CMOS

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
xsix

CMOS

Post by xsix »

Hello. I've a problem with CMOS current day of week value, i don't know why, but it returns me the same value. The problem is that, i change time in CMOS setup and then current day of the week is also changed, but i can't understand why the simple code:
mov al, 6
out 0x70, al
in al, 0x71

Returns me value of 3 every time.
So.
Dex4u

Re:CMOS

Post by Dex4u »

Maybe there should be a delay, between

Code: Select all

cli
mov al,6
out 0x70,al
;delay here
in al,0x71 
sti
good link:
http://www.codepedia.com/1/CMOS_C
octavio

Re:CMOS

Post by octavio »

Before accesing rtc registers, i use this code to verify that it is ready :

Code: Select all

# al=10 cli out 70h,al in al,71h sti test al js <1

in fasm syntax:

l1: mov al,10 
    cli
    out 70h,al
    in al,71h
    sti
    test al,al
    js l1
but i think that you are doing something else wrong.
xenos

Re:CMOS

Post by xenos »

I had a similar problem and I found out that on some computers the day of week field in the CMOS registers simply doesn't work correctly. That's why I decided to compute the day of week manually using some fancy algorithm:
http://en.wikipedia.org/wiki/Doomsday_algorithm
Maybe your BIOS is doing the same.
Post Reply