改变1CH号中断显示时钟

改变1CH号中断,显示时钟:

代码
count_val = 18
dpage =
0
row =
0
column =
80-buff_len
color = 0f4h
;07h
code segment
assume
cs:code,ds:code
count dw count_val
hhhh db ?,?,
':'
mmmm db ?,?,
':'
ssss db ?,?
buff_len = $-offset hhhh
cursor dw ?
new1ch:
cmp cs:count,0
jz next
dec cs:count
iret
next:
mov cs:count,count_val
sti
push ds
push es
push ax
push bx
push cx
push dx
push si
push bp
push cs
pop ds
push ds
pop es
call get_t
mov bh,dpage
mov ah,3
int 10h
mov cursor,dx
mov bp,offset hhhh
mov bh,dpage
mov dh,row
mov dl,column
mov bl,color
mov cx,buff_len
mov al,0
mov ah,13h
int 10h
mov bh,dpage
mov dx,cursor
mov ah,2
int 10h
pop bp
pop si
pop dx
pop cx
pop bx
pop ax
pop es
pop ds
iret
get_t proc
mov ah,2
int 1ah
mov al,ch
call ttasc
xchg ah,al
mov word ptr hhhh,ax
mov al,cl
call ttasc
xchg ah,al
mov word ptr mmmm,ax
mov al,dh
call ttasc
xchg ah,al
mov word ptr ssss,ax
ret
get_t endp
ttasc proc
mov ah,al
and al,0fh
shr ah,1
shr ah,1
shr ah,1
shr ah,1
add ax,3030h
ret
ttasc endp
old1ch dd ?
start:
push cs
pop ds
mov ax,351ch
int 21h
mov word ptr old1ch,bx
mov word ptr old1ch+2,es
mov dx,offset new1ch
mov ax,251ch
int 21h
;...
mov ah,0
int 16h
lds dx,old1ch
int 21h
mov ah,4ch
int 21h
code ends
end start

 

posted @ 2010-12-21 11:09  Jekhn  阅读(475)  评论(0编辑  收藏  举报