t6 - dec cx jnz loop1 j mov bl,10 div bl d mov ch,ah cbw...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
;Write a program to calculate the factorial of a number where factorial ;is defined as: ;factorial(x) = x*(x-1)*(x-2)*. ..*1 ;factorial(0) = 1 ; .model small .stack 100h .data num dw 2 .code main proc mov ax,@data mov ds,ax m mov ax,num mov cx, num sub cx,1 s loop1: mov bx,cx mul bx
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: dec cx jnz loop1 j mov bl,10 div bl d mov ch,ah cbw div bl mov bl,ah mov ah,02 add al,30h mov dl,al int 21h i mov ah,02 add bl,30h mov dl,bl int 21h i mov ah,02 add ch,30h mov dl,ch int 21h i mov ah,4ch int 21h i main endp end main...
View Full Document

This note was uploaded on 11/06/2010 for the course UBIT 411 taught by Professor Saleemelahi during the Spring '10 term at University of Karachi.

Ask a homework question - tutors are online