367 views

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

### 1 comment

In this question, the meaning of each instruction should be specified clearly in the question itself...

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

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 as value of R5 .

Hope it clears :)
Are these standard instructions, because mostly the result is saved in the first register ie for example if instruction is ADD R1 R2, then the sum of R1 and R2 is saved in R1, how are we supposed to know in which register the answer is saved or data is flowing from left to right or right to left,

Move #3000, R5 -------->move R5  to #3000, why is this not reverse ie move #3000 to R5 and  #3000 can

Store R5,30(R1,r2)-------> again same question , why data flow is not in reverse?
sir according to immediate addressing mode MOVE #3000, R5  should means that the immediate value of 3000 is transferred to R5 ... where i am wrong.. please reply.
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$

1. Indexed Addressing Mode (Registers act as index, and a constant acts as base address)