The following pseudo-code describes the actions of the 2-pass assembler. It most closely describes an Intel 80x86 format.

Pass 1

Initialize location counter (lc), symbol table and misc.

read source code line

while not END statement
do

endwhile

Note entry point to program indicated by END

sort literal table and remove duplicates.


Pass 2

Initialize lc to 0 and perform other initializations.

read line temp file created by pass 1

while not end of file
do

endwhile

perform cleanup including writing relocation and external reference info to object module for linking.