Assemblers
Used to translate a user readable program into ISA binary code.
Differs from high-level languages.
Always translated.
Generally 1 to 1 relation between symbol and ISA instruction.
Two steps.
Assembling - convert user specified symbols into a module of
ISA instruction .
Link - link the resulting instructions in new module to ISA instructions
in other modules already prepared.
The assembler step usually consists of 2 passes.
1st pass - find out how everything is described.
Recognized any user defined labels and what the refer to.
Recognize each instruction used and keep track of size of resulting
code.
Record literals for storage at end of module. (LTORG)
Recognize how macros are defined.
Recognize references to other modules
Recogize blocks of code that can be moved around.
Build one or more tables containing the recognized information.
2nd pass - resolve all of the code relations within the module.
Evaluate the instruction
Replace instructions with appropriate binary values.
Literals with their storage address.
Label references with their addresses.
The