Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Question 7 [10pt] The following figure shows the contents of the stack frame ass

ID: 3905688 • Letter: Q

Question

Question 7 [10pt] The following figure shows the contents of the stack frame associated with the procedure immediately after the procedure is called and then jumps to the corresponding procedure. EAX and EDX represent stored registers using USES Stack 0xFFFF0100 0xFFFF0OFC OxFFFFOOF8 OxFFFF00F4 0xFFFF0OFO 0xFFFF00EC 0xFFFF00E8 0xFFFF00E4 return addr 0xFFFF0200 EAX EDX 0xFFFF0100 4 10 a) b) c) [lpt] How many parameters in this procedure? [lpt] How many local variables in this procedure? [lpt] What is ESP value in the above program?

Explanation / Answer

Answer is as follows :

a) Parameters in given procedure :

There are only two parameters in the given data i.e. 4 and 10 at locations 0xFFFF00E8 and 0xFFFF00E4 respectively because these are present after return address and saved value of EBP i.e. 0xFFF0100.

b) local variable are :

there is only one local variable i.e. 8 present at location 0xFFFF0100. We know that we decrement the size of Stack Pointer according to the size of local variable. So here the size is decrement by 4 and also data 8 is of 4 bytes i.e. 00000000000000000000000000001000. i.e. equal to 8.

c) ESP value

In given set of program we know that ESP is updated after push instruction by decrement by 4 bytes of equal to size of local variable.

so here after decrement the address by 4 bytes at last we get the value of ESP is 0xFFFF00E4

if there is any query please ask in comments...

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote