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]

  One example of an installable device driver that comes as an optional part
  of DOS is the ANSI driver, a program that enhances the handling of
  keyboard input and screen output. As with any installable device driver,
  the ANSI driver is active only when you load it into DOS through the
  CONFIG.SYS file. The following CONFIG.SYS command activates the ANSI
  driver:

  DEVICE = ANSI.SYS

  Although the ANSI driver is an optional part of the IBM versions of DOS,
  it is an integral part of the DOS used on some computers similar to (but
  not fully compatible with) the IBM PC family. In such computers, the ANSI
  driver isn't installable--it's built into DOS, like the CON and PRN
  drivers.

  The ANSI driver monitors both the screen output and the keyboard input
  that pass through the standard DOS screen and keyboard services. (Keyboard
  or screen data that bypasses DOS is never seen or processed by the ANSI
  driver.)

  In monitoring the screen output, the ANSI driver looks for special codes
  that identify commands for the driver. The driver takes note of and then
  removes these commands so that the special command codes do not appear on
  the display screen. Instead, these driver command codes are sent to the
  command processor.

  Commands for the ANSI driver are identified by a special 2-byte code: The
  first byte is the "escape" character, ASCII 1BH (decimal 27), and the
  second is the left-bracket character [, ASCII 5BH (decimal 91). Following
  these identifying bytes are the command parameters and finally the command
  code itself. The command parameters are either numbers (in the form of
  ASCII numeric characters interpreted as decimal digits) or strings of
  ASCII characters enclosed in quotes, like this: "a string parameter."
  Multiple parameters are separated by semicolons. The command code itself,
  which completes the ANSI driver command, is always a single alphabetic
  character. Commands are case-sensitive; for example, lowercase h is one
  command, and uppercase H is an entirely different one.

  To show what these commands look like, here are two examples, one simple
  and one complex (the caret stands for the escape character, 1BH):

  [1C
  [65;32;66;"Re-mapped B"p

  The ANSI driver recognizes a large number of commands, but they all fall
  into two broad categories: screen control commands and keyboard
  translation commands. Let's look at screen control first.

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