write line to intermediate file read next line end( if START) else initialize LOCCTR to 0 While OPCODE != do „END‟ begin if this is not a comment line then beg if there is a symbol in the LABEL field then begin search SYMTAB for LABEL if found then set error flag (duplicate symbol) else (if symbol) search OPTAB for OPCODE if found then add 3 (instr length) to LOCCTR else if OPCODE = then „WORD‟ add 3 to LOCCTR else if OPCODE = then „RESW‟ add 3 * #[OPERAND] to LOCCTR else if OPCODE = then „RESB‟ add #[OPERAND] to LOCCTR else if OPCODE = then „BYTE‟ begin find length of constant in bytes add length to LOCCTR end else set error flag (invalid operation code)
write line to intermediate file read next line end( if START) else initialize LOCCTR to 0 While OPCODE != „END‟ do begin if this is not a comment line then beg if there is a symbol in the LABEL field then begin search SYMTAB for LABEL if found then set error flag (duplicate symbol) else (if symbol) search OPTAB for OPCODE if found then add 3 (instr length) to LOCCTR else if OPCODE = „WORD‟ then add 3 to LOCCTR else if OPCODE = „RESW‟ then add 3 * #[OPERAND] to LOCCTR else if OPCODE = „RESB‟ then add #[OPERAND] to LOCCTR else if OPCODE = „BYTE‟ then begin find length of constant in bytes add length to LOCCTR end else set error flag (invalid operation code)
UNIT-32.docx