The glory of 256 colors



Short History

MDA/CGA - 1981

MDA is text mode only (80x25 symbols) with 256 characters in code page 473. CGA is graphical mode with a max resolution of 640x200 with 2 colors and 320x200 with 16 colors.

EGA - 1984

More resolution (640×350) and more colors, 16 colors from a palette of 64.

VGA - 1987

Mode 13h, the best graphic mode ever with 320x200 and 256 colors. Aka Mode X 320x240 for those people that prefer square pixels.


Not much of a standard, more chaos really. Everything 800x600 and up with increasing number of colors is SVGA.


To modify the video mode the BIOS is used. It can only be done in real mode. This is done by invoking a interrupt 10h with the INT x86 instruction. The action to perform is put into the AH register.

00h Set Video Mode

0Ch Write Graphics Pixel

0Dh Read Graphics Pixel

10h Set Palette Registers

4Fh VESA Extension Functions

00h Set Video Mode

AH = 0

AL = Video Mode number.

0CH/ODH: Store pixel value / Return pixel value

AH = 0CH / ODH

AL = Pixel value (IN/OUT)

BH = Video page

CX = x coordinate

DX = y coordinate

10h: Set Palette registers

AH = 10h

AL = 12h (subfunction 12h: Update dac)

BX = First register

CX = Number of registers

ES:DX = Address to table of rgb values.

4F02h: Set VBE Video Mode


The Fastest Sprite in the West (Lets talk VGA, Part 2)