Color Graphics Adapter - Standard Text Modes

Standard Text Modes

CGA offers four BIOS text modes (called alphanumeric modes in IBM's documentation):

  • 40×25 characters in up to 16 colors. Each character is a pattern of 8×8 dots. The effective screen resolution in this mode is 320×200 pixels (a pixel aspect ratio of 1:1.2), though individual pixels cannot be addressed independently. The choice of patterns for any location is thus limited to one of the 256 available characters, the patterns for which are stored in a ROM chip on the card itself. The display font in text mode (the code page 437 character set) is therefore fixed and cannot be changed (although when using the original IBM CGA, it is possible to select one of two different fonts—normal or thin—by changing a jumper. Many clones didn't offer this possibility). The card has sufficient video RAM for eight different text pages in this mode.

BIOS Modes 0 & 1 select 40 column text modes. The difference between these two modes can only be seen on a composite monitor; mode 0 disables the color burst, making colors appear in grayscale. Mode 1 enables the color burst, allowing for color. Mode 0 and Mode 1 are functionally identical on RGB monitors and on later adapters that emulate CGA without supporting composite color output.

  • 80×25 characters in up to 16 colors. Each character is again an 8×8 dot pattern (the same character set is used as for 40×25), in a pixel aspect ratio of 1:2.4. The effective screen resolution of this mode is 640×200 pixels. Again, the pixels cannot be individually addressed. Since there are twice as many characters on the screen in this mode, the card has enough video RAM for just four different text pages.

BIOS Modes 2 & 3 select 80 column text modes. As with the 40-column text modes, Mode 2 disables the color burst in the composite signal and Mode 3 enables it.

In every text mode, each character has a background and a foreground color—e.g. red on yellow text for one character, white on black for the next, etc. While the same 4-bit nybble used for the foreground color would normally allow all 16 colors to be used for the background color, the most significant bit of the background nybble is alternatively used to denote whether or not the character should blink (a hardware effect offered by CGA independent of the CPU). The blinking attribute effect is enabled by default and the high-intensity background effect is disabled; disabling blinking is the only way to freely choose the latter eight-color indexes (8-15) for the background color.

Notably, the GW-BASIC and, later, Microsoft QBASIC (a lesser derivative of Microsoft QuickBASIC) programming language interpreters included with MS-DOS (which was the de facto PC OS while the CGA was popular) supported all the text modes of the CGA with full color control, but did not provide a normal means through the BASIC language to switch the CGA from blink mode to 16-background-color mode, though it would be possible by directly programming the hardware registers using the OUT statement. In BASIC, foreground text color numbers 16-31 are the blinking versions of colors 0-15, respectively, but background colors 8-15 are identical to colors 0-7 respectively.

Read more about this topic:  Color Graphics Adapter

Famous quotes containing the words standard, text and/or modes:

    Any honest examination of the national life proves how far we are from the standard of human freedom with which we began. The recovery of this standard demands of everyone who loves this country a hard look at himself, for the greatest achievments must begin somewhere, and they always begin with the person. If we are not capable of this examination, we may yet become one of the most distinguished and monumental failures in the history of nations.
    James Baldwin (1924–1987)

    If ever I should condescend to prose,
    I’ll write poetical commandments, which
    Shall supersede beyond all doubt all those
    That went before; in these I shall enrich
    My text with many things that no one knows,
    And carry precept to the highest pitch:
    I’ll call the work ‘Longinus o’er a Bottle,
    Or, Every Poet his own Aristotle.’
    George Gordon Noel Byron (1788–1824)

    Sight and all the other senses are only modes of touch.
    Samuel Butler (1835–1902)