Q(uick)Basic Screen Modes, Adapters, Displays & Colors
At a Glance
A set of information about screen modes, graphics adapters and display hardware configurations as well as various color settings and attributes
Worth knowing
Useful and cross-version information about the programming environments of QBasic and QuickBasic.
- ASCII Code Tables
- Keyboard Scan Codes
- Syntax Conventions
- Screen Modes, Adapters, Displays, Colors
- BASIC Character Set
- Error Codes
The following tables briefly summarize each of the screen modes. The color adapters referred to are
- the IBM Color Graphics Adapter (CGA),
- the IBM Enhanced Graphics Adapter (EGA),
- the IBM Video Graphics Array (VGA), and
- the IBM Multicolor Graphics Array (MCGA).
The Hercules Graphics Card, Graphics Card Plus and InColor adapters are supported, but only with monochrome monitors.
Note: | Many screen modes support more than one combination of rows and columns on the screen. See the ⮜ WIDTH statement details ⮞ for more information about changing the number of rows and columns on the display. |
SCREEN 0 - Text mode only:
- 40 x 25, 40 x 43, 40 x 50, 80 x 25, 80 x 43, or 80 x 50 text format, 8 x 8 character box (8 x 14, 9 x 14, or 9 x 16 with EGA or VGA)
- 16 colors assigned to any of 16 attributes (with CGA or EGA)
- 64 colors assigned to any of 16 attributes (with EGA or VGA)
- Depending on the text resolution and adapter, 8 video memory pages (0-7), 4 pages (0-3), 2 pages (0-1), or 1 page (0)
SCREEN 1 - 320 x 200 graphics:
- 40 x 25 text format, 8 x 8 character box
- 16 background colors and one of two sets of 3 foreground colors assigned using COLOR statement with CGA
- 16 colors assigned to 4 attributes with EGA or VGA
- 1 video memory page (0)
SCREEN 2 - 640 x 200 graphics:
- 80 x 25 text format, 8 x 8 character box
- 16 colors assigned to 2 attributes with EGA or VGA
- 1 video memory page (0)
SCREEN 3 - Hercules adapter required, monochrome monitor only:
- 720 x 348 graphics
- 80 x 25 text format, 9 x 14 character box
- Usually 2 video memory pages (0-1); 1 page (0) if a second color display adapter is installed
- PALETTE statement not supported
- Invoke the Hercules driver MSHERC.COM before using screen mode 3
SCREEN 4:
- Supports Olivetti Personal Computers models M24, M240, M28, M280, M380, M380/C, and M380/T and AT&T Personal Computers 6300 series
- 640 x 400 graphics
- 80 x 25 text format, 8 x 16 character box
- 1 of 16 colors assigned as the foreground color (selected by the COLOR statement); background is fixed at black
- 1 video memory page (0)
- PALETTE statement not supported
SCREEN 7 - 320 x 200 graphics:
- 40 x 25 text format, 8 x 8 character box
- Assignment of 16 colors to any of 16 attributes
- If 64K EGA adapter memory, 2 video memory pages (0-1); otherwise, 8 pages (0-7)
SCREEN 8 - 640 x 200 graphics:
- 80 x 25 text format, 8 x 8 character box
- Assignment of 16 colors to any of 16 attributes
- If 64K EGA adapter memory, 1 video memory page (0); otherwise, 4 pages (0-3)
SCREEN 9 - 640 x 350 graphics:
- 80 x 25 or 80 x 43 text format, 8 x 14 or 8 x 8 character box
- 16 colors assigned to 4 attributes (64K adapter memory), or 64 colors assigned to 16 attributes (more than 64K adapter memory)
- If 64K EGA adapter memory, 1 video memory page (0); otherwise, 2 pages (0-1)
SCREEN 10 - 640 x 350 graphics:
- 80 x 25 or 80 x 43 text format, 8 x 14 or 8 x 8 character box
- Up to 9 pseudocolors assigned to 4 attributes
- 2 video memory pages (0-1), 256K adapter memory required
Screen 11 - VGA or MCGA:
- 640 x 480 graphics
- 80 x 30 or 80 x 60 text format, 8 x 16 or 8 x 8 character box
- Assignment of up to 256K colors to 2 attributes
- 1 video memory page (0)
Screen 12 - VGA:
- 640 x 480 graphics
- 80 x 30 or 80 x 60 text format, 8 x 16 or 8 x 8 character box
- Assignment of up to 256K colors to 16 attributes
- 1 video memory page (0)
Screen 13 - VGA or MCGA:
- 320 x 200 graphics
- 40 x 25 text format, 8 x 8 character box
- Assignment of up to 256K colors to 256 attributes
- 1 video memory page (0)
Scroll through the tables in this topic, which list the screen modes available for each adapter. If the display device is also a factor in choosing a screen mode, it is listed.
MDPA Screen Modes
The IBM Monochrome Display and Printer Adapter (MDPA) can be used only with a monochrome display. Only SCREEN 0, text mode, can be used with the MDPA.
Mode | Rows and Columns | Attributes | Colors | Resolution | Pages |
0 | 80x25 | 16 | 3 | 720x350 | 1 |
Hercules Adapter Screen Modes
Mode | Rows and Columns | Attributes | Colors | Resolution | Pages |
0 | 80x25 | 16 | 1 | 720x348 | 2 |
3 | 80x25 | 16 | 1 | 720x348 | 2 |
CGA Screen Modes
The IBM Color Graphics Adapter (CGA) and Color Display are typically paired. This combination permits running text-mode programs, and both medium-resolution and high-resolution graphics programs.
Mode | Rows and Columns | Colors | Resolution | Pages |
0 | 40x25 | 16 | 320x200 | 8 |
80x25 | " | 640x200 | 4 | |
1 | 40x25 | 4 | 320x200 | 1 |
2 | 80x25 | 2 | 640x200 | 1 |
EGA Screen Modes
The IBM Enhanced Graphics Adapter (EGA) may be used with either the IBM Color Display or the Enhanced Color Display. In modes 0, 1, 2, 7, and 8, these pairings produce similar results, except for the following possible differences:
- The border color cannot be set on an Enhanced Color Display when it is in 640 x 350 text mode.
- The text quality is better on the Enhanced Color Display (an 8 x 14 character box for Enhanced Color Display versus an 8 x 8 character box for Color Display).
Mode 9 takes full advantage of the capabilities of the Enhanced Color Display. Mode 9 provides for the highest resolution possible for the EGA/Enhanced Color Display configuration. Programs written for this mode will not work for any other hardware configuration except the VGA.
The table below summarizes the screen modes that can be used with an EGA.
Mode | Rows and Columns | Display(a) | Attributes | Colors | Page Resolution | Size | Pages |
0 | 40x25 | C | 16 | 16 | 320x200 | N/A | 8 |
40x25 | E | " | 64 | 320x350 | " | " | |
40x43 | E | " | 64 | 320x350 | " | "(b) | |
80x25 | C | " | 16 | 640x200 | " | "(b) | |
80x25 | E | " | 64 | 640x350 | " | "(b) | |
80x25 | C | " | 16 | 640x200 | " | "(b) | |
80x25 | M | " | 3 | 720x350 | " | "(b) | |
80x43 | E | " | 64 | 640x350 | " | 4(b) | |
80x43 | M | " | 3 | 720x350 | " | 4(b) | |
1 | 40x25 | N/A | 4 | 16 | 320x200 | 16K | 1 |
2 | 80x25 | N/A | 2 | 16 | 640x200 | 16K | " |
7 | 40x25 | N/A | 16 | 16 | 320x200 | 32K | (c) |
8 | 80x25 | N/A | 16 | 16 | 640x200 | 64K | (c) |
9(d) | 80x25 | E | 4 | 64 | 640x350 | 64K | 1 |
80x43 | E | 4 | 64 | 640x350 | 64K | 1 | |
80x25 | E | 16 | 64 | 640x350 | 128K | (c) | |
80x43 | E | 16 | 64 | 640x350 | 128K | (c) | |
10 | 80x25 | M | 4 | 9 | 640x350 | 64K | (e) |
80x43 | M | 4 | 9 | 640x350 | 64K | (e) |
(a) | C = | Color display, |
E = | Enhanced color display, | |
M = | Monochrome display, | |
N/A | Not applicable (either color display or enhanced color display) | |
(b) | Pages = | Screen memory divided by page size. Eight page maximum, one page minimum. |
(c) | Pages = | Screen memory divided by 2 divided by page size. Eight page maximum, one page minimum. |
(d) | Number of pages is halved with 64K. | |
(e) | The first two entries under mode 9 are for an EGA with 64K of screen memory. The next two entries assume more than 64K of screen memory. |
EGA and VGA Adapters with Monochrome Display: SCREEN 10
Only the EGA and VGA can be paired with the IBM Monochrome Display to run programs in Mode 10. This mode can be used to display monochrome graphics at a very high resolution.
The following two tables summarize the default attributes and colors for screen mode 10 used with a monochrome display.
Default Attributes: SCREEN 10, Monochrome Display
Attribute Value | Displayed Pseudocolor |
0 | Off |
1 | On, normal intensity |
2 | Blink |
3 | On, high intensity |
Color Values: SCREEN 10, Monochrome Display
Color Value | Displayed Pseudocolor |
0 | Off |
1 | Blink, off to on |
2 | Blink, off to high intensity |
3 | Blink, on to off |
4 | On |
5 | Blink, on to high intensity |
6 | Blink, high intensity to off |
7 | Blink, high intensity to on |
8 | High intensity |
VGA Screen Modes
The IBM Video Graphics Array (VGA) adapter offers significantly enhanced text and graphics in all modes.
Mode | Rows and Columns | Attributes | Colors | Page Resolution | Size | Pages |
0 | 40x25 | 16 | 64 | 360x400 | N/A | 8 |
40x43 | " | " | 320x350 | " | " | |
40x50 | " | " | 320x400 | " | 4 | |
80x25 | " | " | 720x400 | " | 8 | |
80x43 | " | " | 640x350 | " | 4 | |
80x43 | " | 3 | 720x350 | " | " | |
80x50 | " | 64 | 640x400 | " | " | |
80x50 | " | 3 | 720x400 | " | " | |
1 | 40x25 | 4 | 16 | 320x200 | 16K | 1 |
2 | 80x25 | 2 | " | 640x200 | " | " |
7 | 40x25 | 16 | " | 320x200 | 32K | (a) |
8 | 80x25 | " | " | 640x200 | 64K | (a) |
9 | 80x25 | " | 64 | 640x350 | 128K | (a) |
80x43 | " | " | " | " | (a) | |
10 | 80x25 | 4 | 9 | " | 64K | (b) |
80x43 | " | " | " | " | (b) | |
11 | 80x30 | 2 | 256K | 640x480 | " | 1 |
80x60 | " | " | " | " | " | |
12 | 80x30 | 16 | " | " | 256K | " |
80x60 | " | " | " | " | " | |
13 | 40x25 | 256 | " | 320x200 | 64K | " |
(a) | Pages = | Screen memory divided by page size. Eight page maximum. |
(b) | Pages = | Screen memory divided by 2 divided by page size. Eight page maximum. |
See the ⮜ PALETTE statement details ⮞ for a description of how the VGA calculates color values.
MCGA Screen Modes
The IBM Multicolor Graphics Array (MCGA) combines the modes of the CGA with the very high resolution and 256K color modes of the VGA to provide enhanced text and graphics in all modes.
Mode | Rows and Columns | Attributes | Colors | Page Resolution | Size | Pages |
0 | 40x25 | 16 | N/A | 320x400 | N/A | 8 |
80x25 | " | " | 640x400 | " | " | |
1 | 40x25 | 4 | " | 320x200 | 16K | 1 |
2 | 80x25 | 2 | " | 640x200 | " | " |
11 | 80x30 | " | 256K | 640x480 | 64K | " |
80x60 | " | " | " | " | " | |
13 | 40x25 | 256 | " | 320x200 | " | " |
The MCGA uses the same color values as the VGA. For a description of how the MCGA calculates color values, see the ⮜ PALETTE statement details ⮞ .
For various screen modes and display hardware configurations, different attribute and color settings exist. (See the ⮜ PALETTE statement details ⮞ for a discussion of attribute and color number.) The majority of these attribute and color configurations are summarized in the tables below.
Default Attributes and Colors for SCREEN Modes 1 and 9(a)
Attributes | Color Display Number(b) | Color | Monochrome Display Number(c) | Color |
0 | 0 | Black | 0 | Off |
1 | 11 | Light cyan | 2 | High intensity |
2 | 13 | Light magenta | 2 | High intensity |
3 | 15 | High-intensity white | 0 | Off |
(a) | EGA with video memory <= 64K. |
(b) | EGA color numbers. VGA and MCGA use color numbers that produce visually equivalent colors. |
(c) | Only for mode 0 monochrome. |
Default Attributes and Colors for SCREEN Modes 2 and 11
Attributes | Color Display Number(b) | Color | Monochrome Display Number(c) | Color |
0 | 0 | Black | 0 | Off |
1 | 15 | High-intensity white | 0 | Off |
(a) | EGA color numbers. VGA and MCGA use color numbers that produce visually equivalent colors. |
(b) | Only for mode 0 monochrome. |
Default Attributes and Colors for SCREEN Modes 0, 7, 8, 9(a), 12, and 13
Attributes | Color Display Number(b) | Color | Monochrome Display Number(c) | Color |
0 | 0 | Black | 0 | Off |
1 | 1 | Blue | Underlined(d) | |
2 | 2 | Green | 1 | On(d) |
3 | 3 | Cyan | 1 | On(d) |
4 | 4 | Red | 1 | On(d) |
5 | 5 | Magenta | 1 | On(d) |
6 | 6 | Brown | 1 | On(d) |
7 | 7 | White | 1 | On(d) |
8 | 8 | Gray | 0 | Off |
9 | 9 | Light Blue | High intensity Underlined | |
10 | 10 | Light green | 2 | High intensity |
11 | 11 | Light cyan | 2 | High intensity |
12 | 12 | Light red | 2 | High intensity |
13 | 13 | Light magenta | 2 | High intensity |
14 | 14 | Yellow | 2 | High intensity |
15 | 15 | High-intensity white | 0 | Off |
(a) | For VGA. Also for EGA with video memory > 64K. |
(b) | EGA color numbers. VGA and MCGA use color numbers that produce visually equivalent colors. |
(c) | Only for mode 0 monochrome. |
(d) | Off when used for background. |