.model small
data segment
num dw 08h
data ends
code segment
assume cs:code,ds:data
mov ax,data
mov ds, ax
mov ax, 01
mov bx, num
call fact
mov di, ax
mov bp, 2
mov bx, dx
mov bx, di
dec bp
mov ah, 4ch
int 3h
fact proc near
cmp bx, 01
jz l11
l12: mul bx
dec bx
cmp bx, 01
jne l12
ret
l11: mov ax, 01
ret
fact endp
code ends
end
No comments:
Post a Comment