GATE / CS ARCHIVE

GATE CSE 1992 / QUESTION 3(ii.a)

Object generation pass

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

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

Compiler Phases, Linking & Loading

Question 3(ii.a), GATE 1992: In a conventional two-pass assembler, in which pass is object code generated?
Question 3(ii.a), GATE 1992: In a conventional two-pass assembler, in which pass is object code generated?
Question 3(ii.a), GATE 1992: In a conventional two-pass assembler, in which pass is object code generated?
Tap to enlarge
Answer & solution

Answer: Pass2 (no official key was published)

Pass1 establishes layout and collects symbol addresses, including forward definitions not yet known at their first use. Pass2 revisits instructions with those tables available and encodes opcodes, addresses and relocation information into object output. Thus final object generation is assigned to pass2. An implementation could emit some provisional bytes earlier, but that optimization does not change the conventional two-pass division asked here. The answer concerns final object code, not the intermediate source representation.

Original paper, page 4