Introduction - VLIB
Clear Screen - CLS
Erase to EOL - EREOL
Goto XY ------ AT/GOTOXY
Initialization VIDINIT/Z3VINIT
Print -------- GXYMSG/VPRINT
Standout Mode  STNDOUT/STNDEND
Term Init ---- TINIT/DINIT
:Introduction to VLIB

    VLI� i� � librar� o� utilit� routine� whic� i� designe� �
t� suppor� scree� manipulatio� unde� th� ZCPR� environment�  �
Usin� VLI� an� th� ZCPR� Termina� Capabilitie� Dat� File� �
(Z3TCAP)�� th� ZCPR�� programme� ca� creat� cod� whic� i� �
transportabl� betwee� ZCPR� system� tha� ca� adap� itsel� �
readil� t� � variet� o� moder� terminals��  Fo� example� th� �
VFILE� fil� manipulatio� utilit� ca� b� move� fro� on� ZCPR� �
syste� t� anothe� wit� � totall� differen� terminal�� an� a� �
lon� a� tha� secon� syste� i� installe� wit� � Z3TCAР fo� �
it� particula� terminal�� VFILE� wil� continu� t� functio� �
exactl� a� i� di� o� th� origina� syste� wit� it� particula� �
terminal.

    Al� VLI� routine� mak� us� o� th� Z3TCA� entr�� store� �
i� th� 2n� hal� o� th� ZCPR� Environmen� Descriptor.

    I� general� � utilit� whic� use� VLI� i� alway� o� thi� �
general structure:


                    General VLIB Usage

         ...
         ext  tinit,dinit,z3vinit ;VLIB init routines
         ex�  ..�                 ;othe� VLIB routines
         ...
         lxi  h,z3env   ;get Z3 environment ptr
         call z3vinit   ;init Z3 environment and VLIB
         call tinit     ;init terminal for VLIB work
         ...
         <code containing VLIB routine calls>
         ...
         call dinit     ;deinit terminal when done
         jmp  0         ;warm boot (or return)
         ...


    A� illustrate� above�� th� genera� step� whic� ar� �
always taken when using VLIB are as follows:

         1.  Initialize Environment Pointers
              - ENVPTR is ZCPR3 Environment Descriptor Addr
              - VIDPTR sets Z3TCAP Entry Address
         2.  Call Terminal Initialization Routine
              - TINIT
         3.  Call VLIB Routines as Desired
         4.  Call Terminal Deinitialization Routine
              - DINIT

:Clear Screen Routine

Routine: CLS

Function:
    Clear the terminal screen

Inputs: None
Outputs:
    A=0 and Zero Flag Set (Z) if function not available
    A=0FFH and NZ if clear screen sequence issued
Registers Affected: PSW
Side Effects: Screen is Cleared
Special Error Conditions: None
Examples of Use:
    ext  cls  ;reference routine
    ...
    CALL CLS  ;clear screen
    ...

:Erase to End of Line Routine

Routine: EREOL

Function:
    Eras� th� curren� lin� fro� th� curso� positio� t� th� �
end of the line

Inputs: None
Outputs:
    A=0 and Zero Flag Set (Z) if function not available
    A=0FFH and NZ if ereol sequence issued
Registers Affected: PSW
Side Effects: Erase to End-of-Line occurs
Special Error Conditions: None
Examples of Use:
    ext  ereol     ;reference routine
    ...
    CALL EREOL     ;erase to end-of-line
    ...

:Cursor Positioning �
Routine: AT

Function:
    Positio� a� ro� an� colum� identifie� a� th� retur� �
address on the CRT screen.  The general syntax of usage is:

         ext  at        ;reference
         ...
         call at
         db   row,column     ;coordinates
         < code follows>


Inputs: None
Outputs: None
Registers Affected: None
Side Effects: None
Special Error Conditions: None
Examples of Use:

         ext  at        ;reference
         ...
         CALL AT
         DB   12,25     ;ROW 12, COLUMN 25
         ...


Routine: GOTOXY

Function:
    Positio� th� curso� a� th� ro� (containe� i� H�� an� �
colum� (containe� i� L� indicated�� wher� th� hom� positio� �
is H=1 and L=1 (upper left corner of screen)

Inputs: H=Row, L=Column
Outputs:
    A=0 and Zero Flag Set (Z) if function not available
    A=0FFH and NZ if cursor motion sequence issued
Registers Affected: PSW
Side Effects: Cursor is positioned
Special Error Conditions:
    I� i� recommende� tha� th� las� colum� o� th� scree� i� �
no� reference䠠 wit� GOTOX٠ sinc� man�� screen� wil� �
automaticall�� wra� aroun� t� colum� � o� th� nex� line� �
possibly advancing the screen image undesirably.


Examples of Use:

    ext  gotoxy    ;reference routine
    ...
    LXI  H,101H    ;position to row 1/col 1
    CALL GOTOXY
    ...
    MVI  H,24      ;position to row 24
    MVI  L,79      ;position to column 79
    CALL GOTOXY
    ...

:Initialization of VLIB

Routine: VIDINIT

Function:
    Se� th� pointe� t� th� Z3TCA� entr� fo� th� desire� �
terminal

Inputs: HL contains the address of the Z3TCAP entry
Outputs: None
Registers Affected: None
Side Effects: Pointer VIDPTR is set
Special Error Conditions:
    I� initializin� VLI� routines� th� programme� MUS� als� �
se� th� globa� pointe� ENVPTҠ t� poin� t� th� ZCPR� �
Environmen� Descripto� becaus� th� dela� routine� i� VLI� �
us� som� Environmen� Descripto� values�� lik� processo� �
speed��  VIDINIԠ i� provide� i� additio� t� forcin� th� �
programme� t� se� ENVPT� i� orde� t� giv� th� programme� th� �
flexibilit� o� usin� � Z3TCA� entr� whic� i� no� th� sam� a� �
that provided in the ZCPR3 Environment Descriptor.

Examples of Use:

    ext  envptr,vidinit ;reference pointer and routine
    ...
    lxi  h,z3env   ;address of ZCPR3 Environment Descriptor
    shld envptr
    lxi  h,z3env+80H    ;address of Z3TCAP in descriptor
    call vidint
    ...


Routine: Z3VINIT

Function:
    Se� th� pointe� t� th� ZCPR� Environmen� Descripto� an� �
th� followin� Z3TCA� entry

Inputs: HL contains the address of the ZCPR3 Env Descriptor
Outputs: None
Registers Affected: None
Side Effects: Pointers ENVPTR and VIDPTR are set
Special Error Conditions:  None

Examples of Use:
    ext  z3vinit ;reference pointer and routine
    ...
    lxi  h,z3env   ;address of ZCPR3 Environment Descriptor
    call z3vinit
    ...

:Print Routines

Routine: GXYMSG

Function:
    Positio� a� th� indicate� row/colum� an� prin� � �
message�� whic� ma�� optionall� contai� th� standou� mod� �
begi� characte� (1� an� standou� mod� en� characte� (2�� t� �
invok� standou� mod� an� en� standou� mod� i� th� middl� o� �
th� message��  Al� parameter� ar� passe� a� i� th� PRIN� �
routin� o� SYSLI� a� th� retur� address�  Th� genera� synta� �
of use is:

         ext  gxymsg         ;reference
         ...
         call gxymsg         ;call routine
         db   row,column     ;row and column numbers
         db   'message'      ;normal message text
         d�   1,'standou� message',�   ;standou� message
         db   0              ;end of message indicator
         < code follows >

Inputs: None
Outputs: None
Registers Affected: None
Side Effects: Message is Printed at Coordinates
Special Error Conditions: None
Examples of Use:
         ext  gxymsg
         ...
         call gxymsg
         db   5,10      ;row 5, column 10
         db   'Hello '       ;"Hello " is printed normally
         db   1,'World',2    ;"World" is printed standout
         db   0
         ...



Routine: VPRINT

Function:
    Prin� � message�� whic� ma� optionall�� contai� th� �
standou� mod� begi� characte� (1� an� standou� mod� en� �
characte� (2� t� invok� standou� mod� an� en� standou� mod� �
i� th� middl� o� th� message��  Al� parameter� ar� passe� a� �
i� th� PRIN� routin� o� SYSLI� a� th� retur� address��  Th� �
genera� synta� o� us� is:

         ext  vprint         ;reference
         ...
         call vprint         ;call routine
         db   'message'      ;normal message text
         d�   1,'standou� message',�   ;standou� message
         db   0              ;end of message indicator
         < code follows >


Inputs: None
Outputs: None
Registers Affected: None
Side Effects: Message is Printed
Special Error Conditions: None
Examples of Use:

         ext  vprint
         ...
         call vprint
         db   'Hello '       ;"Hello " is printed normally
         db   1,'World',2    ;"World" is printed standout
         db   0
         ...

:Standout Mode

Routine: STNDOUT

Function:
    Begi� Standou� Mod� - fo� som� terminals�� thi� wil� b� �
reverse video, and for others this will be dim

Inputs: None
Outputs:
    A=0 and Zero Flag Set (Z) if function not available
    A=0FFH and NZ if standout sequence issued
Registers Affected: PSW
Side Effects: Standout Mode is begun on terminal


Special Error Conditions:
    I� al� cases�� a� par� o� th� Z3TCAР definition� �
enterin� Standou� Mod� an� leavin� Standou� Mod� d� no� �
caus� an� position� o� th� scree� t� b� occupied�  Curso� i� �
NOT moved.
    I� i� recommende� tha� extensiv� curso� motio� i� no� �
don� betwee� STNDOUT/STNDEN� call� (ie�� don'� us� GOTOXY� �
sinc� th� effect� o� doin� thi� ar� no� generalize� fo� al� �
terminals and may not be desirable in some cases.
    Note: See STNDEND for the complement of this function.


Examples of Use:

    ext  stndout,stndend
    ...
    call stndout
    ...
    < all screen output is now in Standout Mode >
    ...
    call stndend
    ...
    < all screen output is back to normal >


Routine: STNDEND

Function:
    Terminat� Standou� Mod� - resum� norma� scree� display

Inputs: None
Outputs:
    A=0 and Zero Flag Set (Z) if function not available
    A=0FFH and NZ if standend sequence issued
Registers Affected: PSW
Side Effects: None (see notes for STNDOUT)
Special Error Conditions: None (see notes for STNDOUT)
Examples of Use: (see notes for STNDOUT)

:Terminal Initialization and Deinitialization

Routine: TINIT

Function:
    Initializ� th� user'� termina� fo� late� processin� b� �
VLIB routines

Inputs: None
Outputs: None
Registers Affected: None
Side Effects: Terminal may be reprogrammed
Special Error Conditions:
    TINIT�� a� � rule� shoul� b� issue� righ� afte� settin� �
u� th� environmen� pointer� an� befor� an� o� th� othe� VLI� �
routines are called.
    DINIT is the complement routine.


Examples of Use:

    ext  envptr,vidinit ;reference ptr and init routine
    ext  tinit,dinit    ;reference routines
    ...
    lxi  h,z3env        ;set up environment pointers
    shld envptr
    lxi  h,z3env+80H
    call vidinit
    call tinit          ;initialize terminal
    ...
    < body of code >
    ...
    call dinit          ;deinitialize terminal
    jmp  0              ;exit


Routine: DINIT

Function:
    Deinitialize the terminal

Inputs: None
Outputs: None
Registers Affected: None
Side Effects: None
Special Error Conditions: (see notes on TINIT)
Examples of Use: (see notes on TINIT)