retagged by
678 views
1 votes
1 votes

Registers $R1$ and $R2$ of a computer contain the decimal values $1300$ and $4500$. The following instructions are run:

  1. $\text{ Load 20(R1),R5}$
  2. $\text{Move #3000,R5}$
  3. $\text{Store R5,30(R1,R2)}$

The effective address of the memory operand is ___________.

retagged by

2 Answers

Best answer
5 votes
5 votes
There are 2 registers given in the question R1 and R2 .

R1 have decimal value 1300 and R2  contain decimal value   4500.

Now there are 3 instructions given in assembly languages.

Load 20(R1),R5           means load the value of R1 + 20  into R5 . source R1 destination R5 .
 Move #3000,R5          means move that R5 value into memory location 3000.
 Store R5,30(R1,R2)    means value of R1+ R2+ 30 is stored at  R5 .

so R1 + R2 is 1300 + 4500 = 5800 and 5800 + 30  = 5830

so after 3rd instruction it becomes 5830

 

so value of R5 is 5830 .
selected by
0 votes
0 votes
  1.  Load 20(R1),R5
    20 works as the base address and R1 works as the index register.
    R5 gets the value: $20+1300=1320$
     
  2. Move #3000,R5
    Now, R5 is overwritten by the number $3000$
     
  3. Store R5,30(R1,R2)
    R1 and R2 both act as index registers, while the base address is 30.
    R1 again gets a value: $30+1300+4500=5830$

Addressing Modes used respectively

  1. Indexed Addressing Mode (Registers act as index, and a constant acts as base address)
  2. Immediate Addressing Mode
  3. Indexed Addressing Mode
Answer:

Related questions

1 votes
1 votes
3 answers
3