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

Consider the following program segment for a hypothetical CPU having three user registers R1, R2 and R3.

Instruction Operation Instruction
Size
(in words)

MOV R1, 5000 ; R1 Memory [5000] 2

MOV R2, (R1) ; R2 Memory [(R1)] 1

ADD R2, R3 ; R2 R2 + R3 1

MOV 6000, R2 ; Memory [6000] R2 2

HALT ; Machine halts 1

Consider that the memory is byte addressable with size 32 bits, and the program has been loaded starting from memory location 1000 (decimal). If an interrupt occurs while the CPU has been halted after executing the HALT instruction, the return address (in decimal) saved in the stack will be

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

The correct option is C 1024

Instruction Instruction Size Location
(Decimal)


MOV R1, 5000 2 1000 to 1007

MOV R0, (R1) 1 1008 to 1011

ADD R0, R3 1 1012 to 1015

MOV 6000, R2 2 1016 to 1023

Halt 1 1024 to 1027


If an interrupt occurs the CPU has been halted after executing the HALT instruction the return address 1024 saved in the stack.

flag
Suggest Corrections
thumbs-up
0
similar_icon
Similar questions
View More
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
The 1905 Revolution
HISTORY
Watch in App
Join BYJU'S Learning Program
CrossIcon