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.
CMOS
Re:CMOS
Maybe there should be a delay, between
good link:
http://www.codepedia.com/1/CMOS_C
Code: Select all
cli
mov al,6
out 0x70,al
;delay here
in al,0x71
sti
http://www.codepedia.com/1/CMOS_C
Re:CMOS
Before accesing rtc registers, i use this code to verify that it is ready :
but i think that you are doing something else wrong.
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
Re:CMOS
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.
http://en.wikipedia.org/wiki/Doomsday_algorithm
Maybe your BIOS is doing the same.