Use a debugger to disassembly the code and analyze instructions
Ask Expert

Be Prepared For The Toughest Questions

Practice Problems

Use a debugger to disassembly the code and analyze instructions

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

Hint
Computer3)Program analysis is the procedure of automatically examining a computer program's behavior in relation to a property like correctness, robustness, safety, and liveness. The two main topics of program analysis are program optimization and program accuracy....

Know the process

Students succeed in their courses by connecting and communicating with
an expert until they receive help on their questions

1
img

Submit Question

Post project within your desired price and deadline.

2
img

Tutor Is Assigned

A quality expert with the ability to solve your project will be assigned.

3
img

Receive Help

Check order history for updates. An email as a notification will be sent.

img
Unable to find what you’re looking for?

Consult our trusted tutors.

Developed by Versioning Solutions.