data segment
SG DB 'http://bbs.bccn.net/'
SG3 DB 'Do you want to play again?(Yes/No)'
sg1 db 0dbh,0dbh
sg2 db 0dbh
row db 15
col db 40
circle DB 00H,00H,07H,0C0H,1FH,0F0H,3FH,0F8H,3FH,0F8H,7FH,0FCH,7FH,0FCH,7FH,0FCH
DB 7FH,0FCH,7FH,0FCH,3FH,0F8H,3FH,0F8H,1FH,0F8H,07H,0C0H,00H,00H,00H,00H
flag db 1
status db 1
victory db 0
num db 1
form db 40 dup (0)
db 40 dup (0)
db 40 dup (0)
db 40 dup (0)
db 40 dup (0)
db 40 dup (0)
db 40 dup (0)
db 40 dup (0)
db 40 dup (0)
db 40 dup (0)
db 40 dup (0)
db 40 dup (0)
db 40 dup (0)
db 40 dup (0)
db 40 dup (0)
db 40 dup (0)
db 40 dup (0)
db 40 dup (0)
db 40 dup (0)
db 40 dup (0)
db 40 dup (0)
db 40 dup (0)
db 40 dup (0)
db 40 dup (0)
db 40 dup (0)
db 40 dup (0)
db 40 dup (0)
db 40 dup (0)
db 40 dup (0)
data ends
;
sh21:
shl di,1 ;移出到 cf
jnc sh31 ;无点
int 10h ;有点印出
sh31:
inc cx ;下一点
dec bp ;完了一列?
jnz sh21 ;未
add si,2 ;下一行
pop bp ;
inc dx ;坐标移下一行
dec bp ;行回圈
jnz sh01
pop bp
pop si
pop dx
pop cx
pop bx
pop ax
ret
show1 endp
show2 proc near
push ax
push bx
push cx
push dx
push si
push bp
push ax
mov al,row
mov bl,16
mul bl
mov dx,ax
pop ax
sh22:
shl di,1 ;移出到 cf
jnc sh32 ;无点
int 10h ;有点印出
sh32:
inc cx ;下一点
dec bp ;完了一列?
jnz sh22 ;未
add si,2 ;下一行
pop bp ;
inc dx ;坐标移下一行
dec bp ;行回圈
jnz sh02
pop bp
pop si
pop dx
pop cx
pop bx
pop ax
ret
show2 endp
judgeperfect proc near
mov al,row
mov bl,col
mov cl,flag
inc al
mov si,offset form
push ax
push bx
mov bl,40
mul bl
add si,ax
pop bx
pop ax
push ax
mov al,bl
mov ah,0
push bx
mov bl,2
div bl
add si,ax
pop bx
pop ax
cmp byte ptr [si],cl
jz next1
mov num,1
jmp jup
next1:
inc num
inc al
mov si,offset form
push ax
push bx
mov bl,40
mul bl
add si,ax
pop bx
pop ax
push ax
mov al,bl
mov ah,0
push bx
mov bl,2
div bl
add si,ax
pop bx
pop ax
cmp byte ptr [si],cl
jz next2
mov num,1
jmp jup
next2:
inc num
inc al
mov si,offset form
push ax
push bx
mov bl,40
mul bl
add si,ax
pop bx
pop ax
push ax
mov al,bl
mov ah,0
push bx
mov bl,2
div bl
add si,ax
pop bx
pop ax
cmp byte ptr [si],cl
jz next3
mov num,1
jmp jup
next3:
inc num
inc al
mov si,offset form
push ax
push bx
mov bl,40
mul bl
add si,ax
pop bx
pop ax
push ax
mov al,bl
mov ah,0
push bx
mov bl,2
div bl
add si,ax
pop bx
pop ax
cmp byte ptr [si],cl
jz next4
mov num,1
jmp jup
next4:
inc num
cmp num,5
jz jvictory
jmp jexit
jvictory:
mov victory,1
mov num,1
jmp jexit
jup:
mov cl,flag
mov al,row
mov bl,col
dec al
mov si,offset form
push ax
push bx
mov bl,40
mul bl
add si,ax
pop bx
pop ax
push ax
mov al,bl
mov ah,0
push bx
mov bl,2
div bl
add si,ax
pop bx
pop ax
cmp byte ptr [si],cl
jz unext1
mov num,1
jmp jleft
unext1:
inc num
dec al
mov si,offset form
push ax
push bx
mov bl,40
mul bl
add si,ax
pop bx
pop ax
push ax
mov al,bl
mov ah,0
push bx
mov bl,2
div bl
add si,ax
pop bx
pop ax
cmp byte ptr [si],cl
jz unext2
mov num,1
jmp jleft
unext2:
inc num
dec al
mov si,offset form
push ax
push bx
mov bl,40
mul bl
add si,ax
pop bx
pop ax
push ax
mov al,bl
mov ah,0
push bx
mov bl,2
div bl
add si,ax
pop bx
pop ax
cmp byte ptr [si],cl
jz unext3
mov num,1
jmp jleft
unext3:
inc num
dec al
mov si,offset form
push ax
push bx
mov bl,40
mul bl
add si,ax
pop bx
pop ax
push ax
mov al,bl
mov ah,0
push bx
mov bl,2
div bl
add si,ax
pop bx
pop ax
cmp byte ptr [si],cl
jz unext4
mov num,1
jmp jleft
unext4:
inc num
cmp num,5
jz ujvictory
jmp jexit
ujvictory:
mov victory,1
mov num,1
jmp jexit
jleft:
mov cl,flag
mov al,row
mov bl,col
inc bl
inc bl
mov si,offset form
push ax
push bx
mov bl,40
mul bl
add si,ax
pop bx
pop ax
push ax
mov al,bl
mov ah,0
push bx
mov bl,2
div bl
add si,ax
pop bx
pop ax
cmp byte ptr [si],cl
jz lnext1
mov num,1
jmp jright
lnext1:
inc num
inc bl
inc bl
mov si,offset form
push ax
push bx
mov bl,40
mul bl
add si,ax
pop bx
pop ax
push ax
mov al,bl
mov ah,0
push bx
mov bl,2
div bl
add si,ax
pop bx
pop ax
cmp byte ptr [si],cl
jz lnext2
mov num,1
jmp jright
lnext2:
inc num
inc bl
inc bl
mov si,offset form
push ax
push bx
mov bl,40
mul bl
add si,ax
pop bx
pop ax
push ax
mov al,bl
mov ah,0
push bx
mov bl,2
div bl
add si,ax
pop bx
pop ax
cmp byte ptr [si],cl
jz lnext3
mov num,1
jmp jright
lnext3:
inc num
inc bl
inc bl
mov si,offset form
push ax
push bx
mov bl,40
mul bl
add si,ax
pop bx
pop ax
push ax
mov al,bl
mov ah,0
push bx
mov bl,2
div bl
add si,ax
pop bx
pop ax
cmp byte ptr [si],cl
jz lnext4
mov num,1
jmp jright
lnext4:
inc num
cmp num,5
jz ljvictory
jmp jexit
ljvictory:
mov victory,1
mov num,1
jmp jexit
jright:
mov al,row
mov bl,col
mov cl,flag
dec bl
dec bl
mov si,offset form
push ax
push bx
mov bl,40
mul bl
add si,ax
pop bx
pop ax
push ax
mov al,bl
mov ah,0
push bx
mov bl,2
div bl
add si,ax
pop bx
pop ax
cmp byte ptr [si],cl
jz rnext1
mov num,1
jmp jleftoblique1
rnext1:
inc num
dec bl
dec bl
mov si,offset form
push ax
push bx
mov bl,40
mul bl
add si,ax
pop bx
pop ax
push ax
mov al,bl
mov ah,0
push bx
mov bl,2
div bl
add si,ax
pop bx
pop ax
cmp byte ptr [si],cl
jz rnext2
mov num,1
jmp jleftoblique1
rnext2:
inc num
dec bl
dec bl
mov si,offset form
push ax
push bx
mov bl,40
mul bl
add si,ax
pop bx
pop ax
push ax
mov al,bl
mov ah,0
push bx
mov bl,2
div bl
add si,ax
pop bx
pop ax
cmp byte ptr [si],cl
jz rnext3
mov num,1
jmp jleftoblique1
rnext3:
inc num
dec bl
dec bl
mov si,offset form
push ax
push bx
mov bl,40
mul bl
add si,ax
pop bx
pop ax
push ax
mov al,bl
mov ah,0
push bx
mov bl,2
div bl
add si,ax
pop bx
pop ax
cmp byte ptr [si],cl
jz rnext4
mov num,1
jmp jleftoblique1
rnext4:
inc num
cmp num,5
jz rvictory
jmp jexit
rvictory:
mov victory,1
mov num,1
jmp exit
jleftoblique1:
mov al,row
mov bl,col
mov cl,flag
dec al
dec bl
dec bl
mov si,offset form
push ax
push bx
mov bl,40
mul bl
add si,ax
pop bx
pop ax
push ax
mov al,bl
mov ah,0
push bx
mov bl,2
div bl
add si,ax
pop bx
pop ax
cmp byte ptr [si],cl
jz lbnext1
mov num,1
jmp jleftoblique2
lbnext1:
inc num
dec al
dec bl
dec bl
mov si,offset form
push ax
push bx
mov bl,40
mul bl
add si,ax
pop bx
pop ax
push ax
mov al,bl
mov ah,0
push bx
mov bl,2
div bl
add si,ax
pop bx
pop ax
cmp byte ptr [si],cl
jz lbnext2
mov num,1
jmp jleftoblique2
lbnext2:
inc num
dec al
dec bl
dec bl
mov si,offset form
push ax
push bx
mov bl,40
mul bl
add si,ax
pop bx
pop ax
push ax
mov al,bl
mov ah,0
push bx
mov bl,2
div bl
add si,ax
pop bx
pop ax
cmp byte ptr [si],cl
jz lbnext3
mov num,1
jmp jleftoblique2
lbnext3:
inc num
dec al
dec bl
dec bl
mov si,offset form
push ax
push bx
mov bl,40
mul bl
add si,ax
pop bx
pop ax
push ax
mov al,bl
mov ah,0
push bx
mov bl,2
div bl
add si,ax
pop bx
pop ax
cmp byte ptr [si],cl
jz lbnext4
mov num,1
jmp jleftoblique2
lbnext4:
inc num
cmp num,5
jz lbvictory
jmp jexit
lbvictory:
mov victory,1
mov num,1
jleftoblique2:
mov al,row
mov bl,col
mov cl,flag
inc al
inc bl
inc bl
mov si,offset form
push ax
push bx
mov bl,40
mul bl
add si,ax
pop bx
pop ax
push ax
mov al,bl
mov ah,0
push bx
mov bl,2
div bl
add si,ax
pop bx
pop ax
cmp byte ptr [si],cl
jz lb1next1
mov num,1
jmp jrightoblique1
lb1next1:
inc num
inc al
inc bl
inc bl
mov si,offset form
push ax
push bx
mov bl,40
mul bl
add si,ax
pop bx
pop ax
push ax
mov al,bl
mov ah,0
push bx
mov bl,2
div bl
add si,ax
pop bx
pop ax
cmp byte ptr [si],cl
jz lb1next2
mov num,1
jmp jrightoblique1
lb1next2:
inc num
inc al
inc bl
inc bl
mov si,offset form
push ax
push bx
mov bl,40
mul bl
add si,ax
pop bx
pop ax
push ax
mov al,bl
mov ah,0
push bx
mov bl,2
div bl
add si,ax
pop bx
pop ax
cmp byte ptr [si],cl
jz lb1next3
mov num,1
jmp jrightoblique1
lb1next3:
inc num
inc al
inc bl
inc bl
mov si,offset form
push ax
push bx
mov bl,40
mul bl
add si,ax
pop bx
pop ax
push ax
mov al,bl
mov ah,0
push bx
mov bl,2
div bl
add si,ax
pop bx
pop ax
cmp byte ptr [si],cl
jz lb1next4
mov num,1
jmp jrightoblique1
lb1next4:
inc num
cmp num,5
jz lb1victory
jmp jexit
lb1victory:
mov victory,1
mov num,1
jmp jexit
jrightoblique1:
mov al,row
mov bl,col
mov cl,flag
inc al
dec bl
dec bl
mov si,offset form
push ax
push bx
mov bl,40
mul bl
add si,ax
pop bx
pop ax
push ax
mov al,bl
mov ah,0
push bx
mov bl,2
div bl
add si,ax
pop bx
pop ax
cmp byte ptr [si],cl
jz rb1next1
mov num,1
jmp jrightoblique2
rb1next1:
inc num
inc al
dec bl
dec bl
mov si,offset form
push ax
push bx
mov bl,40
mul bl
add si,ax
pop bx
pop ax
push ax
mov al,bl
mov ah,0
push bx
mov bl,2
div bl
add si,ax
pop bx
pop ax
cmp byte ptr [si],cl
jz rb1next2
mov num,1
jmp jrightoblique2
rb1next2:
inc num
inc al
dec bl
dec bl
mov si,offset form
push ax
push bx
mov bl,40
mul bl
add si,ax
pop bx
pop ax
push ax
mov al,bl
mov ah,0
push bx
mov bl,2
div bl
add si,ax
pop bx
pop ax
cmp byte ptr [si],cl
jz rb1next3
mov num,1
jmp jrightoblique2
rb1next3:
inc num
inc al
dec bl
dec bl
mov si,offset form
push ax
push bx
mov bl,40
mul bl
add si,ax
pop bx
pop ax
push ax
mov al,bl
mov ah,0
push bx
mov bl,2
div bl
add si,ax
pop bx
pop ax
cmp byte ptr [si],cl
jz rb1next4
mov num,1
jmp jrightoblique2
rb1next4:
inc num
cmp num,5
jz rb1victory
jmp jexit
rb1victory:
mov victory,1
mov num,1
jmp jexit
jrightoblique2:
mov al,row
mov bl,col
mov cl,flag
dec al
inc bl
inc bl
mov si,offset form
push ax
push bx
mov bl,40
mul bl
add si,ax
pop bx
pop ax
push ax
mov al,bl
mov ah,0
push bx
mov bl,2
div bl
add si,ax
pop bx
pop ax
cmp byte ptr [si],cl
jz jr2next1
mov num,1
jmp jexit
jr2next1:
inc num
dec al
inc bl
inc bl
mov si,offset form
push ax
push bx
mov bl,40
mul bl
add si,ax
pop bx
pop ax
push ax
mov al,bl
mov ah,0
push bx
mov bl,2
div bl
add si,ax
pop bx
pop ax
cmp byte ptr [si],cl
jz jr2next2
mov num,1
jmp jexit
jr2next2:
inc num
dec al
inc bl
inc bl
mov si,offset form
push ax
push bx
mov bl,40
mul bl
add si,ax
pop bx
pop ax
push ax
mov al,bl
mov ah,0
push bx
mov bl,2
div bl
add si,ax
pop bx
pop ax
cmp byte ptr [si],cl
jz jr2next3
mov num,1
jmp jexit
jr2next3:
inc num
dec al
inc bl
inc bl
mov si,offset form
push ax
push bx
mov bl,40
mul bl
add si,ax
pop bx
pop ax
push ax
mov al,bl
mov ah,0
push bx
mov bl,2
div bl
add si,ax
pop bx
pop ax
cmp byte ptr [si],cl
jz jr2next4
mov num,1
jmp jexit
jr2next4:
inc num
cmp num,5
jz jr2victory
jmp jexit