Question: The following assembly-code function lets us determine the behavior of the instruction popq %rsp for x86-64: We find this function always returns 0xabcd. What does

The following assembly-code function lets us determine the behavior of the instruction popq %rsp for x86-64:

1 2 3 5 6 7 8 text .globl poptest poptest: movq pushq popa movq movg ret %rap, %rdi $0xabcd %rsp %rap. %rax

We find this function always returns 0xabcd. What does this imply about the behavior of popq %rsp? What other Y86-64 instruction would have the exact same behavior?

1 2 3 5 6 7 8 text .globl poptest poptest: movq pushq popa movq movg ret %rap, %rdi $0xabcd %rsp %rap. %rax %rdi. %rsp Save stack pointer Push test value Pop to stack pointer Set popped value as return value Restore stack pointer

Step by Step Solution

3.31 Rating (151 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

It is even more difficult to imagine why anyone would want to pop to the stack p... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Computer Systems A Programmers Perspective Questions!