|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
互相学习 加油加油加油
assume cs:code,ds:data,ss:stack
data segment
db 64 dup(0)
ends data
stack segment
db 64 dup(0)
ends stack
code segment
s1: db 'NN/YY/RR SS:FF:MM',0
s2: db 9,8,7,4,2,0
start:
call r_screen ; 清屏
call ini_reg ;设置 数据从哪来 数据到哪里去
call show_style ;显示格式
call show_time ;显示时间
mov ax,4c00H
int 21H
;=======================================================
show_time:
mov si,offset s2
mov di,160*12+30*2
mov cx,6
gain_time: mov al,ds:[si]
out 70H,al
in al,71H
mov ah,al
shr ah,1
shr ah,1
shr ah,1
shr ah,1
and al,00001111B
add ah,30H
add al,30H
mov es:[di],ah
mov es:[di+2],al
inc si
add di,6
loop gain_time ;循环获取时间
jmp show_time ;跟随时间变化
ret
;=======================================================
show_style: push dx
push ds
push es
push si
push di
mov si,offset s1
mov di,160*12+30*2
infinite: mov dl,ds:[si]
cmp dl,0
je return
mov es:[di],dl
mov byte ptr es:[di+1],2
inc si
add di,2
jmp infinite
return: pop di
pop si
pop es
pop ds
pop dx
ret
;=======================================================
ini_reg:
mov bx,cs
mov ds,bx
mov bx,0b800H
mov es,bx
ret
;=======================================================
r_screen:
mov bx,0b800H
mov es,bx
mov di,0
mov cx,2000
RSecreen: mov byte ptr es:[di],00000000B
mov byte ptr es:[di+1],000000010B
add di,2
loop RSecreen
ret
code ends
end start |
|