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.
Description :
This is the one stop educational site for all Electronic and Computer students. If you want to learn something new then we are here to help. We work on Microcontroller projects, Basic Electronics, Digital electronics, Computer projects and also in basic c/c++ programs.
#Home #Sitemap #Resources #Terms of Use
Copyright©2012 electrofriends.com All Rights Reserved
Contact:info@electrofriends.com
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