Screen Clearing - CLS, CLREOS Erase to EOL - EREOL Goto XY - AT, GOTOXY Initialization - VIDINIT, Z3VINIT Print - GXYMSG, VPRINT, VPSTR Standout Mode - STNDOUT, STNDEND Term Init - TINIT, DINIT Insert/Delete - DELLIN, INSLIN Test Cursor key - ISCUR Version ID - VVERS ----------------------------------------------------------------- CLS - Clear Entire Screen and Home Cursor ENTER: None EXIT : A <> 0 Zero Flag Reset (NZ) if screen cleared A = 0, Zero Flag Set (Z) if fcn Not available USES : AF Usage: Most often used to provide initial entry conditions, or to divide functions of a program for ergonomic reasons. CLREOS - Clear from current Cursor Position to End-of-Screen leaving Cursor in present position ENTER: None EXIT : A <> 0 Zero Flag Reset (NZ) if screen cleared A = 0, Zero Set (Z) if function Not available USES : AF Usage: Most often used to remove transient information from the lower part of a screen while retaining information on the upper part. EREOL - Erase line from cursor position to End-of-Line ENTER: None EXIT : A <> 0 Zero Flag Reset (NZ) if line erased A = 0, Zero Flag Set (Z) if fcn Not available USES : AF Usage: Used to insure that remaining information on a line is cleared AT - Position cursor from In-Line code coordinate positions ENTER: None. Address of XY coordinates are on Stack Top EXIT : None. Execution resumes at instr after XY coordinates USES : None Usage: Position the cursor at row and column address pointed to by the return address. Used where the desired Row and Column position is known by the program, and does not change with program flow. See GOTOXY for positioning routine that may be varied within a program. Note: There is no checking of terminal limits in the Environment. Example: EXT AT ; Declare the routine ... ; ..other parts of program CALL AT ; Call the positioning routine DEFB ROW,COL ; ..Row and Column (1,1 is home) ... ; Program flow resumes here GOTOXY - Position cursor from Row & Column data in registers ENTER: HL = Desired Cursor position (H=Row, H=Column) EXIT : A <> 0 Zero Flag Reset (NZ) if Cursor positioned A = 0, Zero Set (Z) if function Not available USES : AF Usage: Position the cursor at Row (in Register H) and Column (in L). The Home position (Top left corner) is H=1 and L=1. When the desired Cursor position is fixed, you may want to use AT (above). (*) Bits 1 and 2 of the new Mode Byte should be sensed before positioning to last Column in a Row to avoid Screen Wrap/Scroll problems. Example: EXT GOTOXY ; Declare the routine ... ; ..intervening code LD HL,10*256+3 ; Load coords (Row 10, Col 3) CALL GOTOXY ; Try to position the Cursor JR NZ,MOVOK ; ..jump if successful ... ; Else try something else VLIB Initialization VIDINIT - Initialize the VLIB routines to a specified TCAP. ENTER: HL = Address of a Z3 formatted TCAP EXIT : None USES : None EFFECTS : VIDPTR global ptr is initialized to TCAP, VLIB set Usage: This routine provides the ability to use a TCAP other than that provided in the ZCPR3 Environment. For added safety in programming, you should also set the Z3LIB variable ENVPTR to an address pointing to an ENV construct which provides terminal parameters to some routines. Example: EXT VIDINIT ; Declare the routine ... ; ..program initialization code LD HL,(Z3EADR) ; Load ENV address LD DE,80H ; Offset to TCAP portion ADD HL,DE CALL VIDINIT ; ..and initialize VLIB ... ; Carry on with program Z3VINIT - Initialize Z3LIB and VLIB routines for use. ENTER: HL = Address of a ZCPR3 Environment Descriptor EXIT : None USES : None Usage: This routine combines the functions of the Z3LIB routine Z3INIT and VIDINIT covered above. It assumes that the TCAP begins 80H (128) bytes after the specified Environ- ment pointer passed in HL. Example: EXT Z3VINIT ; Declare the routine ... ; ..Initial program code LD HL,(Z3EADR) ; Get the Environment address CALL Z3VINIT ; ..set ENVPTR and init VLIB ... ; Carry on! Print Routines GXYMSG - Position Cursor and print text with highlighting ENTER: None. Addr of XY coords followed by text on stack top EXIT : None. Execution resumes after text terminating Null USES : None Usage: This routine is used to print a text message at a pre- defined location on the Terminal screen. It is analagous to positioning the cursor with AT followed by a string print with VPRINT. Standout and Standend attributes are recognized with binary 1 and 2 respectively. Note: There is no checking of terminal limits in the Environment. Example: EXT GXYMSG ; Declare the routine ... ; ..intervening code CALL GXYMSG ; Print as... DEFB 2,15 ; Position to Row 2, Column 15 DEFB 1,'Hi',2 ; ..and print this message DEFB ' There!',0 ; ...highlighting "Hi" ... ; Execution resumes here VPRINT - Print null-terminated Inline text with Highlighting ENTER: None. The String starting address in on Stack Top EXIT : None. Execution resumes after String terminator USES : None Usage: This routine is used to print a text string from Inline code with Highlighting ability by enabling STNDOUT mode with a binary 1, and resuming normal print via STNDEND with a binary 2. This is VLIB's version of the SYSLIB routine PRINT. Example: EXT VPRINT ; Declare the routine ... ; ..intervening code CALL VPRINT ; Print the following line DEFB 2,'Hi',1 ; ..hilighting "Hi" and DEFB ' There',0 ; ...the remainder in normal ... ; Execution resumes here VPSTR - Print a null-terminated message with Highlighting ENTER: HL = Address of Null-terminated string to print EXIT : HL = Points to byte after terminating Null A = 0, Zero Flag Set (Z) USES : AF,HL Usage: This routine is used to print text messages with High- lighting capabilities provided by STNDOUT/STNDEND from locations other than the executing code. It is the VLIB corollary of PSTR in SYSLIB. Standout Mode STNDOUT - Begin Standout mode. For terminals with Reverse Video, this routine will start that mode. For those with DIM or reduced video, use TINIT to set the terminal to that mode for normal print, and STNDOUT to place in Normal mode. DINIT should then reverse on exit. ENTER: None EXIT : A <> 0 Zero Flag Reset (NZ) if Standout Mode Entered A = 0, Zero Flag Set (Z) if Not available USES : AF Usage: This mode is used to provide visual attributes for better man-machine interface. CAUTION: Do NOT reposition the cursor or issue Carriage Returns or Line Feeds while the Standout mode is in effect since unknown effects can occur on some types of terminals. Use STNDEND to disable this mode. STNDEND - End Standout Mode, return to Normal Screen Display ENTER: None EXIT : A <> 0 Zero Flag Reset (NZ) if Standout Mode Ended A = 0, Zero Set (Z) if function Not available USES : AF Usage: This reverses the mode set by STNDOUT above. See notes for STNDOUT Terminal Initialization and Deinitialization TINIT - Initialize terminal for use with VLIB routines ENTER: None EXIT : None USES : None Usage: When writing programs based on VLIB routines, TINIT should be called early in the program flow. If you are using video attributes to provide highlighting with STNDOUT/STNDEND and your terminal only provides a DIM or reduced-intensity attribute, TINIT should set the normal mode to the DIM or Reduced mode, and STNDOUT used for normal intensity print. The corresponding DINIT should be used to restore normal mode just priot to program exit. DINIT - De-initialize the terminal. Return to Normal ENTER: None EXIT : None USES : None Usage: Normally used to restore terminal default conditions upon program termination. See Usage notes for TINIT. Example: EXT TINIT,DINIT ; Declare the routines ... ; ..initial program code CALL TINIT ; Initialize the terminal ... ; ..main program code CALL DINIT ; Do just before exitting pgm JP EXIT ; ..and return to normal DELLIN - Delete the currently addressed line INSLIN - Insert a new line at the current cursor position ENTER: None EXIT : A <> 0, Zero Flag Clear (NZ) if action completed, A = 0, Zero Set (Z) if function Not defined. USES : AF Usage: These routines may be used to enhance screen editor functions under ZCPR3 with appropriate TERMCAP definitions. Example: EXT DELLIN,INSLIN ; Declare the routines ... ; ..pos'n cursor to desired line CALL DELLIN ; Kill it! JR Z,NOTDONE ; ..jump if not defined ... ; ..position to new line pos'n CALL INSLIN ; New line here, push others down JR Z,NOINSL ; ..jump if not defined ... ; Else continue on ISCUR - Test character for Cursor Movement Key ENTER: A = Character to test EXIT : A = 1..4 (1=Up, 2=Down, 3=Right, 4=Left), Zero Clear (NZ) if Character is Cursor key from TCAP or WordStar Cursor key A = Character, Zero Set (Z) if NOT Cursor key USES : AF Usage: This routine may be called to determine if a character is a command to move the cursor Up, Down, Right or Left. Both single char commands from the Extended TCAP as well as WordStar ^E, ^X, ^D and ^S are checked. Example: EXT ISCUR, CIN ; Declare some routines ... ; ..preceding code CALL CIN ; Get a char from the keyboard CALL ISCUR ; Is it a cursor key? JR Z,NOCUR ; ..jump if not a cursor key VVERS - Return the VLIB version number. ENTER: None EXIT : HL - contains VLIB version number (H=major, L=minor) USES : HL Usage: This routine is most often called for debugging or documentation purposes to include the VLIB library version number linked in programs.