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 05H (decimal 5) is handy because it lets you store keystroke data
  in the keyboard buffer as if a key were pressed. You must supply an ASCII
  code in register CL and a keyboard scan code in CH. The ROM BIOS places
  these codes into the keyboard buffer following any keystroke data that may
  already be present there.

  Service 05H lets a program process input as if it were typed at the
  keyboard. For example, if you call service 05H with the following data,
  the result is the same as if the keys R-U-N-Enter were pressed:

  CH = 13H, CL = 52H, call service 05H (the R key)
  CH = 16H, CL = 55H, call service 05H (the U key)
  CH = 31H, CL = 4EH, call service 05H (the N key)
  CH = 1CH, CL = 0DH, call service 05H (the Enter key)

  If your program did this when it detected that the F2 function key was
  pressed, the result would be the same as if the word RUN followed by the
  Enter key had been typed. (If you use BASIC, this should sound familiar.)

  Beware: The keyboard buffer can hold only 15 character codes, so you can
  call service 05H a maximum of 15 consecutive times before the buffer
  overflows and the function fails.

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