我这个程序为什么用MASM,TASM,NASM编译全都通不过。
我这个程序为什么用MASM,TASM,NASM编译全都通不过。.model small
;----------------------------------------------------------------------
;数据段
.data
;
x db 0
y db 0
;
win_time equ 5
chess_state dw ?
chess_x db ?
chess_y db ?
help_x db ?
help_y db ?
nothing1 db ?
nothing2 db ?
nothing3 db ?
chess_t db ?
person1 db ?
person2 db ?
person db ?
person_first db ?
jud db ?
;
person1_x equ 6
person1_y equ 3
person1_x1 equ 0
person1_y1 equ 0
person1_x2 equ 49
person1_y2 equ 14
;
person2_x equ 6
person2_y equ 68
person2_x1 equ 0
person2_y1 equ 64
person2_x2 equ 49
person2_y2 equ 79
;
map_x equ 6
map_y equ 20
map_x_end equ 44
map_y_end equ 58
map_x1 equ 6
map_y1 equ 15
map_x2 equ 44
map_y2 equ 63
;
answer_x equ 2
answer_y equ 28
answer_x1 equ 0
answer_y1 equ 15
answer_x2 equ 5
answer_y2 equ 63
;
end_x equ 47
end_y equ 26
end_x1 equ 45
end_y1 equ 15
end_x2 equ 49
end_y2 equ 63
;
map_size equ 19
map_over db ?
map db 400 dup(0)
;
string_doing db ' Want To Peace ! ','$'
string_person1 db ' P 1 : ','$'
string_person2 db ' P 2 : ','$'
string_p1 db ' Person 1 first . ','$'
string_p2 db ' Person 2 first . ','$'
string_win1 db ' Person 1 win. ','$'
string_win2 db ' Person 2 win. ','$'
string_peace db ' PEACE !!! ','$'
string_wrong db ' You can`t put here.','$'
string_end db ' I Want To End The Game ! ','$'
string_lose1 db ' P1 want to lose? ','$'
string_lose2 db ' P2 want to lose? ','$'
string_final1 db ' P1 win the final ! ','$'
string_final2 db ' P2 win the final ! ','$'
string_thank db ' Thank You Very Much !','$'
;
heart db 0,1,1,0,0,0,1,1,0
db 1,0,0,1,0,1,0,0,1
db 1,0,0,0,1,0,0,0,1
db 0,1,0,0,0,0,0,1,0
db 0,0,1,0,0,0,1,0,0
db 0,0,0,1,0,1,0,0,0
db 0,0,0,0,1,0,0,0,0
heart_size1 db 7
heart_size2 db 9
;
;----------------------------------------------------------------------
;清屏程序,gao_color为颜色,x1,y1,x2,y2为坐标
gao_clear_screen macro gao_color,x1,y1,x2,y2
push ax
push bx
push cx
push dx
;
mov ah,6
mov al,0
mov bh,gao_color
mov ch,x1
mov cl,y1
mov dh,x2
mov dl,y2
int 10h
;
pop dx
pop cx
pop bx
pop ax
endm
;----------------------------------------------------------------------
;画出当前状态
;辅助函数 1 , 判断x,y坐标在那个区域
gao_judge macro jud,x,y,x1,y1,x2,y2
local gao_judge_exit
;
mov jud,0
cmp x,x1
jl gao_judge_exit
cmp x,x2
jg gao_judge_exit
cmp y,y1
jl gao_judge_exit
cmp y,y2
jg gao_judge_exit
;
mov jud,1
;
gao_judge_exit:
;
endm
;辅助函数 2 , 输出相应语句的位置
gao_print_string macro string,x,y,gao_color
push ax
push bx
push cx
push dx
;
mov dh,x
mov dl,y
mov bx,offset string
mov al,[bx]
.while al!='$'
;
push bx
;
mov bh,0
mov ah,2
int 10h
;
mov bl,gao_color
mov bh,0
mov cx,1
mov ah,9
int 10h
;
pop bx
inc bx
inc dl
mov al,[bx]
.endw
;
pop dx
pop cx
pop bx
pop ax
endm
;辅助函数 3 - 1 , 打印当前棋盘一奇数行
gao_print_map_line1 macro x,y,gao_color
local gao_print_map_line1_repeat
push ax
push bx
push cx
push dx
;
mov dh,x
mov dl,y
mov bh,0
mov ah,2
int 10h
;
mov bh,0
mov ah,9
mov al,2bh
mov bl,gao_color
mov cx,1
int 10h
inc dl
mov cl,map_size
mov ch,0
;
gao_print_map_line1_repeat:
push cx
mov bh,0
mov ah,2
int 10h
;
mov al,2dh
mov bh,0
mov ah,9
mov cx,1
mov bl,gao_color
int 10h
inc dl
;
mov bh,0
mov ah,2
int 10h
;
mov al,2bh
mov bh,0
mov ah,9
mov bl,gao_color
int 10h
inc dl
pop cx
;
loop gao_print_map_line1_repeat
;
pop dx
pop cx
pop bx
pop ax
endm