Advertisement
alvsjo

ferman

Jun 22nd, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. .model small
  2. .stack
  3. .data
  4. n dw 3
  5. f dw ?
  6. .code
  7.  
  8. main:
  9.  
  10. mov ax,@data
  11. mov ds,ax
  12.  
  13.  
  14.  
  15. mov ax,2
  16. mov cx,n
  17. dec cx
  18. shl ax,cl
  19. mov n,ax
  20.  
  21.  
  22. mov ax,2
  23. mov cx,n
  24. dec cx
  25. shl ax,cl
  26.  
  27.  
  28.  
  29. dalje:
  30.  
  31. inc ax
  32.  
  33. mov f,ax
  34. mov bx,10
  35. mov cx,0
  36.  
  37.  
  38.  
  39. cif:
  40. cmp ax,0
  41. je stamp
  42. mov dx,0
  43. div bx
  44. push dx
  45. inc cx
  46. jmp cif
  47.  
  48. stamp:
  49. cmp cx,0
  50. je kraj2
  51. pop dx
  52. add dx,'0'
  53. mov ah,2
  54. int 21h
  55. dec cx
  56. jmp stamp
  57.  
  58.  
  59.  
  60. kraj2:
  61.  
  62. mov ah,4ch
  63. int 21h
  64. end main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement