GATE / CS ARCHIVE

GATE CSE 1992 / QUESTION 3(ii.d)

Local-symbol address resolution pass

Compiler Design · Compiler Phases, Linking & Loading · Full GATE CSE 1992 paper

GATE 1992, Q3(ii.d) Descriptive
Report issue

Compiler Phases, Linking & Loading

Question 3(ii.d), GATE 1992: In a conventional two-pass assembler, in which pass are local-symbol addresses established?
Question 3(ii.d), GATE 1992: In a conventional two-pass assembler, in which pass are local-symbol addresses established?
Question 3(ii.d), GATE 1992: In a conventional two-pass assembler, in which pass are local-symbol addresses established?
Tap to enlarge
Answer & solution

Answer: Pass1 for defining addresses; pass2 for substituting them into uses (no official key was published)

Pass1 advances the location counter and associates each defined label with its address, thereby resolving the address values stored in the symbol table. Pass2 looks up those values when encoding references, especially forward references. Hence the standard matching answer is pass1 when “address resolution” means establishing the local symbol’s address. If it instead means replacing a symbolic operand at a use site with that address, the operation is pass2. The two meanings are explicitly distinguished because the printed wording does not name the phase’s exact suboperation.

Original paper, page 4