Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The listing of an assembly subroutine factorial written for the PIC24FJG4GA002 which recursively computes the factorial, n!, for an integer n is shown on the
The listing of an assembly subroutine factorial written for the PIC24FJG4GA002 which recursively computes the factorial, n!, for an integer n is shown on the following page. At the time the subroutine is called w15 is 0x800. The subroutine is invoked with to compute the factorial of 3. #0x3, w0 factorial mov.w ; argument is passed in wo rcall Assume the microcontroller will operate with a Fosc of 16 MHz for an instruction cycle time of 62.5 ns (a) Register w15 is the stack pointer. How much stack is used (number of bytes) for a single call to subroutine factorial? What is put in each location of the stack? (b) The subroutine factorial computes the factorial recursively. What is the total amount of data memory (bytes) used to compute the factorial of 3? (c) How long does it take to compute the factorial of 3 with this subroutine? (d) Where is the result computed by the subroutine factorial located when it is returned
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