:   ZCPR-3 Terminal Capabilities (TCAP) Extended Definition 

		as of 3 February 1990 (HFB+JWW)

The ZCPR-3 TCAP is a 128-byte area positioned immediately after
the Environment Descriptor.  The configuration has been changed
from the original descriptions contained in Richard Conn's book,
"ZCPR3: The Manual."  The layout here is designed for backward
compatibility with the original scheme while adding extensions
to accommodate rudamentary business graphics and pull-down menus
described in Dennis Wright's GRXLIB and portions of GRWLIB.

Offsets in this description are from the base of the Z3 TCAP.

 Offset     Item 			 Description 

  0 	Terminal Name	13 characters, alphanumeric.  The first
		 character must NOT be a space.  (A leading space means
		 uninstalled TCAP.)  By convention, a terminal name is
		 unique in its first eight characters and the name
		 is terminated with a space.

  13 	Offset to the GOELD entry

  14 	High Terminal Characteristics (Bit 7 set (80h))

  15 	Low Terminal Characteristics now defined as follows:

		B15 b0	Standout	0 = Dim, 1 = Reverse Video
		B15 b1	Power Up	0 = None, 1 = 10-second delay
		B15 b2	No Wrap		0 = Wrap, 1 = No Wrap
		B15 b3	No Scroll	0 = Scroll, 1 = No Scroll
		B15 b4	ANSI		0 = ASCII, 1 = ANSI

The following four bytes are for single-byte cursor movement
codes FROM the terminal.  If your terminal has no independant
cursor movement keys, or implements cursor movement with multi-
byte sequences, use any convenient single-key sequence you
desire.  The familiar WordStar "diamond" comprised of Control-E
(Up), Control-X (Down), Control-D (Right) and Control-S (Left)
is commonly used.

  16 	 Cursor Up	Cursor UP code from terminal (^E)
  17 	 Cursor Dowm	Cursor DOWN code from terminal (^X)
  18 	 Cursor Right	Cursor RIGHT code from terminal (^D)
  19 	 Cursor Left	Cursor LEFT code from terminal (^S)

Some terminals need delays to perform certain functions.  This
may be more important as interface speeds increase.  Delays are
in milliseconds.  Consult your terminal manual for the correct
values to insert.

  20 	 Clear Screen	Delay in milliseconds (0 to 255)
  21 	 Move Cursor	Delay in milliseconds (0 to 255)
  22 	 Clear to EOL	Delay in milliseconds (0 to 255)
Beginning at Offset 23 from the beginning of the TCAP, a
sequence of Null-terminated strings define the Command Strings
needed to make the Terminal respond as desired.  If particular
features are not implemented on nor needed by your terminal, a
single Null (binary 0) disables that feature.  

  Clear Screen 		(CL) - Clear Screen & Home Cursor

  Cursor Movement 	(CM) - Parsed string for cursor posi-
			 tioning.  See ZCPR3, The Manual for details.  
			 "%N" string added to send Binary 0 to Terminal.

  Clear to End-of-Line 	(CE) - Clear from Cursor Position to
			 the end of the current line.

  Standout Begin 	(SO) - Enter Standout Mode
			 If terminal uses DIM or Reduced intensity, the 
			 Initialization string (TI below) should set to
			 reduced intensity, and this sets normal intensity.
  Standout End 	        (SE) - End Standout Mode
			 If you use DIM or reduced intensity with normal
			 for "Standout", this restores the DIM mode.

  Initialize Terminal 	(TI) - Initialize the terminal (see SO/SE above)

  De-initialize Term 	(TE) - Restore Terminal to normal mode (see SO/SE)

  Delete Line 		(LD) - Delete line on which the cursor resides
			 and move lines below it up.  Bottom line is blank.

  Insert Line 		(LI) - Insert blank line before the one on which
			 the cursor positioned and move lines below down.

  Clear to EOS 		(CD) - Clear screen from current cursor
			 position to the End-of-Screen.

  Set Attributes 	(SA) - Set character attributes.

  Attributes 		(AT) - Attribute characters for this terminal.
			 Usually Normal, Blink, Reverse and Underscore.

  Read Cursor Position  (RC) - Return Cursor in HL.
  Read Terminal Line 	(RL) - Return current Line.

The following definitions implement portions of the GRXLIB and
GRWLIB functionality, but in different TCAP locations.

  Graphics Delay     (GOELD) - Delay for Graphics On/Off.  Use
				greater of the two delay times
				in milliseconds. Values of 0 to
				255 are acceptable
  Graphics Mode On 	(GO) - Set Terminal to Graphics Mode
  End Graphics Mode 	(GE) - Restore Terminal to normal
				Alphanumeric mode
  Cursor Off 		(CDO)- Disable Cursor display.  Needed
				for Pull Down Menus
  Cursor On 		(CDE)- Enable Cursor display.  Needed
				for Pull Down Menus
Several graphics strings are needed to implement the desired
level of functionality.  Each of these is needed in the
specified order.  The terminal should first be placed in the
graphics mode, then the desired string sent.  If strings for
all terminals are only a single character, this may be reduced
to a character array in the future.

  Upper-Left Corner 	(GULC) - String for now
  Upper-Right Corner 	(GURC) -   "     "   "
  Lower-Left Corner 	(GLLC) -   "     "   "
  Lower-Right Corner 	(GLRC) -   "     "   "
  Horizontal Line 	(GHL)  -   "     "   "
  Vertical Line 	(GVL)  -   "     "   "
  Solid (Full) Block 	(GFB)  -   "     "   "
  Hashed Block 		(GHB)  -   "     "   "
  Upper Intersect 	(GUI)  -   "     "   "
  Lower Intersect 	(GLI)  -   "     "   "
  Intersection 		(GIS)  -   "     "   "
  Right Intersect 	(GRTI) -   "     "   "
  Left Intersect 	(GLTI) -   "     "   "
The remainder of the TCAP should be filled with binary Zeros to
properly handle future additions.

Example TermCap:

; NZTCAP:  NZWYS60.Z80
; Author:  Joe Wright
; Date:    12 October 87
; Version: 1.0

; VERSION: 2.2   3 February 90
;
; Moved the CD (clear to end of screen) string back after LI string.
; Define B13 as offset from NZTCAP to GOELD.

; VERSION: 2.1  19 January 90

; Added Read Cursor and Read Line functions.
; Graphics characters now in a table instead of individual strings.

; VERSION: 2.0	12 December 89

; Modified for new VLIB4 graphics and for new SETATT and SETATR routines.
; The SA: macro string is modified for the routines and a new string,
; AT: is added to contain the four main attributes for this terminal:
;	Normal, Blink, Reverse, Underscore

; Extended Termcap Data for NZ

; This is the proposed TermCap Data for the New Z-System.
; It more fully describes the terminal and its capabilities.

ESC	EQU	27		; ASCII escape character

; I have adopted the convention that a terminal name is terminated
; with a space character, therefore no spaces within the name.
; Also that the terminal name is unique in the first eight characters.
;
NZTCAP:	DB	'WYSE-60D     ' ; Name of terminal (13 bytes)

;
; The Graphics section is no longer fixed so we must provide an
; offset to it.  One byte is sufficient for a two-record TCAP.
;
B13:	DB	GOELD-NZTCAP	; Offset to GOELD
;
; Bit 7 of B14 indicates the new Extended TCAP.  Bits 6-0 are undefined.
;
B14:	DB	10000000B	; Extended TCAP
;
; It is often desirable to differentiate terminals with other than
; their commands.  For example TeleVideo 955 has the same command
; set as Wyse 60 but takes less time to initialize (reset).

;
; 16 bits are now reserved for indicating terminal charactistics
; which cannot be known from the strings.  I have defined five
; of these bits for my own purposes.  
;
; B15 b0	Standout	0 = Half-Intensity, 1 = Reverse Video
; B15 b1	Power Up Delay	0 = None, 1 = 10-second delay
; B15 b2	No Wrap		0 = Line Wrap, 1 = No Wrap
; B15 b3	No Scroll	0 = Scroll, 1 = No Scroll
; B15 b4	ANSI		0 = ASCII, 1 = ANSI
;
B15:	DB	00000010B	; Power Up Delay
;

	DB	'K'-'@'		; Cursor up
	DB	'J'-'@'		; Cursor down
	DB	'L'-'@'		; Cursor right
	DB	'H'-'@'		; Cursor left
	DB	00		; Cl delay
	DB	00		; Cm delay
	DB	00		; Ce delay

; Strings start here.

CL:	DB	ESC,'+',0	; Cl string			0
	DB	ESC,'=%+ %+ ',0	; Cm string			1
	DB	ESC,'T',0	; Ce string			2
	DB	ESC,')',0	; So string			3
	DB	ESC,'(',0	; Se string			4
	DB	0		; Ti string			5
	DB	ESC,'(',0	; Te string			6

;
; Extensions to Standard Z3TCAP 
;
LD:	DB	ESC,'R',0	; Line Delete			7
LI:	DB	ESC,'E',0	; Line Insert			8
CD:	DB	ESC,'Y',0	; Clear to end of screen	9
;
; Set Attribute strings once again included.
;
SA:	DB	ESC,'G%+0',0	; Set Attributes		10
AT:	DB	'0248',0	; Attributes			11
;
; These two allow reading the Terminal's screen.
;
RC:	DB	ESC,'?',0	; Read current cursor position	12
RL:	DB	ESC,'6',0	; Read line until cursor	13

;
; Graphics start here.	Wyse-60 goes graphic with bit 7 set.
;
GOELD:	DB	0		; On/Off Delay			0
;
; Graphics strings offset from Delay value.
;
	DB	0		; Graphics On			1
	DB	0		; Graphics Off			2
	DB	ESC,'`0',0	; Cursor Off			3
	DB	ESC,'`1',0	; Cursor On			4

; Graphics Characters

	DB	'Z'+80H		; Upper Left Corner		5
	DB	'?'+80H		; Upper Right Corner		6
	DB	'@'+80H		; Lower Left Corner		7
	DB	'Y'+80H		; Lower Right Corner		8

	DB	'D'+80H		; Horizontal Line		9
	DB	'3'+80H		; Vertical Line			10
	DB	'['+80H		; Full Block			11
	DB	'2'+80H		; Hashed Block			12
	DB	'B'+80H		; Upper Intersect		13
	DB	'A'+80H		; Lower Intersect		14
	DB	'E'+80H		; Mid Intersect			15
	DB	'4'+80H		; Right Intersect		16
	DB	'C'+80H		; Left Intersect		17
;
;  Fill unused space with nulls
;
	REPT	128-($-NZTCAP)
	DB	0
	 ENDM
;
	END
;
;  End of NZTCAPD
;------------- End of Sample TermCap -------------
