Program to find the factorial of a number

Posted by Psycho Programer On Saturday, December 18, 2010 15 comments


MVI B, 03H
MOV C, B
DCR C
LOOP1:
MOV E, C
SUB A
LOOP2:
ADD B
DCR E
JNZ LOOP2
MOV B, A
DCR C
JNZ LOOP1
STA 8000H
HLT

15 comments:

SHOBANA KITTAN said...

GOOD IT WAS USEFUL THANKS

princenaman said...

not wrking if i make b = 4 (04H)

Unknown said...

nice one

website is fun said...

Good one

Unknown said...

It will not work when B=00H

satarupa saha said...

thaanx..it works well..

satarupa saha said...

thaanx..it works well..

Unknown said...

Tnx running well

Unknown said...

Tnx running well

Nimpy said...

What abt big nos where carry is generated like 6!(2D0),7!(3B0)

RandomThoughts said...

fck

Unknown said...

thanks
user reviews

Unknown said...
This comment has been removed by the author.
Unknown said...

it is working great thanks.
some have the confusion about ans but it's alright because ans is in hex.
eg, b,05 ans is 78.
(78)=120 in dec.

Unknown said...

NOT WORK FOR 6 AND SO ON

Post a Comment