Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management Systems Designing And Building Business Applications

Authors: Gerald V. Post

1st Edition

0072898933, 978-0072898934

More Books

Students also viewed these Databases questions

Question

Showcase your strengths in a rsum

Answered: 1 week ago

Question

1.who the father of Ayurveda? 2. Who the father of taxonomy?

Answered: 1 week ago

Question

Commen Name with scientific name Tiger - Wolf- Lion- Cat- Dog-

Answered: 1 week ago