$24
1. (15 points)
A. (10 points) Write a recursive procedure in assembly language that take a 16-bit unsigned integer,
n as input, and computer the following series:
1 +2+3+ .. + n
• The procedure stores the result in EAX register.
• Use stack frame to implement the procedure.
• Run your program using the debugger to verify your answers.
◦ Use Step Into instead of Step Over to keep track of the stack, ESP, EBP, EIP during debugging.
◦ Rename the asm file using your last name as Lastname.asm and submit it.
◦ Screenshot of the code
◦ Then run the code until you reach INVOKE ExitProcess, 0
◦ Then take a screenshot of the EAX register containing the result.
B. (5 point) How many bytes of stack space will be used by the Factorial subroutine just before it executes the first return statement, when n=3?
o Submit the answers to B in the following:
◦ Lastname.pdf
Note:
• Submit your source code by only uploading .ASM file and your pdf file using iCollege in the respective assignment dropbox:
• Lastname1.ASM
• Comment header for .ASM files:
Class: CSC3210
Assignment#: 7
Description: This program ………….
• Follow the program standards as presented in your book.
• Pay more attention to code comments and consistent indentation.
• Create a new project for every question. Do not use one project with multiple .asm files.