Advertisement
Guest User

Untitled

a guest
Apr 26th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. .model small
  2. .stack 100h
  3. .data
  4. mes db 0ah,0dh, '$'
  5. buff db 10, ?, 10 dup (?)
  6. a dw ?
  7. b dw ?
  8. c dw ?
  9. d dw ?
  10. e dw ?
  11. .code
  12.  
  13.  
  14. out_str macro str
  15. push ax
  16. mov ah,09h
  17. mov dx, offset e
  18. int 21h
  19. pop ax
  20. endm
  21.  
  22. entstr macro
  23. lea dx, buff
  24. mov ah, 0ah
  25. int 21h
  26. endm
  27.  
  28. newstr macro
  29. lea dx, mes
  30. mov ah,09h
  31. int 21h
  32. endm
  33.  
  34. start:
  35. mov ax,@data
  36. mov ds,ax
  37. entstr
  38. call myproc
  39. mov a,ax
  40. newstr
  41. entstr
  42. call myproc
  43. mov b,ax
  44. newstr
  45. entstr
  46. call myproc
  47. mov c,ax
  48. newstr
  49. entstr
  50. call myproc
  51. mov d,ax
  52. newstr
  53.  
  54. mov ax, a
  55. mov bx, b
  56. je v3
  57. jb v1
  58. xchg ax,bx
  59.  
  60. v1:
  61. mov cx,ax
  62. v2:
  63. add ax, cx
  64. push ax
  65. xor dx,dx
  66. div bx
  67. pop ax
  68. or dx, dx
  69. jnz v2
  70.  
  71. v3:
  72. mov e, ax
  73.  
  74.  
  75. lea dx, e
  76. mov ah, 09h
  77. int 21h
  78. mov ax, 4c00h
  79. int 21h
  80.  
  81.  
  82.  
  83.  
  84. myproc proc
  85. xor cx, cx
  86. mov cl, buff[1]
  87. xor di,di
  88. mov si, 2 ; 16
  89. cycl:
  90. mov al, buff[si] ; 18
  91. sub al,48
  92. push cx ; 20
  93. dec cl
  94. jz m2
  95. mov bl,10
  96. m1:
  97. imul bl
  98. loop m1
  99. m2:
  100. pop cx ; 27
  101. add di,ax
  102. inc si
  103. loop cycl
  104. ret
  105. myproc endp
  106.  
  107. end start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement