4.2. Assembly Language Flashcards
Assembly language
Low-level programming language with
instructions made up of an op code and an operand
Machine code
Code written in binary that uses the
processor’s basic machine operations
Relationship between machine and assembly language
Every assembly language instruction (source code) translates into exactly one machine code instruction
(object code)
Symbolic addressing
- Symbols used to represent operation codes
- Labels can be used for addresses
Absolute addressing
A fixed address in memory
Assembler
- Software that changes assembly language into
machine code for the processor to understand - The assembler replaces all mnemonics and labels with
their respective binary values (that are predefined
before by the assembler software)
One pass assembler
- Assembler converts mnemonic source code into
machine code in one sweep of program - Cannot handle code that involves forward referencing
Two pass assembler: software makes 2 passes through code
On the first pass:
* Symbol table created to enter symbolic addresses
and labels into specific addresses
* All errors are suppressed
On the second pass:
* Jump instructions access memory addresses via
table
* Whole source code translates into machine code
Error reported if they exist
LDM
Immediate: Load n into ACC
LDD
Direct: load contents at
address into the ACC
LDI
Indirect: load contents of
address at given address
into ACC
LDX
Indexed: load contents of
given address + IR into ACC
STO
Store contents of ACC into
address
ADD
Add contents of register to
ACC
INC
Add 1 to contents of the
register