home *** CD-ROM | disk | FTP | other *** search
- /* Reset program for the Gateway HandBook battery timer, HBC.COM.
- NOT FOR USE ON ANYTHING OTHER THAN THE GATEWAY HANDBOOK!
- You have been warned, I will not be responsible if you trash your
- setup information!
- */
- #include <stdio.h>
- #include <conio.h>
-
- void main(void)
- {
- unsigned short hour, min;
- char buff[80];
-
- printf("RESET GATEWAY HANDBOOK BATTERY TIMER\n");
- _asm
- {
- mov al,3eh ; address of hours in cmos
- out 70h,al ; set up port address
- in al,71h ; move it
- mov hour,ax ; pick up hour
- mov al,3fh ; address of minutes in cmos
- out 70h,al ; set up port address
- in al,71h ; set it
- mov min,ax ; pick up minutes
- }
- printf("Current setting, %d hours, %d minutes\n\n", hour, min);
- printf("Set hours : ");
- gets(buff);
- hour = atoi(buff);
- printf("Set minutes: ");
- gets(buff);
- min = atoi(buff);
- _asm
- {
- mov al,3eh ; address of hours in cmos
- out 70h,al ; set up port address
- mov ax,hour ; prepare hour
- out 71h,al ; move it
- mov al,3fh ; address of minutes in cmos
- out 70h,al ; set up port address
- mov ax,min ; prepare minutes
- out 71h,al ; set it
- }
- }
-