Aim: – To write an assembly language program to find the factorial of the given number.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | (1) MOV AL, 01 MOV BL, X LOOK: MUL BL DEC BL JNZ LOOK MOV FACT, AL END (2) MOV AL, 01 MOV BL, X LOOK: JZ NEXT MUL BL JNZ LOOK NEXT: MOV FACT, AL END (3) MOV AL, 01 MOV CL, X LOOK: JZ NEXT MUL CL LOOP LOOK NEXT: MOV FACT, AL END |
Result: Factorial of a given number is obtained.
please attach the program to find factorial of a number using IDE for ARM controller.
please attach the program to find factorial of a number using IDE for ARM controller to my email…..
this is ur requested program to find factorial of a given number…..simulate it on IDE for ARM controller lab purpose.
(1)
MOV AL, 01
MOV BL, X
LOOK: MUL BL
DEC BL
JNZ LOOK
MOV FACT, AL
END
(2)
MOV AL, 01
MOV BL, X
LOOK: JZ NEXT
MUL BL
JNZ LOOK
NEXT: MOV FACT, AL
END
(3)
MOV AL, 01
MOV CL, X
LOOK: JZ NEXT
MUL CL
LOOP LOOK
NEXT: MOV FACT, AL
END
Really enjoyed this post.Thanks Again. Great.Very neat article. Awesome. test http://testdomain.com