• retagged by
2 flags 20,384 views
60 60 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
  • 🚩 Edit necessary | 👮 0shan

6 Answers

Best answer
75 75 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
18 18 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

5 5 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. 

2 2 votes
c) Base Register Addressing

d) PC- relative addressing

Above is the correct option.
0 0 votes

PC (Program Counter) Relative Addressing Mode permits relocation without any change whatsoever in the code.

Therefore, Option D is correct.

Answer:
Position:
Show:

Related questions

49 49 votes
10 answers 10 answers
22.3k
22.3k views
Kathleen asked Sep 25, 2014
22,283 views
Which normal form is considered adequate for normal relational database design?$2NF$$5NF$$4NF$$3NF$
24 24 votes
5 answers 5 answers
17.5k
17.5k views
Kathleen asked Sep 25, 2014
17,507 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...
42 42 votes
5 answers 5 answers
15.5k
15.5k views
Kathleen asked Sep 25, 2014
15,478 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
24 24 votes
4 answers 4 answers
7.4k
7.4k views
Kathleen asked Sep 25, 2014
7,436 views
Which of the following is an example of a spooled device?The terminal used to enter the input data for the C program being executedAn output device used to print the outp...