GATE / CS ARCHIVE

GATE CSE 1992 / QUESTION 1(viii)

Instruction location counter

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

GATE 1992, Q1(viii) Other
Report issue

Compiler Phases, Linking & Loading

Question 1(viii), GATE 1992: What is the purpose of an assembler’s instruction location counter?
Question 1(viii), GATE 1992: What is the purpose of an assembler’s instruction location counter?
Tap to enlarge
Answer & solution

Answer: Track the address assigned to the next instruction or data item (no official key was published)

The location counter starts from the selected origin and advances by each assembled instruction or reserved data size. A label encountered at a statement is assigned the current location, enabling the symbol table to record its address. Directives such as ORG can change the counter explicitly. This is a compile/assembly-time layout variable, not the processor’s runtime program counter. Its final difference from the origin can also help determine section length, subject to separate sections and origin changes.

Original paper, page 1