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 0AH (decimal 10) puts the power of the DOS editing keys to work
  in your programs. The function gets a complete string of input, which is
  presented to your programs whole, rather than character by character. If
  you assume that the input is actually from live keyboard action and is not
  redirected elsewhere, the full use of the DOS editing keys is available to
  the person who is typing the input string. When the Enter key is pressed
  (or a carriage return, ASCII 0DH (decimal 13), is encountered in the input
  file), the input operation is complete and the entire string is presented
  to your program.

  This function provides many advantages, particularly to those programs
  needing complete, coherent strings of keyboard input, rather than
  byte-by-byte input. The two foremost benefits are that you are spared the
  effort of writing detailed input-handling code, and your programs' users
  are given a familiar set of input editing tools: the DOS editing
  conventions.

  To use this function, you must provide DOS with an input buffer area where
  the input string will be built. The register pair DS:DX points to this
  buffer when you call the function. The first 3 bytes of this buffer have
  specific purposes:

  .  The first byte indicates the working size of the buffer (the number of
     bytes that DOS can use for input).

  .  The second byte is updated by DOS to indicate the actual number of
     bytes input.

  .  The third byte is the beginning of the input string, which consists
     entirely of ASCII characters. The end of the input string is signaled
     by the carriage-return character, ASCII 0DH. Although the carriage
     return is placed in the buffer, it is not included in the character
     count that DOS returns in the second byte.

  By these rules, the longest buffer you can give DOS is 255 working bytes,
  and the longest string that DOS can return is 1 byte less than the working
  length. Because the first 2 bytes of the buffer are used for status
  information, the actual working size of the buffer is 2 bytes less than
  the buffer's overall size. This may explain some of the mysteries of the
  input conventions in both DOS and BASIC.

  If input continues beyond what DOS can place in the buffer (which is 1
  byte short of its working length), then DOS will discard any further
  input, beeping all the while, until a carriage return is encountered.

  See function 0CH for a variation of this function.

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