home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-387-Vol-3of3.iso
/
r
/
revlcd16.zip
/
CMOS.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-03-28
|
2KB
|
58 lines
// cmos: a CMOS-RAM viewer
//
// version 1.1 Mar. 28 1993
//
// version 1.1 Initial version
//
// written by NoZomi Ytow
// Copyright(C) 1993 NoZomi Ytow
//
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 1, or (at your option)
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#if defined __GNUC__
#include <asm/io.h>
#define inp inb_p
#define outp(port,value) outb_p((port),(value))
#else
#include <dos.h>
#include <stdio.h>
#endif
int main(void)
{
printf(" ");
for(int addr = 0x0; addr < 0x10; addr++){
printf(" %2x",addr);
}
for(addr = 0x0; addr < 0x80;){
printf("\nCMOS RAM[%2x] = ", addr);
for(int d =0; d < 0x10; d++, addr++){
outp(0x70, addr);
printf(" %2x", inp(0x71));
}
}
for(addr = 0x0; addr < 0x80;){
printf("\nexCMOS RAM[%2x] = ", addr);
for(int d =0; d < 0x10; d++, addr++){
outp(0x74, addr);
printf(" %2x", inp(0x76));
}
}
printf("\n\n");
return addr;
}