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]

  Service 04H (decimal 4) reports the light-pen status on a CGA or EGA,
  specifically whether or not the pen has been triggered, and where it is on
  the screen if it has been triggered.

  Register AH is set to indicate triggering: If AH = 01H, the light pen has
  been triggered; if AH = 00H, it has not been triggered. If the pen has
  been triggered, the ROM BIOS determines the light pen's character column
  and pixel row (y-coordinate) from the video hardware. From these, the ROM
  BIOS computes the character row and pixel column (x-coordinate). The
  results are returned in registers BX, CX, and DX as shown in Figure 9-5.

  Service Number           Returns
  --------------------------------------------------------------------------
  AH = 04H                 DH = character row number
                           DL = character column number
                           CH = pixel line number (CGA and EGA video modes
                           04H, 05H, and 06H)
                           CX = pixel line number (all other EGA video
                           modes)
                           BX = pixel column number
  --------------------------------------------------------------------------

  Figure 9-5.  Light-pen position values returned by service 04H.

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