retagged by
1 flag 10,889 views
40 votes
40 votes

Which of the following addressing modes permits relocation without any change whatsoever in the code?

  1. Indirect addressing

  2. Indexed addressing

  3. Base register addressing

  4. PC relative addressing

  • 🚩 Edit necessary | 👮 Arjun
retagged by
1 flag

4 Answers

Best answer
45 votes
45 votes

(D) PC relative addressing is the best option. For Base register addressing, we have to change the address in the base register while in PC relative there is absolutely no change in code needed.

edited by
13 votes
13 votes

Ans: D

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 3), 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.

For 4), 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.

ref: https://cs.stackexchange.com/questions/48730/which-addressing-modes-permits-relocation-without-any-change-whatsoever-in-the-c

1 votes
1 votes

Option D, PC relative addressing

w.r.t Morris Mano,

The base register addressing mode is used in computers to facilitate the relocation of programs in memory. When programs and data are moved from one segment of memory to another, as required in multiprogramming systems, the address values of instructions must reflect this change of position. With a base register, the displacement values of instructions do not have to change. Only the value of the base register requires updating to reflect the beginning of a new memory segment.

In PC Relative Addressing Mode, nothing need to  be changed. 

Answer:

Related questions

31 votes
31 votes
8 answers
1
Kathleen asked Sep 25, 2014
10,198 views
Which normal form is considered adequate for normal relational database design?$2NF$$5NF$$4NF$$3NF$
19 votes
19 votes
4 answers
2
Kathleen asked Sep 25, 2014
13,869 views
A counting semaphore was initialized to $10$. Then $6 P$ (wait) operations and $4V$ (signal) operations were completed on this semaphore. The resulting value of the semap...
32 votes
32 votes
3 answers
3
Kathleen asked Sep 25, 2014
9,988 views
When the result of a computation depends on the speed of the processes involved, there is said to becycle stealingrace conditiona time locka deadlock
18 votes
18 votes
4 answers
4