Problem 4 – CALL, RET and the Stack
1. Create the following c code save it as factorial.c
2. Compile it
3. Use a debugger to disassembly the code and analyze instructions
4. Create a break point in main and fact functions
5. Run it
6. Use next or stepi to step into next instruction and analyze the stack in each step needed to calculate the factorial of a provided integer. Provide your observations?
7. Analyze the instructions used in the calculation. Which conditional jump instructions were used?
8. What was the purpose of cmp instruction?
9. Use disas main to disassembly main. How many call instructions are in main?
10. What is the address of fact() function?
11. Disas fact() function. What is the purpose of ret instruction and what is its address?
12. What is the purpose of the call <fact> instruction within this function fact?
13. Attach the screen capture that demonstrates three changes you observed in the stack
Students succeed in their courses by connecting and communicating with an expert until they receive help on their questions
Consult our trusted tutors.