home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / simtel / sigm / vols000 / vol089 / syslibi.ws < prev    next >
Text File  |  1985-02-09  |  9KB  |  209 lines

  1.                          What is SYSLIB?
  2.  
  3.      SYSLI┬á (SYSteφ LIBrary⌐ i≤ ß collectioε oµ ove≥ 13░ subrouì
  4. tine≤ whicΦ arσ designeΣ t∩ providσ t∩ thσ CP/═ 8080/Z8░ assembl∙ ì
  5. languagσá programme≥ ß se⌠ oµ function≤ upoε whicΦ hσá caεá builΣ ì
  6. hi≤ programs«  Thi≤ librar∙ i≤ intendeΣ t∩ relievσ thσ programme≥ ì
  7. oµá thσ tasδ oµ frequentl∙ "reinventinτ thσ wheeló anΣ t∩ providσ ì
  8. hiφáá witΦá aεá too∞á environmen⌠á whicΦá encourage≤áá structureΣ ì
  9. programminτ a⌠ thσ assembl∙ languagσ level.
  10.  
  11.      EacΦá subroutinσ withiε SYSLI┬ caε bσ vieweΣ a≤á ßá reliablσ ì
  12. "blacδ box.ó  Thσ subroutine≤ iε SYSLI┬ arσ completel∙ documenteΣ ì
  13. withiεá thi≤ 100½ pagσ manua∞ anΣ thσ SYSLIBx.HL╨ files¼á anΣ thσ ì
  14. programme≥á i≤ consistentl∙ provideΣ witΦ thσ followinτá informaì
  15. tion:
  16.           1.  Name of Subroutine
  17.           2.  Function it performs
  18.           3.  What its inputs are
  19.           4.  What its outputs are
  20.           5.  What registers are affected by it
  21.           6.  What other library routines it calls upon
  22.           7.  What errors can occur and how it handles them
  23.  
  24.      Thσ routine≤ withiε SYSLI┬ arσ designeΣ t∩ worδ togethe≥ anΣ ì
  25. complemen⌠á eacΦ other«á  Paramete≥ passinτ i≤ consisten⌠ betweeε ì
  26. thσ variou≤ subroutines╗ fo≥ instance¼ al∞ routine≤ whicΦ neeΣ t∩ ì
  27. bσá passeΣá ßá pointe≥ t∩ ß Filσ Contro∞ Blocδá arσá passeΣá tha⌠ ì
  28. pointe≥ iε thσ D┼ registe≥ pair«á  Also¼á a≤ ß genera∞ rule¼ iµ ß ì
  29. registe≥ i≤ no⌠ returneΣ a≤ aε outpu⌠ froφ thσ SYSLI┬ subroutine¼ ì
  30. theεá it≤ valuσ i≤ no⌠ affecteΣ (i⌠ ha≤ thσ samσ valuσá wheεá thσ ì
  31. routinσ i≤ exiteΣ a≤ i⌠ haΣ wheε thσ routinσ wa≤ called).
  32.  
  33.      SYSLI┬á itselµá i≤ ß librar∙ oµ relocatablσá objec⌠á module≤ ì
  34. createΣá iεá thσ Microsof⌠ M8░ relocatablσá objec⌠á format«á  Al∞ ì
  35. subroutine≤ withiε SYSLI┬ arσ groupeΣ withiε functionally-relateΣ ì
  36. modules«á  Oncσá ß routinσ i≤ referenceΣ (b∙ thσ EX╘ statemen⌠ iε ì
  37. thσ M8░ assembl∙ languagσ program)¼á it≤ modulσ i≤ loadeΣ anΣá i⌠ ì
  38. i≤á availablσá t∩ thσ programme≥ b∙ mean≤ oµ ß simplσá subroutinσ ì
  39. call«á  Al∞á othe≥ subroutine≤ withiε tha⌠ particula≥ modulσá arσ ì
  40. als∩ loaded¼á bu⌠ the∙ arσ no⌠ availablσ t∩ thσ programme≥ unles≤ ì
  41. hσá ha≤ als∩ referenceΣ theφ b∙ EX╘ statements«á  Thσá modulσá i≤ ì
  42. loadeΣá onl∙á once¼á regardles≤ oµ ho≈ man∙ routine≤á withiεá thσ ì
  43. modulσá arσ referenced«á  Fo≥ thi≤ reason¼á ╔ havσ designeΣá eacΦ ì
  44. modulσá t∩ contaiε routine≤ whicΦ arσ frequentl∙ useΣ togethe≥ o≥ ì
  45. arσá calleΣá b∙ eacΦ othe≥ (onσ routinσ withiε thσá modulσá call≤ ì
  46. another routine within the module).
  47.  
  48.  
  49.                   What is Needed to Use SYSLIB?
  50.  
  51.      Yo⌡á neeΣ aε 8080- o≥ Z80-baseΣ microcompute≥ witΦ a⌠á leas⌠ ì
  52. 48╦á byte≤ oµ contiguou≤ memor∙ runninτ CP/═ 2.2¼á thσá Microsof⌠ ì
  53. M8░á assemble≥ too∞ se⌠ (specifically¼á thσ M8░ assemble≥ anΣ thσ ì
  54. L8░ linker)¼á anΣ thσ usua∞ se⌠ oµ softwarσ developmen⌠ tool≤ (aε ì
  55. edito≥ and¼ preferably¼ ß debugger⌐ t∩ usσ SYSLIB.è
  56.                     What Does SYSLIB Buy Me?
  57.  
  58.      Thσ bottoφ linσ i≤ that¼á t∩ thσ experienceΣ SYSLI┬ programì
  59. mer¼á SYSLI┬ ha≤ thσ potentia∞ oµ beinτ ß significan⌠ too∞á whicΦ ì
  60. enable≤ hiφ to:
  61.  
  62.           1.  Solve his programming task quickly
  63.                -- becausσá hσ spend≤ les≤ timσ writinτá comì
  64. áááámonly-useΣ subroutine≤ anΣ worryinτ abou⌠ ho≈ hi≤ regisì
  65. ááááter≤á arσá affecteΣ b∙ thesσ subroutine≤ anΣá morσá timσ ì
  66. ááááconcentratinτ oε thσ probleφ a⌠ hand
  67.  
  68. áááá      2.  Write space- and speed-efficient code
  69. áááá           -- becausσá al∞ oµ thσ SYSLI┬á routine≤á havσ ì
  70. áááábeeεá gonσ ove≥ timσ agaiε t∩ reducσ thei≥ sizσ anΣ makσ ì
  71. áááátheφ morσ efficien⌠ iε term≤ oµ speed╗á fo≥ example¼ thσ ì
  72. ááááSOR╘á routinσá i≤á ß Shel∞ Sor⌠ tha⌠ caεá bσá calleΣá t∩ ì
  73. ááááperforφá thσ sor⌠ usinτ pointer≤ (iε whicΦ casσá i⌠á exì
  74. ááááchange≤ pointer≤ rathe≥ thaε record≤ wheε i⌠ need≤ t∩ d∩ ì
  75. ááááß swap⌐ o≥ perforφ thσ sor⌠ withou⌠ usinτ pointer≤ (wheε ì
  76. ááááspacσ i≤ ß facto≥ anΣ therσ ma∙ no⌠ bσ enougΦ rooφ fo≥ ß ì
  77. áááápointe≥ table)
  78.  
  79. áááá      3«  Writσ morσ maintainablσ code
  80. áááá           -- becausσ SYSLI┬ i≤ designeΣ witΦ structureΣ ì
  81. ááááprogramminτ philosoph∙ iε mind╗ eacΦ subroutinσ i≤ equiì
  82. áááávalen⌠á t∩ ß proces≤ box¼á havinτ (1⌐ onl∙ onσá entrancσ ì
  83. ááááanΣ onσ exit¼á (2⌐ ß precisely-defineΣ function¼ anΣ (3⌐ ì
  84. ááááß precisely-defineΣ se⌠ oµ inpu⌠ anΣ outpu⌠á parameters╗ ì
  85. ááááhavinτá useΣá SYSLI┬ fo≥ somσ timσ now¼á thσ autho≥á ha≤ ì
  86. áááánoteΣ tha⌠ hi≤ programminτ though⌠ processe≤ anΣ prograφ ì
  87. áááádesign≤á havσ tendeΣ morσ anΣ morσ towarΣá end-inôá (top-ì
  88. áááádowε froφ thσ objectivσ poin⌠ oµ vie≈ anΣ bottom-u≡ froφ ì
  89. ááááthσ SYSLI┬ subroutinσ poin⌠ oµ view)¼ structureΣ design≤ ì
  90. áááátha⌠á hσá caεá g∩ bacδ t∩ a⌠ ß late≥á datσá anΣá readil∙ ì
  91. áááádeciphe≥ anΣ modify
  92.  
  93. áááá      4.  Reduce the programming effort
  94. áááá           -- becausσá SYSLI┬ provide≤ ß numbe≥ oµá ver∙ ì
  95. ááááinvolveΣ routine≤ whicΦ would¼ iε themselves¼ takσ quitσ ì
  96. áááásomσá timσ t∩ code╗á fo≥ example¼á thσ DIR╞ routinσ wil∞ ì
  97. ááááloaΣ thσ director∙ oµ ß disδ int∩ memory¼á selec⌠ ßá se⌠ ì
  98. ááááoµá file≤á froφ tha⌠ loadeΣ director∙ a≤ specifieΣ b∙á ß ì
  99. ááááFilσ Contro∞ Blocδ anΣ ß flaτ whicΦ indicate≤ whethe≥ t∩ ì
  100. ááááincludσ Systeφ o≥ Non-Systeφ file≤ anΣ wha⌠ use≥ areß i≤ ì
  101. áááát∩á bσ examined¼á pack≤ thσ loadeΣá director∙á (removinτ ì
  102. ááááentrie≤ no⌠ selecteΣ froφ thσ memor∙ buffer)¼á alphabetì
  103. ááááize≤á thσ director∙ entrie≤ b∙ filσ namσ anΣ typσ o≥á b∙ ì
  104. ááááfilσá typσ anΣ name¼á anΣ return≤ ß pointe≥ t∩ thσ firs⌠ ì
  105. ááááentr∙ anΣ ß coun⌠ oµ thσ numbe≥ oµ entrie≤ selected
  106.  
  107.  
  108.      Iε man∙ ways¼á SYSLI┬ bring≤ somσ oµ thσ advantage≤ oµá proì
  109. gramminτá iεá ß High-Orde≥ Language¼á likσ ├ o≥á Pascal¼á t∩á thσ ì
  110. assembl∙ languagσ programmer¼á whilσ allowinτ hiφ t∩ maintaiε thσ ì
  111. smalle≥ codσ sizσ anΣ greate≥ efficienc∙ whicΦ caε bσ realizeΣ iε ì
  112. assembl∙á languagσá programminτ anΣ simultaneousl∙ realizσ ßá reì
  113. duceΣá life-cyclσá cos⌠ (froφ developmen⌠ t∩á fieldinτá t∩á post-ì
  114. fieldinτá maintenancσá anΣ modification⌐ ove≥á assembl∙á languagσ ì
  115. programminτ withou⌠ ß SYSLIB-likσ too∞ set.
  116.  
  117.  
  118.  
  119.                  How Do I Assemble with SYSLIB?
  120.  
  121.      EacΦá examplσ iε Sectioε 2▒ oµ thi≤ manua∞ show≤ aε assembl∙ ì
  122. oµ thσ samplσ program«á  ╔ frequentl∙ usσ ß commanΣ file¼ whicΦ ╔ ì
  123. cal∞ M80.SUB¼á t∩ assemblσ m∙ programs«á  Thi≤ commanΣ filσ take≤ ì
  124. onl∙ onσ parameter¼á thσ namσ oµ thσ filσ t∩ bσ assembleΣ WITHOU╘ ì
  125. its type (MAC is assumed).  Warning:  The command MUST be:
  126.  
  127.                         SUB M80 filename
  128.  
  129. and it MUST NOT be:
  130.  
  131.                       SUB M80 filename.typ
  132.  
  133. Iµá i⌠á i≤ oµ thσ latte≥ form¼á thσ sourcσ codσ wil∞á bσá deleteΣ ì
  134. durinτ thσ assembl∙ processí  Yo⌡ ma∙ wisΦ t∩ removσ the
  135.  
  136.                            ER┴ $1.BAK 
  137.  
  138. commanΣ iε thσ M80.SU┬ filσ t∩ eliminatσ thi≤ problem«  ╔ onl∙ d∩ ì
  139. this for a space savings.
  140.  
  141.      My M80.SUB command file is:
  142.  
  143. ;  M80.SUB -- MACRO-80 Assembler and Linker
  144. M80 =$1
  145. SUB /A  PLEASE ABORT IF ERROR(S) EXIST
  146. ERA $1.BAK
  147. ERA $1.COM
  148. L80 /P:100,$1,A:SYSLIB/S,$1/N,/U,/E
  149. ERA $1.REL
  150. ;  ASSEMBLY COMPLETE
  151.  
  152.      ╔ ruε ZCPR▓ insteaΣ oµ thσ CP/═ 2.▓ CCP¼á anΣ ╔ aφ alway≤ oε ì
  153. Drivσá B║á doinτá m∙á developmen⌠á work¼á whilσá m∙á editor≤á anΣ ì
  154. assembler≤ (anΣ SYSLIB.REL⌐ arσ oε Drivσ A:«á  Notσ tha⌠ thi≤á i≤ ì
  155. reflected in M80.SUB, where L80 looks for A:SYSLIB for the scan.
  156.  
  157.  
  158.  
  159.             How Do I Learn to Use SYSLIB Effectively?
  160.  
  161.      Thi≤ is¼ oµ course¼ opinion¼ bu⌠ ╔ fee∞ tha⌠ thσ bes⌠ wa∙ t∩ ì
  162. learn how to use SYSLIB would involve the following steps:
  163.  
  164.           1«á  Stud∙á thσá SYSLI┬ manua∞ iε aε overvie≈á fashion¼ ì
  165. familiarizinτá yourselµá witΦ thσ function≤á oµá thσá subroutine≤ ì
  166. available
  167.  
  168.           2«á  Stud∙ iε somσ detai∞ thσ samplσ sourcσ program≤ iε ì
  169. Sectioε 21¼ jumpinτ bacδ t∩ thσ maiε bod∙ oµ thσ manua∞ froφ timσ ì
  170. t∩á timσ t∩ seσ wh∙ thσ routine≤ ╔ selecteΣ iε thσ program≤á werσ ì
  171. used in the way I used them
  172.  
  173.           3«  Tr∙ codinτ ß couplσ oµ thσ routine≤ iε thi≤ manual¼ ì
  174. copying them verbatim and assembling them
  175.  
  176.           4«  Tr∙ makinτ u≡ ß fe≈ simplσ problem≤ oµ you≥ owε anΣ ì
  177. use SYSLIB to code them
  178.  
  179.           5«á  Appl∙á SYSLI┬ t∩ ß significan⌠ prograφ yo⌡ wan⌠ t∩ ì
  180. write
  181.  
  182.      ╔ aφ ß stronτ advocatσ oµ writinτ program≤ iε orde≥ t∩ learε ì
  183. ho≈ t∩ program¼á anΣ ╔ fee∞ tha⌠ i⌠ i≤ mos⌠ importan⌠ t∩ (1⌐ gaiε ì
  184. a≤á mucΦ familiarit∙ witΦ thσ SYSLI┬ routine≤ a≤ yo⌡ caε anΣá (2⌐ ì
  185. t∩ writσ program≤ usinτ thesσ routines.
  186.  
  187.  
  188.  
  189.                        Who May Use SYSLIB?
  190.  
  191.      SYSLI┬ i≤ hereb∙ releaseΣ t∩ thσ publiπ domain«á  Anyonσ wh∩ ì
  192. wishe≤ t∩ US┼ i⌠ ma∙ d∩ s∩ witΦ n∩ string≤ attached«á  Thσ autho≥ ì
  193. assume≤ n∩ responsibilit∙ o≥ liabilit∙ fo≥ thσ usσ oµ SYSLIB«  I⌠ ì
  194. i≤ copyrighteΣ b∙ thσ author¼á RicharΣ Conn¼á wh∩ ha≤ solσ right≤ ì
  195. t∩á it«á  SYSLI┬ anΣ it≤ associateΣ documentatioε ma∙ bσ solΣá b∙ ì
  196. itselµá o≥á a≤ aε independen⌠ par⌠ oµ ß packagσ oµ program≤á onl∙ ì
  197. witΦá thσ express¼á writteε consen⌠ oµ thσ author«á  Thσá author¼ ì
  198. however¼ support≤ thσ usσ oµ SYSLI┬ b∙ commercia∞ softwarσ develì
  199. opers¼á anΣá place≤ n∩ restrictioε oε thσ salσ oµ program≤á whicΦ ì
  200. arσá BASE─ oε SYSLI┬ anΣ usσ routine≤ containeΣ withiε SYSLI┬á t∩ ì
  201. perforφ thei≥ majo≥ functions.
  202.  
  203.  
  204.  
  205.      ╔á hopσ yo⌡ enjo∙ usinτ SYSLI┬ anΣ finΣ i⌠ t∩ bσ a≤ usefu∞ ß ì
  206. tool as I do.
  207.  
  208.                                         Richard Conn
  209.