Guest User

Untitled

a guest
Nov 20th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. ;factorial
  2.  
  3. .model small
  4. .data
  5.  
  6. num dw 0008h
  7.  
  8. .code
  9.  
  10. mov ax,@data
  11. mov ds,ax
  12. xor ax,ax
  13. mov ax,num
  14. sub num,0001h
  15. mov cx,num
  16.  
  17. next:mul cx
  18. loop next
  19.  
  20. mov bx,ax
  21.  
  22. call display
  23. mov ah,4ch
  24. int 21h
  25. .exit
  26.  
  27. display proc near
  28. mov ch,04h
  29. mov cl,04h
  30. cont:rol bx,cl
  31. mov dl,bl
  32. and dl,0fh
  33. cmp dl,09h
  34. jg char
  35. add dl,30h
  36. jmp print
  37. char:add dl,37h
  38. print:mov ah,02h
  39. int 21h
  40. dec ch
  41. jnz cont
  42. ret
  43. display endp
  44.  
  45. end
Add Comment
Please, Sign In to add comment