万网网站备案授权书,传播建设网站,图书网站开发,国家工商企业信用信息公示系统实验内容、程序清单及运行结果
访问CMOS RAM#xff08;课本实验14#xff09; 代码如下#xff1a;
assume cs:code
data segment
time db yy/mm/dd hh:mm:ss$ ;int 21h 显示字符串#xff0c;要求以$结尾
table db 9,8,7,4,2,0 ;各时间量的存放单元
data ends
cod…实验内容、程序清单及运行结果
访问CMOS RAM课本实验14 代码如下
assume cs:code
data segment
time db yy/mm/dd hh:mm:ss$ ;int 21h 显示字符串要求以$结尾
table db 9,8,7,4,2,0 ;各时间量的存放单元
data ends
code segment
start:
mov ax,data
mov ds,ax
mov si,offset table
mov di,offset time
mov cx,6
s:
push cx
mov al,ds:[si] ;读端口
out 70h,al
in al,71h
mov ah,al
mov cl,4
shr ah,cl ;将压缩BCD码分为两个BCD码
and al,00001111b
add ah,30h ;变为字符
add al,30h
mov ds:[di],ah
mov ds:[di1],al ;写进time
inc si
add di,3
pop cx
loop s mov ah,0
mov bh,0
mov dh,10 ;置光标于10行40列
mov dl,40
int 10h
mov dx,offset time
mov ah,9 ;显示字符串
int 21h
mov ax,4c00h
int 21h code ends
end start 结果如下