[100分]小弟求大虾进来看看帮个忙,修改一下我的闹钟程序
作业的题目是:编写一个驻留内存的闹钟程序,具有整点报时和自定义报时功能,报时方式为PC喇叭发声(时间长一点)。报时过程中,可以中断
前几天一位热心的大哥,给了我一段程序,但我调试运行后,得不到相应的功能,又不知道问题出在哪里。请学长帮我看看,谢谢。调试好了,最好能把.asm文件和.exe文件发到我的信箱tjunforce@yahoo.com.cn。
附:csdsjkk大哥给的源程序(运行方式XX.exe hh:mm)
cseg segment
assume cs:cseg,ds:cseg
org 100h
start:
jmp begin
oldint1c dw ?,?
flag_busy db 0
hour db ?
second db ?
flag_bell db 0
bell proc near
; mov dl,'A' ;7
; mov ah,2
; int 21h
mov ax,0e07h
int 10h
ret
bell endp
bell0 proc near
; mov dl,'A' ;7
; mov ah,2
; int 21h
mov ax,0e07h
int 10h
ret
bell0 endp
int1c:
cmp cs:flag_busy,0
jne i9
mov cs:flag_busy,1
push ds
push ax
push bx
push cx
push dx
push cs
pop ds
cmp ax,'be'
jne i1
cmp bx,'ll'
jne i1
cmp dx,0
jne i10
pop dx
pop cx
mov ch,hour
mov cl,second
push cx
mov dx,-2
push dx
jmp i21
i10:
cmp dx,1
jne i1
mov hour,ch
mov second,cl
and flag_bell,00000001b
i1:
mov ah,2
int 1ah
cmp ch,hour
jne i200
cmp cl,second
jne i200
test flag_bell,2
jnz i21
or flag_bell,2
call bell
jmp i21
i200:
cmp cl,0
jne i2
i20:
test flag_bell,1
jnz i21
or flag_bell,1
call bell0
jmp i21
i2:
mov flag_bell,0
i21:
pop dx
pop cx
pop bx
pop ax
pop ds
mov cs:flag_busy,0
i9:
jmp dword ptr cs:oldint1c
begin:
mov ax,'be'
mov bx,'ll'
mov dx,0
int 1ch
cmp dx,-2
jne install
cld
mov si,81h
mov cx,0
x0:
lodsb
cmp al,0dh
je x9
cmp al,20h
je x0
cmp al,9
je x0
cmp al,':'
jne x1
xchg cl,ch
jmp x0
x1:
cmp al,'0'
jb x9
cmp al,'9'
ja x9
shl ch,1
shl ch,1
shl ch,1
shl ch,1
sub al,'0'
or ch,al
jmp x0
x9:
jcxz x91
xchg cl,ch
mov ax,'be'
mov bx,'ll'
mov dx,1
int 1ch
x91:
mov ax,'be'
mov bx,'ll'
mov dx,0
int 1ch
cmp dx,-2
jne x99
mov ah,2
mov dl,ch
shr dl,1
shr dl,1
shr dl,1
shr dl,1
add dl,30h
int 21h
mov dl,ch
and dl,0fh
add dl,30h
int 21h
mov dl,':'
int 21h
mov dl,cl
shr dl,1
shr dl,1
shr dl,1
shr dl,1
add dl,30h
int 21h
mov dl,cl
and dl,0fh
add dl,30h
int 21h
x99:
mov ah,4ch
int 21h
install:
push ds
push cs
pop ds
mov ah,2
int 1ah
mov ax,351ch
int 21h
mov oldint1c,bx
mov oldint1c+2,es
mov dx,offset int1c
mov ax,251ch
int 21h
mov dx,cs
pop ax
sub dx,ax
mov ax,offset begin
mov cl,4
shr ax,cl
add dx,ax
inc dx
mov ax,3100h
int 21h
cseg ends
end start