home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / zsus / progpack / v42-docs.lbr / Z3LIB42.DZC / Z3LIB42.DOC
Encoding:
Text File  |  1990-06-08  |  121.3 KB  |  2,589 lines

  1. .hm1
  2. .fm1
  3. .sr0
  4. .he                                 ZCPR3: THE LIBRARIES 4.2 -- Z3LIB
  5. .fo                                                            Page #
  6. .pn 85
  7.  
  8.          II«  Z3LI┬ -¡ ZCPR│ Suppor⌠ anΣ Acces≤ Routines
  9.  
  10.      Introductioε « « « « « « « « « « « « « « « « « « « « « «  87
  11.           ExtendeΣ Environmen⌠ Descriptioε  « « « « « « « « «  87
  12.      Acces≤ t∩ thσ ZCPR│ Environmen⌠  « « « « « « « « « « « «  90
  13.           Command Linσ  « « « « « « « « « « « « « « « « « « «  91
  14.                APPCL¼ CLRCL¼ GETCL1¼ GETCL2¼ PUTCL
  15.           CR╘ anΣ PRT Datß  « « « « « « « « « « « « « « « « «  92
  16.                GETCRT¼ GETPRT¼ PUTCRT¼ PUTPRT
  17.           External Filσ Contro∞ Blocδ « « « « « « « « « « « «  94
  18.                GETEFCB
  19.           Environmen⌠ « « « « « « « « « « « « « « « « « « « «  94
  20.                GETENV¼ GETVID
  21.           Flo≈ Command Packagσ (FCP) Addres≤  « « « « « « « «  95
  22.                GETFCP
  23.           Filename≤ « « « « « « « « « « « « « « « « « « « « «  95
  24.                GETFN1, GETFN2¼ GETFNX¼ PUTFNX
  25.           ╔nitializσ  « « « « « « « « « « « « « « « « « « « «  96
  26.                WHRENV¼ Z3INIT
  27.           System Datß « « « « « « « « « « « « « « « « « « « «  97
  28.                ZSYSCHK¼ Z33CHK¼ GETBDOS¼ GETCCP¼ GETECP
  29.           Input-Outpu⌠ Packagσ (IOP) Concept≤ « « « « « « « «  99
  30.                GETION¼ GETIOP¼ GETIOS¼ IOMATCH¼ PUTIOD
  31.           Input-Outpu⌠ Packagσ (IOP) Recordinτ  « « « « « « « 101
  32.                IORCOFF, IORCON, IORLOFF, IORLON
  33.           Drive/Use≥  « « « « « « « « « « « « « « « « « « « « 101
  34.                GETDUOK¼ GETMDISK¼ GETMUSER¼ PUTDUOK,
  35.                PUTMDISK¼ PUTMUSER¼ HIGHUSER¼ GCMDDU
  36.           Message≤  « « « « « « « « « « « « « « « « « « « « « 103
  37.                GETMSG¼ GETSHM¼ PUTSHM
  38.           Named Directorie≤ « « « « « « « « « « « « « « « « « 104
  39.                ADDNDR¼ DIRNDR¼ DUNDR¼ GETNDR¼ SUBNDR
  40.           PatΦ  « « « « « « « « « « « « « « « « « « « « « « « 106
  41.                GETPATH
  42.           Processor SpeeΣ « « « « « « « « « « « « « « « « « « 106
  43.                GETSPEED¼ PUTSPEED
  44.           Quiet Flaτ  « « « « « « « « « « « « « « « « « « « « 107
  45.                GETQUIET¼ PUTQUIET
  46.           Residen⌠ CommanΣ Packagσ (RCP) Addres≤  « « « « « « 107
  47.                GETRCP
  48.           Shell Stacδ « « « « « « « « « « « « « « « « « « « « 108
  49.                GETSH1¼ GETSH2
  50.           Wheel Bytσ  « « « « « « « « « « « « « « « « « « « « 108
  51.                GETWHL¼ PUTWHL
  52.      Flo≈, ZE╪¼ anΣ SUBMIT Contro∞  « « « « « « « « « « « « « 109
  53.           Flow Contro∞  « « « « « « « « « « « « « « « « « « « 109
  54.                IFEND¼ IFT, IFF¼ IFTEST¼ IFELSE
  55.           ZEX Access and Contro∞  « « « « « « « « « « « « « « 111
  56.                ZEX Datß « « « « « « « « « « « « « « « « « « « 112
  57.                     GETZFC¼ GETZNC¼ GETZRUN¼ PUTZNC¼ PUTZRUN
  58.                ZEX Status and Contro∞ « « « « « « « « « « « « 113
  59.                     GETZEX¼ PUTZEX¼ HALTZEX¼ STOPZEX¼ STRTZEX
  60. .pa
  61. è          SUBMIT and XSUB Contro∞ « « « « « « « « « « « « « « 114
  62.                SUBMIT Data and Contro∞  « « « « « « « « « « « 115
  63.                     SUBON¼ HALTSUB¼ GETSRUN¼ GETSFCB
  64.                XSUB Data and Contro∞  « « « « « « « « « « « « 116
  65.                     STOPXSUB¼ GXSUB¼ PXSUB
  66.      ZCPR3 Message≤ « « « « « « « « « « « « « « « « « « « « « 116
  67.           Command Status Messagσ  « « « « « « « « « « « « « « 118
  68.                GETCST¼ PUTCST¼ QERROR¼ QSHELL
  69.           Error Flag and Error CommanΣ  « « « « « « « « « « « 119
  70.                ERRADR¼ GETER1¼ PUTER1¼ GETERC¼ PUTERC
  71.           Inter-Transient Error Codσ  « « « « « « « « « « « « 121
  72.                GETER2¼ PUTER2
  73.           Command Error Flag and Handle≥  « « « « « « « « « « 121
  74.                GETER3¼ PUTER3¼ INVERROR
  75.           Command Status Flaτ « « « « « « « « « « « « « « « « 122
  76.                SETEPB¼ RESEPB¼ RETCST
  77.           Register Acces≤ « « « « « « « « « « « « « « « « « « 123
  78.                GETREG¼ PUTREG
  79.           Default Drive/User Buffe≥ « « « « « « « « « « « « « 124
  80.                GDEFDU¼ PDEFDU
  81.      ZCPR│ Utilitie≤  « « « « « « « « « « « « « « « « « « « « 124
  82.           Named Directory-Drive/User Conversioε « « « « « « « 124
  83.                DIRTDU¼ DUTDIR
  84.           Resolve Directory Reference≤  « « « « « « « « « « « 125
  85.                DNSCAN¼ DUSCAN¼ DIRSCAN
  86.           Parse Command Linσ  « « « « « « « « « « « « « « « « 126
  87.                PARSER
  88.           Path Search for Filσ  « « « « « « « « « « « « « « « 126
  89.                PFIND
  90.           Program Loading (Chaining⌐  « « « « « « « « « « « « 126
  91.                PRGLOAD
  92.           Console Quie⌠ Outpu⌠  « « « « « « « « « « « « « « « 127
  93.                QCOUT¼ QCRLF¼ QOUT¼ QPRINT¼ QPSTR
  94.           Locate ROOT Director∙ « « « « « « « « « « « « « « « 128
  95.                ROOT
  96.           Shell Stack Routine≤  « « « « « « « « « « « « « « « 128
  97.                SHEMPTY¼ SHFULL¼ SHPOP¼ SHPUSH
  98.           Delay Routine≤  « « « « « « « « « « « « « « « « « « 129
  99.                WAIT1S¼ WAIT1MS¼ WAITP1S
  100.           Log into ZCPR3 Filσ Contro∞ Block Drive/Use≥  « « « 130
  101.                Z3LOG
  102.           Return Z3LIB Versioε  « « « « « « « « « « « « « « « 130
  103.                Z3LVER
  104.           Parse Tokeε « « « « « « « « « « « « « « « « « « « « 131
  105.                ZPRSFN, ZFNAME
  106.           ZCPR 3.3 Parser≤  « « « « « « « « « « « « « « « « « 131
  107.                Z33FNAME¼ PARSE2¼ REPARSE¼ SCAN
  108.           Check ZCP╥ 3.3 Parse Result≤  « « « « « « « « « « « 132
  109.                FCB1CHK, FCB2CHK¼ FCBCHK
  110.           Print Load Module Datß  « « « « « « « « « « « « « « 133
  111.                PRTTYPE
  112.           ZCP╥ 3.3 Internal Program Namσ  « « « « « « « « « « 133
  113.                GETNAME¼ PRTNAME
  114.           Highest Useable Memor∙  « « « « « « « « « « « « « « 134
  115.                GZMTOP
  116. è.pa
  117.  
  118.            Z3LI┬ -¡ ZCPR│ Suppor⌠ anΣ Acces≤ Routines
  119.  
  120.  
  121. INTRODUCTION:é á Z3LI┬ ácontain≤ suppor⌠ utilitie≤ áwhicΦ áprovidσ ì
  122. acces≤ t∩ ZCPR│¡ specifiπ feature≤ anΣ capabilities«  Z3LI┬ árouì
  123. tine≤ caε bσ divideΣ int∩ fou≥ categories:
  124.  
  125.      1.ZCPR│ áEnvironmen⌠ Acces≤ ¡¡ Utilitie≤ enablinτ áyo⌡ át∩ ì
  126. áááááeasil∙ áextrac⌠ datß froφ thσ Z│ Environmen⌠ Descripto≥ áanΣ ì
  127. ááááámodif∙ certaiε Z│ environmen⌠ parameters.
  128.  
  129.      2.ZCPR│ áFlo≈ Contro∞ ¡¡ Utilitie≤ allowinτ yo⌡ t∩ áeasil∙ ì
  130. ááááámanipulatσ áZCPR3'≤ Flo≈ Contro∞ environmen⌠ b∙ áraisinτ áo≥ ì
  131. ááááálowerinτ áthσ curren⌠ I╞ leve∞ anΣ togglinτ thσ ácurren⌠ áI╞ ì
  132. ááááácondition.
  133.  
  134.      3.ZCPR│ áMessage≤ ¡¡ Utilitie≤ providinτ acces≤ át∩ áZCPR│ ì
  135. ááááámessages¼ enablinτ program≤ t∩ reaΣ anΣ writσ message≤ áfroφ ì
  136. áááááanΣ t∩ thσ system.
  137.  
  138.      4.ZCPR│ áUtilitie≤ á¡¡ Utilitie≤ whicΦ árelievσ áyo⌡ áfroφ ì
  139. áááááconstantl∙ reprogramminτ somσ commonl∙-useΣ ZCPR│ features.
  140.  
  141. EXTENDE─ áENVIRONMEN╘ DESCRIPTION:é  Versioε ┤ oµ áZ3LI┬ áincorpoì
  142. rate≤ áman∙ áenhanceΣ function≤ developeΣ b∙ Joσ Wrigh⌠ áanΣ áJa∙ ì
  143. Sagσ iε NZCO═ anΣ ZCPR3│ anΣ 34«  Duσ t∩ redefinitioε oµ somσ áoµ ì
  144. thσ ábyte≤ iε thσ Environmen⌠ Descriptor¼ ß fe≈ oµ áthσ áorigina∞ ì
  145. module≤ áwil∞ no⌠ perforφ a≤ originall∙ intended« á Fo≥ áexample¼ ì
  146. onl∙ onσ consolσ (CR╘ device⌐ i≤ supported«  Thσ remaininτ áspacσ ì
  147. iε thσ EN╓ contain≤ vector≤ t∩ systeφ segments.
  148.  
  149. Somσ program≤ sucΦ a≤ Plu*Perfec⌠ Systemsº JETLD╥ anΣ Alphß áSysì
  150. temsº NZCO═ se⌠ aε existinτ Environmen⌠ Descripto≥ t∩ reflec⌠ thσ ì
  151. necessar∙ áextendeΣ ádefinitions«  Iµ yo⌡ d∩ áno⌠ ároutinel∙ áusσ ì
  152. eithe≥ áoµ thesσ products¼ yo⌡ shoulΣ creatσ ß ne≈ áSYS.EN╓ áfilσ ì
  153. fo≥ usσ witΦ you≥ existinτ ZCPR│ system«  Thσ ne≈ definition≤ arσ ì
  154. markeΣ áwitΦ aε asterisδ (*⌐ iε thσ followinτ sourcσ codσ ásamplσ ì
  155. Environmen⌠ Descriptor.
  156. 
  157.      ; Library:  NZENV.LIB
  158.      ; Author:   Joe Wright
  159.      ; Version:  1.0
  160.      ; Date:     29 Nov 87
  161.  
  162.      ; Adapted from Rick Conn's original SYSENV.LIB circa 1984
  163.  
  164.      Z3ENV║    J╨        CBIOS+╢   ;* Real BIOS Addr (+6) for your
  165.                                    ╗  system (* Was JP 0 *)
  166.                DEF┬      'Z3ENVº   ; Environment ID
  167.                DEF┬      80╚       ;* Extended Env shown by Bit 7
  168.  
  169.                DEF╫      EXPAT╚    ; External Path address
  170.                DEF┬      EXPATH╙   ; # of 2-byte elements in Path
  171.  
  172. è               DEF╫      RC╨       ; RCP address
  173.                DEF┬      RCP╙      ; # of 128-byte blocks in RCP
  174.  
  175.                DEF╫      IO╨       ; IOP address
  176.                DEF┬      IOP╙      ; # of 128-byte blocks in IOP
  177.  
  178.                DEF╫      FC╨       ; FCP address
  179.                DEF┬      FCP╙      ; # of 128-byte blocks in FCP
  180.  
  181.                DEF╫      Z3NDI╥    ; NDR address
  182.                DEFB      Z3NDIRS   ; # of 18-byte entries in NDR
  183.  
  184.                DEFW      Z3CL      ; ZCPR3 Command Line
  185.                DEFB      Z3CLS     ; # of bytes in Command Line
  186.  
  187.                DEFW      Z3ENV     ; ZCPR3 Environment Descriptor
  188.                DEFB      Z3ENVS    ; # of 128-byte blks in ENV
  189.  
  190.                DEFW      SHSTK     ; Shell Stack address
  191.                DEFB      SHSTKS    ; # SHSIZE-byte entries in Stk
  192.                DEFB      SHSIZE    ; Size of a Shell Stack entry
  193.  
  194.                DEFW      Z3MSG     ; ZCPR3 Message Buffer
  195.  
  196.                DEFW      EXTFCB    ; ZCPR3 External FCB
  197.  
  198.                DEFW      EXTSTK    ; ZCPR3 External Stack
  199.  
  200.                DEFB      0         ; Quiet flag (0=not quiet)
  201.  
  202.                DEFW      Z3WHL     ; Address of Wheel Byte
  203.  
  204.                DEFB      4         ; Processor Speed in MHz
  205.  
  206.                DEFB      'P'-'@'   ; Maximum Disk
  207.                DEFB      31        ; Maximum User
  208.                DEFB      1         ; 1=Ok to accept DU:, 0=Not Ok
  209.  
  210.                DEFB      0         ;* CRT Selection   (* Unused *)
  211.                DEFB      0         ; Printer Sel (only 0 or 1)
  212.  
  213.                DEFB      80        ; Width of CRT 0
  214.                DEFB      24        ; Number of lines on CRT 0
  215.                DEFB      22        ; Number of text lines on CRT 0
  216.  
  217.      ; CRT 1 descriptor is replaced with this valid drive vector.
  218.      ; The command processor ignores 'maximum disk' above, and uses
  219.      ; this vector instead.  This allows 'holes' in the disk map.
  220.      ; A user might have drives A, B, E, F, and G for example.  In
  221.      ; this case, his vector would look like:
  222.      ;    DEFW 0000000001110011B
  223.      ; The command processor will treat drive C the same as drive H
  224.      ; (unavailable) and take appropriate action.  
  225.  
  226.                DEFW      1111111111111111B ;* Valid drive vector (16)
  227. è               DEFB      0         ;* Not used
  228.  
  229.                DEFB      80        ; Width of Printer 0
  230.                DEFB      66        ; Number of lines on Printer 0
  231.                DEFB      58        ; Number of text lines on Ptr 0
  232.                DEFB      1         ; H/W Form Feed (0=can't,1=can)
  233.  
  234.                DEFB      102       ; Width of Printer 1
  235.                DEFB      66        ; Number of lines on Printer 1
  236.                DEFB      58        ; Number of text lines on Ptr 1
  237.                DEFB      1         ; H/W Form Feed (0=can't,1=can)
  238.  
  239.      ;* Descriptors for Printers 2 and 3 replaced with System Data
  240.  
  241.                DEFW      CCP       ;* ZCPR 3.x start loc'n       3FH
  242.                DEFB      CCPS      ;* Size in records            41H
  243.  
  244.                DEFW      DOS       ;* DOS starting location      42H
  245.                DEFB      DOSS      ;* Size in records            44H
  246.  
  247.                DEFW      BIOS      ;* NZBIO starting location    45H
  248.  
  249.                DEFB      'SH      ' ; Shell Variable Filename
  250.                DEFB      'VAR'     ; Shell Variable Filetype
  251.  
  252.                DEFB      '        ' ; Filename 1
  253.                DEFB      '   '     ; Filetype 1
  254.  
  255.                DEFB      '        ' ; Filename 2
  256.                DEFB      '   '     ; Filetype 2
  257.  
  258.                DEFB      '        ' ; Filename 3
  259.                DEFB      '   '     ; Filetype 3
  260.  
  261.                DEFB      '        ' ; Filename 4
  262.                DEFB      '   '     ; Filetype 4
  263.  
  264.                DEFB      0         ;* Public drive OFF           7EH
  265.                DEFB      0         ;* Public user OFF            7FH
  266.                                    ;  (* Only defined for ZRDOS *)
  267.  
  268.      ; This dummy Terminal Capabilities description (Z3TCAP) will
  269.      ; normally be replaced with a tailored MYTERM.Z3T on start up.
  270.  
  271.      ENVORG2:  DEFB      '               ' ; Terminal Name (15 chars)
  272.                DEFB      0         ; No terminal attributes
  273.                DEFB      'E'-'@'   ; Cursor Up
  274.                DEFB      'X'-'@'   ; Cursor Down
  275.                DEFB      'D'-'@º   ; Cursor Right
  276.                DEFB      'S'-'@'   ; Cursor Left
  277.                DEFB      0         ; Cl delay
  278.                DEFB      0         ; Cm delay
  279.                DEFB      0         ; Ce delay
  280.                DEFB      0         ; Cl string
  281.                ─EFB      0         ; Cm string
  282. è               DEFB      0         ; Ce string
  283.                DEFB      0         ; So string
  284.                DEFB      0         ; Se string
  285.                DEFB      0         ; Ti string
  286.                DEFB      0         ; Te string
  287.  
  288.      ; File filled with Zeros to end of 128-byte segment
  289. 
  290. ACCES╙ T╧ TH┼ ZCPR│ ENVIRONMENT:é  An∙ prograφ runninτ unde≥ ZCPR│ ì
  291. i≤ áwithiε áß ZCPR│ environment«  Man∙ facilitie≤ áanΣ ádatß áarσ ì
  292. availablσ át∩ áthi≤ prograφ whicΦ t∩ no⌠ exis⌠ áfo≥ ánorma∞ áCP/═ ì
  293. programs«  Fo≥ instance¼ ß prograφ runninτ unde≥ thσ ZCPR│ áenvΘì
  294. ronmen⌠ can:
  295.    o Find out what name it was invoked by
  296.    o Acces≤ áß se⌠ oµ message≤ froφ ZCPR│ whicΦ tel∞ i⌠ ß ánumbe≥ ì
  297. áááááoµ thing≤ abou⌠ ho≈ i⌠ wa≤ invoked
  298.    o SenΣ message≤ t∩ ZCPR│ anΣ program≤ whicΦ ruε afte≥ i⌠ ácomì
  299. ááááápletes
  300.    o FinΣ áou⌠ áman∙ thing≤ abou⌠ it≤ environment¼ ásucΦ áa≤ áthσ ì
  301. áááááprocesso≥ áspeed¼ CR╘ anΣ printe≥ ácharacteristics¼ ámaximuφ ì
  302. ááááánumbe≥ oµ disks
  303.    o Determinσ thσ you≥ termina∞ characteristic≤ anΣ usσ theφ át∩ ì
  304. áááááenhancσ áthσ displa∙ witΦ visua∞ attribute≤ sucΦ áa≤ ácurso≥ ì
  305. áááááaddressinτ anΣ highlighteΣ text.
  306.  
  307. Thσ informatioε outlineΣ abovσ anΣ morσ i≤ availablσ t∩ an∙ áproì
  308. graφ áthr⌡ thσ ZCPR│ Environmen⌠ Descriptor«  Thi≤ i≤ ß á25╢-bytσ ì
  309. blocδ oµ memor∙ containinτ addresse≤ anΣ othe≥ datß iε ß preciseì
  310. l∙-defineΣ format«  ZCPR│ utilitie≤ ma∙ bσ writteε witΦ aε interì
  311. na∞ áEnvironmen⌠ áDescripto≥ o≥ the∙ ma∙ áacces≤ áaε áEnvironmen⌠ ì
  312. Descripto≥ áresidinτ a⌠ somσ fixeΣ memor∙ locatioε (thi≤ ái≤ áthσ ì
  313. preferreΣ approach)«  Wheε executed¼ program≤ caε extrac⌠ áspeciì
  314. fiπ informatioε froφ thσ descripto≥ fo≥ use.
  315.  
  316. Thσ followinτ informatioε i≤ containeΣ withiε ß ZCPR│ Environmen⌠ ì
  317. Descriptor:
  318.      address of external path      size of external path
  319.      address of RCP                size of RCP
  320.      address of FCP                size of FCP
  321.      address of IOP                size of IOP
  322.      address of named directory    size of named directory
  323.      address of command line       size of command line
  324.      address of env descriptor     size of env descriptor
  325.      address of shell stack        size of shell stack
  326.      address of Z3 messages        size of stack entries
  327.      address of external FCB       address of external stack
  328.      address of wheel byte         quiet flag
  329.      processor speed               DU approval flag
  330.      maximum disk allowed          maximum user allowed
  331.      data on CRT                   data on printer
  332.      two reserved filenames        ZCPR3 TERMCAP (Z3TCAP)
  333.  
  334. Thσ purposσ oµ Z3LI┬ i≤ t∩ providσ yo⌡ witΦ eas∙ acces≤ t∩ inforì
  335. matioε áiε thσ ZCPR│ Environmen⌠ Descripto≥ anΣ t∩ allo≈ áyo⌡ át∩ ì
  336. easil∙ áusσ thi≤ information«  T∩ illustrate¼ somσ oµ áthσ áZ3LI┬ ìèroutine≤ are:
  337.  
  338.    o GETPR╘ á¡¡ áreturε datß oε thσ width¼ numbe≥ oµ álines¼ áanΣ ì
  339. áááááforφ feeΣ abilit∙ oµ thσ printer
  340.    o GETCL▓ á¡¡ returε thσ addres≤ oµ thσ firs⌠ characte≥ oµ áthσ ì
  341. ááááánex⌠ commanΣ t∩ bσ run¼ iµ any
  342.    o GETEFC┬ á¡¡ áreturε thσ addres≤ oµ thσ externa∞ FC┬ ás∩ áthσ ì
  343. áááááprograφ caε determinσ it≤ name
  344.    o SHPUSH -- push a command line on the shell stack
  345.    o SHPOP -- pop a command line from the shell stack
  346.    o IFT -- invoke the next IF level and make it T
  347.    o IFEND -- back up to previous IF level
  348.  
  349. Thi≤ filσ describe≤ thosσ Z3LI┬ routine≤ whicΦ providσ acces≤ át∩ ì
  350. thσ áZCPR│ Environmen⌠ Descripto≥ data«  Man∙ oµ áthesσ ároutine≤ ì
  351. arσ oµ thσ genera∞ name:
  352.      GETxxxxx
  353. wherσ áthσ mnemoniπ followinτ thσ GE╘ prefi° allude≤ t∩ wha⌠ áinì
  354. formatioε i≤ beinτ obtained.
  355.  
  356. COMMAND LINE:
  357.  
  358.      Routine║   APPCL
  359.      Function║ Append command string to command line buffer
  360.      Entry║    HL = address of command string to append
  361.      Exit║     A <> 0, zero flag clear (NZ) if append complete
  362.                ┴ ╜ 0¼ zer∩ flaτ se⌠ (Z⌐ iµ buffe≥ overflow≤ o≥ n∩ ì
  363. ááááááááááááááácommanΣ linσ buffe≥ (n∩ changσ t∩ commanΣ line)
  364.      Affected║ AF╗ command line buffer is changed
  365.      Usage:    Append≤ ááthσ áspecifieΣ áNU╠-terminateΣ áácommanΣ ì
  366. ááááááááááááááástrinτ t∩ thσ enΣ oµ thσ ZCPR│ commanΣ linσ buffe≥ ì
  367. áááááááááááááááfo≥ áexecution«  ┴ leadinτ semicoloε i≤ áprependeΣ ì
  368. ááááááááááááááát∩ allo≈ thi≤ linσ t∩ executσ afte≥ thσ las⌠ álinσ ì
  369. áááááááááááááááiε áthσ buffer«  Thσ commanΣ linσ buffe≥ ácontent≤ ì
  370. áááááááááááááááarσ árepackeΣ át∩ aver⌠ overflo≈ áiε ámos⌠ ácases«  ì
  371. áááááááááááááááPUTC╠ ái≤ áß complementar∙ functioε iε áwhicΦ áthσ ì
  372. ááááááááááááááácommanΣ ástrinτ i≤ addeΣ t∩ thσ beginninτ áoµ áthσ ì
  373. ááááááááááááááácommanΣ linσ buffe≥ a≤ thσ firs⌠ command.
  374.  
  375.      Routine║   CLRCL
  376.      Function║ Clear the command line buffer
  377.      Entry:    None
  378.      Exit:     A <> 0, zero flag clear (NZ) if command line cleared
  379.                A = 0, zero flag set (Z) if no command line buffer
  380.      Affected: AF
  381.      Usage:    Clear≤ áthσ commanΣ linσ buffe≥ b∙ settinτ ái⌠ át∩ ì
  382. áááááááááááááááempty«  An∙ remaininτ command≤ iε thσ buffe≥ áwil∞ ì
  383. áááááááááááááááno⌠ bσ executeΣ wheε contro∞ i≤ returneΣ t∩ ZCPR3.
  384. .pa
  385. è     Routine║   GETCL1
  386.      Function║ Return pointer to command line buffer
  387.      Entry:    None
  388.      Exit:     H╠ ╜ addres≤ oµ commanΣ linσ buffe≥ (░ iµ nonexisì
  389. ááááááááááááááátent)
  390.                A = size of buffer
  391.      Affected: AF¼ HL
  392.      Usage:    Locate≤ áanΣ return≤ commanΣ linσ ábuffe≥ áparameì
  393. áááááááááááááááters«  Thσ commanΣ linσ buffe≥ i≤ structureΣ as:
  394.                     CMDLIN║   DEF╫      <address of next character to process>
  395.                               DEF┬      <size of buffer in bytes>
  396.                               DEFB      <dummy used for BDOS READLN function>
  397.                               DEFB      <....chars in command line>
  398.                               DEFB      0              ; end of command string
  399.  
  400.      Routine║   GETCL2
  401.      Function║ Return next command info from command line buffer
  402.      Entry:    None
  403.      Exit:     H╠ ╜ addres≤ oµ nex⌠ commanΣ (░ iµ n∩ commanΣ linσ ì
  404. ááááááááááááááábuffer)
  405.                ┴ ╜ firs⌠ characte≥ oµ command¼ zer∩ clea≥ (NZ⌐ iµ ì
  406. ááááááááááááááávalid
  407.                A = 0, zero flag set (Z) if no characters in line
  408.                Affected: AF¼ HL
  409.      Usage:    UseΣ áiε application≤ wherσ yo⌡ neeΣ át∩ ádirectl∙ ì
  410. áááááááááááááááacces≤ ácharacter≤ iε thσ nex⌠ commanΣ ástoreΣ áiε ì
  411. áááááááááááááááthσ commanΣ linσ buffer.
  412.  
  413.      Routine║   PUTCL
  414.      Function: Storσ ácommanΣ linσ a⌠ beginninτ oµ ácommanΣ álinσ ì
  415. ááááááááááááááábuffer
  416.      Entry:    HL = address of NUL-terminated command line
  417.      Exit:     A <> 0, zero flag clear (NZ) if OK
  418.                A = 0 zero set (Z) if overflow (no buffer change)
  419.      Affected: AF
  420.      Usage:    Add≤ ß commanΣ linσ a≤ ß prefi° iε thσ ZCPR│ ácomì
  421. ááááááááááááááámanΣ linσ buffe≥ a≤ opposeΣ t∩ APPC╠ whicΦ append≤ ì
  422. ááááááááááááááát∩ áthσ áenΣ oµ thσ commanΣ linσ ábuffer« á Buffe≥ ì
  423. ááááááááááááááácontent≤ áarσ árepackeΣ ás∩ tha⌠ áaε áoverflo≈ ái≤ ì
  424. áááááááááááááááaverteΣ áiε ámos⌠ ácases«  Iµ áß ácommanΣ áalread∙ ì
  425. áááááááááááááááexist≤ áiε thσ buffer¼ thσ ne≈ linσ ái≤ ápostfixeΣ ì
  426. áááááááááááááááwitΦ ß semicoloε s∩ continuatioε i≤ enabled.
  427.  
  428. CR╘ AN─ PRT DATA:
  429.  
  430.      Routine║   GETCRT
  431.      Function║ Return address of CRT data record from ENV
  432.      Entry:    None
  433.      Exit:     HL = address of CRT record
  434.      Affected: HL
  435.      Usage:    Determine≤ thσ parameter≤ oµ thσ installeΣ átermiì
  436. ááááááááááááááánal«  Thσ CR╘ recorΣ i≤ structureΣ as:
  437.                     CRTDAT║   DEF┬      8░        ; width of CRT in characters
  438.                               DEFB      24        ; number of lines on the screen
  439.                               DEFB      22        ; number of text lines on screen
  440. è
  441.                Thσ ánumbe≥ oµ tex⌠ line≤ shoulΣ bσ tw∩ les≤ áthaε ì
  442. áááááááááááááááthσ átota∞ numbe≥ oµ lines«  Yo⌡ ma∙ providσ ámorσ ì
  443. áááááááááááááááoverla≡ áb∙ ámakinτ i⌠ │ o≥ ┤ less« á Thi≤ árecorΣ ì
  444. áááááááááááááááelemen⌠ átell≤ utilitie≤ likσ PAG┼ ho≈ man∙ áline≤ ì
  445. ááááááááááááááát∩ outpu⌠ beforσ pausinτ t∩ allo≈ yo⌡ t∩ reaΣ áthσ ì
  446. áááááááááááááááscreen« á Thi≤ ácaε ábσ reduceΣ (g∩ t∩ á2░ áo≥ á1╕ ì
  447. ááááááááááááááálines⌐ át∩ áallo≈ áyo⌡ t∩ seσ ámorσ áoµ áthσ álas⌠ ì
  448. áááááááááááááááscreen.
  449.  
  450.      Routine║   GETPRT
  451.      Function║ Return the address of the printer data record
  452.      Entry:    None
  453.      Exit:     HL = address of printer data record
  454.      Affected: HL
  455.      Usage:    Provide≤ datß oε somσ oµ thσ printe≥ ácharacterisì
  456. ááááááááááááááátic≤ áfo≥ áusσ iε formattinτ ároutines¼ áo≥ áothe≥ ì
  457. áááááááááááááááuses« á Thσ returneΣ pointe≥ i≤ t∩ ß printe≥ ádatß ì
  458. ááááááááááááááárecorΣ as:
  459.                     PRTDAT║   DEF┬      8░        ; width of printer in characters
  460.                               DEFB      66        ; number of lines on printer page
  461.                               DEFB      58        ; number of text lines per page
  462.                               DEFB      1         ; formfeed flag (0=can't FF, 1=can)
  463.  
  464.                Program≤ ásucΦ áa≤ PRIN╘ ma∙ áusσ áthσ ádifferencσ ì
  465. ááááááááááááááábetweeε thσ thirΣ anΣ seconΣ entrie≤ t∩ ádeterminσ ì
  466. áááááááááááááááto≡ anΣ bottoφ margins¼ anΣ tes⌠ thσ las⌠ bytσ át∩ ì
  467. ááááááááááááááádeterminσ áwhethe≥ át∩ issuσ ß formfeeΣ áo≥ ácoun⌠ ì
  468. ááááááááááááááálinσ feeΣ character≤ t∩ advancσ t∩ thσ nex⌠ page.
  469.  
  470.      Routine║   PUTCRT
  471.      Function║ Stores terminal select byte (no real function)
  472.      Entry:    A = selection value (0)
  473.      Exit:     A <> 0, zero flag clear (NZ) if entry was 0
  474.                A = 0, zero flag set (Z) if invalid (not 0)
  475.      Affected: AF
  476.      Usage:    Perform≤ n∩ actua∞ functioε iε thσ extendeΣ áenviì
  477. áááááááááááááááronmen⌠ áwhicΦ support≤ onl∙ onσ defineΣ CR╘ ádatß ì
  478. áááááááááááááááblock« á Fo≥ compatibility¼ i⌠ sense≤ áthσ áselec⌠ ì
  479. ááááááááááááááávaluσ anΣ simpl∙ return≤ statu≤ baseΣ oε it.
  480.  
  481.      Routine║   PUTPRT
  482.      Function║ Store printer selection byte (0..1) in environment
  483.      Entry:    A = printer selection value (0 or 1)
  484.      Exit:     A <> 0, zero flag clear (NZ) if OK
  485.                A = 0, zero flag set (Z) if invalid (not 0 or 1)
  486.      Affected: AF
  487.      Usage:    Store≤ thσ selectioε (░ o≥ 1⌐ iε thσ PR╘ selectioε ì
  488. ááááááááááááááábuffe≥ oµ thσ ZCPR│ Environmen⌠ Descripto≥ showinτ ì
  489. ááááááááááááááátha⌠ ái⌠ i≤ thσ currentl∙ activσ áprinter« á Unde≥ ì
  490. áááááááááááááááthσ extendeΣ environment¼ onl∙ tw∩ printer≤ ma∙ bσ ì
  491. ááááááááááááááádefineΣ insteaΣ oµ thσ fou≥ originall∙ supported.
  492. .pa
  493. èEXTERNA╠ FIL┼ CONTRO╠ BLOCK:
  494.  
  495.      Routine║   GETEFCB
  496.      Function: Returε áthσ áaddres≤ oµ thσ áZCPR│ áexterna∞ áfilσ ì
  497. ááááááááááááááácontro∞ blocδ (FCB)
  498.      Entry:    None
  499.      Exit:     HL = address of external FCB
  500.                A <> 0, zero flag clear (NZ) if OK
  501.                A = 0, zero flag set (Z) if not found
  502.      Affected: AF¼ HL
  503.      Usage:    Unde≥ áZCPR3¼ ß prograφ caε finΣ ou⌠ b∙ wha⌠ ánamσ ì
  504. ááááááááááááááái⌠ wa≤ invokeΣ througΦ thσ externa∞ FCB«  Byte≤ ▒-ì
  505. ááááááááááááááá╕ áoµ thσ externa∞ FC┬ (firs⌠ bytσ i≤ á0⌐ ácontaiε ì
  506. áááááááááááááááthσ namσ oµ thσ prograφ jus⌠ executeΣ b∙ ZCPR3.
  507.  
  508.                Thi≤ áfeaturσ ái≤ particularl∙ usefu∞ áfo≥ áshell≤ ì
  509. áááááááááááááááwhicΦ áhavσ át∩ pusΦ thei≥ ánamσ áanΣ áoperationa∞ ì
  510. áááááááááááááááparameter≤ áont∩ áthσ shel∞ stacδ iε orde≥ át∩ ábσ ì
  511. áááááááááááááááreinvokeΣ wheε ß commanΣ linσ completes«  ┴ áshel∞ ì
  512. ááááááááááááááácaε usσ thσ datß iε thσ externa∞ FC┬ t∩ ádeterminσ ì
  513. áááááááááááááááwha⌠ it≤ namσ i≤ withou⌠ havinτ t∩ assumσ tha⌠ ái⌠ ì
  514. áááááááááááááááha≤ ß particula≥ namσ a⌠ al∞ times.
  515.  
  516. ENVIRONMENT:
  517.  
  518.      Routine║   GETENV
  519.      Function║ Return address of the ZCPR3 Environment Descriptor
  520.      Entry:    None
  521.      Exit:     HL = address of Environment Descriptor
  522.      Affected: HL
  523.      Usage:    Fo≥ thosσ program≤ whicΦ neeΣ t∩ modif∙ thσ áZCPR│ ì
  524. áááááááááááááááEnvironmen⌠ áDescriptor«  Mos⌠ oµ thσ routine≤ áiε ì
  525. áááááááááááááááZ3LI┬ áwhicΦ acces≤ thσ Environmen⌠ Descripto≥ ád∩ ì
  526. ááááááááááááááás∩ iε ß R/╧ modσ (the∙ d∩ no⌠ allo≈ thσ prograφ t∩ ì
  527. áááááááááááááááchangσ datß iε it)«  Somσ program≤ ma∙ neeΣ t∩ ád∩ ì
  528. áááááááááááááááthis¼ s∩ GENEN╓ i≤ provided«  Z3LDR¼ fo≥ áexample¼ ì
  529. áááááááááááááááload≤ ß ne≈ Environmen⌠ Descripto≥ froφ ß filσ áoε ì
  530. ááááááááááááááádisk¼ anΣ i⌠ use≤ GETEN╓ t∩ finΣ ou⌠ wherσ t∩ loaΣ ì
  531. áááááááááááááááthσ file.
  532.  
  533.      Routine║   GETVID
  534.      Function║ Return address of the ZCPR3 TCAP (Z3TCAP)
  535.      Entry:    None
  536.      Exit:     HL = address of Z3TCAP buffer
  537.                A <> 0, zero flag clear (NZ) if OK
  538.                A = 0, zero flag set (Z) if no entry in buffer
  539.      Affected: AF¼ HL
  540.      Usage:    Fo≥ thosσ program≤ whicΦ neeΣ t∩ modif∙ thσ áZCPR│ ì
  541. áááááááááááááááTCA╨ ábuffe≥ anΣ thosσ program≤ whicΦ neeΣ t∩ ádeì
  542. áááááááááááááááterminσ áiµ thσ TCA╨ i≤ loaded«  I⌠ ma∙ bσ ádesirì
  543. áááááááááááááááablσ t∩ cal∞ thi≤ routinσ beforσ ß screeε-orienteΣ ì
  544. áááááááááááááááutilit∙ ái≤ áexecuteΣ át∩ insurσ tha⌠ áß áTCA╨ ái≤ ì
  545. áááááááááááááááavailable.
  546. .pa
  547. èFLO╫ COMMAND PACKAG┼ (FCP⌐ ADDRESS:
  548.  
  549.      Routine║   GETFCP
  550.      Function║ Return address of the flow commanΣ package buffer
  551.      Entry:    None
  552.      Exit:     HL = address of FCB buffer
  553.                ┴ ╜ numbe≥ oµ 12╕-bytσ FC╨ blocks¼ zer∩ clea≥ (NZ⌐ ì
  554. áááááááááááááááiµ OK
  555.                A = 0, zero flag set (Z) if no buffer
  556.      Affected: AF¼ HL
  557.      Usage:    Return≤ áthσ FC┬ parameter≤ froφ áthσ áEnvironmen⌠ ì
  558. áááááááááááááááDescriptor«  Thσ startinτ addres≤ anΣ sizσ oµ áthσ ì
  559. áááááááááááááááFC╨ ábuffe≥ áiε term≤ oµ 12╕-bytσ block≤ áarσ áreì
  560. áááááááááááááááturned«  T∩ finΣ ou⌠ iµ aε FC╨ i≤ installed¼ álooδ ì
  561. áááááááááááááááa⌠ áthσ áfirs⌠ bytσ oµ thσ FC╨ buffer«  Iµ ái⌠ ái≤ ì
  562. ááááááááááááááázero¼ theε n∩ FC╨ i≤ present.
  563.      Example:
  564.                          EXT       GETFCP         ; declare the routine
  565.                          ...                      ; ..preliminary code
  566.                          CALL      GETFCP         ; get addr/size from ENV
  567.                          JR        Z,NOFCP        ; ..jump if no FCB buffer avail
  568.                          LD        A,(HL)         ; examine the first buffer byte
  569.                          OR        A              ; anything installed?
  570.                          JR        Z,LODFCP       ; ..jump to load an FCP if not
  571.                          ...                      ; else use existing one
  572.  
  573. FILENAMES:
  574.  
  575.      Routine║   GETFN1 ¼  GETFN2
  576.      Function: GETFN▒ áget≤ addres≤ oµ shel∞ ávariablσ áfilename¼ ì
  577. áááááááááááááááGETFN▓ get≤ addres≤ oµ firs⌠ oµ systeφ filenames
  578.      Entry:    None
  579.      Exit:     H╠ ╜ addres≤ oµ 1▒-characte≥ filσnamσ entry
  580.      Affected: HL
  581.      Usage:    Return≤ áthσ addres≤ iε H╠ oµ thσ áshel∞ ávariablσ ì
  582. áááááááááááááááfilenamσ (GETFN1⌐ anΣ thσ firs⌠ oµ thσ fou≥ systeφ ì
  583. áááááááááááááááfilename≤ á(GETFN2⌐ iε thσ ZCPR│ áEnvironmen⌠ áDeì
  584. áááááááááááááááscriptor« á Thσ filenamσ entr∙ i≤ 1▒ ábyte≤ álong¼ ì
  585. ááááááááááááááámatchinτ áthσ filenamσ anΣ filetypσ field≤ oµ áthσ ì
  586. áááááááááááááááCP/═ filσ contro∞ block.
  587.  
  588.                Thesσ filename≤ arσ useΣ t∩ pas≤ name≤ oµ áspecia∞ ì
  589. áááááááááááááááfile≤ t∩ program≤ fo≥ late≥ use«  Thei≥ exac⌠ áusσ ì
  590. ááááááááááááááái≤ áno⌠ defineΣ anΣ i≤ lef⌠ t∩ you«  Onσ áapplicaì
  591. ááááááááááááááátioε áwoulΣ bσ t∩ allo≈ GETFN▒ t∩ returε thσ ánamσ ì
  592. áááááááááááááááoµ thσ maste≥ HL╨ filσ (HELP.HLP⌐ t∩ bσ useΣ a≤ aε ì
  593. áááááááááááááááinde° int∩ thσ hel≡ system.
  594. .pa
  595. è     Routine║   GETFNX
  596.      Function║ Return address of nth filename of system filenames
  597.      Entry:    A = filename number (1..4) in ENV filename buffer
  598.      Exit:     H╠ á╜ addres≤ oµ firs⌠ bytσ oµ indicateΣ filσ á(1▒ ì
  599. ááááááááááááááácharacters)
  600.                A <> 0, zero flag clear (NZ) if OK
  601.                ┴ á╜ á0¼ zer∩ flaτ se⌠ (Z⌐ iµ inpu⌠ valuσ áno⌠ áiε ì
  602. ááááááááááááááá1..┤ range
  603.      Affected: AF¼ HL
  604.      Usage:    Return≤ áthσ áaddres≤ oµ thσ ntΦ filenamσ áiε áthσ ì
  605. áááááááááááááááZCPR│ áEnvironmen⌠ áDescriptor« á Therσ áarσ áfou≥ ì
  606. ááááááááááááááásysteφ files¼ numbereΣ ▒ t∩ 4¼ anΣ the∙ arσ struπì
  607. ááááááááááááááátureΣ álikσ áthσ Fn.F⌠ field≤ oµ áß áfilσ ácontro∞ ì
  608. áááááááááááááááblocδ á(1▒ ábyte≤ each)«  Oε input¼ ┴ á╜ á1..┤ át∩ ì
  609. áááááááááááááááindicatσ áthσ filename«  Oε output¼ H╠ ápoint≤ át∩ ì
  610. áááááááááááááááthσ áfirs⌠ bytσ oµ thσ name«  ┴ validit∙ checδ ái≤ ì
  611. ááááááááááááááádonσ oε thσ valuσ oµ ┴ whicΦ mus⌠ bσ 1..4.
  612.  
  613.      Routine║   PUTFNX
  614.      Function: Se⌠ ntΦ (1..4⌐ filenamσ iε Environmen⌠ Descriptor
  615.      Entry:    A = filename number (1..4)
  616.                HL = address of FCB+1 of new filename value
  617.      Exit:     A <> 0, zero flag clear (NZ) if OK
  618.                ┴ á╜ á0¼ zer∩ flaτ se⌠ (Z⌐ iµ inpu⌠ valuσ áno⌠ áiε ì
  619. ááááááááááááááá1..┤ range
  620.      Affected: AF
  621.      Usage:    Set≤ thσ ntΦ (1..4⌐ filenamσ iε thσ ZCPR│ Environì
  622. ááááááááááááááámen⌠ Descripto≥ t∩ thσ FC┬-entr∙ pointeΣ t∩ b∙ áH╠ ì
  623. ááááááááááááááá(FCB+1¼ o≥ thσ Fε field¼ i≤ pointeΣ t∩ b∙ HL)« á ┴ ì
  624. ááááááááááááááái≤ useΣ t∩ identif∙ thσ filename.
  625.  
  626. INITIALIZE:
  627.  
  628.      Routine║   WHRENV
  629.      Function: Returε áinstalleΣ áZCPR│ áEnvironmen⌠ ááDescripto≥ ì
  630. áááááááááááááááaddress
  631.      Entry:    HL = candidate address of Environment Descriptor
  632.      Exit:     HL = points to start address of ENV (0 if not found)
  633.                A <> 0, zero flag clear (NZ) if ENV validated
  634.                A = 0, zero flag set (Z) if not found
  635.      Affected: AF¼ BC¼ DE¼ HL
  636.      Usage:    Provide≤ áß mean≤ oµ locatinτ ß ZCPR│ áEnvironmen⌠ ì
  637. áááááááááááááááDescripto≥ áwithou⌠ thσ assistancσ oµ ZCP╥ 3.│ áo≥ ì
  638. ááááááááááááááálate≥ ácommanΣ processors«  Callinτ WHREN╓ witΦ áß ì
  639. ááááááááááááááácandidatσ addres≤ oµ thσ DO╙ entr∙ addres≤ áloadeΣ ì
  640. áááááááááááááááfroφ location≤ ╢ anΣ ╖ wil∞ causσ ß searcΦ fo≥ áaε ì
  641. áááááááááááááááenvironmen⌠ áfroφ tha⌠ addres≤ u≡ áthrougΦ áFEFFh«  ì
  642. áááááááááááááááCallinτ ái⌠ áwitΦ áß paramete≥ oµ á░ ápreclude≤ áß ì
  643. ááááááááááááááásearcΦ át∩ signif∙ tha⌠ thσ aut∩-searcΦ i≤ át∩ ábσ ì
  644. ááááááááááááááádisabled.
  645.      Example:
  646.                          EX╘       WHRENV,Z3INI╘  ; declare routines
  647.                          ...                      ; ..any header info here
  648.                          LD        HL,(6)         ; load candidate location
  649.                          CALL      WHRENV         ; ..and test it
  650. è                         LD        (Z3EADR),HL    ; save any returned value
  651.                          JR        Z,NOENV        ; ..jump if no ENV validated
  652.                          CALL      Z3INIT         ; else set globals (or Z3VINIT)
  653.  
  654.      Routine║   Z3INIT
  655.      Function: Se⌠ ágloba∞ buffe≥ t∩ arbitrar∙ addres≤ fo≥ áZCPR│ ì
  656. áááááááááááááááenvironment
  657.      Entry:    HL = address of ZCPR3 environment descriptor
  658.      Exit:     None
  659.      Affected: None
  660.      Usage:    Set≤ ß globa∞ variablσ t∩ thσ ZCPR│ pointe≥ ávaluσ ì
  661. áááááááááááááááinstalleΣ áiε áthσ prograφ áheader« á Thi≤ ágloba∞ ì
  662. ááááááááááááááávariablσ i≤ useΣ b∙ othe≥ Z3LI┬ routines.
  663.      Example:
  664.                          EXT       Z3INIT         ; declare the routine
  665.                          ...                      ; ..header code
  666.                          LD        HL,Z3ENV       ; load the Env Desc address
  667.                          CALL      Z3INIT         ; ..and install!
  668.                          ...                      ; carry on!
  669.  
  670. SYSTE═ DATA:
  671.  
  672.      Routine║   ZSYSCHK
  673.      Function║ Validate ZCPR3 Environment Descriptor address
  674.      Entry:    HL = points to candidate Z3 environment
  675.      Exit:     A = 0, zero set (Z) if valid environment
  676.                A <> 0, zero clear (NZ) if environment not valid
  677.      Affected: AF
  678.      Usage:    Check≤ ávariou≤ parameter≤ iε aε áEnvironmen⌠ áDeì
  679. áááááááááááááááscripto≥ ápredicateΣ oε thσ specifieΣ áaddres≤ át∩ ì
  680. áááááááááááááááseσ áiµ i⌠ i≤ valid«  I⌠ wil∞ prin⌠ ß ámessagσ áiµ ì
  681. áááááááááááááááthσ áenvironmen⌠ i≤ invalid«  Fo≥ bes⌠ result≤ áoε ì
  682. áááááááááááááááZCP╥ á3.│ áo≥ later¼ pas≤ thσ valuσ iε H╠ áa⌠ áthσ ì
  683. ááááááááááááááátimσ áthσ prograφ starts«  Thi≤ wil∞ no⌠ áworδ áoε ì
  684. áááááááááááááááZCP╥ á3.0¼ ábu⌠ wil∞ detec⌠ áBackGrounde≥ áiΘ áanΣ ì
  685. áááááááááááááááversion≤ sincσ ZCP╥ 3.3.
  686.      Example:
  687.                     EXT       ZSYSCHK             ; declare the routine
  688.                     ...
  689.                     LD        HL,(ENVADR)         ; load candidate environment
  690.                     CALL      ZSYSCHK             ; is it valid? (message if not)
  691.                     RET       NZ                  ; ..quit if invalid
  692.                     ...                           ; else continue with valid ENV
  693.  
  694.      Routine║   Z33CHK
  695.      Function║ Check for presence of ZCPR 3.3 or later
  696.      Entry:    None
  697.      Exit:     A = 0, zero set (Z) if CCP is ZCPR 3.3 or later
  698.                A <> 0, zero clear (NZ) if not ZCPR >= 3.3
  699.      Affected: AF
  700.      Usage:    ShoulΣ ábσ useΣ iε thσ initia∞ setu≡ portioε oµ áß ì
  701. áááááááááááááááprograφ áiµ man∙ oµ thσ ne≈ Z3LI┬ routine≤ arσ át∩ ì
  702. ááááááááááááááábσ used«  Routine≤ sucΦ a≤ Z33FNAM┼ rel∙ oε speciì
  703. áááááááááááááááfiπ áentr∙ point≤ iε thσ commanΣ áprocesso≥ áwhicΦ ì
  704. áááááááááááááááonl∙ áexis⌠ iε ZCP╥ 3.│ o≥ later«  Iµ ásucΦ ácall≤ ìèáááááááááááááááarσ madσ unde≥ othe≥ commanΣ processors¼ o≥ iµ thσ ì
  705. áááááááááááááááC╨ i≤ overwritten¼ you≥ prograφ wil∞ bσ unablσ át∩ ì
  706. áááááááááááááááfunction.
  707.      Example:
  708.                          EXT       Z33CHK         ; declare the routine
  709.                          ...
  710.                          CALL      Z33CHK         ; Is CP ZCPR 3.3 or later?
  711.                          JR        NZ,NOTZ3       ; ..jump if not
  712.                          ...                      ; else we can use it
  713.  
  714.      Routine║   GETBDOS
  715.      Function║ Return BDO╙ start address
  716.      Entry:    None
  717.      Exit:     HL = calculated or loaded BDOS starting address
  718.      Affected: HL
  719.      Usage:    Return≤ áthσ ástartinτ addres≤ oµ thσ áBasiπ áDisδ ì
  720. áááááááááááááááOperatinτ Systeφ (BDOS⌐ froφ aε extendeΣ áenvironì
  721. ááááááááááááááámen⌠ iµ present¼ elsσ i⌠ wil∞ calculatσ thσ startì
  722. áááááááááááááááinτ addres≤ froφ thσ BIO╙ warφ boo⌠ vecto≥ áassumì
  723. áááááááááááááááinτ áß á3.5╦ BDO╙ size«  Yo⌡ shoulΣ no⌠ áusσ áthi≤ ì
  724. áááááááááááááááaddres≤ áa≤ thσ to≡ oµ availablσ memory¼ bu⌠ áonl∙ ì
  725. ááááááááááááááát∩ locatσ thσ DOS«  Usσ thσ addres≤ a⌠ location≤ ╢ ì
  726. áááááááááááááááanΣ ╖ o≥ GZMTO╨ t∩ finΣ thσ highes⌠ usablσ ámemor∙ ì
  727. ááááááááááááááálocatioε dependinτ oε whethe≥ o≥ no⌠ thσ CC╨ i≤ t∩ ì
  728. ááááááááááááááábσ retained.
  729.  
  730.      Routine║   GETCCP
  731.      Function║ Return command processor starting address
  732.      Entry:    None
  733.      Exit:     HL = calculated or loaded CCP starting address
  734.      Affected: HL
  735.      Usage:    Return≤ áthσ startinτ addres≤ oµ thσ commanΣ áproì
  736. ááááááááááááááácesso≥ áfo≥ usσ iε calculatinτ addresse≤ oµ áentr∙ ì
  737. ááááááááááááááápoints¼ anΣ iε locatinτ ZCPR│ configuratioε bytes«  ì
  738. áááááááááááááááThi≤ ároutinσ áfirs⌠ attempt≤ t∩ álocatσ áthσ áCC╨ ì
  739. áááááááááááááááaddres≤ áfroφ aε extendeΣ environmen⌠ iµ ápresent¼ ì
  740. áááááááááááááááotherwisσ ái⌠ wil∞ calculatσ thσ startinτ áaddres≤ ì
  741. áááááááááááááááfroφ áthσ áBIO╙ warφ boo⌠ vecto≥ assuminτ áß á3.5╦ ì
  742. áááááááááááááááBDO╙ anΣ ß 2╦ CCP.
  743.  
  744.      Routine║   GETECP
  745.      Function║ Return address of extended command processor name
  746.      Entry:    None
  747.      Exit:     HL = address of ECP name
  748.      Affected: HL
  749.      Usage:    Locate≤ thσ namσ oµ thσ ZCP╥ versioε 3.│ o≥ álate≥ ì
  750. áááááááááááááááextendeΣ commanΣ processor«  Require≤ ZCP╥ 3.│ áo≥ ì
  751. ááááááááááááááálate≥ anΣ thσ commanΣ processo≥ mus⌠ no⌠ havσ beeε ì
  752. áááááááááááááááoverwritten.
  753. .pa
  754. èINPUT/OUTPU╘ áPACKAG┼ (IOP⌐ CONCEPTS:é  Thi≤ se⌠ oµ routine≤ áproì
  755. vidσ áacces≤ t∩ thσ systeφ Input/Outpu⌠ Packagσ (IOP)« á Thσ ádeì
  756. vice≤ iε aε IO╨ arσ identifieΣ b∙ ß logica∞ I─ (referrinτ t∩ áthσ ì
  757. generiπ CON¼ RDR¼ PUN¼ anΣ LS╘ devices⌐ anΣ ß physica∞ I─ (referì
  758. rinτ át∩ thσ specifiπ devicσ unde≥ thσ generic)«  B∙ áconvention¼ ì
  759. routine≤ áiε thi≤ collectioε alway≤ pas≤ thσ logica∞ I─ iε thσ á┬ ì
  760. registe≥ áanΣ thσ physica∞ I─ iε thσ ├ register« á Thσ áfollowinτ ì
  761. tablσ show≤ thσ assignments:
  762.  
  763.       logical ID
  764.        (B reg)       device
  765.           0           CON:
  766.           1           RDR:
  767.           2           PUN:
  768.           3           LST:
  769.  
  770. Thσ IO╨ statu≤ table¼ containeΣ iε ever∙ IOP¼ return≤ informatioε ì
  771. oε áthσ physica∞ ID's«  I⌠ tell≤ ho≈ man∙ physica∞ device≤ á(PID⌐ ì
  772. arσ availablσ fo≥ eacΦ logica∞ ID¼ anΣ thσ curren⌠ assignmen⌠ á(░ ì
  773. t∩ PI─-1)«  Thi≤ tablσ i≤ structureΣ as:
  774.  
  775.          offset               number of current
  776.          bytes     device    devices  assignment
  777.           0-▒       CON║      Byte ░    Byte 1
  778.           2-3       RDR:      Byte 2    Byte 3
  779.           4-5       PUN:      Byte 4    Byte 5
  780.           6-7       LST:      Byte 6    Byte 7
  781.  
  782. Fo≥ áexample¼ iµ bytσ ░ (numbe≥ oµ physica∞ consoles⌐ i≤ 5¼ átheε ì
  783. bytσ á▒ (curren⌠ physica∞ consolσ assignment⌐ caε onl∙ bσ iε áthσ ì
  784. rangσ froφ ░ t∩ 4«  GETIO╙ return≤ thσ addres≤ oµ thi≤ table.
  785.  
  786. The routines in the IOP collection are:
  787.  
  788.      GETIONÅ¡-returε áß ástrinτ givinτ thσ namσ áoµ áthσ ádevicσ ì
  789. ááááááááááidentifieΣ b∙ ß logica∞ I─ anΣ ß physica∞ ID.
  790.      GETIOP -- return the address and size of the IOP.
  791.      GETIOS -- return a pointer to the IOP status table.
  792.      IOMATCHÅ¡-searche≤ áfo≥ ß physica∞ devicσ ánamσ áassociateΣ ì
  793. ááááááááááwitΦ ß particula≥ logica∞ ID.
  794.      PUTIOD -¡ select and IOP device by logical and physical ID.
  795.  
  796.      Routine║   GETION
  797.      Function║ Return address of name for specified device
  798.      Entry:    B = logical device ID (0..3)
  799.                C = physical ID
  800.      Exit:     HL = address of string naming the indicated device
  801.                A <> 0, zero flag clear (NZ) if no error
  802.                A = 0, zero flag set (Z) if no IOP or range error
  803.      Affected: AF¼ HL
  804.      Usage:    Return≤ áß ápointe≥ t∩ thσ strinτ ádescribinτ áthσ ì
  805. ááááááááááááááádevicσ áwhosσ álogica∞ I─ (░ t∩ á3¼ áwherσ áCON=0¼ ì
  806. áááááááááááááááRDR=1¼ áPUN=2¼ anΣ LST=3⌐ i≤ iε ┬ anΣ physica∞ áI─ ì
  807. ááááááááááááááái≤ iε C.
  808.  
  809. è     Routine║   GETIOP
  810.      Function║ Return address and size of IOP buffer definition
  811.      Entry:    None
  812.      Exit:     HL = address of IOP buffer
  813.                ┴ á╜ ánumbe≥ oµ 12╕-bytσ block≤ áiε ábuffer¼ ázer∩ ì
  814. áááááááááááááááclea≥ (NZ)
  815.                A = 0, zero flag set (Z) if no buffer
  816.      Affected: AF¼ HL
  817.      Usage:    Return≤ detail≤ oε thσ IO╨ buffe≥ addres≤ anΣ sizσ ì
  818. áááááááááááááááfroφ áthσ Environmen⌠ Descriptor¼ bu⌠ i⌠ doe≤ áno⌠ ì
  819. ááááááááááááááása∙ áiµ áaε IO╨ i≤ resident«  T∩ áfinΣ áthi≤ áout¼ ì
  820. áááááááááááááááexaminσ áthσ áfirs⌠ bytσ oµ thσ áIO╨ ábuffer« á Iµ ì
  821. ááááááááááááááázero¼ theε n∩ IO╨ i≤ exists.
  822.      Example:
  823.                          EX╘       GETIOP         ; declare the routine
  824.                          ...                      ; ..preceeding code
  825.                          CALL      GETIOP         ; get IOP buff data from ENV
  826.                          J╥        Z,NOIO╨        ╗ ..jum≡ iµ n∩ IO╨ buffer
  827.                          LD        A,(HL)         ; else get first byte
  828.                          OR        A              ; is anything installed?
  829.                          JR        Z,LODIOP       ; ..jump to load if not there
  830.                          ...                      ; else continue, IOP present
  831.  
  832.      Routine║   GETIOS
  833.      Function║ Return pointer to I/O package status table
  834.      Entry:    None
  835.      Exit:     HL = address of IOP status table
  836.                A <> 0, zero flag clear (NZ) if OK
  837.                A = 0 zero set (Z) if no IOP loaded
  838.      Affected: AF¼ HL
  839.      Usage:    Return≤ ß pointe≥ t∩ thσ I/╧ packagσ statu≤ átablσ ì
  840. áááááááááááááááiε HL«  Thσ tablσ i≤ structureΣ as:
  841.                    offset               number of current
  842.                    bytes     device    devices  assignment
  843.                     0-1       CON║      Byte ░    Byte 1
  844.                     2-3       RDR:      Byte 2    Byte 3
  845.                     4-5       PUN:      Byte 4    Byte 5
  846.                     6-7       LST:      Byte 6    Byte 7
  847.  
  848.      Routine║   IOMATCH
  849.      Function║ Search for physical device name for logical ID
  850.      Entry:    HL = address of device name string
  851.                B = logical ID (CON=0, RDR=1, PUN=2, LST=3)
  852.      Exit:     C = physical ID
  853.                A <> 0, zero flag clear (NZ) if OK
  854.                A = 0, zero flag clear if not found or no IOP
  855.      Affected: AF¼ C
  856.      Usage:    Searche≤ fo≥ thσ namσ oµ ß physica∞ devicσ associì
  857. áááááááááááááááateΣ witΦ ß particula≥ logica∞ ID«  Thi≤ namσ i≤ ß ì
  858. áááááááááááááááNU╠-terminateΣ ástrinτ o≥ an∙ characte≥ les≤ áthaε ì
  859. áááááááááááááááo≥ áequa∞ át∩ ß space«  Thσ ánamσ ái≤ ácapitalizeΣ ì
  860. áááááááááááááááinternally« á Iµ found¼ ├ return≤ thσ physica∞ áI─ ì
  861. áááááááááááááááoµ thσ device.
  862. .pa
  863. è     Example:
  864.                          EXT       IOMATCH        ; declare the routine
  865.                          ...                      ; ..preceeding code
  866.                          LD        HL,MYCON       ; point to name string
  867.                          LD        B,0            ; select CON device
  868.                          CALL      IOMATCH        ; search for the device
  869.                          JR        Z,ERROR        ; ..jump error if bad
  870.                          ...                      ; else C=physical ID of MYCON
  871.                MYCON:    DEFB      'CRT1',0       ; name of desired CON device
  872.  
  873.      Routine║   PUTIOD
  874.      Function║ Select the IOP device from specified logical ID
  875.      Entry:    B = logical ID (CON=0, RDR=1, PUN=2, LST=3)
  876.                C = physical ID
  877.      Exit:     A <> 0, zero flag clear (NZ) if OK
  878.                ┴ ╜ 0¼ zer∩ flaτ se⌠ (Z⌐ iµ n∩ IO╨ o≥ rangσ áerro≥ ì
  879. ááááááááááááááá(physica∞ o≥ logica∞ I─ numbe≥ invalid)
  880.      Affected: AF
  881.      Usage:    Select≤ áaε IO╨ devicσ froφ ß se⌠ oµ álogica∞ áanΣ ì
  882. áááááááááááááááphysica∞ áID's« á Logica∞ I─ number≤ áarσ áiε áthσ ì
  883. ááááááááááááááárangσ oµ ░ t∩ 3¼ wherσ CO╬ ╜ 0¼ RD╥ ╜ 1¼ PU╬ ╜ á2¼ ì
  884. áááááááááááááááanΣ LS╘ ╜ 3«  Seσ thσ introductor∙ IO╨ sectioε fo≥ ì
  885. ááááááááááááááámorσ details.
  886.  
  887. INPUT/OUTPU╘ PACKAGE (IOP⌐ RECORDING:
  888.  
  889.      Routines║  IORCON ¼  IORCOFF ¼  IORLON ¼  IORLOFF
  890.      Function║ Turε oε anΣ ofµ I/╧ recordinτ iε curren⌠ IOP
  891.      Entry:    HL = address of ZCPR3 FCB for recorded information
  892.      Exit:     A <> 0, zero flag clear (NZ) if OK
  893.                ┴ á╜ 0¼ zer∩ flaτ se⌠ (Z⌐ iµ n∩ IO╨ áo≥ árecordinτ ì
  894. áááááááááááááááno⌠ supporteΣ iε IOP
  895.      Affected: AF
  896.      Usage:    IORCO╬ áturn≤ oε consolσ recording¼ IORCOF╞ áturn≤ ì
  897. áááááááááááááááofµ áconsolσ recording¼ IORLO╬ turn≤ oε ális⌠ áreì
  898. ááááááááááááááácording¼ áIORLOF╞ turn≤ ofµ lis⌠ árecording« á Thσ ì
  899. áááááááááááááááFC┬ ápasseΣ t∩ thesσ routine≤ i≤ ß standarΣ áZCPR│ ì
  900. áááááááááááááááFCB¼ áwherσ offse⌠ ░ contain≤ thσ disδ anΣ áoffse⌠ ì
  901. ááááááááááááááá1│ ácontain≤ thσ use≥ data«  ┴ particula≥ IO╨ áma∙ ì
  902. áááááááááááááááo≥ áma∙ áno⌠ pa∙ attentioε t∩ áthi≤ áFC┬ ápointer¼ ì
  903. ááááááááááááááádependinτ oε implementation.
  904.  
  905. DRIVE/USER:
  906.  
  907.      Routine║   GETDUOK
  908.      Function║ Return the value of the DUOK flag
  909.      Entry:    None
  910.      Exit:     A <> 0, zero flag clear (NZ) if DU use OK
  911.                A = 0, zero flag set (Z) if DU use not allowed
  912.      Affected: AF
  913.      Usage:    Return≤ áthσ DUO╦ flaτ valuσ whicΦ tell≤ thσ áproì
  914. ááááááááááááááágraφ iµ i⌠ i≤ permissiblσ t∩ specif∙ thσ D╒ prefi° ì
  915. ááááááááááááááát∩ changσ disδ anΣ use≥ area«  ZCPR│ utilitie≤ caε ì
  916. áááááááááááááááalway≤ áspecif∙ ß DI╥ prefi° (nameΣ directory⌐ áiε ì
  917. áááááááááááááááidentifyinτ thσ disδ anΣ use≥ areß t∩ examine¼ bu⌠ ìèáááááááááááááááiε somσ "secureó application≤ i⌠ i≤ no⌠ ádesirablσ ì
  918. ááááááááááááááát∩ áallo≈ thσ use≥ t∩ emplo∙ thσ D╒ prefi° t∩ áacì
  919. áááááááááááááááces≤ áan∙ ádisδ o≥ use≥ area« á Thi≤ áflaτ á(DUOK⌐ ì
  920. ááááááááááááááátell≤ áthσ áutilit∙ iµ i⌠ i≤ O╦ fo≥ áthσ áuse≥ át∩ ì
  921. áááááááááááááááemplo∙ thσ D╒ prefix.
  922.  
  923.      Routine║   GETMDISK
  924.      Function║ Return the maximum allowable disk
  925.      Entry:    None
  926.      Exit:     A = maximum disk number (1=A..16=P)
  927.      Affected: AF
  928.      Usage:    Obtain≤ áinformatioε áfroφ thσ áZCPR│ áEnvironmen⌠ ì
  929. áááááááááááááááDescripto≥ whicΦ ma∙ bσ useΣ t∩ restric⌠ acces≤ t∩ ì
  930. ááááááááááááááácertaiε ápart≤ áoµ thσ system« á Fo≥ áinstance¼ áß ì
  931. ááááááááááááááá"norma∞ useró ma∙ bσ denieΣ acces≤ t∩ disk≤ ├ áanΣ ì
  932. áááááááááááááááD« á ┴ á"privelegeΣ áuseró wh∩ ha≤ áthσ ápowe≥ át∩ ì
  933. áááááááááááááááchangσ áthσ ZCPR│ EnvΘronmen⌠ Descripto≥ caε ágaiε ì
  934. áááááááááááááááacces≤ t∩ an∙ desireΣ disδ.
  935.  
  936.      Routine║   GETMUSER
  937.      Function║ Return the maximum allowable user area
  938.      Entry:    None
  939.      Exit:     A = maximum allowable user area (0..31)
  940.      Affected: AF
  941.      Usage:    Provide≤ áinformatioε froφ thσ áZCPR│ áEnvironmen⌠ ì
  942. áááááááááááááááDescripto≥ whicΦ ma∙ bσ useΣ t∩ restric⌠ acces≤ t∩ ì
  943. ááááááááááááááácertaiε ápart≤ áoµ thσ system« á Fo≥ áinstance¼ áß ì
  944. ááááááááááááááá"norma∞ áuseró áma∙ bσ denieΣ acces≤ t∩ áan∙ áuse≥ ì
  945. áááááááááááááááareß ábeyonΣ 10«  ┴ "privelegeΣ useró wh∩ ha≤ áthσ ì
  946. ááááááááááááááápowe≥ át∩ changσ thσ ZCPR│ Environmen⌠ áDescripto≥ ì
  947. ááááááááááááááácaε gaiε acces≤ t∩ an∙ desireΣ use≥ area.
  948.  
  949.      Routine║   PUTDUOK
  950.      Function║ Set the DUOK byte to specified value
  951.      Entry:    A = DUOK value (0=DU not OK, 0FFh = DU is OK)
  952.      Exit:     None
  953.      Affected: None
  954.      Usage:    Set≤ áthσ áDUO╦ bytσ froφ A«  Iµ ┴ ╜ á0¼ áDUO╦ ái≤ ì
  955. áááááááááááááááfalsσ anΣ D╒ forφ oµ filσ specificatioε i≤ no⌠ OK«  ì
  956. áááááááááááááááIµ A<>░ (0FFΦ i≤ preferred)¼ DUO╦ i≤ truσ anΣ filσ ì
  957. áááááááááááááááspecificatioε usinτ thσ D╒ forφ i≤ permitted.
  958.  
  959.      Routine║   PUTMDISK
  960.      Function║ Set the maximum allowable disk in the environment
  961.      Entry:    A = maximum allowable disk numbe≥ (1=A..16=P)
  962.      Exit:     None
  963.      Affected: None
  964.      Usage:    Set≤ thσ maximuφ allowablσ disδ iε thσ Environmen⌠ ì
  965. áááááááááááááááDescriptor« á ValiΣ disδ number≤ rangσ froφ ▒ áfo≥ ì
  966. ááááááááááááááádrivσ ┴ t∩ 1╢ fo≥ drivσ P.
  967. .pa
  968. è     Routine║   PUTMUSER
  969.      Function║ Set the maximum allowable user number (0..31)
  970.      Entry:    A = maximum allowable user number (0..31)
  971.      Exit:     None
  972.      Affected: None
  973.      Usage:    Set≤ thσ maximuφ allowablσ use≥ areß iε thσ áEnviì
  974. áááááááááááááááronmen⌠ Descriptor«  ValiΣ use≥ number≤ rangσ froφ ì
  975. ááááááááááááááá░ througΦ 31.
  976.  
  977.      Routine║   HIGHUSER
  978.      Function: Returε flaτ showinτ suppor⌠ fo≥ user≤ highe≥ thaε 15
  979.      Entry:    None
  980.      Exit:     Zero clear (NZ) if users highe≥ than 15 supported
  981.                Zer∩ áse⌠ á(Z⌐ iµ n∩ ZCP╥ 3.│ o≥ n∩ áuser≤ áhighe≥ ì
  982. áááááááááááááááthaε 15
  983.                A = undefined
  984.      Affected: AF
  985.      Usage:    Return≤ áß áflaτ indicatinτ whethe≥ áuse≥ ánumber≤ ì
  986. ááááááááááááááágreate≥ thaε 1╡ arσ supported«  Thi≤ definitioε i≤ ì
  987. áááááááááááááááobtaineΣ áfroφ thσ ZCP╥ 3.│ o≥ late≥ commanΣ ápr∩ì
  988. ááááááááááááááácessor«  Require≤ ZCP╥ 3.│ o≥ highe≥ anΣ thσ ácomì
  989. ááááááááááááááámanΣ processo≥ mus⌠ no⌠ havσ beeε overwritten.
  990.  
  991.      Routine║   GCMDDU
  992.      Function║ Return drive and user number in external FCB
  993.      Entry:    None
  994.      Exit:     BC = DU; B=drive (0=A..15=P), C=user (0..31)
  995.      Affected: BC
  996.      Usage:    Return≤ thσ drivσ anΣ use≥ fo≥ thσ filσ áspecifieΣ ì
  997. áááááááááááááááiε áthσ externa∞ FCB«  I⌠ i≤ ofteε useΣ t∩ ádeterì
  998. áááááááááááááááminσ áwherσ áthσ filσ wa≤ actuall∙ áfounΣ á(shell¼ ì
  999. ááááááááááááááápath¼ áetc.⌐ áiε orde≥ t∩ loτ int∩ áo≥ ásavσ átha⌠ ì
  1000. ááááááááááááááálocation« á Externa∞ FC┬ mus⌠ havσ beeε parseΣ áb∙ ì
  1001. áááááááááááááááZCP╥ 3.│ o≥ later¼ whicΦ place≤ thσ use≥ numbe≥ iε ì
  1002. áááááááááááááááFCB+1│ anΣ thσ drivσ iε FCB+14.
  1003.  
  1004. MESSAGES:
  1005.  
  1006.      Routine║   GETMSG
  1007.      Function║ Return the address of the ZCPR3 message buffer
  1008.      Entry:    None
  1009.      Exit:     HL = address of the ZCPR3 message buffer
  1010.                A <> 0, zero flag clear (NZ) if valid
  1011.                A = 0, zero flag set (Z) if no buffer
  1012.      Affected: AF,HL
  1013.      Usage:    Iε áconjunctioε áwitΦ othe≥ messagσ ároutine≤ áfo≥ ì
  1014. ááááááááááááááásynchronizatioε ábetweeε programs¼ anΣ statu≤ áinì
  1015. áááááááááááááááformation« á Seσ áZ3LI┬ áinformatioε ásection≤ áoε ì
  1016. áááááááááááááááZCPR│ Messages.
  1017. .pa
  1018. è     Routine║   GETSHM
  1019.      Function: Ge⌠ ávaluσ oµ shel∞ messagσ fo≥ specifieΣ ámessagσ ì
  1020. ááááááááááááááánumber
  1021.      Entry:    B = message number (0, 1, 2)
  1022.      Exit:     A = message value (zero flag set accordingly)
  1023.      Affected: AF
  1024.      Usage:    Return≤ thσ valuσ oµ thσ shel∞ messagσ whosσ ánumì
  1025. ááááááááááááááábe≥ i≤ specified«  Therσ arσ threσ shel∞ messages¼ ì
  1026. ááááááááááááááás∩ ░ <╜ ┬ <╜ ▓ (yo⌡ mus⌠ bσ surσ ß valiΣ valuσ ái≤ ì
  1027. ááááááááááááááápresented).
  1028.  
  1029.      Routine║   PUTSHM
  1030.      Function║ Set the value of specified shell message number
  1031.      Entry:    A = message value
  1032.                B = message number (0,1,2)
  1033.      Exit:     None
  1034.      Affected: None
  1035.      Usage:    Place≤ áß ámessagσ int∩ onσ oµ thσ áthreσ ámessagσ ì
  1036. áááááááááááááááposition≤ iε thσ shel∞ area.
  1037.  
  1038. NAMED DIRECTORIES:
  1039.  
  1040.      Routine║   ADDNDR
  1041.      Function║ Add directory name to the named directory buffer
  1042.      Entry:    ┴ ╜ passworΣ flaτ (0=se⌠ t∩ spaces¼ noε-0=se⌠ froφ ì
  1043. áááááááááááááááDE)
  1044.                D┼ ╜ addres≤ oµ passworΣ buffe≥ iµ A<>░ (╕-characì
  1045. áááááááááááááááters)
  1046.                HL = address of FCB containing DU and disk name
  1047.      Exit:     ┴ á<╛ 0¼ zer∩ flaτ clea≥ (NZ⌐ iµ namσ áaddeΣ ásucì
  1048. ááááááááááááááácessfully
  1049.                A = 0, zero set (Z) if no buffer, or buffer full
  1050.      Affected: AF
  1051.      Usage:    Add≤ ß director∙ namσ t∩ thσ nameΣ director∙ (NDR⌐ ì
  1052. ááááááááááááááábuffe≥ defineΣ iε thσ Environmen⌠ Descriptor«  Thσ ì
  1053. áááááááááááááááname¼ áalonτ áwitΦ ádisδ anΣ áuse≥ álocation≤ áarσ ì
  1054. ááááááááááááááápasseΣ áiε áZCPR│ FC┬ forφ wherσ thσ ádisδ ái≤ áa⌠ ì
  1055. áááááááááááááááoffse⌠ á░ (A=1,..P=16)¼ anΣ thσ use≥ numbe≥ i≤ áa⌠ ì
  1056. áááááááááááááááoffse⌠ á1│ (0..31)«  Thσ director∙ namσ i≤ iε áthσ ì
  1057. áááááááááááááááFε áfielΣ oµ thσ FCB«  Aε optiona∞ passworΣ oµ áu≡ ì
  1058. ááááááááááááááát∩ eigh⌠ character≤ (spacσ-filleΣ oε right⌐ ma∙ bσ ì
  1059. ááááááááááááááápasseΣ áa≤ ß strinτ iε thσ D┼ registe≥ ápair« á Oε ì
  1060. áááááááááááááááinput¼ áiµ A=░ theε thσ D┼ pointe≥ i≤ ignoreΣ áanΣ ì
  1061. áááááááááááááááthσ passworΣ i≤ se⌠ empt∙ (al∞ spaces).
  1062.  
  1063.                ADDND╥ capitalize≤ thσ disδ namσ anΣ password¼ anΣ ì
  1064. ááááááááááááááásort≤ thσ nameΣ director∙ buffe≥ b∙ D╒ afte≥ addiì
  1065. ááááááááááááááátion« á N∩ áchecδ i≤ madσ fo≥ duplicatσ áname≤ áo≥ ì
  1066. áááááááááááááááduplicatσ D╒ references.
  1067. .pa
  1068. è     Routine║   DIRNDR
  1069.      Function║ Find named directory buffer entry for specified name
  1070.      Entry:    HL = address of 8-character buffer with name to find
  1071.      Exit:     HL = address of NDR entry, if found
  1072.                BC = DU (disk in B, 1=A..16=P) if found
  1073.                A <> 0, zero flag clear (NZ) if name found
  1074.                A = 0, zero flag set (Z) if no NDR or not found
  1075.      Affected: AF¼ BC¼ HL
  1076.      Usage:    Recover≤ áthσ drivσ anΣ use≥ datß fo≥ ß áspecifieΣ ì
  1077. ááááááááááááááánamσ áfroφ thσ nameΣ director∙ buffer«  Thσ áentr∙ ì
  1078. ááááááááááááááánamσ i≤ automaticall∙ capitalized«  Iµ found¼ áthσ ì
  1079. ááááááááááááááádrivσ ái≤ returneΣ iε registe≥ ┬ (1=A..16=P)¼ áanΣ ì
  1080. áááááááááááááááthσ áuse≥ iε registe≥ ├ (0..31)«  Thσ H╠ áregiste≥ ì
  1081. ááááááááááááááápai≥ áwil∞ poin⌠ t∩ thσ ND╥ entr∙ whicΦ i≤ ástrucì
  1082. ááááááááááááááátureΣ arounΣ 1╕-bytσ entrie≤ as:
  1083.                          DEFB      ▒              ; disk (1=A..16=P)
  1084.                          DEFB      15             ; user (0 to 31)
  1085.                          DEFB      'ROOT    º     ; name, 8-chars, space filled
  1086.                          DEFB      'MYPASS  '     ; password, 8-char, space fill
  1087.  
  1088.      Routine║   DUNDR
  1089.      Function: FinΣ nameΣ director∙ entr∙ froφ drive/use≥ áspeciì
  1090. áááááááááááááááfication
  1091.      Entry:    BC = drive/user in DU to locate (disk 1=A..16=P)
  1092.      Exit:     HL = address of NDR entry if found
  1093.                A <> 0, zero flag clear (NZ⌐ if found
  1094.                A = 0, zero flag set if no NDR buffer or not found
  1095.      Affected: AF¼ HL
  1096.      Usage:    Locate≤ áß ánameΣ director∙ áfroφ áthσ ádrive/use≥ ì
  1097. áááááááááááááááspecificatioε áiε áD╒ forφ wherσ thσ drivσ ái≤ áiε ì
  1098. áááááááááááááááregiste≥ ┬ (drivσ 1=A..16=P⌐ anΣ use≥ i≤ iε regisì
  1099. áááááááááááááááte≥ á├ (0..31)«  Iµ found¼ thσ addres≤ oµ thσ á1╕-ì
  1100. ááááááááááááááábytσ ánameΣ ádirector∙ buffe≥ entr∙ ái≤ áreturned«  ì
  1101. áááááááááááááááEntrie≤ arσ structureΣ as:
  1102.                          DEF┬      ▓              ╗ disδ (1=A..16=P)
  1103.                          DEFB      0              ; user (0..31)
  1104.                          DEFB      'HELP    '     ; name, 8-char, space filled
  1105.                          DEFB      '        '     ; password, 8-char, space fill
  1106.  
  1107.      Routine║   GETNDR
  1108.      Function║ Returε ánameΣ ádirector∙ ábuffe≥ áparameter≤ áfroφ ì
  1109. áááááááááááááááenvironment
  1110.      Entry:    None
  1111.      Exit:     HL = address of NDR buffer
  1112.                A = buffer size in 128-byte blocks, zero clear (NZ)
  1113.                A = 0, zero set (Z⌐ if no NDR buffer
  1114.      Affected: AF¼ HL
  1115.      Usage:    Thi≤ ároutinσ return≤ thσ addres≤ anΣ sizσ oµ áthσ ì
  1116. ááááááááááááááánameΣ director∙ buffe≥ a≤ defineΣ iε thσ áEnvironì
  1117. ááááááááááááááámen⌠ Descriptor«  I⌠ doe≤ no⌠ indicatσ thσ ástatu≤ ì
  1118. áááááááááááááááoµ áan∙ áentrie≤ withiε it« á T∩ ádeterminσ áthis¼ ì
  1119. áááááááááááááááexaminσ áthσ firs⌠ bytσ iε thσ buffer« á Iµ ázero¼ ì
  1120. ááááááááááááááátheε n∩ ND╥ i≤ presen⌠ iε thσ buffer.
  1121. .pa
  1122. è     Example:
  1123.                          EX╘       GETNDR         ; declare the routine
  1124.                          ...                      ; ..preceeding code
  1125.                          CALL      GETNDR         ; get data from ENV
  1126.                          JR        Z,NONDRBF      ; ..jump if no NDR bufr exists
  1127.                          LD        A,(HL)         ; have an NDR. Is data there?
  1128.                          OR        A
  1129.                          JR        Z,LODNDR       ; ..jump if not and load some
  1130.  
  1131.      Routine║   SUBNDR
  1132.      Function: Removσ áspecifieΣ nameΣ director∙ entr∙ áfroφ áND╥ ì
  1133. ááááááááááááááábuffer
  1134.      Entry:    HL = address of 8-character buffer containing name
  1135.      Exit:     A <> 0, zero flag clear (NZ) if removal successful
  1136.                A = 0, zero flag set if no NDR or name not found
  1137.      Affected: AF
  1138.      Usage:    Remove≤ aε entr∙ specifieΣ b∙ namσ froφ thσ ánameΣ ì
  1139. ááááááááááááááádirector∙ buffer«  Thσ namσ mus⌠ bσ provideΣ a≤ áß ì
  1140. ááááááááááááááástrinτ oµ u≡ t∩ eigh⌠ characters¼ spacσ-filleΣ áoε ì
  1141. ááááááááááááááárigh⌠ iµ les≤ thaε eigh⌠ characters«  Thσ namσ ái≤ ì
  1142. ááááááááááááááácapitalizeΣ beforσ i⌠ i≤ checkeΣ agains⌠ ápossiblσ ì
  1143. áááááááááááááááentries« á Iµ located¼ thσ entr∙ i≤ áremoved¼ áanΣ ì
  1144. áááááááááááááááthσ remaininτ buffe≥ i≤ repacked.
  1145.  
  1146. PATH:
  1147.  
  1148.      Routine║   GETPATH
  1149.      Function: Returε addres≤ oµ thσ commanΣ searcΦ patΦ froφ thσ ì
  1150. áááááááááááááááenvironment
  1151.      Entry:    None
  1152.      Exit:     H╠ ╜ addres≤ oµ ZCPR│ searcΦ patΦ froφ Environmen⌠ ì
  1153. áááááááááááááááDescriptor
  1154.                A = number of elements, zero flag clear (NZ) if OK
  1155.                A = 0, zero set (Z) if no path defined in ENV
  1156.      Affected: AF¼ HL
  1157.      Usage:    Returε áthσ áaddres≤ oµ thσ ZCPR│ ácommanΣ ásearcΦ ì
  1158. ááááááááááááááápatΦ a≤ defineΣ iε thσ Environmen⌠ Descriptor«  Iµ ì
  1159. ááááááááááááááátherσ i≤ ß ZCPR│ path¼ i⌠ wil∞ bσ structureΣ a≤ áß ì
  1160. áááááááááááááááserie≤ oµ tw∩-bytσ patΦ element≤ structureΣ as:
  1161.                          DEF┬      ▒              ; disk #1 (current='$', A=1..P=16)
  1162.                          DEFB      15             ; user #1 (current='$', 0..31)
  1163.                          DEFB      '$'            ; disk #2
  1164.                          DEFB      0              ; user #2
  1165.                          DEFB      0              ; end-of-list is drive = 0
  1166.  
  1167. PROCESSOR SPEED:
  1168.  
  1169.      Routine║   GETSPEED
  1170.      Function║ Return processor speed in MHz from environment
  1171.      Entry:    None
  1172.      Exit:     A = processor speed in megahertz
  1173.      Affected: AF
  1174.      Usage:    Mos⌠ ofteε useΣ iε softwarσ timinτ loop≤ t∩ permi⌠ ì
  1175. áááááááááááááááß greate≥ amoun⌠ oµ portabilit∙ iε software« á Thσ ì
  1176. áááááááááááááááreturneΣ valuσ i≤ t∩ thσ neares⌠ megahertz¼ s∩ ▒ ╜ ìèááááááááááááááá▒ MHz¼ ┤ ╜ ┤ MHz¼ etc.
  1177.  
  1178.      Routine║   PUTSPEED
  1179.      Function: Se⌠ áprocesso≥ speeΣ iε environmen⌠ át∩ áspecifieΣ ì
  1180. ááááááááááááááávalue
  1181.      Entry:    A = processor speed in megahertz
  1182.      Exit:     None
  1183.      Affected: None
  1184.      Usage:    Set≤ áthσ processo≥ speeΣ a≤ defineΣ iε thσ áEnviì
  1185. áááááááááááááááronmen⌠ Descripto≥ t∩ thσ specifieΣ valuσ iε Megaì
  1186. áááááááááááááááHert· wherσ ▒ ╜ ▒ MHz¼ ┤ ╜ ┤ MHz¼ etc.
  1187.  
  1188. QUIE╘ FLAG:
  1189.  
  1190.      Routine║   GETQUIET
  1191.      Function║ Return value of quiet flag
  1192.      Entry:    None
  1193.      Exit:     A = value of quiet flag from environment
  1194.                Zer∩ flaτ se⌠ accordingly║ ░ (no⌠ quiet⌐ ╜ Z¼ 0FFΦ ì
  1195. ááááááááááááááá(quiet⌐ ╜ NZ
  1196.      Affected: AF
  1197.      Usage:    Ofteε áuseΣ áiε program≤ t∩ suppres≤ áunneedeΣ áo≥ ì
  1198. áááááááááááááááunwanteΣ ástatu≤ messages«  B∙ sensinτ áthσ áquie⌠ ì
  1199. áááááááááááááááflaτ anΣ usinτ conditiona∞ prin⌠ statements¼ ámorσ ì
  1200. ááááááááááááááápleasinτ áoperatioε ácaε result«  Thσ áquie⌠ áflaτ ì
  1201. ááááááááááááááávaluσ iε storeΣ iε thσ Environmen⌠ Descriptor.
  1202.  
  1203.      Routine║   PUTQUIET
  1204.      Function║ Set the value of the quiet flag
  1205.      Entry:    A = quiet flag value (0=not quiet, 0FFh=quiet)
  1206.      Exit:     None
  1207.      Affected: None
  1208.      Usage:    Set≤ thσ quie⌠ flaτ t∩ thσ specifieΣ value«  Whilσ ì
  1209. ááááááááááááááá0FFΦ i≤ preferreΣ t∩ indicatσ quie⌠ operation¼ an∙ ì
  1210. ááááááááááááááánoε-zer∩ valuσ wil∞ suffice.
  1211.  
  1212. RESIDEN╘ COMMAN─ PACKAG┼ (RCP⌐ ADDRESS:
  1213.  
  1214.      Routine║   GETRCP
  1215.      Function: Returε addres≤ anΣ sizσ oµ residen⌠ commanΣ ápackì
  1216. áááááááááááááááagσ (RCP⌐ defineΣ iε environment
  1217.      Entry:    None
  1218.      Exit:     HL = address of RCP buffer
  1219.                A = size of buffer in 12-byte blocks, zero clear (NZ)
  1220.                A = 0, zero flag set (Z) if no RCP defined
  1221.      Affected: AF¼ HL
  1222.      Usage:    Return≤ thσ residen⌠ commanΣ packagσ buffe≥ ádefiì
  1223. ááááááááááááááánition≤ ácontaineΣ iε thσ Environmen⌠ áDescriptor«  ì
  1224. áááááááááááááááYou≥ áprograφ ámus⌠ checδ fo≥ ß valiΣ ápackagσ áiµ ì
  1225. ááááááááááááááánecessar∙ b∙ examininτ thσ firs⌠ bytσ oµ thσ ábufì
  1226. áááááááááááááááfer.
  1227. .pa
  1228. è     Example:
  1229.                          EX╘       GETFCP         ; declare the routine
  1230.                          ...                      ; ..preceeding code
  1231.                          CALL      GETFCP         ; get ENV definitions
  1232.                          JR        Z,NOFCPBUF     ; ..jump if no RCP exists
  1233.                          LD        A,(HL)         ; check first byte of bufr
  1234.                          OR        A              ; anything there?
  1235.                          JR        Z,LODRCP       ; ..jump if not to load
  1236.                          ...                      ; else have an RCP in place
  1237.  
  1238. SHELL STACK:
  1239.  
  1240.      Routine║   GETSH1
  1241.      Function: Returε ádefineΣ shel∞ stacδ parameter≤ froφ áenviì
  1242. áááááááááááááááronment
  1243.      Entry:    None
  1244.      Exit:     HL = address of shell stack
  1245.                B = number of bytes in each shell stack entry
  1246.                A = number of possible entries, zero clear (NZ)
  1247.                A = 0, zero flag set (Z) if no shell stack
  1248.      Affected: AF¼ B¼ HL
  1249.      Usage:    Return≤ ádatß áoε thσ overal∞ shel∞ ástacδ ásysteφ ì
  1250. áááááááááááááááfroφ áthσ Environmen⌠ Descriptor«  Seσ SHPUS╚ áanΣ ì
  1251. áááááááááááááááSHPO╨ routine≤ fo≥ detail≤ oε othe≥ facilitie≤ fo≥ ì
  1252. ááááááááááááááádealinτ witΦ shel∞ stack≤ provideΣ b∙ Z3LIB.
  1253.  
  1254.      Routine║   GETSH2
  1255.      Function: Returε ádefineΣ shel∞ stacδ parameter≤ froφ áenviì
  1256. áááááááááááááááronment
  1257.      Entry:    None
  1258.      Exit:     HL = address of shell stack
  1259.                DE = number of bytes allowed in each stack entry
  1260.                B¼ A = number of allowed entries, zero clear (NZ)
  1261.                A = 0, zero set (Z) if no shell stack defined
  1262.      Affected: AF¼ B¼ DE¼ HL
  1263.      Usage:    Thi≤ ái≤ aε alternativσ routinσ t∩ árecove≥ áshel∞ ì
  1264. ááááááááááááááástacδ parameter≤ froφ thσ Environmen⌠ áDescriptor«  ì
  1265. áááááááááááááááFo≥ somσ uses¼ thi≤ forφ i≤ morσ easil∙ manipulatì
  1266. áááááááááááááááeΣ áthaε áGETSH▒ covereΣ above« á Seσ áSHPUS╚ áanΣ ì
  1267. áááááááááááááááSHPO╨ routine≤ fo≥ detail≤ oε othe≥ facilitie≤ fo≥ ì
  1268. ááááááááááááááádealinτ witΦ shel∞ stack≤ provideΣ b∙ Z3LIB.
  1269.  
  1270. WHEEL BYTE:
  1271.  
  1272.      Routine║   GETWHL
  1273.      Function║ Return the wheel byte value from the environment
  1274.      Entry:    None
  1275.      Exit:     A = wheel byte
  1276.                Flag≤ se⌠ accordingly║ ░ (no⌠ wheel⌐ ╜ Z¼ 0FFΦ (i≤ ì
  1277. áááááááááááááááwheel⌐ ╜ NZ
  1278.      Affected: AF
  1279.      Usage:    Restrict≤ user≤ froφ accessinτ part≤ oµ áprograms¼ ì
  1280. áááááááááááááááo≥ áaffectinτ prograφ flow«  Fo≥ example¼ yo⌡ áma∙ ì
  1281. áááááááááááááááno⌠ áwisΦ remotσ user≤ t∩ changσ thσ patΦ ádefiniì
  1282. ááááááááááááááátion« á B∙ assigninτ "n∩ wheeló statu≤ át∩ áremotσ ìèáááááááááááááááusers¼ áthσ áPAT╚ áutilit∙ wil∞ árefusσ át∩ áallo≈ ì
  1283. áááááááááááááááchanges¼ sincσ i⌠ sense≤ thσ privelege≤ witΦ áthi≤ ì
  1284. ááááááááááááááároutine«  Whilσ ß 0FFΦ valuσ i≤ listeΣ fo≥ ágrantì
  1285. áááááááááááááááinτ whee∞ priveleges¼ an∙ noε-zer∩ valuσ currentl∙ ì
  1286. ááááááááááááááásuffices.
  1287.  
  1288.      Routine║   PUTWHL
  1289.      Function║ Set the value of the wheel byte in the environment
  1290.      Entry:    A = wheel byte value to set (0=no wheel, 0FFh=wheel)
  1291.      Exit:     None
  1292.      Affected: None
  1293.      Usage:    Set≤ thσ whee∞ bytσ oε (0FFh⌐ o≥ ofµ (0)¼ áthereb∙ ì
  1294. ááááááááááááááágrantinτ o≥ denyinτ whee∞ privelege≤ t∩ áexecutinτ ì
  1295. áááááááááááááááprograms.
  1296.  
  1297. FLOW¼ ZEX¼ AN─ SUBMI╘ CONTROL:
  1298.  
  1299. FLO╫ áCONTROL:é  Al∞ commanΣ sequence≤ issueΣ unde≥ ZCPR│ ácaε ábσ ì
  1300. though⌠ t∩ executσ iε ß TRU┼ flo≈ contro∞ state«  Tha⌠ is¼ áwhenì
  1301. eve≥ ß commanΣ i≤ executeΣ unde≥ ZCPR3¼ thσ statσ oµ flo≈ contro∞ ì
  1302. i≤ TRUE«  Iµ thσ statσ oµ flo≈ contro∞ i≤ FALS┼ theε n∩ ácommand≤ ì
  1303. excep⌠ áflo≈ ácommand≤ wil∞ bσ executeΣ unti∞ thσ statσ áoµ áflo≈ ì
  1304. contro∞ become≤ TRUE.
  1305.  
  1306. Background║  Wheε ZCPR│ firs⌠ come≤ up¼ thσ statσ oµ flo≈ contro∞ ì
  1307. i≤ alway≤ TRUE«  An∙ commanΣ issueΣ wil∞ bσ executed«  Iµ ß áFlo≈ ì
  1308. CommanΣ áPackagσ i≤ installeΣ whicΦ support≤ thσ IF/ELSE/F╔ á(EnΣ ì
  1309. IF⌐ ácommands¼ theε thσ statσ oµ flo≈ contro∞ caε bσ ádynamicall∙ ì
  1310. changeΣ áb∙ use≥ commands¼ a≤ thσ followinτ termina∞ sessioε ái∞ì
  1311. lustrates:
  1312. 
  1313.      SCR>; any command will execute now
  1314.      SCR>era *.bak
  1315.      No Files
  1316.      SCR>dir
  1317.      MYFILE  .TXT  |  OBJECT  .BIN
  1318.      SCR>; we can set a flow control state to be false
  1319.      SCR>IF F
  1320.       IF F
  1321.      SCR>; no command will execute now
  1322.      SCR>dir
  1323.      SCR>else
  1324.       IF T
  1325.      SCR>dir
  1326.      MYFILE  .TXT  |  OBJECT  .BIN
  1327.      SCR>FI
  1328.       No IF
  1329.      SCR>
  1330. 
  1331. Hence¼ wheε an∙ commanΣ i≤ executed¼ beforσ thσ executioε actualì
  1332. l∙ ábegins¼ ZCPR│ wil∞ looδ t∩ seσ iµ thσ statσ oµ thσ flo≈ áconì
  1333. tro∞ ái≤ áTRUE«  SucΦ i≤ thσ casσ wheε wσ arσ no⌠ áwithiε áaε áI╞ ì
  1334. conditioε o≥ wheε wσ arσ withiε onσ o≥ morσ I╞ conditions¼ al∞ oµ ì
  1335. whicΦ arσ TRUE.
  1336.  
  1337. èZCPR│ áallow≤ yo⌡ t∩ bσ nesteΣ int∩ IF'≤ u≡ t∩ eigh⌠ á(8⌐ álevel≤ ì
  1338. deep«  Tha⌠ is¼ thσ structurσ oµ you≥ commanΣ sequence≤ caε átakσ ì
  1339. thσ followinτ forφ whicΦ caε bσ nesteΣ t∩ ╕ level≤ oµ IF's:
  1340. 
  1341.      <set of commands>
  1342.      IF T
  1343.           <set of commands>
  1344.           IF T
  1345.                <set of commands>
  1346.                IF T
  1347.                     <set of commands>
  1348.                FI
  1349.                <set of commands>
  1350.           ELSE
  1351.                <set of non-executed commands>
  1352.                IF T
  1353.                     <set of non-executed commands>
  1354.                FI
  1355.           FI
  1356.      ELSE
  1357.           <set of non-executed commands>
  1358.      FI
  1359. 
  1360. CommanΣ ástructure≤ likσ thosσ presenteΣ abovσ arσ áno≈ ápossiblσ ì
  1361. unde≥ ZCPR3«  Iε essence¼ ZCPR│ command≤ caε no≈ takσ thσ forφ oµ ì
  1362. ß programminτ languagσ iε thei≥ owε right.
  1363.  
  1364. Thσ áse⌠ oµ routine≤ availablσ iε thi≤ par⌠ oµ Z3LI┬ arσ useΣ át∩ ì
  1365. providσ áyo⌡ witΦ ß simplσ interfacσ t∩ contro∞ thσ flo≈ ácontro∞ ì
  1366. withiε (anΣ outside⌐ you≥ program«  Yo⌡ caε issuσ command≤ to:
  1367.    o Enter the next IF level in TRUE or FALSE condition
  1368.    o Toggle the state of the current IF level
  1369.    o Drop down to the previous IF level
  1370.    o Determine the current IF level number
  1371.    o Or multiples of the above
  1372.  
  1373.      Routine║   IFEND
  1374.      Function║ Drop to previous IF level
  1375.      Entry:    None
  1376.      Exit:     A <> 0, zero flag clear (NZ) if successful
  1377.                A = 0, zero flag set (Z) if no IF level
  1378.      Affected: AF
  1379.      Usage:    Terminate≤ áthσ curren⌠ I╞ leve∞ anΣ drop≤ t∩ áthσ ì
  1380. ááááááááááááááápreviou≤ I╞ level¼ iµ thσ prograφ i≤ withiε onσ o≥ ì
  1381. ááááááááááááááámorσ áIF's« á Fo≥ ß transien⌠ áprogram¼ átherσ ái≤ ì
  1382. áááááááááááááááeithe≥ án∩ I╞ level¼ o≥ therσ i≤ ß TRU┼ flo≈ áconì
  1383. ááááááááááááááátro∞ statσ (al∞ preceedinτ IF'≤ arσ TRUE).
  1384.  
  1385.      Routines║  IFT ¼  IFF
  1386.      Function║ Raisσ anΣ se⌠ I╞ level
  1387.      Entry:    None
  1388.      Exit:     A <> 0, zero flag clear (NZ) if IF level OK
  1389.                A = 0, zero set (Z) on IF level overflow
  1390.      Affected: AF
  1391.      Usage:    IF╘ áset≤ I╞ leve∞ t∩ TRUE¼ IF╞ set≤ I╞ áleve∞ át∩ ìèáááááááááááááááFALSE« á Thesσ routine≤ arσ useΣ t∩ se⌠ flo≈ áconì
  1392. ááááááááááááááátro∞ ástate≤ áanΣ raisσ thσ I╞ álevel« á Thσ áflo≈ ì
  1393. ááááááááááááááácontro∞ ástatσ caε suppor⌠ u≡ t∩ eigh⌠ (8⌐ álevel≤ ì
  1394. áááááááááááááááoµ IF's«  IF╘ anΣ IF╞ returε erro≥ code≤ fo≥ overì
  1395. áááááááááááááááflo≈ ácondition≤ whicΦ shoulΣ bσ senseΣ t∩ áinsurσ ì
  1396. áááááááááááááááthσ integrit∙ oµ thσ program.
  1397.  
  1398.      Routine║   IFTEST
  1399.      Function║ Determine the current IF level
  1400.      Entry:    None
  1401.      Exit:     A = number of current IF level
  1402.                Zero flag i≤ se⌠ accordingly
  1403.      Affected: AF
  1404.      Usage:    Determine≤ áthσ ácurren⌠ I╞ level« á Thσ áreturneΣ ì
  1405. áááááááááááááááleve∞ valuσ range≤ froφ ░ t∩ 8«  Iµ A=0¼ therσ ái≤ ì
  1406. ááááááááááááááán∩ ácurren⌠ IF«  Thσ zer∩ flaτ i≤ se⌠ áaccordingl∙ ì
  1407. ááááááááááááááát∩ allo≈ rapiΣ testing.
  1408.      Example:
  1409.                          EX╘       IFTEST         ; declare the routine
  1410.                          ...                      ; ..preceeding code
  1411.                          CALL      IFTEST         ; get current IF level
  1412.                          JR        Z,NOIF         ; ..jump if none
  1413.                          CP        8              ; is it at max level?
  1414.                          JR        Z,ATMAX        ; ..jump if at max IF level
  1415.                          ...                      ; else carry shows empty levels
  1416.  
  1417.      Routine║   IFELSE
  1418.      Function║ Toggle TRUE/FALSE state of current IF level
  1419.      Entry:    None
  1420.      Exit:     A <> 0, zero flag clear (NZ) if successful
  1421.                A = 0, zero flag set (Z) if no current IF
  1422.      Affected: AF
  1423.      Usage:    Toggle≤ thσ curren⌠ statσ oµ thσ curren⌠ I╞ level«  ì
  1424. áááááááááááááááIµ ácalleΣ aε eveε numbe≥ oµ times¼ thσ ástatσ ái≤ ì
  1425. áááááááááááááááeffectivel∙ unchanged.
  1426.  
  1427. ZE╪ áACCES╙ áAN─ CONTROL:é  Thσ ZE╪ commanΣ filσ áfacilit∙ á(unde≥ ì
  1428. ZCPR│ only⌐ caε bσ controlleΣ b∙ thi≤ se⌠ oµ Z3LI┬ routines«  ZE╪ ì
  1429. intercept≤ al∞ BIO╙ call≤ fo≥ input¼ and¼ wheε iε intercep⌠ mode¼ ì
  1430. i⌠ áprovide≤ inpu⌠ froφ tex⌠ containeΣ iε it≤ ámemor∙-baseΣ átex⌠ ì
  1431. buffe≥ rathe≥ thaε allowinτ thσ use≥ t∩ inpu⌠ character≤ froφ thσ ì
  1432. keyboard«  Thesσ routine≤ arσ useΣ t∩ quer∙ thσ statu≤ oµ ZE╪ anΣ ì
  1433. t∩ áinstruc⌠ ZE╪ t∩ continuσ interceptinτ character≤ o≥ át∩ ásto≡ ì
  1434. interceptinτ character≤ anΣ allo≈ use≥ input.
  1435.  
  1436. Thi≤ áse⌠ áoµ routine≤ provide≤ acces≤ t∩ áthσ áZE╪ ámemor∙-baseΣ ì
  1437. commanΣ filσ processo≥ anΣ it≤ environment«  Yo⌡ caε takσ contro∞ ì
  1438. oµ ZE╪ througΦ thesσ routines.
  1439.  
  1440. Summary of Routines:
  1441.  
  1442.      GETZEX -- get the ZEX control message
  1443.      GETZFC -- get the first character in ZEX buffer
  1444.      GETZNC -- get the next character to be returned
  1445.      GETZRUN -- get ZEX running flag
  1446. è     HALTZEX -- terminate the ZEX processor
  1447.      PUTZEX -- set the ZEX control message
  1448.      PUTZNC -- set the next character to be returned
  1449.      PUTZRUN -- set ZEX running flag
  1450.      STOPZEX -- suspend ZEX execution
  1451.      STRTZEX -- resume ZEX execution from a STOPZEX
  1452.  
  1453. ZEX DATA:
  1454.  
  1455.      Routine║   GETZFC
  1456.      Function║ Return address of first character in ZEX buffer
  1457.      Entry:    None
  1458.      Exit:     HL = address of first character in ZEX script buffer
  1459.                A = character at that address
  1460.                Carry clear (NC) if data
  1461.                Carry flag set (C) if no text data in buffer
  1462.      Affected: AF¼ HL
  1463.      Usage:    UseΣ t∩ examinσ thσ scrip⌠ datß fo≥ ß runninτ áZE╪ ì
  1464. áááááááááááááááscrip⌠ sequence.
  1465.  
  1466.      Routine║   GETZNC
  1467.      Function║ Get next character ZEX will process
  1468.      Entry:    None
  1469.      Exit:     HL = address of next character in ZEX text buffer
  1470.                ┴ ╜ nex⌠ characte≥ t∩ bσ returned¼ carr∙ clea≥ áiµ ì
  1471. ááááááááááááááávalid¼ carr∙ flaτ se⌠ (C⌐ iµ n∩ tex⌠ datß remains
  1472.      Affected: AF¼ HL
  1473.      Usage:    Ma∙ ábσ áuseΣ t∩ effec⌠ change≤ t∩ ß árunninτ áZE╪ ì
  1474. áááááááááááááááprograφ b∙ examininτ thσ nex⌠ characte≥ tha⌠ áwil∞ ì
  1475. ááááááááááááááábσ returned.
  1476.  
  1477.      Routine║   GETZRUN
  1478.      Function║ Determine run status of ZEX from run message byte
  1479.      Entry:    None
  1480.      Exit:     A = run message
  1481.                Zero set accordingly (0=not running)
  1482.                Carry flag set (C) if no message available
  1483.      Affected: AF
  1484.      Usage:    Return≤ áthσ ZE╪ ruε messagσ bytσ anΣ áset≤ áflag≤ ì
  1485. áááááááááááááááindicatinτ statu≤ as║  zer∩ flaτ i≤ se⌠ (Z⌐ iµ ZE╪ ì
  1486. áááááááááááááááno⌠ runninτ o≥ clea≥ (NZ⌐ iµ i⌠ is╗ carr∙ flaτ ái≤ ì
  1487. áááááááááááááááse⌠ á(C⌐ iµ therσ i≤ n∩ messagσ o≥ clea≥ á(NC⌐ áiµ ì
  1488. ááááááááááááááátherσ is.
  1489.  
  1490.      Routine║   PUTZNC
  1491.      Function║ Set address of next ZEX character (GOTO)
  1492.      Entry:    HL = address of next character ZEX will return
  1493.      Exit:     Carry flag clear (NC) if operation successful
  1494.                Carry set (C) if ZEX buffers not available
  1495.      Affected: AF
  1496.      Usage:    Set≤ thσ addres≤ oµ thσ nex⌠ characte≥ whicΦ áwil∞ ì
  1497. ááááááááááááááábσ áreaΣ áb∙ ZEX«  Usinτ thi≤ routinσ áprovide≤ áß ì
  1498. áááááááááááááááGOT╧ functioε fo≥ ZE╪ control.
  1499. .pa
  1500. è     Routine║   PUTZRUN
  1501.      Function║ Set value of ZEX running message byte
  1502.      Entry:    A = value of ZEX running message byte
  1503.      Exit:     Carry flag set (C) if no message buffers
  1504.      Affected: AF
  1505.      Usage:    Set≤ áthσ ZE╪ runninτ messagσ bytσ t∩ ß áuse≥-supì
  1506. áááááááááááááááplie≤ ávalue« á It≤ purposσ i≤ át∩ áallo≈ árunninτ ì
  1507. áááááááááááááááprogram≤ át∩ ádisablσ o≥ suspenΣ áZE╪ áprocessing«  ì
  1508. áááááááááááááááSe⌠ t∩ zer∩ t∩ sto≡ ZE╪ processing.
  1509.  
  1510. ZEX STATUS AND CONTROL:
  1511.  
  1512.      Routine║   GETZEX
  1513.      Function║ Return ZEX control message byte
  1514.      Entry:    None
  1515.      Exit:     A = ZEX control message (0,1,2)
  1516.                Zero set accordingly
  1517.      Affected: AF
  1518.      Usage:    Allow≤ program≤ t∩ determinσ thσ curren⌠ statσ áoµ ì
  1519. áááááááááááááááZEX«  Thσ contro∞ messagσ bytσ caε havσ onσ oµ thσ ì
  1520. áááááááááááááááfollowinτ threσ values:
  1521.                      0 = Normal«  ZE╪ i≤ runninτ anΣ interceptinτ ì
  1522. áááááááááááááááááááááááááBIO╙ calls.
  1523.                      1 = ZCPR│ Prompt«  ZE╪ i≤ alloweΣ t∩ ruε anΣ ì
  1524. áááááááááááááááááááááááááintercep⌠ áBIO╙ ácalls¼ bu⌠ áZE╪ áthink≤ ì
  1525. ááááááááááááááááááááááááátha⌠ i⌠ i≤ providinτ inpu⌠ t∩ thσ áZCPR│ ì
  1526. ááááááááááááááááááááááááácommanΣ áprocesso≥ directl∙ (ZE╪ i≤ áno⌠ ì
  1527. áááááááááááááááááááááááááprovidinτ inpu⌠ t∩ an∙ program).
  1528.                      2 = ZE╪ Suspended«  ZE╪ i≤ no⌠ áinterceptinτ ì
  1529. áááááááááááááááááááááááááBIO╙ call≤ anΣ use≥ inpu⌠ i≤ allowed.
  1530.  
  1531.                ┴ á▒ codσ shoulΣ neve≥ bσ seeε b∙ ß prograφ ásincσ ì
  1532. ááááááááááááááái⌠ i≤ se⌠ b∙ ZCPR│ anΣ cleareΣ t∩ ░ afte≥ ZE╪ áha≤ ì
  1533. ááááááááááááááácompleteΣ thσ commanΣ linσ input«  An∙ ZE╪ contro∞ ì
  1534. ááááááááááááááámessagσ i≤ rese⌠ upoε executioε oµ ZCPR│ t∩ ░ wheε ì
  1535. áááááááááááááááZCPR│ ái≤ áentereΣ anΣ theε t∩ ▒ áwheε áthσ áZCPR│ ì
  1536. ááááááááááááááápromp⌠ áappear≤ á(ZCPR│ input)«  Wheε áZCPR│ ácomì
  1537. áááááááááááááááplete≤ áit≤ input¼ i⌠ reset≤ thσ ZE╪ contro∞ ámesì
  1538. ááááááááááááááásagσ t∩ 0.
  1539.  
  1540.      Routine║   PUTZEX
  1541.      Function║ Set ZEX control message byte (change ZEX state)
  1542.      Entry:    A = ZEX control message byte (0¼ 1¼ 2)
  1543.      Exit:     None
  1544.      Affected: None
  1545.      Usage:    Allow≤ ß prograφ t∩ se⌠ thσ statσ tha⌠ ZE╪ i≤ áin«  ì
  1546. áááááááááááááááThi≤ contro∞ messagσ bytσ mus⌠ onl∙ bσ se⌠ t∩ áonσ ì
  1547. áááááááááááááááoµ thesσ values:
  1548.                      0 = Normal«  ZE╪ i≤ runninτ anΣ interceptinτ ì
  1549. áááááááááááááááááááááááááBIO╙ calls.
  1550.                      1 = ZCPR│ Prompt«  ZE╪ i≤ alloweΣ t∩ ruε anΣ ì
  1551. áááááááááááááááááááááááááintercep⌠ BIO╙ call≤ bu⌠ ZE╪ think≤ tha⌠ ì
  1552. ááááááááááááááááááááááááái⌠ i≤ providinτ inpu⌠ t∩ thσ ZCPR│ ácomì
  1553. ááááááááááááááááááááááááámanΣ áprocesso≥ ádirectl∙ á(ZE╪ ái≤ áno⌠ ì
  1554. áááááááááááááááááááááááááprovidinτ inpu⌠ t∩ an∙ program).
  1555. è                     2 = ZE╪ Suspended«  ZE╪ i≤ no⌠ áinterceptinτ ì
  1556. áááááááááááááááááááááááááBIO╙ call≤ anΣ use≥ inpu⌠ i≤ allowed.
  1557.  
  1558.                ┴ ▒ codσ ma∙ bσ se⌠ b∙ an∙ prograφ iµ i⌠ want≤ ZE╪ ì
  1559. ááááááááááááááát∩ á"thinkó tha⌠ i⌠ i≤ providinτ inpu⌠ át∩ áZCPR3«  ì
  1560. áááááááááááááááIµ áZE╪ wa≤ previousl∙ suspended¼ i⌠ áadvance≤ át∩ ì
  1561. áááááááááááááááthσ beginninτ oµ thσ nex⌠ linσ anΣ resume≤ wheε i⌠ ì
  1562. ááááááááááááááásee≤ thi≤ code«  An∙ ZE╪ contro∞ messagσ i≤ árese⌠ ì
  1563. áááááááááááááááupoε executioε oµ ZCPR│ t∩ ░ wheε ZCPR│ i≤ entereΣ ì
  1564. áááááááááááááááanΣ theε t∩ ▒ wheε thσ ZCPR│ promp⌠ appear≤ (ZCPR│ ì
  1565. áááááááááááááááinput)«  Wheε ZCPR│ complete≤ it≤ input¼ i⌠ reset≤ ì
  1566. áááááááááááááááthσ ZE╪ contro∞ messagσ t∩ 0.
  1567.  
  1568.      Routine║   HALTZEX
  1569.      Function║ Halt ZEX completely by setting ZEX end-of-file
  1570.      Entry:    None
  1571.      Exit:     A <> 0, zero flag clear (NZ) if ZEX is halted
  1572.                A = 0, zero flag set (Z) if ZEX i≤ not running
  1573.      Affected: AF
  1574.      Usage:    Terminate≤ áexecutioε áoµ ZE╪ ácompletely« á Othe≥ ì
  1575. ááááááááááááááároutine≤ providσ temporar∙ executioε contro∞ ásucΦ ì
  1576. áááááááááááááááa≤ áSTOPZE╪ (suspenΣ execution)¼ anΣ STRTZE╪ á(reì
  1577. ááááááááááááááásumσ execution)¼ bu⌠ HALTZE╪ cause≤ ZE╪ t∩ átermiì
  1578. ááááááááááááááánatσ itselµ completel∙ b∙ settinτ thσ nex⌠ characì
  1579. áááááááááááááááte≥ ZE╪ wil∞ proces≤ t∩ thσ terminatioε ácharacte≥ ì
  1580. áááááááááááááááoµ 0FFh.
  1581.  
  1582.      Routine║   STOPZEX
  1583.      Function║ Temporarily suspend ZEX script processing
  1584.      Entry:    None
  1585.      Exit:     None╗ ZEX control message byte is set to 2
  1586.      Affected: None
  1587.      Usage:    Temporaril∙ stop≤ ZE╪ froφ interceptinτ BIO╙ call≤ ì
  1588. áááááááááááááááanΣ allow≤ thσ use≥ t∩ inpu⌠ characters«  Thi≤ ái≤ ì
  1589. áááááááááááááááß shorthanΣ t∩ placinτ thσ ▓ contro∞ codσ int∩ thσ ì
  1590. áááááááááááááááZE╪ contro∞ messagσ byte.
  1591.  
  1592.      Routine║   STRTZEX
  1593.      Function║ Start processing from ZEX script
  1594.      Entry:    None
  1595.      Exit:     None
  1596.      Affected: None
  1597.      Usage:    Allow≤ áZE╪ t∩ intercep⌠ BIO╙ call≤ áanΣ áprevent≤ ì
  1598. áááááááááááááááuse≥ froφ inputtinτ characters«  Thi≤ i≤ ß áshortì
  1599. áááááááááááááááhanΣ át∩ placinτ thσ ░ contro∞ codσ int∩ áthσ áZE╪ ì
  1600. ááááááááááááááácontro∞ messagσ byte.
  1601.  
  1602. SUBMI╘ AN─ XSU┬ CONTROL:é  Iε enhancinτ thσ ZCPR│ commanΣ áprocesì
  1603. sor≤ anΣ defininτ thσ extendeΣ environment¼ provision≤ werσ áals∩ ì
  1604. madσ át∩ contro∞ prograφ flo≈ froφ SUBMI╘ anΣ XSU┬ áutilitie≤ áiε ì
  1605. thσ samσ manne≥ a≤ thσ memor∙-baseΣ ZE╪ processinτ covereΣ áelseì
  1606. where.
  1607.  
  1608. SUBMI╘ áprocessinτ i≤ determineΣ viß flag≤ anΣ othe≥ datß áwithiε ì
  1609. ZCP╥ áVersioε á3.│ anΣ later«  Routine≤ supportinτ áit≤ áfeature≤ ìèmus⌠ havσ acces≤ t∩ thσ commanΣ processor«  I⌠ i≤ you≥ áresponsiì
  1610. bilit∙ t∩ insurσ tha⌠ thσ processo≥ i≤ no⌠ overwritten.
  1611.  
  1612. Thσ ácombinatioε áoµ SUBMI╘ witΦ aε XSU┬-likσ áutilit∙ áforφ áthσ ì
  1613. basi≤ oµ ß disδ-baseΣ corollar∙ t∩ ZE╪ fo≥ use≤ wherσ ß largσ TP┴ ì
  1614. space¼ áo≥ áver∙ largσ script≤ mus⌠ bσ áprocessed« á "Hooksó áarσ ì
  1615. thereforσ provideΣ witΦ thesσ routine≤ t∩ enablσ sucΦ ß facility.
  1616.  
  1617. SUBMI╘ DAT┴ AN─ CONTROL:
  1618.  
  1619.      Routine║   SUBON
  1620.      Function║ Determine whether SUBMIT processing is enabled
  1621.      Entry:    None
  1622.      Exit:     Zero clear (NZ) if SUBMIT is enabled
  1623.                Zero set (Z) if no ZCPR 3.3 or SUBMIT disabled
  1624.                A = destroyed
  1625.      Affected: AF
  1626.      Usage:    Require≤ áZCP╥ 3.│ o≥ later« á Determine≤ áwhethe≥ ì
  1627. áááááááááááááááthσ áSUBMI╘ áfacilit∙ withiε ZCP╥ versioε á3.│ áo≥ ì
  1628. ááááááááááááááálate≥ i≤ enabled«  Aε erro≥ statu≤ i≤ returneΣ áiµ ì
  1629. áááááááááááááááSUBMI╘ ái≤ disabled¼ o≥ thσ commanΣ áprocesso≥ ái≤ ì
  1630. áááááááááááááááno⌠ ZCP╥ 3.│ o≥ later«  Thσ commanΣ processo≥ mus⌠ ì
  1631. áááááááááááááááno⌠ havσ beeε overwritten.
  1632.  
  1633.      Routine║   HALTSUB
  1634.      Function║ Terminate an executing SUBMIT job
  1635.      Entry:    None
  1636.      Exit:     None; the $$$.SUB filσ is deleted
  1637.      Affected: None
  1638.      Usage:    Stop≤ áaε áexecutinτ SUBMI╘ joΓ áb∙ ádeletinτ áthσ ì
  1639. ááááááááááááááá$$$.SU┬ filσ addresseΣ iε thσ ZCP╥ 3.│ submi⌠ FCB.
  1640.  
  1641.      Routine║   GETSRUN
  1642.      Function║ Return flag indicating SUBMIT job status
  1643.      Entry:    None
  1644.      Exit:     A <> 0, zero clear (NZ) if SUBMIT job is running
  1645.                A = 0, zero set (Z) if SUBMIT is not running
  1646.      Affected: AF
  1647.      Usage:    Determine≤ whethe≥ wσ arσ currentl∙ runninτ withiε ì
  1648. áááááááááááááááß SUBMI╘ job«  Thi≤ i≤ sometime≤ necessar∙ áinforì
  1649. ááááááááááááááámatioε át∩ ádeterminσ possiblσ áaction≤ áwithiε áß ì
  1650. áááááááááááááááprogram.
  1651.  
  1652.      Routine║   GETSFCB
  1653.      Function║ Return the ZCPR 3.3 or later submit FCB address
  1654.      Entry:    None
  1655.      Exit:     DE = address of SUBMIT FCB (undefined if error)
  1656.                A <> 0, zero flag clear (NZ) if OK
  1657.                A = 0, zero set (Z) if no SUBMIT or ZCPR 3.3
  1658.      Affected: AF¼ DE
  1659.      Usage:    Require≤ ZCP╥ 3.│ o≥ later«  Thi≤ routinσ áreturn≤ ì
  1660. áááááááááááááááthσ áSUBMI╘ FC┬ addres≤ froφ ZCP╥ versioε á3.│ áo≥ ì
  1661. ááááááááááááááálate≥ FCB«  Aε erro≥ statu≤ i≤ returneΣ iµ áSUBMI╘ ì
  1662. ááááááááááááááái≤ no⌠ enableΣ o≥ thσ commanΣ processo≥ i≤ no⌠ áoµ ì
  1663. áááááááááááááááthσ árigh⌠ type«  Thσ commanΣ processo≥ ámus⌠ áno⌠ ìèáááááááááááááááhavσ beeε overwritten.
  1664.  
  1665. XSU┬ DAT┴ AN─ CONTROL:
  1666.  
  1667.      Routine║   STOPXSUB
  1668.      Function║ Reset XSUB input redirection flag
  1669.      Entry:    None
  1670.      Exit:     None; XSUB is halted
  1671.      Affected: None
  1672.      Usage:    Stop≤ áXSU┬ prograφ flo≈ fo≥ loca∞ consolσ áinput«  ì
  1673. áááááááááááááááThi≤ ái≤ accomplisheΣ b∙ resettinτ ß flaτ áiε áthσ ì
  1674. ááááááááááááááámessagσ buffer.
  1675.  
  1676.      Routine║   GXSUB
  1677.      Function║ Return the value of the XSUB redirection flag
  1678.      Entry:    None
  1679.      Exit:     A = value of the XSUB redirection flag
  1680.      Affected: AF
  1681.      Usage:    Determine≤ áiµ áinpu⌠ t∩ thσ árunninτ áprograφ ái≤ ì
  1682. ááááááááááááááácominτ áfroφ aε XSU┬ utility«  Thi≤ i≤ áusefu∞ áiε ì
  1683. áááááááááááááááerro≥ condition≤ wherσ thσ norma∞ flo≈ oµ command≤ ì
  1684. áááááááááááááááanΣ datß mus⌠ bσ altereΣ fo≥ operato≥ input.
  1685.  
  1686.      Routine║   PXSUB
  1687.      Function║ Set the XSUB input redirection flag
  1688.      Entry:    A = value to set XSUB input redirection flag
  1689.      Exit:     None; the value is set
  1690.      Affected: None
  1691.      Usage:    Activate≤ XSU┬ processinτ froφ ß commanΣ scrip⌠ o≥ ì
  1692. áááááááááááááááSU┬ áfile«  B∙ settinτ thσ XSU┬ redirectioε áflag¼ ì
  1693. áááááááááááááááprograφ flo≈ caε bσ dynamicall∙ altered«  Unti∞ áß ì
  1694. ááááááááááááááábette≥ ádefinitioε i≤ developed¼ i⌠ ái≤ ásuggesteΣ ì
  1695. ááááááááááááááátha⌠ áthσ ácommanΣ byte≤ useΣ fo≥ ZE╪ ábσ áapplieΣ ì
  1696. ááááááááááááááá(seσ GETZEX).
  1697.  
  1698. ZCPR│ áMESSAGES:é  ZCPR│ offer≤ man∙ feature≤ no⌠ founΣ áiε áCP/M¼ ì
  1699. ZCPR1¼ áo≥ áZCPR2«  Onσ ver∙ specia∞ featurσ i≤ tha⌠ áoµ ácommanΣ ì
  1700. processo≥ messages.
  1701.  
  1702. ZCPR│ ásupport≤ ß messagσ buffe≥ whicΦ contain≤ ß numbe≥ oµ ámesì
  1703. sage≤ áwhicΦ caε bσ passeΣ froφ onσ transien⌠ prograφ t∩ áanothe≥ ì
  1704. o≥ ábetweeε áZCPR│ itselµ anΣ al∞ transien⌠ áprogram≤ áwhicΦ áruε ì
  1705. unde≥ it«  Command≤ caε bσ giveε directl∙ t∩ ZCPR3¼ statu≤ inforì
  1706. matioε caε bσ passeΣ froφ ZCPR│ t∩ thσ transients¼ anΣ botΦ statì
  1707. u≤ áanΣ ácommand≤ ácaε bσ passeΣ froφ onσ átransien⌠ át∩ áanothe≥ ì
  1708. througΦ thesσ messages.
  1709.  
  1710. These message can be divided into six basic classes:
  1711.    o Messages which command ZCPR3
  1712.    o Status messages sent by ZCPR3
  1713.    o ZEX command messages
  1714.    o Statu≤ áanΣ commanΣ message≤ sen⌠ b∙ onσ prograφ t∩ áanothe≥ ì
  1715. áááááwhicΦ arσ ignoreΣ b∙ ZCPR3
  1716.    o User-defined messages
  1717.    o Reserved messages
  1718. è
  1719. Beforσ áusinτ an∙ Z3LI┬ routine≤ t∩ acces≤ thesσ ámessages¼ áyou≥ ì
  1720. prograφ shoulΣ ensurσ tha⌠ thσ messagσ buffe≥ i≤ availablσ t∩ it«  ì
  1721. Thi≤ ácaε easil∙ bσ donσ b∙ callinτ thσ GETMS╟ routinσ á(seσ áthσ ì
  1722. screeε oε thσ  ZCPR│ environment)«  GETMS╟ return≤ witΦ thσ ázer∩ ì
  1723. flaτ se⌠ (Z⌐ iµ n∩ ZCPR│ messagσ buffe≥ exists«  Hence:
  1724.                EX╘       GETMS╟              ; declare the routine
  1725.                ...
  1726.                CALL      GETMSG              ; get message buffer status
  1727.                JR        Z,NOZ3MSGS          ; ..jump if no msgs to read
  1728.                ...
  1729.  
  1730. Thσ áfollowinτ summarize≤ facilitie≤ availablσ througΦ thσ áZCPR│ ì
  1731. messagσ buffer.
  1732.  
  1733. Message≤ whicΦ CommanΣ ZCPR3:é  Somσ oµ thσ message≤ iε thσ áZCPR│ ì
  1734. messagσ ábuffe≥ arσ se⌠ b∙ externa∞ program≤ (transient≤ o≥ ácomì
  1735. manΣ ápackages⌐ áanΣ arσ reaΣ anΣ interpreteΣ áb∙ áZCPR3« á Thesσ ì
  1736. message≤ are:
  1737.    o Curren⌠ I╞ leve∞ anΣ activσ (T/F⌐ statu≤ oµ al∞ I╞ levels
  1738.    o Whethe≥ áaε erro≥ handle≥ i≤ availablσ anΣ wha⌠ thσ ácommanΣ ì
  1739. ááááálinσ t∩ invokσ i⌠ is
  1740.  
  1741. Statu≤ Message≤ Sen⌠ b∙ ZCPR3:é  Somσ oµ thσ message≤ iε thσ ZCPR│ ì
  1742. messagσ ábuffe≥ áarσ se⌠ onl∙ b∙ ZCPR│ o≥ ß ZCPR│ shel∞ áanΣ áarσ ì
  1743. intendeΣ át∩ bσ useΣ a≤ R/╧ message≤ b∙ transients« á Thesσ ámesì
  1744. sage≤ are:
  1745.    o ZCPR│ commanΣ statu≤ ¡¡ thσ transien⌠ loadeΣ i≤ o≥ i≤ no⌠ áß ì
  1746. áááááshell¼ anΣ thσ transien⌠ loadeΣ i≤ o≥ i≤ no⌠ aε erro≥ áhandì
  1747. áááááler
  1748.    o Erro≥ áaddres≤ ¡¡ iµ thσ transien⌠ loadeΣ i≤ aε erro≥ áhandì
  1749. áááááler¼ thi≤ i≤ thσ addres≤ oµ thσ firs⌠ characte≥ oµ thσ ácomì
  1750. ááááámanΣ linσ whicΦ wa≤ iε error
  1751.  
  1752. ZE╪ áCommanΣ Messages:é  Onσ messagσ iε thσ ZCPR│ messagσ ábuffer≤ ì
  1753. i≤ áintendeΣ át∩ directl∙ senΣ command≤ t∩ thσ áZE╪ ámemor∙-baseΣ ì
  1754. commanΣ áfilσ processor«  Thi≤ messagσ bytσ tell≤ ZE╪ threσ ádifì
  1755. feren⌠ things:
  1756.    o Ruε normall∙ ¡¡ ZE╪ i≤ t∩ intercep⌠ inpu⌠ call≤ anΣ áprovidσ ì
  1757. ááááácharacter≤ iε placσ oµ consolσ input
  1758.    o ZCPR│ i≤ promptinτ ¡¡ ZE╪ i≤ providinτ inpu⌠ directl∙ t∩ thσ ì
  1759. ááááácommanΣ processo≥ ZCPR3
  1760.    o SuspenΣ áintercep⌠ á¡¡ ZE╪ i≤ t∩ sto≡ áinterceptinτ áconsolσ ì
  1761. áááááinpu⌠ áanΣ allo≈ inpu⌠ froφ thσ consolσ unti∞ norma∞ áexecuì
  1762. ááááátioε o≥ thσ ZCPR│ promp⌠ appears
  1763.  
  1764. Message≤ IgnoreΣ b∙ ZCPR3:é  Tw∩ prσ-defineΣ message≤ arσ áignoreΣ ì
  1765. b∙ ZCPR3«  Thσ firs⌠ i≤ thσ prograφ erro≥ code«  Thi≤ bytσ caε bσ ì
  1766. se⌠ b∙ an∙ prograφ unde≥ ZCPR│ t∩ indicatσ ß returε statu≤ t∩ thσ ì
  1767. nex⌠ program«  Thσ conventioε ha≤ beeε adopteΣ tha⌠ iµ thi≤ ábytσ ì
  1768. i≤ á0¼ átheε thσ prograφ completeΣ successfully«  Iµ i⌠ ái≤ ánoε-ì
  1769. zero¼ áthσ prograφ faileΣ fo≥ somσ reasoε anΣ thσ valuσ áoµ áthi≤ ì
  1770. codσ indicate≤ tha⌠ reasoε t∩ ß followinτ program.
  1771.  
  1772. Thσ áseconΣ messagσ i≤ thσ registe≥ buffer«  Teε onσ-bytσ áregi≤ìèter≤ arσ availablσ anΣ caε bσ testeΣ b∙ thσ Flo≈ CommanΣ Package«  ì
  1773. Condition≤ álikσ "I╞ ░ 5ó (I╞ Registe≥ ░ ╜ 5⌐ caε bσ átesteΣ áanΣ ì
  1774. processeΣ áb∙ thσ Flo≈ Command Package¼ anΣ othe≥ transien⌠ ápr∩ì
  1775. gram≤ o≥ residen⌠ commanΣ package≤ caε manipulatσ thesσ áregiste≥ ì
  1776. values.
  1777.  
  1778. Use≥-DefineΣ áMessages:é  ┴ se⌠ oµ 1╢ message≤ arσ áavailablσ áfo≥ ì
  1779. use≥ ádefinition«  EacΦ messagσ i≤ onσ bytσ long¼ anΣ Z3LI┬ árouì
  1780. tine≤ arσ provideΣ t∩ placσ value≤ int∩ thesσ message≤ anΣ áquer∙ ì
  1781. them.
  1782.  
  1783. ReserveΣ Messages:é  ┴ se⌠ oµ 1╢ onσ-bytσ message≤ i≤ reserveΣ fo≥ ì
  1784. futurσ usσ iε thσ ZCPR│ systeφ anΣ shoulΣ no⌠ bσ useΣ b∙ applicaì
  1785. tion≤ áprogrammers«  Z3LI┬ doe≤ no⌠ providσ acces≤ t∩ thesσ ámesì
  1786. sages.
  1787.  
  1788. COMMAN─ STATU╙ MESSAGE:é  Thesσ message≤ returε thσ statu≤ oµ áthσ ì
  1789. curren⌠ átransien⌠ a≤ se⌠ b∙ ZCPR3«  An∙ transien⌠ ha≤ ábeeε áinì
  1790. vokeΣ iε onσ oµ threσ possiblσ states:
  1791.      1.A≤ ß "normaló transient¼ executeΣ a⌠ thσ reques⌠ oµ áthσ ì
  1792. use≥ o≥ anothe≥ program
  1793.      2.A≤ ß "shell"¼ invokeΣ b∙ ZCPR│ itself
  1794.      3.A≤ áaε "erro≥ handler"¼ invokeΣ b∙ ZCPR│ itselµ wheε ái⌠ ì
  1795. canno⌠ áproces≤ thσ curren⌠ commanΣ linσ (canno⌠ finΣ ß ámatchinτ ì
  1796. CO═ filσ o≥ CMDRU╬ facility)
  1797.  
  1798.      Routine║   GETCST
  1799.      Function║ Return the ZCPR3 command status message
  1800.      Entry:    None
  1801.      Exit:     A = message code (zero flag set accordingly)
  1802.      Affected: AF
  1803.      Usage:    Return≤ thσ ZCPR│ commanΣ statu≤ messagσ whicΦ ái≤ ì
  1804. áááááááááááááááalway≤ se⌠ b∙ ZCPR│ anΣ no⌠ intendeΣ t∩ bσ se⌠ áb∙ ì
  1805. áááááááááááááááan∙ program«  I⌠ caε havσ onσ oµ threσ values:
  1806.                     0 = this is a "normal" transient
  1807.                     1 = this is a "shell"
  1808.                     2 = this is an "error handler"
  1809.  
  1810.      Routine║   PUTCST
  1811.      Function║ Set the ZCPR3 command status message
  1812.      Entry:    A = ZCPR3 command status message value (0, 1, or 2)
  1813.      Exit:     None
  1814.      Affected: None
  1815.      Usage:    ProvideΣ t∩ allo≈ ß ZCPR│ shel∞ prograφ t∩ se⌠ thσ ì
  1816. áááááááááááááááZCPR│ ácommanΣ ástatu≤ messagσ byte« á I⌠ ái≤ áno⌠ ì
  1817. áááááááááááááááintendeΣ fo≥ genera∞ usσ b∙ applicatioε áprograms«  ì
  1818. áááááááááááááááAllowablσ ávalue≤ fo≥ thσ commanΣ ástatu≤ ámessagσ ì
  1819. áááááááááááááááare:
  1820.                     0 = this is a "normal" transient
  1821.                     1 = this is a "shell"
  1822.                     2 = this is an "error handler"
  1823. .pa
  1824. è     Routine║   QERROR
  1825.      Function║ Test command status message for error handler
  1826.      Entry:    None
  1827.      Exit:     A = message code
  1828.                Zer∩ áse⌠ á(Z⌐ iµ transien⌠ i≤ aε áerro≥ áhandler¼ ì
  1829. áááááááááááááááelsσ clea≥ (NZ)
  1830.      Affected: AF
  1831.      Usage:    UseΣ áa≤ ß quicδ tes⌠ t∩ seσ iµ thσ ZCPR│ ácommanΣ ì
  1832. ááááááááááááááástatu≤ messagσ indicate≤ tha⌠ thσ curren⌠ átransiì
  1833. áááááááááááááááen⌠ i≤ aε erro≥ handler«  Thσ ZCPR│ commanΣ statu≤ ì
  1834. ááááááááááááááámessagσ i≤ reaΣ anΣ testeΣ agains⌠ thσ erro≥ handì
  1835. ááááááááááááááále≥ codσ value«   Zer∩ flaτ i≤ se⌠ iµ thσ ácurren⌠ ì
  1836. ááááááááááááááátransien⌠ i≤ aε erro≥ handler.
  1837.  
  1838.      Routine║   QSHELL
  1839.      Function║ Test command status message for shell transient
  1840.      Entry:    None
  1841.      Exit:     A = message code
  1842.                Zero set (Z) if transient is shell
  1843.      Affected: AF
  1844.      Usage:    UseΣ áa≤ ß quicδ tes⌠ t∩ seσ iµ thσ ZCPR│ ácommanΣ ì
  1845. ááááááááááááááástatu≤ messagσ indicate≤ tha⌠ thσ curren⌠ átransiì
  1846. áááááááááááááááen⌠ i≤ ß shell«  Thσ ZCPR│ commanΣ statu≤ ámessagσ ì
  1847. ááááááááááááááái≤ áreaΣ anΣ testeΣ agains⌠ thσ shel∞ codσ ávalue«  ì
  1848. áááááááááááááááZer∩ áflaτ ái≤ se⌠ iµ thσ curren⌠ transien⌠ ái≤ áß ì
  1849. áááááááááááááááshell.
  1850.  
  1851. ERRO╥ FLA╟ AN─ ERRO╥ COMMAND:é  Thi≤ se⌠ oµ routine≤ perform≤ áthσ ì
  1852. followinτ functions:
  1853.      ERRADRÅ¡-return≤ thσ addres≤ oµ thσ firs⌠ characte≥ oµ áthσ ì
  1854. áááááááááácommanΣ linσ iε error
  1855.      GETER1 -- returns the error flag
  1856.      PUTER1 -- sets the error flag
  1857.      GETERCÅ¡-return≤ thσ addres≤ oµ thσ firs⌠ characte≥ oµ áthσ ì
  1858. ááááááááááerro≥ handle≥ commanΣ line
  1859.      PUTERC -- set the error handler command line
  1860.  
  1861.      Routine║   ERRADR
  1862.      Function: Oε erro≥ returε firs⌠ characte≥ oµ erroreΣ commanΣ ì
  1863. áááááááááááááááline
  1864.      Entry:    None
  1865.      Exit:     HL = address of first character of error line
  1866.      Affected: HL
  1867.      Usage:    Assuminτ átha⌠ thσ curren⌠ transien⌠ i≤ áaε áerro≥ ì
  1868. áááááááááááááááhandler¼ (cal∞ t∩ QERRO╥ returninτ witΦ zer∩ áflaτ ì
  1869. áááááááááááááááset)¼ áthi≤ ároutinσ return≤ thσ áaddres≤ áoµ áthσ ì
  1870. áááááááááááááááfirs⌠ ácharacte≥ oµ thσ commanΣ linσ whicΦ wa≤ áiε ì
  1871. áááááááááááááááerror«  Fo≥ example¼ iµ thσ command:
  1872.                     xxx params;dir
  1873.                i≤ áissueΣ áanΣ XXX.CO═ canno⌠ ábσ áfound¼ áERRAD╥ ì
  1874. áááááááááááááááreturn≤ áthσ addres≤ oµ thσ firs⌠ characte≥ á("X"⌐ ì
  1875. áááááááááááááááoµ thσ string:
  1876.                     DEF┬      'XXX PARAMS;DIR',0
  1877. .pa
  1878. è     Routine║   GETER1
  1879.      Function║ Return error flag
  1880.      Entry:    None
  1881.      Exit:     A <> 0, zero flag clear (NZ) if error present
  1882.                A = 0, zero set (Z) if no error
  1883.      Affected: AF
  1884.      Usage:    Return≤ áthσ áerro≥ flaτ iε A« á GETER▒ áha≤ ábeeε ì
  1885. áááááááááááááááredefineΣ froφ thσ origina∞ purposσ oµ determininτ ì
  1886. áááááááááááááááerro≥ áhandle≥ presencσ anΣ no≈ onl∙ áreturn≤ áthσ ì
  1887. ááááááááááááááávaluσ oµ thσ erro≥ flag.
  1888.  
  1889.      Routine║   PUTER1
  1890.      Function: Engagσ anΣ disengagσ erro≥ handle≥ flaτ [n∩ longe≥ ì
  1891. áááááááááááááááused]
  1892.      Entry:    None
  1893.      Exit:     None
  1894.      Affected: None
  1895.      Usage:    Thi≤ ároutinσ án∩ longe≥ perform≤ ß áfunctioε áanΣ ì
  1896. ááááááááááááááásimpl∙ return≤ t∩ thσ callinτ program.
  1897.  
  1898.      Routine║   GETERC
  1899.      Function║ Return address of string invoking error handler
  1900.      Entry:    None
  1901.      Exit:     HL = address of first character of string invoking error handler
  1902.                A <> 0, zero flag clear (NZ) if valid character
  1903.                A = 0 and zero flag set if string is empty
  1904.      Affected: AF¼ HL
  1905.      Usage:    Facilitate≤ erro≥ handle≥ constructioε b∙ áreturnì
  1906. áááááááááááááááinτ áthσ strinτ addres≤ anΣ firs⌠ ácharacter« á Iµ ì
  1907. áááááááááááááááthσ erro≥ handle≥ i≤ t∩ bσ invokeΣ b∙ thσ command:
  1908.                     error params
  1909.                theε GETER├ return≤ thσ addres≤ oµ thσ firs⌠ charì
  1910. áááááááááááááááacte≥ of:
  1911.                     DEF┬      'ERROR PARAMS',0
  1912.  
  1913.      Routine║   PUTERC
  1914.      Function║ Set the error handler command line
  1915.      Entry:    H╠ á╜ addres≤ oµ firs⌠ characte≥ oµ erro≥ áhandle≥ ì
  1916. ááááááááááááááácommanΣ line
  1917.      Exit:     A <> 0, zero flag clear (NZ) if OK
  1918.                ┴ ╜ 0¼ zer∩ flaτ se⌠ (Z⌐ iµ commanΣ linσ to∩ álonτ ì
  1919. ááááááááááááááá(morσ thaε 3▓ bytes)
  1920.      Affected: AF
  1921.      Usage:    Establishe≤ áß strinτ whicΦ i≤ t∩ bσ áthσ ácommanΣ ì
  1922. ááááááááááááááálinσ áexecuteΣ át∩ invokσ aε erro≥ áhandler« á Thσ ì
  1923. áááááááááááááááerro≥ ástring¼ includinτ thσ endinτ 0¼ mus⌠ bσ á3▓ ì
  1924. ááááááááááááááábyte≤ lonτ o≥ less.
  1925.      Example:
  1926.                          EX╘       PUTER├         ; declare the routine
  1927.                          ...                      ; ..preceeding code
  1928.                          LD        HL,ERSTR       ; address this string
  1929.                          CAL╠      PUTER├         ╗ se⌠ i⌠ a≤ handle≥ comnΣ line
  1930.                          JR        NZ,OK          ; ..jump if string accepted
  1931.                          ...                      ; else take other action
  1932.                ERSTR:    DEFB      'ERROR NOOPT',0
  1933. è
  1934. INTE╥-TRANSIEN╘ ERRO╥ CODE:é  Thσ inte≥-transien⌠ erro≥ codσ i≤ áß ì
  1935. onσ-bytσ ámessagσ whicΦ an∙ prograφ caε se⌠ t∩ indicatσ it≤ ácomì
  1936. pletioε success«  Thσ conventioε i≤ tha⌠ iµ thi≤ messagσ bytσ ái≤ ì
  1937. se⌠ t∩ 0¼ theε thσ prograφ completeΣ successfully«  Iµ thi≤ ámesì
  1938. sagσ ábytσ i≤ no⌠ 0¼ theε thσ prograφ haΣ aε erro≥ anΣ thσ ávaluσ ì
  1939. oµ thi≤ messagσ bytσ indicate≤ thσ error.
  1940.  
  1941. GETER▓ áallow≤ áß prograφ t∩ determinσ thσ valuσ oµ áthi≤ áinte≥-ì
  1942. transien⌠ erro≥ codσ anΣ PUTER▓ allow≤ ß prograφ t∩ se⌠ thσ valuσ ì
  1943. oµ thσ inte≥-transien⌠ erro≥ code.
  1944.  
  1945.      Routine║   GETER2
  1946.      Function║ Return the value of inter-transient error code
  1947.      Entry:    None
  1948.      Exit:     A = error code, zero clear (NZ) if error
  1949.                A = 0, zero flag set (Z) if no error
  1950.      Affected: AF
  1951.      Usage:    Determine≤ iµ ß preceedinτ prograφ passeΣ aε erro≥ ì
  1952. ááááááááááááááát∩ thi≤ onσ iε thσ inte≥-transien⌠ erro≥ code.
  1953.  
  1954.      Routine║   PUTER2
  1955.      Function║ Set inter-transient error code
  1956.      Entry:    A = error code (0 for no error)
  1957.      Exit:     None
  1958.      Affected: None
  1959.      Usage:    Signal≤ áfollowinτ program≤ tha⌠ n∩ áerro≥ ástatu≤ ì
  1960. áááááááááááááááresulteΣ froφ thσ presentl∙-executinτ transient.
  1961.  
  1962. COMMAN─ ERRO╥ FLA╟ AN─ HANDLER:
  1963.  
  1964.      Routine║   GETER3
  1965.      Function║ Return the value of the command error flag
  1966.      Entry:    None
  1967.      Exit:     A <> 0, zero clear (NZ) if message exists
  1968.                A = 0, zero set (Z) if no message
  1969.      Affected: AF
  1970.      Usage:    Mos⌠ áofteε áuseΣ b∙ erro≥ áhandler≤ át∩ áidentif∙ ì
  1971. áááááááááááááááwhethe≥ o≥ no⌠ aε erro≥ occurred«  Iµ aε erro≥ ái≤ ì
  1972. ááááááááááááááádetecteΣ froφ thσ commanΣ erro≥ flag¼ thσ ámessagσ ì
  1973. ááááááááááááááábuffer≤ ma∙ bσ useΣ t∩ pas≤ additiona∞ informatioε ì
  1974. áááááááááááááááoε thσ causσ anΣ action.
  1975.  
  1976.      Routine║   PUTER3
  1977.      Function║ Set the command error flag
  1978.      Entry:    A = value to set command error flag
  1979.      Exit:     None; value is stored in command error flag
  1980.      Affected: None
  1981.      Usage:    Set≤ áthσ commanΣ erro≥ flaτ fo≥ possiblσ áinvocaì
  1982. ááááááááááááááátioε oµ aε erro≥ handler«  Additiona∞ áinformatioε ì
  1983. áááááááááááááááma∙ bσ passeΣ iε othe≥ messagσ buffers.
  1984.      Example:
  1985.                          EX╘       PUTER│         ; declare the routine
  1986.                          ...
  1987.                ISERR:    LD        A,0FFH         ; signal error occurrance
  1988. è                         JR        ERRV           ; ..with command error flag
  1989.                NOERR:    XOR       A              ; enter here to set no errs
  1990.                ERRV:     CALL      PUTER3         ; ..set/clear comnd err flag
  1991.                          ...                      ; continue
  1992.  
  1993.      Routine║   INVERROR
  1994.      Function║ Invoke error handler
  1995.      Entry:    A = 0 for internal errors
  1996.                A <> 0 for external errors
  1997.                ┬ ╜ erro≥ codσ fo≥ externa∞ errors¼ undefineΣ áfo≥ ì
  1998. áááááááááááááááinterna∞ errors
  1999.      Exit:     A = ░ iµ erro≥ i≤ interna∞ t∩ ZCPR 3.3
  2000.                A <> ░ iµ erro≥ i≤ externa∞ t∩ ZCPR 3.3
  2001.      Affected: AF¼ DE¼ HL
  2002.      Usage:    Set≤ áal∞ parameter≤ fo≥ aε erro≥ handle≥ áinvocßì
  2003. ááááááááááááááátion«  I⌠ i≤ normall∙ useΣ jus⌠ prio≥ t∩ ß prograφ ì
  2004. áááááááááááááááabor⌠ t∩ eithe≥ thσ commanΣ processo≥ o≥ t∩ ß warφ ì
  2005. áááááááááááááááboot.
  2006.      Example:
  2007.                          EX╘       INVERRO╥       ; declare the routine
  2008.                          ...                      ; ..pgm flow w/detected error
  2009.                          LD        A,(ERRCODE)    ; get error code (if external)
  2010.                          LD        B,A            ; ..and put in correct register
  2011.                          LD        A,(ERRTYPE)    ; load the error type
  2012.                          CALL      INVERROR       ; call the routine
  2013.                          JP        NZ,0           ; ..jump warm boot if no ZCPR33
  2014.                          ...                      ; else return to command proc
  2015.  
  2016. COMMAN─ STATU╙ FLAG:
  2017.  
  2018.      Routine║   SETEPB
  2019.      Function║ Set external program bit in command status flag
  2020.      Entry:    None
  2021.      Exit:     None
  2022.      Affected: None
  2023.      Usage:    Set≤ thσ externa∞ prograφ bi⌠ iε thσ commanΣ statì
  2024. áááááááááááááááu≤ áflaτ t∩ signif∙ t∩ thσ ZCP╥ 3.│ o≥ late≥ ácomì
  2025. ááááááááááááááámanΣ processo≥ tha⌠ curren⌠ action≤ (sucΦ a≤ parsì
  2026. áááááááááááááááing⌐ i≤ beinτ requesteΣ b∙ aε externa∞ program.
  2027.  
  2028.      Routine║   RESEPB
  2029.      Function║ Reset external program bit in command status flag
  2030.      Entry:    None
  2031.      Exit:     None
  2032.      Affected: None
  2033.      Usage:    Reset≤ áthσ áexterna∞ prograφ bi⌠ iε áthσ ácommanΣ ì
  2034. ááááááááááááááástatu≤ áflaτ indicatinτ t∩ thσ ZCP╥ 3.│ áo≥ álate≥ ì
  2035. ááááááááááááááácommanΣ áprocesso≥ tha⌠ an∙ action≤ therσ arσ áinì
  2036. áááááááááááááááterna∞ anΣ no⌠ relateΣ t∩ aε externa∞ program.
  2037. .pa
  2038. è     Routine║   RETCST
  2039.      Function║ Return the address of the command status flag
  2040.      Entry:    None
  2041.      Exit:     HL = address of the command status flag
  2042.      Affected: HL
  2043.      Usage:    Return≤ áthσ addres≤ oµ thσ commanΣ ástatu≤ áflag«  ì
  2044. áááááááááááááááI⌠ ái≤ useΣ b∙ SETEPB¼ RESEPB¼ anΣ othe≥ áinterna∞ ì
  2045. ááááááááááááááámodules.
  2046.  
  2047. REGISTE╥ ACCESS:é  Thσ ZCPR│ messagσ buffe≥ provide≤ teε áonσ-bytσ ì
  2048. message≤ áwhicΦ arσ useΣ a≤ onσ-bytσ registers«  Thσ áGETRE╟ áanΣ ì
  2049. PUTRE╟ routine≤ allo≈ ß prograφ t∩ obtaiε anΣ se⌠ ß valuσ iε áan∙ ì
  2050. onσ oµ thσ teε registers.
  2051.  
  2052.      Routine║   GETREG
  2053.      Function║ Return contents of specified message buffer
  2054.      Entry:    B = number of register to access (0..9)
  2055.      Exit:     A = value of register, zero flag set accordingly
  2056.      Affected: AF
  2057.      Usage:    UseΣ át∩ obtaiε thσ content≤ oµ aε arbitrar∙ ámesì
  2058. ááááááááááááááásagσ ábuffer« á Thesσ ábuffer≤ áarσ ábytσ ávalues«  ì
  2059. áááááááááááááááGETRE╟ perform≤ n∩ validit∙ checδ oε thσ specifieΣ ì
  2060. áááááááááááááááregiste≥ number¼ merel∙ usinτ i⌠ a≤ aε inde° áint∩ ì
  2061. áááááááááááááááthσ ámessagσ buffe≥ array«  Yo⌡ mus⌠ áinsurσ átha⌠ ì
  2062. áááááááááááááááonl∙ value≤ iε thσ rangσ oµ 0..╣ arσ passed.
  2063.      Example:
  2064.                          EX╘       GETREG         ; declare the routine
  2065.                          ...                      ; ..preceeding code
  2066.                          LD        B,5            ; get the value of reg 5
  2067.                          CALL      GETREG         ; return reg 5 value byte
  2068.                          JR        Z,R5EQ0        ; ..jump to process if 0
  2069.                          ...                      ; else check more, etc
  2070.  
  2071.      Routine║   PUTREG
  2072.      Function: Se⌠ áß specifieΣ messagσ buffe≥ registe≥ t∩ ágiveε ì
  2073. ááááááááááááááávalue
  2074.      Entry:    B = register number to set (0 to 9)
  2075.                A = value to set in register (0 to 255)
  2076.      Exit:     None
  2077.      Affected: None
  2078.      Usage:    Set≤ áß áspecifieΣ messagσ buffe≥ áregiste≥ át∩ áß ì
  2079. ááááááááááááááágiveε valuσ whicΦ ma∙ bσ testeΣ b∙ othe≥ programs«  ì
  2080. áááááááááááááááN∩ checδ i≤ madσ t∩ ensurσ tha⌠ ┬ contain≤ ß valiΣ ì
  2081. áááááááááááááááregiste≥ number«  Yo⌡ mus⌠ insurσ tha⌠ iε contain≤ ì
  2082. áááááááááááááááonl∙ value≤ froφ ░ t∩ 9.
  2083.      Example:
  2084.                          EX╘       PUTREG         ; declare the routine
  2085.                          ...                      ; ..preceeding code
  2086.                          LD        B,9            ; set message register 9
  2087.                          LD        A,20           ; ..to 20
  2088.                          CALL      PUTREG         ; do it
  2089.                          ...                      ; ..and continue
  2090. .pa
  2091. èDEFAUL╘ DRIVE/USE╥ BUFFER:
  2092.  
  2093.      Routine║   GDEFDU
  2094.      Function║ Return current drive and user
  2095.      Entry:    None
  2096.      Exit:     BC = DU; B=drive (0=A..15=P), C = user number
  2097.      Affected: BC
  2098.      Usage:    Return≤ áthσ curren⌠ drivσ anΣ use≥ setting≤ áfroφ ì
  2099. áááááááááááááááthσ áZCP╥ á3.│ messagσ buffe≥ fo≥ usσ áb∙ áthσ áC─ ì
  2100. ááááááááááááááá(changσ directory⌐ routine¼ shells¼ o≥ wheε ß use≥ ì
  2101. ááááááááááááááánumbe≥ ágreate≥ áthaε 1╡ i≤ logged«  Thi≤ ái≤ áthσ ì
  2102. ááááááááááááááápreferreΣ ámethoΣ oµ logginτ int∩ higΦ use≥ áarea≤ ì
  2103. ááááááááááááááásincσ thσ CURDR╓ bytσ a⌠ locatioε ┤ onl∙ áaccommoì
  2104. ááááááááááááááádate≤ user≤ froφ ░ througΦ 15.
  2105.  
  2106.      Routine║   PDEFDU
  2107.      Function║ Make specified drive and user current
  2108.      Entry:    BC = DU; B=drive (0=A..15=P), C=user (0..31) to set
  2109.      Exit:     None; CURDR and CURUSR are set to specified values
  2110.      Affected: None
  2111.      Usage:    Store≤ specifieΣ drivσ anΣ use≥ value≤ int∩ áCURD╥ ì
  2112. áááááááááááááááanΣ CURUS╥ location≤ iε thσ ZCPR│ messagσ ábuffer¼ ì
  2113. áááááááááááááááthereb∙ makinτ theφ current«  I⌠ i≤ normall∙ áuseΣ ì
  2114. áááááááááááááááwheε drivσ anΣ use≥ arσ obtaineΣ froφ patΦ áspeciì
  2115. áááááááááááááááfication≤ t∩ signa∞ shell≤ o≥ erro≥ handler≤ wherσ ì
  2116. áááááááááááááááactivitie≤ occurred.
  2117.  
  2118. ZCPR│ UTILITIES:é  Thesσ utilitie≤ providσ ß numbe≥ oµ áconvenien⌠ ì
  2119. function≤ fo≥ ZCPR│ programmers«  Acces≤ t∩ directories¼ áconverì
  2120. sioε áfroφ tex⌠ strinτ name≤ t∩ director∙ referencσ values¼ ácomì
  2121. manΣ anΣ commanΣ linσ parsing¼ quie⌠ outpu⌠ routines¼ shel∞ stacδ ì
  2122. manipulation¼ dela∙ routines¼ anΣ othe≥ ZCPR│-specifiπ áfunction≤ ì
  2123. arσ provided.
  2124.  
  2125. NAME─ DIRECTORY-DRIVE/╒SER CONVERSION:
  2126.  
  2127.      Routine║   DIRTDU
  2128.      Function║ Convert specified DIR name to DU equivalent
  2129.      Entry:    HL = address of first character of DIR name
  2130.      Exit:     HL = points to delimiter at end of name
  2131.                BC = DU, B=disk (0=A..15=P), C=user (0..31)
  2132.                A <> 0, zero flag clear (NZ) if found
  2133.                A = 0, zero flag set (Z) if not found
  2134.      Affected: AF¼ BC¼ HL
  2135.      Usage:    Convert≤ áß DI╥ namσ consistinτ oµ ß strinτ oµ áu≡ ì
  2136. ááááááááááááááát∩ áeigh⌠ character≤ terminateΣ b∙ áan∙ ácharacte≥ ì
  2137. áááááááááááááááothe≥ thaε ß digi⌠ o≥ lette≥ t∩ it≤ D╒ áequivalen⌠ ì
  2138. áááááááááááááááfounΣ iε thσ nameΣ director∙ buffer.
  2139. .pa
  2140. è     Routine║   DUTDIR
  2141.      Function║ Convert specified DU to DIR equivalent
  2142.      Entry:    BC = DU, B=disk (0=A..15=P), C=user (0..31)
  2143.      Exit:     HL = pointer to 8-character name string
  2144.                A <> 0, zero flag clear (NZ) if found
  2145.                A = 0, zero flag set (Z) if not found
  2146.      Affected: AF¼ HL
  2147.      Usage:    Searche≤ thσ nameΣ director∙ fo≥ thσ specifieΣ DU«  ì
  2148. áááááááááááááááIµ áaε áentr∙ exist≤ fo≥ thσ correspondinτ áDU¼ áß ì
  2149. ááááááááááááááápointe≥ i≤ returneΣ t∩ thσ ╕-characte≥ namσ á(folì
  2150. áááááááááááááááloweΣ b∙ aε ╕-characte≥ password).
  2151.  
  2152. RESOLV┼ DIRECTOR┘ REFERENCES:
  2153.  
  2154.      Routine║   DNSCAN
  2155.      Function║ Resolve directory name using both DU and DIR
  2156.      Entry:    H╠ á╜ addres≤ oµ thσ firs⌠ characte≥ oµ ádirector∙ ì
  2157. áááááááááááááááname
  2158.                A = 0 (scan DU before DIR)
  2159.                A <> 0 (scan DIR before DU)
  2160.      Exit:     BC = DU, B=disk (0=A..15=P), C=user (0..31)
  2161.                A <> 0, zero flag clear (NZ) if found
  2162.                A = 0, zero flag set (Z) if not found
  2163.      Affected: AF¼ BC
  2164.      Usage:    Attempt≤ t∩ resolvσ ß candidatσ director∙ namσ áb∙ ì
  2165. ááááááááááááááácheckinτ ábotΦ áDI╥ anΣ D╒ áformat≤ áiε áspecifieΣ ì
  2166. áááááááááááááááorder« á Thσ ácandidatσ namσ ma∙ bσ áu≡ át∩ áeigh⌠ ì
  2167. ááááááááááááááácharacter≤ áterminateΣ áb∙ ß delimite≥ sucΦ áa≤ áß ì
  2168. áááááááááááááááspace¼ comma¼ period¼ dash¼ ß characte≥ les≤ áthaε ì
  2169. áááááááááááááááspace¼ etc«  Iµ found¼ thσ D╒ i≤ returneΣ iε BC.
  2170.  
  2171.      Routine║   DUSCAN
  2172.      Function║ Resolve addressed string in DU form
  2173.      Entry:    HL = address of string (up to 8 characters)
  2174.      Exit:     BC = DU, B=disk (0=A..15=P), C=user (0..31)
  2175.                A <> 0, zero flag clear (NZ) if valid DU form
  2176.                A = 0, zero flag set (Z) if not valid
  2177.      Affected: AF¼ BC
  2178.      Usage:    Resolve≤ thσ D╒ forφ oµ ß strinτ addresseΣ b∙ áHL«  ì
  2179. áááááááááááááááThσ áD╒ strinτ i≤ storeΣ iε ß buffe≥ u≡ át∩ áeigh⌠ ì
  2180. ááááááááááááááácharacter≤ long¼ anΣ i≤ terminateΣ b∙ ß delimiter¼ ì
  2181. áááááááááááááááwhicΦ ma∙ bσ ß characte≥ les≤ thaε ß space¼ áequa∞ ì
  2182. ááááááááááááááásigε á(=)¼ underscorσ (_)¼ perioΣ (.)¼ commß á(,)¼ ì
  2183. áááááááááááááááles≤ thaε (<)¼ o≥ greate≥ thaε (>).
  2184.  
  2185.      Routine║   DIRSCAN
  2186.      Function║ Resolve addressed strinτ in DIR form
  2187.      Entry:    HL = address of string (up to 8 characters)
  2188.      Exit:     BC = DU, B=disk (0=A..15=P), C=user (0..31)
  2189.                A <> 0, zero flag clear (NZ) if valid DU form
  2190.                A = 0, zero flag set (Z) if not valid
  2191.      Affected: AF¼ BC
  2192.      Usage:    Resolve≤ thσ DI╥ forφ oµ ß strinτ addresseΣ b∙ HL«  ì
  2193. áááááááááááááááThσ áD╒ strinτ i≤ storeΣ iε ß buffe≥ u≡ át∩ áeigh⌠ ì
  2194. ááááááááááááááácharacter≤ long¼ anΣ i≤ terminateΣ b∙ ß delimiter¼ ìèáááááááááááááááwhicΦ ma∙ bσ ß characte≥ les≤ thaε ß space¼ áequa∞ ì
  2195. ááááááááááááááásigε á(=)¼ underscorσ (_)¼ perioΣ (.)¼ commß á(,)¼ ì
  2196. áááááááááááááááles≤ thaε (<)¼ o≥ greate≥ thaε (>).
  2197.  
  2198. PARS┼ COMMAN─ LINE:
  2199.  
  2200.      Routine║   PARSER
  2201.      Function║ Parse complete command line
  2202.      Entry:    HL = address of command line
  2203.                A = 0 (scan DIR before DU)
  2204.                ┴ <╛ ░ (scan DU before DIR)
  2205.      Exit:     HL = address of next command (0 or leading ;)
  2206.                DE = address of FCB with command name (verb. COM)
  2207.                A = 0, zero flag set (Z) if OK
  2208.                ┴ á╜ numbe≥ oµ questioε marks¼ zer∩ clea≥ (NZ⌐ áiµ ì
  2209. áááááááááááááááverΓ contain≤ onσ o≥ morσ "?ó characters
  2210.      Affected: AF¼ DE¼ HL
  2211.      Usage:    Parse≤ áß completσ commanΣ u≡ t∩ aε endinτ NU╠ áo≥ ì
  2212. ááááááááááááááámultiplσ ácommanΣ linσ delimite≥ (usuall∙ ß ásemiì
  2213. ááááááááááááááácolon)« á I⌠ parse≤ anΣ initialize≤ áal∞ áelement≤ ì
  2214. ááááááááááááááápe≥ thσ ZCPR│ commanΣ convention≤ t∩ includσ áFCB▒ ì
  2215. áááááááááááááááa⌠ á005Ch¼ áFCB▓ a⌠ 006CΦ anΣ thσ ádefaul⌠ ábuffe≥ ì
  2216. ááááááááááááááá(TBUFF⌐ a⌠ 0080h«  Thσ commanΣ namσ i≤ returneΣ iε ì
  2217. áááááááááááááááaε FC┬ addresseΣ b∙ DE.
  2218.  
  2219. PAT╚ SEARC╚ FO╥ FILE:
  2220.  
  2221.      Routine║   PFIND
  2222.      Function║ Search for specified file along search path
  2223.      Entry:    DE = address of an FCB
  2224.                A <> 0 to search current directory
  2225.                ┴ = 0 if no current search
  2226.      Exit:     BC = DU, B=disk (0=A..15=P), C=user (0..31)
  2227.                A <> 0, zero flag clear (NZ) if found
  2228.                A = 0, zero flag set (Z) if not found
  2229.      Affected: AF¼ BC
  2230.      Usage:    Locate≤ ß filσ alonτ thσ ZCPR│ searcΦ path« á Wheε ì
  2231. ááááááááááááááálocated¼ áthσ ádisδ anΣ use≥ wherσ áthσ áfilσ áwa≤ ì
  2232. áááááááááááááááfounΣ arσ returned.
  2233.  
  2234. PROGRA═ LOADIN╟ (CHAINING):
  2235.  
  2236.      Routine║   PRGLOAD
  2237.      Function║ Load and execute specified program (chain)
  2238.      Entry:    DE = address oµ ß filσ contro∞ block
  2239.      Exit:     None
  2240.      Affected: Al∞ áregisters╗ iµ thi≤ routinσ returns¼ theε áthσ ì
  2241. áááááááááááááááloaΣ wa≤ ß failure.
  2242.      Usage:    Thi≤ routinσ i≤ ß "chainó functioε whicΦ load≤ thσ ì
  2243. áááááááááááááááprograφ indicateΣ b∙ thσ firs⌠ 1▓ byte≤ áaddresseΣ ì
  2244. áááááááááááááááb∙ D┼ int∩ memor∙ a⌠ 100Φ anΣ transfer≤ contro∞ t∩ ì
  2245. áááááááááááááááit« á Thσ áloade≥ anΣ FC┬ useΣ fo≥ áthσ áloaΣ áarσ ì
  2246. ááááááááááááááárelocateΣ át∩ ájus⌠ unde≥ áthσ ácommanΣ áprocesso≥ ì
  2247. áááááááááááááááafte≥ PRGLOA─ begin≤ execution¼ s∩ thσ TP┴ i≤ freσ ì
  2248. áááááááááááááááfo≥ thσ load«  Carσ shoulΣ bσ takeε t∩ ensurσ tha⌠ ìèáááááááááááááááthσ systeφ stacδ (locateΣ ou⌠ oµ thσ TP┴ iε ß safσ ì
  2249. áááááááááááááááarea⌐ i≤ useΣ insteaΣ oµ ß stacδ iε thσ TP┴ áwhicΦ ì
  2250. áááááááááááááááma∙ bσ overwritteε durinτ load.
  2251.  
  2252.                Iµ áPRGLOA─ áreturn≤ t∩ thσ ácallinτ áprogram¼ áaε ì
  2253. áááááááááááááááerro≥ iε loadinτ occurred«  Iµ al∞ goe≤ well¼ áthσ ì
  2254. áááááááááááááááloadeΣ prograφ execute≤ successfully.
  2255.  
  2256. CONSOL┼ QUIE╘ OUTPUT:é  Thesσ routine≤ outpu⌠ thei≥ value≤ onl∙ iµ ì
  2257. thσ quie⌠ flaτ i≤ clea≥ (0)«  Iµ thσ quie⌠ flaτ i≤ TRU┼ (no⌠ á0)¼ ì
  2258. theε n∩ value≤ arσ output.
  2259.  
  2260. This class of routines includes the following:
  2261.      QCOUT -¡ console character output with control
  2262.      QCRLF -¡ new line
  2263.      QOUT -¡ console character output
  2264.      QPRINT -- string output (return address)
  2265.      QPSTR -- string output (HL)
  2266.  
  2267.      Routine║   QCOUT
  2268.      Function║ Print character on console if not quiet
  2269.      Entry:    A = character to print
  2270.      Exit:     None
  2271.      Affected: None
  2272.      Usage:    Compariblσ t∩ thσ SYSLI┬ COU╘ routine¼ excep⌠ tha⌠ ì
  2273. ááááááááááááááái⌠ onl∙ print≤ iµ thσ quie⌠ flaτ i≤ off« á Contro∞ ì
  2274. ááááááááááááááácharacter≤ arσ printeΣ a≤ ß care⌠ (^⌐ followeΣ áb∙ ì
  2275. áááááááááááááááthσ characte≥ offse⌠ b∙ 40Φ (▒ output≤ a≤ ^A).
  2276.  
  2277.      Routine║   QCRLF
  2278.      Function║ Print a new line (CR/LF pair) if not quiet
  2279.      Entry:    None
  2280.      Exit:     Nonσ
  2281.      Affected: None
  2282.      Usage:    Correspond≤ t∩ thσ SYSLI┬ CRL╞ routinσ excep⌠ tha⌠ ì
  2283. áááááááááááááááiε ái≤ onl∙ sen⌠ t∩ thσ consolσ iµ thσ quie⌠ áflaτ ì
  2284. ááááááááááááááái≤ ofµ (0).
  2285.  
  2286.      Routine║   QOUT
  2287.      Function: Prin⌠ withou⌠ contro∞ characte≥ processinτ iµ áno⌠ ì
  2288. áááááááááááááááquiet
  2289.      Entry:    A = character to output
  2290.      Exit:     None
  2291.      Affected: None
  2292.      Usage:    Output≤ thσ characte≥ iε ┴ withou⌠ contro∞ characì
  2293. áááááááááááááááte≥ áprocessinτ á(▒ output≤ a≤ binar∙ á1⌐ áiµ áthσ ì
  2294. áááááááááááááááquie⌠ flaτ i≤ ofµ (0).
  2295.  
  2296.      Routine║   QPRINT
  2297.      Function║ Inline print of string if not quiet
  2298.      Entry:    None; string at return address
  2299.      Exit:     None
  2300.      Affected: None
  2301.      Usage:    Print≤ áß NU╠-terminateΣ strinτ whosσ áaddres≤ ái≤ ì
  2302. ááááááááááááááácontaineΣ áoε thσ stacδ to≡ iµ thσ quie⌠ áflaτ ái≤ ìèáááááááááááááááofµ (0)«  Executioε resume≤ a⌠ thσ bytσ áfollowinτ ì
  2303. áááááááááááááááthσ NU╠ afte≥ thσ strinτ i≤ printed.
  2304.  
  2305.      Routine║   QPSTR
  2306.      Function║ Print NUL-terminated string if not quiet
  2307.      Entry:    HL = address of first character of the string
  2308.      Exit:     None
  2309.      Affected: None
  2310.      Usage:    Samσ a≤ QPRIN╘ above¼ excep⌠ tha⌠ printinτ i≤ froφ ì
  2311. áááááááááááááááß registe≥ a≤ opposeΣ thσ inlinσ addres≤ froφ áthσ ì
  2312. ááááááááááááááástack.
  2313.  
  2314. LOCAT┼ ROO╘ DIRECTORY:
  2315.  
  2316.      Routine║   ROOT
  2317.      Function║ Return DU for the last directory in search path
  2318.      Entry:    None
  2319.      Exit:     BC = DU, B=disk (0=A..15=P), C=user (0..31)
  2320.      Affected: BC
  2321.      Usage:    Provide≤ ß convenien⌠ wa∙ t∩ finΣ thσ las⌠ ádirecì
  2322. ááááááááááááááátor∙ áiε ß patΦ expressioε (ROO╘ ádirectory)« á N∩ ì
  2323. ááááááááááááááápatΦ optimizatioε i≤ performed.
  2324.  
  2325.                Thi≤ routinσ i≤ sometime≤ no⌠ consisten⌠ witΦ áthσ ì
  2326. áááááááááááááááZCPR│ ácommanΣ processo≥ iµ thσ MINPAT╚ á(minimizσ ì
  2327. ááááááááááááááápatΦ áexpression⌐ áoptioε i≤ selected« á ROO╘ áadì
  2328. ááááááááááááááávance≤ át∩ áthσ las⌠ referenceΣ director∙ áiε áthσ ì
  2329. ááááááááááááááápatΦ áwithou⌠ minimization¼ whilσ ZCPR│ áminimize≤ ì
  2330. áááááááááááááááthσ ásearcΦ áanΣ ma∙ resolvσ ß patΦ t∩ áenΣ á(witΦ ì
  2331. áááááááááááááááduplication⌐ a⌠ ß director∙ othe≥ thaε thσ áphysiì
  2332. ááááááááááááááácall∙ las⌠ director∙ iε thσ path.
  2333.  
  2334. SHEL╠ STAC╦ ROUTINES:é  Thi≤ se⌠ oµ routine≤ support≤ shel∞ ástacδ ì
  2335. manipulation«  Thσ followinτ routine≤ arσ provided:
  2336.      SHEMPTY -- test to see if shell stack is empty
  2337.      SHFULL -- test to see if shell stack is full
  2338.      SHPOP -- pop top string off of shell stack
  2339.      SHPUSH -- push string onto shell stack
  2340.  
  2341. ┴ shel∞ stacδ i≤ implementeΣ a≤ ß serie≤ oµ string≤ á(recommendeΣ ì
  2342. sizσ ái≤ á3▓ byte≤ pe≥ string¼ anΣ thσ stacδ áshoulΣ ácontaiε áa⌠ ì
  2343. leas⌠ áfou≥ oµ thesσ strings)«  Thσ to≡ elemen⌠ oµ ß shel∞ ástacδ ì
  2344. specifie≤ thσ commanΣ linσ t∩ bσ executeΣ a≤ ß shel∞ b∙ thσ ZCPR│ ì
  2345. commanΣ processor«  Thi≤ commanΣ linσ i≤ copieΣ int∩ thσ multiplσ ì
  2346. commanΣ linσ buffe≥ fo≥ execution.
  2347.  
  2348.      Routine║   SHEMPTY
  2349.      Function║ Return status of shell stack
  2350.      Entry:    None
  2351.      Exit:     A <> 0, zero flag clear (NZ) if not empty
  2352.                A = 0, zero flag set (Z) if empty or none
  2353.      Affected: AF
  2354.      Usage:    Provide≤ áthσ ácurren⌠ statσ oµ thσ áshel∞ ástack«  ì
  2355. áááááááááááááááThσ zer∩ flaτ indicate≤ whethe≥ o≥ no⌠ shel∞ stacδ ì
  2356. áááááááááááááááspacσ i≤ available.
  2357. è
  2358.      Routine║   SHFULL
  2359.      Function║ Determine if the shell stack is full
  2360.      Entry:    None
  2361.      Exit:     A <> 0, zero flag clear (NZ) if stack not full
  2362.                A = 0, zero set (Z) if stack full or none
  2363.      Affected: AF
  2364.      Usage:    Return≤ áß flaτ indicatinτ iµ thσ shel∞ ástacδ ái≤ ì
  2365. áááááááááááááááful∞ o≥ noε-existant.
  2366.  
  2367.      Routine║   SHPOP
  2368.      Function║ Pop top element from shell stack and discard
  2369.      Entry:    None
  2370.      Exit:     A = 0, zero flag set (Z) if OK
  2371.                A = error code, zero clear (NZ):
  2372.                     1 = no shell stack
  2373.                     2 = shell stack empty
  2374.                Affected: AF
  2375.      Usage:    Remove≤ áthσ to≡ elemen⌠ froφ thσ shel∞ stack¼ áiµ ì
  2376. ááááááááááááááápossible¼ anΣ discard≤ it«  Erro≥ code≤ repor⌠ áiµ ì
  2377. áááááááááááááááthσ áoperatioε wa≤ successful¼ o≥ thσ áreasoε áfo≥ ì
  2378. áááááááááááááááthσ error.
  2379.  
  2380.      Routine║   SHPUSH
  2381.      Function║ Push NUL-terminated string onto shell stack
  2382.      Entry:    H╠ ╜ addresse≤ NU╠-terminateΣ strinτ t∩ pusΦ áont∩ ì
  2383. ááááááááááááááástack
  2384.      Exit:     A = 0, zero flag set (Z) if successful
  2385.                A = return code¼ zer∩ clea≥ (NZ):
  2386.                     1 = no shell stack available
  2387.                     2 = shell stack is full
  2388.                     3 = string too long for entry
  2389.      Affected: AF
  2390.      Usage:    Perform≤ áneedeΣ function≤ t∩ pusΦ áNU╠-terminateΣ ì
  2391. ááááááááááááááástring≤ áont∩ áthσ shel∞ stack« á ReturneΣ ástatu≤ ì
  2392. áááááááááááááááshow≤ thσ result≤ oµ thσ action.
  2393.  
  2394. DELA┘ ROUTINES:é  Thσ followinτ routine≤ providσ ß softwarσ ádela∙ ì
  2395. baseΣ áupoε áthσ processo≥ speeΣ valuσ iε thσ áZCPR│ áEnvironmen⌠ ì
  2396. Descriptor«  Thesσ routine≤ simpl∙ dela∙ fo≥ thσ indicateΣ perioΣ ì
  2397. oµ átimσ (approximately⌐ anΣ theε return«  N∩ register≤ áarσ áafì
  2398. fected«  The routines are:
  2399.      WAIT1S -- delay for 1 second
  2400.      WAIT1MS -- delay for 0.001 second
  2401.      WAITP1S -- delay for 0.1 second
  2402.  
  2403.      Routine║   WAIT1S
  2404.      Function║ Wait for approximately one second
  2405.      Entry:    None
  2406.      Exit:     None
  2407.      Affected: None
  2408.      Usage:    Pause≤ áfo≥ approximatel∙ onσ seconΣ baseΣ oε áthσ ì
  2409. áááááááááááááááprocesso≥ áspeeΣ áiε thσ environmen⌠ anΣ áthσ áCP╒ ì
  2410. ááááááááááááááátype.
  2411.  
  2412. è     Routine║   WAIT1MS
  2413.      Function║ Wait for approximately one millisecond
  2414.      Entry:    None
  2415.      Exit:     None
  2416.      Affected: None
  2417.      Usage:    Pause≤ áfo≥ áapproximatel∙ onσ ámilliseconΣ á(.00▒ ì
  2418. ááááááááááááááásecond⌐ baseΣ oε thσ processo≥ speeΣ iε thσ áenviì
  2419. áááááááááááááááronmen⌠ anΣ thσ CP╒ type.
  2420.  
  2421.      Routine║   WAITP1S
  2422.      Function║ Wait for approximately one-tenth second
  2423.      Entry:    None
  2424.      Exit:     None
  2425.      Affected: None
  2426.      Usage:    Pause≤ áfo≥ áapproximatel∙ onσ-tentΦ oµ áß áseconΣ ì
  2427. ááááááááááááááábaseΣ oε thσ processo≥ speeΣ anΣ thσ CP╒ type.
  2428.  
  2429. LO╟ INT╧ ZCPR│ FIL┼ CONTRO╠ ┬LOCK DRIVE/USER:
  2430.  
  2431.      Routine║   Z3LOG
  2432.      Function: Loτ int∩ drive/use≥ containeΣ iε ß specifieΣ ZCPR│ ì
  2433. áááááááááááááááfilσ contro∞ block
  2434.      Entry:    D┼ á╜ addres≤ oµ firs⌠ bytσ oµ ZCPR│ filσ ácontro∞ ì
  2435. áááááááááááááááblock
  2436.      Exit:     None
  2437.      Affected: None
  2438.      Usage:    Log≤ int∩ thσ drivσ anΣ use≥ containeΣ iε ß speciì
  2439. áááááááááááááááfieΣ áZCPR│ filσ contro∞ block«  Thσ drivσ ái≤ áiε ì
  2440. ááááááááááááááábytσ ░ oµ thσ FC┬ (1=A..16=P⌐ anΣ thσ use≥ (0..31⌐ ì
  2441. ááááááááááááááái≤ áiε bytσ 13«  Thi≤ i≤ thσ standarΣ forma⌠ áuseΣ ì
  2442. áááááááááááááááb∙ áZCPR│ át∩ storσ ß completσ D╒ referencσ áiε áß ì
  2443. áááááááááááááááFCB.
  2444.  
  2445. RETUR╬ Z3LI┬ VERSION:
  2446.  
  2447.      Routine║   Z3LVER
  2448.      Function║ Return version number of Z3LIB.REL
  2449.      Entry:    None
  2450.      Exit:     HL = version number (H=major, L=minor) in binary
  2451.      Affected: HL
  2452.      Usage:    Record≤ thσ Z3LI┬ versioε iε linkeΣ programs¼ áfo≥ ì
  2453. ááááááááááááááádebugginτ witΦ differen⌠ versions.
  2454. .pa
  2455. èPARS┼ TOKEN:
  2456.  
  2457.      Routines║  ZPRSFN ¼  ZFNAME
  2458.      Function║ Parse filσ contro∞ blocδ token
  2459.      Entry:    HL = address of first character of token
  2460.                DE = address of 36-byte filσ contro∞ block
  2461.                A = flag:
  2462.                     0 = scan for DIR form before DU
  2463.                     1 = scan for DU form before DIR
  2464.      Exit:     HL = address of character after token
  2465.                A = number of question marks in filename.typ
  2466.                Zero flag set accordingly
  2467.      Affected: AF¼ HL
  2468.      Usage:    Perform≤ thσ identica∞ functioε oµ parsinτ ß ácomì
  2469. ááááááááááááááápletσ áFC┬ tokeε a≤ thσ ZCPR│ ácommanΣ áprocessor«  ì
  2470. áááááááááááááááToken≤ áma∙ takσ thσ forφ áoµ á"dir:filename.typ"¼ ì
  2471. ááááááááááááááá"du:filename.typ"¼ á"filename.typ"¼ etc«  Thσ áreì
  2472. ááááááááááááááásultinτ áFC┬ contain≤ thσ filenamσ anΣ typσ anΣ áß ì
  2473. áááááááááááááááprope≥ D╒ reference«  (Seσ PARSER¼ whicΦ i≤ relatì
  2474. áááááááááááááááed.)
  2475.  
  2476.                ZFNAM┼ ái≤ áß litera∞ interpretatioε oµ áthσ ácodσ ì
  2477. áááááááááááááááwithiε áthσ ZCPR│ commanΣ processor¼ whilσ áZPRSF╬ ì
  2478. ááááááááááááááái≤ áß ámorσ efficien⌠ bod∙ oµ codσ bu⌠ áuse≤ ámorσ ì
  2479. ááááááááááááááábuffe≥ space.
  2480.  
  2481. ZCP╥ 3.│ PARSERS:
  2482.  
  2483.      Routine║   Z33FNAME
  2484.      Function║ Parse single token from external command buffer
  2485.      Entry:    DE = address of user-defined FCB to receive token
  2486.      Exit:     HL = addres≤ oµ delimiter in command buffer
  2487.      Affected: HL
  2488.      Usage:    Require≤ ZCP╥ 3.│ o≥ later«  Thi≤ routinσ parse≤ ß ì
  2489. ááááááááááááááásinglσ tokeε froφ thσ externa∞ commanΣ buffe≥ t∩ ß ì
  2490. áááááááááááááááspecifieΣ FCB«  I⌠ use≤ thσ SCA╬ entr∙ iε ZCP╥ 3.│ ì
  2491. áááááááááááááááo≥ álater«  Yo⌡ mus⌠ insurσ tha⌠ thσ commanΣ áproì
  2492. ááááááááááááááácesso≥ ha≤ no⌠ beeε overwritteε t∩ usσ thi≤ áfuncì
  2493. ááááááááááááááátion.
  2494.  
  2495.      Routine║   PARSE2
  2496.      Function║ Parse command line using ZCPR 3.3 REPARSE entry
  2497.      Entry:    HL = address of the command line to reparse
  2498.      Exit:     None; line is reparsed and FCB's filled
  2499.      Affected: None
  2500.      Usage:    Require≤ ZCP╥ 3.│ o≥ later«  Thi≤ routinσ parse≤ ß ì
  2501. áááááááááááááááspecifieΣ commanΣ linσ t∩ thσ defaul⌠ FCB'≤ a⌠ 5CΦ ì
  2502. áááááááááááááááanΣ 6Ch«  Yo⌡ mus⌠ insurσ tha⌠ thσ commanΣ procesì
  2503. áááááááááááááááso≥ ha≤ no⌠ beeε overwritteε t∩ usσ thi≤ routine.
  2504. .pa
  2505. è     Routine║   REPARSE
  2506.      Function║ Reparse default command line one token later
  2507.      Entry:    None
  2508.      Exit:     None; the command line is reparsed
  2509.      Affected: None
  2510.      Usage:    Require≤ ZCP╥ 3.│ o≥ later«  Thi≤ routinσ reparse≤ ì
  2511. áááááááááááááááthσ curren⌠ commanΣ linσ startinτ onσ tokeε áafte≥ ì
  2512. ááááááááááááááácurren⌠ ásettinτ anΣ set≤ thσ defaul⌠ FCB's« á Yo⌡ ì
  2513. ááááááááááááááámus⌠ áinsurσ átha⌠ thσ commanΣ processo≥ áha≤ áno⌠ ì
  2514. ááááááááááááááábeeε overwritteε t∩ usσ thi≤ routine.
  2515.  
  2516.      Routine║   SCAN
  2517.      Function║ Scan single token from specified command line
  2518.      Entry:    HL = points to command line to scan
  2519.                DE = points to FCB to receive parsed token
  2520.      Exit:     None; token is parsed
  2521.      Affected: None
  2522.      Usage:    Require≤ ZCP╥ 3.│ o≥ later«  Thi≤ routinσ parse≤ ß ì
  2523. ááááááááááááááásinglσ átokeε froφ ß use≥-specifieΣ ácommanΣ álinσ ì
  2524. áááááááááááááááint∩ ß specifieΣ FC┬ usinτ thσ SCA╬ entr∙ iε áZCP╥ ì
  2525. ááááááááááááááá3.│ áo≥ later«  Yo⌡ mus⌠ insurσ tha⌠ áthσ ácommanΣ ì
  2526. áááááááááááááááprocesso≥ áha≤ áno⌠ beeε overwritteε t∩ áusσ áthi≤ ì
  2527. ááááááááááááááároutine.
  2528.  
  2529. CHEC╦ ZCP╥ 3.│ PARS┼ RESULTS:
  2530.  
  2531.      Routines║  FCB1CHK ¼  FCB2CHK
  2532.      Function║ Examinσ defaul⌠ filσ contro∞ block≤ fo≥ validity
  2533.      Entry:    None
  2534.      Exit:     A = 0, zero set (Z) if FCB has valid name
  2535.                A <> 0, zero clear (NZ) if error or no name
  2536.      Affected: AF
  2537.      Usage:    Require≤ áFC┬ parseΣ b∙ ZCP╥ 3.│ o≥ later« á Thesσ ì
  2538. ááááááááááááááároutine≤ áexaminσ thσ defaul⌠ FCB'≤ áa⌠ álocation≤ ì
  2539. ááááááááááááááá5CΦ (FCB1CHK⌐ anΣ 6CΦ (FCB2CHK⌐ fo≥ validl∙ parseΣ ì
  2540. áááááááááááááááfilename≤ froφ ZCP╥ 3.│ o≥ late≥ parsers« á Error≤ ì
  2541. áááááááááááááááarσ áduσ t∩ D╒ ou⌠ oµ range¼ illega∞ nameΣ ádirecì
  2542. ááááááááááááááátory¼ o≥ illega∞ password.
  2543.  
  2544.      Routine║   FCBCHK
  2545.      Function║ Examine specified filσ contro∞ block for validity
  2546.      Entry:    DE = address of an FCB to check
  2547.      Exit:     A = 0, zero set (Z) if FCB has valid name
  2548.                A <> 0, zero clear (NZ) if error or no name
  2549.      Affected: AF
  2550.      Usage:    Require≤ áFC┬ parseΣ b∙ ZCP╥ 3.│ o≥ álater« á Thi≤ ì
  2551. ááááááááááááááároutine≤ áexamine≤ thσ FC┬ a⌠ ß specifieΣ áaddres≤ ì
  2552. áááááááááááááááfo≥ ávalidl∙ parseΣ filenamσ b∙ ZCP╥ 3.│ o≥ álate≥ ì
  2553. áááááááááááááááparsers«  Error≤ arσ duσ t∩ D╒ ou⌠ oµ range¼ illeì
  2554. ááááááááááááááága∞ nameΣ directory¼ o≥ illega∞ password.
  2555. .pa
  2556. èPRIN╘ LOA─ MODUL┼ DATA:
  2557.  
  2558.      Routine║   PRTTYPE
  2559.      Function║ Print load module type and address
  2560.      Entry:    A = program type (1..4)
  2561.                HL = program load address
  2562.      Exit:     None; the type and address are printed on console
  2563.      Affected: None
  2564.      Usage:    Mos⌠ ofteε useΣ iε extendeΣ processor≤ anΣ áutiliì
  2565. ááááááááááááááátie≤ át∩ ádispla∙ loaΣ information«  I⌠ áprint≤ áß ì
  2566. ááááááááááááááámessagσ t∩ thσ CON║ devicσ containinτ loaΣ ámodulσ ì
  2567. ááááááááááááááátypσ (│ o≥ 4⌐ anΣ thσ loaΣ addres≤ iε hex.
  2568.      Example:
  2569.                          EX╘       PRTTYPE        ; declare the routine
  2570.                          ...
  2571.                          JP        BEGIN          ; ZCPR 3 header structure
  2572.                          DEFB      'Z3ENV'        ; .ID string
  2573.                TYPE:     DEFB      3              ; ..module load type
  2574.                Z3EADR:   DEFW      $-$            ; ...candidate ENV address
  2575.                START:    DEFW      9800H          ; type 3 starting addr = 9800h
  2576.                BEGIN:    ...                      ; initial setup, set stack, etc
  2577.                          LD        A,(TYPE)       ; get the load module type
  2578.                          LD        HL,START       ; ..and load starting address
  2579.                          CALL      PRTTYPE        ; print them to the console
  2580.                          ...                      ; ..continue on
  2581.  
  2582. ZCP╥ 3.│ INTERNA╠ PROGRA═ NAME:
  2583.  
  2584.      Routine║   GETNAME
  2585.      Function║ Return pointer to current program name
  2586.      Entry:    None
  2587.      Exit:     A <> 0, zero clear (NZ) if external FCB exists
  2588.                A = 0, zero set (Z) if no external FCB
  2589.                H╠ á╜ addres≤ oµ interna∞ namσ buffe≥ (valiΣ áonl∙ ì
  2590. áááááááááááááááiµ externa∞ FC┬ exists)
  2591.      Affected: AF¼ DE¼ HL
  2592.      Usage:    Return≤ ß pointe≥ t∩ thσ currentl∙ executinτ áproì
  2593. ááááááááááááááágraφ b∙ accessinτ thσ externa∞ FC┬ defineΣ iε áthσ ì
  2594. áááááááááááááááEnvironmen⌠ Descriptor«  I⌠ i≤ usefu∞ fo≥ áidentiì
  2595. áááááááááááááááfyinτ thσ rea∞ prograφ namσ wheε rσ-executeΣ áwitΦ ì
  2596. áááááááááááááááß á"GOó commanΣ o≥ equivalen⌠ facility«  Fo≥ áthi≤ ì
  2597. ááááááááááááááároutinσ át∩ functioε aε externa∞ FC┬ mus⌠ ábσ ádeì
  2598. áááááááááááááááfined.
  2599.  
  2600.      Routine║   PRTNAME
  2601.      Function║ Print program name from internal buffer
  2602.      Entry:    None
  2603.      Exit:     None; the name is printed to console
  2604.      Affected: None
  2605.      Usage:    Print≤ thσ curren⌠ prograφ namσ froφ aε áinternalì
  2606. ááááááááááááááál∙-helΣ buffe≥ t∩ thσ CON║ device.
  2607. .pa
  2608. èHIGHES╘ USEABL┼ MEMORY:
  2609.  
  2610.      Routine║   GZMTOP
  2611.      Function║ Return last usable TPA memory address
  2612.      Entry:    None
  2613.      Exit:     HL = last usable memory address in TPA
  2614.      Affected: HL
  2615.      Usage:    Determine≤ thσ to≡ oµ thσ availablσ TPA«  I⌠ áuse≤ ì
  2616. áááááááááááááááthσ extendeΣ environment¼ iµ available¼ áotherwisσ ì
  2617. ááááááááááááááái⌠ ácalculate≤ áthσ CC╨ basσ froφ BIO╙ áwarφ áboo⌠ ì
  2618. áááááááááááááááaddress« á I⌠ als∩ accommodate≤ sensinτ fo≥ áresiì
  2619. áááááááááááááááden⌠ RSX's«  Thσ addres≤ returneΣ i≤ thσ las⌠ bytσ ì
  2620. ááááááááááááááábelo≈ ß pagσ boundar∙ (L=0FFh⌐ fo≥ aε addeΣ safet∙ ì
  2621. ááááááááááááááámargin«  Fo≥ example¼ iµ thσ CC╨ begin≤ a⌠ á0C000Φ ì
  2622. áááááááááááááááanΣ án∩ RSX'≤ arσ present¼ thi≤ routinσ woulΣ áreì
  2623. áááááááááááááááturε 0BFFFh«  Oε thσ othe≥ hand¼ iµ aε RS╪ áexist≤ ì
  2624. áááááááááááááááwitΦ áß áprotec⌠ addres≤ oµ á0BC6Ch¼ áGXMTO╨ áwil∞ ì
  2625. áááááááááááááááreturε 0BBFFh.
  2626. .pa
  2627. è