CameraIcon
CameraIcon
SearchIcon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Consider the following program segment. Here R1, R2 and R3 are the general purpose registers

Instruction Operation Instruction size
(no.of words)

MOV R1, (3000) R1 M[3000] 2

LOOP:

MOV R2, M[R3] R2 M[R3] 1

ADD R2, R1 R2 R1 + R2 1

MOV (R3), R2 M[R3] R2 1

INC R3 R3 R3 + 1 1

DEC R1 R1 R1 - 1 1

BNZ LOOP Branch on not zero 2

HALT Stop

Assume that the content of memory location 3000 is 10 and the content of the register R3 is 2000. The content of each of the memory locations from 2000 to 2010 is 100. The program is loaded from the memory location 1000. All the numbers are in decimal.

Assume that the memory is byte addressable and the word size is 32 bits. If an interrupt occurs during the execution of the instruction "INC R3", what return address will be pushed on to the stack?

A
1020
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
1024
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
C
1005
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
1040
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is B 1024
Location Operation

1000 - 1007 R1 M[3000]

1008 - 1011

1012 - 1015 R2 M [R3]

1016 - 1019 R2 R1 + R2

1020 - 1023 M[R3] R2

1024-1031 R3 R3 + 1

So if an interrupt occurs during the execution of the instruction "INC R0, the return address 1024 will be pushed on to the stack.

flag
Suggest Corrections
thumbs-up
0
similar_icon
Similar questions
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Fear of the Dark
QUANTITATIVE APTITUDE
Watch in App
Join BYJU'S Learning Program
CrossIcon