Question: You are to design, write, assemble, and simulate an assembly language program which will calculate the factorial N ! of an unsigned 1 - byte

You are to design, write, assemble, and simulate an assembly language program which will calculate the
factorial N! of an unsigned 1-byte number N.
The factorial of N is defined as: 0!=1 and N!=1*2*3*..*(N-1)* N, for N >0
For example, for N=8, N!=40320= $9D80.
One way to calculate N! is iteratively in N steps:
1. calculate 1!
2. calculate 2!=1!*2
3. calculate 3!=2!*3
4. calculate 4!=3!*4
...
N. calculate N!=(N-1)!*N
For this lab, N is a 1 byte number, while the result (N!) is stored as a 2-byte number in NFAC in BIG
ENDIAN format
YOU MUST FOLLOW THE C PROGRAM BELOW 1 TO 1, DO NOT CHANGE. my current assmebly program isn't calculating correctly, when N is set to 8 it says the NFAC is $0D80 which is incorrect. So please help me. And if you could change my program as little as possible and DO NOT go against the psudocode as it must be 1 to 1
 You are to design, write, assemble, and simulate an assembly language

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!