Nonrecursive Factorial, Assembly Language

Assignment Help:
Write a nonrecursive version of the Factorial procedure (Section 8.3.2) that uses a loop. (A VideoNote
for this exercise is posted on the Web site.) Write a short program that interactively tests your Factorial
procedure. Let the user enter the value of n. If overflow occurs in your loop when calculating each factorial
value, your program should display an error message. If no overflow occurs, display the calculated
factorial. Following is a sample of the interaction between the user and the program:
Enter the value of n to calculate the factorial (-1 to quit): 0
The factorial is: 1
Enter the value of n to calculate the factorial (-1 to quit): 1
The factorial is: 1
Enter the value of n to calculate the factorial (-1 to quit): 5
The factorial is: 120
Enter the value of n to calculate the factorial (-1 to quit): 12
The factorial is: 479001600
Enter the value of n to calculate the factorial (-1 to quit): 13
Error: Calculated value cannot fit into 32 bits
Enter the value of n to calculate the factorial (-1 to quit): -1

Related Discussions:- Nonrecursive Factorial

The pin diagram of 8088-microprocessor, Pin diagram of 8088 : The pin ...

Pin diagram of 8088 : The pin diagram of 8088 is shown in given figure. Most of the 8088 pins and their functions are exactly similar to the corresponding pins of 8086.  Hence

Assembly assignment help, Problems: 1. Write a single program. Each of th...

Problems: 1. Write a single program. Each of the problems (2-4) should be written within a procedure. Your “main” procedure should call each procedure. Before calling each proc

Project, Any small project which can implement on any software. No need any...

Any small project which can implement on any software. No need any external hardware approach.

Debug-microprocessor, Using DEBUG DEBUG.COM is a DOS efficacy that faci...

Using DEBUG DEBUG.COM is a DOS efficacy that facilitates the trouble-shooting and debugging of assembly language programs. In particular case of personal computers, all of th

Cbw-cwd-arithmetic instruction-microprocessor, CBW: Convert Signed Byte to...

CBW: Convert Signed Byte to Word: This instruction converts a signed byte to a signed word. In other terms, it copies the sign bit of a byte to be converted to all of the bits in

Memory address decoding-microprocessor, Memory Address Decoding Binary ...

Memory Address Decoding Binary Decoders - Decoders have 2n-inputs and n outputs, each input combination results in a single output line contain a 1, and all other lines contain

Program to move string from offset-assembly program, Program : A program t...

Program : A program to move a string of the data words from offset 2000H to offset 3000H the length of the string is OFH. Solution : For writing this program, we will use

Ror-logical instruction-microprocessor, ROR : Rotate Right without Carry: ...

ROR : Rotate Right without Carry: This instruction rotates the contents of destination operand to the bit-wise right either by one or by the count specified in register CL, exclud

Program to convert decimal to binary number, Program is written but has err...

Program is written but has errors returning values from the procedure.

Zero flag, Zero flag: The next line compares the value in register. A ...

Zero flag: The next line compares the value in register. A with the value 1. If they are equivalent, the Zero flag is set (to 1). The next line then jumps to start: only if th

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd