read_time:
push ax
push bx
push cx
mov bx, offset time
mov cx, 4
; 读取秒
mov al, 0
out 70h, al
in al, 71h
mov ah, al
and al, 0fh
shr ah, cl
add al, '0'
add ah, '0'
mov [bx + 18], al
mov [bx + 17], ah
; 读取分
mov al, 2
out 70h, al
in al, 71h
mov ah, al
and al, 0fh
shr ah, cl
add al, '0'
add ah, '0'
mov [bx + 15], al
mov [bx + 14], ah
; 读取时
mov al, 4
out 70h, al
in al, 71h
mov ah, al
and al, 0fh
shr ah, cl
add al, '0'
add ah, '0'
mov [bx + 12], al
mov [bx + 11], ah
; 读取日
mov al, 7
out 70h, al
in al, 71h
mov ah, al
and al, 0fh
shr ah, cl
add al, '0'
add ah, '0'
mov [bx + 9], al
mov [bx + 8], ah
; 读取月
mov al, 8
out 70h, al
in al, 71h
mov ah, al
and al, 0fh
shr ah, cl
add al, '0'
add ah, '0'
mov [bx + 6], al
mov [bx + 5], ah
; 读取年
mov al, 9
out 70h, al
in al, 71h
mov ah, al
and al, 0fh
shr ah, cl
add al, '0'
add ah, '0'
mov [bx + 3], al
mov [bx + 2], ah
; 读取世纪
mov al, 32h
out 70h, al
in al, 71h
mov ah, al
and al, 0fh
shr ah, cl
add al, '0'
add ah, '0'
mov [bx + 1], al
mov [bx + 0], ah
pop cx
pop bx
pop ax
ret