Aptitude | GATE CS 1998 | Question 19
Which of the following addressing modes permits relocation without any change whatsoever in the code?
(A) Indirect addressing
(B) Indexed addressing
(C) Base register addressing
(D) PC relative addressing
Answer: (D)
Explanation: Code relocation can be done whenever addresses are not directly specified in the program (absolute), but are relative to some variable or other modifiable source.
For (C), base addressing, a register points to the base of the structure and the effective address is obtained by computing an offset from the base. The base address register can be loaded at run time to point to the base of the structure so the code doesn’t have to be modified. In this addressing, we may have to change the address in the base register.
For (D), PC relative, the effective memory address is obtained by computing an offset from the current PC. No matter where the code is loaded in memory, the offsets are always the same so the code needs no modification. In this addressing, there is absolutely no change in code needed.
So, option (D) is correct.
Quiz of this Question
Recommended Posts:
- Aptitude | GATE CS 1998 | Question 20
- Aptitude | GATE CS 1998 | Question 36
- Aptitude | GATE CS 1998 | Question 41
- Aptitude | GATE CS 1998 | Question 40
- Aptitude | GATE CS 1998 | Question 37
- Aptitude | GATE CS 1998 | Question 38
- Aptitude | GATE CS 1998 | Question 39
- Aptitude | GATE CS 1998 | Question 42
- Aptitude | GATE CS 1998 | Question 43
- Aptitude | GATE CS 1998 | Question 44
- Aptitude | GATE CS 1998 | Question 45
- Aptitude | GATE CS 1998 | Question 46
- Aptitude | GATE CS 1998 | Question 35
- Aptitude | GATE CS 1998 | Question 21
- Aptitude | GATE CS 1998 | Question 22



