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