[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Accessing the CMOS


The CMOS memory exists outside of the normal address space and cannot
contain directly executable code. It is reachable through IN and OUT
commands at port number 70h (112d) and 71h (113d). To read a CMOS byte,
an OUT to port 70h is executed with the address of the byte to be read and
an IN from port 71h will then retrieve the requested information. The
following BASIC fragment will read 128 CMOS bytes and print them to the
screen in 8 rows of 16 values.

Note that if the CMOS only has 64 bytes available, addressing will
generally wrap and addresses from 40h-7Fh will mirror 00h-3Fh. Output will
be hexadecimal.

10 CLS
20 FOR i = 0 TO &H7F
30 OUT &H70, i
40 PRINT USING "\   \"; HEX$(INP(&H71));
50 NEXT i
60 PRINT " "


Note: where not otherwise noted, all data points are expressed as BYTES
      these are eight bit values and are read from MSB to LSB e.g.
      0000 0000     0101 1010 binary would be written as 5Ah
      7654 3210     where only some bits are used this is represented with
                    Xs e.g bits 5-3 would be shown as 00xx x000

This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson