1 1 vote A stack based CPU executes the instruction. Memory location $500$ contain $0X 88$ and memory location $700$ contain $0X37$. The stack pointer is at $0X003F$ The instruction are as follows: $I_{1}:PUSH$ $500$ $I_{2}:PUSH$. $700$ $I_{3}:ADD$ $I_{4}:POP$. $600$ $I_{5}:PUSH$ $300$ Now which of the following is correct? $A)$ Stack pointer will be $0X0040$ after executing instructions. $B)$ Memory location $0X40$ contain $0X88$ after execution of instruction. $C)$ Memory location $600$ contain $0XBF$ after execution of instruction. $D)$ Both $a)$ and $c)$ Data Structures made-easy-test-series data-structures stack + – srestha 1.4k views answer comment Share Follow Print See all 3 Comments 3 3 Comments reply Shagun Singh commented Oct 16, 2019 i moved by srestha Oct 16, 2019 reply Follow flag Option (C): 0 0 replyShare Madhulika kumari commented Dec 19, 2019 reply Follow flag As there will not be any change in memory location 40 after the execution of the above set of instructions so option B) should also be true... and memory location 600 contains 0XBF so C) is true. i.e. both B) & c) should be the correct Answers. 0 0 replyShare Shagun Singh commented Dec 29, 2019 reply Follow flag Since 0X88 is initially stored at memory location 500 then how will 0X88 move to 0X40. Memory location 0X40 never stored 0X88 0 0 replyShare Please log in or register to add a comment.
0 0 votes since the memory location 600 is popped when the stack pointer was pointing to the sun 0X88 so clearly the location of 0X88 is 600. Therefore option “c” is correct. rish1602 answered Feb 2, 2021 rish1602 comment Share Follow 0 reply Please log in or register to add a comment.