• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 1 fuera de 1 páginas
Resumen

COMPACT SUMMARY FOR TOPIC 3: Assembly Language

Document preview thumbnail
Vista previa 1 fuera de 1 páginas

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.

Vista previa del contenido

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.

Información del documento

Nivel de Estudio
Tema
Subido en
15 de agosto de 2024
Número de páginas
1
Escrito en
2022/2023
Tipo
Resumen
$4.79

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Vendido
0
Seguidores
0
Artículos
14
Última venta
-




Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes