Answered step by step
Verified Expert Solution
Link Copied!

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);

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2014 Nancy France September 15 19 2014 Proceedings Part 2 Lnai 8725

Authors: Toon Calders ,Floriana Esposito ,Eyke Hullermeier ,Rosa Meo

2014th Edition

3662448505, 978-3662448502

More Books

Students also viewed these Databases questions