home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
pascal
/
surpas.arc
/
IBMPC.DOC
< prev
next >
Wrap
Text File
|
1987-10-04
|
10KB
|
221 lines
SURPAS-86 SUPPLEMENTARY DOCUMENTATION
for IBM PC with DOS 1.1 and 2.0
Copyright (C) 1984
Tixaku Pty Ltd
Since IBM DOS provides no escape code sequences to control the
display, the IBM DOS version of SURPAS has its own console driver
installed. This driver provides an extensive set of escape code
sequences to select CRT operating modes, control the cursor,
clear the screen, insert and delete lines, activate/deactivate
character attributes and select colors. Furthermore, the console
driver will convert the extended ASCII codes returned by the
keyboard to escape code sequences, so that function keys and
other special control keys can be read from your programs.
Below follows a description of the escape code sequences provided
by the SURPAS console driver. An ASCII escape character (27 or
1BH) triggers escape sequence processing. The escape character
can be followed by one or more characters depending on the func-
tion required.
ESC Y Position Cursor. The two characters that follow the "Y"
specify the row and column to which the cursor is to be
moved. The first character specifies the row, the second
specifies the column. Rows range from 0 to 24, colums
range from 0 to 79 (39 in 40 column modes). To avoid
confusing row and column numbers with control characters,
row and column values have 32 (or 20H) added to them.
Thus, to move the cursor to the home position, the two
characters following the "Y" would be ASCII spaces (20H).
The position cursor function is also available through
the GOTOXY standard procedure.
ESC J Erases all character positions from the cursor to the end
of the screen. This function is also available through
the CLREOS string.
ESC K Erases all character positions from the cursor to the end
of the line. This function is also available through the
CLREOL string.
ESC L Insert Line. Inserts a blank line by moving the line that
the cursor is on, and all following lines, down one line.
This function is also available through the INSLIN
string.
ESC M Delete Line. Deletes the contents of the line that the
cursor is on, moves all the following lines up on line,
and adds a blank line at the bottom of the display. This
function is also available through the DELLIN string.
ESC P Enter Reverse Video Mode. Subsequent characters are dis-
played as black characters on white background. This
function is also available through the RVSON string.
ESC Q Exit Reverse Video Mode. This function is also available
through the RVSOFF string.
ESC R Intensify On. Subsequent characters are displayed in high
video intensity. Note that intensify has no effect in
reverse video mode.
ESC S Intensify Off.
ESC T Blink On. Subsequent characters are displayed blinking.
ESC U Blink Off.
ESC V Underline On. Subsequent characters are underlined. Since
reverse video and underline are incombineable, this func-
tion will automatically exit reverse video mode.
ESC W Underline Off.
ESC X Cancel All Attributes. Cancels reverse video, intensify,
blink and underline. Subsequent characters are displayed
in white on a black background.
ESC a Set CRT Mode. The CRT mode selects the number of rows and
columns on the CRT screen, as well as color or monochrome
display. The sequence must be followed by a character
between ASCII 0 and ASCII 7 which selects a mode accor-
ding to the table below:
0 = 40 x 25 Black and White.
1 = 40 x 25 Color.
2 = 80 x 25 Black and White.
3 = 80 x 25 Color.
4 = 320 x 200 Color Graphics.
5 = 320 x 200 Monochrome Graphics.
6 = 640 x 200 Monochrome Graphics.
7 = 80 x 25 Black and White (Monochrome Display Adapter).
Modes 0-6 require the Color/Graphics Adapter. Only the
least significant three bits of the mode number are used.
ESC b Set Foreground Color. The foreground color is the color
of the actual character raster. Associated with the fore-
ground color is an intensity bit, which switches between
colors 0-7 and 8-15. Escape-b must be followed by a
character between ASCII 0 and ASCII 15 which selects a
color according to the table below.
0 = Black. 8 = Dark Gray.
1 = Blue. 9 = Light Blue.
2 = Green. 10 = Light Green.
3 = Cyan. 11 = Light Cyan.
4 = Red. 12 = Light Red.
5 = Magenta. 13 = Light Magenta.
6 = Brown. 14 = Yellow.
7 = Light Gray. 15 = White.
Only the least significant four bits of the color number
are used. Note that Escape-R and Escape-S may also be
used to switch the the foreground intensity, i.e. switch
between colors 0-7 and 8-15.
ESC c Set Background Color. The background color is the color
"behind" the characters. Escape-c must be followed by a
character between ASCII 0 and ASCII 15 which selects the
background color according to the table below:
0 = Black. 4 = Red.
1 = Blue. 5 = Magenta.
2 = Green. 6 = Brown.
3 = Cyan. 7 = Light Gray.
If 8 is added to the color value, the characters will
blink. Only the least significant four bits of the color
number are used. Note that Escape-T and Escape-U may also
be used to switch blink on and off.
ESC d Set Border/Background Color. In alpha modes (CRT modes 0-
3), this sesequence sets the border color, i.e. the color
of the border surrounding the actual character display
area. In 320 x 200 graphics modes (CRT modes 4-5), it
sets the background color. Escape-d must be followed by a
character between ASCII 0 and ASCII 15 which selects the
border/background color. The color values correspond to
those of the foreground color (see Escape-b). Only the
least significant four bits of the color number are used.
ESC e Set Color Palette. This sequence has meaning only in 320
x 200 graphics modes (CRT modes 4-5). Escape-e must be
followed by an ASCII 0 or an ASCII 1 character which
selects one of the two available color palettes:
0 = Green(1), Red(2), Yellow(3)
1 = Cyan(1), Magenta(2), White(3)
Only the least signigicant bit of the palette number is
used. When operating in 320 x 200 graphics mode, only the
least significant two bits of the foreground color are in
effect. Color number 0 is the background color and colors
1-3 are selected from the palette.
ESC f Set Working Display Page. This sequence has meaning only
in CRT modes 0-3. It selects the working display page,
i.e. the display page to which characters are written. 8
display pages are available in 40 x 25 alpha mode (CRT
mode 0-1) and 4 display pages are available in 80 x 25
alpha mode (CRT mode 2-3). Escape-f must be followed by a
character between ASCII 0 and ASCII 3 or 7 which selects
a display page. Only the least significant 3 (40 x 25) or
2 (80 x 25) bits of the display number are used.
ESC g Set Active Display Page. This sequence has meaning only
in CRT modes 0-3. It selects the active display page,
i.e. the display page to be shown on the monitor. Escape-
g must be followed by a character which selects a display
page as described above.
When reading characters from the keyboard, the SURPAS console
driver will convert extended ASCII codes, i.e. the codes returned
by function keys and other special keys, to two character escape
code sequences. The first character returned is an ASCII escape
character (27 or 1BH). The second character is the scan code of
the key. For instance, if "Home" is pressed at the keyboard, the
console driver will return an ASCII escape (27) followed by an
ASCII "S" (71). For a complete list of scan codes, please refer
to the IBM PC Technical Reference Manual, page 3-14. Alternative-
ly, you may use the following short program to display the exten-
ded ASCII codes of specific keys:
PROGRAM displaycodes;
VAR
ch: char;
BEGIN
REPEAT
read(kbd,ch); writeln(ord(ch));
UNTIL ord(ch)=13;
END.
The program continuously reads characters from the keyboard and
displays their ASCII values until you press RETURN. When you
press a function key or a special key, the first value displayed
is 27, the second is the scan code of that specific key.
In addition to the standard set of editor commands, you may also
use the cursor control keypad when you are in the editor. The
following alternate keys are defined:
Standard Alternate Standard Alternate
^S Left ^D Right
^Q^S ^Q Left ^Q^D ^Q Right
^E Up ^X Down
^Q^E ^Q Up ^Q^X ^Q Down
^R PgUp ^C PgDn
^Q^R Home ^Q^C End
DEL Backsp ^Q DEL ^Q Backsp
^V Ins ^G Del
Left, Right, Up and Down denote the cursor arrows. Backsp is the
backspace key located above the Return key.