📄 showtime.asm
字号:
code segment para
assume cs:code,ds:code
INT1C_HANDLER proc far
push ax
push bx
push cx
push dx
push si
push di
push bp
push ds
push es
sti
jmp start
count db ?
t db 10
hour db 2 dup(?),':'
minite db 2 dup(?),':'
second db 2 dup(?)
start: push cs
pop ds
inc count
cmp count,18
jb return
mov count,0
;gettime
mov ah,2ch
int 21h
;
xor ax,ax
mov al,ch
div t
lea bx,hour
or al,30h
mov [bx],al
or ah,30h
inc bx
mov [bx],ah
;
xor ax,ax
mov al,cl
div t
lea bx,minite
or al,30h
mov [bx],al
inc bx
or ah,30h
mov [bx],ah
;
xor ax,ax
mov al,dh
div t
lea bx,second
or al,30h
mov [bx],al
inc bx
or ah,30h
mov [bx],ah
;push cx
;push dx
call int_time
;pop cx
;pop dx
return: cli
pop es
pop ds
pop bp
pop di
pop si
pop dx
pop cx
pop bx
pop ax
iret
INT1C_HANDLER ENDP
int_time proc ;showtime
push ax
push ds
push es
push bx
push dx
mov ah,13h
push ds
pop es
lea bp,hour
mov al,0
mov cx,8
xor dx,dx
mov dl,48h
xor bx,bx
mov bl,2
int 10h
pop dx
pop bx
pop es
pop ds
pop ax
ret
int_time endp
h_len equ $-INT1C_HANDLER
MAIN proc far
mov dx,offset INT1C_HANDLER
mov ax,cs
mov ds,ax
mov count,0
mov al,1ch
mov ah,25h
int 21h
mov ah,31h
mov al,0
mov dx,((h_len+15)/16)+10h
int 21h
MAIN endp
code ends
end MAIN
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -