ASM program to find the factorial of the given number

Sunday, June 3rd, 2012

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.

Avatar of chitra

Author Name :
chitra

Total : 4 Comments


4 Responses to “ASM program to find the factorial of the given number”

  1. praveenkumar says:

    please attach the program to find factorial of a number using IDE for ARM controller.

  2. praveenkumar says:

    please attach the program to find factorial of a number using IDE for ARM controller to my email…..

  3. praveenkumar says:

    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

  4. test says:

    Really enjoyed this post.Thanks Again. Great.Very neat article. Awesome. test http://testdomain.com

Leave a Reply

Question and Answer
C/C++ Unix & Linux Wordpress
Source codes
C C++ Java

Free email signup

Email: