We have Function callee is called by caller as below left and there assembly cod
ID: 3752974 • Letter: W
Question
We have Function callee is called by caller as below left and there assembly code on the right: caller: push %ebp mov sub $0x18,%esp mov 0xc (%ebp),%eax mov %eax, 0x4(%esp) mov 0x8(%ebp),%eax mov %eax, (%esp) call 0x80483ed mov %eax,-0x4(%ebp) shll 0x2,-0x4(%ebp) mov -9x4(%ebp),%eax leave ret %esp, %ebp oid caller(int x, int int z; z-callee(x,y) return; int callee(int x, int y) callee push %ebp mov mov 0x8(%ebp),%eax cmp 0xc (%ebp),%eax ile 0x80483fd mov 0x8 (ebp),eax if (xxy) %esp, %ebp return x else return y; jmp x8048400 0xc (%ebp),%eax mov pop ret %ebp When caller starts executing(before push %ebp), we have %esp: Oxbffff18c %ebp: 0xbffff1a8 What value does %esp get when callee starts executing? Select one a. 0xbfffi19c b. 0xbfff16c , 0xbffff13c d. Oxbffff 188Explanation / Answer
program adds data to the stack, the stack grows downward from high memory to low memory.
When items removed from the stack, stack shrinks upward from low to high memory.
When a word value is pushed onto the stack,
the assembler decreases the esp (Stack Pointer) register by 4.
hence esp = esp - 4;
bffff18c - 00000004 = bffff188
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.