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

Add-arithmetic instruction-microprocessor, ADD:  Add :- This instruction ...

ADD:  Add :- This instruction adds an immediate contents of a memory location specified in the a register ( source ) or instruction to the contents of another register (destinat

AAD, AAD stand for what??

AAD stand for what??

Linking a program-microprocessor, Linking a program The DOS linking pro...

Linking a program The DOS linking program LINK.EXE links the different object modules of function library routines and source program to produce an integrated executable code o

Write an assembly language program to fi nd the maximum, Write an assembly ...

Write an assembly language program to find the maximum of: y = x 6 - 14x 2 + 56x for the range -2 ≤ x ≤ 4, by stepping one by one through the range. The program should in

Scanning, how o create the flow chart for scan ROW4, Column 1 and 3.tq

how o create the flow chart for scan ROW4, Column 1 and 3.tq

Flowchart, ALP to preform of two 16-bit numbers in register addressing mode...

ALP to preform of two 16-bit numbers in register addressing mode

Movsw/movsb-string manipulation instruction-microprocessor, MOVSW/MOVSB : ...

MOVSW/MOVSB : Move String Word or String Byte: Imagine a string of bytes, stored in a set  of consecutive memory locations is to be moved to another set of  the destination locati

Project, need some project ideas

need some project ideas

ADDITION-SUBTRACTION, HELLO I AM TRYING TO ADD AND SUBTRACT BUT I SEEM CAN'...

HELLO I AM TRYING TO ADD AND SUBTRACT BUT I SEEM CAN''T FIND THE CORRECT REGISTER TO PUT IN

Program for dispaying lcd characters, #include"lcd.asm"       ; assembly fi...

#include"lcd.asm"       ; assembly file is included for displaying lcd characters Main: PORTA EQU 0xF80  ; PORTS PORTB EQU 0xF81 PORTC EQU 0xF82 PORTD EQU 0xF83 R

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