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]

  All characters that appear on the display screen are composed of dots
  drawn within a grid called a character box or character matrix. (See
  Figure C-2.) The size of the character box depends on your video hardware
  as well as on the video mode you're using. For example, the Monochrome
  Display Adapter (MDA) uses a 9 x 14 character matrix; the text modes on
  the Color Graphics Adapter (CGA) uses 8 x 8 characters; the default 80 x
  25 text mode on the Enhanced Graphics Adapter (EGA) uses an 8 x 14
  character matrix; and the default text modes on the Video Graphics Array
  (VGA) use 9 x 16 characters. Characters are created by filling, or
  lighting, the appropriate dots in the grid. The more dots in a grid, the
  sharper the characters appear.

  +----------------------------------------------------------------------+
  |                                                                      |
  |     ## ## ## ## ## ## ## ##              # # # # # # # # # # #       |
  |                                          # # # # # # # # # # #       |
  |     ## ## ## ## ## ## ## ##              # # # # # # # # # # #       |
  |                                          # # # # # # # # # # #       |
  |     ## ## ## ## ## ## ## ##              # # # # # # # # # # #       |
  |                                          # # # # # # # # # # #       |
  |     ## ## ## ## ## ## ## ##              # # # # # # # # # # #       |
  |                                          # # # # # # # # # # #       |
  |     ## ## ## ## ## ## ## ##              # # # # # # # # # # #       |
  |                                          # # # # # # # # # # #       |
  |     ## ## ## ## ## ## ## ##              # # # # # # # # # # #       |
  |                                          # # # # # # # # # # #       |
  |     ## ## ## ## ## ## ## ##              # # # # # # # # # # #       |
  |                                          # # # # # # # # # # #       |
  |     ## ## ## ## ## ## ## ##              # # # # # # # # # # #       |
  |                                                                      |
  |               (a)                                  (b)               |
  +----------------------------------------------------------------------+

  Figure C-2.  The dot-matrix pattern displayed by (a) the Color Graphics
  Adapter and (b) the Monochrome Display Adapter.

  Dot-matrix printers also draw characters with a grid of dots. However,
  each model of printer may have its own particular way of drawing
  characters that may not exactly match the screen characters dot for dot.

  To see how characters appear, the three dot matrices in Figure C-3
  illustrate a Y, a y, and a semicolon, using the 8 x 8 character box.

  +-------------------------------------------------------------------+
  |  +---------------+      +---------------+      +---------------+  |
  |  | | |#|#| | |#|#|      |#|#|#|#|#|#|#|#|      |#|#|#|#|#|#|#|#|  |
  |  |-+-+-+-+-+-+-+-|      |-+-+-+-+-+-+-+-|      |-+-+-+-+-+-+-+-|  |
  |  | | |#|#| | |#|#|      |#|#|#|#|#|#|#|#|      |#|#| | |#|#|#|#|  |
  |  |-+-+-+-+-+-+-+-|      |-+-+-+-+-+-+-+-|      |-+-+-+-+-+-+-+-|  |
  |  | | |#|#| | |#|#|      | | |#|#| | |#|#|      |#|#| | |#|#|#|#|  |
  |  |-+-+-+-+-+-+-+-|      |-+-+-+-+-+-+-+-|      |-+-+-+-+-+-+-+-|  |
  |  |#| | | | |#|#|#|      | | |#|#| | |#|#|      |#|#|#|#|#|#|#|#|  |
  |  |-+-+-+-+-+-+-+-|      |-+-+-+-+-+-+-+-|      |-+-+-+-+-+-+-+-|  |
  |  |#|#| | |#|#|#|#|      | | |#|#| | |#|#|      |#|#| | |#|#|#|#|  |
  |  |-+-+-+-+-+-+-+-|      |-+-+-+-+-+-+-+-|      |-+-+-+-+-+-+-+-|  |
  |  |#|#| | |#|#|#|#|      |#| | | | | |#|#|      |#|#| | |#|#|#|#|  |
  |  |-+-+-+-+-+-+-+-|      |-+-+-+-+-+-+-+-|      |-+-+-+-+-+-+-+-|  |
  |  |#| | | | |#|#|#|      |#|#|#|#| | |#|#|      |#| | |#|#|#|#|#|  |
  |  |-+-+-+-+-+-+-+-|      |-+-+-+-+-+-+-+-|      |-+-+-+-+-+-+-+-|  |
  |  |#|#|#|#|#|#|#|#|      | | | | | |#|#|#|      |#|#|#|#|#|#|#|#|  |
  |  +---------------+      +---------------+      +---------------+  |
  +-------------------------------------------------------------------+

  Figure C-3.  The dot pattern of three characters in an 8 x 8 character
  box.

  Several rules apply to the character drawings:

  .  For standard characters, the two right columns are unused, providing
     separation between characters. These two columns are used only by
     characters that are supposed to fill the entire character box, such as
     the solid block character, ASCII DBH (decimal 129).

  .  The top two rows are used for ascenders (the parts of characters that
     are above the ordinary character height). The ascender space is used
     for capital letters and for such lowercase letters as b, d, and k.

  .  The bottom row is used for descenders (the parts of characters that
     drop below the line), as in the lowercase letters g and y.

  These general guidelines are occasionally compromised for overall effect.
  For example, the semicolon, our third example in Figure C-3, is shifted
  up one row from what you might expect so that it does not use the
  descender row.

  The dots that form each character on the screen are placed there by a
  specialized component of the video subsystem called a character generator.
  The character generator's task is to convert ASCII codes into the
  corresponding pattern of dots that make up a displayed character. The
  character generator accomplishes this by using ASCII codes as an index
  into a memory-resident bit pattern table that represents the displayed
  character's dot patterns.

  For example, Figure C-4 shows the table entry for an uppercase Y in an 8
  x 8 character box. Note how the pattern of ones and zeros in the character
  definition corresponds to the pattern of dots displayed for the character.

        Bit                            Value
  7 6 5 4 3 2 1 0                      (hex)
  --------------------------------------------------------------------------
  1 1 0 0 1 1 0 0                      CCH
  1 1 0 0 1 1 0 0                      CCH
  1 1 0 0 1 1 0 0                      CCH
  0 1 1 1 1 0 0 0                      78H
  0 0 1 1 0 0 0 0                      30H
  0 0 1 1 0 0 0 0                      30H
  0 1 1 1 1 0 0 0                      78H
  0 0 0 0 0 0 0 0                      00H
  --------------------------------------------------------------------------

  Figure C-4.  The coding of the 8 character bytes for the Y character.

  In some video modes, you have no control over the bit patterns that define
  the displayed characters. The MDA's character definitions, for instance,
  are stored in special ROM chips that can be accessed only by the adapter's
  character-generator circuitry. In many video modes, however, the character
  definition table resides in RAM, allowing you to redefine the bit patterns
  used by the character generator and create your own fonts or character
  sets. (See Chapter 9 for more about RAM-based character definitions.)

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