752 views

1 Answer

0 votes
0 votes

Just for info, If nothing is mentioned in question about instruction and address size, It will be safe to assume every Instruction and every Address as 1 WORD long. But in this question it is mentioned clearly.

MOV could be in any one below syntax.

Syntax:- MOV destination,source

The possible combinations of operands are as follows :

 

destination

source

example

register

register

mov Rd,Rs

register

immediate

mov Rd,10#

register

memory

mov Rd,(mem add)

MOV copies the data from the source to the destination. The data can be either a byte or a word.

 

Mov R1, #10  R1<--- 10. This moves Constant 10 value to register R1 without memory reference [Syntax 2]

Mov R2, (R3)  R2 <--- M[(R3)]. This moves data from M[(R3)] memory location present in R3 to R2. This takes 1 memory reference.

Mov (R3), R2   M[(R3)] <--- R2.  This moves content of register R2 to memory location pointed by R3. This takes 1 memory reference.

But above 2 instruction are present inside loop which loops R1=10 times. starting from 10, decrementing by 1 on every iteration.

So total memory reference =  { 2(MOV) × (1 word access/ MOV) } * 10 (times iteration) = 20 memory accesses.

 

edited by

Related questions

0 votes
0 votes
1 answer
1
Anup patel asked Jan 9, 2017
872 views
Difference between Memory Access and memory Reference ?
3 votes
3 votes
0 answers
2
Anirban Biswas asked Jan 2, 2017
615 views
Consider the 2 GHz clock frequency processor used execute the following program segment.Assume that memory reference consumers 4 cycles and ALU operations consumes 2 cycl...
0 votes
0 votes
2 answers
4