retagged by
14,969 views
45 votes
45 votes

The most relevant addressing mode to write position-independent codes is:

  1. Direct mode
  2. Indirect mode
  3. Relative mode
  4. Indexed mode
retagged by

6 Answers

Best answer
32 votes
32 votes

(C) Relative Mode since we can just change the content of base register if we wish to relocate.

REFERENCE: https://gateoverflow.in/155280/self-doubt-computer-organization?show=155312

edited by
8 votes
8 votes

Position Independent Code: This code can be placed anywhere in the primary memory, executes properly regardless of its absolute address. This differs from relocatable code which requires a program loader to modify program before execution so it can run from a particular memory location.

Relative Addressing mode is suitable for Program-Independent-Code (PIC) because Effective  Address can be calculated by adding displacement to the PC.

Indexed mode can not be used because Base Address is provided in the instructions itself. Whenever position of code changes, address in  all instructions needs to be changed. However, Base Register Mode (BRM) can be used to write position independent code because in BRM base is present in base register while index or offset is present in the instructions.

ANSWER: (C) Relative Mode

3 votes
3 votes

Answer:- C            " PC Relative Mode "

Code that is position independent will consist of only one segment of code and have it's data also contained within this segment (or section). and PC relative AM is intra segment jump while Base addressing mode is inter segment jump . so, PC Relative mode is the best suitable case

reference: https://stackoverflow.com/questions/22889719/what-is-relocatable-and-absolute-machine-code

1 votes
1 votes
relative mode
Answer:

Related questions

28 votes
28 votes
3 answers
1
makhdoom ghaya asked Nov 15, 2016
4,175 views
The Boolean expression $A \oplus B \oplus A$ is equivalent to$AB + \overline {A}\;\;\overline B$$\overline{A}\;B+A\;\overline{B}$$B$$\overline{A}$
11 votes
11 votes
1 answer
2
makhdoom ghaya asked Nov 14, 2016
1,613 views
Specify an adjacency-lists representation of the undirected graph given above.
3 votes
3 votes
1 answer
3
makhdoom ghaya asked Nov 8, 2016
2,390 views
The refreshing rate of dynamic RAMs is in the range of$2$ microseconds$2$ milliseconds.$50$ milliseconds$500$ milliseconds