Color Graphics Adapter (CGA)

▌Overview▐█ 
  The CGA is the "lowest common denominator" color video system.  It is
  the original color system shipped with the IBM-PC circa 1981.  TECH Help!
  covers the following CGA and general video topics:

   Video Services ..... INT 10H video services
   Video Modes ........ includes CGA modes
   Video Memory Layouts accessing CGA video memory
   Video Snow ......... about CGA video programming peculiarities

   BIOS Data Area ..... includes video-specific variables in low memory

   Screen Attributes .. codes determine colors for text mode
   Color Table ........ exhaustive listing of screen attributes

   CGA I/O Ports ...... I/O port addresses; video controller registers
   CGA Pin Outs ....... connectors on CGA cards

   INT 1dH ............ video initialization table
   INT 1fH ............ font definitions of chars 128-255 in graphics modes

  CGAs are limited to 25-lines or 80 or 40 columns in text mode.  In
  graphics mode, it supports 320x200 4-color and 640-200 2-color modes only.
  Its video memory begins at b800:0000 and it supports up to 8 "pages" of
  video in text mode.

  If your program writes directly to CGA video memory, it is important to
  write special code to avoid annoying screen flicker.  See Video Snow.

  EGA, VGA, and SuperVGA are all upwardly-compatible with CGA, supporting
  all of its modes, I/O ports, and BIOS variables.

█▌Testing for a CGA▐█
  Use INT 11H (equipment list) and check bits 4 & 5; if (w AND 30H) is 30H,
  then you are running on an MDA (video memory is at b000:0).  Otherwise,
  its a CGA, EGA, VGA or other compatible color system (video memory is at
  b800:0).  See EGA and VGA if you need to narrow it down.

See Also: MDA
          EGA
          VGA
          SuperVGA
          CGA I/O Ports
          Video Memory Layouts
                                         -♦-