Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- call putx
- fou:
- cmp al,'4'
- jE fou1
- jNE fiv
- fou1:
- mov ah, 02
- ;mov ch, 8
- mov dh, 8
- ;mov cl, 30
- mov dl, 30
- int 10h
- call putx
- fiv:
- cmp al,'5'
- jE fiv1
- jNE six
- fiv1:
- mov ah, 02
- mov dh, 8
- mov dl, 34
- int 10h
- call putx
- six:
- mov ah,'3'
- Stosb ;Else no put the byte in the buffer
- cmp bl,32h
- Je pl1
- Jne wla
- pl1:
- mov ah,09
- lea dx,p1
- Stosb ;Else no put the byte in the buffer
- cmp bl,32h
- Je pl1
- Jne wla ;this is line 140
- pl1:
- mov ah,09
- lea dx,p1
- .model small
- .code
- org 100h
- start:
- start: jmp main
- lin db "|===|===|===|$"
- r1 db "| 1 | 2 | 3 |$"
- r2 db "| 4 | 5 | 6 |$"
- r3 db"| 7 | 8 | 9 |$"
- spa db 0ah,0dh,24h
- p1 db"Player 1's Turn (X) : $"
- p2 db"Player 2's Turn (O) : $"
- main:
- ;start of the crap
- mov ah, 02
- mov ch, 5
- mov dh, 5
- mov cl, 28
- mov dl, 28
- int 10h
- call line
- call down
- call row1
- mov ah,09
- lea dx,r1
- int 21h
- call down
- ;le end
- ;start of the crap
- mov ah, 02
- mov ch, 7
- mov dh, 7
- mov cl, 28
- mov dl, 28
- int 10h
- call line
- call down
- call row2
- mov ah,09
- lea dx,r2
- int 21h
- call down
- ;le end
- ;start of the crap
- mov ah, 02
- mov ch, 9
- mov dh, 9
- mov cl, 28
- mov dl, 28
- int 10h
- call line
- call down
- call row3
- mov ah,09
- lea dx,r3
- int 21h
- call down
- ;le end
- mov ah, 02
- mov ch, 11
- mov dh, 11
- mov cl, 28
- mov dl, 28
- int 10h
- call line
- call down
- ;input goes here
- mov ah, 02
- mov ch, 20
- mov dh, 20
- mov cl, 10
- mov dl, 10
- int 10h
- mov ah,09
- lea dx,p1
- int 21h
- mov ah,02
- mov dl,al
- int 21h
- call down
- ;mov cx,2
- ;again:
- CLD ;Incrementing direction
- mov bl,30h
- Get_another_byte:
- add bl,1h
- call down
- mov ah,02
- mov dl,bl
- int 21h ;show the bl
- Mov AH, 7 ;Ms.Dos code to get one char
- Int 21h ;Ms.Dos does that for us and puts it in AL
- Cmp AL, 20h ;Did he hit the return key ?
- Je exi ;Yes, now we can go on
- Stosb ;Else no put the byte in the buffer
- cmp bl,32h
- Je pl1
- Jne wla
- pl1:
- mov ah,09
- lea dx,p1
- int 21h
- mov ah,02
- mov dl,al
- int 21h
- ;code ni player 1
- cmp al,'1'
- jE one
- jNE two
- one:
- mov ah, 02
- mov ch, 6
- mov dh, 6
- mov cl, 30
- mov dl, 30
- int 10h
- call putx
- two:
- cmp al,'2'
- jE two1
- jNE thr
- two1:
- mov ah, 02
- mov ch, 6
- mov dh, 6
- mov cl, 34
- mov dl, 34
- int 10h
- call putx
- thr:
- cmp al,'3'
- jE thr1
- jNE fou
- thr1:
- mov ah, 02
- mov ch, 6
- mov dh, 6
- mov cl, 38
- mov dl, 38
- int 10h
- call putx
- fou:
- cmp al,'4'
- jE fou1
- jNE fiv
- fou1:
- mov ah, 02
- ;mov ch, 8
- mov dh, 8
- ;mov cl, 30
- mov dl, 30
- int 10h
- call putx
- fiv:
- cmp al,'5'
- jE fiv1
- jNE six
- fiv1:
- mov ah, 02
- mov dh, 8
- mov dl, 34
- int 10h
- call putx
- six:
- mov ah,'3'
- taps:
- mov bl,30h
- jmp Get_another_byte
- exi:
- jmp exit
- ;end of code player1
- ;mov bl,30h
- sub bl, 2h ;babalik niya yung 32 sa 1 (32-2 = 31)
- call down
- Jmp Get_another_byte
- wla:
- mov ah,09
- lea dx,p2
- int 21h
- mov ah,02
- mov dl,al
- int 21h
- ;mov bl,30h
- call down
- Jmp Get_another_byte ;He's not done, so keep on
- ;loop again
- row1 proc
- mov ah, 02
- mov ch, 6
- mov dh, 6
- mov cl, 28
- mov dl, 28
- int 10h
- ret
- row1 endp
- row2 proc
- mov ah, 02
- mov ch, 8
- mov dh, 8
- mov cl, 28
- mov dl, 28
- int 10h
- ret
- row2 endp
- row3 proc
- mov ah, 02
- mov ch, 10
- mov dh, 10
- mov cl, 28
- mov dl, 28
- int 10h
- ret
- row3 endp
- line proc
- mov ah, 09
- lea dx, lin
- int 21h
- ret
- line endp
- down proc
- mov ah, 09
- lea dx, spa
- int 21h
- ret
- down endp
- putx proc
- mov ah,02
- mov dl,"X"
- int 21h
- ret
- putx endp
- exit:
- int 20h
- end start
Add Comment
Please, Sign In to add comment