                                 Map of CMOS
                              Colected by Mumin
                             mumin0@box43.gnet.pl


1. Ports of CMOS

Port     Desc.
----     ------------
70h      Address port
71h      Data port


2. How to use these ports

Assembler code for reading/writing CMOS:
	mov al, Address	; your favorite address
	out 70h, al	; sending...
	mov cx, time	; I don't know what time is the best
    :loop		; 
	loop loop	; 
	in al,71h	; for writing - use out


3. Map of CMOS:

Reg.	Desc.
-----   --------------------
00h	Second of RTC in BCD
01h	Second of alarm in BCD
02h	Minute of RTC in BCD
03h	Minute of alarm in BCD
04h	Hour of RTC in BCD
05h	Hour of alarm in BCD
06h	Day of week (1=Sun, 2=Mon, ...)
07h	Day of month in BCD
08h	Month in BCD
09h	Year in BCD (last two numbers)
0Ah	RTC status A
0Bh	RTC status B
0Ch	RTC status C (Read-only)
0Dh	RTC status D
0Eh	Power-On-Self-Test status
0Fh	Reason of last reset
10h	Type of FDD's
	+---+---+---+---+---+---+---+---+
	| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
	+---+---+---+---+---+---+---+---+
	|    1nd FDD    |    2st FDD    |
	+---------------+---------------+
		0000 = Not installed
		0001 = 360kb , 5.25"
		0010 = 1.2Mb , 5.25"
		0011 = 720kb , 3.5"
		0100 = 1.44Mb, 3.5"
		0101 = 2.88Mb, 3.5"
11h	Reserved
12h	Type of HDD's
	+---+---+---+---+---+---+---+---+
	| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
	+---+---+---+---+---+---+---+---+
	|    1st HDD    |    2nd HDD    |
	+---------------+---------------+
		0000  = None
		1111  = type in reg 19h(C:)/1Ah(D:)
		other = type of predefined disks
13h	Reserved
14h	Equipment
15h	Base memory (low byte)
16h	Base memory (high byte)
17h	Extended memory (low byte) in Kb (0-3C00h)
18h	Extended memory (high byte) in Kb
19h	Type of 1st HDD (if not in 12h)
1Ah	Type of 2nd HDD (if not in 12h)
1Bh	Reserved
...	Reserved
2Dh	Reserved
2Eh	Checksum (low byte)
2Fh	Checksum (high byte)
30h	Extended memory (low byte) in Kb (0-3C00h)
31h	Extended memory (high byte) in Kb
32h	First two numbers of date in BCD
33h	Strange register ;]
...	Empty or other data(ie. colors)

length(CMOS)=	AT:     3Fh;
		better: 7Fh;
RTC - Real-Time Clock
BCD - ie. 34h=34 and ie.3Fh is not BCD.
alarm - run INT 4Ah and do nothing

4. Long description

Sometimes some of registers are write-protected. This is very stupid
protection, because you can write to register (no_reg+length(CMOS)).
Computer operate modulo on reg.

