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

Consider a processor with byte-addressable memory. Assume that all registers, including Program Counter (PC) and Program Status Word (PSW), are of size 2 bytes. A stack in the main memory is implemented from memory location (0100)16 and it grows upward. The stack pointer (SP) points to the top element of the stack. The current value of SP is (016E)16. The CALL instruction is of two words, the first word is the op-code and the second word is the starting address of the subroutine (one word = 2 bytes).

The CALL instruction is implemented as follows:

The content of PC just before the fetch of a CALL instruction is (5FA0)16. After execution of the CALL instruction, the value of the stack pointer is

A
(016C)16
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
(0170)16
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
(0172)16
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
D
(016A)16
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is C (0172)16

Just before CALL instruction execution, SP contains 016E

While CALL execution:

(i) PC contents are pushed i.e., SP incremented by 2 SP = 0170

(ii) PSW contents are pushed i.e., SP incremented by 2 SP = 0172

The value of stack pointers is (0172)16

flag
Suggest Corrections
thumbs-up
0
similar_icon
Similar questions
View More
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Putting It Together - BODMAS
MATHEMATICS
Watch in App
Join BYJU'S Learning Program
CrossIcon