Answered step by step
Verified Expert Solution
Question
1 Approved Answer
WA push mov sub push push push lea ebp ebp, esp esp,40h ebx esi ed mov 199 ( 1, 125, #12 ). Stack discipline: Consider
WA push mov sub push push push lea ebp ebp, esp esp,40h ebx esi ed mov 199 ( 1, 125, #12 ). Stack discipline: Consider the following C code and its corresponding 32-bit x86 machine code. Please complete the stack diagram on the following M fact: 00401020 55 00401021 88 EC 00401023 83 EC 40 00401026 53 00401027 56 00401028 57 00401029 8D 70 CO 0040102C B9 10 00 00 00 00401031 B8CC CC CCCC 00401036 F3AB 00401038 83 7D 08 01 0040103C 7505 0040103E 8B 45 08 00401041 EB 15 00401043 88 45 08 00401046 83 E8 01 00401049 50 0040104AE8 BB FF FF FF 0040104F 83 C4 04 00401052 88 4D 08 00401055 OF AF C1 00401058 5F 00401059 SE 0040105A5B 0040105B 83 C4 40 0040105E 3B EC 00401060 E86B 00 00 00 00401065 88 E5 00401067 5D 00401068 C3 edi, [ebp-40h) ecx 10h eax,0cccccccch dwordptred dword ptr [ebp+8),1 fact+23h (00401043) fact +386 (00401058) eax dword ptr febp+8] eax dword ptr [ebp+8] eax 1 eax @ILT+5(_fact) (0040100a) esp,4 ecxdword ptr [ebp+8] eax.ecx www edi esi WA ebx esp,40h ebp, esp chkesp (00401000) esp.ebp ebp W mov rep stos cmp jne mov jmp mov WANA sub push call add mov imul pop pop pop add cmp call mov WANA pop ret page. :, : : : : *: : int fact(int n) { if (n == 1) return n; else return n * fact(n-1); } WA push mov sub push push push lea ebp ebp, esp esp,40h ebx esi ed mov 199 ( 1, 125, #12 ). Stack discipline: Consider the following C code and its corresponding 32-bit x86 machine code. Please complete the stack diagram on the following M fact: 00401020 55 00401021 88 EC 00401023 83 EC 40 00401026 53 00401027 56 00401028 57 00401029 8D 70 CO 0040102C B9 10 00 00 00 00401031 B8CC CC CCCC 00401036 F3AB 00401038 83 7D 08 01 0040103C 7505 0040103E 8B 45 08 00401041 EB 15 00401043 88 45 08 00401046 83 E8 01 00401049 50 0040104AE8 BB FF FF FF 0040104F 83 C4 04 00401052 88 4D 08 00401055 OF AF C1 00401058 5F 00401059 SE 0040105A5B 0040105B 83 C4 40 0040105E 3B EC 00401060 E86B 00 00 00 00401065 88 E5 00401067 5D 00401068 C3 edi, [ebp-40h) ecx 10h eax,0cccccccch dwordptred dword ptr [ebp+8),1 fact+23h (00401043) fact +386 (00401058) eax dword ptr febp+8] eax dword ptr [ebp+8] eax 1 eax @ILT+5(_fact) (0040100a) esp,4 ecxdword ptr [ebp+8] eax.ecx www edi esi WA ebx esp,40h ebp, esp chkesp (00401000) esp.ebp ebp W mov rep stos cmp jne mov jmp mov WANA sub push call add mov imul pop pop pop add cmp call mov WANA pop ret page. :, : : : : *: : int fact(int n) { if (n == 1) return n; else return n * fact(n-1); }
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