王爽<<汇编语言>> 实验十四

 ;以"年/月/日 时:分:秒"的格式, 显示当前的日期, 时间
assume cs:code
code segment
main:
mov al,
out 70h,al ;告诉CMOS RAM将要访问的存储单元编号
in al,71h ;从该存储单元中读入数据 mov ah,al
mov cl,
shr al,cl
add al,30h ;显示的年份的十位的ascii码
and ah,00001111b
add ah,30h ;显示的年份的个位的ascii码 mov bx,0b800h
mov es,bx
mov byte ptr es:[*+*],al
mov byte ptr es:[*+*],ah ;显示年 mov byte ptr es:[*+*],'/' ;显示'/' mov al,
out 70h,al ;告诉CMOS RAM将要访问的存储单元编号
in al,71h ;从该存储单元中读入数据 mov ah,al
mov cl,
shr al,cl
add al,30h ;显示的年份的十位的ascii码
and ah,00001111b
add ah,30h ;显示的年份的个位的ascii码 mov byte ptr es:[*+*],al
mov byte ptr es:[*+*],ah ;显示月 mov byte ptr es:[*+*],'/' ;显示'/' mov al,
out 70h,al ;告诉CMOS RAM将要访问的存储单元编号
in al,71h ;从该存储单元中读入数据 mov ah,al
mov cl,
shr al,cl
add al,30h ;显示的年份的十位的ascii码
and ah,00001111b
add ah,30h ;显示的年份的个位的ascii码 mov byte ptr es:[*+*],al
mov byte ptr es:[*+*],ah ;显示日 mov byte ptr es:[*+*],' ' ;显示' ' mov al,
out 70h,al ;告诉CMOS RAM将要访问的存储单元编号
in al,71h ;从该存储单元中读入数据 mov ah,al
mov cl,
shr al,cl
add al,30h ;显示的年份的十位的ascii码
and ah,00001111b
add ah,30h ;显示的年份的个位的ascii码 mov byte ptr es:[*+*],al
mov byte ptr es:[*+*],ah ;显示时 mov byte ptr es:[*+*],':' ;显示':' mov al,
out 70h,al ;告诉CMOS RAM将要访问的存储单元编号
in al,71h ;从该存储单元中读入数据 mov ah,al
mov cl,
shr al,cl
add al,30h ;显示的年份的十位的ascii码
and ah,00001111b
add ah,30h ;显示的年份的个位的ascii码 mov byte ptr es:[*+*],al
mov byte ptr es:[*+*],ah ;显示分 mov byte ptr es:[*+*],':' ;显示':' mov al,
out 70h,al ;告诉CMOS RAM将要访问的存储单元编号
in al,71h ;从该存储单元中读入数据 mov ah,al
mov cl,
shr al,cl
add al,30h ;显示的年份的十位的ascii码
and ah,00001111b
add ah,30h ;显示的年份的个位的ascii码 mov byte ptr es:[*+*],al
mov byte ptr es:[*+*],ah ;显示秒 mov ax,4c00h
int 21h
code ends
end main
上一篇:发布 Google Chrome插件教程


下一篇:presto的动态化应用(一):presto节点的横向扩展与伸缩