ZCPR2 Feature-Specific Utilities
Initialization Routines
ZCPRQ Status Routine
Multiple Command Line Pointer Routine
Path-Oriented File Search Routine
File Status Routine
:Introduction
    Thi� modul� contain� � serie� o� routine� whic� ar� designe� �
t� allo� th� programme� t� tak� advantag� o� ke� ZCPR�� Feature� �
withou� doin� � lo� o� programmin� fo� himself��  I� particular� �
facilitie� suc� a� th� followin� ar� provided:
         �  Initializatio� -- Settin� th� locatio� o� the
                   multiple command line buffer
         .  Initialization -- Defining the location of a command
                   search path
         .  Initialization -- Setting the current DMA address
         .  Initialization -- Setting the current disk/user
                   character definition
         .  Initialization -- Setting all ZCPR2-Specific buffers
                   from the standard utility buffers
         .  Utility -- Returning a pointer to the first byte
                   of the next command
         .  Utility -- Searching for a file along the command
                   search path
         .  Utility -- Determining the attributes of a file
         �  Utilit� -- Returnin� � Pointe� t� thi� Module'�
                   buffers
:Initialization Routines

    Routine Name:  ZINIMC
    Function�
         ZINIM� define� th� bas� addres� o� th� multipl� comman� �
lin� buffe� fo� th� ZCPR� system��  Th� initializatio� performe� �
b�� thi� routin� i� use� b� th� ZMCPT� routin� t� retur� th� �
pointer to the first character of the next command.
    Inputs:  HL = base address of multiple command line buffer
    Outputs:  None
    Registers Affected:  None
    SYSLIB Routines Called:  None
    Specia� Erro� Conditions�  None
    Note��  I� thi� routin� i� no� called�� i� i� assume� tha� �
multiple command lines are not supported.


    Routine Name:  ZINIEXT
    Function�
         ZINIEXԠ define� th� bas� addres� o� � comman� searc� �
path��  Th� ZPFINĠ routin� use� thi� bas� addres� t� star� it� �
searc� fo� � file��  Not� tha� thi� provide� adde� flexibilit� i� �
tha� thi� nee� no� necessaril� b� th� bas� addres� o� th� ZCPR� �
Syste� comman� searc� path� bu� i� ma� b� th� bas� addres� o� an� �
path (such as a separate path to look for HLP files).
    Inputs:  HL = base address of path
    Outputs:  None
    Registers Affected:  None
    SYSLIB Routines Called:  None
    Specia� Erro� Conditions�  None
    Note��  I� thi� routin� i� no� called�� th� externa� pat� �
default� t� a� empt� path�� s� n� har� i� don� an� n� searc� ca� �
b� performed.


    Routine Name:  ZINIDMA
    Function�
         ZINIDM� define� th� DM� addres� t� b� use� b� th� ZCPR� �
routines.  If this routine is not called, 80H is assumed.
    Inputs:  HL = DMA Address
    Outputs:  None
    Registers Affected:  None
    SYSLIB Routines Called:  None
    Specia� Erro� Conditions�  None
    Note��  I� thi� routin� i� no� called�� DM� Addres� default� �
t� 80H.


    Routine Name:  ZINICI
    Function�
         ZINICɠ define� th� curren� user/dis� indicato� t� b� �
use� b� th� ZCPR� routines��  I� thi� routin� i� no� called�� '$� �
i� assumed.
    Inputs:  A = Indicator
    Outputs:  None
    Registers Affected:  None
    SYSLIB Routines Called:  None
    Specia� Erro� Conditions�  None
    Note��  I� thi� routin� i� no� called�� thi� indicato� �
defaults to the character '$'.


    Routine Name:  ZGPINS
    Function�
         ZGPINӠ initialize� th� ZCPR2-Specifi� Buffer� fro� th� �
ZCPR�� Utilit� Standar� General-Purpos� Installatio� Forma� Buf-�
fers��  Thi� i� t� b� use� b� ZCPR� Utilities�� suc� a� XDIR3� t� �
completel� initializ� al� th� necessar� buffers.
    Th� buffer� i� th� utilitie� ar� locate� a� indicate� i� th� �
ZCPR� Utilitie� Manual.

    Inputs:  None
    Outputs:  None
    Registers Affected:  None
    SYSLIB Routines Called:  MOVEB, ZINIMC, ZINIEXT, ZINIDMA,
                             ZINICI, ZFNINIT
    Specia� Erro� Conditions�  None

:ZCPRQ Status Routine

    Routine Name:  ZCPRQ
    Function�
         Thi� routin� return� � pointe� t� th� firs� byt� o� th� �
firs� ZCPR� module� interna� buffers��  Thes� buffer� contai� ke� �
informatio� necessar�� fo� th� prope� operatio� o� thi� se� o� �
ZCPR2 routines.  The structure of this buffer area is:
              Byte 0:  Multiple Command Flag; 0 says no multiple
                        command line buffer is available (No
                        command line is assumed)
              Bytes 1-2:  Address of Multiple Command Line
                        Buffer if it is available
              Bytes 3-4:  Address of ZCPR2 External Path
                        (Points to an empty path if not
                        initialized)
              Byte 5:  Current User/Disk Indicator ($ if not
                        initialized)
              Bytes 6-7:  DMA Address (80H assumed)

    Inputs:  None
    Outputs:  HL = Base Address of Internal Buffers
    Registers Affected:  HL
    SYSLIB Routines Called:  None
    Specia� Erro� Conditions�  None

:Multiple Command Line Pointer Routine

    Routine Name:  ZMCPTR
    Function�
         ZMCPTҠ return� � pointe� t� th� nex� characte� i� th� �
multipl� comman� lin� i� multipl� command� ar� enabled��  �� fla� �
is returned which says if multiple commands are enabled or not.
    Inputs:  None
    Outputs:  HL pts to next char in line
              A=0 and Zero Flag Set (Z) if multiple commands
                   are not available; NZ otherwise
    Registers Affected:  HL, PSW
    SYSLIB Routines Called:  None
    Specia� Erro� Conditions�  None

:Path-Oriented File Search Routine

    Routine Name:  ZPFIND
    Function�
         ZPFINĠ searche� fo� � fil� alon� th� comman� searc� �
pat� whos� bas� addres� wa� define� whe� th� programme� calle� �
ZINIEXT��  I� log� int� eac� dis� an� use� are� alon� th� path� �
lookin� fo� th� fil� whos� FC� i� pte� t� b� DE�� unti� i� eithe� �
find� th� fil� o� reache� th� en� o� th� pat� (fil� no� found)�  �
I� th� fil� i� found�� i� return� th� dis� an� use� are� i� whic� �
th� fil� resides��  ZPFIN� alway� return� th� proces� t� th� dis� �
and user area it is "currently" logged into.

    Inputs:  DE pts to the FCB of the file to find
             B is a flag; if B <> 0, search the current disk and
                   user area first; if B=0, do not search the
                   current disk and user area first


ZPFIND, Con't

    Outputs:  Zero Flag Clear (NZ) and A=0FFH if file found
              B = Disk (B=0 if Disk A), C=User if file found
              Zero Flag Set (Z) and A=0 if file not found

    Registers Affected:  BC, PSW

    SYSLIB Routines Called:  BDOS

    Specia� Erro� Conditions�  None

:File Status Routine

    Routine Name:  ZFSTAT
    Function�
         ZFSTAԠ determine� th� attribute� o� th� fil� i� th� �
curren� dis� an� use� are� whos� FC� i� pte� t� b� DE��  I� tell� �
the programmer if the file is SYSTEM or not and READ/ONLY or not.
    Inputs:  DE pts to FCB of file
    Outputs:  B=0 means file is NOT System, B<>0 means file is
              C=0 means file is NOT R/O, C<>0 means file is
              Zer� Fla� Se� (Z� an� A=� i� fil� foun� an� BC
                   valid, and Zero Flag Clear (NZ) if file not
                   found
    Registers Affected:  BC, PSW
    SYSLIB Routines Called:  BDOS
    Specia� Erro� Conditions�  None
    Note:  ZFSTAT does NOT do a search.