Professional Documents
Culture Documents
Experiment - Ii Factorial of A Number
Experiment - Ii Factorial of A Number
FACTORIAL OF A NUMBER
ADITHYA D RAJAGOPAL
ROLL NO : 9
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
COLLEGE OF ENGINEERING TRIVANDRUM
TVE17CS009 ADITHYA D RAJAGOPAL
A IM
To develop an assembly language program to find the factorial of a number.
Page 1 of 5
TVE17CS009 ADITHYA D RAJAGOPAL
A LGORITHM
Page 2 of 5
TVE17CS009 ADITHYA D RAJAGOPAL
S OURCE C ODE
data segment
num db 5h
r e s u l t db ?
data ends
code segment
assume cs : code , ds : data
start :
mov ax , data
mov ds , ax
mov cl ,num
mov al , 1
up : mul c l
dec c l
jnz up
mov r e s u l t , a l
mov ah , 4 ch
i n t 21h
code ends
end s t a r t
Page 3 of 5
TVE17CS009 ADITHYA D RAJAGOPAL
O UTPUT
Page 4 of 5
TVE17CS009 ADITHYA D RAJAGOPAL
R ESULT
Assembly language program for finding the factorial of a number has been developed and
verified using emu8086.
Page 5 of 5