in CO and Architecture retagged by
928 views
1 vote
1 vote

A two-word instruction is stored in a location $A$. The operand part of instruction holds $B$. If the addressing mode is relative, the operand is available in location

  1. $A+B+2$
  2. $A+B+1$
  3. $B+1$
  4. $A+B$
in CO and Architecture retagged by
928 views

1 comment

option A) A+B+2
0
0

2 Answers

2 votes
2 votes

In relative addressing mode Effective address= Program counter+ Address specified.

Here Program counter= A+2, Address specified.=B

Effective address= A+2+B

Answer: A

edited by

2 Comments

its a check again.
1
1
yes, i missed that 2 word instruction.
0
0
1 vote
1 vote
It is given that instruction size is 2 words, and it’s starting address is A.
When executing the present instruction program counter gets incremented to the address of the next instruction.
So, latest value in PC=A+2.
In the instruction operand value is B, which is used as a offset for the effective address calculation.
So, Effective address= Program counter + Offset.
Here Program counter= A+2, Offset = B
Effective address= A+2+B
Answer:

Related questions