;TSR,用于在右上角显示时间
locals
.model tiny
.code
org 100h
start: jmp begin
oldint1c dd 0
kg dw 0
ts db '1978-07-03 12:34:56'
int1c proc
push ds
push es
push ax
push bx
push cx
push dx
push bp
push si
push cs
pop ds
mov ax,kg
mov cl,2
div cl
cmp ah,0
je @@1
jmp exitint1c
@@1: mov si,offset ts
mov bl,16
mov ah,4
int 1ah
mov al,ch
xor ah,ah
div bl
add ax,'00'
mov [si],ax
mov al,cl
xor ah,ah
div bl
add ax,'00'
mov [si+2],ax
mov al,dh
xor ah,ah
div bl
add ax,'00'
mov [si+5],ax
mov al,dl
xor ah,ah
div bl
add ax,'00'
mov [si+8],ax
mov ah,2
int 1ah
mov al,ch
xor ah,ah
div bl
add ax,'00'
mov [si+12],ax
mov al,cl
xor ah,ah
div bl
add ax,'00'
mov [si+15],ax
mov al,dh
xor ah,ah
div bl
add ax,'00'
mov [si+18],ax
mov ah,0fh
int 10h
mov ax,1300h
mov bl,70h
mov cx,20
mov dx,3ch
push cs
pop es
mov bp,offset ts
int 10h
exitint1c: pop si
pop bp
pop dx
pop cx
pop bx
pop ax
pop es
pop ds
iret
jmp cs:[oldint1c]
int1c endp
mark db 'sl'
lastbyte label byte
copyright db 'Clock for DOS '
db ' Copyright (c) 1994, LS',0dh,0ah,'$'
begin: push cs
pop ds
mov ah,9
mov dx,offset copyright
int 21h
mov ax,351ch
int 21h
add bx,offset mark-offset int1c
mov ax,es:[bx]
cmp ax,'ls'
jz turn
mov ax,351ch
int 21h
mov word ptr oldint1c,bx
mov ax,es
mov word ptr oldint1c+2,ax
mov ax,251ch
mov dx,offset int1c
int 21h
mov dx,offset lastbyte
mov cl,4
shr dx,cl
inc dx
mov ax,3100h
int 21h
turn: mov bx,offset kg
inc word ptr es:[bx]
mov ax,4c00h
int 21h
end start