in Compiler Design
1,318 views
1 vote
1 vote
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.3k views

5 Comments

@srestha i think 2nd statement is false 

http://users.cis.fiu.edu/~downeyt/cop3402/two-pass.htm

1
1

no @Sonam check these lines

scan the code twice. The first time, just count how long the machine code instructions will be, just to find out the addresses of all the labels. Also, create a table that has a list of all the addresses and where they will be in the program. This table is known as the symbol table.

0
0
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

2 votes
2 votes
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