home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PROGRAMS / UTILS / TECLADO / NUML.ZIP / NUMLON.C < prev    next >
Encoding:
C/C++ Source or Header  |  1988-01-28  |  721 b   |  26 lines

  1. /*  By request, here's 6 lines of C to turn the NumLock on  */
  2. /*  Based on Fran Horvath's routine to turn it off.         */
  3. /*  Converted by Howard Sanner, 28 Jan 88.            */
  4.  
  5. typedef unsigned char (far *MEM);
  6.  
  7. /* Number lock function in C ---
  8.  * Sets number lock to ON.
  9.  * Assumes keyboard flag is at 0000:0417H in Model 60
  10.  *       Check your documentation and change
  11.  *       segment and offset below if not.
  12.  *       Also works fine on PCs and ATs.
  13.  */
  14.  
  15. num_lock()
  16.   {
  17.   MEM charset = ((MEM)(0x0000L << 16 )) + 0x0417L;
  18.   *charset |= 0x20;       /*  Turns Num Lock on if off  */
  19.   /*  Change the above line to: *charset &= 0xDF; to turn num lock OFF if it is ON.  */
  20.   }
  21.  
  22. main()
  23.   {
  24.   num_lock();
  25.   }
  26.