From: James Vahn
Subj: Cmos
____________________________________________________________________________

The standard AT CMOS addresses from 00h to 3Fh are easy,

;    Read CMOS
mov al,addr     ; 'addr' ranges from 00h to 3Fh.
out 70h,al      ;  wakes up the port.
jmp $+2         ;  a delay loop..
in al,71h       ;  reads CMOS.

;    Write CMOS
mov al,addr     ; 'addr' ranges from 00h to 3Fh.
out 70h,al      ;  wakes up the port.
jmp $+2         ;  a delay loop..
out 71h, value  ;  Writes 'value' from 00h to FFh.
                ;    note that 'addr' 10h to 20h are checksummed.


Some CMOS info...

  addr        contents

  00h         Seconds
  01h         Second Alarm
  02h         Minutes
  03h         Minute Alarm
  04h         Hours
  05h         Hour Alarm
  06h         Day of the Week
  07h         Day of the Month
  08h         Month
  09h         Year
  0Ah         Status Register A
  0Bh         Status Register B
  0Ch         Status Register C
  0Dh         Status Register D
  0Eh         Diagnostic Status Byte
  0Fh         Shutdown Status Byte
  10h         Disk Drive Type for Drives A: and B:
              The drive-type bytes use bits 0:3 for the first
              drive and 4:7 for the other disk drive types.
  00h         no drive present
  01h         double sided 360k
  02h         high capacity (1.2 meg)
  03h-0Fh     reserved
  11h         (AT):Reserved    (PS/2):drive type for hard disk C:
  12h         (PS/2):drive type for hard disk D:
              (AT, XT/286):hard disk type for drives C: and D:
  Format of drive-type entry for AT, XT/286:
  0       number of cyls in drive (0-1023 allowed)
  2       number of heads per drive (0-15 allowed)
  3       starting reduced write compensation (not used on AT)
  5       starting cylinder for write compensation
  7       max. ECC data burst length, XT only
  8       control byte
  Bit
  7       disable disk-access retries
  6       disable ECC retries
  5-4     reserved, set to zero
  3       more than 8 heads
  2-0     drive option on XT (not used by AT)
  9       timeout value for XT (not used by AT)
  12      landing zone cylinder number
  14      number of sectors per track (default 17, 0-17 allowed)
  13h         Reserved
  14h         Equipment Byte (corresponds to sw. 1 on PC and XT)
  15h-16h     Base Memory Size      (low,high)
  17h-18h     Expansion Memory Size (low,high)
  19h-20h     Reserved
          (PS/2) POS information Model 50 (60 and 80 use a 2k
          CMOS RAM that is not accessible through software)
  21h-2Dh     Reserved (not checksumed)
  2Eh-2Fh     Checksum of Bytes 10 Through 20  (low,high)
  30h-31h     Exp. Memory Size as Det. by POST (low,high)
  32h         Date Century Byte
  33h         Information Flags (set during power-on)
  34h-3Fh     Reserved - Put Your Name Here.