Video Graphics Array I/O Ports

 The VGA is upwardly-compatible with the CGA, MDA, and EGA in that all
 commonly-used I/O activities are emulated at the expected port addresses.

 Video programming at the hardware port level has become increasingly
 difficult and risky while the BIOS programming interface has become
 flexible and comprehensive.  It is recommended that you use the BIOS
 functions when possible.  See INT 10H (video services).

 The following table lists ports and indexes for the VGA without providing
 full details.  Since the VGA uses the same port range as the EGA, you may
 refer to EGA I/O Ports and CGA I/O Ports for related information.

Port  Description
▀▀▀▀  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
3c0H  Attribute Address Register (read/write)
──── ───────────────────────────────────────────────────────────────────────
3c0H  Palette Registers / Other Attribute Registers (write)
       Index: 00H∙∙∙0fH  Palette registers
              10H  mode control
              11H  overscan (border) color
              12H  enable color planes
              13H  horizontal pixel panning
              14H  color select register
──── ───────────────────────────────────────────────────────────────────────
3c1H  Palette Registers (read)
──── ───────────────────────────────────────────────────────────────────────
3c2H  Miscellaneous Output Register (write)
──── ───────────────────────────────────────────────────────────────────────
3c2H  Input Status Register 0 (read)
──── ───────────────────────────────────────────────────────────────────────
3c3H  VGA Enable Register (read/write)
──── ───────────────────────────────────────────────────────────────────────
3c4H  Sequencer Address Register (read/write)
──── ───────────────────────────────────────────────────────────────────────
3c5H  Other Sequencer Registers (read/write)
      Index: 00H  reset
             01H  Clocking Mode
             02H  Map Mask
             03H  Character Map Select
             04H  Memory Mode
──── ───────────────────────────────────────────────────────────────────────
3c6H  PEL Mask Register
──── ───────────────────────────────────────────────────────────────────────
3c7H  PEL Address Register for Read Mode (write)
──── ───────────────────────────────────────────────────────────────────────
3c7H  DAC State Register (read)
──── ───────────────────────────────────────────────────────────────────────
3c8H  PEL Address Register for Write Mode (read)
──── ───────────────────────────────────────────────────────────────────────
3c9H  PEL Data Register
──── ───────────────────────────────────────────────────────────────────────
3caH  Feature Control Register (read)
──── ───────────────────────────────────────────────────────────────────────
3ccH  Miscellaneous Output Register (read)
──── ───────────────────────────────────────────────────────────────────────
3ceH  Graphics Address Register
──── ───────────────────────────────────────────────────────────────────────
3cfH  Other Graphics Registers
      Index: 00H  set/reset
             01H  enable set/reset
             02H  color compare
             03H  data rotate
             04H  read map select
             05H  graphics mode register
             06H  miscellaneous graphics control
             07H  color don't care
             08H  plane bit mask
──── ───────────────────────────────────────────────────────────────────────
3?4H  CRT controller address (3b4H=MDA emulation, 3d4H=CGA emulation)
3?5H  CRT controller internal registers
      Index: 00H  horizontal total
             02H  start horizontal blanking (character count)
             03H  end horizontal blanking
             04H  start horizontal retrace (character position)
             05H  end horizontal retrace
             06H  vertical total (scan lines)
             07H  overflow (bit 8 for certain CRTC registers)
             08H  preset row scan; first scan line after vertical retrace
             09H  maximum scan line
             0aH  cursor start
             0bH  cursor end
             0cH  regen start address (high)
             0dH  regen start address (low)
             0eH  Cursor location (high)
             0fH  Cursor location (low)
             10H  vertical retrace start
             11H  vertical retrace end
             12H  vertical displayed end (scan line)
             13H  vertical displayed adjustment
             14H  underline location.  Bits 0-5 are scan line number.
             15H  start vertical blanking (scan line)
             16H  end vertical blanking
             17H  mode control
             18H  line compare (scan line)  Used for split screen
──── ───────────────────────────────────────────────────────────────────────
3?aH  Feature Control Register (write) (3baH=mono emulation, 3daH=CGA emul.)
──── ───────────────────────────────────────────────────────────────────────
3?aH  Input Status Register 1 (read)
──── ───────────────────────────────────────────────────────────────────────
See Also: EGA I/O Ports
          CGA I/O Ports
          EGA/VGA Data Areas
          INT 10H (BIOS video services)
          I/O Port Map
          Cables and Pin Outs
                                    -♦-