Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Peter Norton Programmer's Guide - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

  The ROM BIOS stores keyboard status information in several portions of the
  ROM BIOS data area in segment 40H in low memory. Your programs can use
  some of the ROM BIOS status variables to check the keyboard status or to
  modify ROM BIOS keyboard processing.

  The two keyboard status bytes at locations 0040:0017H (shown in Figure
  6-6) and 0040:0018H (shown in Figure 6-7) are coded with individually
  meaningful bits that indicate which shift keys and toggle keys are active.
  All the standard models of the PC family have these two bytes, although
  the bits representing the Sys Req, left Alt, and left Ctrl keys are
  updated only for the keyboards that support these keys.

  The status byte at 0040:0017H is particularly useful because it
  establishes the state of ROM BIOS keystroke processing. Changes to this
  status byte affect the next keystroke that the ROM BIOS processes.

        Bit
  7 6 5 4 3 2 1 0          Meaning
  --------------------------------------------------------------------------
  X . . . . . . .          Insert state: 1 = active; 0 = inactive
  . X . . . . . .          Caps Lock: 1 = active; 0 = inactive
  . . X . . . . .          Num Lock: 1 = active; 0 = inactive
  . . . X . . . .          Scroll Lock: 1 = active; 0 = inactive
  . . . . X . . .          1 = Alt pressed
  . . . . . X . .          1 = Ctrl pressed
  . . . . . . X .          1 = Left Shift pressed
  . . . . . . . X          1 = Right Shift pressed
  --------------------------------------------------------------------------

  Figure 6-6.  The coding of the keyboard status byte at location
  0040:0017H. Bits 4-7 are toggles; their values change each time the key is
  pressed. Bits 0-3 are set only while the corresponding key i s pressed.

        Bit
  7 6 5 4 3 2 1 0          Meaning
  --------------------------------------------------------------------------
  X . . . . . . .          1 = Ins pressed
  . X . . . . . .          1 = Caps Lock pressed
  . . X . . . . .          1 = Num Lock pressed
  . . . X . . . .          1 = Scroll Lock pressed
  . . . . X . . .          1 = Hold state active (Ctrl-Num Lock or Pause)
  . . . . . X . .          1 = Sys Req key pressed
  . . . . . . X .          1 = Left Alt key pressed
  . . . . . . . X          1 = Left Ctrl key pressed
  --------------------------------------------------------------------------

  Figure 6-7.  The coding of the keyboard status byte at location
  0040:0018H. These bits are set only while the corresponding key is
  pressed.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson