(1)包含一個(gè)實(shí)時(shí)時(shí)鐘和一個(gè)128個(gè)存儲(chǔ)單元的RAM存儲(chǔ)器
(2)靠電池供電
(3)128個(gè)字節(jié)的RAM中,內(nèi)部時(shí)鐘始終占用0~0dh,其余單元用來保存系統(tǒng)配置信息,供系統(tǒng)啟動(dòng)時(shí)BIOS程序讀寫
(4)兩個(gè)端口,70h為地址端口,存放要訪問CMOS RAM單元的地址,71H為數(shù)據(jù)端口,從CMOS讀寫數(shù)據(jù)
(5)額外 shl 左移指令 shr 右移指令, 最后移出的一為寫入CF中,移動(dòng)位數(shù)大于1,則必須放入cl中
(6)昨天寫的讀取CMOS時(shí)間的程序。寫出來大家指點(diǎn)
assume cs:code,ds:data
data segment
db 9,8,7,4,2,0
db '// :: '
data ends
code segment
start:
mov ax,data
mov ds,ax
mov si,0
mov di,0
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
and al,00001111b
add ah,30h
add al,30h
mov dl,71h
mov bx,0b800h
mov es,bx
mov byte ptr es:[di].[160*12+40*2],ah
mov byte ptr es:[di].[160*12+40*2+1],dl
add di,2
mov byte ptr es:[di].[160*12+40*2],al
mov byte ptr es:[di].[160*12+40*2+1],dl
;inc si
add di,2
mov al,ds:[si].[6]
mov byte ptr es:[di].[160*12+40*2],al
mov byte ptr es:[di].[160*12+40*2+1],dl
add di,2
inc si
pop cx
loop s
mov ax,4c00h
int 21h
code ends
end start
posted on 2007-06-17 16:27
merlinfang 閱讀(1183)
評(píng)論(1) 編輯 收藏 引用 所屬分類:
匯編語言