Advertisement
JayaAhmed

Factorial

Dec 4th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .MODEL SMALL
  2. .STACK 100H
  3. .CODE                        
  4. FACTORIAL PROC
  5.     MOV AH,1
  6.     INT 21H
  7.     MOV CX,0
  8.     SUB AL,48
  9.     MOV CL,AL
  10.     MOV AX,1
  11.      
  12.      TOP:
  13.      CMP CX,1
  14.      JE END
  15.         MUL CX
  16.         LOOP TOP
  17.          
  18.         RET
  19.         END:
  20.         MOV DX,AX
  21.         MOV AH,2
  22.         INT 21H
  23.            
  24.        
  25.         FACTORIAL ENDP
  26. END FACTORIAL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement