Find the factorial of a given number.

Find the factorial of a given number.

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 9000H
RST

No comments:

Post a Comment