2nd pass of the 2 pass assembler.
Initialize ILC and perform other initializations.
Read information generated by 1st pass
Read instruction line.
While not end of file
Do
Evaluate type and replace mnemonic with ISA binary code
Determine operands
If operand reference to literal then
Substitute literal with its storage address.
If label reference then
Replace label with with value or address.
If relocatable reference then
Calculate and note relative address
- determine location relative to beginning of module.
If external reference then
Create proper length empty operand for external references
- zero out appropriate number of bytes
Generate other operands
Write binary translation to object file.
Still not in executable form in most cases.
Write listing to listing file.
Read instruction line.
Endwhile
Perform cleanup including writing relocation and external reference info
to object module for linking.