Guest User

Untitled

a guest
Aug 14th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.03 KB | None | 0 0
  1. call putx
  2.  
  3. fou:
  4. cmp al,'4'
  5. jE fou1
  6. jNE fiv
  7.  
  8. fou1:
  9.  
  10. mov ah, 02
  11. ;mov ch, 8
  12. mov dh, 8
  13. ;mov cl, 30
  14. mov dl, 30
  15. int 10h
  16.  
  17. call putx
  18.  
  19. fiv:
  20. cmp al,'5'
  21. jE fiv1
  22. jNE six
  23.  
  24. fiv1:
  25. mov ah, 02
  26. mov dh, 8
  27. mov dl, 34
  28. int 10h
  29.  
  30. call putx
  31.  
  32. six:
  33. mov ah,'3'
  34.  
  35. Stosb ;Else no put the byte in the buffer
  36. cmp bl,32h
  37. Je pl1
  38. Jne wla
  39. pl1:
  40. mov ah,09
  41. lea dx,p1
  42. Stosb ;Else no put the byte in the buffer
  43. cmp bl,32h
  44. Je pl1
  45. Jne wla ;this is line 140
  46. pl1:
  47. mov ah,09
  48. lea dx,p1
  49.  
  50. .model small
  51. .code
  52. org 100h
  53.  
  54. start:
  55.  
  56.  
  57. start: jmp main
  58. lin db "|===|===|===|$"
  59. r1 db "| 1 | 2 | 3 |$"
  60. r2 db "| 4 | 5 | 6 |$"
  61. r3 db"| 7 | 8 | 9 |$"
  62. spa db 0ah,0dh,24h
  63.  
  64. p1 db"Player 1's Turn (X) : $"
  65. p2 db"Player 2's Turn (O) : $"
  66.  
  67.  
  68. main:
  69.  
  70. ;start of the crap
  71. mov ah, 02
  72. mov ch, 5
  73. mov dh, 5
  74. mov cl, 28
  75. mov dl, 28
  76. int 10h
  77.  
  78. call line
  79. call down
  80. call row1
  81.  
  82. mov ah,09
  83. lea dx,r1
  84. int 21h
  85.  
  86. call down
  87. ;le end
  88.  
  89.  
  90.  
  91. ;start of the crap
  92. mov ah, 02
  93. mov ch, 7
  94. mov dh, 7
  95. mov cl, 28
  96. mov dl, 28
  97. int 10h
  98.  
  99. call line
  100. call down
  101. call row2
  102.  
  103. mov ah,09
  104. lea dx,r2
  105. int 21h
  106.  
  107. call down
  108. ;le end
  109.  
  110.  
  111.  
  112.  
  113. ;start of the crap
  114. mov ah, 02
  115. mov ch, 9
  116. mov dh, 9
  117. mov cl, 28
  118. mov dl, 28
  119. int 10h
  120.  
  121. call line
  122. call down
  123. call row3
  124.  
  125. mov ah,09
  126. lea dx,r3
  127. int 21h
  128.  
  129. call down
  130. ;le end
  131.  
  132. mov ah, 02
  133. mov ch, 11
  134. mov dh, 11
  135. mov cl, 28
  136. mov dl, 28
  137. int 10h
  138.  
  139. call line
  140. call down
  141.  
  142.  
  143.  
  144.  
  145.  
  146. ;input goes here
  147. mov ah, 02
  148. mov ch, 20
  149. mov dh, 20
  150. mov cl, 10
  151. mov dl, 10
  152. int 10h
  153.  
  154. mov ah,09
  155. lea dx,p1
  156. int 21h
  157.  
  158. mov ah,02
  159. mov dl,al
  160. int 21h
  161.  
  162. call down
  163.  
  164.  
  165.  
  166. ;mov cx,2
  167. ;again:
  168. CLD ;Incrementing direction
  169. mov bl,30h
  170. Get_another_byte:
  171.  
  172. add bl,1h
  173. call down
  174. mov ah,02
  175. mov dl,bl
  176. int 21h ;show the bl
  177.  
  178. Mov AH, 7 ;Ms.Dos code to get one char
  179. Int 21h ;Ms.Dos does that for us and puts it in AL
  180.  
  181. Cmp AL, 20h ;Did he hit the return key ?
  182. Je exi ;Yes, now we can go on
  183.  
  184. Stosb ;Else no put the byte in the buffer
  185. cmp bl,32h
  186. Je pl1
  187. Jne wla
  188. pl1:
  189. mov ah,09
  190. lea dx,p1
  191. int 21h
  192.  
  193. mov ah,02
  194. mov dl,al
  195. int 21h
  196.  
  197. ;code ni player 1
  198.  
  199. cmp al,'1'
  200. jE one
  201. jNE two
  202.  
  203. one:
  204.  
  205. mov ah, 02
  206. mov ch, 6
  207. mov dh, 6
  208. mov cl, 30
  209. mov dl, 30
  210. int 10h
  211.  
  212.  
  213. call putx
  214.  
  215. two:
  216.  
  217. cmp al,'2'
  218. jE two1
  219. jNE thr
  220.  
  221. two1:
  222.  
  223. mov ah, 02
  224. mov ch, 6
  225. mov dh, 6
  226. mov cl, 34
  227. mov dl, 34
  228. int 10h
  229.  
  230. call putx
  231.  
  232.  
  233. thr:
  234.  
  235. cmp al,'3'
  236. jE thr1
  237. jNE fou
  238.  
  239. thr1:
  240.  
  241. mov ah, 02
  242. mov ch, 6
  243. mov dh, 6
  244. mov cl, 38
  245. mov dl, 38
  246. int 10h
  247.  
  248. call putx
  249.  
  250. fou:
  251. cmp al,'4'
  252. jE fou1
  253. jNE fiv
  254.  
  255. fou1:
  256.  
  257. mov ah, 02
  258. ;mov ch, 8
  259. mov dh, 8
  260. ;mov cl, 30
  261. mov dl, 30
  262. int 10h
  263.  
  264. call putx
  265.  
  266. fiv:
  267. cmp al,'5'
  268. jE fiv1
  269. jNE six
  270.  
  271. fiv1:
  272. mov ah, 02
  273. mov dh, 8
  274. mov dl, 34
  275. int 10h
  276.  
  277. call putx
  278.  
  279. six:
  280. mov ah,'3'
  281.  
  282.  
  283. taps:
  284. mov bl,30h
  285. jmp Get_another_byte
  286.  
  287. exi:
  288. jmp exit
  289. ;end of code player1
  290.  
  291. ;mov bl,30h
  292. sub bl, 2h ;babalik niya yung 32 sa 1 (32-2 = 31)
  293. call down
  294. Jmp Get_another_byte
  295. wla:
  296. mov ah,09
  297. lea dx,p2
  298. int 21h
  299.  
  300. mov ah,02
  301. mov dl,al
  302. int 21h
  303.  
  304. ;mov bl,30h
  305. call down
  306. Jmp Get_another_byte ;He's not done, so keep on
  307.  
  308. ;loop again
  309.  
  310.  
  311. row1 proc
  312. mov ah, 02
  313. mov ch, 6
  314. mov dh, 6
  315. mov cl, 28
  316. mov dl, 28
  317. int 10h
  318. ret
  319. row1 endp
  320.  
  321.  
  322. row2 proc
  323. mov ah, 02
  324. mov ch, 8
  325. mov dh, 8
  326. mov cl, 28
  327. mov dl, 28
  328. int 10h
  329. ret
  330. row2 endp
  331.  
  332.  
  333. row3 proc
  334. mov ah, 02
  335. mov ch, 10
  336. mov dh, 10
  337. mov cl, 28
  338. mov dl, 28
  339. int 10h
  340. ret
  341. row3 endp
  342.  
  343.  
  344.  
  345.  
  346. line proc
  347. mov ah, 09
  348. lea dx, lin
  349. int 21h
  350. ret
  351. line endp
  352.  
  353. down proc
  354. mov ah, 09
  355. lea dx, spa
  356. int 21h
  357. ret
  358. down endp
  359.  
  360.  
  361.  
  362. putx proc
  363. mov ah,02
  364. mov dl,"X"
  365. int 21h
  366. ret
  367. putx endp
  368.  
  369.  
  370. exit:
  371.  
  372. int 20h
  373. end start
Add Comment
Please, Sign In to add comment