Accessing Century byte via RTC
Bug #659276 reported by
Ian Seyler
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Invalid
|
Undecided
|
Unassigned |
Bug Description
With the RTC configure for Binary instead of BCD I am getting the incorrect result for Century.
mov al, 0x0B ; Set RTC to binary mode
out 0x70, al
in al, 0x71
bts ax, 2
mov bl, al
mov al, 0x0B
out 0x70, al
mov al, bl
out 0x71, al
mov al, 0x32 ; Century
out 0x70, al
in al, 0x71
In QEMU 0.12.5 it returns 0x20 but should return 0x14. The following work correctly:
mov al, 0x09 ; Year
out 0x70, al
in al, 0x71
mov al, 0x08 ; Month
out 0x70, al
in al, 0x71
mov al, 0x07 ; Day
out 0x70, al
in al, 0x71
To post a comment you must log in.
The century register is only present in "recent" version of the chip, and is at an address corresponding to the NVRAM memory. It is not manipulated directly by the RTC and therefore is always in BCD format. The current QEMU implementation is correct.