home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / simtel / sigm / vols200 / vol200 / z3lib1.hqp / Z3LIB1.HLP
Text File  |  1985-02-09  |  28KB  |  943 lines

  1. Introduction   ZCPR3 Environment
  2. Command Line   GETCL1/GETCL2
  3. CRT/PRT Data   GETCRT/GETPRT
  4. External FCB   GETEFCB
  5. Environment    GETENV/GETVID
  6. FCP Address    GETFCP
  7. Filenames      GETFN1/GETFN2
  8. Initialize     Z3INIT
  9. IOP Address    GETIOP
  10. DU/Max DU      GETDUOK/GETMDISK/GETMUSER
  11. Messages       GETMSG/GETSHM/PUTSHM
  12. Named Dir      GETNDR
  13. Path           GETPATH
  14. Processor Spd  GETSPEED
  15. Quiet Flag     GETQUIET
  16. RCP Address    GETRCP
  17. Shell Stack    GETSH1/GETSH2
  18. Wheel Byte     GETWHL/PUTWHL
  19. ZEX Data       GETZFC/GETZNC/GETZRUN/PUTZNC/PUTZRUN
  20. :Introduction to the ZCPR3 Environment
  21.  
  22.      An∙á prograφ runninτ unde≥ ZCPR│ i≤ withiε wha⌠ caεá bσ ì
  23. calleΣ ß ZCPR│ environment«á  ┴ hos⌠ oµ facilitie≤ anΣá datß ì
  24. i≤á availablσá t∩ thi≤ prograφ whicΦ ß norma∞á CP/═á prograφ ì
  25. doe≤á no⌠ have«á  Fo≥ instance¼á ß prograφ runninτ unde≥ thσ ì
  26. ZCPR│ environment:
  27.  
  28.           . can find out what name it was invoked by
  29.           . can access a set of messages from ZCPR3 which
  30.                tell it a number of things about how it was
  31.                invoked
  32.           « caε senΣ message≤ t∩ ZCPR│ anΣ program≤ which
  33.                run after it completes
  34.           . can find out many things about its environment,
  35.                such as the processor speed, CRT and printer
  36.                characteristics, maximum number of disks
  37.           . can determine what characteristics the user's
  38.                terminal has and make use of these to employ
  39.                cursor addressing and other such functions
  40.  
  41.      Al∞á oµá thσá informatioε outlineΣ abovσá anΣá morσá i≤ ì
  42. availablσ t∩ an∙ runninτ prograφ thr⌡ thσ ZCPR│á Environmen⌠ ì
  43. Descriptor«á  Thi≤á i≤á ß blocδ oµ memor∙ (25╢ bytes⌐á whicΦ ì
  44. contain≤á addresse≤á anΣ othe≥ datß iεá ßá precisely-defineΣ ì
  45. format«á  A⌠ installatioε time¼á thσ ZCPR│ utilitie≤ caεá bσ ì
  46. se⌠á u≡á t∩ internall∙ contaiε aε Environmen⌠ Descripto≥á o≥ ì
  47. the∙á caεá bσá installeΣ witΦ ß pointe≥á t∩á aεá Environmen⌠ ì
  48. Descripto≥á whicΦ reside≤ a⌠ somσ fixeΣ locatioεá iεá memor∙ ì
  49. (thi≤á i≤á thσ preferreΣ approach)«á  Oncσ thσá routine≤á iε ì
  50. Z3LI┬ havσ beeε initializeΣ witΦ knowledgσ oµ thσ addres≤ oµ ì
  51. thi≤á environmen⌠á descriptor¼á the∙á caεá extrac⌠á specifiπ ì
  52. informatioε froφ i⌠ fo≥ usσ iε thσ applicatioε program.
  53.  
  54.  
  55.      Thσá followinτ informatioε i≤ containeΣ withiε ßá ZCPR│ ì
  56. Environment Descriptor:
  57.  
  58.      . address of External Path    . size of External Path
  59.      . address of RCP              . size of RCP
  60.      . address of FCP              . size of FCP
  61.      . address of IOP              . size of IOP
  62.      . address of Named Dir        . size of Named Dir
  63.      . address of Command Line     . size of Command Line
  64.      . address of Env Descriptor   . size of Env Descriptor
  65.      . address of Shell Stack      . size of Shell Stack
  66.      . address of Z3 Messages      . size of Stack Entries
  67.      . address of External FCB     . address of External Stk
  68.      . address of Wheel Byte       . quiet flag
  69.      . processor speed             . DU approval flag
  70.      . maximum disk allowed        . maximum user allowed
  71.      « datß oε CR╘                 « datß oε Printe≥
  72.      . two reserved file names     . ZCPR3 TERMCAP (Z3TCAP)
  73.  
  74.  
  75.      Thσ purposσ oµ Z3LI┬ i≤ t∩ providσ thσ programme≥á witΦ ì
  76. eas∙á acces≤á t∩á thσ informatioε iε thσá ZCPR│á Environmen⌠ ì
  77. Descripto≥á anΣá t∩á allo≈ hiφ t∩ easil∙ makσá usσá oµá thi≤ ì
  78. information.  To illustrate, the some Z3LIB routines are:
  79.  
  80.           . GETPRT  - return data on the width, number of
  81.                       lines, and form feed ability of the
  82.                       printer
  83.           . GETCL2  - return the address of the first char
  84.                       of the next command to be run, if any
  85.           . GETEFCB - return the address of the external
  86.                       FCB so the program can determine its
  87.                       name
  88.           . SHPUSH  - push a command line on the shell stack
  89.           « SHPO╨   - po≡ ß commanΣ linσ froφ thσ shel∞ stk
  90.           . IFT     - invoke the next IF level and make it T
  91.           . IFEND   - back up to previous IF level
  92.  
  93.  
  94.      Thi≤á HL╨á filσ describe≤ thosσá Z3LI┬á routine≤á whicΦ ì
  95. providσá acces≤á t∩ thσ ZCPR│ Environmen⌠á Descripto≥á data«  ì
  96. All of these routines are of the general name:
  97.  
  98.           GETxxxxx
  99.  
  100. wherσá thσ mnemoniπ followinτ thσ GE╘ prefi° allude≤ t∩ wha⌠ ì
  101. information is being obtained.
  102. :Command Line   GETCL1/GETCL2
  103.  
  104. Z3LIB Routine: GETCL1
  105.  
  106. Function:
  107.      Return≤á thσ addres≤ oµ thσ CommanΣ Linσ Buffe≥á iεá H╠ ì
  108. anΣá it≤á sizσ (iε byte⌐ iε A«á  Thσ CommanΣ Linσ Buffe≥á i≤ ì
  109. structured as follows:
  110.  
  111.           cmdline:
  112.                db   <address of next char to process>
  113.                db   <size of buffer>
  114.                db   <dummy used for BDOS READLN function>
  115.                db   <characters in command line>
  116.                db   0
  117.  
  118.      GETCL▒á return≤á thσ addres≤ oµ CMDLIN┼ iε H╠á anΣá thσ ì
  119. size (at CMDLINE+2) in A.
  120.  
  121.  
  122. Inputs: None
  123.  
  124. Outputs: HL=address of CMDLINE, A=size
  125.  
  126. Registers Affected: HL, PSW
  127.  
  128. Side Effects: None
  129.  
  130. Special Error Conditions:
  131.      HL = 0 if there is no command line buffer
  132.  
  133.  
  134. Z3LIB Routine: GETCL2
  135.  
  136. Function:
  137.      Return≤ thσ addres≤ oµ thσ firs⌠ characte≥ oµ thσá nex⌠ ì
  138. commanΣá t∩ bσ executeΣ iε thσ CommanΣ Linσ Buffe≥ iε H╠ anΣ ì
  139. thσ firs⌠ characte≥ oµ thσ nex⌠ commanΣ iε A«á  A=░ anΣá thσ ì
  140. Zer∩á Flaτ i≤ Se⌠ (Z⌐ iµ therσ arσ n∩ furthe≥ character≤á iε ì
  141. the line.
  142.      The Command Line Buffer is structured as follows:
  143.  
  144.           cmdline:
  145.                db   <address of next char to process>
  146.                db   <size of buffer>
  147.                db   <dummy used for BDOS READLN function>
  148.                db   <characters in command line>
  149.                db   0
  150.  
  151.      GETCL▓ return≤ thσ addres≤ containeΣ iε thσ firs⌠ D╫ a⌠ ì
  152. thσ labe∞ CMDLIN┼ iε H╠ anΣ thσ cha≥ a⌠ thi≤ addres≤ iε A.
  153.  
  154. Inputs: None
  155.  
  156. Outputs: HL=address of next command, A=first char
  157.  
  158. Registers Affected: HL, PSW
  159.  
  160. Side Effects: None
  161.  
  162. Special Error Conditions:
  163.      HL = 0 if there is no Command Line Buffer.
  164.  
  165. :CRT/PRT Data   GETCRT/GETPRT
  166.  
  167. Z3LIB Routine: GETCRT
  168.  
  169. Function:
  170.      Returε thσ addres≤ oµ thσ CR╘ datß recorΣ iε HL«á  Thi≤ ì
  171. record is structured as follows:
  172.  
  173.           crtdata:
  174.                db   <width of the CRT in characters>
  175.                db   <number of lines on CRT screen>
  176.                db   <number of text lines on CRT screen>
  177.  
  178.      For example, a conventional CRT would look like:
  179.  
  180.                db   80   ; 80 cols
  181.                db   24   ; 24 lines
  182.                db   22   ; 22 text lines
  183.  
  184.  
  185.      Thσá numbe≥á oµ tex⌠ line≤ shoulΣ bσ tw∩ les≤ thaεá thσ ì
  186. tota∞á numbe≥ oµ lines«á  I⌠ ma∙ bσ madσ │ o≥ ┤ les≤ iµá thσ ì
  187. use≥ want≤ t∩ seσ wide≥ overla≡ oε hi≤ screen«á  Thσ purposσ ì
  188. oµá thi≤ recorΣ elemen⌠ i≤ t∩ tel∞ utilitie≤ likσá PAG┼á ho≈ ì
  189. man∙á line≤á t∩ outpu⌠ beforσ pausinτ t∩ allo≈ thσá use≥á t∩ ì
  190. reaΣá thσá screen¼á anΣ thi≤ caε bσ reduceΣ (g∩ t∩ 2░ o≥á 1╕ ì
  191. lines⌐á t∩ allo≈ thσ use≥ t∩ seσ morσ oµ thσ las⌠ screeεá hσ ì
  192. was viewing.
  193.  
  194. Inputs: None
  195.  
  196. Outputs: HL contains the address of the CRT record
  197.  
  198. Registers Affected: HL
  199.  
  200. Side Effects: None
  201.  
  202. Special Error Conditions: None
  203.  
  204.  
  205. Z3LIB Routine: GETPRT
  206.  
  207. Function:
  208.      Returεá thσ addres≤ oµ thσ Printe≥ datß recorΣá iεá HL«  ì
  209. This record is structured as follows:
  210.  
  211.           prtdata:
  212.                db   <width of printer in characters>
  213.                db   <number of lines on printer page>
  214.                db   <number of text lines on printer page>
  215.                db   <form feed flag (0=printer can't FF)>
  216.  
  217.      For example, a typical printer data record would be:
  218.  
  219.                db   80   ; 80 columns
  220.                db   66   ; 66 lines
  221.                dΓ   5╕   ╗ 5╕ tex⌠ line≤ (┤ up/┤ dε margin)
  222.                db   1    ; printer can form feed
  223.  
  224.  
  225.      Usinτá thσ thirΣ bytσ (numbe≥ oµ tex⌠ line≤ pe≥á page)¼ ì
  226. thσá printe≥á pagσá margin≤ arσ selecteΣ a≤á thσá differencσ ì
  227. betweeεá thσá tota∞ numbe≥ oµ line≤ anΣ thσ numbe≥á oµá tex⌠ ì
  228. lines.
  229.      Wheε routine≤ likσ PRIN╘ run¼á the∙ prin⌠ thσ numbe≥ oµ ì
  230. tex⌠á line≤ anΣ then¼á iµ thσ printe≥ caεá forφá feed¼á the∙ ì
  231. issuσá ßá forφ feeΣ character«á  Iµ thσ printe≥á can'⌠á forφ ì
  232. feed¼á thσá senΣá ou⌠á thσ prope≥ numbe≥ oµ blanδá line≤á t∩ ì
  233. advance to the next page.
  234.  
  235. Inputs: None
  236.  
  237. Outputs: HL is address of printer data buffer
  238.  
  239. Registers Affected: HL
  240.  
  241. Side Effects: None
  242.  
  243. Special Error Conditions: None
  244. :External FCB   GETEFCB
  245.  
  246. Z3LIB Routine: GETEFCB
  247.  
  248. Function:
  249.      Return≤á thσá addres≤ oµ thσ ZCPR│ Externa∞ FC┬ iεá HL«  ì
  250. Return≤á witΦá HL=░á anΣ Zer∩ Flaτ Se⌠ (Z⌐ iµá therσá i≤á n∩ ì
  251. External FCB.
  252.  
  253.      Unde≥á ZCPR3¼á ß prograφ caε finΣ ou⌠ wha⌠ namσ i⌠á wa≤ ì
  254. invokeΣá b∙á througΦ thσ Externa∞ FCB«á  Byte≤á 1-╕á oµá thσ ì
  255. Externa∞á FC┬á (firs⌠á bytσ i≤ 0⌐ contaiε thσá namσá oµá thσ ì
  256. program just executed by ZCPR3.
  257.  
  258.      Thi≤á featurσ i≤ particularl∙ usefu∞ fo≥ program≤á likσ ì
  259. Shell≤á whicΦá havσá t∩á pusΦá thei≥á namσá anΣá operationa∞ ì
  260. parameter≤á ont∩á thσ Shel∞ Stacδ iε orde≥ t∩á bσá reinvokeΣ ì
  261. wheε ß commanΣ linσ completes«á  ┴ Shel∞ caε usσ thσ datß iε ì
  262. thσá Externa∞á FC┬á t∩ determinσ wha⌠ it≤á namσá i≤á withou⌠ ì
  263. having to assume that it has a particular name at all times.
  264.  
  265.  
  266. Inputs: None
  267.  
  268. Outputs: HL = address of External FCB, A=0 and Z if none
  269.  
  270. Registers Affected: HL, PSW
  271.  
  272. Side Effects: None
  273.  
  274. Special Error Conditions: None
  275.  
  276. :Environment    GETENV
  277.  
  278. Z3LIB Routine: GETENV
  279.  
  280. Function:
  281.      Returεá thσ addres≤ oµ thσ ZCPR│ Environmen⌠ Descripto≥ ì
  282. in HL.
  283.  
  284.      Thi≤á functioε i≤ usefu∞ fo≥ thosσ program≤ whicΦá neeΣ ì
  285. t∩á modif∙ thσ ZCPR│ Environmen⌠ Descriptor«á  Mos⌠á oµá thσ ì
  286. routine≤ iε Z3LI┬ whicΦ acces≤ thσ environmen⌠ descripto≥ d∩ ì
  287. s∩á iεá ß R/╧ modσ (the∙ d∩ no⌠ allo≈ thσ prograφ t∩á changσ ì
  288. datß iε it)«á  Somσ program≤ ma∙ neeΣ t∩ d∩ this¼á s∩ GENEN╓ ì
  289. i≤ provided«á  Z3LDR¼á fo≥ example¼á load≤ ß ne≈ Environmen⌠ ì
  290. Descripto≥ froφ ß filσ oε disk¼á anΣ i⌠ use≤ GETEN╓ t∩á finΣ ì
  291. out where to load the file.
  292.  
  293.  
  294. Inputs: None
  295.  
  296. Outputs: HL = address of Environment Descriptor
  297.  
  298. Registers Affected: HL
  299.  
  300. Side Effects: None
  301.  
  302. Special Error Conditions: None
  303.  
  304.  
  305. Z3LIB Routine: GETVID
  306.  
  307. Function:
  308.      Returε thσ addres≤ oµ thσ ZCPR│ TCA╨ (Z3TCAP⌐ Buffe≥ iε ì
  309. HL.  Indicate if this buffer contains a TCAP entry.
  310.  
  311.      Thi≤á functioε i≤ usefu∞ fo≥ thosσ program≤ whicΦá neeΣ ì
  312. t∩á modif∙á thσ ZCPR│ TCA╨ Buffe≥ anΣ thosσá program≤á whicΦ ì
  313. neeΣá t∩á determinσá iµá thσ TCA╨á i≤á loaded«á  I⌠á ma∙á bσ ì
  314. desirablσá t∩á cal∞á thi≤ routinσ beforσá ßá screen-orienteΣ ì
  315. utilit∙á i≤á executeΣá iε orde≥ t∩ insurσá tha⌠á ßá TCA╨á i≤ ì
  316. available.
  317.  
  318.      Returεá witΦá A=░ anΣ Zer∩ Flaτ Se⌠ (Z⌐á iµá n∩á Z3TCA╨ ì
  319. entr∙ exist≤ withiε thσ buffer.
  320.  
  321.  
  322. Inputs: None
  323.  
  324. Outputs: HL = address of Z3TCAP Buffer
  325.           A=0 and Zero Flag Set (Z) if no entry in buffer
  326.  
  327. Registers Affected: HL, PSW
  328.  
  329. Side Effects: None
  330.  
  331. Special Error Conditions: None
  332.  
  333. :FCP Address    GETFCP
  334.  
  335. Z3LIB Routine: GETFCP
  336.  
  337. Function:
  338.      Returεá thσ addres≤ oµ thσ flo≈ commanΣ packagσá buffe≥ ì
  339. iε H╠ anΣ thσ sizσ oµ thσ buffe≥ iε term≤ oµ 128-bytσ block≤ ì
  340. in A.  If there is no FCP buffer, A=0 and Zero Flag Set (Z).
  341.  
  342.      GETFC╨ simpl∙ return≤ detail≤ oε thσ FC╨ buffe≥ addres≤ ì
  343. anΣá size¼á bu⌠ i⌠ doe≤ no⌠ sa∙ iµ aε FC╨ i≤ residen⌠ withiε ì
  344. it«á  T∩á finΣ thi≤ out¼á looδ a⌠ thσ firs⌠ bytσ oµ thσá FC╨ ì
  345. buffer¼á and¼á iµ i⌠ i≤ zero¼á theε therσ i≤ n∩ FC╨ present«  ì
  346. Example:
  347.           ext  getfcp    ;reference
  348.           ...
  349.           call getfcp    ;obtain data
  350.           jz   nofcpbuf  ;no FCP buffer is available
  351.           mov  a,m       ;get first byte of buffer
  352.           ora  a         ;set zero flag accordingly
  353.           jz   nofcpload ;no FCP is in the buffer
  354.  
  355. Inputs: None
  356.  
  357. Outputs║ H╠ ╜ addres≤ oµ FC╨ buffer
  358.                A=0 and Zero Flag Set (Z) if no buffer, else
  359.                A=sizσ oµ buffe≥ iε 128-bytσ block≤ anΣ NZ
  360.  
  361. Registers Affected: HL, PSW
  362.  
  363. Side Effects: None
  364.  
  365. Special Error Conditions: None
  366.  
  367. :Filenames      GETFN1/GETFN2
  368.  
  369. Z3LIB Routine: GETFN1 or GETFN2
  370.  
  371. Function:
  372.      Thesσá routine≤ returε thσ addres≤ iε H╠ oµ filenamσá ▒ ì
  373. (GETFN1⌐á anΣ filenamσ ▓ (GETFN2⌐ iε thσá ZCPR│á Environmen⌠ ì
  374. Descriptor«á  EacΦ filenamσ entr∙ i≤ 1▒ byte≤ long¼ matchinτ ì
  375. the filename and filetype fields of the CP/M FCB.
  376.  
  377.      Thesσá name≤ arσ useΣ t∩ pas≤ name≤ oµ specia∞ file≤ t∩ ì
  378. program≤á fo≥á late≥ use«á  Thei≥ exac⌠á definitioεá i≤á no⌠ ì
  379. presenteΣá anΣá lef⌠ t∩ thσ installer«á  Onσ applicatioεá oµ ì
  380. thesσá i≤ t∩ allo≈ GETFN▒ t∩ returε thσ namσ oµá thσá maste≥ ì
  381. HL╨á filσá (HELP.HLP⌐ whicΦ i≤ t∩ bσ useΣ t∩ inde° int∩á thσ ì
  382. Help System.
  383.  
  384.  
  385. Inputs: None
  386.  
  387. Outputs: HL is address of the selected file name
  388.  
  389. Registers Affected: HL
  390.  
  391. Side Effects: None
  392.  
  393. Special Error Conditions: None
  394.  
  395. :Initialize     Z3INIT
  396.  
  397. Z3LIB Routine: Z3INIT
  398.  
  399. Function:
  400.      Obtaiε thσ addres≤ oµ thσ ZCPR│ Environmen⌠á Descripto≥ ì
  401. froφá thσ callinτ prograφ anΣ se⌠ i⌠ iε ß globa∞ buffe≥á fo≥ ì
  402. future use by the Z3LIB routines.
  403.  
  404.      Z3INIT is called as follows:
  405.  
  406.           ext  z3init    ;reference
  407.           ...
  408.           lxi  h,z3env   ;address of ZCPR3 Environment Desc
  409.           call z3init    ;perform function
  410.           ...
  411.  
  412. Inputs: HL = address of ZCPR3 Environment Descriptor
  413.  
  414.  
  415. Outputs: None
  416.  
  417. Registers Affected: None
  418.  
  419. Side Effects: None
  420.  
  421. Special Error Conditions: None
  422.  
  423. :IOP Address    GETIOP
  424.  
  425. Z3LIB Routine: GETIOP
  426.  
  427. Function:
  428.      Returεá thσ addres≤ oµ thσ input/output packagσá buffe≥ ì
  429. iε H╠ anΣ thσ sizσ oµ thσ buffe≥ iε term≤ oµ 128-bytσ block≤ ì
  430. in A.  If there is no IOP buffer, A=0 and Zero Flag Set (Z).
  431.  
  432.      GETIO╨ simpl∙ return≤ detail≤ oε thσ IOP buffe≥ addres≤ ì
  433. anΣá size¼á bu⌠ i⌠ doe≤ no⌠ sa∙ iµ aε IOP i≤ residen⌠ withiε ì
  434. it«á  T∩á finΣ thi≤ out¼á looδ a⌠ thσ firs⌠ bytσ oµ thσá IOP ì
  435. buffer¼á and¼á iµ i⌠ i≤ zero¼á theε therσ i≤ n∩ IOP present«  ì
  436. Example:
  437.           ext  getiop    ;reference
  438.           ...
  439.           call getiop    ;obtain data
  440.           jz   noiopbuf  ;no IOP buffer is available
  441.           mov  a,m       ;get first byte of buffer
  442.           ora  a         ;set zero flag accordingly
  443.           jz   noiopload ;no IOP is in the buffer
  444.  
  445. Inputs: None
  446.  
  447. Outputs║ H╠ ╜ addres≤ oµ IO╨ buffer
  448.                A=0 and Zero Flag Set (Z) if no buffer, else
  449.                A=sizσ oµ buffe≥ iε 128-bytσ block≤ anΣ NZ
  450.  
  451. Registers Affected: HL, PSW
  452.  
  453. Side Effects: None
  454.  
  455. Special Error Conditions: None
  456.  
  457. :DU/Max Disk/User  GETDUOK/GETMDISK/GETMUSER
  458.  
  459. Z3LIB Routine: GETDUOK
  460.  
  461. Function:
  462.      Returε thσ DUO╦ flaτ iε ┴ witΦ thσ Zer∩ Flaτ Se⌠ (Z⌐ iµ ì
  463. A=0«á  DUO╦á i≤á ß flaτ whicΦ tell≤ thσ prograφ iµ i⌠ i≤á t∩ ì
  464. permi⌠ thσ use≥ t∩ specif∙ thσ DU║ prefi° t∩ changσ disδ anΣ ì
  465. use≥ area«  ┴ ZCPR│ utilit∙ caε alway≤ specif∙ ß DIR║ prefi° ì
  466. (nameΣá directory⌐ iε identifyinτ thσ disδ anΣ use≥ areßá t∩ ì
  467. examine¼á bu⌠á iεá somσá "secureóá application≤á i⌠á i≤á no⌠ ì
  468. desirablσá t∩á allo≈ thσ use≥ t∩ emplo∙ thσá DU║á prefi°á t∩ ì
  469. acces≤á AN┘á disk/use≥ area«á  Thi≤ flaτá (DUOK⌐á tell≤á thσ ì
  470. utility if it is OK for the user to employ the DU: prefix.
  471.  
  472. Inputs: None
  473.  
  474. Outputs: A=0 and Zero Flag Set (Z) if NOT OK to use DU:
  475.             A=0FFH and Zero Flag Clear (NZ) if OK to use DU:
  476.  
  477.  
  478. Registers Affected: PSW
  479.  
  480. Side Effects: None
  481.  
  482. Special Error Conditions: None
  483.  
  484.  
  485. Z3LIB Routine: GETMDISK
  486.  
  487. Function:
  488.      Returεá thσá numbe≥á oµ thσ maximuφ disδá iεá A«á  Thi≤ ì
  489. numbe≥ i≤ iε thσ rangσ froφ ▒ t∩ 16¼ wherσ ▒ mean≤ disδ ┴ i≤ ì
  490. the maximum disk on the system and 16 means disk P is.
  491.  
  492.      Thσá ZCPR│á Environmen⌠á Descripto≥á ma∙á bσá useΣáá t∩ ì
  493. restric⌠á acces≤á t∩á certaiεá part≤á oµá thσá system«á  Fo≥ ì
  494. instance¼á ßá "norma∞ useró ma∙ bσ denieΣ acces≤ t∩ disk≤á ├ ì
  495. anΣá ─ anΣ t∩ an∙ use≥ areß beyonΣ 10«á  ┴ "privelegeΣ useró ì
  496. wh∩ ha≤ thσ powe≥ t∩ changσ thσ ZCPR│ Environmen⌠ Descripto≥ ì
  497. can gain access to any disk or user area he desires.
  498.  
  499. Inputs: None
  500.  
  501. Outputs: A = disk number (disk A = 1)
  502.  
  503.  
  504. Registers Affected: PSW
  505.  
  506. Side Effects: None
  507.  
  508. Special Error Conditions: None
  509.  
  510.  
  511. Z3LIB Routine: GETMUSER
  512.  
  513. Function:
  514.      Returε thσ numbe≥ oµ thσ maximuφ use≥ areß iε A«á  Thi≤ ì
  515. number is in the range from 0 to 31.
  516.  
  517.      Thσá ZCPR│á Environmen⌠á Descripto≥á ma∙á bσá useΣáá t∩ ì
  518. restric⌠á acces≤á t∩á certaiεá part≤á oµá thσá system«á  Fo≥ ì
  519. instance¼á ßá "norma∞ useró ma∙ bσ denieΣ acces≤ t∩ disk≤á ├ ì
  520. anΣá ─ anΣ t∩ an∙ use≥ areß beyonΣ 10«á  ┴ "privelegeΣ useró ì
  521. wh∩ ha≤ thσ powe≥ t∩ changσ thσ ZCPR│ Environmen⌠ Descripto≥ ì
  522. can gain access to any disk or user area he desires.
  523.  
  524. Inputs: None
  525.  
  526. Outputs: A = maximum user area which may be accessed
  527.  
  528.  
  529. Registers Affected: PSW
  530.  
  531. Side Effects: None
  532.  
  533. Special Error Conditions: None
  534.  
  535. :Messages       GETMSG/GETSHM/PUTSHM
  536.  
  537. Z3LIB Routine: GETMSG
  538.  
  539. Function:
  540.      Returεá thσ addres≤ oµ thσ ZCPR│ Messagσ Buffe≥ iεá HL«  ì
  541. A=░á anΣá Zer∩á Flaτ Se⌠ (Z⌐ iµ therσ i≤á n∩á ZCPR│á Messagσ ì
  542. Buffer.
  543.      Seσ thσ Z3LI┬ informatioε section≤ oε ZCPR│ Messages.
  544.  
  545. Inputs: None
  546.  
  547. Outputs: HL = address of ZCPR3 Message Buffer
  548.             A = 0 and Zero Flag Set (Z) if there is none
  549.  
  550. Registers Affected: HL, PSW
  551.  
  552. Side Effects: None
  553.  
  554. Special Error Conditions: None
  555.  
  556.  
  557. Z3LIB Routine: GETSHM
  558.  
  559. Function:
  560.      GETSH═á return≤á thσ valuσ oµ thσ shel∞á messagσá whosσ ì
  561. numbe≥á i≤ specifieΣ iε B«á  Therσ arσ threσ shel∞ messages¼ ì
  562. s∩ ░ <╜ ┬ <╜ ▓ (thσ programme≥ mus⌠ bσ surσ ß valiΣ valuσ i≤ ì
  563. presented).
  564.  
  565. Inputs: B = Message Number (0, 1, 2)
  566.  
  567. Outputs: A = Message Value (Zero Flag Set Accordingly)
  568.  
  569. Registers Affected: PSW
  570.  
  571. Side Effects: None
  572.  
  573. Special Error Conditions: None
  574.  
  575.  
  576. Z3LIB Routine: PUTSHM
  577.  
  578. Function:
  579.      PUTSH═ set≤ thσ valuσ oµ thσ shel∞ messagσ whosσ numbe≥ ì
  580. i≤ giveε iε B«á  Thσ messagσ valuσ i≤ iε A«á  Therσ arσ onl∙ ì
  581. three shell messages, so B = 0, 1, or 2.
  582.  
  583. Inputs: A = Message Value, B = Message Number = 0,1,2
  584.  
  585. Outputs: None
  586.  
  587. Registers Affected: None
  588.  
  589. Side Effects: Message Value is Set
  590.  
  591. Special Error Conditions: None
  592.  
  593. :Named Dir      GETNDR
  594.  
  595. Z3LIB Routine: GETNDR
  596.  
  597. Function:
  598.      Returεá thσ addres≤ oµ thσ nameΣ director∙ buffe≥ iε H╠ ì
  599. anΣ thσ sizσ oµ thσ buffe≥ iε term≤ oµ 128-bytσ block≤ iε A«  ì
  600. Iµ therσ i≤ n∩ ND╥ buffer¼ A=░ anΣ Zer∩ Flaτ Se⌠ (Z).
  601.  
  602.      GETNDR simpl∙ return≤ detail≤ oε thσ NDR buffe≥ addres≤ ì
  603. anΣá size¼á bu⌠ i⌠ doe≤ no⌠ sa∙ iµ aε NDR i≤ residen⌠ withiε ì
  604. it«á  T∩á finΣ thi≤ out¼á looδ a⌠ thσ firs⌠ bytσ oµ thσá NDR ì
  605. buffer¼á and¼á iµ i⌠ i≤ zero¼á theε therσ i≤ n∩ NDR present«  ì
  606. Example:
  607.           ext  getndr    ;reference
  608.           ...
  609.           call getndr    ;obtain data
  610.           jz   nondrbuf  ;no NDR buffer is available
  611.           mov  a,m       ;get first byte of buffer
  612.           ora  a         ;set zero flag accordingly
  613.           jz   nondrload ;no NDR is in the buffer
  614.  
  615. Inputs: None
  616.  
  617. Outputs║ H╠ ╜ addres≤ oµ NDR buffer
  618.                A=0 and Zero Flag Set (Z) if no buffer, else
  619.                A=sizσ oµ buffe≥ iε 128-bytσ block≤ anΣ NZ
  620.  
  621. Registers Affected: HL, PSW
  622.  
  623. Side Effects: None
  624.  
  625. Special Error Conditions: None
  626.  
  627. :Path           GETPATH
  628.  
  629. Z3LIB Routine: GETPATH
  630.  
  631. Function:
  632.      Returεá thσ addres≤ oµ thσ ZCPR│ Command-SearcΦ PatΦ iε ì
  633. HL«á  A=░á anΣ Zer∩ Flaτ Se⌠ (Z⌐ iµ therσ i≤ n∩ ZCPR│á Path«  ì
  634. Iµá therσá i≤á ß ZCPR│ Path¼á ┴ ╜ numbe≥á oµá two-bytσá patΦ ì
  635. elements allowed in it.
  636.  
  637.      A ZCPR3 Path Element is structured as follows:
  638.  
  639.           Byte 1:  Disk ID
  640.                     Disk A = 1, B = 2, etc
  641.                     Current Disk = '$'
  642.           Byte 2:  User ID
  643.                     Number from 0 to 31
  644.  
  645.  
  646.      A ZCPR3 Path is terminated by a Disk ID of 0.  Example:
  647.  
  648.           path:
  649.                db   '$',1     ;current disk, user 1
  650.                db   1,'$'     ;disk A, current user
  651.                db   1,15      ;disk A, user 15
  652.                db   0         ;end of path
  653.  
  654. Inputs: None
  655.  
  656. Outputs: HL = address of ZCPR3 Path
  657.             A = 0 and Zero Flag Set (Z) if there is none
  658.  
  659. Registers Affected: HL, PSW
  660.  
  661. Side Effects: None
  662.  
  663. Special Error Conditions: None
  664.  
  665. :Processor Spd  GETSPEED
  666.  
  667. Z3LIB Routine: GETSPEED
  668.  
  669. Function:
  670.      Returε thσ speeΣ oµ thσ processo≥ iε A«á  Thi≤ one-bytσ ì
  671. valuσá i≤ t∩ represen⌠ thσ processo≥ speeΣ iεá MHz¼á s∩á A=▒ ì
  672. means 1 MHz, A = 4 means 4 MHz, etc.
  673.  
  674.      This function is useful for software timing loops.
  675.  
  676. Inputs: None
  677.  
  678. Outputs: A = processor speed
  679.  
  680. Registers Affected: PSW
  681.  
  682. Side Effects: None
  683.  
  684. Special Error Conditions: None
  685.  
  686. :Quiet Flag     GETQUIET
  687.  
  688. Z3LIB Routine: GETQUIET
  689.  
  690. Function:
  691.      Returε thσ Quie⌠ Flaτ iε A«  A╜ ░ anΣ Zer∩ Flaτ Se⌠ (Z⌐ ì
  692. iµá thσ prograφ i≤ NO╘ t∩ ruε quietly¼á A=0FF╚ anΣ N┌ iµ thσ ì
  693. program is to run quietly.
  694.  
  695.      B∙ quie⌠ operation¼á thσ prograφ i≤ no⌠ t∩ displa∙á an∙ ì
  696. informative messages.
  697.  
  698. Inputs: None
  699. èOutputs: A = Quiet Flag (0=not quiet) and Zero Flag set
  700.                accordingly
  701.  
  702.  
  703. Registers Affected: PSW
  704.  
  705. Side Effects: None
  706.  
  707. Special Error Conditions: None
  708.  
  709. :RCP Address    GETRCP
  710.  
  711. Z3LIB Routine: GETRCP
  712.  
  713. Function:
  714.      Returεá thσá addres≤ oµ thσá residen⌠á commanΣá packagσ ì
  715. buffe≥ iε H╠ anΣ thσ sizσ oµ thσ buffe≥ iε term≤ oµ 128-bytσ ì
  716. block≤ iε A«á  Iµ therσ i≤ n∩ RC╨ buffer¼á A=░ anΣ Zer∩ Flaτ ì
  717. Se⌠ (Z).
  718.  
  719.      GETRC╨ simpl∙ return≤ detail≤ oε thσ RC╨ buffe≥ addres≤ ì
  720. anΣá size¼á bu⌠ i⌠ doe≤ no⌠ sa∙ iµ aε RC╨ i≤ residen⌠ withiε ì
  721. it«á  T∩á finΣ thi≤ out¼á looδ a⌠ thσ firs⌠ bytσ oµ thσá RC╨ ì
  722. buffer¼á and¼á iµ i⌠ i≤ zero¼á theε therσ i≤ n∩ RC╨ present«  ì
  723. Example:
  724.           ext  getfcp    ;reference
  725.           call getfcp    ;obtain data
  726.           jz   nofcpbuf  ;no FCP buffer is available
  727.           mov  a,m       ;get first byte of buffer
  728.           ora  a         ;set zero flag accordingly
  729.           jz   nofcpload ;no FCP is in the buffer
  730.  
  731. Inputs: None
  732.  
  733. Outputs║ H╠ ╜ addres≤ oµ RC╨ buffer
  734.                A=0 and Zero Flag Set (Z) if no buffer, else
  735.                A=sizσ oµ buffe≥ iε 128-bytσ block≤ anΣ NZ
  736.  
  737. Registers Affected: HL, PSW
  738.  
  739. Side Effects: None
  740.  
  741. Special Error Conditions: None
  742.  
  743. :Shell Stack    GETSH1/GETSH2
  744.  
  745. Z3LIB Routine: GETSH1
  746.  
  747. Function:
  748.      Returεá thσ addres≤ oµ thσ shel∞ stacδ iε HL¼á thσ sizσ ì
  749. oµá eacΦ shel∞ stacδ entr∙ iε B¼á anΣ thσ numbe≥ oµá entrie≤ ì
  750. possiblσ iε thσ shel∞ stacδ iε A«  A=░ anΣ Zer∩ Flaτ Se⌠ (Z⌐ ì
  751. if there is no shell stack.
  752.  
  753.      Seσá thσ SHPUS╚ anΣ SHPO╨ routine≤ fo≥ detai∞ oεá othe≥ ì
  754. facilitie≤ fo≥ dealinτ witΦ shel∞ stack≤ provideΣ b∙á Z3LIB«  ì
  755. GETSH▒ serve≤ mainl∙ t∩ providσ data.
  756.  
  757. Inputs: None
  758.  
  759. Outputs: HL = address of Shell Stack
  760.                B = number of bytes in each shell stack entry
  761.                A = number of entries possible in the stack
  762.                     A = 0 and Zero Flag Set (Z) if no stack
  763.  
  764.  
  765. Registers Affected: HL, B, PSW
  766.  
  767. Side Effects: None
  768.  
  769. Special Error Conditions: None
  770.  
  771.  
  772. Z3LIB Routine: GETSH2
  773.  
  774. Function:
  775.      Returε thσ addres≤ oµ thσ shel∞ stacδ iε HL¼á thσá sizσ ì
  776. oµá eacΦ shel∞ stacδ entr∙ iε DE¼á anΣ thσ numbe≥ oµ entrie≤ ì
  777. possiblσ iε thσ shel∞ stacδ iε botΦ ┴ anΣ B«á  A=░ anΣá Zer∩ ì
  778. Flaτ Se⌠ (Z⌐ iµ therσ i≤ n∩ shel∞ stack.
  779.  
  780.      Seσá thσá SHPUS╚á anΣ SHPO╨ routine≤á fo≥á othe≥á Z3LI┬ ì
  781. capabilitie≤á wr⌠ shells«á  GETSH▓ serve≤ mainl∙ t∩á providσ ì
  782. datß iε ß forφ tha⌠ i≤ morσ usablσ fo≥ certaiεá application≤ ì
  783. thaε GETSH1.
  784.  
  785. Inputs: None
  786.  
  787. Outputs: HL = address of Shell Stack
  788.               DE = number of bytes in each shell stack entry
  789.              A,B = number of entries possible in the stack
  790.                     A = 0 and Zero Flag Set (Z) if no stack
  791.  
  792.  
  793. Registers Affected: HL, DE, B, PSW
  794.  
  795. Side Effects: None
  796.  
  797. Special Error Conditions: None
  798.  
  799.  
  800. :Wheel Byte     GETWHL/PUTWHL
  801.  
  802. Z3LIB Routine: GETWHL
  803.  
  804. Function:
  805.      Returε thσ Whee∞ Bytσ iε A«  A╜ ░ anΣ Zer∩ Flaτ Se⌠ (Z⌐ ì
  806. iµ thσ prograφ i≤ NO╘ t∩ givσ Whee∞ powers¼ A=0FF╚ anΣ N┌ iµ ì
  807. thσ prograφ i≤ t∩ ruε iε ß privelegeΣ mode.
  808.  
  809.      B∙ whee∞ operation¼á thσ prograφ i≤ no⌠ t∩ prohibi⌠ thσ ì
  810. use≥ froφ performinτ an∙ function«á  Fo≥ instance¼á allowinτ ì
  811. thσá use≥ t∩ changσ thσ PAT╚ shoulΣ bσ ß Whee∞á functioεá s∩ ì
  812. tha⌠á thσá "normalóá use≥á i≤á no⌠á alloweΣá t∩á changσá hi≤ ì
  813. environmen⌠ whilσ ß "privelegedó use≥ is.
  814.  
  815. Inputs: None
  816.  
  817. Outputs: A = Wheel Byte (0=not wheel) and Zero Flag set
  818.                accordingly
  819.  
  820.  
  821. Registers Affected: PSW
  822.  
  823. Side Effects: None
  824.  
  825. Special Error Conditions: None
  826.  
  827.  
  828. Z3LIB Routine: PUTWHL
  829.  
  830. Function:
  831.      Se⌠ thσ Whee∞ Bytσ iε A«  A╜ ░ anΣ Zer∩ Flaτ Se⌠ (Z⌐ iµ ì
  832. thσá prograφ i≤ NO╘ t∩ givσ Whee∞ powers¼á A=0FF╚ anΣ N┌á iµ ì
  833. thσ prograφ i≤ t∩ ruε iε ß privelegeΣ mode.
  834.  
  835. Inputs: A=Wheel Byte Value
  836.  
  837. Outputs: None
  838.  
  839. Registers Affected: None
  840.  
  841. Side Effects: Wheel Byte is Set
  842.  
  843. Special Error Conditions: None
  844.  
  845. :ZEX Data      GETZFC/GETZNC/GETZRUN
  846.  
  847. Z3LIB Routine: GETZFC
  848.  
  849. Function:
  850.      GETZF├ return≤ thσ addres≤ iε H╠ oµ thσ firs⌠ characte≥ ì
  851. iεá thσ ZE╪ tex⌠ buffer«á  Carr∙ Flaτ i≤ se⌠ iµ datß i≤á no⌠ ì
  852. available.
  853.  
  854. Inputs: None
  855.  
  856. Outputs: HL = Address of First Character
  857.                A = Character
  858.                Carry Flag Set (C) if No Data
  859.  
  860. Registers Affected: HL, PSW
  861.  
  862. Side Effects: None
  863.  
  864. Special Error Conditions: None
  865.  
  866. Z3LIB Routine: GETZNC
  867.  
  868. Function:
  869.      GETZN├á return≤ thσ addres≤ iε H╠ oµ thσ nex⌠ characte≥ ì
  870. whicΦ ZE╪ wil∞ return«  Carr∙ Flaτ i≤ Se⌠ iµ n∩ data«  Reτ ┴ ì
  871. contains the character.
  872.  
  873. Inputs: None
  874.  
  875. Outputs: HL = Address of Next Character in ZEX Text Buffer
  876.                A = Next Character in ZEX Text Buffer
  877.                Carry Flag Set (C) if no data
  878.  
  879. Registers Affected: HL, PSW
  880.  
  881. Side Effects: None
  882.  
  883. Special Error Conditions: None
  884.  
  885.  
  886. Z3LIB Routine: GETZRUN
  887.  
  888. Function:
  889.      GETZRU╬á return≤ thσ ZE╪ Ruε Messagσ Bytσ iεá A«á  Zer∩ ì
  890. Flaτá i≤ se⌠ accordingly«á  Carr∙ Flaτ i≤ Se⌠ iµ n∩á messagσ ì
  891. available«á  Thi≤ messagσ indicate≤ iµ ZE╪ i≤ runninτ o≥ no⌠ ì
  892. (A=0 if not running).
  893.  
  894. Inputs: None
  895.  
  896. Outputs: A = ZEX Run Message
  897.                Carry Flag Set (C) if no data
  898.  
  899. Registers Affected: PSW
  900.  
  901. Side Effects: None
  902.  
  903. Special Error Conditions: None
  904.  
  905.  
  906. Z3LIB Routine: PUTZNC
  907.  
  908. Function:
  909.      PUTZN├ set≤ thσ addres≤ oµ thσ nex⌠ characte≥ whicΦ ZE╪ ì
  910. wil∞ returε t∩ tha⌠ containeΣ iε HL«á  Thi≤ routinσ provide≤ ì
  911. a GOTO function for ZEX control.
  912.  
  913. Inputs: HL = address of next character ZEX will return
  914.  
  915. Outputs: Carry Flag Set (C) if data not available
  916.                (Message Buffers not available)
  917.  
  918. Registers Affected: PSW
  919.  
  920. Side Effects: ZEX Next Character Address Message is set
  921.  
  922. Special Error Conditions: None
  923.  
  924.  
  925. Z3LIB Routine: PUTZRUN
  926.  
  927. Function:
  928.      PUTZRU╬ set≤ thσ ZE╪ Runninτ Messagσ bytσ t∩ thσá valuσ ì
  929. iεá thσá ┴ register«á  Carr∙ Flaτ i≤ Se⌠ upoε returεá iµá n∩ ì
  930. message≤á arσ supported«á  Thi≤ messagσ indicate≤ iµ ZE╪á i≤ ì
  931. running¼ anΣ A=░ iµ ZE╪ i≤ no⌠ running.
  932.  
  933. Inputs: A=Value of ZEX Running Message Byte
  934.  
  935. Outputs: Carry Flag Set if no message buffers
  936.  
  937. Registers Affected: PSW
  938.  
  939. Side Effects: ZEX Running Message Byte is set
  940.  
  941. Special Error Conditions: None
  942.  
  943.