GATE / CS ARCHIVE

GATE CSE 1993 / QUESTION 7.6

First pass of a two-pass assembler

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

GATE 1993, Q7.6 2 marks · MSQ
Not in GATE 2027 syllabusReport issue

Compiler Phases, Linking & Loading

Question 7.6, GATE 1993: Which first-pass tasks apply: allocate literal space,compute program length,build symbol table,generate load/store machine code?
Tap to enlarge
Select all that apply
Answer & solution

Answer: A,B,C in the standard assembler model (no official key was published)

Pass one tracks the location counter and instruction/data sizes. It assigns addresses to labels, records symbol values, and determines the total layout and length. Literal-pool placement also reserves space and assigns literal addresses when the pool is processed. Final instruction encoding is normally deferred to pass two, when forward symbol references can be resolved, so generating all load/store code is not a standard first-pass task. The answer assumes the ordinary two-pass design, not a hybrid implementation that opportunistically emits some instructions early.

Original paper, page 7