home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / Z280 / 232APR88.GBG < prev    next >
Text File  |  2000-06-30  |  25KB  |  526 lines

  1.  
  2.  
  3.  
  4. áááá                            VIRTUA╠ SYSTEMS
  5.  
  6. áááá                    Beε Grey¼ Ceda≥ Mil∞ Z-Nodσ 24
  7.  
  8. ááááIε thi≤ month'≤ articlσ wσ arσ goinτ t∩ examinσ thσ dynamic≤ oµ memor∙ ì
  9. áááámanagemen⌠ a≤ i⌠ caε bσ applieΣ t∩ writinτ program≤ fo≥ CP/═ anΣ ZCPR« ì
  10. ááááIε m∙ firs⌠ article¼ wσ briefl∙ toucheΣ oε thσ limitation≤ placeΣ oε ì
  11. ááááprogram≤ becausσ oµ memor∙ sizσ restrictions« Wσ founΣ tha⌠ system≤ ì
  12. ááááwitΦ ß fixeΣ memory¼ let'≤ sa∙ 64K¼ requirσ largσ program≤ t∩ bσ ì
  13. áááásegmented¼ o≥ "overlayedó iµ the∙ arσ t∩ fi⌠ iε thσ availablσ memory« ì
  14. ááááThi≤ ha≤ thσ effec⌠ oµ creatinτ morσ worδ fo≥ thσ programmer« Hσ mus⌠ ì
  15. áááábσ awarσ no⌠ onl∙ oµ thσ program'≤ functionality¼ bu⌠ mus⌠ als∩ bσ ì
  16. ááááconcerneΣ witΦ "fittingó i⌠ int∩ availablσ memory.
  17.  
  18. ááááTraditionally¼ programmer≤ fo≥ singlσ-user¼ noε-multitaskinτ systems¼ ì
  19. ááááhavσ tendeΣ t∩ assumσ tha⌠ al∞ oµ thσ memor∙ froφ thσ enΣ oµ thσ ì
  20. ááááprograφ codσ t∩ thσ Basiπ Disδ Operatinτ Systeφ (BDOS⌐ wa≤ availablσ t∩ ì
  21. ááááusσ a≤ desired« Thi≤ meant¼ iε reality¼ thσ applicatioε program≤ coulΣ ì
  22. áááá"ove≥-writeó thσ Consolσ CommanΣ Processo≥ (CCP⌐ iε orde≥ t∩ gaiε thσ ì
  23. ááááextrß 2╦ i⌠ occupies.
  24.  
  25. ááááToday¼ however¼ wσ arσ concerneΣ witΦ maximizinτ thσ programmer'≤ ì
  26. ááááefficienc∙ t∩ solvσ thσ probleφ a⌠ hand¼ anΣ t∩ minimizσ thσ "overheadó ì
  27. ááááhσ mus⌠ encounte≥ t∩ producσ ß workinτ application« Iε othe≥ words¼ wσ ì
  28. ááááwisΦ t∩ allo≈ hiφ t∩ writσ program≤ tha⌠ wil∞ worδ iε ß minimuφ memor∙ ì
  29. áááásize¼ witΦ ver∙ littlσ regarΣ fo≥ managinτ thσ availablσ memor∙ space.
  30.  
  31. ááááWha⌠ technique≤ arσ available┐ Ho≈ d∩ wσ implemen⌠ them┐ Wh∙ arσ thesσ ì
  32. áááámethod≤ s∩ importan⌠ iε thσ ╕-bi⌠ world┐ Wh∙ can'⌠ wσ g∩ on¼ "will∙-ì
  33. áááánillyó thσ wa∙ wσ havσ donσ fo≥ thσ pas⌠ 1╡ years?
  34.  
  35. ááááThσ answer≤ t∩ thesσ question≤ arσ no⌠ obvious¼ bu⌠ wσ arσ al∞ ì
  36. áááápainfull∙ awarσ oµ thσ implications« LimiteΣ memor∙ spacσ mean≤ ì
  37. áááárestrictinτ thσ applicatioε program≤ t∩ ruε iε thσ availablσ memor∙ ì
  38. ááááspace« A≤ ß result¼ wσ ofteε compromisσ thσ functionalit∙ oµ aε ì
  39. ááááapplicatioε t∩ conservσ space« Yet¼ wσ wan⌠ thσ prograφ t∩ bσ ì
  40. ááááoperationa∞ oε thσ broades⌠ cros≤-sectioε oµ ╕-bi⌠ CP/═ machine≤ witΦ ì
  41. ááááa≤ mucΦ functionalit∙ a≤ i≤ possible.
  42.  
  43. ááááBeforσ wσ caε reall∙ conside≥ "howó t∩ d∩ thesσ things¼ wσ mus⌠ firs⌠ ì
  44. áááálooδ a⌠ thσ wa∙ standarΣ CP/═ system≤ currentl∙ "loaΣ anΣ executeó thσ ì
  45. ááááprogram≤ wσ run« AnΣ iε orde≥ t∩ reall∙ looδ a⌠ thi≤ problem¼ wσ reall∙ ì
  46. ááááneeΣ t∩ kno≈ wha⌠ thσ "memor∙ imageó normall∙ look≤ like.
  47.  
  48. áááá[Therσ arσ severa∞ system≤ tha⌠ d∩ no⌠ adherσ t∩ thσ "generaló rule≤ ╔ ì
  49. ááááwil∞ discuss¼ notabl∙ somσ oµ thσ earl∙ Northsta≥ Systems« However¼ iµ ì
  50. ááááyo⌡ havσ onσ oµ thesσ earl∙ systems¼ yo⌡ alread∙ kno≈ thσ differences.]
  51.  
  52. ááááMemor∙ iε ╕-bi⌠ computer≤ generall∙ begin≤ a⌠ addres≤ 0000╚ (thσ ╚ ì
  53. áááástand≤ fo≥ hexadecima∞ o≥ basσ 16⌐ anΣ goe≤ t∩ addres≤ FFFFH« Iµ thi≤ ì
  54. ááááhexadecima∞ numbe≥ i≤ converteΣ t∩ it'≤ decima∞ equivalent¼ wσ finΣ ì
  55. áááátha⌠ i⌠ i≤ equa∞ t∩ 65,53╡ o≥ 64╦ (1╦ iε computeresσ ╜ 102┤ bytes).è
  56. ááááIε man∙ curren⌠ systems¼ thσ operatinτ systeφ (OS⌐ build≤ froφ thσ to≡ ì
  57. áááá(FFFFH⌐ dowε towarΣ thσ bottoφ (0000H)« Thσ memor∙ i≤ consecutive¼ o≥ ì
  58. áááásequential¼ o≥ contiguous« Tha⌠ is¼ therσ arσ n∩ gap≤ iε i⌠ froφ thσ ì
  59. áááálowes⌠ bytσ t∩ thσ highes⌠ byte.
  60.  
  61. ááááMoreover¼ man∙ oµ thσ O╙ segment≤ arσ ß fixeΣ size« Fo≥ example¼ iε thσ ì
  62. áááámos⌠ commoε implementation¼ thσ CC╨ requre≤ ╕ 25╢-bytσ pages¼ o≥ 204╕ ì
  63. áááábytes« Thσ BDOS¼ require≤ 1┤ 25╢-bytσ pages¼ o≥ 3584 bytes« Thσ BIOS¼ ì
  64. ááááoε thσ othe≥ hand¼ ha≤ ß "variableó size¼ anΣ generall∙ run≤ abou⌠ 409╢ ì
  65. áááábytes¼ anΣ disδ buffer≤ perhap≤ a≤ mucΦ a≤ 204╕ bytes« Therσ i≤ onσ ì
  66. áááámorσ area iε memory¼ Pagσ 0¼ tha⌠ i≤ reserveΣ fo≥ "communication≤"ì
  67. áááábetweeε thσ O╙ anΣ applicatioε program¼ i⌠ i≤ fixeΣ a⌠ 25╢ bytes.
  68.  
  69. ááááFo≥ purpose≤ oµ discussinτ thσ CP/═ (ZRDOS⌐ OS¼ i⌠ i≤ generall∙ easie≥ ì
  70. áááát∩ thinδ oµ memor∙ froφ to≡ t∩ bottom¼ whilσ fo≥ applications¼ wσ wan⌠ ì
  71. áááát∩ conside≥ memor∙ froφ thσ bottoφ t∩ thσ top...
  72.  
  73. ááááBaseΣ oε thσ previou≤ discussion¼ then¼ wσ finΣ ß "typicaló memor∙ ì
  74. ááááimagσ t∩ looδ somethinτ likσ thσ following:
  75.  
  76.  
  77. áááá          FFF╞ +-----------------------------+
  78. áááá               ⁿ                             |
  79. áááá               ⁿ        Disδ Buffer≤         ⁿ         204╕ ¿ 2.0k)
  80. áááá               ⁿ                             |
  81. áááá          F800 +-----------------------------+
  82. áááá               ⁿ                             |
  83. áááá               ⁿ           BIO╙              ⁿ         409╢ ¿ 4.0k)
  84. áááá               ⁿ                             |
  85. áááá          E80░ +-----------------------------+
  86. áááá               ⁿ                             |
  87. áááá               ⁿ           BDO╙              ⁿ         358┤ ¿ 3.5k)
  88. áááá               ⁿ                             |
  89. áááá          DA0░ +-----------------------------+
  90. áááá               ⁿ                             |
  91. áááá               ⁿ            CC╨              ⁿ         204╕ ¿ 2.0k)
  92. áááá               ⁿ                             |
  93. áááá          D20░ +-----------------------------+
  94. áááá               ⁿ                             |
  95.  
  96. áááá               |            TP┴              ⁿ      ■ 5340╡ (52.5K)
  97. áááá               ⁿ                             |
  98. áááá          010░ +-----------------------------+
  99. áááá               ⁿ                             |
  100. áááá               ⁿ           Pagσ ░            ⁿ          25╢ (0.25k)
  101. áááá               ⁿ                             |
  102. áááá          000░ +-----------------------------+
  103.  
  104.  
  105. ááááBea≥ iε mind¼ however¼ thi≤ i≤ ß "theoreticaló systeφ layout¼ anΣ i≤ ì
  106. ááááNO╘ indicativσ oµ thσ systeφ yo⌡ ma∙ bσ using« I⌠ i≤ provideΣ merel∙ ì
  107. ááááfo≥ purpose≤ oµ discussion« Wσ wil∞ develo≡ aε imagσ tha⌠ wil∞ matcΦ ì
  108. ááááyou≥ owε systeφ nex⌠ month« TP┴ stand≤ fo≥ Transien⌠ Prograφ Areß anΣ ì
  109. áááái≤ thσ areß iε memor∙ wherσ applicatioε program≤ load.è
  110. ááááBeforσ wσ caε reall∙ begiε ou≥ project¼ wσ neeΣ t∩ kno≈ jus⌠ ß littlσ ì
  111. áááámorσ abou⌠ thσ pagσ ░ anΣ wha⌠ i⌠ contains« Rathe≥ thaε presen⌠ i⌠ iε ì
  112. áááágraphiπ form¼ I'φ goinτ t∩ illustratσ i⌠ witΦ assemble≥ statement≤ s∩ ì
  113. ááááwσ caε usσ thi≤ informatioε iε writinτ futurσ programs.
  114.  
  115. áááá╔ d∩ no⌠ intenΣ t∩ explaiε thσ rudiment≤ oµ assemble≥ languagσ syntax¼ ì
  116. ááááyo⌡ shoulΣ stud∙ you≥ manual≤ anΣ yo⌡ shoulΣ fee∞ freσ t∩ contac⌠ mσ ì
  117. ááááwheε yo⌡ havσ questions« ╔ woulΣ prefe≥ yo⌡ d∩ thi≤ b∙ callinτ Ceda≥ ì
  118. ááááMil∞ Z-Nodσ 2┤ [503▌ 644-462▒ anΣ leavinτ ß messagσ t∩ AL╠ USERS.....
  119.  
  120. áááá[Note║ thσ followinτ codσ examplσ wa≤ produceΣ usinτ WordSta≥ (tm⌐ anΣ ì
  121. ááááshoulΣ no⌠ bσ "extractedó froφ thσ articlσ t∩ assemble« Instead¼ ß ì
  122. ááááseparatσ filσ calleΣ PAGE0.MA├ (o≥ .Z80⌐ wil∞ bσ provideΣ t∩ assemble.]
  123.  
  124. áááá        TITL┼   'PAG┼ ░ Definition≤ ¡ CP/═ Compute≥ Systems'
  125.  
  126. áááá╗ Prograφ       -------------¡  ╗ Note║ UndefineΣ a⌠ moment
  127. áááá╗ Segmen⌠       Pagσ 0
  128. áááá╗ Autho≥        Beε Grey
  129. áááá╗ Languagσ      Z8░ Assembler
  130. áááá╗ Datσ          0┤ AP╥ 88
  131. áááá╗ Previou≤      None
  132.  
  133. áááá╗ Conditiona∞ Definitions
  134.  
  135. ááááN╧      EQ╒     000░            ╗ Definσ NO
  136. ááááYE╙     EQ╒     no⌠ N╧          ╗ Definσ YES
  137.  
  138. áááá╗ Assemble≥ Definition
  139.  
  140. ááááM8░     EQ╒     N╧              ╗ MicroSoft
  141. ááááSL╥     EQ╒     ye≤             ╗ SL╥ Systems
  142. ááááZA╙     EQ╒     N╧              ╗ Echelon
  143.  
  144. áááá╗ Versioε Levels¼ Date
  145.  
  146. ááááVERS╬   EQ╒     0░              ╗ Versioε  Number
  147. ááááREVS╬   EQ╒     0░              ╗ Revisioε Level
  148.  
  149. ááááVMNT╚   EQ╒     0┤              ╗ Versioε Month
  150. ááááVDAT┼   EQ╒     0┤              ╗ Versioε Date
  151. ááááVYEA╥   EQ╒     8╕              ╗ Versioε Year
  152.  
  153. áááá╗ Operatinτ Systeφ Definitions
  154.  
  155. ááááCPM2▓   EQ╒     N╧              ╗ CP/═ Versioε 2.2
  156. ááááCPM3░   EQ╒     N╧              ╗ CP/═ Versioε 3.░ (CP/M+)
  157. ááááZCPR│   EQ╒     ye≤             ╗ Usinτ ZCP╥  3.x
  158. ááááZRDO╙   EQ╒     ye≤             ╗ Usinτ ZRDO╙ 1.x
  159.  
  160. ááááBAS┼    EQ╒     000░            ╗ Basσ oµ Memory
  161. ááááCC╨     EQ╒     BASE+0D200╚     ╗ Basσ oµ CCP
  162. ááááBDO╙    EQ╒     CCP+0800╚       ╗ Basσ oµ BDOS
  163. ááááBIO╙    EQ╒     BDOS+0E00╚      ╗ Basσ oµ BIOSè
  164. áááá╗ Star⌠ oµ Pagσ 0
  165.  
  166. áááá         iµ     M8░
  167. áááá        .Z80
  168. áááá        ASEG
  169. áááá        OR╟     0000
  170. áááá         endif
  171.  
  172. ááááRST░    EQ╒     ñ               ╗ Restar⌠ Vecto≥ 0
  173.  
  174. ááááWBOOT║  J╨      BIOS+│          ╗ Warφ Boo⌠ Entry
  175. ááááIOBTYE║ D┬      0░              ╗ Input/Outpu⌠ Byte
  176. ááááUSRDSK║ D┬      0░              ╗ M╙ Nybblσ ╜ User¼ L╙ Nybblσ ╜ Disk
  177. ááááBDOSV║  J╨      BDOS+╢          ╗ BDO╙ Functioε Call
  178.  
  179. ááááRST1║   D╙      ╕               ╗ Restar⌠ Vecto≥ 1
  180. ááááRST2║   D╙      ╕               ╗ Restar⌠ Vecto≥ 2
  181. ááááRST3║   D╙      ╕               ╗ Restar⌠ Vecto≥ 3
  182. ááááRST4║   D╙      ╕               ╗ Restar⌠ Vecto≥ 4
  183. ááááRST5║   D╙      ╕               ╗ Restar⌠ Vecto≥ 5
  184. ááááRST6║   D╙      ╕               ╗ Restar⌠ Vecto≥ 6
  185. ááááRST7║   D╙      ╕               ╗ Restar⌠ Vecto≥ ╖ (Debuτ Utilities)
  186.  
  187. áááá        D╙      1╢              ╗ 004░ ¡ 004F
  188. áááá        D╙      1▒              ╗ 005░ ¡ 005B
  189.  
  190. ááááFCB1║   D╙      1╢              ╗ Defaul⌠ FC┬ 1
  191. ááááFCB2║   D╙      1╢              ╗ Defaul⌠ FC┬ 2
  192.  
  193. áááá        D╙      0┤              ╗ 007├ ¡ 007F
  194.  
  195. ááááDMABFR║ D╙      12╕             ╗ 008░ ¡ 00FF
  196.  
  197. áááá        END
  198.  
  199. ááááThi≤ examplσ oµ codσ actuall∙ generate≤ ß Pagσ 0« Thi≤ i≤ NO╘ somethinτ ì
  200. ááááwσ normall∙ neeΣ t∩ d∩ fo≥ ourselves¼ sincσ thσ O╙ wil∞ alway≤ insurσ ì
  201. ááááthσ correc⌠ value≤ arσ storeΣ iε thi≤ area« I⌠ i≤ fo≥ illustratioε onl∙ ì
  202. ááááanΣ i≤ intendeΣ t∩ bσ ß littlσ introductioε a≤ t∩ stylσ anΣ form« Mos⌠ ì
  203. ááááoµ i⌠ i≤ selµ explanatory¼ anΣ ╔ wil∞ minimizσ m∙ descriptioε oµ it.
  204.  
  205. ááááIε general¼ al∞ program≤ wσ writσ wil∞ begiε thσ samσ way║ ß TITL┼ anΣ ì
  206. ááááß brieµ fe≈ line≤ oµ wha⌠ thσ program'≤ namσ is¼ wh∩ wrotσ it¼ wha⌠ thσ ì
  207. áááálanguagσ useΣ is¼ thσ datσ anΣ somσ commen⌠ abou⌠ previuo≤ versions« Iµ ì
  208. áááádesired¼ ß fe≈ (ver∙ few⌐ line≤ caε bσ addeΣ t∩ addres≤ it≤ function:
  209.  
  210. áááá╗ Prograφ       
  211. áááá╗ Segmen⌠       Pagσ 0
  212. áááá╗ Autho≥        Beε Grey
  213. áááá╗ Languagσ      Z8░ Assembler
  214. áááá╗ Datσ          0┤ AP╥ 88
  215. áááá╗ Previou≤      None
  216.  
  217. èáááá╗ Functioε      Thi≤ i≤ ß codσ segmen⌠ t∩ illustratσ thσ content≤ of
  218. áááá╗               thσ CP/═ Pagσ 0« I⌠ i≤ "neveró compileΣ iε rea∞ life.
  219.  
  220. ááááEveε experienceΣ programmer≤ takσ timσ t∩ creatσ thσ abovσ sectioε iε ì
  221. ááááEVER┘ prograφ the∙ write« Thinδ abou⌠ it..« WoulΣ yo⌡ remembe≥ al∞ oµ ì
  222. ááááthσ stufµ fivσ o≥ eveε teε year≤ froφ now┐ Probabl∙ not¼ anΣ thi≤ bi⌠ ì
  223. ááááoµ documentatioε serve≤ t∩ inforφ thσ reader¼ a≤ wel∞ a≤ refresΦ ou≥ ì
  224. ááááowε memorie≤ iε thσ future« I⌠ i≤ ß gooΣ programminτ practice« D∩ it!
  225.  
  226. ááááThσ nex⌠ tw∩ statement≤ arσ directive≤ t∩ thσ assembler¼ defininτ tw∩ ì
  227. áááácommonl∙ useΣ values¼ YE╙ anΣ NO« Wσ coulΣ havσ defineΣ O╬ anΣ OF╞ o≥ ì
  228. ááááeveε TRU┼ anΣ FALS┼ iε thσ samσ way.
  229.  
  230. áááá╗ Conditiona∞ Definitions
  231.  
  232. ááááN╧      EQ╒     000░            ╗ Definσ NO
  233. ááááYE╙     EQ╒     no⌠ N╧          ╗ Definσ YES
  234.  
  235. ááááOF╞     EQ╒     000░            ╗ Definσ OFF
  236. ááááO╬      EQ╒     no⌠ OF╞         ╗ Definσ ON
  237.  
  238. ááááO≥ wσ coulΣ d∩ somethinτ likσ this:
  239.  
  240. ááááTRU┼    EQ╒     YE╙             ╗ Definσ TRUE
  241. ááááFALS┼   EQ╒     N╧              ╗ Definσ FALSE
  242.  
  243. ááááThesσ statement≤ wil∞ permi⌠ u≤ t∩ conditionall∙ selec⌠ certaiε option≤ ì
  244. ááááiε thσ prograφ a⌠ late≥ points« 
  245.  
  246. ááááThσ followinτ threσ statement≤ definσ whicΦ assemble≥ wσ wil∞ usσ wheε ì
  247. ááááwσ pu⌠ thσ prograφ together« Onl∙ ON┼ oµ thσ option≤ shoulΣ bσ YES¼ thσ ì
  248. ááááres⌠ shoulΣ bσ NO« Already¼ wσ arσ usinτ thσ conditional≤ wσ defineΣ iε ì
  249. ááááthσ las⌠ fe≈ line≤ oµ code« Wh∙ d∩ this┐ Wel∞ becausσ i⌠ i≤ importan⌠ ì
  250. ááááfo≥ other≤ t∩ kno≈ "howó yo⌡ assembleΣ thσ program¼ anΣ wha⌠ assemble≥ ì
  251. ááááyo⌡ used« No⌠ al∞ assembler≤ arσ createΣ equal!
  252.  
  253. áááá╗ Assemble≥ Definition
  254.  
  255. ááááM8░     EQ╒     N╧              ╗ MicroSoft
  256. ááááSL╥     EQ╒     ye≤             ╗ SL╥ Systems
  257. ááááZA╙     EQ╒     N╧              ╗ Echelon
  258.  
  259. ááááIε thi≤ case¼ ╔ usσd onσ oµ thσ SL╥ Systemsº assemblers¼ SLR180+¼ ß ì
  260. áááávirtua∞ memor∙ assembler« Al∞ SL╥ assembler≤ usσ thσ samσ syntax« Iµ ì
  261. ááááyo⌡ arσ usinτ M80¼ theε yo⌡ woulΣ se⌠ M8░ EQ╒ yes¼ anΣ SL╥ EQ╒ NO« Thσ ì
  262. áááásamσ rule≤ prevai∞ iε thσ casσ oµ thσ las⌠ equatσ fo≥ ZAS¼ thσ Echeloε ì
  263. ááááInc.¼ product« Therσ coulΣ bσ other≤ addeΣ t∩ thσ lis⌠ a≤ well¼ bu⌠ fo≥ ì
  264. ááááou≥ purposes¼ thesσ arσ thσ onl∙ threσ assembler≤ tha⌠ wil∞ concerε us.
  265.  
  266. ááááRecal∞ m∙ discussinτ versioε anΣ revisioε level≤ a≤ ß par⌠ oµ thσ filσ ì
  267. ááááname┐ Wel∞ insidσ thσ prograφ i⌠ i≤ necessar∙ t∩ identif∙ thσ samσ tw∩ ì
  268. áááávalues« Iε addition¼ I'vσ includeΣ thσ Versioε Datσ s∩ wσ caε tel∞ wheε ì
  269. ááááwσ las⌠ modifieΣ thσ program« Yo⌡ shoulΣ ge⌠ iε thσ habi⌠ oµ updatinτ ì
  270. ááááthesσ value≤ EVER┘ timσ yo⌡ edi⌠ thσ program« Iµ desired¼ thσ timσ may
  271. ááááals∩ bσ added¼ alth∩ no⌠ required:è
  272. áááá╗ Versioε Levels¼ Date¼ Time
  273.  
  274. ááááVERS╬   EQ╒     0░              ╗ Versioε  Number
  275. ááááREVS╬   EQ╒     0░              ╗ Revisioε Level
  276.  
  277. ááááVMNT╚   EQ╒     0┤              ╗ Versioε Month
  278. ááááVDAT┼   EQ╒     0┤              ╗ Versioε Date
  279. ááááVYEA╥   EQ╒     8╕              ╗ Versioε Year
  280.  
  281. ááááVHOU╥   EQ╒     0╖              ╗ Versioε Hour
  282. ááááVMIN╙   EQ╒     0░              ╗ Versioε Minutes
  283. ááááVSEC╙   EQ╒     0░              ╗ Versioε Seconds
  284.  
  285. ááááSincσ wσ wil∞ bσ writinτ program≤ t∩ ruε unde≥ botΦ CP/═ anΣ ZRDOS¼ anΣ ì
  286. ááááwil∞ probabl∙ bσ usinτ botΦ thσ standarΣ CC╨ anΣ ZCPR¼ wσ shoulΣ definσ ì
  287. ááááthesσ value≤ also« Thi≤ i≤ ß furthe≥ aiΣ t∩ documentation« A⌠ thi≤ ì
  288. áááápoint¼ i⌠ i≤ no⌠ significant¼ bu⌠ late≥ i⌠ wil∞ becomσ quitσ important.
  289.  
  290. ááááCPM2▓   EQ╒     N╧              ╗ CP/═ Versioε 2.2
  291. ááááCPM3░   EQ╒     N╧              ╗ CP/═ Versioε 3.░ (CP/M+)
  292. ááááZCPR│   EQ╒     ye≤             ╗ Usinτ ZCP╥  3.x
  293. ááááZRDO╙   EQ╒     ye≤             ╗ Usinτ ZRDO╙ 1.x
  294.  
  295. ááááThσ nex⌠ se⌠ oµ equate≤ definσ somσ oµ thσ importan⌠ anΣ ofteε useΣ ì
  296. ááááaddresse≤ iε ou≥ systems:
  297.  
  298. ááááBAS┼    EQ╒     000░            ╗ Basσ oµ Memory
  299. ááááCC╨     EQ╒     BASE+0D200╚     ╗ Basσ oµ CCP
  300. ááááBDO╙    EQ╒     CCP+0800╚       ╗ Basσ oµ BDOS
  301. ááááBIO╙    EQ╒     BDOS+0E00╚      ╗ Basσ oµ BIOS
  302.  
  303. ááááBAS┼ define≤ thσ "bottomó o≥ "beginningó oµ memory« Noticσ tha⌠ thσ CC╨ ì
  304. ááááequatσ i≤ defineΣ a≤ thσ BASE+0D200H« Thi≤ i≤ donσ s∩ tha⌠ thσ prograφ ì
  305. áááácaε kno≈ no⌠ onl∙ wherσ thσ CC╨ i≤ located¼ bu⌠ als∩ t∩ kee≡ thσ ì
  306. áááá"symboló CC╨ ß relocatablσ item« (I'l∞ discus≤ relocatabilit∙ later.⌐
  307.  
  308. ááááLikewise¼ thσ BDO╙ addres≤ i≤ aε "offsetó oµ fixeΣ valuσ froφ thσ CCP¼ ì
  309. ááááanΣ sincσ wσ kno≈ thσ CC╨ i≤ 204╕ bytes¼ o≥ 8*256¼ (notσ tha⌠ 25╢ iε ì
  310. ááááhex i≤ 100⌐ s∩ wσ adΣ 8*10░ (0800H⌐ t∩ thσ CC╨ beginninτ address¼ t∩ ì
  311. ááááfinΣ thσ beginninτ oµ thσ BDOS« Wσ als∩ kno≈ tha⌠ thσ BDO╙ i≤ 1┤ 25╢-ì
  312. áááábytσ page≤ (1┤ iε hex i≤ 0E¼ s∩ 0E*10░ ╜ 0E00H).
  313.  
  314. ááááIµ wσ als∩ wisheΣ t∩ includσ thσ usua∞ 2╦ oµ buffe≥ spacσ generall∙ ì
  315. ááááfounΣ afte≥ thσ BIOS¼ wσ coulΣ adΣ onσ morσ equatσ ..« however¼ wσ ì
  316. ááááwoulΣ havσ t∩ kno≈ EXACTL┘ ho≈ biτ thσ BIO╙ is¼ anΣ rounΣ i⌠ u≡ t∩ thσ ì
  317. áááánex⌠ eveε 1╦ boundary« Wσ havσ assumeΣ ß 4╦ BIO╙ s∩ wσ woulΣ have:
  318.  
  319. ááááBAS┼    EQ╒     000░            ╗ Basσ oµ Memory
  320. ááááCC╨     EQ╒     BASE+0D200╚     ╗ Basσ oµ CCP
  321. ááááBDO╙    EQ╒     CCP+0800╚       ╗ Basσ oµ BDOS
  322. ááááBIO╙    EQ╒     BDOS+0E00╚      ╗ Basσ oµ BIOS
  323. ááááEPRO═   EQ╒     BIOS+1000╚      ╗ Basσ oµ EPRO═ o≥ Buffers
  324.  
  325. áááá[Note║ iµ 2╦ ╜ 8*256¼ theε 4╦ ╜ 16*256¼ thu≤ 10*10░ ╜ 1000H.)è
  326. ááááConfused┐ ╔ hopσ not« Hexadecima∞ arithmetiπ i≤ discusseΣ iε nearl∙ ì
  327. ááááever∙ compute≥ textbooδ ╔ havσ eve≥ seen« Remember¼ wheε dealinτ witΦ ì
  328. áááácomputers¼ the∙ "thinkó iε basσ 1╢ (hexadecimal)¼ no⌠ basσ 1░ (decimal⌐ ì
  329. áááálikσ wσ do« S∩ yo⌡ ask¼ wh∙ couldn'⌠ wσ usσ decima∞ number≤ t∩ definσ ì
  330. ááááthesσ values┐ Thσ answe≥ i≤ wσ could¼ bu⌠ sincσ wσ arσ talkinτ abou⌠ ì
  331. ááááthσ rea∞ hardware¼ anΣ wil∞ bσ concerneΣ abou⌠ "rea∞ memoryó addresses¼ ì
  332. áááái⌠ i≤ morσ appropriatσ t∩ worδ iε hexadecima∞ values« Afte≥ all¼ thσ ì
  333. ááááoutpu⌠ oµ thσ assembler≤ alway≤ provide≤ u≤ witΦ thσ he° value≤ iε thσ ì
  334. áááálistinτ (NEVE╥ thσ decima∞ ones)...
  335.  
  336. ááááThσ nex⌠ fe≈ statement≤ arσ significan⌠ iµ yo⌡ arσ usinτ M8░ a≤ thσ ì
  337. ááááassembler« The∙ arσ NO╘ requireΣ fo≥ SL╥ o≥ ZA╙ anΣ thereforσ wσ wan⌠ ì
  338. áááát∩ makσ theφ "conditionaló oε thσ assemble≥ wσ arσ using« Tha⌠ is¼ iµ ì
  339. ááááwσ arσ usinτ M80¼ theε thesσ statement≤ wil∞ bσ used¼ iµ wσ arσ not¼ ì
  340. ááááthe∙ wil∞ no⌠ bσ used« Pleasσ notσ thσ style¼ thσ conditiona∞ "ifó i≤ ì
  341. ááááoffse⌠ onσ column¼ anΣ i≤ iε "lowe≥ case"..« Thi≤ make≤ i⌠ eas∙ t∩ finΣ ì
  342. ááááiε ß largσ listinτ (ditt∩ fo≥ thσ "endif").
  343.  
  344. áááá         iµ     M8░
  345. áááá        .Z80
  346. áááá        ASEG
  347. áááá        OR╟     0000
  348. áááá         endif
  349.  
  350. ááááIε thσ casσ oµ M80¼ whicΦ caε assemblσ botΦ 808░ Inte∞ anΣ Z8░ Ziloτ ì
  351. áááámnemonics¼ wσ neeΣ t∩ inforφ i⌠ whicΦ se⌠ oµ mnemonic≤ wσ arσ using« Iε ì
  352. ááááou≥ case¼ wσ wil∞ ALWAY╙ usσ thσ Ziloτ codes« (Thσ .Z8░ directive)
  353.  
  354.  áááThσ ASE╟ statemen⌠ tell≤ M8░ tha⌠ thi≤ i≤ aε "absoluteó segment« I⌠ i≤ ì
  355. ááááno⌠ requireΣ b∙ thσ othe≥ tw∩ assemblers«
  356.  
  357. ááááThσ OR╟ statemen⌠ tell≤ M8░ wherσ iε memor∙ wσ wan⌠ thi≤ codσ located« ì
  358. ááááThi≤ directivσ cause≤ M8░ t∩ pu⌠ ß specia∞ valuσ iε thσ relocatablσ ì
  359. ááááfilσ tha⌠ wil∞ bσ generateΣ b∙ thσ assembler¼ s∩ tha⌠ L80¼ thσ linke≥, ì
  360. ááááwil∞ bσ ablσ t∩ "placeó i⌠ iε thσ prope≥ memor∙ area¼ namel∙ Pagσ 0.
  361.  
  362. ááááNo≈ wσ havσ thσ basiπ definitions¼ wσ wil∞ examinσ jus⌠ wha⌠ i≤ iε Pagσ ì
  363. áááá0¼ anΣ wha⌠ thσ value≤ mean...
  364.  
  365. ááááRST░    EQ╒     ñ               ╗ Restar⌠ Vecto≥ 0
  366.  
  367. ááááWBOOTE║ J╨      BIOS+│          ╗ Warφ Boo⌠ Entry
  368. ááááIOBTYE║ D┬      0░              ╗ Input/Outpu⌠ Byte
  369. ááááUSRDSK║ D┬      0░              ╗ M╙ Nybblσ ╜ User¼ L╙ Nybblσ ╜ Disk
  370. ááááBDOSFV║ J╨      BDOS+╢          ╗ BDO╙ Functioε Call
  371.  
  372. ááááRST1║   D╙      ╕               ╗ Restar⌠ Vecto≥ 1
  373. ááááRST2║   D╙      ╕               ╗ Restar⌠ Vecto≥ 2
  374. ááááRST3║   D╙      ╕               ╗ Restar⌠ Vecto≥ 3
  375. ááááRST4║   D╙      ╕               ╗ Restar⌠ Vecto≥ 4
  376. ááááRST5║   D╙      ╕               ╗ Restar⌠ Vecto≥ 5
  377. ááááRST6║   D╙      ╕               ╗ Restar⌠ Vecto≥ 6
  378. ááááRST7║   D╙      ╕               ╗ Restar⌠ Vecto≥ ╖ (Debuτ Utilities)
  379. èáááá        D╙      1╢              ╗ 004░ ¡ 004F
  380. áááá        D╙      1▒              ╗ 005░ ¡ 005B
  381.  
  382. ááááFCB1║   D╙      1╢              ╗ Defaul⌠ FC┬ 1
  383. ááááFCB2║   D╙      1╢              ╗ Defaul⌠ FC┬ 2
  384.  
  385. áááá        D╙      0┤              ╗ 007├ ¡ 007F
  386.  
  387. ááááDMABFR║ D╙      12╕             ╗ 008░ ¡ 00FF
  388.  
  389. áááá        END
  390.  
  391. ááááThσ firs⌠ line¼ define≤ (informationally⌐ wherσ thσ firs⌠ Restar⌠ ì
  392. ááááVecto≥ begins« I⌠ jus⌠ s∩ happens¼ thi≤ i≤ thσ samσ addres≤ wherσ thσ ì
  393. áááájum≡ t∩ thσ BIO╙ Warφ Boo⌠ Entr∙ i≤ found« Thσ EQ╒ ñ say≤: assigε thσ ì
  394. ááááaddres≤ oµ thσ Prograφ Counte≥ (000░ a⌠ thi≤ point⌐ t∩ thσ labe∞ RST0.
  395.  
  396. ááááRST░    EQ╒     ñ               ╗ Restar⌠ Vecto≥ 0
  397.  
  398. ááááThσ nex⌠ linσ define≤ thσ labe∞ WBOOT┼ (warφ boo⌠ entry⌐ a≤ ß jum≡ (JP⌐ ì
  399. áááát∩ thσ BIOS+3« Iµ yo⌡ lookeΣ a⌠ thσ beginninτ oµ thσ BIOS¼ yo⌡ woulΣ ì
  400. ááááseσ tha⌠ i⌠ begin≤ witΦ ß serie≤ oµ jum≡ instructions¼ pointinτ t∩ thσ ì
  401. áááávariou≤ function≤ thσ BIO╙ provides« Normally¼ wσ d∩ no⌠ concerε ì
  402. ááááourselve≤ witΦ thi≤ information¼ becausσ thσ BDO╙ als∩ know≤ abou⌠ ì
  403. ááááthi≤ jum≡ table¼ anΣ wheε wσ makσ ß functioε cal∞ t∩ BDOS¼ i⌠ locate≤ ì
  404. ááááthσ BIO╙ anΣ provide≤ thσ necessar∙ linkagσ fo≥ us.
  405.  
  406. ááááWBOOT║  J╨      BIOS+│          ╗ Warφ Boo⌠ Entry
  407.  
  408. ááááThσ nex⌠ linσ define≤ thσ labe∞ IOBYTE« I⌠ i≤ defineΣ a≤ ß singlσ bytσ ì
  409. áááá(D┬ ╜ Definσ Byte⌐ witΦ ß valuσ iε thσ bytσ oµ 00H« Thi≤ bytσ i≤ ofteε ì
  410. ááááuseΣ b∙ thσ BIO╙ anΣ othe≥ application≤ t∩ "rσ-directó thσ input/outpu⌠ ì
  411. ááááoµ ß program« (Iε standarΣ CP/═ systems¼ thσ STA╘ commanΣ manipulate≤ ì
  412. ááááthσ content≤ oµ thi≤ byte.)
  413.  
  414. ááááIOBTYE║ D┬      0░              ╗ Input/Outpu⌠ Byte
  415.  
  416. ááááThσ labe∞ USRDS╦ define≤ tw∩ values║ thσ fou≥ leftmos⌠ bit≤ contaiε thσ ì
  417. áááácurren⌠ "use≥ areaó anΣ thσ fou≥ rightmos⌠ bit≤ definσ thσ curren⌠ ì
  418. áááá"diskó (thσ loggeΣ iε o≥ defaul⌠ disk)« Wheε ß bytσ i≤ divideΣ int∩ tw∩ ì
  419. áááá┤-bi⌠ values¼ wσ refe≥ t∩ theφ a≤ thσ Mos⌠ Significan⌠ (MS⌐ anΣ Leas⌠ ì
  420. ááááSignifican⌠ (LS⌐ Nybble« Perhap≤ aε illustratioε wil∞ bσ helpful:
  421.  
  422.  
  423. ááááUSRDSK║ D┬      0░              ╗ M╙ Nybblσ ╜ User¼ L╙ Nybblσ ╜ Disk
  424.  
  425. áááá                         Use≥ Disk
  426.  
  427. áááá          M╙ Nybblσ -->  000░ 000░  <-¡ L╙ Nybble
  428. áááá             Bi⌠ ╖  ----»         \---¡ Bi⌠ 0
  429.  
  430.  
  431. ááááThσ nex⌠ linσ 
  432.  
  433. ááááBDOSFV║ J╨      BDOS+╢          ╗ BDO╙ Functioε Callè
  434. áááádefine≤ thσ entr∙ poin⌠ t∩ thσ BDO╙ tha⌠ wσ cal∞ t∩ havσ aε O╙ functioε ì
  435. ááááperformeΣ fo≥ us« Mos⌠ program≤ loaΣ ß "functioε codeó int∩ Registe≥ C¼ ì
  436. ááááanΣ appropriatσ informatioε iε thσ othe≥ register≤ anΣ theε perforφ thσ ì
  437. ááááinstruction:
  438.  
  439. áááá        CAL╠    BDOSF╓        ╗ Perforφ Functioε Call
  440.  
  441. ááááFo≥ example║ supposσ wσ wan⌠ t∩ kno≈ iµ ß characte≥ i≤ waitinτ oε thσ ì
  442. ááááconsolσ fo≥ input« Wσ migh⌠ usσ Functioε Codσ 1▒ (ReaΣ Consolσ Status⌐ ì
  443. áááát∩ determinσ this« Thσ codσ woulΣ be:
  444.  
  445. áááá        L─      C,1▒          ╗ F├ ╜ Consolσ Status
  446. áááá        CAL╠    BDOSF╓        ╗ Perforφ O╙ Function
  447.  
  448. ááááWheε contro∞ i≤ returneΣ t∩ u≤ froφ thσ OS¼ (righ⌠ afte≥ thσ CALL)¼ wσ ì
  449. ááááwil∞ havσ ß valuσ iε Registe≥ A« Iµ i⌠ i≤ 00¼ n∩ characte≥ wa≤ waiting¼ ì
  450. ááááiµ i⌠ i≤ NO╘ 00¼ theε ß characte≥ i≤ waiting« Bu⌠ ╔ digressí Wσ onl∙ ì
  451. ááááhavσ ß fe≈ morσ line≤ oµ codσ t∩ go¼ anΣ wσ wil∞ havσ completeΣ thi≤ ì
  452. ááááarticle...
  453.  
  454.  áááUnfortunately¼ thi≤ kinΣ oµ explanatioε require≤ lot≤ oµ word≤ anΣ ì
  455. ááááexamples« Thσ content≤ oµ Pagσ ░ arσ s∩ ver∙ important¼ ╔ wanteΣ t∩ ì
  456. áááástar⌠ witΦ i⌠ s∩ yo⌡ wil∞ understanΣ somσ oµ thσ morσ rudimentar∙ ì
  457. áááálocation≤ iε you≥ memor∙ image.
  458.  
  459. ááááThσ nex⌠ seveε line≤ represen⌠ thσ remaininτ Restar⌠ Vectors« Therσ arσ ì
  460. ááááeigh⌠ oµ theφ iε thσ Z8░ machine« Iε genera∞ the∙ arσ unuseΣ a⌠ presen⌠ ì
  461. ááááiε mos⌠ machines« However¼ witΦ thσ ne≈ O╙ anΣ somσ ne≈ applications¼ ì
  462. ááááthesσ byte≤ wil∞ bσ used« (D╙ ╜ Definσ Storagσ iε bytes)
  463.  
  464. ááááRST1║   D╙      ╕               ╗ Restar⌠ Vecto≥ 1
  465. ááááRST2║   D╙      ╕               ╗ Restar⌠ Vecto≥ 2
  466. ááááRST3║   D╙      ╕               ╗ Restar⌠ Vecto≥ 3
  467. ááááRST4║   D╙      ╕               ╗ Restar⌠ Vecto≥ 4
  468. ááááRST5║   D╙      ╕               ╗ Restar⌠ Vecto≥ 5
  469. ááááRST6║   D╙      ╕               ╗ Restar⌠ Vecto≥ 6
  470. ááááRST7║   D╙      ╕               ╗ Restar⌠ Vecto≥ ╖ (Debuτ Utilities)
  471.  
  472.  áááThσ nex⌠ tw∩ lines¼ merel∙ allocatσ 2╕ byte≤ oµ memory« Nothinτ oµ an∙ ì
  473. ááááinteres⌠ i≤ iε them« Thσ addresse≤ t∩ thσ right¼ iε thσ comment≤ area¼ ì
  474. áááámerel∙ indicatσ wha⌠ "memor∙ locationsó the∙ allocate.
  475.  
  476. áááá        D╙      1╢              ╗ 004░ ¡ 004F
  477. áááá        D╙      12              ╗ 005░ ¡ 005B
  478.  
  479. ááááAls∩ locateΣ iε Pagσ ░ arσ tw∩ "defaultó Filσ Contro∞ Blocks¼ a⌠ ì
  480. ááááaddresse≤ 005C╚ anΣ 006CH« Thesσ FCB≤ arσ generall∙ filleΣ iε b∙ thσ ì
  481. ááááCC╨ iµ wσ havσ specifieΣ "argumentsó oε thσ commanΣ line« ╔ wil∞ no⌠ ì
  482. áááábothe≥ witΦ ß discussioε oµ thei≥ structurσ a⌠ thi≤ time« Wσ wil∞ cove≥ ì
  483. áááái⌠ iε detai∞ a⌠ ß late≥ time.
  484.  
  485. ááááFCB1║   D╙      1╢              ╗ Defaul⌠ FC┬ 1
  486. ááááFCB2║   D╙      1╢              ╗ Defaul⌠ FC┬ 2
  487. èááááNext¼ arσ fou≥ bytes¼ merel∙ allocatinτ memor∙ a≤ above:
  488.  
  489. áááá        D╙      0┤              ╗ 007├ ¡ 007F
  490.  
  491. ááááAnΣ lastl∙ come≤ thσ defaul⌠ Direc⌠ Memor∙ Acces≤ Buffer« Thi≤ i≤ thσ ì
  492. ááááareß wherσ CP/═ generall∙ store≤ ß recorΣ reaΣ froφ onσ oµ thσ flopp∙ ì
  493. áááádisk≤ (o≥ harΣ disk)« I⌠ i≤ ALWAY╙ 12╕-bytes¼ becausσ CP/═ think≤ ALL ì
  494. ááááphysica∞ record≤ arσ 128-byte≤ iε length«
  495.  
  496. ááááDMABFR║ D╙      12╕             ╗ 008░ ¡ 00FF
  497.  
  498. ááááTheε thσ assemble≥ directive¼ END¼ t∩ definσ thσ obvious¼ thσ enΣ oµ ì
  499. ááááthσ program.
  500.  
  501. áááá        END
  502.  
  503. ááááIε thi≤ month'≤ article¼ ╔ havσ describeΣ thσ basiπ layou⌠ oµ memor∙ ì
  504. ááááanΣ thσ content≤ oµ Pagσ 0« Nex⌠ month¼ wσ wil∞ begiε ß "realó prograφ ì
  505. ááááanΣ discus≤ morσ memor∙ management« Iµ yo⌡ d∩ no⌠ havσ BUFFERS.DO├ a⌠ ì
  506. ááááthi≤ time¼ yo⌡ migh⌠ retrievσ i⌠ fo≥ nex⌠ month≤ column.
  507.  
  508. ááááYou≥ assignment║ Yo⌡ shoulΣ tr∙ t∩ assemblσ thi≤ prograφ anΣ prin⌠ ou⌠ ì
  509. ááááthσ resultinτ listing« Kee≡ i⌠ hand∙ fo≥ thσ future¼ a≤ wσ wil∞ refe≥ ì
  510. áááát∩ i⌠ ove≥ anΣ ove≥ again« Iµ yo⌡ d∩ no⌠ havσ M80¼ SL╥ o≥ ZAS¼ yo⌡ caε ì
  511. ááááge⌠ ß cop∙ oµ thσ compileΣ listinτ filσ froφ m∙ ┌-Node«
  512.  
  513.  áááYo⌡ mus⌠ havσ ß printe≥ capablσ oµ printinτ ß minimuφ oµ 12▒ columns« ì
  514. ááááMos⌠ 8░ columε do⌠-matri° machine≤ caε bσ se⌠ t∩ "condensedó modσ anΣ ì
  515. ááááwil∞ worδ fine« Thσ filσ caε bσ printeΣ witΦ PI╨ anΣ ha≤ imbeddeΣ ^╠ ì
  516. áááá(Contro∞-L⌐ a⌠ appropriatσ place≤ t∩ causσ ß Forφ FeeΣ (ne≈ page)« Thσ ì
  517. áááásourcσ codσ fo≥ thi≤ filσ i≤ als∩ availablσ oε m∙ ┌-Node¼ Acces≤ ì
  518. ááááProgramminτ anΣ PE╟-3« Refe≥ t∩ you≥ printe≥ manua∞ o≥ documentatioε oε ì
  519. ááááPI╨ fo≥ morσ printinτ details.
  520.  
  521. ááááOnσ morσ poin⌠ oµ interest║ Somσ assembler≤ displa∙ thσ assembleΣ ì
  522. ááááaddres≤ a≤ i⌠ i≤ actuall∙ storeΣ iε memory¼ lo≈ byte¼ theε higΦ byte« ì
  523. ááááThσ SL╥ assembler≤ caε displa∙ i⌠ botΦ ways« ╔ chosσ t∩ sho≈ i⌠ a≤ ì
  524. ááááhigΦ-bytσ anΣ lo≈-byte¼ simpl∙ becausσ i⌠ i≤ easie≥ t∩ read« M80¼ ì
  525. ááááhowever¼ doe≤ jus⌠ thσ opposite.
  526.