in Compiler Design
1,203 views
0 votes
0 votes
State whether the following statements are True or False with reasons for your answer:

A two pass assembler uses its machine opcode table in the first pass of assembly.
in Compiler Design
by
1.2k views

4 Comments

This para also suggests that B is false right?
0
0
edited by

In question MOT(machine opcode table)  is asked and Not symbol table ….It is used in both the passes hence true.

for pass 1 – it is used to get length of mnemonics and modify location counter.

for pass 2- it is used to obtain respective  machine code .

 

source- http://bcaq.blogspot.com/2013/02/draw-flowchart-for-pass-1-assembler-and.html

http://www.ques10.com/p/3118/with-reference-to-assembler-explain-following-ta-1/ 

 

Note-symbol table  and Literal table is created in first pass and it is used in second pass

 

2
2
b is false i think
0
0

1 Answer

1 vote
1 vote
Best answer
In the first pass of the assembler, $\textsf{Machine Opcode Table}\; (\textsf{MOT})$ is used to get the opcode size of the mnemonics which is needed to increment the $\textsf{LOCCTR}$ which is needed to determine the address of the labels. The labels and their corresponding addresses go to the $\textsf{Symbol Table}$ which is thus populated during the first phase and used in the second phase whereas $\textsf{MOT}$ is not modified but just used in the two phases – in the second phase to convert menmonic to opcode.
selected by
by

Related questions