100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Summary

COMPACT SUMMARY FOR TOPIC 3: Assembly Language

Rating
-
Sold
-
Pages
1
Uploaded on
15-08-2024
Written in
2022/2023

This document offers detailed revision notes for Topic 3 of the OCR A-Level Computer Science syllabus, focusing on Assembly Language. It explains the fundamentals of the Little Man Computer (LMC) model, a simplified representation of a computer that operates using assembly and machine code. Key concepts include how mnemonics like LDA, STA, and INP function within a program, the role of opcodes and operands in instruction execution, and the distinction between high-level and low-level languages. The notes also cover branching and its use in creating loops and conditions in assembly programs. Perfect for students seeking to understand the basics of assembly language and its application.

Show more Read less
Institution
OCR








Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
August 15, 2024
Number of pages
1
Written in
2022/2023
Type
Summary

Subjects

Content preview

Compute science—A Level—Topic 3 Assembly Language
Mnemonics and their functions
The Little Man Computer (LMC) is a instructional model of a computer, developed
by Dr Stuart Madnick, it models a simple Von Neumann architecture and can be Mnemonic/Machine code Instruction
programmed in Machine or assembly code.
LDA (0101 xxxxxxx) Load address to ACC.

STA (0011 xxxxxxx) Store ACC to address.
ADD (0001 xxxxxxx) Add address to ACC.
SUB (0010 xxxxxxx) Sub address to ACC.
INP (1001 0000001) Input from keyboard to ACC.
OUT (1001 0000010) Output from ACC to display.
BRA (0110 xxxxxxx) Branch always
BRP (0111 xxxxxxx) Branch if ACC is >=0
BRZ (1000 xxxxxxx) Branch if ACC = 0
DAT (The data) Declares a variable
HLT (00000000000) Ends the Program
The table above shows the mnemonics and their
What does the program do? instructions. Mnemonics are terms that are
either names or symbols used to define or spec-
What are branches used for? On the left side, we have the assembly language code ify a computing function, this is important as it
“BRA” , “BRP” & “BRZ” are which are known as mnemonics (“INP”,STA”). First, doesn't require the programmer to remember
branches, in LMC, branches the program asks for an input and it will store it in vari- the machine code( in binary) so becomes more
are used to set the contents able “A” which could be anywhere in the RAM (on the readable and easier for them.
of the ACC to a given label/ right), this will repeat for variable “B” and “C”. The Opcode and Operand
address. They can be used “LDA” mnemonic loads variable “C” into the Accumula- • The opcode is the part of the binary which
for creating loops or condi- tor located in the CPU, the “OUT” then outputs the
tions. data stored in the ACC which in this case is “C”, it will tells the computer what to do.
repeat this for “B” and “C” and then the program will • The Operand is the part of the binary which
end using the Mnemonic “HLT”. The “DAT” at the tells the computer what to do it to.
bottom basically declares the variables.
In summary, the program asks for 3 inputs then out- ADD: 0001 0010011
puts them in reverse order.
It will add the value stored in memory
address 19 to the ACC.
Label
• If value in ACC is positive, High level language
go to loop (which starts at A language designed to help express the computer program in a way that reflects the problem being
the output mnemonic). solved, high level language programs are far easier to read than low level language as high level language
tends to use more of the English language instead of Mnemonics . Examples include: Python, Java Script
and C#.




Low level language Assembly language
A Language that is very closely A Language that is very closely related to Machine code. This is
related to Machine code. Exam- an example of a low level language, this language uses Mnemon-
ples of low level language: As- ics which are either names or symbols to define or specify a func-
sembly language & Machine tion so this isn’t as understandable as high level language howev-
code. er it is a lot easier than just binary numbers (machine code).




Machine code
A Language which uses binary with a set of all possible instructions made
available by the hardware design of a particular processor, all languages
above this have a translator which translate ultimately translates all
code into machine code.
£2.99
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
JackJordi05

Also available in package deal

Thumbnail
Package deal
-
14 2024
£ 47.86 More info

Get to know the seller

Seller avatar
JackJordi05 Cranfield University
View profile
Follow You need to be logged in order to follow users or courses
Sold
0
Member since
1 year
Number of followers
0
Documents
14
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions