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]

  In the PC/AT ROM BIOS (dated 06/10/85 and later) and in the PS/2 ROM BIOS,
  the keyboard interrupt handler (that is, the handler for hardware
  interrupt 09H) executes interrupt 15H with AH = 4FH and with AL equal to
  the keyboard scan code. This action has little effect: The ROM BIOS
  interrupt 15H, service 4FH (decimal 79) handler returns with the carry
  flag set, and the interrupt 09H handler continues processing the
  keystroke.

  If you write an interrupt handler for interrupt 15H, however, you can hook
  service 4FH and process keystrokes yourself. Install your handler by
  storing its segmented address in the interrupt 15H vector. (Be sure to
  save the previous contents of the interrupt 15H vector.) Your interrupt
  15H handler would do the following:

  IF (AH<>4FH)
          jump to default interrupt 15H handler
  ELSE
          process keyboard scan code in AL
          set or reset carry flag
          exit from interrupt handler

  If your handler processes the scan code in AL, it must either set or reset
  the carry flag before it returns control to the ROM BIOS interrupt 09H
  handler. Setting the carry flag indicates that the BIOS interrupt 09H
  handler should continue processing the scan code in AL: Clearing the carry
  flag causes the BIOS handler to exit without processing the scan code.

  The problem with using the ROM BIOS keyboard intercept is that other
  programs, including DOS itself, can and do process keystrokes before the
  ROM BIOS interrupt 09H handler ever has a chance to issue interrupt 15H.
  (These programs do this by pointing the interrupt 09H vector to their own
  handlers instead of to the default ROM BIOS handler.) Because your program
  can't determine if this is happening, you cannot rely on the ROM BIOS
  keyboard intercept to be called for every keystroke.

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