Source code of determining the facttorial of a given number in 8085
Friday, January 23, 2009
- Problem:Determine the factorial of a given number.
- Solution:
The factorial of a number is a value which is equal to the result of the multiplication of the number starting from 1 to the number. Suppose the factorial of 4 is equal to the result of 1*2*3*4 that is 24
In 8085 programming we will determine the factorial of a number.The source code of this program are given bellow. Just type this code in your 8085 simulator and run the program. The program will determine the factorial of your given number.
- Determination of Factorial in 8085:
- Program Code:
- MVI B 00
- MVI C 05
- MVI A 00
- MVI D 00
- MVI E 00
- MOV B ,C
- DCR B
- MOV D,B
- ADD C
- DCR D
- JNZ F008
- MOV C,A
- MOV A,E
- DCR B
- JNZ F00A
- MOV M, C
- HLT
- About program Code:
- Source Code of the program and Output:
0 comments:
Post a Comment