不知道是什么意思,求大神查错,谢谢
;此程序是一个计时器,输入一个小于60的分钟数,然后从00:00(分:秒)开始显示,在21行处出错了,data segment
m db 0 ;分钟
s db 0 ;秒钟
count db 18
buf byte '0'
data ends
code segment ;代码段
assume cs:code,ds:data
CURSOR MACRO ROW
MOV AH,2
MOV BH,0
MOV DH,ROW
MOV DL,60
INT 10H
ENDM
display macro buf ;数制的调整
mov bl,buf ;这一行报错,invalid character in file
mov cl,4
rol bl,cl
mov dl,bl
and dl,00001111b
add dl,30h
mov ah,2
int 21h
mov cl,4
rol bl,cl
mov dl,bl
and dl,00001111b
add dl,30h
mov ah,2
int 21h
endm
start:
mov ax,data
mov ds,ax
mov ah,2 ;读取系统时钟 出口参数分别CH:CL:DH
int 1ah
mov m ,cl ;分钟放入minute
mov s ,dh ;秒放入second
cursor 0
call dsp
mov al,1ch
mov ah,35h
int 21h
push es
push bx
push ds
mov dx,offset timer
mov ax,seg timer
mov ds,ax
mov al,1ch
mov ah,25h
int 21h
pop ds
in al,21h
and al,11111110b
out 21h,al
cyc:
jmp cyc
pop dx
pop ds
mov al,1ch
mov ah,25
int 21h
mov ah,4ch
int 21h
dsp proc near
push ax ;输出时间
push bx
push cx
push dx
display m
mov dl,':'
int 21h
display s
pop dx
pop cx
pop bx
pop ax
ret;dsp返回
dsp endp
timer proc near ;时钟中断
push ax
push dx
mov ax,data
mov ds,ax
dec count
jnz done
mov al,s
add al,1
daa
mov s ,al
cmp s ,60h
; das
jnz dis
mov s ,0
mov al,m
add al,1
daa
mov m ,al
cmp m ,60h
;das
jnz dis
jmp end start //结束程序
daa
dis:
mov count,18
cursor 0
call dsp
done:
pop ax
pop dx
iret ;中断返回
timer endp
mov ah,07h ;键盘接收字符,07号调用无回显
int 21h
cmp al,0dh ;与输入回车比较,相等跳转至clear(清屏)
je clear
;mov ax,31h ;终止并驻留
;int 21h
clear:
mov ah,0fh ;取当前显示方式
int 10h
mov ah,00h ;设置显示方式
int 10h
mov ah,4ch ;返回DOS
int 21h
code ends
end start