\documentstyle[a4,12pt]{article}
\begin{document}
\author{Richard M. Marshall}
\title{The IE Terminal Driver}
\maketitle
\parskip .1 in
\setcounter{secnumdepth}{10}
\parindent 0in
\section{Preamble}
\hspace*{ 0.2 in} The IE Terminal Driver - by Richard M. Marshall

\hspace*{ 0.4 in} The IE Terminal Driver is a terminal and system \hspace{ 0.2 in} independent
\\ \hspace*{ 0.4 in} procedural video terminal interface. \hspace{ 0.2 in} If differs significantly in
\\ \hspace*{ 0.4 in} philosophy from the Hamish Dewar \hspace{ 0.3 in} VTLIB while offering almost
\\ \hspace*{ 0.4 in} identically the same useful features.

\hspace*{ 0.4 in} What IE\_T\_D does NOT provide:

\hspace*{ 0.6 in} * "Windows" - conventional video terminals do not provide the
\\ \hspace*{ 1.7 in} correct hardware "hooks" to support full window
\\ \hspace*{ 1.7 in} systems on them so why pretend!
\\ \hspace*{ 0.6 in} * \hspace{ 0.2 in} Short identifiers - All facilities are identified by a
\\ \hspace*{ 2.4 in} meaningful name.

\hspace*{ 0.4 in} What IE\_T\_D does provide:

\hspace*{ 0.6 in} * Systematic access to ALL terminal advanced features.
\\ \hspace*{ 0.6 in} * Insert/Delete character operations.
\\ \hspace*{ 0.6 in} * Terminal independant graphics characters.


\hspace*{ 0.2 in} Access to these declarations is by including "IE:Terminal.Inc"

\hspace*{ 0.2 in} Currently the following terminals are supported:

\hspace*{ 0.4 in} Visual 200
\\ \hspace*{ 0.4 in} Visual 55 \hspace{ 0.2 in} (in V210 emulation mode NOT V55 mode)
\\ \hspace*{ 0.4 in} VT100
\\ \hspace*{ 0.4 in} VT220
\\ \hspace*{ 0.4 in} Freedom 100
\\ \hspace*{ 0.4 in} WY75 \hspace{ 0.5 in} (in ANSI mode)

\hspace*{ 0.2 in} More terminals can be added as needed with no difficulty.

Suggestions for improvements are welcomed.

Establishing the terminal type: (pending being done properly!)

For the moment this variable should be assigned as follows:

\%external \%byte \%spec Terminal Model

\%constant \%integer Visual 200
\\ \hspace*{ 1.3 in} Visual 55
\\ \hspace*{ 1.3 in} VT100
\\ \hspace*{ 1.3 in} VT220

Then call the procedure to initialise the package:

\%external \%routine \%spec Set Terminal Characteristics

It may well also be advantageous to set Terminal Width if your terminal is
not 80 columns wide:

\%external \%integer \%spec Terminal Width


To allow access to advanced features of the terminal the following \%integer
has bits set in it to tell whether or not the terminal has a capability.

\%external \%integer \%spec Terminal Characteristics

\%constant \%integer Reverse Scroll \hspace{ 0.2 in} Ability
\\ \hspace*{ 1.3 in} Delete Character Ability
\\ \hspace*{ 1.3 in} Static Insert \hspace{ 0.3 in} Ability
\\ \hspace*{ 1.3 in} Dynamic Insert \hspace{ 0.2 in} Ability
\\ \hspace*{ 1.3 in} Noisy Insert \hspace{ 0.3 in} Ability
\\ \hspace*{ 1.3 in} Supress Cursor \hspace{ 0.2 in} Ability

\%constant \%integer Bright Text \hspace{ 0.4 in} Ability
\\ \hspace*{ 1.3 in} Dim Text \hspace{ 0.6 in} Ability
\\ \hspace*{ 1.3 in} Reverse Text \hspace{ 0.3 in} Ability
\\ \hspace*{ 1.3 in} Blink Text \hspace{ 0.5 in} Ability
\\ \hspace*{ 1.3 in} Underline Text \hspace{ 0.2 in} Ability
\\ \hspace*{ 1.3 in} Double Width \hspace{ 0.3 in} Ability
\\ \hspace*{ 1.3 in} Double Height \hspace{ 0.3 in} Ability


The meaning of each bit will become clear as required.

The following routines manipulate the cursor:

\%external \%routine \%spec Cursor (\%integer X, Y)
\\ \hspace*{ 0.2 in} X is normally in the range 0 to 79
\\ \hspace*{ 0.2 in} Y is normally in the range 0 to 23
\\ \hspace*{ 0.4 in} with (0, 0) being at the TOP LEFT as this has (unfortunately) become
\\ \hspace*{ 0.4 in} conventional in text manipulation.

\%external \%routine \%spec Left \%alias "IE\_TT\_C\_L"
\%external \%routine \%spec Right \%alias "IE\_TT\_C\_R"
\%external \%routine \%spec Up \hspace{ 0.3 in} \%alias "IE\_TT\_C\_U"
\%external \%routine \%spec Down \%alias "IE\_TT\_C\_D"


Scroll operations are provided by the following two routines.
Each makes a SINGLE LINE scroll in the appropriate direction. Here is one
of the philosophy distinctions between IE\_T\_D and VTLIB. The extra cost,
when taking text drawing into account, of introducing lines singly in a
scroll is minimal and by so doing the whole screen maintains readability
and the effect is much smoother.

\%external \%routine \%spec Forward Scroll (\%integer Top, Bottom)
\\ \hspace*{ 0.2 in} The line TOP is deleted and another line is added at BOTTOM, where
\\ \hspace*{ 0.2 in} TOP and BOTTOM are valid Y coordinates on the screen.
\%external \%routine \%spec Reverse Scroll (\%integer Top, Bottom)
\\ \hspace*{ 0.2 in} The Line at BOTTOM is deleted and another line is added at TOP.


The following routines are involved in clearing parts of the screen. The
names are historical.

\%external \%routine \%spec Clear Line
\\ \hspace*{ 0.2 in} The clears all text from the current line and leaves the cursor at the
\\ \hspace*{ 0.2 in} left hand margin.
\%external \%routine \%spec Clear Screen
\\ \hspace*{ 0.2 in} The clears all text from the whole screen and leaves the cursor at HOME,
\\ \hspace*{ 0.2 in} ie (0, 0), top left of the screen.
\%external \%routine \%spec Erase Line
\\ \hspace*{ 0.2 in} This clears all text from the current cursor position up to the end of
\\ \hspace*{ 0.2 in} the line, leaving the cursor unmoved. This will not normally delete
\\ \hspace*{ 0.2 in} protected text on terminals that provide this facility.


It is usually advantageous to be able to display text in different
"colours" and modes.

The following routines enable (if the terminal is capable) these
facilities:

\%external \%routine \%spec Dim On
\%external \%routine \%spec Reverse On
\%external \%routine \%spec Underline On
\%external \%routine \%spec Blink On

To go back to plain text use:
\%external \%routine \%spec Normal

Since various terminals do not support all the above features a special
procedure is provided to HIGHLIGHT text. It is recommended that this is
normally used instead of the $<$feature$>$ On routines:

\%external \%routine \%spec Feature


Some even more exotic facilities are available:

\%external \%routine \%spec Upper Half Double Height
\%external \%routine \%spec Lower Half Double Height
\%external \%routine \%spec Double Width On
\%external \%routine \%spec Normal Size

And it is even possible on some terminals to switch off the blob or
whatever that is the cursor:

\%external \%routine \%spec Cursor On
\%external \%routine \%spec Cursor Off


Terminal independant graphics characters (form filling line graphics) are
available. The set is currently not complete and can be extended as required.

Graph mode must be enabled before use of the procedures:
\%external \%routine \%spec Graph On
\%external \%routine \%spec Graph Off

\%external \%routine \%spec Left T \hspace{ 1.1 in} \{ |- \}
\%external \%routine \%spec Top Left \hspace{ 1.0 in} \{ r shape\}
\%external \%routine \%spec Horizontal \hspace{ 0.9 in} \{ - \}
\%external \%routine \%spec Vertical \hspace{ 1.0 in} \{ | \}
\%external \%routine \%spec Top Right \hspace{ 0.9 in} \{ backwards 'r' shape\}

Other possibilities include:
\\ \hspace*{ 0.2 in} Right T, Bottom Left, Bottom Right, Centre

\hspace*{ 0.2 in} and various odd characters such as pound, cent, yen and degrees signs.

Character row operations are supported, but are unlikely to be used in programs
other than editors. Note that NONE of these facilities may be available on a
terminal and IE\_T\_D does not emulate them as this has not yet been needed. IE
itself is in a much better position to update the sceen than the package so it
simply checks TERMINAL CHARACTERISTICS.

\%external \%routine \%spec Delete Characters (\%integer N)
\\ \hspace*{ 0.2 in} This deletes the N characters after the cursor.

There are three classes of INSERT CHARACTER:
\\ \hspace*{ 0.2 in} 1) Dynamic Insert: This is optimal - stick the terminal into the mode
\\ \hspace*{ 1.5 in} and all output sent to the terminal is inserted.
\\ \hspace*{ 0.2 in} 2) Noisy Insert: \hspace{ 0.3 in} This is named after the the V200 mode. It is essentially
\\ \hspace*{ 1.5 in} the same as Dynamic Insert but for various reasons the
\\ \hspace*{ 1.5 in} mode cannot be left enabled, and must be used as:
\\ \hspace*{ 1.8 in} Insert On; Put Character; \hspace{ 0.3 in} Insert Off
\\ \hspace*{ 1.5 in} On the V200 keystrokes beep in Insert Mode, hence the
\\ \hspace*{ 1.5 in} name.
\\ \hspace*{ 0.2 in} 3) Static Insert: \hspace{ 0.2 in} Terminals supporting this class of insertion can
\\ \hspace*{ 1.5 in} insert a given number of spaces after the cursor which
\\ \hspace*{ 1.5 in} can then be filled in.

Classes 1 and 2 are catered for with:
\%external \%routine \%spec Insert On
\%external \%routine \%spec Insert Off

Class 3 uses:
\%external \%routine \%spec Static Insert (\%integer N)


Output is only half the terminal independent battle! Yes, the other half is
input. IE\_T\_D uses a KEY PACKAGE which reads in ALL the odd keys on a terminal
and encodes them in the 128..255 range of the byte. \hspace{ 0.2 in} A systematic approach
has been used to providing ranges and SHIFTs.

These routines enter non-numeric mode on keyboards that have this facility.
\%external \%routine \%spec Keypad On
\%external \%routine \%spec Keypad Off

This routine is equivalent to READ SYMBOL but returns packaged keystrokes.

\%external \%byte \%function \%spec Get Key

This routine returns the name of the key, for example "Keypad ENTER".
\%external \%string (255) \%function \%spec Key Name (\%integer Key)


The key codes returned are as follows in the next few pages. Symbolic names
should always be used in preference
\%constant \%integer NUL = 0,
\\ \hspace*{ 1.3 in} SOH = 1,
\\ \hspace*{ 1.3 in} STX = 2,
\\ \hspace*{ 1.3 in} ETX = 3,
\\ \hspace*{ 1.3 in} EOT = 4,
\\ \hspace*{ 1.3 in} ENQ = 5,
\\ \hspace*{ 1.3 in} ACK = 6,
\\ \hspace*{ 1.3 in} BEL = 7,
\\ \hspace*{ 1.3 in} BS = 8,
\\ \hspace*{ 1.3 in} TAB = 9, HT = TAB,
\\ \hspace*{ 1.3 in} LF = 10,
\\ \hspace*{ 1.3 in} VT = 11,
\\ \hspace*{ 1.3 in} FF = 12,
\\ \hspace*{ 1.3 in} CR = 13,
\\ \hspace*{ 1.3 in} SO = 14,
\\ \hspace*{ 1.3 in} SI = 15,
\\ \hspace*{ 1.3 in} DLE = 16,
\\ \hspace*{ 1.3 in} DC1 = 17, XON = DC1,
\\ \hspace*{ 1.3 in} DC2 = 18,
\\ \hspace*{ 1.3 in} DC3 = 19, XOFF = DC3,
\\ \hspace*{ 1.3 in} DC4 = 20,
\\ \hspace*{ 1.3 in} NAK = 21,
\\ \hspace*{ 1.3 in} SYN = 22,
\\ \hspace*{ 1.3 in} ETB = 23,
\\ \hspace*{ 1.3 in} CAN = 24,
\\ \hspace*{ 1.3 in} EM = 25,
\\ \hspace*{ 1.3 in} SUB = 26,
\\ \hspace*{ 1.3 in} ESC = 27,
\\ \hspace*{ 1.3 in} FS = 28,
\\ \hspace*{ 1.3 in} GS = 29,
\\ \hspace*{ 1.3 in} RS = 30,
\\ \hspace*{ 1.3 in} US = 31,
\\ \hspace*{ 1.3 in} DEL = 127

\%constant \%integer Extra Keys = 128

\%constant \%integer Unknown Key = Extra Keys ! 0

\{Cursor Keys\}

\%constant \%integer Up \hspace{ 0.3 in} Key = Extra Keys ! 1,
\\ \hspace*{ 1.3 in} Down Key = Extra Keys ! 2,
\\ \hspace*{ 1.3 in} Right Key = Extra Keys ! 3,
\\ \hspace*{ 1.3 in} Left Key = Extra Keys ! 4


\{Keypad Numbers\}

\%constant \%integer Keypad 0 = Extra Keys ! 10,
\\ \hspace*{ 1.3 in} Keypad 1 = Extra Keys ! 11,
\\ \hspace*{ 1.3 in} Keypad 2 = Extra Keys ! 12,
\\ \hspace*{ 1.3 in} Keypad 3 = Extra Keys ! 13,
\\ \hspace*{ 1.3 in} Keypad 4 = Extra Keys ! 14,
\\ \hspace*{ 1.3 in} Keypad 5 = Extra Keys ! 15,
\\ \hspace*{ 1.3 in} Keypad 6 = Extra Keys ! 16,
\\ \hspace*{ 1.3 in} Keypad 7 = Extra Keys ! 17,
\\ \hspace*{ 1.3 in} Keypad 8 = Extra Keys ! 18,
\\ \hspace*{ 1.3 in} Keypad 9 = Extra Keys ! 19

\{Keypad odd keys\}

\%constant \%integer Keypad Comma = Extra Keys ! 20,
\\ \hspace*{ 1.3 in} Keypad Dot \hspace{ 0.2 in} = Extra Keys ! 21,
\\ \hspace*{ 1.3 in} Keypad Minus = Extra Keys ! 22,
\\ \hspace*{ 1.3 in} Keypad Enter = Extra Keys ! 23

\{Keypad with Function\}

\%constant \%integer Function Keypad 0 = Extra Keys ! 30,
\\ \hspace*{ 1.3 in} Function Keypad 1 = Extra Keys ! 31,
\\ \hspace*{ 1.3 in} Function Keypad 2 = Extra Keys ! 32,
\\ \hspace*{ 1.3 in} Function Keypad 3 = Extra Keys ! 33,
\\ \hspace*{ 1.3 in} Function Keypad 4 = Extra Keys ! 34,
\\ \hspace*{ 1.3 in} Function Keypad 5 = Extra Keys ! 35,
\\ \hspace*{ 1.3 in} Function Keypad 6 = Extra Keys ! 36,
\\ \hspace*{ 1.3 in} Function Keypad 7 = Extra Keys ! 37,
\\ \hspace*{ 1.3 in} Function Keypad 8 = Extra Keys ! 38,
\\ \hspace*{ 1.3 in} Function Keypad 9 = Extra Keys ! 39

\{Keypad Odd Keys Shifted\}

\%constant \%integer Function Keypad Comma = Extra Keys ! 40,
\\ \hspace*{ 1.3 in} Function Keypad Dot \hspace{ 0.2 in} = Extra Keys ! 41,
\\ \hspace*{ 1.3 in} Function Keypad Minus = Extra Keys ! 42,
\\ \hspace*{ 1.3 in} Function Keypad Enter = Extra Keys ! 43

\{Function Keys\}

\%constant \%integer Key F0 = Extra Keys ! 50,
\\ \hspace*{ 1.3 in} Key F1 = Extra Keys ! 51,
\\ \hspace*{ 1.3 in} Key F2 = Extra Keys ! 52,
\\ \hspace*{ 1.3 in} Key F3 = Extra Keys ! 53,
\\ \hspace*{ 1.3 in} Key F4 = Extra Keys ! 54,
\\ \hspace*{ 1.3 in} Key F5 = Extra Keys ! 55,
\\ \hspace*{ 1.3 in} Key F6 = Extra Keys ! 56,
\\ \hspace*{ 1.3 in} Key F7 = Extra Keys ! 57,
\\ \hspace*{ 1.3 in} Key F8 = Extra Keys ! 58,
\\ \hspace*{ 1.3 in} Key F9 = Extra Keys ! 59,
\\ \hspace*{ 1.3 in} Key F10 = Extra Keys ! 60,
\\ \hspace*{ 1.3 in} Key F11 = Extra Keys ! 61,
\\ \hspace*{ 1.3 in} Key F12 = Extra Keys ! 62,
\\ \hspace*{ 1.3 in} Key F13 = Extra Keys ! 63,
\\ \hspace*{ 1.3 in} Key F14 = Extra Keys ! 64,
\\ \hspace*{ 1.3 in} Key F15 = Extra Keys ! 65,
\\ \hspace*{ 1.3 in} Key F16 = Extra Keys ! 66,
\\ \hspace*{ 1.3 in} Key F17 = Extra Keys ! 67,
\\ \hspace*{ 1.3 in} Key F18 = Extra Keys ! 68,
\\ \hspace*{ 1.3 in} Key F19 = Extra Keys ! 69,
\\ \hspace*{ 1.3 in} Key F20 = Extra Keys ! 70

\{Any odd other keys\}

\{All terminals\}
\%constant \%integer Panic Key = Extra Keys ! 100

\{VT100 and VT220\}
\%constant \%integer PF1 Key = Extra Keys ! 101,
\\ \hspace*{ 1.3 in} PF2 Key = Extra Keys ! 102,
\\ \hspace*{ 1.3 in} PF3 Key = Extra Keys ! 103,
\\ \hspace*{ 1.3 in} PF4 Key = Extra Keys ! 104,
\\ \hspace*{ 1.3 in} Function PF2 = PF2 Key + 20,
\\ \hspace*{ 1.3 in} Function PF3 = PF3 Key + 20,
\\ \hspace*{ 1.3 in} Function PF4 = PF4 Key + 20

\{Visual 200 and Visual 55\}
\%constant \%integer Home Key = Extra Keys ! 105,
\\ \hspace*{ 1.3 in} BTAB Key = Extra Keys ! 106

\{Visual 200 only\}
\%constant \%integer CP \hspace{ 0.3 in} Key = Extra Keys ! 107,
\\ \hspace*{ 1.3 in} CL \hspace{ 0.3 in} Key = Extra Keys ! 108

\{VT220\}
\%constant \%integer Help Key = Key F15,
\\ \hspace*{ 1.3 in} Do \hspace{ 0.2 in} Key = Key F16,
\\ \hspace*{ 1.3 in} Find Key = Extra Keys ! 109,
\\ \hspace*{ 1.3 in} Insert Here Key = Extra Keys ! 110,
\\ \hspace*{ 1.3 in} Remove Key = Extra Keys ! 111,
\\ \hspace*{ 1.3 in} Select Key = Extra Keys ! 112,
\\ \hspace*{ 1.3 in} Prev Screen Key = Extra Keys ! 113,
\\ \hspace*{ 1.3 in} Next Screen Key = Extra Keys ! 114
\vspace{.75in} view:Ieterm printed on 09/02/89 at 17.18

\newpage
\tableofcontents
\end{document}
