求助 帮忙看看哪错了啊
data segmentbuffer db 200 dup(?)
db1 db 1
db2 db 0
db3 db 00h
msg1 db 'THE TABLE: THE DRAWING AREA:(press "esc" key to exit)','$'
data ends
program segment
main proc far
assume cs:program,ds:data
start:
push ds
sub ax,ax
push ax
mov ax,data
mov ds,ax
mov ah,09
lea dx,msg1 ;显示信息
int 21h
mov bx,26
mov db1,0 ;显示分界线
mov db2,36
op:
mov ah,2
mov bh,0
mov dh,db1 ;初始化光标
mov dl,db2
int 10h
mov bh,0
mov cx,1
mov al,2ah
mov ah,0ah
int 10h
inc db1
dec bx
jnz op
mov db1,1
mov db2,0
mov si,0
op1: ;制作图形元素表
mov ah,2
mov bh,0
mov dh,db1 ;定位光标
mov dl,db2
int 10h
mov al,db3
mov buffer[si],al ;显示数字并存入ASCII码
push si
add si,30h
mov bh,0
mov ax,si
and ax,00ffh
mov cx,1
mov ah,0ah
int 10h
inc db2
cmp db2,39 ;判断是否过界
jna op2
inc db1
mov db2,0
op2: mov ah,2
mov bh,0
mov dh,db1 ;重定位光标
mov dl,db2
int 10h
mov ah,0ah
mov bh,0 ;显示字符
mov al,db3
mov cx,1
int 10h
pop si
inc si
inc db3
cmp db3,09h
ja over
add db2,7
cmp db2,39 ;判断是否过界
jna op1
inc db1
mov db2,0
jmp op1
over:
mov db1,1
mov db2,38
mov ah,2
mov bh,0
mov dh,1
mov dl,38 ;初始化光标
int 10h
opp0:
mov ah,0
int 16h ;判断输入键
cmp ah,48h ;方向键
je up
cmp ah,50h
je down
cmp ah,4dh
je right
cmp ah,4bh
je left
cmp ah,01h ;ESC键
jnz rr
ret
rr: cmp al,30h ;数字键
jnb opp2
jmp opp0
opp2:
cmp al,39h
ja opp0
and ax,00ffh
sub ax,30h
mov si,ax
mov al,buffer[si] ;显示相应字符
mov bh,0
mov cx,1
mov ah,0ah
int 10h
jmp opp0
up:
dec db1
jz edg_up
jmp opp1 ;定界线
edg_up:
mov db1,1
jmp opp1
down:
inc db1
cmp db1,24
ja edg_down
jmp opp1
edg_down:
mov db1,24
jmp opp1
right:
inc db2
cmp db2,78
ja edg_right
jmp opp1
edg_right:
mov db2,78
jmp opp1
left:
dec db2
cmp db2,38
jb edg_left
jmp opp1
edg_left:
mov db2,38
opp1:
mov ah,2
mov bh,0 ;重定位光标
mov dh,db1
mov dl,db2
int 10h
jmp opp0
exit:
ret ;返回DOS
main endp
program ends
end start