Page 1 of 1

CMOS

Posted: Thu Mar 02, 2006 2:15 pm
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.

Re:CMOS

Posted: Thu Mar 02, 2006 3:32 pm
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

Re:CMOS

Posted: Fri Mar 03, 2006 3:04 am
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.

Re:CMOS

Posted: Sat Mar 04, 2006 2:04 am
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.