GATE / CS ARCHIVE

GATE CSE 1998 / QUESTION 1.19

Relocation without modifying instructions

Computer Organization & Architecture · Instructions & Addressing Modes · Full GATE CSE 1998 paper

GATE 1998, Q1.19 1 mark · MCQ
Report issue

Instructions & Addressing Modes

Question 1.19, GATE 1998: Which addressing mode permits relocation without changing code: indirect, indexed, base-register, PC-relative?
Tap to enlarge
Your answer
Answer & solution

Answer: C for general base relocation; D also supports relative references (no official key was published)

Base-register addressing forms effective address=base+stored displacement. Moving the program requires changing the base register, leaving its instruction displacements unchanged, which explains intended C. PC-relative addressing also preserves references within a uniformly moved block because both target and current PC increase by the same relocation amount; their difference stays fixed. Thus D has relocation capability too, though it is not a general replacement for every external/data reference. The scope of relocation is unstated, so C is the standard general mechanism rather than the only conceivable invariant addressing form.

Original paper, page 2