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]

  Function 01H (decimal 1) waits for character input from the standard input
  device and returns it in the AL register when available. This function
  should be compared with the other keyboard function calls, particularly
  functions 06H, 07H, and 08H.

  --------------------------------------------------------------------------
  NOTE:
    In DOS version 1, the standard input device is always the keyboard; the
    standard output device is always the video screen. In later DOS
    versions, however, standard input and output can be redirected to other
    devices such as files. DOS processes characters from the standard input
    device without distinguishing whether the actual input source is the
    keyboard or a stream of characters redirected from a file.
  --------------------------------------------------------------------------

  Here is how function 01H works: Keystrokes that result in an ASCII
  character are returned as 1 byte in AL and immediately reported by this
  function. The keystrokes that result in something other than an ASCII
  character (see page 135) generate 2 bytes, which must be obtained through
  two consecutive calls to this function.

  The usual way to use this function is to test whether it returns 00H in
  AL. If AL is not 00H, you have an ASCII character. If AL = 00H, you have a
  non-ASCII keystroke (which should be recorded), and this function should
  be repeated immediately to get the pseudo-scan code that represents the
  special key action. (See page 135 for a list of the actions, codes, and
  their meanings.) As with all the DOS keyboard input services, the scan
  code for ASCII characters is not available, even if the corresponding ROM
  BIOS keyboard services make it available. (See page 135.)

  The various DOS keyboard service functions are distinguished primarily by
  three criteria: whether they wait for input (or report no input when none
  is available); whether they echo input onto the display screen; and
  whether the standard break-key operation is active for that service.
  Function 01H performs all three operations: It waits for input, echoes
  input to the screen, and lets DOS execute interrupt 23H if Ctrl-C is
  pressed.

  Remember, function 01H always waits for the user to press a key before it
  returns to a program. If you don't want to wait, either use function
  0BH--before you call function 01H--to test whether a key was pressed, or
  use function 06H. Also, see functions 08H and 0CH for related services.

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