home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / sigm / vol106 / syslib.ws < prev    next >
Encoding:
Text File  |  1985-02-10  |  106.4 KB  |  3,313 lines

  1. .he                 SYSLIB User and Reference Manual
  2. .fo  1 - Introduction                                      Page #
  3. .pn 1
  4.  
  5.  
  6.  
  7.       SYSLIB -- An Integrated Library of Assembly Language
  8.   Utility Subroutines for use with the Microsoft M80 Assembler
  9.  
  10.  
  11. 1.0  Introduction
  12.  
  13. 1.01 What is SYSLIB?
  14.  
  15.      SYSLI┬á (SYSteφ LIBrary⌐ i≤ ß collectioε oµ ove≥ 13░ subrouì
  16. tine≤ whicΦ arσ designeΣ t∩ providσ t∩ thσ CP/═ 8080/Z8░ assembl∙ ì
  17. languagσá programme≥ ß se⌠ oµ function≤ upoε whicΦ hσá caεá builΣ ì
  18. hi≤ programs«  Thi≤ librar∙ i≤ intendeΣ t∩ relievσ thσ programme≥ ì
  19. oµá thσ tasδ oµ frequentl∙ "reinventinτ thσ wheeló anΣ t∩ providσ ì
  20. hiφ witΦ aε environmen⌠ oµ reliablσ tool≤ whicΦ encourage≤ strucì
  21. tureΣ programminτ a⌠ thσ assembl∙ languagσ level.
  22.  
  23.      EacΦá subroutinσ withiε SYSLI┬ caε bσ vieweΣ a≤á ßá reliablσ ì
  24. "blacδ box.ó  Thσ subroutine≤ iε SYSLI┬ arσ completel∙ documenteΣ ì
  25. withiεá thi≤ 112½ pagσ manua∞ anΣ thσ SYSLIBx.HL╨ files¼á anΣ thσ ì
  26. programme≥á i≤ consistentl∙ provideΣ witΦ thσ followinτá informaì
  27. tion:
  28.           1.  Name of Subroutine
  29.           2.  Function it performs
  30.           3.  What its inputs are
  31.           4.  What its outputs are
  32.           5.  What registers are affected by it
  33.           6.  What other library routines it calls upon
  34.           7.  What errors can occur and how it handles them
  35.  
  36.      Thσ routine≤ withiε SYSLI┬ arσ designeΣ t∩ worδ togethe≥ anΣ ì
  37. complemen⌠ eacΦ other«á  Paramete≥ passinτ i≤ consisten⌠á betweeε ì
  38. thσ variou≤ subroutines╗á  Fo≥ instance¼á al∞ routine≤ whicΦ neeΣ ì
  39. t∩á bσá passeΣ ß pointe≥ t∩ ß Filσ Contro∞ Blocδ arσ passeΣá tha⌠ ì
  40. pointe≥ iε thσ D┼ registe≥ pair«á  A≤ ß genera∞ rule¼ iµ ß regisì
  41. te≥ i≤ no⌠ returneΣ a≤ aε outpu⌠ froφ thσ SYSLI┬ subroutine¼ theε ì
  42. it≤ valuσ i≤ no⌠ affecteΣ (i⌠ ha≤ thσ samσ valuσ wheε thσ routinσ ì
  43. i≤ exiteΣ a≤ i⌠ haΣ wheε thσ routinσ wa≤ called).
  44.  
  45.      SYSLI┬á itselµá i≤ ß librar∙ oµ relocatablσá objec⌠á module≤ ì
  46. createΣá iεá thσ Microsof⌠ M8░ relocatablσá objec⌠á format«á  Al∞ ì
  47. subroutine≤ withiε SYSLI┬ arσ groupeΣ withiε functionally-relateΣ ì
  48. modules«á  Oncσá ß routinσ i≤ referenceΣ (b∙ thσ EX╘ statemen⌠ iε ì
  49. thσ M8░ assembl∙ languagσ program)¼á it≤ modulσ i≤ loadeΣ anΣá i⌠ ì
  50. i≤á availablσá t∩ thσ programme≥ b∙ mean≤ oµ ß simplσá subroutinσ ì
  51. call«á  Al∞á othe≥ subroutine≤ withiε tha⌠ particula≥ modulσá arσ ì
  52. als∩ loaded¼á bu⌠ the∙ arσ no⌠ availablσ t∩ thσ programme≥ unles≤ ì
  53. hσá ha≤ als∩ referenceΣ theφ b∙ EX╘ statements«á  Thσá modulσá i≤ ì
  54. loadeΣá onl∙á once¼á regardles≤ oµ ho≈ man∙ routine≤á withiεá thσ ì
  55. modulσá arσ referenced«á  Fo≥ thi≤ reason¼á ╔ havσ designeΣá eacΦ ì
  56. modulσá t∩ contaiε routine≤ whicΦ arσ frequentl∙ useΣ togethe≥ o≥ ì
  57. arσá calleΣá b∙ eacΦ othe≥ (onσ routinσ withiε thσá modulσá call≤ ì
  58. another routine within the module).
  59. è
  60. 1.02 What is Needed to Use SYSLIB?
  61.  
  62.      Yo⌡á neeΣ aε 8080- o≥ Z80-baseΣ microcompute≥ witΦ a⌠á leas⌠ ì
  63. 48╦á byte≤ oµ contiguou≤ memor∙ runninτ CP/═ 2.2¼á thσá Microsof⌠ ì
  64. M8░á assemble≥ too∞ se⌠ (specifically¼á thσ M8░ assemble≥ anΣ thσ ì
  65. L8░ linker)¼á anΣ thσ usua∞ se⌠ oµ softwarσ developmen⌠ tool≤ (aε ì
  66. edito≥ and¼ preferably¼ ß debugger⌐ t∩ usσ SYSLIB.
  67.  
  68.  
  69.  
  70. 1.03 What Does SYSLIB Buy Me?
  71.  
  72.      Thσ bottoφ linσ i≤ that¼á t∩ thσ experienceΣ SYSLI┬ programì
  73. mer¼á SYSLI┬ ha≤ thσ potentia∞ oµ beinτ ß significan⌠ too∞á whicΦ ì
  74. enable≤ hiφ to:
  75.  
  76.           1.  Solve his programming task quickly
  77.                -- becausσá hσ spend≤ les≤ timσ writinτá comì
  78. áááámonly-useΣ subroutine≤ anΣ worryinτ abou⌠ ho≈ hi≤ regisì
  79. ááááter≤á arσá affecteΣ b∙ thesσ subroutine≤ anΣá morσá timσ ì
  80. ááááconcentratinτ oε thσ probleφ a⌠ hand
  81.  
  82. áááá      2.  Write space- and speed-efficient code
  83. áááá           -- becausσá al∞á oµ thσ SYSLI┬ routine≤á havσ ì
  84. áááábeeε gonσ ove≥ timσ anΣ timσ agaiε t∩ reducσ thei≥á sizσ ì
  85. ááááanΣá makσá theφ morσ efficien⌠ iε term≤á oµá speed╗á fo≥ ì
  86. ááááexample¼á thσá SOR╘ routinσ i≤ ß Shel∞ Sor⌠ tha⌠ caεá bσ ì
  87. áááácalleΣ t∩ perforφ thσ sor⌠ usinτ pointer≤ (iε whicΦ casσ ì
  88. áááái⌠á exchange≤ pointer≤ rathe≥ thaε record≤ wheε i⌠ need≤ ì
  89. áááát∩ d∩ ß swap⌐ o≥ perforφ thσ sor⌠ withou⌠ usinτ pointer≤ ì
  90. áááá(wheε spacσ i≤ ß facto≥ anΣ therσ ma∙ no⌠ bσ enougΦ rooφ ì
  91. ááááfo≥ ß pointe≥ table)
  92.  
  93. áááá      3«  Writσ morσ maintainablσ code
  94. áááá           -- becausσ SYSLI┬ i≤ designeΣ witΦ structureΣ ì
  95. ááááprogramminτ philosoph∙ iε mind╗ eacΦ subroutinσ i≤ equiì
  96. áááávalen⌠á t∩ ß proces≤ box¼á havinτ (1⌐ onl∙ onσá entrancσ ì
  97. ááááanΣ onσ exit¼á (2⌐ ß precisely-defineΣ function¼ anΣ (3⌐ ì
  98. ááááß precisely-defineΣ se⌠ oµ inpu⌠ anΣ outpu⌠á parameters╗ ì
  99. ááááhavinτá useΣá SYSLI┬ fo≥ somσ timσ now¼á thσ autho≥á ha≤ ì
  100. áááánoteΣ tha⌠ hi≤ programminτ though⌠ processe≤ anΣ prograφ ì
  101. áááádesign≤á havσ tendeΣ morσ anΣ morσ towarΣá end-inôá (top-ì
  102. áááádowε froφ thσ objectivσ poin⌠ oµ vie≈ anΣ bottom-u≡ froφ ì
  103. ááááthσ SYSLI┬ subroutinσ poin⌠ oµ view)¼ structureΣ design≤ ì
  104. áááátha⌠á hσá caεá g∩ bacδ t∩ a⌠ ß late≥á datσá anΣá readil∙ ì
  105. áááádeciphe≥ anΣ modify
  106.  
  107.  
  108. áááá      4.  Reduce the programming effort
  109. áááá           -- becausσá SYSLI┬ provide≤ ß numbe≥ oµá ver∙ ì
  110. ááááinvolveΣ routine≤ whicΦ would¼ iε themselves¼ takσ quitσ ì
  111. áááásomσá timσ t∩ code╗á fo≥ example¼á thσ DIR╞ routinσ wil∞ ì
  112. ááááloaΣ thσ director∙ oµ ß disδ int∩ memory¼á selec⌠ ßá se⌠ ì
  113. ááááoµá file≤á froφ tha⌠ loadeΣ director∙ a≤ specifieΣ b∙á ß ì
  114. ááááFilσ Contro∞ Blocδ anΣ ß flaτ whicΦ indicate≤ whethe≥ t∩ ì
  115. ááááincludσ Systeφ o≥ Non-Systeφ file≤ anΣ wha⌠ use≥ areß i≤ ì
  116. áááát∩á bσ examined¼á pack≤ thσ loadeΣá director∙á (removinτ ì
  117. ááááentrie≤ no⌠ selecteΣ froφ thσ memor∙ buffer)¼á alphabetì
  118. ááááize≤á thσ director∙ entrie≤ b∙ filσ namσ anΣ typσ o≥á b∙ ì
  119. ááááfilσá typσ anΣ name¼á anΣ return≤ ß pointe≥ t∩ thσ firs⌠ ì
  120. ááááentr∙ anΣ ß coun⌠ oµ thσ numbe≥ oµ entrie≤ selected
  121.  
  122.  
  123.      Iε man∙ ways¼á SYSLI┬ bring≤ somσ oµ thσ advantage≤ oµá proì
  124. gramminτá iεá ß High-Orde≥ Language¼á likσ ├ o≥á Pascal¼á t∩á thσ ì
  125. assembl∙á languagσá programmer«á I⌠á allow≤ hiφ t∩á maintaiεá thσ ì
  126. smalle≥ codσ sizσ anΣ greate≥ efficienc∙ whicΦ caε bσ realizeΣ iε ì
  127. assembl∙á languagσ programminτ anΣ simultaneousl∙ realizσá ßá reì
  128. duceΣá life-cyclσá cos⌠á (froφ developmen⌠ t∩ fieldinτá t∩á post-ì
  129. fieldinτá maintenancσá anΣ modification⌐ ove≥á assembl∙á languagσ ì
  130. programminτ withou⌠ ß SYSLIB-likσ too∞ set.
  131.  
  132.  
  133.  
  134. 1.04 How Do I Assemble with SYSLIB?
  135.  
  136.      EacΦá examplσ iε Sectioε 2▒ oµ thi≤ manua∞ show≤ aε assembl∙ ì
  137. oµ thσ samplσ program«á  ╔ frequentl∙ usσ ß commanΣ file¼ whicΦ ╔ ì
  138. cal∞ M80.SUB¼á t∩ assemblσ m∙ programs«á  Thi≤ commanΣ filσ take≤ ì
  139. onl∙ onσ parameter¼á thσ namσ oµ thσ filσ t∩ bσ assembleΣ WITHOU╘ ì
  140. its type (MAC is assumed).  Warning:  The command MUST be:
  141.  
  142.                         SUB M80 filename
  143.  
  144. and it MUST NOT be:
  145.  
  146.                       SUB M80 filename.typ
  147.  
  148. Iµá i⌠á i≤ oµ thσ latte≥ form¼á thσ sourcσ codσ wil∞á bσá deleteΣ ì
  149. durinτ thσ assembl∙ processí  Yo⌡ ma∙ wisΦ t∩ removσ the
  150.  
  151.                            ER┴ $1.BAK 
  152.  
  153. commanΣ iε thσ M80.SU┬ filσ t∩ eliminatσ thi≤ problem«  ╔ onl∙ d∩ ì
  154. this for a space savings.
  155.  
  156.  
  157.      My M80.SUB command file is:
  158.  
  159. ;  M80.SUB -- MACRO-80 Assembler and Linker
  160. M80 =$1
  161. SUB /A  PLEASE ABORT IF ERROR(S) EXIST
  162. ERA $1.BAK
  163. ERA $1.COM
  164. L80 /P:100,$1,A:SYSLIB/S,$1/N,/U,/E
  165. ERA $1.REL
  166. ;  ASSEMBLY COMPLETE
  167.  
  168.      ╔ ruε ZCPR▓ insteaΣ oµ thσ CP/═ 2.▓ CCP¼á anΣ ╔ aφ alway≤ oε ì
  169. Drivσá B║á doinτá m∙á developmen⌠á work¼á whilσá m∙á editor≤á anΣ ì
  170. assembler≤ (anΣ SYSLIB.REL⌐ arσ oε Drivσ A:«á  Notσ tha⌠ thi≤á i≤ ì
  171. reflected in M80.SUB, where L80 looks for A:SYSLIB for the scan.
  172.  
  173.  
  174.  
  175. 1.05 How Do I Learn to Use SYSLIB Effectively?
  176.  
  177.      Thi≤ is¼ oµ course¼ opinion¼ bu⌠ ╔ fee∞ tha⌠ thσ bes⌠ wa∙ t∩ ì
  178. learn how to use SYSLIB would involve the following steps:
  179.  
  180.           1«á  Stud∙á thσá SYSLI┬ manua∞ iε aε overvie≈á fashion¼ ì
  181. familiarizinτá yourselµá witΦ thσ function≤á oµá thσá subroutine≤ ì
  182. available
  183.  
  184.           2«á  Stud∙ iε somσ detai∞ thσ samplσ sourcσ program≤ iε ì
  185. Sectioε 21¼ jumpinτ bacδ t∩ thσ maiε bod∙ oµ thσ manua∞ froφ timσ ì
  186. t∩á timσ t∩ seσ wh∙ thσ routine≤ ╔ selecteΣ iε thσ program≤á werσ ì
  187. used in the way I used them
  188.  
  189.           3«  Tr∙ codinτ ß couplσ oµ thσ routine≤ iε thi≤ manual¼ ì
  190. copying them verbatim and assembling them
  191.  
  192.           4«  Tr∙ makinτ u≡ ß fe≈ simplσ problem≤ oµ you≥ owε anΣ ì
  193. use SYSLIB to code them
  194.  
  195.           5«á  Appl∙á SYSLI┬ t∩ ß significan⌠ prograφ yo⌡ wan⌠ t∩ ì
  196. write
  197.  
  198.      ╔ aφ ß stronτ advocatσ oµ writinτ program≤ iε orde≥ t∩ learε ì
  199. ho≈ t∩ program¼á anΣ ╔ fee∞ tha⌠ i⌠ i≤ mos⌠ importan⌠ t∩ (1⌐ gaiε ì
  200. a≤á mucΦ familiarit∙ witΦ thσ SYSLI┬ routine≤ a≤ yo⌡ caε anΣá (2⌐ ì
  201. t∩ writσ program≤ usinτ thesσ routines.
  202.  
  203.  
  204.  
  205.  
  206. 1.06 Who May Use SYSLIB?
  207.  
  208.      SYSLI┬ i≤ hereb∙ releaseΣ t∩ thσ publiπ domain«á  Anyonσ wh∩ ì
  209. wishe≤ t∩ US┼ i⌠ ma∙ d∩ s∩ witΦ n∩ string≤ attached«á  Thσ autho≥ ì
  210. assume≤ n∩ responsibilit∙ o≥ liabilit∙ fo≥ thσ usσ oµ SYSLIB«  I⌠ ì
  211. i≤ copyrighteΣ b∙ thσ author¼á RicharΣ Conn¼á wh∩ ha≤ solσ right≤ ì
  212. t∩á it«á  SYSLI┬ anΣ it≤ associateΣ documentatioε ma∙ bσ solΣá b∙ ì
  213. itselµá o≥á a≤ aε independen⌠ par⌠ oµ ß packagσ oµ program≤á onl∙ ì
  214. witΦá thσ express¼á writteε consen⌠ oµ thσ author«á  Thσá author¼ ì
  215. however¼ support≤ thσ usσ oµ SYSLI┬ b∙ commercia∞ softwarσ develì
  216. opers¼á anΣá place≤ n∩ restrictioε oε thσ salσ oµ program≤á whicΦ ì
  217. arσá BASE─ oε SYSLI┬ anΣ usσ routine≤ containeΣ withiε SYSLI┬á t∩ ì
  218. perforφ thei≥ majo≥ functions.
  219.  
  220.  
  221.  
  222.      ╔á hopσ yo⌡ enjo∙ usinτ SYSLI┬ anΣ finΣ i⌠ t∩ bσ a≤ usefu∞ ß ì
  223. tool as I do.
  224.  
  225.                                         Richard Conn
  226.  
  227. .fo  2 - Directory Manipulation Routines                   Page #
  228.  
  229. 2.0  SYSLIB Directory Manipulation Routines
  230.  
  231.  
  232. 2.01 Introduction
  233.      Thi≤ se⌠ oµ SYSLI┬ routine≤ concern≤ itselµ witΦ thσ loadinτ ì
  234. oµ anΣ acces≤ oµ ß disδ director∙ fo≥ thσ genera∞ purpose≤ oµ thσ ì
  235. user.  Included in this set of routines are the functions of:
  236.  
  237.           1.  Preallocation of buffer space for the routines
  238.  
  239.           2.  Two routines which load all undeleted directory
  240.                entries into a buffer, constantly checking for
  241.                memory overflow as they go
  242.                     DIRLOAD loads the first entry for each file
  243.                          (this is the faster of the two)
  244.                     DIRSLOAD loads the last entry for each file
  245.                          (this routine is required if the
  246.                               user wishes to compute file sizes)
  247.  
  248.           3.  A routine to determine the amount of free space on
  249.                the disk
  250.  
  251.           4.  A routine to compute the size of a file in K
  252.  
  253.           5.  A routine to sort a loaded directory by file name
  254.                and type or by file type and name
  255.  
  256.           6.  A routine to select (by marking) a set of directory
  257.                entries which match a given ambiguous file spec
  258.  
  259.           7.  A routine to pack the loaded directory, leaving in
  260.                it only those entries marked by the select routine
  261.  
  262.  
  263.  
  264. 2.02 Generalized Routines -- DIRF and DIRFS
  265.      Routine Name: DIRF and DIRFS
  266.      Function║
  267.           Thi≤ routinσ initialize≤ thσ buffe≥ area¼á load≤ ß disδ ì
  268. directory¼á select≤á ßá se⌠á oµ file≤ froφ thσá loadeΣá director∙ ì
  269. specifieΣá b∙á thσ user'≤ ambiguou≤ filσ namσ anΣ ßá passeΣá flaτ ì
  270. (whicΦ indicate≤ iµ Systeφ file≤ arσ selected¼á Non-systeφá file≤ ì
  271. arσá selected¼á al∞á use≥á area≤á arσ t∩á bσá covered¼á anΣá wha⌠ ì
  272. particula≥á use≥ areß i≤ t∩ bσ covereΣ iµ al∞ use≥ area≤ arσá no⌠ ì
  273. selected)¼ pack≤ thσ directory¼ anΣ alphabetize≤ thσ director∙ b∙ ì
  274. filσ namσ anΣ filσ type.
  275.      Iµá DIR╞ i≤ used¼á thσ processinτ proceed≤ faste≥ sincσ onl∙ ì
  276. thσá firs⌠ entr∙ oµ eacΦ filσ i≤ loadeΣ int∩ thσá memor∙á buffer«  ì
  277. Filσ sizinτ informatioε i≤ no⌠ includeΣ iε thi≤ load¼ however.
  278.      Iµ DIRF╙ i≤ used¼ thσ processinτ i≤ somewha⌠ slower¼ bu⌠ thσ ì
  279. las⌠á entr∙ fo≥ eacΦ filσ i≤ loadeΣ rathe≥ thaε thσ first«á  Filσ ì
  280. sizinτá informatioεá i≤á containeΣá iεá thi≤á entry¼áá anΣáá thi≤ ì
  281. informatioε caε bσ useΣ b∙ thσ FSIZ┼ routine.
  282.  
  283.      Inputs:  HL points to a dynamic buffer which extends from
  284.                after the user's code and buffer areas to the
  285.                end of the TPA
  286.               DE points to the first byte of the FCB used to
  287.                specify the ambiguous file name; only the chars
  288.                in the FN and FT fields are significant, so this
  289.                need not be a true FCB and may be as short as 12
  290.                bytes
  291.               A is the selection flag, structured as follows:
  292.                Bit 7 - If Set, Select Non-System Files
  293.                Bit 6 - If Set, Select System Files
  294.                Bit 5 - If Set, Select All User Areas
  295.                Bits 4-0 - If Bit 5 is Cleared, contains number
  296.                     of User Area to Select
  297.  
  298.      Outputs:  HL points to the first file entry in the buffer;
  299.                 each file entry is 16 bytes long
  300.                BC contains the number of files selected
  301. ááááá          A contains an error flag; A=0 and Zero Flag Set
  302. ááááá           (Z) indicates TPA overflow error during load of
  303. ááááá           directory entries; A<>0 and NZ indicates load OK
  304.  
  305.      Registers Affected:  HL, BC, PSW
  306.  
  307.      SYSLIB Routines Called:  DBUFFER, DIRLOAD, DIRSEL, DIRPACK,
  308.                               DIRALPHA
  309.  
  310.      Special Error Conditions:  As outline for the A register
  311. ááááá     above.
  312.  
  313.  
  314.  
  315. 2.03 Buffer Allocation Routine -- DBUFFER
  316.      Routine Name: DBUFFER
  317.      Function:
  318.           Thi≤á routinσ allocate≤ thσ buffe≥ spacσ necessar∙á fo≥ ì
  319. thσá se⌠ oµ director∙ function≤ iε general«á  Iεá particular¼á i⌠ ì
  320. allocate≤ thσ necessar∙ spacσ fo≥ thσ alphabetizatioε functioε a≤ ì
  321. wel∞ a≤ thσ loadeΣ director∙ itself«á  Thi≤ routinσ mus⌠ bσá useΣ ì
  322. iµá thσá DIRALPH┴á routinσá i≤á t∩ bσá late≥á useΣá t∩á sor⌠á thσ ì
  323. directory╗á thi≤á routinσá allocate≤ al∞ thσ spacσá necessar∙á b∙ ì
  324. DIRALPH┴ t∩ sor⌠ thσ routinσ (pointe≥ space)«  Iµ thi≤ routinσ i≤ ì
  325. called¼ i⌠ i≤ no⌠ necessar∙ t∩ cal∞ thσ DPARAM╙ routine.
  326.  
  327.      Inputs:  HL points to the beginning address of a dynamic
  328. ááááá          buffer area which extends to under the CCP
  329.  
  330.      Outputs:  HL points to the first byte at which the directory
  331. ááááá           entries are to be loaded
  332. ááááá          A=0 and Zero Flag is Set (Z) if the CCP is
  333. ááááá           already overrun; else, A<>0 and NZ
  334.  
  335.      Registers Affected:  HL, PSW
  336.  
  337.      SYSLIB Routines Called:  DPARAMS
  338.  
  339.      Special Error Conditions:  As indicated by A reg and Z flag
  340.  
  341.  
  342.  
  343. 2.04 Disk Parameter Information Extraction Routine -- DPARAMS
  344.      Routine Name:  DPARAMS
  345.      Function:
  346.      Thi≤á routinσá extract≤ necessar∙ informatioε froφ thσá Disδ ì
  347. Paramete≥á Blocδ (DPB⌐ anΣ store≤ i⌠ awa∙ iε somσ globa∞á buffer≤ ì
  348. useΣ b∙ othe≥ Disδ Director∙ Routines«  Thσ informatioε extracteΣ ì
  349. i≤ no⌠ oµ genera∞ concerε b∙ thσ programmer«á  AL╠ TH┼ PROGRAMME╥ ì
  350. NEED╙á T╧ KNO╫ I╙ THA╘ THI╙ ROUTIN┼ MUS╘ B┼ CALLE─ A╘ LEAS╘á ONC┼ ì
  351. BEFOR┼ TH┼ DIRLOA─ O╥ DIRSLOA─ ROUTIN┼ I╙ CALLED«  Iµ thσ DBUFFE╥ ì
  352. routinσá i≤á called¼á theε i⌠ i≤ no⌠ necessar∙á t∩á cal∞á DPARAM╙ ì
  353. again.
  354.      Fo≥ thσ informatioε oµ thσ reader¼ thσ followinτ informatioε ì
  355. i≤ extracted:
  356. ááááá          BLKSHF <-- Block Shift Factor (1 Byte)
  357. ááááá          BLKMSK <-- Block Mask (1 Byte)
  358. ááááá          EXTENT <-- Extent Mask (1 Byte)
  359. ááááá          BLKMAX <-- Max Number of Blocks on Disk (2 Bytes)
  360. ááááá          DIRMA╪ <-- Ma° Numbe≥ oµ Di≥ Entrie≤ (▓ Bytes)
  361.      Thi≤á routinσ automaticall∙ adjust≤ fo≥ version≤ 1.┤ anΣ 2.▓ ì
  362. oµ CP/═ anΣ i≤ compatablσ witΦ botΦ version≤ oµ CP/M.
  363.  
  364.      Inputs:  None
  365.  
  366.      Outputs:  None (Information Extracted into Buffers)
  367.  
  368.      Registers Affected:  None
  369.  
  370.      SYSLIB Routines Called:  None
  371.  
  372.      Special Error Conditions:  None
  373.  
  374.  
  375.  
  376. 2.05 Free Space Computation Routine -- DFREE
  377.      Routine Name: DFREE
  378.      Function:
  379.           Thi≤á routinσá compute≤ thσ amoun⌠ oµ freσ spacσ (iεá ╦ ì
  380. bytes⌐ lef⌠ oε disk.
  381.  
  382.      Inputs:  None
  383.  
  384.      Outputs:  DE = Amount of Free Disk Space in K Bytes
  385.  
  386.      Registers Affected:  DE
  387.  
  388.      SYSLIB Routines Called:  DPARAMS
  389.  
  390.      Special Error Conditions:  None
  391.  
  392.  
  393.  
  394.  
  395. 2.06 File Size Computation Routine -- FSIZE
  396.      Routine Name: FSIZE
  397.      Function:
  398.           Thi≤á routinσá compute≤ thσ sizσ oµ ß filσ whosσá entr∙ ì
  399. (whicΦá MUS╘ bσ loadeΣ b∙ DIRSLOAD⌐ i≤ pointeΣ t∩á b∙á HL«á  Thi≤ ì
  400. routinσ wil∞ work¼ bu⌠ generall∙ returε incorrec⌠ results¼ iµ thσ ì
  401. entr∙ pointeΣ t∩ wa≤ loadeΣ b∙ DIRLOA─ instead.
  402.  
  403.      Inputs:  HL points to first byte of file entry
  404.  
  405.      Outputs:  DE contains the file size in K Bytes
  406.  
  407.      Registers Affected:  DE
  408.  
  409.      SYSLIB Routines Called:  DPARAMS
  410.  
  411.      Special Error Conditions:  None
  412.  
  413.  
  414. 2.07 Directory Load Routines -- DIRLOAD and DIRSLOAD
  415.      Routine Names: DIRLOAD and DIRSLOAD
  416.      Function:
  417.           DIRLOA─á anΣá DIRSLOA─ loaΣ entrie≤ fo≥á al∞á undeleteΣ ì
  418. file≤á oεá thσá currentl∙ loggeΣ iε disδ int∩ thσá memor∙á buffe≥ ì
  419. pointeΣ t∩ b∙ HL«  Al∞ entrie≤ arσ 1╢ byte≤ long.
  420.      DIRLOA─á i≤ faste≥ thaε DIRSLOAD«á  I⌠ load≤ jus⌠ thσá firs⌠ ì
  421. entr∙ oµ eacΦ filσ oε disk«á  DIRLOAD¼á however¼á shoulΣ bσá useΣ ì
  422. onl∙áá iµá filσá sizinτá informatioεá i≤á no⌠á requireΣá b∙áá thσ ì
  423. application≤ program.
  424.      DIRSLOA─á load≤á jus⌠ thσ LAS╘ entr∙ oµ eacΦ filσá oεá disk«  ì
  425. Thi≤á entr∙ contain≤ thσ necessar∙ filσ sizinτ informatioεá whicΦ ì
  426. ma∙ bσ useΣ b∙ FSIZ┼ t∩ computσ thσ sizσ oµ thσ loadeΣ file.
  427.      Iµá thσá TP┴ i≤ filleΣ durinτ DIRLOA─ o≥ DIRSLOA─ anΣá therσ ì
  428. arσ stil∞ morσ filσ entrie≤ t∩ load¼á thσ loaΣ wil∞ bσ halteΣ anΣ ì
  429. aε erro≥ returε wil∞ bσ madσ t∩ thσ caller«á  Oε return¼á iµá A=░ ì
  430. anΣá thσá Zer∩á Flaτá i≤ Se⌠ (Z)¼á theε ßá loaΣá erro≥á occurred╗ ì
  431. otherwise¼ thσ loaΣ wa≤ OK.
  432.  
  433.      Inputs:  HL points to the first byte of the directory buffer
  434. ááááá          area; this area extends from after the last buffer
  435. ááááá          used by the applications program to the page
  436. ááááá          before the CCP.  If alphabetization is to be done,
  437. ááááá          the value returned in HL by DBUFFER is a correct
  438. ááááá          input for DIRLOAD or DIRSLOAD
  439. ááááá         A=0 and Zero Flag is Set (Z) if TPA Overflow;
  440. ááááá          A<>0 and NZ if load OK
  441.  
  442.      Outputs:  BC is the number of files loaded into the buffer
  443.  
  444.      Registers Affected:  BC
  445.  
  446.      SYSLIB Routines Called:  None
  447.  
  448.      Special Error Conditions:  If TPA is filled and load is
  449. ááááá     incomplete, A=0 and Zero Flag is Set (Z) as error indic
  450.  
  451.  
  452. 2.08 Directory Alphabetization Routine -- DIRALPHA
  453.      Routine Name: DIRALPHA
  454.      Function:
  455.           T∩ alphabetizσ thσ file≤ iε thσ director∙ pointeΣ t∩ b∙ ì
  456. H╠á b∙ eithe≥ filσ namσ anΣ typσ (STEST.AS═ goe≤ beforσ TEST.AAA⌐ ì
  457. o≥ b∙ filσ typσ anΣ namσ (TEST.AA┴ goe≤ beforσ STEST.ASM).
  458.  
  459.      Inputs:  HL points to first directory entry
  460. ááááá         BC contains the number of files to sort
  461. ááááá         ┴ i≤ thσ sor⌠ flag╗ A=░ mean≤ sor⌠ b∙ filσ namσ anΣ ì
  462. ááááá     áááááthen file type, A<>0 means by file type and name
  463.  
  464.      Outputs:  None (directory list is sorted)
  465.  
  466.      Registers Affected:  PSW
  467.  
  468.      SYSLIB Routines Called:  PRINT
  469.  
  470.      Special Error Conditions:
  471. ááááá     I⌠á i≤ possible¼á alth∩ highl∙ unlikel∙ froφ al∞á test≤ ì
  472. ááááágiveεá s∩á far¼á tha⌠á DIRALPH┴ ma∙ experiencσá aεá interna∞ ì
  473. áááááerror.  If this happens, the message:
  474. ááááá          DIRALPHA -- Pointer Error
  475. áááááwil∞ bσ printeΣ anΣ thσ routinσ wil∞ abor⌠ t∩ CP/M«  Iµ thi≤ ì
  476. áááááhappens¼á pleasσá repor⌠á thi≤ probleφ anΣá bσá prepareΣá t∩ ì
  477. áááááduplicatσ thσ exac⌠ situatioε whicΦ causeΣ thi≤ erro≥ t∩ thσ ì
  478. áááááauthor, Richard Conn.
  479.  
  480.  
  481.  
  482. 2.09 Directory Entry Selection Routine -- DIRSEL
  483.      Routine Name: DIRSEL
  484.      Function:
  485.           DIRSE╠á select≤á al∞á entrie≤ iε thσá director∙á buffe≥ ì
  486. whicΦá matcΦ thσ ambiguou≤ filσ namσ specifieΣ iε thσ F╬á anΣá F╘ ì
  487. field≤á oµá thσá FC┬ pointeΣ t∩ b∙ D┼ upoε entr∙á t∩á DIRSEL«á  ┴ ì
  488. selectioεá flaτ i≤ als∩ passeΣ t∩ DIRSE╠ iε thσ ┴á register¼á anΣ ì
  489. thi≤ flaτ tell≤ DIRSE╠ whethe≥ o≥ no⌠ t∩ includσ Non-Systeφ file≤ ì
  490. anΣ Systeφ file≤ iε thσ selectioε anΣ whethe≥ t∩ selec⌠ file≤á iε ì
  491. al∞ use≥ area≤ o≥ iε ß particula≥ use≥ area.
  492.      DIRSE╠á identifie≤ thσ selecteΣ filσ entrie≤ b∙ settinτá thσ ì
  493. Mos⌠á Significan⌠ Bi⌠ oµ thσ firs⌠ bytσ oµ eacΦ oµ thesσá entrie≤ ì
  494. t∩ ▒ iµ thσ entr∙ i≤ selected«á  DIRSE╠ make≤ n∩ othe≥ change≤ t∩ ì
  495. thσ filσ entrie≤ iε thσ director∙ buffer.
  496.  
  497.  
  498.      Inputs:  HL points to the directory buffer
  499. ááááá         D┼á point≤ t∩ thσ FC┬ containinτ thσá ambiguou≤á F╬ ì
  500. ááááá          and FT fields; only the first 12 bytes are needed
  501. ááááá         BC contains the number of files in the directory
  502. ááááá         A contains a selection flag, organized as follows:
  503. ááááá          Bit 7 - Select Non-System Files
  504. ááááá          Bit 6 - Select System Files
  505. ááááá          Bit 5 - Select Files in All User Areas
  506. ááááá          Bits 4-0 - If Bit 5 is 0, indicates number of
  507. ááááá               User Area to select files from
  508.  
  509.      Outputs:  None (MSBs of selected entries are set)
  510.  
  511.      Registers Affected:  None
  512.  
  513.      SYSLIB Routines Called:  None
  514.  
  515.      Special Error Conditions:  None
  516.  
  517.  
  518.  
  519. 2.10 Directory Pack Routine -- DIRPACK
  520.      Routine Name:  DIRPACK
  521.      Function:
  522.           DIRPAC╦á restructure≤ thσ director∙ buffe≥á t∩á contaiε ì
  523. onl∙ thosσ entrie≤ markeΣ b∙ DIRSEL«á  Iε thi≤ way¼ thosσ entrie≤ ì
  524. NO╘á markeΣá b∙ DIRSE╠ arσ discardeΣ froφ thσá buffe≥á (actually¼ ì
  525. jus⌠á takeε ou⌠ oµ consideration¼á bu⌠ thσ content≤ oµ thσ buffe≥ ì
  526. afte≥á thσá las⌠á selecteΣ entr∙ i≤á no⌠á guaranteeΣá t∩á contaiε ì
  527. anythinτ significant).
  528.      Thσá Mos⌠á Significan⌠ Bi⌠ oµ thσ firs⌠ bytσ oµ al∞á entrie≤ ì
  529. remaininτ iε thσ director∙ buffe≥ i≤ rese⌠ t∩ ░ a≤ ß sidσá effec⌠ ì
  530. oµ DIRPACK.
  531.  
  532.      Inputs:  HL points to the directory buffer
  533. ááááá         BC contains the number of files in the buffer
  534.  
  535.      Outputs:  BC contains the number of files (those selected by
  536. ááááá           DIRSEL) remaining in the directory buffer
  537.  
  538.      Registers Affected:  BC
  539.  
  540.      SYSLIB Routines Called:  None
  541.  
  542.      Special Error Conditions:  None
  543.  
  544.  
  545. 2.11 Negative Directory Pack Routine
  546.      Routine Name:  DIRNPACK
  547.      Function:
  548.           DIRNPAC╦á restructure≤ thσ director∙ buffe≥ t∩á contaiε ì
  549. onl∙á thosσá entrie≤ NO╘ markeΣ b∙ DIRSEL«á  Iε thi≤á way¼á thosσ ì
  550. entrie≤ markeΣ b∙ DIRSE╠ arσ discardeΣ froφ thσ buffe≥ (actually¼ ì
  551. jus⌠ takeε ou⌠ oµ consideration¼á bu⌠ thσ content≤ oµ thσá buffe≥ ì
  552. afte≥á thσá las⌠á selecteΣá entr∙ i≤ no⌠á guaranteeΣá t∩á contaiε ì
  553. anythinτ significant).
  554.      Thσá Mos⌠ Significan⌠ Bi⌠ oµ thσ firs⌠ bytσ oµá al∞á entrie≤ ì
  555. remaininτá iε thσ director∙ buffe≥ i≤ rese⌠ t∩ ░ a≤ ß sidσ effec⌠ ì
  556. oµ DIRNPACK.
  557.  
  558.      Inputs:  HL points to the directory buffer
  559. ááááá         BC contains the number of files in the buffer
  560.  
  561.      Outputs:  BC contains the number of files (those NOT selected
  562. ááááá           by DIRSEL) remaining in the directory buffer
  563.  
  564.      Registers Affected:  BC
  565.  
  566.      SYSLIB Routines Called:  DIRPACK
  567.  
  568.      Special Error Conditions:  None
  569.  
  570. .fo  3 - Numeric String Evaluation Routines                Page #
  571.  
  572. 3.0  Numeric String Evaluation Routines
  573.  
  574. 3.01 Evaluation of String at All Bases -- EVAL
  575.      Routine Name:  EVAL
  576.      Function║
  577.           Thi≤á routinσ convert≤ thσ characte≥ strinτ pointeΣá t∩ ì
  578. b∙á H╠á int∩ thσ 16-bi⌠ binar∙ numbe≥ representeΣá b∙á it«á  EVA╠ ì
  579. perform≤á thσá conversioεá unti∞ ß non-hexadecima∞á characte≥á i≤ ì
  580. encountered¼ a⌠ whicΦ timσ i⌠ look≤ a⌠ thσ las⌠ characte≥ anΣ thσ ì
  581. previou≤á characte≥ t∩ determinσ iµ thσ strinτ i≤ representinτá ß ì
  582. binary¼á octal¼á decimal¼á o≥ hexadecima∞ number«á  Inpu⌠á strinτ ì
  583. character≤á ma∙ bσ upper- o≥ lower-case«á  ValiΣ format≤ fo≥á thσ ì
  584. inpu⌠ strinτ arσ --
  585.           bbbbbbbbbbbbbbbbB -- b=0 or b=1; Binary string
  586.           ttttt or tttttD -- 0 <= t <= 9; Decimal string
  587.           hhhhH or hhhhX -- 0 <= h <= F; Hexadecimal string
  588.           oooooooO or oooooooQ -- 0 <= o <= 7; Octal string
  589.  
  590.      Inputs:  HL points to the first byte of the string to convert
  591.               String is loaded in a buffer
  592.  
  593.      Outputs:  HL points to next character after converted string
  594.                DE contains 16-bit value
  595.                A = E
  596.                CARR┘á Flaτ Se⌠ mean≤ aε erro≥ wa≤ encountereΣá iε ì
  597. strinτ format
  598.  
  599.      Registers Affected:  PSW, DE, HL
  600.  
  601.      SYSLIB Routines Called:  CAPS, EVAL16, EVAL10, EVAL8, EVAL2
  602.  
  603.      Specia∞á Erro≥ Conditions║
  604.           CARR┘á Flaτ Se⌠ indicate≤ tha⌠ aε erro≥ wa≤ encountereΣ ì
  605. iεá thσá evaluatioεá oµ thσ string╗á iµá so¼á H╠á point≤á t∩á thσ ì
  606. offendinτ character
  607.  
  608.  
  609. 3.02 Evaluation of String in Base 16 -- EVAL16
  610.      Routine Name:  EVAL16
  611.      Function║
  612.           EVAL1╢áá convert≤á thσá strinτá oµá ASCI╔áá hexadecima∞ ì
  613. character≤áá pointeΣá t∩á b∙á H╠á int∩á ßá 16-bi⌠á binar∙á value«  ì
  614. Conversioε progresse≤ unti∞ aε invaliΣ hexadecima∞ digi⌠ (0-9¼ A-ì
  615. F⌐ i≤ encountered.
  616.  
  617.      Inputs:  HL points to the first byte of the string to convert
  618.               String is loaded in a buffer
  619.  
  620.      Outputs:  HL points to the offending character
  621.                DE contains the 16-bit value
  622.                A = E
  623.  
  624.      Registers Affected:  PSW, DE, HL
  625.  
  626.      SYSLIB Routines Called:  CAPS
  627.  
  628.      Special Error Conditions:  -None-
  629.  
  630.  
  631. 3.03 Evaluation of String in Base 10 -- EVAL10
  632.      Routine Name:  EVAL10
  633.      Function║
  634.           EVAL1░ convert≤ thσ strinτ oµ ASCI╔ decima∞á character≤ ì
  635. pointeΣá t∩á b∙á H╠á int∩á ßá 16-bi⌠á binar∙á value«á  Conversioε ì
  636. progresse≤ unti∞ aε invaliΣ decima∞ digi⌠ (0-9⌐ i≤ encountered.
  637.  
  638.      Inputs:  HL points to the first byte of the string to convert
  639.               String is loaded in a buffer
  640.  
  641.      Outputs:  HL points to the offending character
  642.                DE contains the 16-bit value
  643.                A = E
  644.  
  645.      Registers Affected:  PSW, DE, HL
  646.  
  647.      SYSLIB Routines Called:  -None-
  648.  
  649.      Special Error Conditions:  -None-
  650.  
  651.  
  652.  
  653. 3.04 Evaluation of String in Base 8 -- EVAL8
  654.      Routine Name:  EVAL8
  655.      Function║
  656.           EVAL╕á convert≤á thσ strinτ oµ ASCI╔á octa∞á character≤ ì
  657. pointeΣá t∩á b∙á H╠á int∩á ßá 16-bi⌠á binar∙á value«á  Conversioε ì
  658. progresse≤ unti∞ aε invaliΣ octa∞ digi⌠ (0-7⌐ i≤ encountered.
  659.  
  660.      Inputs:  HL points to the first byte of the string to convert
  661.               String is loaded in a buffer
  662.  
  663.      Outputs:  HL points to the offending character
  664.                DE contains the 16-bit value
  665.                A = E
  666.  
  667.      Registers Affected:  PSW, DE, HL
  668.  
  669.      SYSLIB Routines Called:  -None-
  670.  
  671.      Special Error Conditions:  -None-
  672.  
  673.  
  674. 3.05 Evaluation of String in Base 2 -- EVAL2
  675.      Routine Name:  EVAL2
  676.      Function║
  677.           EVAL▓á convert≤á thσ strinτ oµ ASCI╔ binar∙á character≤ ì
  678. pointeΣá t∩á b∙á H╠á int∩á ßá 16-bi⌠á binar∙á value«á  Conversioε ì
  679. progresse≤ unti∞ aε invaliΣ binar∙ digi⌠ (0-1⌐ i≤ encountered.
  680.  
  681.      Inputs:  HL points to the first byte of the string to convert
  682.               String is loaded in a buffer
  683.  
  684.      Outputs:  HL points to the offending character
  685.                DE contains the 16-bit value
  686.                A = E
  687.  
  688.      Registers Affected:  PSW, DE, HL
  689.  
  690.      SYSLIB Routines Called:  -None-
  691.  
  692.      Special Error Conditions:  -None-
  693.  
  694. .fo  4 - Byte-Oriented File Input/Output Routines          Page #
  695.  
  696. 4.0 Byte-Oriented File Input/Output Routines
  697.  
  698. 4.01 Introduction to Byte-Oriented File Input/Output Routines
  699.  
  700.      Thσá followinτá documentatioεá cover≤ thσá serie≤á oµá byte-ì
  701. orienteΣá filσ input/outpu⌠ routine≤ iε SYSLIB«á  Thesσá routine≤ ì
  702. allo≈ thσ use≥ t∩ sequentiall∙ reaΣ froφ (GET⌐ anΣ writσ t∩ (PUT⌐ ì
  703. ß filσ oε ß byte-for-bytσ basis«á  Hence¼á thesσ routine≤ providσ ì
  704. aε exceptionall∙ simplσ methoΣ fo≥ handlinτ inpu⌠ froφ anΣ outpu⌠ ì
  705. t∩ ß file.
  706.  
  707.      ┴ typica∞ prograφ whicΦ employ≤ thesσ routine≤ mus⌠ opeε thσ ì
  708. requireΣ file≤ beforσ doinτ an∙ processing¼ mus⌠ theε perforφ thσ ì
  709. processinτá oε thσ openeΣ files¼á anΣ mus⌠ theε closσá thσá file≤ ì
  710. wheεá thσá processinτ i≤ completσ (closinτ thσ file≤ i≤á optiona∞ ì
  711. fo≥ inpu⌠ file≤ anΣ mandator∙ fo≥ outpu⌠ files).
  712.  
  713.      SYSLI┬ provide≤ fou≥ set≤ oµ routine≤ fo≥ byte-orienteΣ filσ ì
  714. inpu⌠ anΣ output«  Thesσ routine≤ arσ --
  715.  
  716. Input Open  Output Open  GET    PUT   Input Close  Output Close
  717. ----------  -----------  ---    --¡   -----------  ------------
  718.  FI0$OPEN    FO0$OPEN   F0$GET F0$PUT  FI0$CLOSE    FO0$CLOSE
  719.  FI1$OPEN    FO1$OPEN   F1$GET F1$PUT  FI1$CLOSE    FO1$CLOSE
  720.  FI2$OPEN    FO2$OPEN   F2$GET F2$PUT  FI2$CLOSE    FO2$CLOSE
  721.  FI3$OPEN    FO3$OPEN   F3$GET F3$PUT  FI3$CLOSE    FO3$CLOSE
  722.  
  723.      Thi≤á systeφá allow≤á thσ use≥ t∩ havσ u≡ t∩á ╕á file≤á opeε ì
  724. simultaneousl∙ -- fou≥ arσ opeε fo≥ inpu⌠ usinτ GE╘ anΣ fou≥á arσ ì
  725. opeεá fo≥á outpu⌠ usinτ PUT«á  Fo≥ example¼á thσ followinτá i≤á ß ì
  726. samplσ codσ sectioε usinτ thesσ routine≤ fo≥ tw∩ files:
  727.  
  728.           EXT  FI0$OPEN   ; DECLARE LIBRARY REFERENCES
  729.           EXT  FO0$OPEN
  730.           EXT  FI0$CLOSE
  731.           EXT  FO0$CLOSE
  732.           EXT  F0$GET
  733.           EXT  F0$PUT
  734.           ...
  735.           LXI  D,FCBI    ; PT TO FCB OF INPUT FILE
  736.           CALL FI0$OPEN
  737.           LXI  D,FCBO    ; PT TO FCB OF OUTPUT FILE
  738.           CALL FO0$OPEN
  739.           ...
  740.           [body containing CALL F0$GET and CALL F0$PUT where required]
  741.           ...
  742.           CALL FI0$CLOSE  ; CLOSE FILE
  743.           CALL FO0$CLOSE
  744.           ...
  745.           END
  746.  
  747.  
  748.      Notσ tha⌠ onl∙ thσ routine≤ t∩ bσ useΣ arσ referenceΣ iε thσ ì
  749. EX╘ statements«á  Iµ yo⌡ d∩ no⌠ neeΣ ß particula≥ routine¼ d∩ no⌠ ì
  750. referencσá it«á  No⌠á referencinτ aε unneedeΣá routinσá generall∙ ì
  751. save≤ thσ overheaΣ memor∙ spacσ oµ loadinτ i⌠ froφ thσ library.
  752.  
  753.      EacΦ se⌠ oµ INPU╘ OPEN¼á INPU╘ CLOSE¼á OUTPU╘á OPEN¼á OUTPU╘ ì
  754. CLOSE¼á GET¼ anΣ PU╘ routine≤ i≤ containeΣ iε onσ librar∙ module¼ ì
  755. s∩á referencinτ an∙ oµ thesσ routine≤ cause≤ thσ entirσ modulσ t∩ ì
  756. bσá loaded¼á anΣá al∞á thσ routine≤ arσ accessablσá t∩á thσá use≥ ì
  757. (provideΣ the∙ arσ mentioneΣ iε thσ externa∞ definitions⌐ withou⌠ ì
  758. an∙áá additiona∞á memor∙áá overhead«áá  Specifically¼áá FI0$OPEN¼ ì
  759. FI0$CLOSE¼á FO0$OPEN¼ FO0$CLOSE¼ F0$GET¼ anΣ F0$PU╘ arσ containeΣ ì
  760. iε onσ module¼á anΣ referencσ t∩ an∙ oµ thesσ routine≤ load≤á thσ ì
  761. entirσ module╗ thσ samσ i≤ truσ fo≥ thσ othe≥ set≤ oµ routines.
  762.  
  763.      Thσ CLOS┼ routinσ fo≥ outpu⌠ (FOn$CLOSE⌐ i≤ ALWAY╙ required╗ ì
  764. i⌠á fill≤á thσ res⌠ oµ thσ curren⌠ blocδ witΦ Ctrl-┌ followeΣá b∙ ì
  765. <NULL╛á byte≤ anΣ properl∙ close≤ file«á  Thσ CLOS┼á routinσá fo≥ ì
  766. inpu⌠ (FIn$CLOSE⌐ i≤ requireΣ ONL┘ I╞ yo⌡ arσ goinτ t∩ late≥ opeε ì
  767. anothe≥á filσá fo≥á inpu⌠ usinτ thσá correspondinτá OPE╬á routinσ ì
  768. (FIn$OPEN)«á  FIn$CLOS┼á onl∙ serve≤ t∩ rese⌠ thσ OPE╬ flaτ (useΣ ì
  769. t∩ GE╘ t∩ ascertaiε tha⌠ thσ filσ ha≤ beeε properl∙ opened).
  770.  
  771.  
  772.  
  773. 4.02 Byte-Oriented Input and Output File Open
  774.      Routine Names:  FI0$OPEN, FI1$OPEN, FI2$OPEN, FI3$OPEN
  775.      Function║
  776.           Opeεá thσ filσ whosσ FC┬ i≤ pointeΣ t∩ b∙ D┼ fo≥á inpu⌠ ì
  777. (usσ witΦ F$GET).
  778.  
  779.      Inputs:  DE = ptr to FCB of file to open
  780.  
  781.      Outputs:  Z Flag is Error Indicator, A is Error Code
  782.  
  783.      Registers Affected:  PSW
  784.  
  785.      SYSLIB Routines Called:  Internal
  786.  
  787.      Special Error Conditions:  See Section on Error Codes
  788.  
  789.  
  790.  
  791.      Routine Names:  FO0$OPEN, FO1$OPEN, FO2$OPEN, FO3$OPEN
  792.      Function║
  793.           Opeε thσ filσ whosσ FC┬ i≤ pointeΣ t∩ b∙ D┼ fo≥á outpu⌠ ì
  794. (usσ witΦ F$PUT).
  795.  
  796.      Inputs:  DE = ptr to FCB of file to open
  797.  
  798.      Outputs:  Z Flag is Error Indicator, A is Error Code
  799.  
  800.      Registers Affected:  PSW
  801.  
  802.      SYSLIB Routines Called:  Internal
  803.  
  804.      Special Error Conditions:  See Section on Error Codes
  805.  
  806.  
  807.  
  808. 4.03 Byte-Oriented Input and Output File Close
  809.      Routine Names:  FI0$CLOSE, FI1$CLOSE, FI2$CLOSE, FI3$CLOSE
  810.      Function║
  811.           Closσá thσ filσ previousl∙ openeΣ b∙ thσá correspondinτ ì
  812. FI$OPE╬á routine«á  Usσá oµá thesσ routine≤ i≤á optiona∞á iµá thσ ì
  813. anothe≥á filσá wil∞á no⌠ bσ openeΣ late≥ iε thσá prograφá b∙á thσ ì
  814. correspondinτ FI$OPE╬ routine.
  815.  
  816.      Inputs:  -None-
  817.  
  818.      Outputs:  Z Flag is Error Indicator, A is Error Code
  819.  
  820.      Registers Affected:  PSW
  821.  
  822.      SYSLIB Routines Called:  Internal
  823.  
  824.      Specia∞ Erro≥ Conditions:  See Section on Error Codes
  825.  
  826.  
  827.  
  828.      Routine Names:  FO0$CLOSE, FO1$CLOSE, FO2$CLOSE, FO3$CLOSE
  829.      Function║
  830.           Closσá thσ filσ previousl∙ openeΣ b∙ thσá correspondinτ ì
  831. FO$OPE╬ routine«  Usσ oµ thesσ routine≤ i≤ MANDATOR┘ afte≥ outpu⌠ ì
  832. t∩ thσ filσ (usinτ thσ correspondinτ F$PU╘ routine⌐ i≤ complete.
  833.  
  834.      Inputs:  -None-
  835.  
  836.      Outputs:  Z Flag is Error Indicator, A is Error Code
  837.  
  838.      Registers Affected:  -None-
  839.  
  840.      SYSLIB Routines Called:  Internal
  841.  
  842.      Specia∞ Erro≥ Conditions:  See Section on Error Codes
  843.  
  844.  
  845. è
  846. 4.04 Byte-Oriented Input and Output
  847.      Routine Names:  F0$GET, F1$GET, F2$GET, F3$GET
  848.      Function║
  849.           Ge⌠ thσ nex⌠ bytσ iε sequencσ froφ thσ filσá previousl∙ ì
  850. openeΣ b∙ thσ correspondinτ FI$OPE╬ routine«  Bytσ i≤ returneΣ iε ì
  851. Registe≥ A.
  852.  
  853.      Inputs:  -None-
  854.  
  855.      Outputs:  A = Next byte from file if no error
  856.                If Error, NZ and A = Error Code
  857.  
  858.      Registers Affected:  PSW
  859.  
  860.      SYSLIB Routines Called:  Internal
  861.  
  862.      Specia∞ Erro≥ Conditions:  See Section on Error Codes
  863.  
  864.  
  865.  
  866.      Routine Names:  F0$PUT, F1$PUT, F2$PUT, F3$PUT
  867.      Function║
  868.           Pu⌠á thσá bytσ iε Registe≥ ┴ ont∩ thσ enΣ oµá thσá filσ ì
  869. previousl∙ openeΣ b∙ thσ correspondinτ FO$OPE╬ routine.
  870.  
  871.      Inputs:  A = Byte to PUT
  872.  
  873.      Outputs:  Z Flag is Error Indicator, A is Error Code
  874.  
  875.      Registers Affected:  PSW
  876.  
  877.      SYSLIB Routines Called:  Internal
  878.  
  879.      Specia∞á Erro≥ Conditions║  See Section on Error Codes
  880.  
  881.  
  882.  
  883. 4.05 Error Return Codes
  884.  
  885.      Fo≥á eacΦ oµ thσ routine≤ iε thi≤ se⌠ oµ byte-orienteΣá filσ ì
  886. I/╧ routines¼ thσ Zer∩ Flaτ anΣ thσ ┴ Registe≥ pla∙ ß ke∙ rolσ iε ì
  887. indicating the error conditions of the routines.
  888.  
  889.      Iµá thσá Zer∩á Flaτá i≤ Se⌠ (Z⌐ afte≥á ßá routinσá ha≤á beeε ì
  890. executed¼á theε thi≤ indicate≤ tha⌠ n∩ erro≥ ha≤ occurred«  Thσ ┴ ì
  891. Registe≥á i≤á eithe≥á unaffecteΣ (iε mos⌠ cases⌐á o≥á contain≤á ß ì
  892. returned value (if so indicated, as in Fn$GET routines).
  893.  
  894.      Iµá thσá Zer∩ Flaτ i≤ Clea≥ (NZ⌐ afte≥ ßá routinσá ha≤á beeε ì
  895. executed¼á theε thi≤ indicate≤ tha⌠ aε erro≥ ha≤ occurred«  Thσ ┴ ì
  896. Registe≥á no≈á contain≤á thσ Erro≥á Code«á  Thσá followinτá tablσ ì
  897. summarize≤á thσá Erro≥á Code≤á whicΦ ma∙ bσá returneΣá iεá thσá ┴ ì
  898. Register.
  899.  
  900. è
  901.      The following display summarizes the Error Codes.
  902.  
  903.  
  904.                      Summary of Error Codes
  905.            Returned by Byte-Oriented File I/O Routines
  906.  
  907.           Code Meaning
  908.           ---- -------
  909.  
  910.             1  GET or PUT attempted on an unopened file
  911.             2  Disk Full (Ran out of space)
  912.             3  Input File Not Found
  913.             4  Attempt to Read Past EOF
  914.             5  Directory Full
  915.             6  Error in Closing a File
  916.             7  Attempt to Open a File which is already Open
  917.  
  918.  
  919. .fo  5 - CP/M File Input/Output Routines                   Page #
  920.  
  921. 5.0 CP/M File Input/Output Routines
  922.  
  923. 5.01 Introduction
  924.  
  925.      Thσ followinτ routine≤ arσ general-purposσ filσ I/╧ routine≤ ì
  926. whicΦá interfacσá t∩ CP/═ througΦ thσ Entr∙ Poin⌠ a⌠ locatioεá 5«  ì
  927. The∙ preservσ BC¼á DE¼á anΣ HL¼ anΣ the∙ returε witΦ thσ standarΣ ì
  928. CP/═ erro≥ code≤ fo≥ thσ correspondinτ routines.
  929.  
  930.      Specifically, these routines are --
  931.  
  932.           F$OPEN    Open a file
  933.           F$MOPEN   Open/Create a file
  934.           F$CLOSE   Close a file
  935.           F$MAKE    Create a file
  936.           F$DELETE  Delete a file
  937.           F$RENAME  Rename a file
  938.           F$EXIST   Test of existance of a file
  939.           F$READ    Read a block (128 bytes) from a file
  940.           F$WRITE   Write a block (128 bytes) to a file
  941.  
  942.  
  943.  
  944. 5.02 Open a File
  945.      Routine Name:  F$OPEN
  946.      Function║
  947.           Opeεá thσá filσ specifieΣ b∙ thσ FC┬ pointeΣ t∩ b∙á DE«  ì
  948. Iµ filσ no⌠ found¼á F$OPE╬ return≤ witΦ aε erro≥ codσ iε ┴ (0FFH⌐ ì
  949. anΣ Zer∩ Flaτ Clea≥ (NZ).
  950.  
  951.      Inputs:  DE = pointer to FCB
  952.  
  953.      Outputs:  A = Error Code and PSW Flags Set (Zero Flag)
  954.                    0    --> No Error
  955.                    0FFH --> File not opened
  956.  
  957.      Registers Affected:  PSW
  958.  
  959.      SYSLIB Routines Called:  BDOS, CAPS, CIN, COUT, CRLF, PRINT
  960.  
  961.      Special Error Conditions:  -None-
  962.  
  963.  
  964.  
  965.  
  966.      Routine Name:  F$MOPEN
  967.      Function║
  968.           Opeεá thσ filσ specifieΣ b∙ thσ FC┬ pointeΣ t∩á b∙á DE«  ì
  969. Iµá filσ i≤ no⌠ found¼á F$MOPE╬ trie≤ t∩ creatσ one«á  I⌠ return≤ ì
  970. thσá erro≥ codσ oµ 0FF╚ iε ┴ iµ therσ wa≤ no⌠ enougΦ rooφ iεá thσ ì
  971. disδ director∙ t∩ creatσ thσ director∙ entry.
  972.  
  973.      Inputs:  DE = pointer to FCB
  974.  
  975.      Outputs:  A = Error Code and PSW Flags (Zero Flag) Set
  976.                    0    --> No Error
  977.                    0FFH --> File not opened
  978.  
  979.      Registers Affected:  PSW
  980.  
  981.      SYSLIB Routines Called:  BDOS, CAPS, CIN, COUT, CRLF, PRINT
  982.  
  983.      Special Error Conditions:  -None-
  984.  
  985.  
  986.  
  987. 5.03 Close a File
  988.      Routine Name:  F$CLOSE
  989.      Function:
  990.           Close the file whose FCB is pointed to by DE.
  991.  
  992.      Inputs:  DE = pointer to FCB
  993.  
  994.      Outputs:  A = Error Code
  995.                    0    --> No Error
  996.                    0FFH --> Error in closing file
  997.  
  998.      Registers Affected:  PSW
  999.  
  1000.      SYSLIB Routines Called:  BDOS
  1001.  
  1002.      Special Error Conditions:  -None-
  1003.  
  1004.  
  1005.  
  1006.  
  1007. 5.04 Create a File
  1008.      Routine Name:  F$MAKE
  1009.      Function:
  1010.           Create (Make) the file whose FCB is pointed to by DE.
  1011.  
  1012.      Inputs:  DE = pointer to FCB
  1013.  
  1014.      Outputs:  A = Error Code
  1015.                    0FFH --> No directory space available
  1016.                    Not 0FFH --> No Error; Value is byte address in
  1017.                                 TBUFF (80H-0FFH) of directory entry
  1018.                                 allocated to the FCB
  1019.  
  1020.      Registers Affected:  PSW
  1021.  
  1022.      SYSLIB Routines Called:  BDOS, F$DELETE
  1023.  
  1024.      Special Error Conditions:  -None-
  1025.  
  1026.  
  1027.  
  1028. 5.05 Delete a File
  1029.      Routine Name:  F$DELETE
  1030.      Function║
  1031.           Deletσ thσ filσ whosσ FC┬ i≤ pointeΣ t∩ b∙ DE«  Iµ filσ ì
  1032. doe≤á no⌠á exist¼á nothinτ happen≤ (n∩ erro≥ messagσ o≥á codσá i≤ ì
  1033. given).
  1034.  
  1035.      Inputs:  DE = pointer to FCB
  1036.  
  1037.      Outputs:  -None-
  1038.  
  1039.      Registers Affected:  PSW
  1040.  
  1041.      SYSLIB Routines Called:  BDOS
  1042.  
  1043.      Special Error Conditions:  -None-
  1044.  
  1045.  
  1046.  
  1047. 5.06 Rename a File
  1048.      Routine Name:  F$RENAME
  1049.      Function║
  1050.           F$RENAM┼á ma∙ bσ useΣ t∩ renamσ ß file«á  Oε entry¼á D┼ ì
  1051. pt≤ t∩ thσ firs⌠ twelvσ byte≤ oµ thσ file'≤ FC┬ anΣ H╠ pt≤ t∩ thσ ì
  1052. firs⌠ twelvσ byte≤ oµ thσ FC┬ fo≥ thσ ne≈ filσ (tha⌠ is¼ onl∙ thσ ì
  1053. F╬ anΣ F╘ field≤ arσ significant¼á s∩ thσ res⌠ oµ aε FC┬ neeΣ no⌠ ì
  1054. bσá presen⌠á fo≥ thi≤ functioε t∩ work)«á  F$RENAM┼á contain≤á aε ì
  1055. interna∞ FC┬ whicΦ i≤ structureΣ froφ thσ tw∩ entrie≤ t∩ properl∙ ì
  1056. rename the file.
  1057.  
  1058.      Inputs:  HL pts to 1st 12 bytes of new FCB
  1059.               DE pts to 1st 12 bytes of old FCB
  1060.  
  1061.      Outputs:  Zero Flag Set (Z) means error (file not found)
  1062.  
  1063.      Registers Affected:  PSW
  1064.  
  1065.      SYSLIB Routines Called: BDOS, FILLB, MOVEB
  1066.  
  1067.      Specia∞ Erro≥ Conditions║á  Filσ No⌠ FounΣ error¼á indicateΣ ì
  1068. by Z flag
  1069.  
  1070.  
  1071.  
  1072. 5.07 Test for the Existance of a File
  1073.      Routine Name:  F$EXIST
  1074.      Function║
  1075.           F$EXIS╘ test≤ fo≥ thσ presencσ oµ thσ filσ whosσ FC┬ i≤ ì
  1076. pteΣá t∩ b∙ D┼ iε thσ curren⌠ disk/use≥ area«á  Iµ thi≤ filσ doe≤ ì
  1077. no⌠á exis⌠ iε thi≤ area¼á F$EXIS╘ return≤ witΦ thσ Zer∩ Flaτá Se⌠ ì
  1078. (Z); if this file does exist, F$EXIST returns with NZ.
  1079.  
  1080.      Inputs:  DE pts to FCB of file to test for
  1081.  
  1082.      Outputs:  Zero Flag Set (Z) means file not found; NZ means
  1083.                     file found
  1084.  
  1085.      Registers Affected:  PSW
  1086.  
  1087.      SYSLIB Routines Called:  BDOS
  1088.  
  1089.      Specia∞á Erro≥ Conditions║  None
  1090.  
  1091.  
  1092.  
  1093.  
  1094. 5.08 Read a Block from a File
  1095.      Routine Name:  F$READ
  1096.      Function║
  1097.           ReaΣá nex⌠ blocδ (12╕ bytes⌐ froφ thσ openeΣ filσ whosσ ì
  1098. FC┬ i≤ pointeΣ t∩ b∙ D┼ int∩ TBUF╞ (buffe≥ a⌠ 80╚ - 0FFH).
  1099.  
  1100.      Inputs:  DE = pointer to FCB
  1101.  
  1102.      Outputs:  A = Error Code
  1103.                    0 --> No Error
  1104.                    1 --> Read past end of file
  1105.                    2 --> Reading unwritten data in random access
  1106.  
  1107.      Registers Affected:  PSW
  1108.  
  1109.      SYSLIB Routines Called:  BDOS
  1110.  
  1111.      Special Error Conditions:  -None-
  1112.  
  1113.  
  1114.  
  1115. 5.09 Write a Block to a File
  1116.      Routine Name:  F$WRITE
  1117.      Function║
  1118.           Writσá nex⌠ blocδ (12╕ bytes⌐ froφ TBUF╞ (buffe≥ a⌠ 80╚ ì
  1119. t∩ 0FFH⌐ t∩ thσ openeΣ filσ whosσ FC┬ i≤ pointeΣ t∩ b∙ DE.
  1120.  
  1121.      Inputs:  DE = pointer to FCB
  1122.  
  1123.      Outputs:  A = Error Code
  1124.                    0    --> No Error
  1125.                    1    --> Error in extending file
  1126.                    2    --> End of disk data
  1127.                    0FFH --> No more directory space
  1128.  
  1129.      Registers Affected:  PSW
  1130.  
  1131.      SYSLIB Routines Called:  BDOS
  1132.  
  1133.      Special Error Conditions:  -None-
  1134.  
  1135. .fo  6 - File Name String Parser and FCB Init              Page #
  1136.  
  1137. 6.0 File Name String Parser and FCB Init
  1138.  
  1139.      Routine Name: FNAME
  1140.      Function:
  1141.           FNAM┼á i≤ ß filσ namσ scanner«á  Pointinτ t∩ thσá firs⌠ ì
  1142. characte≥ oµ ß filσ namσ specificatioε oµ thσ form:
  1143.  
  1144. ááááá          du:filename.typ
  1145.  
  1146. wherσá an∙á par⌠ oµ thσ specificatioε i≤ optional¼á thi≤á routinσ ì
  1147. fill≤ iε aε FC┬ witΦ zeroe≤ (3╢ bytes)¼á properl∙ initialize≤ thσ ì
  1148. F╬ (Filσ Name⌐ fielΣ iµ 'filenameº i≤ presen⌠ anΣ F╘ (Filσá Type⌐ ì
  1149. fielΣ iµ 'typº i≤ present¼ anΣ return≤ thσ numbe≥ oµ thσ selecteΣ ì
  1150. disδá (iεá thσ rangσ froφ ▒ fo≥ ┴ t∩ 1╢ fo≥ P⌐ iµ 'dº i≤á presen⌠ ì
  1151. anΣá thσ numbe≥ oµ thσ selecteΣ use≥ (iε thσ rangσ froφ ░á t∩á 3▒ ì
  1152. anΣá thσ questioε marδ '?º character⌐ iµ 'uº i≤ present«á  Iµ 'dº ì
  1153. i≤ no⌠ present¼ 0FF╚ i≤ returneΣ fo≥ i⌠ t∩ indicatσ curren⌠ disk¼ ì
  1154. anΣá iµ 'uº i≤ no⌠ present¼á 0FF╚ i≤ returneΣ fo≥ i⌠ t∩á indicatσ ì
  1155. curren⌠ user.
  1156.  
  1157.      Thσ strinτ pointeΣ t∩ b∙ H╠ i≤ no⌠ ß conventiona∞ strinτá iε ì
  1158. thσá sensσá oµ thσ res⌠ oµ thσ SYSLI┬ routines«á  Thi≤ strinτá i≤ ì
  1159. terminateΣ b∙ an∙ oµ thσ followinτ delims¼á a≤ opposeΣ b∙á simpl∙ ì
  1160. alway≤ beinτ terminateΣ b∙ ß binar∙ zero«  Thσ delimite≥ lis⌠ is:
  1161.  
  1162. ááááá          <NULL or Binary 0>       <SP or Space>
  1163. ááááá          =    _    ;    ,    <    >
  1164.  
  1165.      Thσ followinτ arσ valiΣ examples:
  1166. ááááá          test.txt   <-- FN=TEXT  FT=TXT, B reg = 0FFH,
  1167. ááááá                         C reg = 0FFH
  1168. ááááá          a:t        <-- FN=T  FT=<SP>, B reg = 1,
  1169. ááááá                         C reg = 0FFH
  1170. ááááá          5:t        <-- FN=T  FT=<SP>, B reg = 0FFH,
  1171. ááááá                         C reg = 5
  1172. ááááá          c10:x.y    <-- FN=X  FT=Y, B reg = 3,
  1173. ááááá                         C reg = 10
  1174.  
  1175.  
  1176.      Inputs:  HL points to the first byte of the target string
  1177. ááááá               (which ends in a delimiter)
  1178. ááááá         DE pts to the first byte of a 36-byte long FCB
  1179.  
  1180.      Outputs:  B=Disk Number (1 for A to 16 for P, or 0FFH if
  1181. ááááá               no disk specified)
  1182. ááááá          C=User Number (0 to 31 or '?' for all users, or
  1183. ááááá               0FFH if no user specified)
  1184. ááááá          HL points to the character which ended the scan
  1185. ááááá          A = 0 and Zero Flag Set (Z) if invalid Disk or User
  1186. ááááá               Specified; A = 0FFH and NZ if no error
  1187.      Registers Affected: PSW, BC, HL
  1188.      SYSLIB Routines Called:  CAPS
  1189.      Special Error Conditions:  None
  1190.  
  1191. è
  1192.      Routine Name:  INITFCB
  1193.      Function║
  1194. ááááá     INITFC┬á simpl∙á clear≤ al∞ oµ thσ field≤ oµ ßá 36-bytσ ì
  1195. áááááFC┬á t∩á zer∩ excep⌠ fo≥ thσ F╬ anΣ F╘ (Filσ Namσá anΣá Filσ ì
  1196. áááááType⌐ fields¼ whicΦ i⌠ leave≤ untouched.
  1197.  
  1198.      Inputs:  DE = pointer to FCB buffer
  1199.  
  1200.      Outputs:  None
  1201.  
  1202.      Registers Affected:  None
  1203.  
  1204.      SYSLIB Routines Called:  FILLB
  1205.  
  1206.      Special Error Conditions:  None
  1207.  
  1208. .fo  7 - Input Line Editors                                Page #
  1209.  
  1210. 7.0 Input Line Editors
  1211.  
  1212.      Aεá Inpu⌠ Linσ Edito≥ i≤ useΣ t∩ accep⌠ ß linσ oµ tex⌠á froφ ì
  1213. thσ user¼ allowinτ hiφ t∩ issuσ command≤ likσ backspacσ anΣ Ctrl-ì
  1214. ╪á (erasσá al∞á oµ linσ typeΣ s∩ far⌐ t∩ edi⌠ hi≤ tex⌠ a≤á hσá i≤ ì
  1215. inputtinτá it«á  Oncσ thσ tex⌠ ha≤ beeε entered¼á thσ Inpu⌠á Linσ ì
  1216. Edito≥ return≤ t∩ thσ callinτ prograφ witΦ thσ user'≤ tex⌠ storeΣ ì
  1217. in a buffer.  This text is terminated by a binary 0.
  1218.  
  1219.      Tw∩ oµ thσ Inpu⌠ Linσ Editor≤ iε SYSLI┬ usσ thσ CP/═ BDO╙ t∩ ì
  1220. providσ thσ linσ edito≥ function«á  The∙ mainl∙ servσ t∩ preservσ ì
  1221. thσá register≤á durinτá thσá functioεá cal∞á anΣá t∩á storσáá thσ ì
  1222. terminatinτ zer∩ a⌠ thσ enΣ oµ thσ text«á  The∙ occup∙ les≤ spacσ ì
  1223. than the third Input Line Editor, INLINE.
  1224.  
  1225.      Thσ thirΣ Inpu⌠ Linσ Editor¼á INLINE¼á i≤ useΣ wheε securit∙ ì
  1226. i≤á important«á  Unlikσá thσ othe≥ two¼á wheε typinτ ß Ctrl-├á t∩ ì
  1227. INLINE¼á thσá Inpu⌠á Linσá Edito≥ (anΣ callinτá program⌐á i≤á no⌠ ì
  1228. aborteΣ anΣ contro∞ returneΣ t∩ CP/M«á  Instead¼á thσ Ctrl-├ cha≥ ì
  1229. i≤ simpl∙ storeΣ iε thσ user'≤ line«  Also¼ unlikσ thσ othe≥ two¼ ì
  1230. INLIN┼á caεá bσá instructeΣá t∩á ech∩á o≥á no⌠á ech∩á thσáá inpu⌠ ì
  1231. characters«á  Thi≤á featurσ i≤ usefu∞ fo≥ program≤ whicΦ wan⌠á t∩ ì
  1232. inpu⌠á ßá password«á  INLIN┼á caε bσ instructeΣ no⌠ t∩á ech∩á thσ ì
  1233. password¼á bu⌠á i⌠ wil∞ stil∞ providσ thσ linσ editinτá function≤ ì
  1234. for the user so that he can correct mistakes if he makes them.
  1235.  
  1236.  
  1237.      Routine Name:  BBLINE
  1238.      Function:
  1239.           BBLIN┼ provide≤ ß ver∙ convenien⌠ interfacσ t∩ thσ BDO╙ ì
  1240. fo≥á inpu⌠ linσ edito≥ functions«á  I⌠ contain≤ it≤ owεá interna∞ ì
  1241. buffe≥á fo≥ storagσ oµ thσ inpu⌠ linσ (20░ byte≤ allocated)¼á anΣ ì
  1242. i⌠á return≤ ß pointe≥ t∩ thσ firs⌠ bytσ oµ thσ linσ upoεá return«  ì
  1243. Thσá linσá storeΣ iε thi≤ buffe≥ i≤ terminateΣ b∙ ßá binar∙á zer∩ ì
  1244. (0).
  1245.  
  1246.      T∩á usσá BBLINE¼áá thσá use≥á neeΣá onl∙á cal∞á it¼á witΦá ß ì
  1247. capitalizatioε flaτ storeΣ iε thσ ┴ Register«á  Iµ ┴ ╜ 0¼á BBLIN┼ ì
  1248. doe≤ no⌠ capitalizσ thσ inpu⌠ linσ characters╗á iµ ┴ <╛ 0¼ BBLIN┼ ì
  1249. capitalize≤á thσá inpu⌠ linσ character≤ beforσ returninτá t∩á thσ ì
  1250. caller.
  1251.  
  1252.      N∩ erro≥ code≤ arσ returneΣ b∙ BBLINE«  Oε return¼ H╠ point≤ ì
  1253. t∩ thσ firs⌠ bytσ oµ thσ inpu⌠ linσ anΣ ┴ contain≤ ß coun⌠ oµ thσ ì
  1254. numbe≥ oµ character≤ iε tha⌠ linσ (no⌠ countinτ thσ endinτ zero).
  1255.  
  1256.  
  1257.      Inputs:  A=0 to Not Capitalize Line, A<>0 to Capitalize Line
  1258.  
  1259.      Outputs:  HL pts to first char in the line
  1260.                A is number of characters in the line (not
  1261.                     counting the ending zero)
  1262.  
  1263.      Registers Affected:  PSW, HL
  1264.  
  1265.      SYSLIB Routines Called:  CAPS
  1266.  
  1267.      Special Error Conditions:  None
  1268.  
  1269.  
  1270.  
  1271.      Routine Name:  BLINE
  1272.      Function:
  1273.           BLIN┼ provide≤ ß ver∙ convenien⌠ interfacσ t∩ thσá BDO╙ ì
  1274. fo≥á inpu⌠ linσ edito≥ functions«á  I⌠ perform≤ thσ samσ typσá oµ ì
  1275. functioεá a≤á BBLINE¼á bu⌠ i⌠ doe≤ no⌠ contaiε it≤á owεá interna∞ ì
  1276. buffer«á  Thσ use≥ i≤ expecteΣ t∩ providσ sucΦ ß buffer¼ whicΦ i≤ ì
  1277. structureΣ a≤ follows:
  1278.  
  1279.                SIZE:     DB   <Size of Buffer>
  1280.                CCNT:     DS   1
  1281.                LINE:     DS   <Size of Buffer + 1>
  1282.  ì
  1283. BLIN┼ return≤ ß pointe≥ t∩ thσ firs⌠ bytσ oµ thσ linσ (LINE⌐ upoε ì
  1284. return«  Thσ linσ storeΣ iε thi≤ buffe≥ i≤ terminateΣ b∙ ß binar∙ ì
  1285. zer∩ (0).
  1286.  
  1287.      T∩ usσ BLINE¼á thσ use≥ neeΣ onl∙ cal∞ it¼ witΦ ß pointe≥ t∩ ì
  1288. thσ user'≤ buffe≥ iε H╠ anΣ ß capitalizatioε flaτ storeΣ iε thσ ┴ ì
  1289. Register«á  Iµá ┴ ╜ 0¼á BLIN┼ doe≤ no⌠ capitalizσ thσ inpu⌠á linσ ì
  1290. characters╗áá iµá ┴á <╛á 0¼á BLIN┼á capitalize≤á thσá inpu⌠á linσ ì
  1291. character≤ beforσ returninτ t∩ thσ caller.
  1292.  
  1293.      N∩ erro≥ code≤ arσ returneΣ b∙ BLINE«á  Oε return¼ H╠ point≤ ì
  1294. t∩ thσ firs⌠ bytσ oµ thσ inpu⌠ linσ anΣ ┴ contain≤ ß coun⌠ oµ thσ ì
  1295. numbe≥ oµ character≤ iε tha⌠ line (not counting the ending zero).
  1296.  
  1297.      Inputs:  A=0 to Not Capitalize Line, A<>0 to Capitalize Line
  1298.               HL pts to first byte (SIZE) of user-supplied buffer
  1299.  
  1300.      Outputs:  HL pts to first char in the line
  1301.                A is number of characters in the line (not
  1302.                     counting the ending zero)
  1303.  
  1304.      Registers Affected:  PSW, HL
  1305.  
  1306.      SYSLIB Routines Called:  CAPS
  1307.  
  1308.      Special Error Conditions:  None
  1309.  
  1310.  
  1311.  
  1312.      Routine Name:  INLINE
  1313.      Function║
  1314.           INLIN┼á allow≤á thσ use≥ t∩ inpu⌠ ß linσ oµá tex⌠á froφ ì
  1315. CON║á int∩ thσ buffe≥ pointeΣ t∩ b∙ HL«á  Thσ use≥ i≤ alloweΣá t∩ ì
  1316. edi⌠á thσá tex⌠á a≤á hσ type≤ it¼á anΣá INLIN┼á respond≤á t∩á thσ ì
  1317. followinτ edito≥ commands:
  1318.  
  1319.    Key Command    Function
  1320.      <BS>           Delete previous character and back up cursor
  1321.      <DEL>          Delete previous character and echo it
  1322.      <CR>           Input complete -- return to calling program
  1323.      <LF>           Skip down to next physical line and insert a
  1324.                       <CR> <LF> into buffer
  1325.      <TAB>          Tabulate to next tab stop (every 8)
  1326.      Ctrl-U,        Erase current line (clear buffer) and restart
  1327.        Ctrl-X         input
  1328.      Ctrl-R         Retype current line
  1329.      Ctrl-┼         Ski≡ dowε t∩ nex⌠ physica∞ line╗ inser⌠ 
  1330.                       nothing into buffer
  1331.  
  1332.      Oε exit¼á thσ buffe≥ contain≤ thσ tex⌠ entereΣ followeΣ b∙ ß ì
  1333. <NULL╛ (binar∙ 0)╗á thσ <CR╛ typeΣ t∩ enΣ thσ inpu⌠ i≤ NO╘ placeΣ ì
  1334. iε thσ buffer.
  1335.  
  1336.  
  1337.     Inputs:  HL = pointer to input line buffer
  1338.               A = Echo Flag (A=0 Means Don't Echo Input)
  1339.      Outputs:  -None- (Input line buffer contains text typed by user)
  1340.      Registers Affected:  -None-
  1341.      SYSLIB Routines Called:  CCOUT, CIN, COUT, CRLF
  1342.  
  1343.      Specia∞á Erro≥ Conditions║
  1344.           <BEL╛á (Bee≡ a⌠ CON:⌐ i≤ outpu⌠ iµ attemp⌠ i≤á madσá t∩ ì
  1345. deletσá characte≥ (<BS╛ o≥ <DEL>⌐ beforσ beginninτ oµá line«á  N∩ ì
  1346. limi⌠á o≥á erro≥ checkinτ i≤ donσ oε thσ sizσ oµ thσá inpu⌠á linσ ì
  1347. buffe≥á (buffe≥ overflo≈ i≤ possible¼á s∩ i⌠ i≤ recommendeΣá tha⌠ ì
  1348. buffe≥á i≤ madσ arbitraril∙ large)«á  HasΦ marδ (#⌐ i≤ printeΣ iε ì
  1349. responsσ t∩ Ctrl-R¼ Ctrl-U¼ anΣ Ctrl-X.
  1350.  
  1351.      Note║á  INLIN┼á offer≤á tw∩ feature≤ no⌠ founΣ iε BLIN┼á anΣ ì
  1352. BBLINE«á  First¼á i⌠ canno⌠ bσ aborteΣ b∙ ß Ctrl-C╗ thi≤ i≤ good¼ ì
  1353. sincσá i⌠á caε bσ useΣ iε "secureó program≤ withou⌠ fea≥á oµá thσ ì
  1354. use≥ breakinτ ou⌠ oµ thσ program«  Second¼ i⌠ caε bσ madσ t∩ ech∩ ì
  1355. o≥á no⌠á ech∩á thσá input╗á thi≤á provide≤á somσá protectioεá fo≥ ì
  1356. inputtinτ sensitivσ information¼ likσ ß password.
  1357.  
  1358.      INLIN┼á essentiall∙á provide≤ al∞ oµ thσ conventiona∞á inpu⌠ ì
  1359. linσ edito≥ functions«á  I⌠ i≤ somewha⌠ morσ flexiblσ thaεá BLIN┼ ì
  1360. anΣá BBLINE¼á bu⌠ thσ tradeofµ i≤ tha⌠ INLIN┼ take≤ u≡ morσ spacσ ì
  1361. thaε eithe≥ BLIN┼ o≥ BBLINE«á  Iµ securit∙ i≤ no⌠ required¼ i⌠ i≤ ì
  1362. recommendeΣ tha⌠ thσ programme≥ emplo∙ BLIN┼ o≥ BBLIN┼ insteaΣ oµ ì
  1363. INLINE.
  1364.  
  1365.  
  1366. .fo  8 - String Output Routines                            Page #
  1367.  
  1368. 8.0 String Output Routines -- PRINT, LPRINT, PSTR, LPSTR
  1369.  
  1370.      Routine Names:  PRINT, LPRINT
  1371.      Function║
  1372.           Prin⌠á strinτ pointeΣ t∩ b∙ thσ returε addres≤ oεá CON║ ì
  1373. (PRINT⌐á o≥ LST║á (LPRINT)«á  Strinτ i≤ terminateΣ b∙ ß binar∙ 0«  ì
  1374. Contro∞ i≤ returneΣ t∩ bytσ followinτ string.
  1375.  
  1376.      Inputs:  Return Address = pointer to string to be printed
  1377.  
  1378.      Outputs:  HL points to byte after string
  1379.                (string is printed on CON: or LST:)
  1380.  
  1381.      Registers Affected:  HL
  1382.  
  1383.      SYSLIB Routines Called:  PSTR (for PRINT); LSTR (for LPRINT)
  1384.  
  1385.      Specia∞ Erro≥ Conditions:
  1386.           Thσ strinτ MUS╘ bσ terminateΣ b∙ ß binar∙ 0!!!
  1387.  
  1388.  
  1389.  
  1390.      Routine Names:  PSTR, LPSTR
  1391.      Function║
  1392.           Prin⌠á strinτ pointeΣ t∩ b∙ H╠ oε CON║á (PSTR⌐ o≥á LST║ ì
  1393. (LPSTR)«  Strinτ i≤ terminateΣ b∙ ß binar∙ 0.
  1394.  
  1395.      Inputs:  HL = pointer to string to be printed
  1396.  
  1397.      Outputs:  -None- (string is printed on CON: or LST:)
  1398.  
  1399.      Registers Affected:  -None-
  1400.  
  1401.      SYSLI┬á Routine≤ Called║  CCOUT¼á COU╘ (fo≥ PSTR)╗
  1402.                                LCOUT¼ LOU╘ (fo≥ LPSTR)
  1403.  
  1404.      Specia∞ Erro≥ Conditions:
  1405.           Thσ strinτ MUS╘ bσ terminateΣ b∙ ß binar∙ 0!!!
  1406.  
  1407. .fo  9 - Numeric Output Routines                           Page #
  1408.  
  1409. 9.0 Numeric Output Routines
  1410.  
  1411. 9.01 Output HL as 4 Hexadecimal Characters
  1412.  
  1413.      Routine Names:  PHL4HC, LHL4HC
  1414.      Function║
  1415.           Prin⌠á H╠á a≤ fou≥ (4⌐ hexadecima∞ character≤á oεá CON║ ì
  1416. (PHL4HC⌐ o≥ LST║ (LHL4HC).
  1417.  
  1418.      Inputs:  HL = value to be printed
  1419.  
  1420.      Outputs:  -None- (Value is printed)
  1421.  
  1422.      Registers Affected:  -None-
  1423.  
  1424.      SYSLIB Routines Called:  PA2HC (for PHL4HC);
  1425.                               LA2HC (for LHL4HC)
  1426.  
  1427.      Special Error Conditions:  -None-
  1428.  
  1429.  
  1430.  
  1431.      Routine Name:  MHL4HC
  1432.      Function║
  1433.           Storσá H╠ a≤ fou≥ (4⌐ hexadecima∞ character≤ iε thσá 4-ì
  1434. bytσ memor∙ buffe≥ pointeΣ t∩ b∙ DE«  Oε return¼ D┼ point≤ t∩ thσ ì
  1435. bytσ followinτ thi≤ buffer.
  1436.  
  1437.      Inputs:  HL = value to be converted and stored
  1438.               DE points to 4-byte buffer
  1439.  
  1440.      Outputs:  DE points to byte after buffer
  1441.  
  1442.      Registers Affected:  DE
  1443.  
  1444.      SYSLIB Routines Called:  MA2HC
  1445.  
  1446.      Special Error Conditions:  -None-
  1447.  
  1448.  
  1449.  
  1450. 9.02 Output HL as 5 Decimal Character
  1451.  
  1452.      Routine Names:  PHL5DC, LHL5DC
  1453.      Function║
  1454.           Prin⌠á H╠á a≤á fivσá (5⌐á decima∞á character≤á oεá CON║ ì
  1455. (PHL5DC⌐ o≥ LST║ (LHL5DC).
  1456.  
  1457.      Inputs:  HL = value to be printed
  1458.  
  1459.      Outputs:  -None- (Value is printed)
  1460.  
  1461.      Registers Affected:  -None-
  1462.  
  1463.      SYSLIB Routines Called:  POUT (for PHL5DC); LOUT (for LHL5DC)
  1464.  
  1465.      Special Error Conditions:  -None-
  1466.  
  1467.  
  1468.  
  1469.      Routine Name:  MHL5DC
  1470.      Function║
  1471.           Storσá H╠ a⌠ fivσ (5⌐ decima∞ character≤ iεá memor∙á iε ì
  1472. thσ 5-bytσ buffe≥ pointeΣ t∩ b∙ DE«á  Oε return¼ D┼ point≤ t∩ thσ ì
  1473. bytσ afte≥ thi≤ buffer.
  1474.  
  1475.      Inputs:  HL = value to be converted and stored
  1476.               DE points to a 5-byte buffer
  1477.  
  1478.      Outputs:  DE points to the byte following the buffer
  1479.  
  1480.      Registers Affected:  DE
  1481.  
  1482.      SYSLIB Routines Called:  -None-
  1483.  
  1484.      Special Error Conditions:  -None-
  1485.  
  1486.  
  1487.  
  1488. 9.03 Output HL as Up to 5 Decimal Character with Leading Spaces
  1489.  
  1490.      Routine Names:  PHLDC, LHLDC
  1491.      Function║
  1492.           Prin⌠á H╠á a≤á u≡ t∩ fivσ (5⌐ decima∞á character≤á witΦ ì
  1493. leadinτ space≤ (<SP>⌐ oε CON║ (PHLDC⌐ o≥ LST║ (LHLDC).
  1494.  
  1495.      Inputs:  HL = value to be printed
  1496.  
  1497.      Outputs:  -None- (Value is printed)
  1498.  
  1499.      Registers Affected:  -None-
  1500.  
  1501.      SYSLIB Routines Called:  POUT (for PHLDC); LOUT (for LHLDC)
  1502.  
  1503.      Special Error Conditions:  -None-
  1504. è
  1505.      Routine Name:  MHLDC
  1506.      Function║
  1507.           Storσá H╠á a≤ u≡ t∩ fivσ (5⌐á decima∞á character≤á witΦ ì
  1508. leadinτ space≤ iε thσ 5-bytσ memor∙ buffe≥ pointeΣ t∩ b∙ DE.
  1509.  
  1510.      Inputs:  HL = value to be converted and printed
  1511.               DE points to the 5-byte buffer
  1512.  
  1513.      Outputs:  DE points to the byte after the buffer
  1514.  
  1515.      Registers Affected:  DE
  1516.  
  1517.      SYSLIB Routines Called:  -None-
  1518.  
  1519.      Special Error Conditions:  -None-
  1520.  
  1521.  
  1522. 9.04 Output A as 2 Hexadecimal Characters
  1523.  
  1524.      Routine Names:  PA2HC, LA2HC
  1525.      Function║
  1526.           Prin⌠á ┴á a≤á tw∩ (2⌐ hexadecima∞á character≤á oεá CON║ ì
  1527. (PA2HC⌐ o≥ LST║ (LA2HC).
  1528.  
  1529.      Inputs:  A = value to be printed
  1530.  
  1531.      Outputs:  -None- (Value is printed)
  1532.  
  1533.      Registers Affected:  -None-
  1534.  
  1535.      SYSLI┬ Routine≤ Called║á  E╬ (fo≥ both)╗á POU╘ (fo≥á PA2HC)╗ ì
  1536. LOU╘ (fo≥ LA2HC)
  1537.  
  1538.      Special Error Conditions:  -None-
  1539.  
  1540.  
  1541.  
  1542.      Routine Name:  MA2HC
  1543.      Function║
  1544.           Storσ ┴ a≤ tw∩ (2⌐ hexadecima∞ character≤ iε thσ 2-bytσ ì
  1545. memor∙á buffe≥ pointeΣ t∩ b∙ DE«á  Oε return¼á DE point≤ t∩á bytσ ì
  1546. afte≥ buffer.
  1547.  
  1548.      Inputs:  A = value to be converted and stored
  1549.               DE points to 2-byte buffer
  1550.  
  1551.      Outputs:  DE points to byte after this buffer
  1552.  
  1553.      Registers Affected:  DE
  1554.  
  1555.      SYSLIB Routines Called:  EN
  1556.  
  1557.      Special Error Conditions:  -None-
  1558.  
  1559. è
  1560. 9.05 Output A as 3 Decimal Characters
  1561.  
  1562.      Routine Names:  PA3DC, LA3DC
  1563.      Function║
  1564.           Prin⌠ ┴ a≤ threσ (3⌐ decima∞ character≤ oε CON║ (PA3DC⌐ ì
  1565. o≥ LST║ (LA3DC).
  1566.  
  1567.      Inputs:  A = value to be printed
  1568.  
  1569.      Outputs:  -None- (Value is printed)
  1570.  
  1571.      Registers Affected:  -None-
  1572.  
  1573.      SYSLIB Routines Called:  POUT (for PA3DC); LOUT (for LA3DC)
  1574.  
  1575.      Special Error Conditions:  -None-
  1576.  
  1577.  
  1578.  
  1579.      Routine Name:  MA3DC
  1580.      Function║
  1581.           Storσá ┴ a≤ threσ (3⌐ decima∞ character≤ iε thσá 3-bytσ ì
  1582. memor∙ buffe≥ pointeΣ t∩ b∙ DE«  Oε return¼ DE point≤ t∩ thσ bytσ ì
  1583. afte≥ thσ buffer.
  1584.  
  1585.      Inputs:  A = value to be converted and stored
  1586.               DE points to the 3-byte buffer
  1587.  
  1588.      Outputs:  DE points to the byte after the buffer
  1589.  
  1590.      Registers Affected:  DE
  1591.  
  1592.      SYSLIB Routines Called:  -None-
  1593.  
  1594.      Special Error Conditions:  -None-
  1595.  
  1596.  
  1597. 9.06 Output A as Up to 3 Decimal Characters with Leading Spaces
  1598.  
  1599.      Routine Names:  PADC, LADC
  1600.      Function║
  1601.           Prin⌠á ┴á a≤á u≡ t∩ threσ (3⌐ decima∞á character≤á witΦ ì
  1602. leadinτ space≤ (<SP>⌐ oε CON║ (PADC⌐ o≥ LST║ (LADC).
  1603.  
  1604.      Inputs:  A = value to be printed
  1605.  
  1606.      Outputs:  -None- (Value is printed)
  1607.  
  1608.      Registers Affected:  -None-
  1609.  
  1610.      SYSLIB Routines Called:  POUT (for PADC); LOUT (for LADC)
  1611.  
  1612.      Special Error Conditions:  -None-
  1613.  
  1614. è
  1615.      Routine Name:  MADC
  1616.      Function║
  1617.           Storσá ┴á a≤ u≡ t∩ threσ (3⌐á decima∞á character≤á witΦ ì
  1618. leadinτ space≤ iε thσ 3-bytσ memor∙ buffe≥ pointeΣ t∩ b∙ DE«á  Oε ì
  1619. return¼ DE point≤ t∩ thσ bytσ afte≥ thσ buffer.
  1620.  
  1621.      Inputs:  A = value to be converted and stored
  1622.               DE points to the 3-byte memory buffer
  1623.  
  1624.      Outputs:  DE points to the byte after the buffer
  1625.  
  1626.      Registers Affected:  DE
  1627.  
  1628.      SYSLIB Routines Called:  -None-
  1629.  
  1630.      Special Error Conditions:  -None-
  1631.  
  1632. .fo 10 - String and Value Comparison Routines              Page #
  1633.  
  1634. 10.0 String and Value Comparision Routines
  1635.  
  1636.      Routine Name:  COMPHD
  1637.      Function║
  1638.           Comparσ H╠ t∩ DE«á  Oε return¼á Zer∩ Flaτ Se⌠ =╛ HL=DE¼ ì
  1639. Carr∙ Flaτ Se⌠ =╛ HL<DE.
  1640.  
  1641.      Inputs:  HL, DE -- Values to compare
  1642.  
  1643.      Outputs:  Zero and Carry Flags
  1644.  
  1645.      Registers Affected:  PSW
  1646.  
  1647.      SYSLIB Routines Called:  -None-
  1648.  
  1649.      Special Error Conditions:  -None-
  1650.  
  1651.  
  1652.  
  1653.      Routine Names:  COMPB, COMPBC
  1654.      Function║
  1655.           Vecto≥ Comparσ Routines«  Comparσ thσ vecto≥ pointeΣ t∩ ì
  1656. b∙á H╠ witΦ tha⌠ pointeΣ t∩ b∙ D┼ (Vector≤ arσ oµ equa∞á length)«  ì
  1657. Vector≤á arσ ┬ byte≤ lonτ fo≥ COMP┬ anΣ B├ byte≤ lonτ fo≥ COMPBC«  ì
  1658. Oεá exit¼á Zer∩á Flaτ Se⌠ indicate≤ tha⌠ vector≤á arσá identical╗ ì
  1659. Carr∙ Flaτ Se⌠ indicate≤ tha⌠ thσ vecto≥ pointeΣ t∩ b∙ H╠ i≤ les≤ ì
  1660. thaε thσ vecto≥ pointeΣ t∩ b∙ DE.
  1661.  
  1662.      Inputs:  HL, DE -- Pointers to vectors to compare
  1663.               B (for COMPB), BC (for COMPBC) -- number of bytes
  1664.                in vectors
  1665.  
  1666.      Outputs:  Zero and Carry Flags
  1667.  
  1668.      Registers Affected:  PSW
  1669.  
  1670.      SYSLIB Routines Called:  -None-
  1671.  
  1672.      Special Error Conditions:  -None-
  1673.  
  1674.  
  1675.  
  1676.      Routine Name:  SCANNER
  1677.      Function║
  1678.           SCANNE╥ scan≤ thσ vecto≥ oµ byte≤ pointeΣ t∩ b∙ H╠á fo≥ ì
  1679. thσá vecto≥ oµ byte≤ pointeΣ t∩ b∙ DE«á  Thσ HL-bytσ vecto≥ i≤á ┬ ì
  1680. byte≤ lonτ anΣ thσ DE-bytσ vecto≥ i≤ ├ byte≤ long«  Oε return¼ iµ ì
  1681. found¼ H╠ point≤ t∩ thσ beginninτ locatioε withiε thσ origina∞ H╠ ì
  1682. vecto≥á oµá thσ locateΣ vecto≥ anΣ thσ Zer∩ Flaτ i≤ Set╗á iµá no⌠ ì
  1683. found¼ Zer∩ Flaτ i≤ no⌠ se⌠ anΣ H╠ i≤ no⌠ affecteΣ (point≤ t∩ thσ ì
  1684. beginninτ oµ thσ origina∞ HL-bytσ vector).
  1685.  
  1686.  
  1687.      Inputs:  HL = Pointer to vector to be scanned
  1688.               DE = Pointer to vector to scan for
  1689.               B = Number of bytes in HL-vector
  1690.               C = Number of bytes in DE-vector
  1691.  
  1692.      Outputs:  If found, Zero Set and HL pts to located vector
  1693.                If not found, Zero Reset and HL unaffected
  1694.  
  1695.      Registers Affected:  PSW, HL
  1696.  
  1697.      SYSLIB Routines Called:  -None-
  1698.  
  1699.      Specia∞á Erro≥á Conditions║á  Automatiπá succes≤á iµá vecto≥ ì
  1700. searcheΣ fo≥ i≤ null.
  1701.  
  1702.  
  1703.  
  1704.      Routine Name:  INSTR
  1705.      Function║
  1706.           INSTRIN╟á Function«á  Scaε thσ strinτ pointeΣ t∩ b∙á H╠ ì
  1707. fo≥ thσ strinτ pointeΣ t∩ b∙ DE«á  ┴ strinτ i≤ ß vecto≥ oµá byte≤ ì
  1708. terminateΣ b∙ ß binar∙ 0.
  1709.  
  1710.           Oε return¼á iµ found¼ Zer∩ Flaτ i≤ Se⌠ anΣ H╠ point≤ t∩ ì
  1711. 1s⌠ bytσ oµ substrinτ withiε scanneΣ string╗á iµ no⌠ found¼á Zer∩ ì
  1712. Flaτ i≤ no⌠ se⌠ anΣ H╠ i≤ no⌠ affected.
  1713.  
  1714.  
  1715.      Inputs:  HL = Pointer to string to be scanned
  1716.               DE = Pointer to string to scan for
  1717.  
  1718.      Outputs:  If found, Zero Set and HL pts to located substring
  1719.                If not found, Zero Reset and HL unaffected
  1720.  
  1721.      Registers Affected:  PSW, HL
  1722.  
  1723.      SYSLIB Routines Called:  -None-
  1724.  
  1725.      Specia∞ Erro≥ Conditions:
  1726.           Automatiπ succes≤ iµ strinτ searcheΣ fo≥ i≤ null.
  1727. .fo 11 - Character Input/Output Routines                   Page #
  1728.  
  1729. 11.0 Character Input/Output Routines
  1730.  
  1731. 11.01 <CR> <LF> Output
  1732.  
  1733.      Routine Names:  CRLF, LCRLF
  1734.      Function:
  1735.           Print <CR> and <LF> on CON: (CRLF) or LST: (LCRLF).
  1736.  
  1737.      Inputs:  -None-
  1738.  
  1739.      Outputs:  -None- (<CR> <LF> is printed)
  1740.  
  1741.      Registers Affected:  -None-
  1742.  
  1743.      SYSLIB Routines Called:  POUT (for CRLF); LOUT (for LCRLF)
  1744.  
  1745.      Special Error Conditions:  -None-
  1746.  
  1747.  
  1748.  
  1749. 11.02 Conditional Input
  1750.  
  1751.      Routine Name:  CONDIN
  1752.      Function║
  1753.           Inpu⌠á ßá characte≥á froφ CON║á iµá onσá i≤á available╗ ì
  1754. otherwise¼á returεá ßá flaτá statinτá tha⌠á ßá characte≥á i≤á no⌠ ì
  1755. availablσ oε CON:.
  1756.  
  1757.      Inputs:  -None-
  1758.  
  1759.      Outputs:  A = character typed at CON: (if available)
  1760.                Zero Flag is set (Z) if no character is available
  1761.                Zero Flag is reset (NZ) if character is available
  1762.  
  1763.      Registers Affected:  PSW
  1764.  
  1765.      SYSLIB Routines Called:  CST, CIN
  1766.  
  1767.      Special Error Conditions:  -None-
  1768.  
  1769.  
  1770. 11.03 General Input Routines
  1771.  
  1772.      Routine Name:  CST
  1773.      Function║
  1774.           Inpu⌠ thσ statu≤ oε CON║á iε Registe≥ A«á  Iµ ReaΣ Datß ì
  1775. Available¼ A=0╗ otherwise¼ A=1.
  1776.  
  1777.      Inputs:  -None-
  1778.  
  1779.      Outputs:  A = Console Status
  1780.                    0 --> Read Data Available (RDA)
  1781.                    1 --> Read Data Not Available (Not RDA)
  1782.  
  1783.      Registers Affected:  PSW
  1784.  
  1785.      SYSLIB Routines Called:  -None-
  1786.  
  1787.      Special Error Conditions:  -None-
  1788.  
  1789.  
  1790.  
  1791.      Routine Names:  CIN, RIN
  1792.      Function║á Inpu⌠ characte≥ froφ CON║á (CIN⌐ o≥ RDR║ (RIN⌐ iε ì
  1793. Registe≥ A.
  1794.  
  1795.      Inputs:  -None-
  1796.  
  1797.      Outputs:  A = Character input from CON: or RDR:
  1798.  
  1799.      Registers Affected:  PSW
  1800.  
  1801.      SYSLIB Routines Called:  -None-
  1802.  
  1803.      Special Error Conditions:  -None-
  1804.  
  1805.  
  1806.  
  1807. 11.04 General Output Routines
  1808.  
  1809.      Routine Names:  COUT, LOUT, POUT
  1810.      Function║
  1811.           Outpu⌠á characte≥ iε Registe≥ ┴ t∩á CON║á (COUT)¼á LST║ ì
  1812. (LOUT)¼ o≥ PUN║ (POUT).
  1813.  
  1814.      Inputs:  A = Character to output
  1815.  
  1816.      Outputs:  -None- (Character is output)
  1817.  
  1818.      Registers Affected:  -None-
  1819.  
  1820.      SYSLIB Routine Called:  -None-
  1821.  
  1822.      Special Error Conditions:  -None-
  1823.  
  1824. è
  1825.      Routine Names:  CCOUT, CLOUT, CPOUT
  1826.      Function║
  1827.           Outpu⌠á characte≥ iε Registe≥ ┴ t∩á CON║á (COUT)¼á LST║ ì
  1828. (LOUT)¼á o≥ PUN║á (POUT⌐ witΦ contro∞ characte≥ processing«á  Al∞ ì
  1829. character≤ witΦ ASCI╔ code≤ les≤ thaε <SP╛ (spacσ ╜ 20H⌐ iε valuσ ì
  1830. excep⌠á <NULL>¼á <BEL>¼á <BS>¼á <LF>¼á anΣ <CR╛ arσ outpu⌠ a≤á aε ì
  1831. uparro≈á (^⌐á followeΣ b∙ thσ correspondinτ lette≥á generateΣá b∙ ì
  1832. addinτ 40╚ t∩ thσ characte≥ valuσ (i.e.¼á ▒ output≤ a≤ "^A"¼ ▓ a≤ ì
  1833. "^B"¼á etc.)«á  Again¼ thσ character≤ les≤ thaε <SP╛ iε valuσ NO╘ ì
  1834. outpu⌠ iε thi≤ manne≥ arσ --
  1835.  
  1836.           <NULL>  <BEL>  <BS>  <LF>  <CR>
  1837.  
  1838. An∙ characte≥ oµ valuσ greate≥ thaε <SP╛ i≤ outpu⌠ normally.
  1839.  
  1840.      Inputs:  A = Character to output
  1841.  
  1842.      Outputs:  -None- (Character/Code is output)
  1843.  
  1844.      Registers Affected:  PSW (only the Flags;
  1845.                               Register A is NOT affected)
  1846.  
  1847.      SYSLI┬ Routine≤ Called║  COU╘ (fo≥ CCOUT)╗
  1848.                               LOU╘ (fo≥ CLOUT)╗ POU╘ (fo≥ CPOUT)
  1849.  
  1850.      Special Error Conditions:  -None-
  1851.  
  1852. .fo 12 - Math Routines                                     Page #
  1853.  
  1854. 12.0 Math Routines
  1855.  
  1856. 12.01 Introduction
  1857.  
  1858.      Thi≤á modulσá contain≤ ß se⌠ oµ 16-bi⌠á unsigneΣá arithmetiπ ì
  1859. routines«á  Al∞ routine≤ usσ H╠ a≤ thσ accumulato≥ o≥ thσ result¼ ì
  1860. anΣá H╠ anΣ D┼ contaiε thσ operand≤ requireΣ (iµ onl∙ onσ operanΣ ì
  1861. is needed, HL contains it).
  1862.  
  1863.      The available routines are:
  1864.  
  1865.           ADDHD -- HL = HL + DE    SUBHD -- HL = HL - DE
  1866.           MULHD -- HL = HL * DE    DIVHD -- HL = HL / DE
  1867.           NEGH  -- HL = 2's Complement of HL
  1868.           CMPH  -- HL = 1's Complement of HL
  1869.           ROTLH -- HL is rotated left one bit position
  1870.           ROTRH -- HL is rotated right one bit position
  1871.           SHFTLH -- HL is shifted left one bit position
  1872.           SHFTRH -- HL is shifted right one bit position
  1873.           ANDHD  -- HL = HL AND DE
  1874.           ORHD   -- HL = HL OR DE
  1875.           XORHD  -- HL = HL XOR DE
  1876.  
  1877.  
  1878.  
  1879. 12.02 Arithmetic Operations -- ADDHD, SUBHD, MULHD, DIVHD
  1880.  
  1881.      Al∞á oµá thesσ routine≤ operatσ oε H╠ anΣá DE¼á placinτá thσ ì
  1882. resul⌠á iε HL«á  Thσ Carr∙ Flaτ i≤ affected¼á frequentl∙ useΣá t∩ ì
  1883. indicate overflow.
  1884.  
  1885.  
  1886.      Routine Name:  ADDHD
  1887.      Function║
  1888.           HL = HL + DE
  1889.      Inputs:  HL, DE are operands
  1890.      Outputs:  HL is result, Carry Flag Set (C) means overflow
  1891.      Registers Affected:  HL, PSW
  1892.      SYSLIB Routines Called:  None
  1893.      Specia∞á Erro≥ Conditions║  None
  1894.  
  1895.  
  1896.  
  1897.  
  1898.      Routine Name:  SUBHD
  1899.      Function║
  1900.           HL = HL - DE
  1901.      Inputs:  HL, DE are operands
  1902.      Outputs:  HL is result, Carry Flag Set (C) if HL<DE
  1903.      Registers Affected:  HL, PSW
  1904.      SYSLIB Routines Called:  None
  1905.      Specia∞á Erro≥ Conditions║  None
  1906.  
  1907.  
  1908.      Routine Name:  MULHD
  1909.      Function║
  1910.           HL = HL * DE
  1911.      Inputs:  HL, DE are operands
  1912.      Outputs:  HL is result, Carry Set means Overflow
  1913.      Registers Affected:  HL, PSW
  1914.      SYSLIB Routines Called:  SHFTRH, SHFTLH
  1915.      Specia∞á Erro≥ Conditions║  None
  1916.      Note║á  Thi≤á routinσ i≤ optimizeΣ fo≥ speed¼á witΦ ßá mino≥ ì
  1917. sacrificσá oε size¼á anΣ i⌠ alway≤ take≤ 1╢ loop≤ t∩ perforφá an∙ ì
  1918. multiplication.
  1919.  
  1920.  
  1921.  
  1922.  
  1923.      Routine Name:  DIVHD
  1924.      Function║
  1925.           HL = HL / DE
  1926.      Inputs:  HL, DE are operands
  1927.      Outputs:  HL is result
  1928.      Registers Affected:  HL
  1929.      SYSLIB Routines Called:  SHFTLH
  1930.      Specia∞á Erro≥ Conditions║  None
  1931.      Note║á  Thi≤á routinσ i≤ optimizeΣ fo≥ speed¼á witΦ ßá mino≥ ì
  1932. sacrificσá oε size¼á anΣ i⌠ alway≤ take≤ 1╢ loop≤ t∩ perforφá an∙ ì
  1933. division.
  1934.  
  1935.  
  1936.  
  1937. 12.03 Complement Operations -- NEGH and CMPH
  1938.  
  1939.      These routines operate on HL, placing the result into HL.
  1940.  
  1941.  
  1942.      Routine Name:  NEGH
  1943.      Function║
  1944.           HL = 2's Complement of HL
  1945.      Inputs:  HL is operand
  1946.      Outputs:  HL is result
  1947.      Registers Affected:  HL
  1948.      SYSLIB Routines Called:  CMPH
  1949.      Specia∞á Erro≥ Conditions║  None
  1950.  
  1951.  
  1952.  
  1953.  
  1954.      Routine Name:  CMPH
  1955.      Function║
  1956.           HL = 1's Complement of HL
  1957.      Inputs:  HL is operand
  1958.      Outputs:  HL is result
  1959.      Registers Affected:  HL
  1960.      SYSLIB Routines Called:  None
  1961.      Specia∞á Erro≥ Conditions║  None
  1962. è
  1963. 12.04 Rotate and Shift Operations -- ROTLH, ROTRH, SHFTLH, SHFTRH
  1964.  
  1965.  
  1966.      These operations operate on HL, placing the result into HL.
  1967.  
  1968.  
  1969.      Routine Name:  ROTLH
  1970.      Function║
  1971.           H╠á i≤á rotateΣá lef⌠ onσá bi⌠á position«á  Thi≤á i≤á ß ì
  1972. circula≥á rotate¼á anΣá thσ mos⌠ significan⌠ bi⌠ oµ ╚ i≤á rotateΣ ì
  1973. into the least significant bit position of L.
  1974.      Inputs:  HL is operand
  1975.      Outputs:  HL is result
  1976.      Registers Affected:  HL
  1977.      SYSLIB Routines Called:  None
  1978.      Specia∞á Erro≥ Conditions║  None
  1979.  
  1980.  
  1981.  
  1982.  
  1983.      Routine Name:  ROTRH
  1984.      Function║
  1985.           H╠á i≤á rotateΣá righ⌠ onσ bi⌠á position«á  Thi≤á i≤á ß ì
  1986. circula≥á rotate¼á anΣ thσ leas⌠ significan⌠ bi⌠ oµ ╠ i≤á rotateΣ ì
  1987. into the most significant bit position of H.
  1988.      Inputs:  HL is operand
  1989.      Outputs:  HL is result
  1990.      Registers Affected:  HL
  1991.      SYSLIB Routines Called:  None
  1992.      Specia∞á Erro≥ Conditions║  None
  1993.  
  1994.  
  1995.  
  1996.  
  1997.      Routine Name:  SHFTLH
  1998.      Function║
  1999.           H╠á i≤á shifteΣá lef⌠á onσá bi⌠á position«á  Thσá leas⌠ ì
  2000. significant bit of L is filled with a Zero.
  2001.      Inputs:  HL is operand
  2002.      Outputs:  HL is result
  2003.      Registers Affected:  HL
  2004.      SYSLIB Routines Called:  None  
  2005.      Specia∞á Erro≥ Conditions║  None
  2006.  
  2007.  
  2008.  
  2009.      Routine Name:  SHFTRH
  2010.      Function║
  2011.           H╠á i≤á shifteΣá righ⌠á onσá bi⌠á position«á  Thσá mos⌠ ì
  2012. significant bit of H is filled with a Zero.
  2013.      Inputs:  HL is operand
  2014.      Outputs:  HL is result
  2015.      Registers Affected:  HL
  2016.      SYSLIB Routines Called:  None  
  2017.      Specia∞á Erro≥ Conditions║  None
  2018.  
  2019.  
  2020.  
  2021.  
  2022. 12.05 Logical Operations -- ANDHD, ORHD, XORHD
  2023.  
  2024.      These operate on HL and DE, placing the result into HL.
  2025.  
  2026.  
  2027.      Routine Name:  ANDHD
  2028.      Function║
  2029.           HL = HL AND DE
  2030.      Inputs:  HL and DE are operands
  2031.      Outputs:  HL is result
  2032.      Registers Affected:  HL
  2033.      SYSLIB Routines Called:  None  
  2034.      Specia∞á Erro≥ Conditions║  None
  2035.  
  2036.  
  2037.  
  2038.  
  2039.      Routine Name:  ORHD
  2040.      Function║
  2041.           HL = HL OR DE
  2042.      Inputs:  HL and DE are operands
  2043.      Outputs:  HL is result
  2044.      Registers Affected:  HL
  2045.      SYSLIB Routines Called:  None  
  2046.      Specia∞á Erro≥ Conditions║  None
  2047.  
  2048.  
  2049.  
  2050.  
  2051.      Routine Name:  XORHD
  2052.      Function║
  2053.           HL = HL XOR DE
  2054.      Inputs:  HL and DE are operands
  2055.      Outputs:  HL is result
  2056.      Registers Affected:  HL
  2057.      SYSLIB Routines Called:  None
  2058.      Specia∞á Erro≥ Conditions║  None
  2059.  
  2060. .fo 13 - CRC Routines                                      Page #
  2061.  
  2062. 13.0 CRC Routines
  2063.  
  2064.      Thσá CR├á Routine≤ ma∙ bσ useΣ t∩ checδ thσ validit∙á oµá aε ì
  2065. incominτ seria∞ bytσ streaφ oµ arbitrar∙ length«á  Thesσ routine≤ ì
  2066. computσ anΣ checδ ß truσ 16-bi⌠ Cycliπ Redundanc∙ Codσ (CRC).
  2067.      The use of these routines will guarantee detection of:
  2068.           1) all single- and double-bit errors
  2069.           2) all errors with an odd number of error bits
  2070.           3) all burst errors of length 16 or less
  2071.      Additionally, the following statistics:
  2072.           1) 99.9969% of all 17-bit error bursts
  2073.           2) 99.9984% of all possible longer error bursts
  2074.  
  2075.      Thσ followinτ displa∙ illustrate≤ ß typica∞ wa∙ t∩ usσ thesσ ì
  2076. routines:
  2077.  
  2078.      ;
  2079.      ;  EXTERNAL DECLARATIONS OF SYSLIB ROUTINES
  2080.      ;
  2081.           ...
  2082.           EXT  CRCCLR    ; CLEAR CRC ACCUMULATOR
  2083.           EXT  CRCUPD    ; UPDATE CRC ACCUMULATOR
  2084.           EXT  CRCDONE   ; RETURN CRC ACCUMULATOR VALUE
  2085.           EXT  COMPHD    ; COMPARE HL TO DE, RETURN ZERO IF EQUAL
  2086.           ...
  2087.      CRC$MAKE:                ; ROUTINE TO ESTABLISH OUTGOING CRC
  2088.           CALL CRCCLR    ; CLEAR CRC
  2089.           <loop CALLing CRCUPD>    ; ACQUIRE VALUES
  2090.           CALL CRCDONE   ; GET VALUE
  2091.           PUSH H         ; SAVE VALUE
  2092.      CRC$CHECK:          ; ROUTINE TO CHECK INCOMING CRC VALUE
  2093.           CALL CRCCLR    ; CLEAR CRC
  2094.           <loop CALLing CRCUPD>    ; ACQUIRE VALUES
  2095.           CALL CRCDONE   ; GET 2ND CRC
  2096.           POP  D         ; GET 1ST CRC IN DE, 2ND IN HL
  2097.           CALL COMPHD    ; COMPARE HL TO DE (SYSLIB ROUTINE)
  2098.           JNZ  ERROR     ; ERROR IF NO MATCH
  2099.           ...
  2100.  
  2101.      Thσá followinτá screeε display≤ describσ thσá CR├á routines«  ì
  2102. Therσ arσ threσ differen⌠ set≤ oµ CR├ computatioε routines¼á eacΦ ì
  2103. se⌠á workinτ witΦ ß differen⌠ polynomial«á  Thσ routinσá se⌠á fo≥ ì
  2104. CRC▓á use≤ thσ samσ polynomia∞ a≤ thσ publiπ domaiε CRC╦á prograφ ì
  2105. b∙ KeitΦ Petersen.
  2106.  
  2107.           CRC Routine    Polynomial
  2108.           -----------    ----------
  2109.              CRC         X^16 + X^12 + X^5 + 1
  2110.              CRC1        X^16 + X^15 + X^2 + 1
  2111.              CRC2        X^16 + X^15 + X^13 + X^7 + X^4 +
  2112.                               X^2 + X + 1
  2113.  
  2114.  
  2115.  
  2116.      Routine Name:  CRCCLR, CRC1CLR, CRC2CLR
  2117.      Function║
  2118.           Clea≥á thσá interna∞ CR├ Accumulato≥ iε preparatioεá t∩ ì
  2119. CR├ computation.
  2120.  
  2121.      Inputs:  None
  2122.  
  2123.      Outputs:  None
  2124.  
  2125.      Registers Affected:  None
  2126.  
  2127.      SYSLIB Routines Called:  None
  2128.  
  2129.      Special Error Conditions:  None
  2130.  
  2131.  
  2132.  
  2133.      Routine Name:  CRCUPD, CRC1UPD, CRC2UPD
  2134.      Function:
  2135.           Updatσ thσ CR├ Accumulato≥ valuσ witΦ thσ nex⌠ byte.
  2136.  
  2137.      Input:  A=byte to be included in CRC
  2138.  
  2139.      Outputs:  None
  2140.  
  2141.      Registers Affected:  None
  2142.  
  2143.      SYSLIB Routines Called:  None
  2144.  
  2145.      Special Error Conditions:  None
  2146.  
  2147.  
  2148.  
  2149.      Routine Name:  CRCDONE, CRC1DONE, CRC2DONE
  2150.      Function║
  2151.           Terminatσáá CR├á valuσá accumulatioεá anΣá returεáá thσ ì
  2152. calculateΣ 16-bi⌠ CR├ value.
  2153.  
  2154.      Inputs:  None
  2155.  
  2156.      Output:  HL = calculated CRC value
  2157.  
  2158.      Registers Affected:  HL
  2159.  
  2160.      SYSLIB Routines Called:  None
  2161.  
  2162.      Special Error Conditions:  None
  2163.  
  2164.  
  2165.  
  2166.  
  2167.  
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.  
  2174.           **** This Page Intentionally Left Blank ****
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180. .fo 14 - Random Number Generator Routines                  Page #
  2181.  
  2182. 14.0 Random Number Generator Routines
  2183.  
  2184.      Thσ followinτ se⌠ oµ routine≤ arσ useΣ t∩ (1⌐ providσ ß seeΣ ì
  2185. valuσá fo≥á thσá randoφ numbe≥ generato≥ anΣ (2⌐á cal∞á ßá randoφ ì
  2186. number generator to return a random number.
  2187.  
  2188.      RNDINI╘á counts¼á waitinτ fo≥ thσ user'≤ keypress¼á a⌠ whicΦ ì
  2189. poin⌠ i⌠ stop≤ countinτ anΣ use≤ thσ coun⌠ a≤ thσ seeΣ valuσá fo≥ ì
  2190. the random number generator.
  2191.  
  2192.      RNDSEE─á allow≤á thσá use≥ t∩ specif∙ ß seeΣ valuσá fo≥á thσ ì
  2193. random number generator.
  2194.  
  2195.      RND returns a random number.
  2196.  
  2197.  
  2198.      Routine Name:  RNDINIT
  2199.      Function║
  2200.           RNDINI╘ enter≤ ß countinτ loop¼ waitinτ fo≥ thσ use≥ t∩ ì
  2201. strikσ ß ke∙ a⌠ hi≤ console«  I⌠ theε set≤ thσ seeΣ valuσ fo≥ thσ ì
  2202. randoφ numbe≥ generato≥ baseΣ upoε it≤ coun⌠ valuσ a⌠ thσ instan⌠ ì
  2203. of keypress.  The seed value is an 8-bit quantity.
  2204.  
  2205.      Inputs:  None (User Keypress)
  2206.  
  2207.      Outputs:  None  (Seed is set)
  2208.  
  2209.      Registers Affected:  None
  2210.  
  2211.      SYSLIB Routines Called:  CONDIN, RND
  2212.  
  2213.      Specia∞á Erro≥ Conditions║  None
  2214.  
  2215.  
  2216.  
  2217.  
  2218.      Routine Name:  RNDSEED
  2219.      Function║
  2220.           Thi≤á routinσá allow≤ thσ use≥ t∩ providσ ß seeΣá valuσ ì
  2221. fo≥á thσ randoφ numbe≥ generator«á  Thσ seeΣ i≤ passeΣ iεá thσá ┴ ì
  2222. register.
  2223.  
  2224.      Inputs:  A = Seed
  2225.  
  2226.      Outputs:  None  (Seed is set)
  2227.  
  2228.      Registers Affected:  None
  2229.  
  2230.      SYSLIB Routines Called:  RND
  2231.  
  2232.      Specia∞á Erro≥ Conditions║  None
  2233.  
  2234.  
  2235.  
  2236. è
  2237.      Routine Name:  RND
  2238.      Function║
  2239.           Thi≤ i≤ thσ user-callablσ randoφ numbe≥ generator«á  I⌠ ì
  2240. return≤á ßá pseudo-randoφ numbe≥ (8-bit⌐ iε thσ ┴á registe≥á wheε ì
  2241. called.
  2242.  
  2243.      Inputs:  None
  2244.  
  2245.      Outputs:  A = Random Number
  2246.  
  2247.      Registers Affected:  PSW
  2248.  
  2249.      SYSLIB Routines Called:  None
  2250.  
  2251.      Specia∞á Erro≥ Conditions║  None
  2252.  
  2253.  
  2254. .fo 15 - User/Disk Manipulation Routines                   Page #
  2255.  
  2256. 15.0 User/Disk Manipulation Routines
  2257.  
  2258.      Thi≤á i≤á ßá se⌠ oµ fou≥ routine≤ whicΦ allo≈á thσá use≥á t∩ ì
  2259. readil∙ movσ arounΣ betweeε disk≤ anΣ use≥ areas«  Thesσ routine≤ ì
  2260. are:
  2261.           PUTUD -- to save away the current disk/user
  2262.           GETUD -- to restore the disk/user saved by PUTUD
  2263.           RETUD -- to return the current disk/user
  2264.           LOGUD -- to log the user into a specified disk/user
  2265.  
  2266.      PUTU─á anΣ GETU─ arσ designeΣ t∩ bσ useΣ a≤ ßá placσá marke≥ ì
  2267. anΣá returεá combination«á  The∙ arσ intendeΣ t∩ bσ useΣ iεá codσ ì
  2268. sequences like the following:
  2269.  
  2270.           CALL PUTUD     ; Mark current location
  2271.           < move around on disks/users >
  2272.           CALL GETUD     ; Return to marked location
  2273.  
  2274.      RETU─ anΣ LOGU─ arσ t∩ bσ useΣ t∩ finΣ ou⌠ wherσ thσ prograφ ì
  2275. is (RETUD) and to enter a specific disk/user area (LOGUD).
  2276.  
  2277.  
  2278.  
  2279.      Routine Name:  PUTUD
  2280.      Function║
  2281.           PUTU─á save≤ thσ curren⌠ use≥ anΣ disδ number≤ awa∙ fo≥ ì
  2282. late≥á retrieva∞ b∙ GETUD«á  PUTU─ anΣ GETU─ arσ intendeΣá t∩á bσ ì
  2283. useΣá t∩á savσ anΣ restorσ thσ curren⌠ disδ anΣ use≥ arounΣá somσ ì
  2284. set of operations in another user/disk area.
  2285.  
  2286.      Inputs:  None
  2287.  
  2288.      Outputs:  None
  2289.  
  2290.      Registers Affected:  None
  2291.  
  2292.      SYSLIB Routines Called:  RETUD
  2293.  
  2294.      Specia∞á Erro≥ Conditions║  None
  2295.  
  2296.  
  2297.  
  2298.  
  2299.      Routine Name:  GETUD
  2300.      Function║
  2301.           GETU─á restore≤á thσ curren⌠ use≥ anΣá disδá whicΦá wa≤ ì
  2302. saved by PUTUD.
  2303.  
  2304.      Inputs:  None
  2305.  
  2306.      Outputs:  None
  2307.  
  2308.      Registers Affected:  None
  2309.  
  2310.      SYSLIB Routines Called:  BDOS
  2311.  
  2312.      Specia∞á Erro≥ Conditions║  None
  2313.  
  2314.  
  2315.  
  2316.      Routine Name:  LOGUD
  2317.      Function║
  2318.           LOGU─ log≤ iε thσ disδ specifieΣ b∙ thσ ┬ registe≥ (B=░ ì
  2319. fo≥ Disδ A) and the user specified by the C register.
  2320.  
  2321.      Inputs:  B=Disk (B=0 for Disk A), C=User
  2322.  
  2323.      Outputs:  None
  2324.  
  2325.      Registers Affected:  None
  2326.  
  2327.      SYSLIB Routines Called:  BDOS
  2328.  
  2329.      Specia∞á Erro≥ Conditions║  None
  2330.  
  2331.  
  2332.  
  2333.  
  2334.      Routine Name:  RETUD
  2335.      Function║
  2336.           RETU─á return≤ thσ number≤ oµ thσ curren⌠ use≥ iε ├ anΣ ì
  2337. current disk in B (B=0 for disk A).
  2338.  
  2339.      Inputs:  None
  2340.  
  2341.      Outputs:  B=Disk (B=0 for disk A), C=User
  2342.  
  2343.      Registers Affected:  BC
  2344.  
  2345.      SYSLIB Routines Called:  BDOS
  2346.  
  2347.      Specia∞á Erro≥ Conditions║  None
  2348.  
  2349.  
  2350. .fo 16 - Sort Routines                                     Page #
  2351.  
  2352. 16.0 Sort Routine≤ 
  2353.  
  2354.      Tw∩á routine≤ arσ provideΣ whicΦ givσ thσ SYSLI┬á programme≥ ì
  2355. acces≤á t∩ ß ver∙ flexiblσ sortinτ system«á  Thσ maiε routinσá i≤ ì
  2356. calleΣá SORT¼á anΣ i⌠ provide≤ ß utilit∙ whicΦ doe≤ aεá in-memor∙ ì
  2357. sor⌠á oµá ß se⌠ oµ fixed-lengtΦ records«á  Thσ sortinτá techniquσ ì
  2358. useΣ i≤ ß Shel∞ Sort¼á adapteΣ froφ thσ booδ "Softwarσ Toolsóá b∙ ì
  2359. Kernigaεá anΣ Plaugher¼á publisheΣ b∙ Addison-Wesly¼á 1976¼á pagσ ì
  2360. 106«  Thi≤ sor⌠ i≤ ver∙ fast¼ mucΦ morσ s∩ thaε thσ simplσ bubblσ ì
  2361. sort.
  2362.  
  2363.      Thi≤á Shel∞ Sor⌠ caε bσ donσ iε tw∩ ways║á  witΦ o≥á withou⌠ ì
  2364. usinτá pointers«á  Sortinτá withou⌠ usinτ pointer≤á i≤á typicall∙ ì
  2365. slowe≥ thaε sortinτ witΦ pointers¼á anΣ thσ onl∙ advantagσ t∩ no⌠ ì
  2366. usinτá pointer≤ i≤ thσ saving≤ oµ spacσ whicΦ i≤ takeε u≡ b∙á thσ ì
  2367. pointer≤ (2*numbe≥ oµ entrie≤ bytes)«á  Iµ pointer≤ arσ useΣá fo≥ ì
  2368. thσá sort¼á theε wheneve≥ aε exchangσ i≤ done¼á thσ pointer≤á arσ ì
  2369. simpl∙ exchanged¼á rathe≥ thaε thσ ful∞ records¼ anΣ thi≤ greatl∙ ì
  2370. decreases the sort time in most cases.
  2371.  
  2372.      Thσ SOR╘ routinσ i≤ controlleΣ b∙ passinτ t∩ i⌠ ß pointe≥ t∩ ì
  2373. ß Sor⌠ Specificatioε Blocδ (SSB⌐ iε DE«á  Thi≤ Sor⌠ Specificatioε ì
  2374. Blocδá i≤á ß serie≤ oµ 2-bytσ word≤ whicΦ contaiεá thσá followinτ ì
  2375. information:
  2376.  
  2377.           Bytes 0&1: Starting Address of 1st Record
  2378.           Bytes 2&3: Number of Records to Sort
  2379.           Bytes 4&5: Size of Each Record (in Bytes)
  2380.           Bytes 6&7: Address of Compare Routine Provided by User
  2381.                          Thi≤á routinσ compare≤ tw∩ records¼á onσ ì
  2382. ááááááááááááááááááááápointeΣ t∩ b∙ H╠ anΣ thσ othe≥ pointeΣ t∩ b∙ ì
  2383. áááááááááááááááááááááDE«á  Iµ thσ recorΣ pointeΣ t∩ b∙ D┼ i≤ les≤ ì
  2384. áááááááááááááááááááááiε sortinτ orde≥ thaε tha⌠ pointeΣ t∩ b∙ HL¼ ì
  2385. áááááááááááááááááááááthi≤ Comparσ Routinσ i≤ t∩ returε witΦ Carr∙ ì
  2386. áááááááááááááááááááááSe⌠á (C)«á  Iµá thσá record≤á arσá equa∞á iε ì
  2387. ááááááááááááááááááááásortinτá order¼á thi≤ Comparσ Routinσ i≤á t∩ ì
  2388. áááááááááááááááááááááreturε witΦ Zer∩ Se⌠ (Z)«á  Onl∙ thσ PS╫á i≤ ì
  2389. áááááááááááááááááááááto be affected by the Compare Routine.
  2390.           Bytes 8&9: Address of Pointer Table
  2391.           Bytσ 10║  Flag╗ ░FFH mean≤ t∩ usσ pointers¼ 0 mean≤ not
  2392.           Byte 11:  Unused
  2393.  
  2394.      A≤ mentioneΣ previously¼á tw∩ routine≤ arσ availablσ iε thi≤ ì
  2395. sor⌠ module«á  Thσ firs⌠ routine¼ SSBINIT¼ look≤ a⌠ thσ beginninτ ì
  2396. oµá ßá scratcΦá areßá anΣá thσ initia∞ content≤á oµá aεá SS┬á anΣ ì
  2397. allocate≤ spacσ fo≥ thσ pointe≥ table«á  I⌠ als∩ check≤ t∩ seσ iµ ì
  2398. thσá buffe≥á requireΣ wil∞ overflo≈ thσá TP┴á (Transien⌠á Prograφ ì
  2399. Area).
  2400.  
  2401.      Thσ seconΣ routine¼á SORT¼ perform≤ thσ sort¼ anΣ controlleΣ ì
  2402. by the SSB pointer passed to it in DE.
  2403.  
  2404.  
  2405.      Routine Name:  SSBINIT
  2406.      Function║
  2407.           Thi≤á routinσ load≤ byte≤ 0&▒ (addres≤ oµ firs⌠ record⌐ ì
  2408. anΣá 8&╣ (addres≤ oµ pointe≥ table⌐ oµ aε SSB¼á checkinτ fo≥á TP┴ ì
  2409. overflow«á  I⌠ i≤ passeΣ thσ star⌠ addres≤ oµ ß scratcΦ area¼ anΣ ì
  2410. set≤á thσ pointe≥ tablσ t∩ star⌠ here¼á look≤ a⌠ thσ recorΣá sizσ ì
  2411. anΣ recorΣ coun⌠ entrie≤ oµ aε SSB¼á anΣ add≤ thi≤ produc⌠ t∩ thσ ì
  2412. addres≤ oµ thσ pointe≥ table«á  Thσ resultan⌠ addres≤ i≤ returneΣ ì
  2413. as the address of the first record.
  2414.      Thi≤á routinσá ma∙á bσ useΣ a≤ describeΣá abovσá beforσá an∙ ì
  2415. record≤á arσ loadeΣ int∩ memor∙ fo≥ thσ sort¼á o≥ i⌠ ma∙ bσá useΣ ì
  2416. afte≥ thσ record≤ havσ alread∙ beeε loaded«á  Iε thσ latte≥ case¼ ì
  2417. thσá use≥ shoulΣ savσ thσ star⌠ addres≤ oµ thσ firs⌠á recorΣá anΣ ì
  2418. cal∞á SSBINI╘á witΦ thσ addres≤ oµ thσ firs⌠ bytσ afte≥ thσá las⌠ ì
  2419. record«á  Oncσá SSBINI╘á ha≤ loadeΣ thσ buffer≤ iεá thσá SS┬á anΣ ì
  2420. checkeΣá fo≥á ßá TP┴á overflo≈ (notσ tha⌠ thi≤ i≤á donσá fo≥á thσ ì
  2421. pointer≤ only)¼á i⌠ wil∞ returε t∩ thσ caller¼á a⌠ whicΦ timσ thσ ì
  2422. calle≥á shoulΣá restorσ thσ firs⌠ tw∩ byte≤ oµ thσ SS┬á t∩á thei≥ ì
  2423. proper values, the actual start address of the first record.
  2424.  
  2425.      Inputs:  HL pts to start of scratch area, DE pts to SSB
  2426.  
  2427.      Outputs:  Z Flag is Set (Z) if TPA overflow; NZ if OK
  2428.  
  2429.      Registers Affected:  PSW
  2430.  
  2431.      SYSLIB Routines Called:  MOVEB
  2432.  
  2433.      Specia∞á Erro≥ Conditions║  None
  2434.  
  2435.  
  2436.  
  2437.  
  2438.      Routine Name:  SORT
  2439.      Function║
  2440.           SOR╘ sort≤ thσ se⌠ oµ fixeΣ lengtΦ record≤ accordinτ t∩ ì
  2441. thσá contro∞á informatioε iε thσ Sor⌠ Specificatioεá Blocδá (SSB⌐ ì
  2442. pointed to by DE.
  2443.  
  2444.      Inputs:  DE pts to SSB
  2445.  
  2446.      Outputs:  None (Records are Sorted)
  2447.  
  2448.      Registers Affected:  None
  2449.  
  2450.      SYSLIB Routines Called:  MOVEB, PRINT
  2451.  
  2452.      Specia∞á Erro≥ Conditions║
  2453.           Thσ Erro≥ Messagσ "SOR╘ Pointe≥ Erroró ma∙ bσá printed¼ ì
  2454. bu⌠ i≤ highl∙ unlikely«  Thi≤ indicate≤ ß fla≈ ha≤ developeΣ witΦ ì
  2455. thσ SOR╘ routinσ fo≥ thi≤ particula≥ case¼á anΣ i⌠ coulΣ no⌠ SOR╘ ì
  2456. thσá se⌠á oµ record≤ a≤ desired«á  Thi≤ erro≥ i≤ fata∞á anΣá wil∞ ì
  2457. abort to CP/M.
  2458. .fo 17 - ZCPR2 Feature-Specific Routines                   Page #
  2459.  
  2460. 17.0 ZCPR2 Feature-Specific Routines
  2461.  
  2462.      Thi≤ modulσ contain≤ ß serie≤ oµ routine≤ whicΦ arσ designeΣ ì
  2463. t∩á allo≈ thσ programme≥ t∩ takσ advantagσ oµ ke∙ ZCPR▓á Feature≤ ì
  2464. withou⌠ doinτ ß lo⌠ oµ programminτ fo≥ himself«á  Iεá particular¼ ì
  2465. facilitie≤ sucΦ a≤ thσ followinτ arσ provided:
  2466.  
  2467.   ZINIMC  -  Initializatioε -- Settinτ thσ locatioε oµ the
  2468.                     multiple command line buffer
  2469.   ZINIEXT -  Initialization -- Defining the location of a command
  2470.                     search path
  2471.   ZINICI  -  Initialization -- Setting the current disk/user
  2472.                     character definition
  2473.   ZINIDMA -  Initialization -- Set the DMA address for ZCPR2 disk
  2474.                     Input/Output
  2475.   ZGPINS  -  Initialization -- Setting all ZCPR2 buffers as
  2476.                     required from buffers set up as per the
  2477.                     ZCPR2 Utility Standard General Purpose
  2478.                     Installation Format
  2479.   ZCPR╤   -  Utilit∙ -- Returninτ ß pointe≥ t∩ thσ interna∞ 
  2480.                     buffers of the first ZCPR2 SYSLIB Module
  2481.   ZMCPTR  -  Utility -- Returning a pointer to the first byte
  2482.                     of the next command
  2483.   ZPFIND  -  Utility -- Searching for a file along the command
  2484.                     search path
  2485.   ZFSTAT  -  Utility -- Determining the attributes of a file
  2486.  
  2487.      ┴á notσá oεá statu≤ routines║á  therσ arσ threσá module≤á iε ì
  2488. SYSLI┬á whicΦá contain≤á ZCPR2-specifiπá routines«áá  Onσá modulσ ì
  2489. contain≤ jus⌠ ZGPIN╙ anΣ contain≤ n∩ statu≤ returεá routine¼á bu⌠ ì
  2490. thσ othe≥ tw∩ module≤ contaiε ZCPR╤ anΣ ZCPRQ2¼á resp¼á t∩ returε ì
  2491. pointer≤á t∩á importan⌠á interna∞ buffer≤ a≤á describeΣá iεá thi≤ ì
  2492. manual«á  Thi≤ chapte≥ describe≤ thσ firs⌠ ZCPR▓ module¼á anΣ it≤ ì
  2493. status routine is ZCPRQ.
  2494.  
  2495.  
  2496.      Routine Name:  ZINIMC
  2497.      Function║
  2498.           ZINIM├ define≤ thσ basσ addres≤ oµ thσ multiplσ commanΣ ì
  2499. linσá buffe≥ fo≥ thσ ZCPR▓ system«á  Thσ initializatioε performeΣ ì
  2500. b∙á thi≤á routinσá i≤ useΣ b∙ thσ ZMCPT╥ routinσá t∩á returεá thσ ì
  2501. pointer to the first character of the next command.
  2502.  
  2503.      Inputs:  HL = base address of multiple command line buffer
  2504.      Outputs:  None
  2505.      Registers Affected:  None
  2506.      SYSLIB Routines Called:  None
  2507.      Specia∞á Erro≥ Conditions║  None
  2508.  
  2509.      Note║á  Iµá thi≤ routinσ i≤ no⌠ called¼á i⌠ i≤ assumeΣá tha⌠ ì
  2510. multiple command lines are not supported.
  2511.  
  2512.  
  2513.  
  2514.      Routine Name:  ZINIEXT
  2515.      Function║
  2516.           ZINIEX╘á define≤ thσ basσ addres≤ oµ ßá commanΣá searcΦ ì
  2517. path«á  Thσá ZPFIN─á routinσ use≤ thi≤ basσ addres≤ t∩ star⌠á it≤ ì
  2518. searcΦ fo≥ ß file«á  Notσ tha⌠ thi≤ provide≤ addeΣ flexibilit∙ iε ì
  2519. tha⌠á thi≤ neeΣ no⌠ necessaril∙ bσ thσ basσ addres≤ oµ thσá ZCPR▓ ì
  2520. Systeφ commanΣ searcΦ path¼ bu⌠ i⌠ ma∙ bσ thσ basσ addres≤ oµ an∙ ì
  2521. path (such as a separate path to look for HLP files).
  2522.  
  2523.      Inputs:  HL = base address of path
  2524.  
  2525.      Outputs:  None
  2526.  
  2527.      Registers Affected:  None
  2528.  
  2529.      SYSLIB Routines Called:  None
  2530.  
  2531.      Specia∞á Erro≥ Conditions║  None
  2532.  
  2533.      Note║á  Iµá thi≤á routinσ i≤ no⌠ called¼á thσ externa∞á patΦ ì
  2534. default≤ t∩ aε empt∙ path¼á s∩ n∩ harφ i≤ donσ anΣ n∩ searcΦá caε ì
  2535. bσ performed.
  2536.  
  2537.  
  2538.      Routine Name:  ZINICI
  2539.      Function║
  2540.           ZINIC╔á define≤á thσá characte≥ useΣá t∩á indicatσá thσ ì
  2541. curren⌠á use≥á o≥ disδ iε thσ ZCPR▓ commanΣá searcΦá path«á  Thi≤ ì
  2542. characte≥á i≤ passeΣ iε A«á  Iµ thi≤ routinσ i≤ no⌠á called¼á thσ ì
  2543. ZCPR2 default of '$' is assumed.
  2544.      Inputs:  A = Current Indicator
  2545.      Outputs:  None
  2546.      Registers Affected:  None
  2547.      SYSLIB Routines Called:  None
  2548.      Specia∞á Erro≥ Conditions║  None
  2549.      Note║á  Iµá thi≤á routinσ i≤ no⌠ called¼á Curren⌠á Indicato≥ ì
  2550. defaults to '$'.
  2551.  
  2552.  
  2553.      Routine Name:  ZINIDMA
  2554.      Function║
  2555.           ZINIDM┴ define≤ thσ DM┴ addres≤ useΣ fo≥ al∞ disδ Inpu⌠ ì
  2556. anΣá Output«á  Thi≤ addres≤ i≤ passeΣ iε HL«á  Iµ thi≤ routinσ i≤ ì
  2557. no⌠ called¼ thσ ZCPR▓ defaul⌠ oµ 80╚ i≤ assumed.
  2558.      Inputs:  HL = DMA Address
  2559.      Outputs:  None
  2560.      Registers Affected:  None
  2561.      SYSLIB Routines Called:  None
  2562.      Specia∞á Erro≥ Conditions║  None
  2563.      Note║á  Iµ thi≤ routinσ i≤ no⌠ called¼á DM┴ Addres≤ default≤ ì
  2564. t∩ 80H.
  2565.  
  2566.  
  2567.      Routine Name:  ZGPINS
  2568.      Function║
  2569.           ZGPIN╙á initialize≤ thσ ZCPR2-Specifiπ Buffer≤ froφ thσ ì
  2570. ZCPR▓á Utilit∙ StandarΣ General-Purposσ Installatioε Forma⌠á Bufì
  2571. fers«á  Thi≤ i≤ t∩ bσ useΣ b∙ ZCPR▓ Utilities¼á sucΦ a≤ XDIR3¼ t∩ ì
  2572. completel∙ initializσ al∞ thσ necessar∙ buffers.
  2573.      Thσ buffer≤ iε thσ utilitie≤ arσ locateΣ a≤ indicateΣ iε thσ ì
  2574. ZCPR▓ Utilitie≤ Manual.
  2575.  
  2576.      Inputs:  None
  2577.  
  2578.      Outputs:  None
  2579.  
  2580.      Registers Affected:  None
  2581.  
  2582.      SYSLIB Routines Called:  MOVEB, ZINIMC, ZINIEXT, ZCPRSET,
  2583.                               ZFNINIT
  2584.  
  2585.      Specia∞á Erro≥ Conditions║  None
  2586.  
  2587.  
  2588.  
  2589.  
  2590.  
  2591.      Routine Name:  ZCPRQ
  2592.      Function║
  2593.           ZCPR╤á querie≤á thσ statu≤ oµ thσ SZCP╥á module¼á whicΦ ì
  2594. contain≤ thesσ routines«  Oε exit¼ thi≤ routinσ return≤ ß pointe≥ ì
  2595. t∩á thσá interna∞ buffer≤ oµ thσ firs⌠ ZCPR▓á modulσá iεá SYSLIB«  ì
  2596. These buffers are structured as follows:
  2597.         Byte 0:  Multiple command available flag (0=no)
  2598.         Bytes 1-2:  Address of multiple command line
  2599.                 buffer, if available
  2600.         Bytes 3-4:  Address of external path (empty
  2601.                 path if path not set)
  2602.         Byte 5:  Current User/Disk Indicator
  2603.         Bytes 6-7:  DMA Address
  2604.  
  2605.      Inputs:  None
  2606.      Outputs:  HL = Base Address of Buffers
  2607.      Registers Affected:  HL
  2608.      SYSLIB Routines Called:  None
  2609.      Specia∞á Erro≥ Conditions║  None
  2610.  
  2611.  
  2612.      Routine Name:  ZMCPTR
  2613.      Function║
  2614.           ZMCPT╥á return≤ ß pointe≥ t∩ thσ nex⌠ characte≥ iεá thσ ì
  2615. multiplσ commanΣ linσ iµ multiplσ command≤ arσ enabled«á  ┴á flaτ ì
  2616. is returned which says if multiple commands are enabled or not.
  2617.  
  2618.      Inputs:  None
  2619.  
  2620.      Outputs:  HL pts to next char in line
  2621.                A=0 and Zero Flag Set (Z) if multiple commands
  2622.                     are not available; NZ otherwise
  2623.  
  2624.      Registers Affected:  HL, PSW
  2625.  
  2626.      SYSLIB Routines Called:  None
  2627.  
  2628.      Specia∞á Erro≥ Conditions║  None
  2629.  
  2630.  
  2631.  
  2632.  
  2633.      Routine Name:  ZPFIND
  2634.      Function║
  2635.           ZPFIN─á searche≤á fo≥ ß filσ alonτ thσá commanΣá searcΦ ì
  2636. patΦá whosσá basσ addres≤ wa≤ defineΣ wheε thσ programme≥á calleΣ ì
  2637. ZINIEXT«á  I⌠á log≤ int∩ eacΦ disδ anΣ use≥ areß alonτ thσá path¼ ì
  2638. lookinτ fo≥ thσ filσ whosσ FC┬ i≤ pteΣ t∩ b∙ DE¼á unti∞ i⌠ eithe≥ ì
  2639. find≤á thσ filσ o≥ reache≤ thσ enΣ oµ thσ patΦ (filσ no⌠á found)«  ì
  2640. Iµ thσ filσ i≤ found¼á i⌠ return≤ thσ disδ anΣ use≥ areß iε whicΦ ì
  2641. thσ filσ resides«á  ZPFIN─ alway≤ return≤ thσ proces≤ t∩ thσ disδ ì
  2642. and user area it is "currently" logged into.
  2643.  
  2644.      Inputs:  DE pts to the FCB of the file to find
  2645.               B is a flag; if B <> 0, search the current disk and
  2646.                     user area first; if B=0, do not search the
  2647.                     current disk and user area first
  2648.  
  2649.      Outputs:  Zero Flag Clear (NZ) and A=0FFH if file found
  2650.                B = Disk (B=0 if Disk A), C=User if file found
  2651.                Zero Flag Set (Z) and A=0 if file not found
  2652.  
  2653.      Registers Affected:  BC, PSW
  2654.  
  2655.      SYSLIB Routines Called:  BDOS
  2656.  
  2657.      Specia∞á Erro≥ Conditions║  None
  2658.  
  2659.  
  2660.      Routine Name:  ZFSTAT
  2661.      Function║
  2662.           ZFSTA╘á determine≤á thσ attribute≤ oµ thσ filσá iεá thσ ì
  2663. curren⌠ disδ anΣ use≥ areß whosσ FC┬ i≤ pteΣ t∩ b∙ DE«á  I⌠ tell≤ ì
  2664. the programmer if the file is SYSTEM or not and READ/ONLY or not.
  2665.  
  2666.      Inputs:  DE pts to FCB of file
  2667.  
  2668.      Outputs:  B=0 means file is NOT System, B<>0 means file is
  2669.                C=0 means file is NOT R/O, C<>0 means file is
  2670.                Zer∩ Flaτ Se⌠ (Z⌐ anΣ A=░ iµ filσ founΣ anΣ BC
  2671.                     valid, and Zero Flag Clear (NZ) if file not
  2672.                     found
  2673.  
  2674.      Registers Affected:  BC, PSW
  2675.  
  2676.      SYSLIB Routines Called:  BDOS
  2677.  
  2678.      Specia∞á Erro≥ Conditions║  None
  2679.  
  2680.      Note:  ZFSTAT does NOT do a search.
  2681.  
  2682.  
  2683. .fo 18 - ZCPR2-Specific Named Directory Routines           Page #
  2684.  
  2685. 18.0 ZCPR2-Specific Named Directory Routines
  2686.  
  2687.      Thi≤ se⌠ oµ routine≤ i≤ specifiπ t∩ thσ ZCPR2-Specifiπ NameΣ ì
  2688. Director∙ Structure«á  Thesσ routine≤ providσ thσ programme≥ witΦ ì
  2689. ßá se⌠á oµ routine≤ whicΦ resolvσ thσ nameΣ director∙á reference≤ ì
  2690. fo≥ him¼ translatinτ ß nameΣ director∙ int∩ thσ disk/use≥ areß i⌠ ì
  2691. refers to.
  2692.  
  2693.      Five routines are included in this set:
  2694.           o ZCPRQ2 -- Return Status
  2695.           o ZFNINIT -- Initialize Named Directory Buffers
  2696.           o ZDNFIND -- Scan for Disk Directory Name
  2697.           o ZDNAME -- Load All Disk Directory Name Data
  2698.           o ZFNAME -- Named Directory File Name Scanner
  2699.  
  2700.  
  2701.      Routine Name:  ZCPRQ2
  2702.      Function:
  2703.           ZCPRQ▓á i≤á thσ companioε t∩ ZCPRQ¼á anΣ i⌠á return≤á ß ì
  2704. pointe≥á t∩ thσ interna∞ buffer≤ oµ thσ seconΣ ZCPR▓ modulσ whicΦ ì
  2705. contains such buffers.  The organization of these buffers is:
  2706.  
  2707.                Byte 0:  Max Number of Named Directory Entries
  2708.                Bytes 1-2:  Address of memory-resident named
  2709.                               directory buffer (or 0 if none)
  2710.                Bytes 3-38:  FCB of NAMES.DIR
  2711.  
  2712.      Inputs:  None
  2713.      Outputs:  HL points to first byte of buffer
  2714.      Registers Affected:  HL
  2715.      SYSLIB Routines Called:  None
  2716.      Special Error Conditions:  None
  2717.  
  2718.  
  2719.      Routine Name:  ZFNINIT
  2720.      Function║
  2721.           ZFNINI╘á allow≤ thσ use≥ t∩ specif∙ thσ addres≤ oµá thσ ì
  2722. memory-residen⌠á nameΣ director∙ buffer¼á initializσ thσ namσá oµ ì
  2723. thσá nameΣá director∙ filσ (defaul⌠ namσ oµá NAMES.DIR⌐á t∩á somσ ì
  2724. othe≥á name¼á anΣá t∩ changσ thσ numbe≥ oµ name≤ permitteΣá iεá ß ì
  2725. director∙ filσ (defaul⌠ oµ 64).
  2726.  
  2727.      Inputs:  DE pts to FCB containing the new file name
  2728.               HL contains address of memory-resident buffer
  2729.               C is the new maximum number of directory names
  2730.               A is a flag indicating values to set as follows:
  2731.                     Bit 7 -- Set to 1 to load default FCB fm DE
  2732.                     Bit 6 -- Set to 1 to load name count fm C
  2733.                     Bit 5 -- Set to 1 to load address fm HL
  2734.      Outputs:  None
  2735.      Registers Affected:  None
  2736.      SYSLIB Routines Called:  MOVEB
  2737.      Specia∞á Erro≥ Conditions║  None
  2738.  
  2739.      Routine Name:  ZDNAME
  2740.      Function:
  2741.           ZDNAM┼á load≤ thσ content≤ oµ thσ NAMES.DI╥á filσá int∩ ì
  2742. thσ memor∙ buffe≥ pointeΣ t∩ b∙ HL«  EacΦ entr∙ iε thi≤ buffe≥ i≤ ì
  2743. structured as follows:
  2744.                Byte 0:  Disk Number (A=0)
  2745.                Byte 1:  User Number
  2746.                Bytes 2-9:  Directory Name, 8 Chars Max, Space
  2747.                     Fill at End
  2748.  
  2749.      Inputs:  HL pts to the memory buffer extending to the base
  2750.                of the BDOS
  2751.  
  2752.      Outputs:  HL pts to the first entry in the buffer
  2753.                C is the number of valid entries, B=0
  2754.                A is the error flag (A=0 and Z if error)
  2755.  
  2756.      Registers Affected:  HL, BC, PSW
  2757.  
  2758.      SYSLIB Routines Called:  INITFCB, ZPFIND, FI3$OPEN, F3$GET
  2759.  
  2760.      Special Error Conditions:  None
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.      Routine Name:  ZDNFIND
  2767.      Function║
  2768.           ZDNFIN─ examine≤ thσ DIR║á prefi° fo≥ eithe≥ ß DU║ forφ ì
  2769. o≥ ß director∙ name«  Iµ i⌠ i≤ determineΣ tha⌠ thσ DIR║ prefi° i≤ ì
  2770. no⌠ oµ thσ DU║ form¼ theε thσ memory-residen⌠ director∙ buffe≥ i≤ ì
  2771. scanned¼á iµ present¼á and¼á failinτ that¼á thσ NAMES.DI╥ filσ i≤ ì
  2772. sough⌠á alonτ thσ ZCPR▓ path¼á loaded¼á anΣ scanneΣ fo≥ ß corresì
  2773. pondinτ name«á  Iµ found¼á thσ correspondinτ use≥ anΣ disδ value≤ ì
  2774. arσ returned╗ iµ no⌠ found¼ aε erro≥ codσ i≤ returned.
  2775.  
  2776.      Inputs:  HL pts to first byte of DIR: prefix
  2777.               A=░ iµ DU║ forφ NO╘ allowed
  2778.  
  2779.      Outputs:  B=Disk (B=1 if Disk A, B=0FFH if Current Disk),
  2780.                C=User (C=0FFH if Current User), HL pts to colon,
  2781.                Zer∩ Flaτ Clea≥ (NZ⌐ iµ n∩ error╗ Zer∩ Flaτ Se⌠ 
  2782.                (Z) if error, and no valid values returned
  2783.  
  2784.      Registers Affected:  BC, HL, PSW
  2785.      SYSLIB Routines Called:  INITFCB, ZPFIND, FI3$OPEN,
  2786.                               FI3$CLOSE, F3$GET
  2787.  
  2788.      Specia∞ Erro≥ Conditions║  Notσ tha⌠ ZDNFIN─ use≤ Inpu⌠ Filσ ì
  2789. 3¼á s∩á Inpu⌠á Filσ │ shoulΣ no⌠ bσ openeΣ wheε thi≤á routinσá i≤ ì
  2790. called«á  Also¼á ZPFIN─ i≤ used¼ s∩ thσ programme≥ mus⌠ bσ surσ ß ì
  2791. proper external path is specified if needed by calling ZINIEXT.
  2792.  
  2793.      Routine Name:  ZFNAME
  2794.      Function║
  2795.           ZFNAM┼á i≤ ß filσ namσ scanner«á  Pointinτ t∩ thσ firs⌠ ì
  2796. characte≥áá oµáá ßáá filσá namσáá specificatioεáá oµáá thσáá forφ ì
  2797. 'DIR:FILENAME.TYP'¼á wherσá an∙á par⌠á oµ thi≤á specificatioεá i≤ ì
  2798. optional¼á thi≤á routinσ fill≤ iε aε FC┬á witΦá zeroes¼á properl∙ ì
  2799. initialize≤á thσá F╬ anΣ F╘ (Filσ Namσ anΣ Filσ Type⌐á field≤á iµ ì
  2800. 'FILENAME.TYPºá o≥ an∙ par⌠ thereoµ i≤ present¼á anΣ return≤á thσ ì
  2801. valuσ oµ disδ anΣ use≥ iµ the∙ arσ specifieΣ (o≥ 0FF╚ iµ not).
  2802.      Thσ director∙ indicato≥ 'DIR:'¼á iµ specified¼ ma∙ bσ oµ onσ ì
  2803. of four forms:
  2804.           DIRECT: -- A named directory, of up to 8 chars long
  2805.           d:      -- A disk drive letter
  2806.           u:      -- A user number
  2807.           du:     -- A disk drive letter and a user number
  2808.      Thσ du║á forφ i≤ checkeΣ first¼ s∩ unnecessar∙ disδ activit∙ ì
  2809. in looking for the NAMES.DIR file is avoided.
  2810.      Examples of valid input strings:
  2811.           HELP:*.HLP     A5:TEST.TXT    C?:ABC.*  PASCAL:*.COM
  2812.  
  2813.      Inputs:  DE pts to FCB to fill, HL pts to first byte of
  2814.                targe⌠ string; FCB is 36 bytes long
  2815.  
  2816.      Outputs:  B=Disk (B=1 for Disk A), C=User
  2817.                B=0FFH if no disk specified (current disk)
  2818.                C=0FFH if no user specified (current user)
  2819.                C=? if all user areas specified
  2820.                HL pts to terminating character
  2821.                A=0 and Zero Flag Set (Z) if error in disk
  2822.                     or user numbers; A=0FFH and NZ if no error
  2823.  
  2824.      Registers Affected:  BC, HL, PSW
  2825.  
  2826.      SYSLIB Routines Called:  ZDNFIND
  2827.  
  2828.      Specia∞áá Erro≥áá Conditions║áá  Seσáá FNAM┼áá routinσáá fo≥ ì
  2829. similarities
  2830.  
  2831.  
  2832. .fo 19 - Miscellaneous Routines                            Page #
  2833.  
  2834. 19.0 Miscellaneou≤ Routine≤ 
  2835.  
  2836.      Thi≤ sectioε describe≤ thσ followinτ Miscellaneou≤ Routines:
  2837.  
  2838.  
  2839.           BDOS      For Direct BDOS Interface
  2840.           BIOS      For Direct BIOS Interface
  2841.           CAPS      For Character Capitalization
  2842.           CAPSTR    For String Capitalization
  2843.           CATH      Convert ASCII Character to Hexadecimal
  2844.           CLINE     Save Command Line Buffer
  2845.           CODEND    Provide End of Code/Data Area
  2846.           EN        Exchange Nybbles in A
  2847.           FILLB     Fill Memory (up to 255 bytes)
  2848.            FILLBC   Fill Memory (up to 65,535 bytes)
  2849.            HFILB    Fill Memory (up to 255 bytes)
  2850.            HFILBC   Fill Memory (up to 65,535 bytes)
  2851.           MOVEB     Move Memory (up to 255 bytes)
  2852.            MOVEBC   Move Memory (up to 65,535 bytes)
  2853.            HMOVB    Move Memory (up to 255 bytes)
  2854.            HMOVBC   Move Memory (up to 65,535 bytes)
  2855.           PAUSE     Delay N 10ths of a Second
  2856.           VERSION   Return Version Number of SYSLIB
  2857.  
  2858.  
  2859.      Routine Name:  BDOS
  2860.      Function║
  2861.           Cal∞á CP/═á Entr∙á Poin⌠á a⌠ locatioεá ╡á anΣá preservσ ì
  2862. Register≤ DE anΣ BC.
  2863.  
  2864.      Inputs:  C and DE provide input parameters
  2865.  
  2866.      Outputs:  A and HL provide output parameters
  2867.  
  2868.      Registers Affected:  PSW, HL
  2869.  
  2870.      SYSLIB Routines Called:  -None-
  2871.  
  2872.      Special Error Conditions:  -Determined by Routines Called-
  2873.  
  2874.  
  2875.  
  2876.      Routine Name:  BIOS
  2877.      Function║
  2878.           BIO╙ provide≤ thσ use≥ witΦ ß direc⌠ interfacσ int∩ thσ ì
  2879. CP/═á BIOS«á  I⌠á i≤ calleΣ witΦ thσ ┴ Reτ containinτá thσá inde° ì
  2880. offse⌠á int∩ thσ BIO╙ JM╨ table«á  N∩ register≤ arσ preserveΣá b∙ ì
  2881. thi≤ routine«á  Thσ content≤ oµ HL¼á DE¼ anΣ B├ arσ passeΣ t∩ thσ ì
  2882. BIOS unchanged.
  2883.  
  2884.      The following table summarizes the BIOS JMP Table Entries --
  2885.  
  2886.    Offset Function
  2887.       0   Cold Start
  2888.       1   Warm Start
  2889.       2   Console Status; Returns A=0FFH if char ready, A=0 if
  2890.                not
  2891.       3   Console Input; Returns char in A
  2892.       4   Console Output; Char passed in C
  2893.       5   List Output; Char passed in C
  2894.       6   Punch Output; Char passed in C
  2895.       7   Reader Input; Returns char in A
  2896.  
  2897.       8   Home Disk Head (Return Version Number); Returns
  2898.                Version Number in HL
  2899.       9   Select Disk; Disk Number (A=0, etc) passed in C
  2900.      10   Set Track Number; Track Number passed in C
  2901.      11   Set Sector Number; Sector Number passed in C
  2902.      12   Set DMA Address; DMA Address passed in BC
  2903.      13   Read Block from Disk; Returns A=0 if OK, A=1 if Error
  2904.      14   Write Block to Disk; Returns A=0 if OK, A=1 if Error
  2905.  
  2906.      15   List Status; Returns A=0FFH if ready to output, A=0
  2907.                if not
  2908.      16   Sector Translation; Logical-to-Physical Sector
  2909.                Translation; Logical Sector Number passed in BC
  2910.                and Translate Table Address passed in DE; Returns
  2911.                Physical Sector Number in HL
  2912.  
  2913. è
  2914.      Inputs:  A = Offset (as per Table Above)
  2915.               BC = Input Parameters
  2916.  
  2917.      Outputs:  A, HL = Output Parameters
  2918.  
  2919.      Registers Affected:  All
  2920.  
  2921.      SYSLIB Routines Called:  -None-
  2922.  
  2923.      Special Error Conditions:  -None-
  2924.  
  2925.  
  2926.  
  2927.      Routine Name:  CAPS
  2928.      Function║
  2929.           Capitalizσá ASCI╔á characte≥á iε Registe≥ ┴á iµá i⌠á i≤ ì
  2930. lower-casσá alphabetiπá (a-z)╗á otherwise¼á returε ┴á unaffected«  ì
  2931. Onl∙á thσ lowe≥ seveε bit≤ oµ thσ bytσ arσá considered¼á anΣá thσ ì
  2932. Mos⌠ Significan⌠ Bi⌠ i≤ maskeΣ ou⌠ t∩ zero.
  2933.  
  2934.      Inputs:  A = character to capitalize
  2935.  
  2936.      Outputs:  A = capitalized character
  2937.  
  2938.      Registers Affected:  PSW
  2939.  
  2940.      SYSLIB Routins Called:  -None-
  2941.  
  2942.      Special Error Conditions:  -None-
  2943.  
  2944.  
  2945.  
  2946.      Routine Name:  CAPSTR
  2947.      Function:
  2948.           CAPST╥ capitalize≤ thσ <NULL>-terminateΣ strinτ pointeΣ ì
  2949. to by HL.  No Registers are affected.
  2950.  
  2951.      Inputs:  HL pts to first byte of string
  2952.  
  2953.      Outputs:  None (String is Capitalized)
  2954.  
  2955.      Registers Affected:  None
  2956.  
  2957.      SYSLIB Routines Called:  CAPS
  2958.  
  2959.      Special Error Conditions:  None
  2960.  
  2961.  
  2962.  
  2963.      Routine Name:  CATH
  2964.      Function║
  2965.           Conver⌠á thσá ASCI╔á Hexadecima∞á characte≥á iεá thσá ┴ ì
  2966. Registe≥ t∩ binar∙ iε thσ ┴ Register«á  Iµ invaliΣ characte≥ (no⌠ ì
  2967. 0-9¼ A-F)¼ returε <SP╛ (2░ Hex⌐ iε ┴ Registe≥ a≤ erro≥ code.
  2968.  
  2969.      Input:  A = ASCII Hex Character (0-9, A-F)
  2970.  
  2971.      Output:  A = Binary value represented by char
  2972.  
  2973.      Registers Affected:  PSW
  2974.  
  2975.      SYSLIB Routines Called:  -None-
  2976.      Specia∞ Erro≥ Conditions:
  2977.           Iµá invaliΣá he°á char¼á <SP╛ (2░ Hex⌐á returneΣá iεá ┴ ì
  2978. Register.
  2979.  
  2980.  
  2981.  
  2982.      Routine Name:  CLINE
  2983.      Function:
  2984.           T∩á savσ thσ commanΣ linσ buffe≥ pteΣ t∩ b∙ H╠ awa∙á iε ì
  2985. aε interna∞ buffe≥ a≤ ß string«á  Thσ characte≥ coun⌠ i≤á pointeΣ ì
  2986. t∩ b∙ H╠ (likσ thσ buffe≥ a⌠ 80╚ se⌠ b∙ ZCPR▓ anΣ CP/═ 2.2)¼á anΣ ì
  2987. thσá buffe≥ content≤ (no⌠ includinτ thσ characte≥ count⌐ i≤ saveΣ ì
  2988. awa∙ a≤ ß null-terminateΣ string«á  Thi≤ routinσ return≤ witΦá H╠ ì
  2989. pointing to the first character of this string.
  2990.  
  2991.      Inputs:  HL points to command line
  2992.  
  2993.      Outputs:  HL points to first character of string
  2994.  
  2995.      Registers Affected:  HL
  2996.  
  2997.      SYSLIB Routines Called:  -None-
  2998.      Special Error Conditions:  -None-
  2999.  
  3000.  
  3001.  
  3002.      Routine Name:  CODEND
  3003.      Function║
  3004.           Returεá thσ addres≤ oµ thσ nex⌠ pagσ followinτ thσ las⌠ ì
  3005. bytσá oµ code«á  Thi≤ i≤ usefu∞ iε determininτ wherσ thσá scratcΦ ì
  3006. areß begins.
  3007.  
  3008.      Inputs:  None
  3009.  
  3010.      Output:  HL=Address of next page
  3011.  
  3012.      Registers Affected:  HL
  3013.  
  3014.      SYSLIB Routines Called:  -None-
  3015.      Special Error Conditions:  -None-
  3016.  
  3017.      Routine Name:  EN
  3018.      Function║
  3019.           Exchangσá Nybble≤ iε Registe≥ A╗á High-orde≥ fou≥á bit≤ ì
  3020. arσ exchangeΣ witΦ Low-orde≥ fou≥ bit≤ oµ Registe≥ A.
  3021.  
  3022.      Inputs:  A = Byte input
  3023.  
  3024.      Outputs:  A = Byte output
  3025.  
  3026.      Registers Affected:  PSW
  3027.  
  3028.      SYSLIB Routines Called:  -None-
  3029.  
  3030.      Special Error Conditions:  -None-
  3031.  
  3032.  
  3033.  
  3034.      Routine Names:  FILLB, FILLBC, HFILB, HFILBC
  3035.      Function║
  3036.           Thesσá routine≤ fil∞ aε areß oµ memor∙ witΦ ßá constan⌠ ì
  3037. bytσ value«á  FILL┬ caε fil∞ u≡ t∩ ß 256-bytσ buffer¼á anΣ FILLB├ ì
  3038. caε fil∞ u≡ t∩ ß 65,536-bytσ (withiε reason⌐ buffer.
  3039.      FILL┬á anΣ FILLB├ havσ n∩ effect≤ oε an∙á registers«á  HFIL┬ ì
  3040. anΣ HFILB├ botΦ affec⌠ thσ H╠ registe≥ pair¼ anΣ the∙ returε witΦ ì
  3041. H╠á pointinτ t∩ thσ bytσ afte≥ thσ las⌠ bytσ filled«á  HFIL┬á anΣ ì
  3042. HFILB├á arσá usefu∞ wheε furthe≥ processinτ froφ thσá las⌠á poin⌠ ì
  3043. filled is desired.
  3044.  
  3045.      Inputs:  HL points to the first byte of the buffer
  3046.               B (for FILLB) or BC (for FILLBC) = number of bytes
  3047.                in buffer
  3048.               A = byte value to fill buffer with
  3049.  
  3050.      Outputs:  None for FILLB and FILLBC (Buffer is filled)
  3051.                H╠ point≤ t∩ nex⌠ bytσ fo≥ HFIL┬ anΣ HFILBC
  3052.  
  3053.      Registers Affected:  None for FILLB, FILLBC; HL for HFILB,
  3054.                               HFILBC
  3055.  
  3056.      SYSLIB Routines Called:  -None-
  3057.  
  3058.      Special Error Conditions:  -None-
  3059.  
  3060.  
  3061.  
  3062.      Routine Names:  MOVEB, MOVEBC, HMOVB, HMOVBC
  3063.      Function║
  3064.           Movσ thσ blocδ oµ memor∙ pointeΣ t∩ b∙ H╠ t∩ thσ memor∙ ì
  3065. locatioεá pointeΣá t∩ b∙ DE«á  MOVE┬ caε movσ u≡á t∩á ßá 256-bytσ ì
  3066. buffer¼ anΣ MOVEB├ caε movσ u≡ t∩ ß 65,536-bytσ buffer.
  3067.  
  3068.      MOVE┬á anΣ MOVEB├ havσ n∩ effect≤ oε an∙á registers«á  HMOV┬ ì
  3069. anΣ HMOVB├ botΦ affec⌠ thσ H╠ registe≥ pair¼ anΣ the∙ returε witΦ ì
  3070. H╠ anΣ D┼ pointinτ t∩ thσ bytσ afte≥ thσ las⌠ bytσ moved«á  HMOV┬ ì
  3071. anΣ HMOVB├ arσ usefu∞ wheε furthe≥ processinτ froφ thσ las⌠ poin⌠ ì
  3072. filleΣ i≤ desired.
  3073.  
  3074.  
  3075.      Inputs:  HL points to the 1st byte of the buffer to move
  3076.               DE points to the 1st byte of the buffer to move to
  3077.               B (for MOVEB) or BC (for MOVEBC) = number of bytes
  3078.                in buffer
  3079.  
  3080.      Outputs:  None for MOVEB and MOVEBC (Buffer is moved)
  3081.                HL and DE pt to byte after last byte moved for
  3082.                     HMOVB and HMOVBC
  3083.  
  3084.      Registers Affected:  None for MOVEB, MOVBC; HL, DE for
  3085.                               HMOVB, HMOVBC
  3086.  
  3087.      SYSLIB Routines Called:  -None-
  3088.  
  3089.      Special Error Conditions:  -None-
  3090.  
  3091.  
  3092.  
  3093.  
  3094.      Routine Name:  PAUSE
  3095.      Function:
  3096.           Delay N 10ths of a Second.
  3097.      Inputs:  HL = N (Number of 10ths of a Second Delay desired)
  3098.               B = Processor Speed in MHz (1, 2, 3, 4, ...)
  3099.      Outputs:  None (Routine returns N 10ths of a Second later)
  3100.      Registers Affected:  None
  3101.      SYSLIB Routines Called:  None
  3102.      Special Error Conditons:  None
  3103.  
  3104.  
  3105.  
  3106.  
  3107.      Routine Name:  VERSION
  3108.      Function:
  3109.           Return Version Number of SYSLIB.
  3110.      Inputs:  None
  3111.      Outputs:  HL = Version Number (H=Major, L=Minor)
  3112.      Registers Affected:  HL
  3113.      SYSLIB Routines Called:  None
  3114.      Special Error Conditons:  None
  3115. .fo 20 - Cross-Reference Listing of SYSLIB Routines        Page #
  3116.  
  3117. 20.0 Cross-Reference Listing of SYSLIB Routines
  3118.  
  3119. Symbol    Defined    Referenced
  3120.  
  3121. ADDHD   SMATH
  3122. ADRCPY  SFILEI  S0FILE  S1FILE  S2FILE  S3FILE  
  3123. ANDHD   SMATH
  3124.  
  3125. BBLINE    SBBLIN
  3126. BDOS    SBODS   SZFNAM  SZCPR   SFOPEN  SFEXIS  SFMAKE
  3127.                 SFCLOS  SRENAM  SFREAD  SFWRIT  SFDEL
  3128.                 SUD
  3129. BIOS    SBIOS   
  3130. BLINE    SBLINE
  3131.  
  3132. CAPS    SCAPS   SZFNAM  SFNAME  SEVAL   SEVAL2  SBBLIN
  3133.                 SBLINE  SCAPST  
  3134. CAPSTR  SCAPST  
  3135. CATH    SCATH   
  3136. CCOUT    SCCOUT    SINLIN    SPSTR
  3137. CIN     SCIN    SCONDI  SINLIN  
  3138. CLINE   SCLINE
  3139. CLOUT    SCLOUT    SLPSTR
  3140. CMPH    SMATH
  3141. CODEND  SCODEN  
  3142. COMPB   SCOMP   
  3143. COMPBC  SCOMP   
  3144. COMPHD  SCOMPH  
  3145. CONDIN  SCONDI  SRAND
  3146. COUT    SCOUT    SINLIN    SPSTR    SPHL5D    SPA2HC    SPADC
  3147.             SCRLF    SCCOUT
  3148. CPOUT   SCPOUT  
  3149. CRC1CL  SCRC1   
  3150. CRC1DO  SCRC1   
  3151. CRC1UP  SCRC1   
  3152. CRC2CL  SCRC2
  3153. CRC2DO  SCRC2
  3154. CRC2UP  SCRC2
  3155. CRCCLR  SCRC    
  3156. CRCDON  SCRC    
  3157. CRCUPD  SCRC    
  3158. CRLF    SCRLF    SINLIN
  3159. CST     SCST    SCONDI  
  3160.  
  3161. DBUFFE  SDIR
  3162. DFREE    SDIR
  3163. DIRALP    SDIR
  3164. DIRF    SDIR
  3165. DIRFS    SDIR
  3166. DIRLOA    SDIR
  3167. DIRNPA    SDIR
  3168. DIRPAC    SDIR
  3169. DIRSEL    SDIR
  3170. DIRSLO    SDIR
  3171. èSymbol    Defined    Referenced
  3172.  
  3173. DIVHD   SMATH
  3174. DPARAM  SDIR    
  3175.  
  3176. EN      SEN     SMA2HC  SLA2HC  SPA2HC  
  3177. EVAL    SEVAL   
  3178. EVAL10  SEVAL1  SEVAL   
  3179. EVAL16  SEVAL2  SEVAL   
  3180. EVAL2   SEVAL4  SEVAL   
  3181. EVAL8   SEVAL3  SEVAL   
  3182.  
  3183. F$CLOS    SFCLOS
  3184. F$DELE    SFDEL    SFMAKE
  3185. F$EXIS  SFEXIS
  3186. F$GET   SFILEI  S0FILE  S1FILE  S2FILE  S3FILE  
  3187. F$MAKE    SFMAKE
  3188. F$MOPE    SFOPEN    SFILEI
  3189. F$OPEN    SFOPEN    SFILEI
  3190. F$PUT   SFILEI  S0FILE  S1FILE  S2FILE  S3FILE  
  3191. F$READ    SFREAD
  3192. F$RENA  SRENAM
  3193. F$WRIT    SFWRIT
  3194.  
  3195. F0$GET  S0FILE  
  3196. F1$GET    S1FILE  
  3197. F2$GET  S2FILE  
  3198. F3$GET  S3FILE  SZFNAM
  3199. F0$PUT  S0FILE  
  3200. F1$PUT  S1FILE  
  3201. F2$PUT  S2FILE  
  3202. F3$PUT  S3FILE  
  3203. FI$CLO  SFILEI  S0FILE  S1FILE  S2FILE  S3FILE  
  3204. FI0$CL  S0FILE  
  3205. FI1$CL  S1FILE  
  3206. FI2$CL  S2FILE
  3207. FI3$CL  S3FILE  SZFNAM
  3208. FI$OPE  SFILEI  S0FILE  S1FILE  S2FILE  S3FILE  
  3209. FI0$OP  S0FILE  
  3210. FI1$OP  S1FILE  
  3211. FI2$OP  S2FILE  
  3212. FI3$OP  S3FILE  SZFNAM
  3213.  
  3214. FILLB    SFILL    SINITF
  3215. FILLBC  SFILL   
  3216. FNAME   SFNAME  
  3217.  
  3218.  
  3219. Symbol    Defined    Referenced
  3220.  
  3221. FO$CLO  SFILEI  S0FILE  S1FILE  S2FILE  S3FILE
  3222. FO$OPE  SFILEI  S0FILE  S1FILE  S2FILE  S3FILE  
  3223. FO0$CL  S0FILE  
  3224. FO1$CL  S1FILE  
  3225. FO2$CL  S2FILE  
  3226. FO3$CL    S3FILE
  3227. FO0$OP  S0FILE  
  3228. FO1$OP  S1FILE  
  3229. FO2$OP  S2FILE  
  3230. FO3$OP    S3FILE
  3231.  
  3232. FSIZE   SDIR    
  3233.  
  3234. GETUD   SUD
  3235.  
  3236. HFILB    SFILL   
  3237. HFILBC  SFILL   
  3238. HMOVB   SMOVE   
  3239. HMOVBC  SMOVE   
  3240.  
  3241. INITFC    SINITF    SFIELI  SZFNAM
  3242. INLINE    SINLIN
  3243. INSTR   SINSTR  
  3244.  
  3245. LA2HC    SLA2HC    SLHL4H
  3246. LA3DC    SLADC
  3247. LADC    SLADC
  3248. LCRLF   SLCRLF  
  3249. LHL4HC    SLHL4H
  3250. LHL5DC    SLHL5D
  3251. LHLDC    SLHL5D
  3252. LOGUD   SUD
  3253. LOUT    SLOUT    SLPSTR    SLHL5D    SLA2HC    SLADC    SLCRLF
  3254.             SCLOUT
  3255. LPRINT    SLPRIN
  3256. LPSTR    SLPSTR    SLPRIN
  3257.  
  3258. MA2HC   SMA2HC  SMHL4H  
  3259. MA3DC   SMADC   
  3260. MADC    SMADC   
  3261. MHL4HC  SMHL4H  
  3262. MHL5DC  SMHL5D  
  3263. MHLDC   SMHL5D  
  3264. MOVEB   SMOVE   SZFNAM  SSORT   SRENAM  SZGPIN
  3265. MOVEBC  SMOVE   
  3266. MULHD   SMATH
  3267.  
  3268. NEGH    SMATH
  3269.  
  3270. ORHD    SMATH
  3271.  
  3272.  
  3273. Symbol    Defined    Referenced
  3274.  
  3275. PA2HC   SPA2HC  SPHL4H  
  3276. PA3DC   SPADC   
  3277. PADC    SPADC   
  3278. PAUSE   SPAUSE  
  3279. PHL4HC  SPHL4H  
  3280. PHL5DC  SPHL5D  
  3281. PHLDC   SPHL5D  
  3282. POUT    SPOUT   SCPOUT  
  3283. PRINT   SPRINT  SDIR    SSORT   SRAND
  3284. PSTR    SPSTR   SPRINT  
  3285. PUTUD   SUD
  3286.  
  3287. RETUD   SUD
  3288. RIN     SRIN    
  3289. ROTLH   SMATH
  3290. ROTRH   SMATH
  3291. RND     SRAND
  3292. RNDINI  SRAND
  3293. RNDSEE  SRAND
  3294.  
  3295. SCANNE  SSCANN  
  3296. SHFTLH  SMATH
  3297. SHFTRH  SMATH
  3298. SORT    SSORT   
  3299. SSBINI  SSORT
  3300. SUBHD   SMATH
  3301.  
  3302. VERSIO  SVERSI
  3303.  
  3304. XORHD   SMATH
  3305.  
  3306. ZCPRQ   SZCPR
  3307. ZCPRQ2  SZFNAM
  3308. ZDNAME  SZFNAM
  3309. ZDNFIN  SZFNAM
  3310. ZFNAME  SZFNAM
  3311. ZFNINI  SZFNAM  SZGPIN
  3312. ZFSTAT  SZCPR
  3313. ZGPINS  SZGPIN
  3314. ZINICI  SZCPR   SZGPIN
  3315. ZINIDM  SZCPR   SZGPIN
  3316. ZINIEX  SZCPR   SZGPIN
  3317. ZINIMC  SZCPR   SZGPIN
  3318. ZMCPTR  SZCPR
  3319. ZPFIND  SZCPR   SZFNAM
  3320.  
  3321. .fo 21 - Sample Programs Using SYSLIB                      Page #
  3322.  
  3323. .FI SYSLIBS.WS
  3324.  
  3325.