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]

  If you want to gain a deeper understanding of the PC's keyboard operation,
  study the ROM BIOS program listing in the IBM technical reference manuals
  for the PC, PC/XT, or PC/AT. If you do this, be careful to avoid making a
  simple mistake that is common when anyone first studies the ROM BIOS,
  particularly the interrupts used by the ROM BIOS. The ROM BIOS provides
  two different interrupts for the keyboard: one that responds to keyboard
  hardware interrupts (interrupt 09H) and collects keyboard data into the
  low-memory buffer, and one that responds to a software interrupt
  requesting keyboard services (interrupt 16H, decimal 22) and passes data
  from the low-memory buffer to DOS and your programs. It is easy to confuse
  the operation of these two interrupts, and it is just as easy to further
  confuse them with the break-key interrupts, 1BH and 23H (decimal 27 and
  35). The table in Figure 6-8 lists the keyboard interrupts.

  Interrupt
  Hex   Dec          Origin of         Use
                     Interrupt
  --------------------------------------------------------------------------
  09H    9           Keyboard          Signals keyboard action.

  16H   22           User program      Invokes standard BIOS keyboard
                                       services. (See Chapter 11.)

  1BH   27           ROM BIOS          Occurs when Ctrl-Break is pressed
                                       under BIOS control; a routine is
                                       invoked if you create it.

  23H   35           DOS               If you create it, an interrupt
                                       routine is invoked when a break-key
                                       combination is pressed under DOS
                                       control.
  --------------------------------------------------------------------------

  Figure 6-8.  The interrupts related to keyboard action.

  A general theme running throughout this book advises you not to play fast
  and loose, but to play by the rules. This means, again, to write programs
  that are general to the IBM PC family rather than tied to the quirks of
  any one model, and to write programs that use portable means (such as DOS
  or ROM BIOS services) to manipulate data, instead of direct hardware
  programming. These rules apply to keyboard programming as much as they do
  to any other type of programming.

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