GATE / CS ARCHIVE

GATE CSE 1998 / QUESTION 1.28

Relocation constants for concatenated modules

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

GATE 1998, Q1.28 1 mark · MCQ
Not in GATE 2027 syllabusReport issue

Compiler Phases, Linking & Loading

Question 1.28, GATE 1998: Modules of lengths 200, 800, 600, 500 words are loaded consecutively in that order from zero. Find their relocation constants.
Tap to enlarge
Your answer
Answer & solution

Answer: B: 0, 200, 1000, 1600 (no official key was published)

The first module starts at 0. The next starts after its 200 words, at 200. The third begins after 200+800=1000 words, and the fourth after 200+800+600=1600. These starting addresses are the relocation constants for modules assembled relative to zero. Thus B. The final 500-word length determines the image’s end, not an additional start. A nonzero loading base would add the same base to all four constants.

Original paper, page 3