DATAS SEGMENT
DATAS ENDS STACKS SEGMENT
STACKS ENDS
extra segment
extra ends
CODES SEGMENT
ASSUME CS:CODES,DS:DATAS,SS:STACKS,es:extra
begin: jmp start1
num1 db 1d dup(0)
num2 db 1d dup(0)
num3 db 1d dup(0)
num4 db 1d dup(0)
num5 db 1d dup(0)
num6 db 1d dup(0)
num7 db 1d dup(0)
num0 db 2d dup(0),2d dup(0),'-',2d dup(0),'-',2d dup(0),',',2d dup(0),':',2d dup(0),':',2d dup(0),'$'
lihao1 proc
pushf
push ax
push bx
push cx
push dx
push ds mov ax,cs
mov ds,ax MOV AX,DATAS
MOV DS,AX
mov es,ax
mov ah,04h
int 1ah
mov si,0
mov [si],ch
mov [si+1],cl
mov [si+2],dh
mov [si+3],dl
MOV si,OFFSET num1
mov dx,2d
mov bx,2d
call lihao
mov bp,offset num0
mov cx,2
mov dh,0
mov dl,2
mov bh,0
mov al,0
mov bl,02d
mov ah,13h
int 10h
MOV si,OFFSET num2
mov dx,4d
mov bx,2d
call lihao
mov bp,(offset num0) + 2d
mov cx,2
mov dh,0
mov dl,4
mov bh,0
mov al,0
mov bl,02d
mov ah,13h
int 10h
;以上是显示年份
mov si,offset num3
mov dx,7d
mov bx,2d
call lihao
mov bp,(offset num0) + 5
mov cx,2
mov dh,0
mov dl,7
mov bh,0
mov al,0
mov bl,02d
mov ah,13h
int 10h
;以上是显示月 mov si,offset num4
mov dx,10d
mov bx,2d
call lihao
mov bp,(offset num0) + 8
mov cx,2
mov dh,0
mov dl,10
mov bh,0
mov al,0
mov bl,02d
mov ah,13h
int 10h
;以上是显示日
mov ah,02h
int 1ah
mov si,0
mov ds:[si+4],ch
mov ds:[si+5],cl
mov ds:[si+6],dh
mov ds:[si+7],dl
mov si,offset num5
mov dx,13d
mov bx,2d
call lihao
mov bp,(offset num0) + 11
mov cx,2
mov dh,0
mov dl,13
mov bh,0
mov al,0
mov bl,02d
mov ah,13h
int 10h
;以上是显示小时
mov si,offset num6
mov dx,16d
mov bx,2d
call lihao
mov bp,(offset num0) + 14
mov cx,2
mov dh,0
mov dl,16
mov bh,0
mov al,0
mov bl,02d
mov ah,13h
int 10h
;以上是显示分钟 mov si,offset num7
mov dx,19d
mov bx,2d
call lihao
mov bp,(offset num0) + 17
mov cx,2
mov dh,0
mov dl,19
mov bh,0
mov al,0
mov bl,02d
mov ah,13h
int 10h
;以上是显示秒钟
pop ds
pop dx
pop cx
pop bx
pop ax
iret
lihao1 endp lihao proc
mov ax,[SI]
mov di,dx
mov cx,bx
mov bx,16d
L1: mov dx,0
div bx
dec di
add dl,30h
mov num0[di],dl
loop L1
ret
lihao endp START1:
PUSH CS
POP DS mov al,1ch
mov ax,cs
mov ds,ax
mov dx,offset lihao1
mov ah,25h
int 21h
mov dx,offset lihao1
sub dx,offset start1
mov cl,4d
shr dx,cl
ADD DX,11H
mov ah,31h
int 21h
CODES ENDS
END begin
|