CameraIcon
CameraIcon
SearchIcon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 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 word addressable with size 32 bits and the program has been loaded starting from memory location 1000 (decimal). If an interrupt occurs during the ADD instruction, what will be the return address pushed on to the stack.

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

The correct option is B 1004
________________________________________
Instruction Instruction Location
Size (decimal)
________________________________________

MOV R1,5000 2 1000 to 1001

MOV R2,(R1) 1 1002

ADD R2,R3 1 1003

MOV 6000,R2 2 1004 - 1005

Halt 1 1006
___________________________________

The return address pushed onto the stack is 1004.

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