Answer: 50 to 50
Explanation:
Consider following memory cells
Address
|
Value
|
5000
|
10
|
3000
|
50
|
3001
|
50
|
3002
|
50
|
3003
|
50
|
3004
|
50
|
3005
|
50
|
3006
|
50
|
3007
|
50
|
3008
|
50
|
3009
|
50
|
3010
|
50
|
After Executing till 3 instruction we have the following value in Registers
After 4th instruction, M[R3] ( M[3000]) will be updated as 50 + 10 = 60
Address
|
Value
|
5000
|
10
|
3000
|
60
|
3001
|
50
|
3002
|
50
|
3003
|
50
|
3004
|
50
|
3005
|
50
|
3006
|
50
|
3007
|
50
|
3008
|
50
|
3009
|
50
|
3010
|
50
|
R3 => R3 +1 => 3001
R1 = 9 Hence it is Nonzero; It will Branch to 1004 (which is instruction 2)
- R2 = 50
R2= R1+R2 = 59
M[R3] ( M[3001]) will be updated as 59.
Address
|
Value
|
5000
|
10
|
3000
|
60
|
3001
|
59
|
3002
|
50
|
3003
|
50
|
3004
|
50
|
3005
|
50
|
3006
|
50
|
3007
|
50
|
3008
|
50
|
3009
|
50
|
3010
|
50
|
R1 = R1 - 1 => 9-1 =>8 Hence it is Nonzero; It will Branch to 1004 (which is instruction 1)
If you try to observe the Pattern
Here M[3001] is updated as 59
M[3002] will be updated as 58
M[3003] will be updated as 57
M[3004] will be updated as 56
M[3005] will be updated as 55
M[3006] will be updated as 54
M[3007] will be updated as 53
M[3008] will be updated as 52
M[3009] will be updated as 51
R1 = 0
M[3010] will be updated as 50