Question: Pass 1 : begin read first input' line if OPCODE = 'START' then begin save # [ OPERAND ] as starting address initialize LOCCTR to
Pass :
begin
read first input' line
if OPCODE 'START' then
begin
save #OPERAND as starting address
initialize LOCCTR to starting address
write line to intermediate file
read next input line
end if START
else
initialize LOCCTR to
while OPCODE 'END' do
begin
if this is not a comment line then
begin
there is a symbol in the LABEL field then
begin
search SYMTAB for LABEL
if found then
set error flag duplicate symbol
else
insert LABEL LOCCTR into SYMTAB
end if symbol
search OPTAB for OPCODE
if found then
add instruction length to LOCCTR
else if OPCODE 'WORD' then
add to LOCCTR
else if OPCODE 'RESW' then
add #OPERAND to LOCCTR
else if OPCODE 'RESB' then
add # OPERAND to LOCCTR
else if OPCODE then
begin
find length of constant in bytes
add length to LOCCTR
end if BYTE
else
set error flag invalid operation code
end if not a comment
write line to intermediate file
read next input line
end while not END
write last line to intermediate file
save LOCCTR starting address as program length
and Pass
Figure a Algorithm for Pass of assembler.
Write c code for this algorithm please i want simple code
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
