Advertisement
Guest User

Untitled

a guest
Oct 9th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.90 KB | None | 0 0
  1. .model small
  2. .stack 10h
  3. .data
  4. didelis db 0Ah, 0Dh,"Per didelis skaicius$"
  5. enteris db 0Ah, 0Dh, 24h
  6. buff db 255, ?, 255 dup (?)
  7.  
  8. .code
  9.  
  10. start:
  11.  
  12. mov ax, @data
  13. mov ds, ax
  14.  
  15. mov ah, 0Ah
  16. mov dx, offset buff
  17. int 21h
  18.  
  19. mov ah, 09h
  20. mov dx, offset enteris
  21. int 21h
  22.  
  23. mov dx, offset buff
  24.  
  25. mov bx, dx
  26.  
  27. inc bx
  28. xor cx, cx
  29. mov cl, byte ptr [bx]
  30.  
  31. xor ax, ax
  32.  
  33. cmp cl, 05h
  34. jg perDidelis
  35.  
  36. cmp cl, 01h
  37. je vienas
  38.  
  39. cmp cl, 02h
  40. je du
  41.  
  42. cmp cl, 03h
  43. je trys
  44.  
  45. cmp cl, 04h
  46. je keturi
  47.  
  48. cmp cl, 05h
  49. je penki
  50.  
  51. vienas:
  52. inc bx
  53. mov al, byte ptr [bx]
  54. sub ax, 30h
  55.  
  56. call KonvSpausdink
  57.  
  58. jmp pabaiga ; reikia jmp konvertuok i 8aini
  59.  
  60. du:
  61. mov dl, 10d
  62. inc bx
  63. mov al, byte ptr [bx]
  64. sub ax, 30h
  65. mul dl
  66. push ax
  67.  
  68. xor ax, ax
  69. inc bx
  70. mov al, byte ptr [bx]
  71. sub ax, 30h
  72.  
  73. xor dx, dx
  74. mov dx, ax
  75.  
  76. pop ax
  77.  
  78. add ax, dx
  79.  
  80. call KonvSpausdink
  81.  
  82. jmp pabaiga ; reikia jmp konvertuok i 8aini
  83.  
  84. trys:
  85. mov dl, 100d
  86. inc bx
  87. mov al, byte ptr [bx]
  88. sub ax, 30h
  89. mul dl
  90. push ax
  91.  
  92. xor ax, ax
  93. mov dl, 10d
  94. inc bx
  95. mov al, byte ptr [bx]
  96. sub ax, 30h
  97. mul dl
  98. push ax
  99.  
  100. inc bx
  101. mov al, byte ptr [bx]
  102. sub ax, 30h
  103.  
  104. xor dx, dx
  105. mov dx, ax
  106.  
  107. pop ax
  108.  
  109. add ax, dx
  110. pop dx
  111.  
  112. add ax, dx
  113.  
  114. call KonvSpausdink
  115.  
  116. jmp pabaiga ; reikia jmp konvertuok i 8aini
  117.  
  118. keturi:
  119. mov dx, 1000d
  120. inc bx
  121. mov al, byte ptr [bx]
  122. sub ax, 30h
  123. mul dx
  124. push ax
  125.  
  126. xor ax, ax
  127.  
  128. mov dl, 100d
  129. inc bx
  130. mov al, byte ptr [bx]
  131. sub ax, 30h
  132. mul dl
  133. push ax
  134.  
  135. xor ax, ax
  136.  
  137. mov dl, 10d
  138. inc bx
  139. mov al, byte ptr [bx]
  140. sub ax, 30h
  141. mul dx
  142. push ax
  143.  
  144. inc bx
  145. mov al, byte ptr [bx]
  146. sub ax, 30h
  147.  
  148. xor dx, dx
  149. mov dx, ax
  150.  
  151. pop ax
  152.  
  153. add ax, dx
  154. pop dx
  155.  
  156. add ax, dx
  157.  
  158. pop dx
  159.  
  160. add ax, dx
  161.  
  162. call KonvSpausdink
  163.  
  164. jmp pabaiga ; reikia jmp konvertuok i 8aini
  165.  
  166. penki:
  167. mov dx, 10000d
  168. inc bx
  169. mov al, byte ptr [bx]
  170. sub ax, 30h
  171. mul dx
  172. push ax
  173.  
  174. xor ax, ax
  175.  
  176. mov dx, 1000d
  177. inc bx
  178. mov al, byte ptr [bx]
  179. sub ax, 30h
  180. mul dx
  181. push ax
  182.  
  183. xor ax, ax
  184.  
  185. mov dl, 100d
  186. inc bx
  187. mov al, byte ptr [bx]
  188. sub ax, 30h
  189. mul dl
  190. push ax
  191.  
  192. xor ax, ax
  193.  
  194. mov dl, 10d
  195. inc bx
  196. mov al, byte ptr [bx]
  197. sub ax, 30h
  198. mul dx
  199. push ax
  200.  
  201. inc bx
  202. mov al, byte ptr [bx]
  203. sub ax, 30h
  204.  
  205. xor dx, dx
  206. mov dx, ax
  207.  
  208. pop ax
  209.  
  210. add ax, dx
  211. pop dx
  212.  
  213. add ax, dx
  214.  
  215. pop dx
  216.  
  217. add ax, dx
  218.  
  219. pop dx
  220.  
  221. add ax, dx
  222.  
  223. cmp ax, 0FFFFh
  224. jg perDidelis
  225.  
  226. call KonvSpausdink
  227.  
  228. jmp pabaiga
  229.  
  230. perDidelis:
  231. mov ah, 09h
  232. mov dx, offset didelis
  233. int 21h
  234. jmp pabaiga
  235.  
  236. pabaiga:
  237. mov ah, 4Ch
  238. int 21h
  239.  
  240. KonvSpausdink PROC
  241.  
  242. push ax
  243. push bx
  244. push cx
  245. push dx
  246.  
  247. mov cx, 08h
  248. push 02424h
  249.  
  250. dalink:
  251. mov dx, 0h
  252. div cx
  253.  
  254. push dx
  255.  
  256. cmp ax, 0h
  257. ja dalink
  258.  
  259. mov ah, 02h
  260. spausdink:
  261. pop dx
  262. cmp dx, 02424h
  263. je pabaigaProc
  264. add dl, 30h
  265. int 21h
  266. jmp spausdink
  267.  
  268.  
  269. pabaigaProc:
  270. pop dx
  271. pop cx
  272. pop bx
  273. pop ax
  274.  
  275. ret
  276.  
  277. KonvSpausdink endp
  278.  
  279. end start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement