home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR3 / LAPCLOCK.ZIP / HBCSET.C < prev    next >
C/C++ Source or Header  |  1993-09-09  |  1KB  |  45 lines

  1. /* Reset program for the Gateway HandBook battery timer, HBC.COM.
  2.    NOT FOR USE ON ANYTHING OTHER THAN THE GATEWAY HANDBOOK!
  3.    You have been warned, I will not be responsible if you trash your
  4.    setup information!
  5. */
  6. #include <stdio.h>
  7. #include <conio.h>
  8.  
  9. void main(void)
  10. {
  11.   unsigned short hour, min;
  12.   char buff[80];
  13.  
  14.   printf("RESET GATEWAY HANDBOOK BATTERY TIMER\n");
  15.   _asm
  16.   {
  17.     mov     al,3eh     ; address of hours in cmos
  18.     out     70h,al     ; set up port address
  19.     in      al,71h     ; move it
  20.     mov     hour,ax    ; pick up hour
  21.     mov     al,3fh     ; address of minutes in cmos
  22.     out     70h,al     ; set up port address
  23.     in      al,71h     ; set it
  24.     mov     min,ax     ; pick up minutes
  25.   }
  26.   printf("Current setting, %d hours, %d minutes\n\n", hour, min);
  27.   printf("Set hours  : ");
  28.   gets(buff);
  29.   hour = atoi(buff);
  30.   printf("Set minutes: ");
  31.   gets(buff);
  32.   min = atoi(buff);
  33.   _asm
  34.   {
  35.     mov     al,3eh     ; address of hours in cmos
  36.     out     70h,al     ; set up port address
  37.     mov     ax,hour    ; prepare hour
  38.     out     71h,al     ; move it
  39.     mov     al,3fh     ; address of minutes in cmos
  40.     out     70h,al     ; set up port address
  41.     mov     ax,min     ; prepare minutes
  42.     out     71h,al     ; set it
  43.    }
  44. }
  45.