Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;factorial
- .model small
- .data
- num dw 0008h
- .code
- mov ax,@data
- mov ds,ax
- xor ax,ax
- mov ax,num
- sub num,0001h
- mov cx,num
- next:mul cx
- loop next
- mov bx,ax
- call display
- mov ah,4ch
- int 21h
- .exit
- display proc near
- mov ch,04h
- mov cl,04h
- cont:rol bx,cl
- mov dl,bl
- and dl,0fh
- cmp dl,09h
- jg char
- add dl,30h
- jmp print
- char:add dl,37h
- print:mov ah,02h
- int 21h
- dec ch
- jnz cont
- ret
- display endp
- end
Add Comment
Please, Sign In to add comment