SCREEN Statement

Purpose:

To set the specifications for the display screen.

Syntax:

SCREEN [mode] [,[colorswitch]][,[apage]][,[vpage]]

Comments:

The SCREEN statement is chiefly used to select a screen mode appropriate for a particular display-hardware configuration. Supported hardware configurations and screen modes are described below.

MDPA with Monochrome Display: Mode 0

The IBM Monochrome Display and Printer Adapter (MDPA) is used to connect only to a monochrome display. Programs written for this configuration must be text mode only.

CGA with Color Display: Modes 0, 1, and 2

The IBM Color Graphics Adapter (CGA) and Color Display are typically paired with each other. This hardware configuration permits the running of text mode programs, and both medium-resolution and high-resolution graphics programs.

EGA with Color Display: Modes 0, 1, 2, 7, and 8

The five screen modes 0, 1, 2, 7, and 8 allow you to interface to the IBM Color Display when it is connected to an IBM Enhanced Graphics Adapter (EGA). If EGA switches are set for CGA compatibility, programs written for modes 1 and 2 will run just as they would with the CGA. Modes 7 and 8 are similar to modes 1 and 2, except that a wider range of colors is available in modes 7 and 8.

EGA with Enhanced Color Display: Modes 0, 1, 2, 7, and 8

With the EGA/IBM Enhanced Display configuration, modes 0, 1, 2, 7, and 8 are virtually identical to their EGA/Color Display counterparts. Two possible differences are as follows:

EGA with Enhanced Color Display: Mode 9

The full capability of the Enhanced Color Display is taken advantage of in this mode. Mode 9 allows the highest resolution possible for the EGA/Enhanced Color Display configuration. Programs written for this mode will not work for any other hardware configuration.

EGA with Monochrome Display: Mode 10

The IBM Monochrome Display can be used to display monochrome graphics at a very high resolution in this mode. Programs written for this mode will not work for any other hardware configuration.

Arguments

The mode argument is an integer expression with legal values 0, 1, 2, 7, 8, 9, and 10. All other values are illegal. Selection of a mode argument depends primarily on your program's anticipated display hardware, as described above.

Each of the SCREEN modes is described individually in the following paragraphs.

SCREEN 0

SCREEN 1

SCREEN 2

SCREEN 7

SCREEN 8

SCREEN 9

SCREEN 10

The following are default attributes for SCREEN 10, monochrome display:

Attribute ValueDisplayed Pseudo-Color
0Off
1On, normal intensity
2Blink
3On, high intensity

The following are color values for SCREEN 10, monochrome display:

Color ValueDisplayed Pseudo-Color
0Off
1Blink, off to on
2Blink, off to high intensity
3Blink, on to off
4On
5Blink, on to high intensity
6Blink, high intensity to off
7Blink, high intensity to on
8High intensity

For both composite monitors and TVs, the colorswitch is a numeric expression that is either true (non-zero) or false (zero). A value of zero disables color and permits display of black and white images only. A nonzero value permits color. The meaning of the colorswitch argument is inverted in SCREEN mode 0.

For hardware configurations that include an EGA and enough memory to support multiple-screen pages, two arguments are available. These apage and vpage arguments determine the "active" and "visual" memory pages. The active page is the area in memory where graphics statements are written; the visual page is the area of memory that is displayed on the screen.

Animation can be achieved by alternating the display of graphics pages. The goal is to display the visual page with completed graphics output, while executing graphics statements in one or more active pages. A page is displayed only when graphics output to that page is complete. Thus, the following program fragment is typical:

SCREEN 7,, 1, 2  'work in page 1, show page 2
.
. Graphics output to page 1
. while viewing page 2
.
SCREEN 7,,2,1  'work in page 2, show page 1
.
. Graphics output to page 2
. while viewing page 1
.

The number of pages available depends on the SCREEN mode and the amount of available memory, as described in the following table:

Table 2

SCREEN Mode Specifications

Mode Resolution Attribute Range Color Range EGA Memory Pages Page Size
0 40-column textNA0-15aNA12K
80-column textNA0-15aNA14K
1320x2000-3b0-3NA116K
2640x2000-1b0-1NA116K
7320x2000-150-1564K232K
128K4
256K8
8640x2000-150-1564K164K
128K2
256K4
9640x3500-30-1564K164K
0-150-63128K1128K
0-150-63256K2
10 640x350 0-3 0-8 128K1128K
256K2

a Numbers in the range 16-31 are blinking versions of the colors 0-15.
b Attributes applicable only with EGA.

Attributes and Colors

For various screen modes and display hardware configurations, different attribute and color settings exist. (See the PALETTE statement for a discussion of attribute and color number.) The majority of these attribute and color configurations are summarized in the following table:

Table 3

Default Attributes and Colors for Most Screen Modes

Attributes for Mode Color Display Monochrome Display
1,9 2 0,7,8,9b Numberc Color Numberc Color
0000Black0Off
    11Blue  (Underlined)a
    22Green1Ona
    33Cyan1Ona
    44Red1Ona
    55Magenta1Ona
    66Brown1Ona
    77White1Ona
    88Gray0Off
    99Light Blue  High intensity (underlined)
    1010Light Green2High intensity
1  1111Light Cyan2High intensity
    1212Light Red2High intensity
2  1313Light Magenta2High intensity
    1414Yellow2High intensity
311515High-intensity White0Off

a Off when used for background.
b With EGA memory > 64K.
c Only for mode 0 monochrome.

The default foreground colors for the various modes are given in the following table:

Table 4

Default Foreground Colors

  Default foreground attribute Default foreground color
Screen mode Color/Extended Displaya Monochrome Display Color/Extended Displaya Monochrome Display
07771
13NA15NA
21NA15NA
715NA15NA
815NA15NA
93bNA63NA
10NA3NA8

a IBM Enhanced Color Display
b 15 if greater than 64K of EGA memory
NA=Not Applicable