Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. (7 pts) Given the C functions, GCC generated assembly and partial memory content below, void caller () int x = 200; f (&x, 100);
1. (7 pts) Given the C functions, GCC generated assembly and partial memory content below, void caller () int x = 200; f (&x, 100); Address in hex int *xp, int y) 1: f: 2: pushl%ebp 3: movi %esp, %ebp 4 : mov! 12 (%ebp) , %ecx 5 : movl 8 ( %ebp) , %eax 6:subl 08040030 0804002c 200 08040028 08040024? 08040020Ox0804002c 0804001cRet addr to caller() 08040018Ox08040030 08040014 %ecx, %edx) %ebp, %esp movi 8: popl %ebp 9: ret (3 pts) After line 7 is executed, %esp 1s 0x08040018. what are the values of %ecx, %edx, %ebp? (2 pts) After line 7 is executed, what are the content/values at memory locations 0x0804002c, 0x0 8040024? (2 pt) After line 9 is executed (function f returns), what are the values of %esp, %ebp? a. b. c. 1. (7 pts) Given the C functions, GCC generated assembly and partial memory content below, void caller () int x = 200; f (&x, 100); Address in hex int *xp, int y) 1: f: 2: pushl%ebp 3: movi %esp, %ebp 4 : mov! 12 (%ebp) , %ecx 5 : movl 8 ( %ebp) , %eax 6:subl 08040030 0804002c 200 08040028 08040024? 08040020Ox0804002c 0804001cRet addr to caller() 08040018Ox08040030 08040014 %ecx, %edx) %ebp, %esp movi 8: popl %ebp 9: ret (3 pts) After line 7 is executed, %esp 1s 0x08040018. what are the values of %ecx, %edx, %ebp? (2 pts) After line 7 is executed, what are the content/values at memory locations 0x0804002c, 0x0 8040024? (2 pt) After line 9 is executed (function f returns), what are the values of %esp, %ebp? a. b. c
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started