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 / ZCPR33 / S-Z / ZAPG.SI < prev    next >
Text File  |  2000-06-30  |  56KB  |  1,205 lines

  1. .. intended to be printed with Newword 2.x or WS 4
  2. .. ^Y turns italics on and off
  3. .. ".bpoff" turns on draft-quality print, ".bpon" returns to letter-quality
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22. 
  23.                ZCPR│ Applicatioε Programmer≤ Guide
  24.  
  25.                          b∙ DaviΣ McCord
  26.  
  27.                           Jul∙ 23¼ 1987
  28.  
  29.                   Copyrigh⌠ 198╖ Echelon¼ Inc.
  30. .paè.FO                                i
  31.                 T A B L E   OF   C O N T E N T S
  32.  
  33.   1. Introduction...............................................1
  34.  
  35.   2. The ZCPR3 Environment......................................2
  36.      2.1. What is a ZCPR3 Environment?..........................2
  37.           2.1.1. The ZCPR3 Command Processor....................2
  38.           2.1.2. Environment Descriptor.........................3
  39.                  2.1.2.1. TCAP..................................3
  40.           2.1.3. System Segments................................4
  41.                  2.1.3.1. Resident Command Package..............4
  42.                  2.1.3.2. Flow Command Package..................4
  43.                  2.1.3.3. Input/Output Package..................5
  44.                  2.1.3.4. Named Directory Register..............5
  45.           2.1.4. Buffers and Work Areas.........................6
  46.                  2.1.4.1. Multiple Command Line Buffer..........6
  47.                  2.1.4.2. Shell Stack...........................6
  48.                  2.1.4.3. Command Search Path...................7
  49.      2.2. Structures............................................7
  50.           2.2.1. Environment Descriptor.........................8
  51.           2.2.2. TCAP...........................................9
  52.           2.2.3. Command Search Path...........................10
  53.           2.2.4. Named Directory Register......................10
  54.           2.2.5. Multiple Command Line Buffer..................11
  55.           2.2.6. Shell Stack...................................12
  56.           2.2.7. ZCPR3 Utility Header..........................13
  57.      2.3. Initialization Environment...........................14
  58.           2.3.1. Default FCBs..................................14
  59.           2.3.2. Command Line Tail Text........................14
  60.           2.3.3. What's Your Program's Name?...................14
  61.  
  62.   3. Using ZCPR3 Shell Features................................16
  63.      3.1. Invocation...........................................16
  64.           3.1.1. How Was Your Program Invoked?.................16
  65.           3.1.2. Pausing.......................................16
  66.           3.1.3. Resetting Shell Invocation Flag...............17
  67.           3.1.4. Environment Verification......................17
  68.           3.1.5. Building a Shell Stack Entry..................17
  69.           3.1.6. Pushing an Entry Onto the Shell Stack.........18
  70.           3.1.7. Pending Commands..............................18
  71.           3.1.8. Example Pseudocode for Invocation.............19
  72.      3.2. Generating Commands..................................19
  73.           3.2.1. Prompting the User............................19
  74.           3.2.2. Setting Return Parameters.....................20
  75.           3.2.3. Placing the Desired Command in the Buffer.....20
  76.           3.2.4. Pseudocode for Shell "Generate Command" Funct.21
  77.      3.3. Terminating a Shell..................................21
  78.  
  79.   4. Programming Examples......................................22
  80.      4.1. Is ZCPR3 Available?..................................22
  81.      4.2. Is ZRDOS Available?..................................22
  82. .PAè.FO
  83. .HE
  84. .PN 1
  85. 1. Introduction
  86.  
  87. Thi≤ documen⌠ i≤ ß referencσ guidσ t∩ ZCPR│ anΣ ┌-Systeφ fo≥ áthσ ì
  88. application≤ programme≥ wh∩ wishe≤ t∩ takσ advantagσ oµ áZCPR3/┌-ì
  89. Systeφ feature≤ anΣ function≤ iε thei≥ applications«  I⌠ ágather≤ ì
  90. togethe≥ áint∩ onσ convenien⌠ documen⌠ thσ informatioε needeΣ áb∙ ì
  91. thσ ááapplicatioε áprogramme≥ áwheε áádevelopinτ ááZCPR│-orienteΣ ì
  92. applications«  Echelon'≤ polic∙ i≤ t∩ suppor⌠ softwarσ developer≤ ì
  93. interesteΣ áiε makinτ thei≥ produc⌠ attractivσ t∩ thσ man∙ áuser≤ ì
  94. oµ thσ ZCPR3/┌-Systeφ environment«  
  95.  
  96. I⌠ i≤ importan⌠ t∩ notσ tha⌠ i⌠ i≤ entirel∙ feasiblσ t∩ writσ áaε ì
  97. applicatioε áwhicΦ áfunction≤ áunde≥ "vanillaó áCP/M¼ áyet¼ áwheε ì
  98. runninτ áoε áß ácompute≥ áwherσ á┌-Systeφ ái≤ áavailable¼ áátake≤ ì
  99. advantagσ áoµ áthσ áfeature≤ oµ ZCPR│ anΣ áZRDOS« á Thus¼ átakinτ ì
  100. advantagσ áoµ ZCPR│ doe≤ no⌠ limi⌠ thσ possiblσ marke⌠ áfo≥ áyou≥ ì
  101. program¼ anΣ caε hel≡ i⌠ t∩ bσ morσ successful.
  102.  
  103. Thi≤ ádocumen⌠ i≤ structureΣ iε threσ majo≥ sections«  First¼ áwσ ì
  104. wil∞ discus≤ wha⌠ ZCPR│ i≤ oε aε overvie≈ basis¼ describinτ ásomσ ì
  105. oµ áthσ feature≤ anΣ function≤ i⌠ offers¼ witΦ discussioε oµ áthσ ì
  106. datß structure≤ anΣ concept≤ tha⌠ ZCPR│ i≤ baseΣ on«  Second¼ áwσ ì
  107. wil∞ discus≤ iε detai∞ thσ mechanism≤ anΣ theor∙ oµ ZCPR3'≤ SHEL╠ ì
  108. functions¼ áwhicΦ áhavσ no⌠ beeε documenteΣ adequatel∙ áiε áothe≥ ì
  109. Echeloε ápublications« á Third¼ wσ wil∞ givσ áß áfe≈ áprogramminτ ì
  110. example≤ iε aε effor⌠ t∩ savσ thσ applicatioε programme≥ timσ anΣ ì
  111. effort.
  112.  
  113. GooΣ lucδ iε you≥ worδ witΦ ZCPR3/Z-System.
  114. .paè2. Thσ ZCPR│ Environment
  115.  
  116. Thσ ZCPR│ environmen⌠ i≤ ß superse⌠ oµ thσ CP/═ 2.▓ áenvironment«  ì
  117. Thσ áZCPR│ environmen⌠ give≤ thσ use≥ áadditiona∞ áfunctionality¼ ì
  118. anΣ ágive≤ áthσ application≤ programme≥ ß mucΦ large≥ áamoun⌠ áoµ ì
  119. informatioε áabou⌠ thσ characteristic≤ oµ thσ ácompute≥ áhardwarσ ì
  120. anΣ áásoftwarσ áenvironment« á Thi≤ áadditiona∞ áinformatioε áái≤ ì
  121. accesseΣ áiε áß marvelousl∙ simplσ way¼ usinτ ß áconstruc⌠ áaptl∙ ì
  122. nameΣ thσ "environmen⌠ descriptor"« 
  123.  
  124. Iε áthi≤ ásubsectioε wσ wil∞ describσ thσ component≤ oµ áß áZCPR│ ì
  125. installatioε oε ß genera∞ overvie≈ basis«  Wherσ appropriate¼ áwσ ì
  126. wil∞ referencσ supportinτ documentatioε fo≥ furthe≥ information« 
  127.  
  128. 2.1. Wha⌠ i≤ ß ZCPR│ Environment?
  129.  
  130. Therσ arσ fou≥ majo≥ "piecesó t∩ ß ZCPR│ installation«  The∙ are║ ì
  131. thσ áZCPR│ áCommanΣ Processor¼ thσ áEnvironmen⌠ áDescriptor¼ áthσ ì
  132. systeφ packages¼ anΣ thσ systeφ buffer≤ anΣ worδ areas« 
  133.  
  134. No⌠ ácovereΣ áb∙ áthi≤ documen⌠ arσ thσ ove≥ á10░ áZCPR│ áutilit∙ ì
  135. programs¼ áwhicΦ áarσ áquitσ aε asse⌠ iε áthei≥ áowε áright« á Aε ì
  136. interesteΣ áprogramme≥ ácoulΣ árefe≥ át∩ áthσ ásourcσ áfo≥ áthesσ ì
  137. program≤ fo≥ example≤ oµ ho≈ giveε function≤ arσ performed« 
  138.  
  139. I⌠ i≤ recommendeΣ thσ thσ interesteΣ programme≥ als∩ revie≈ page≤ ì
  140. ▒-2░ áoµ áZCPR3: The Manual¼ especiall∙ iµ ápresentl∙ áunfamilia≥ ì
  141. witΦ ZCPR3«  Thi≤ wil∞ givσ yo⌡ aε iε-deptΦ introductioε t∩ ásomσ ì
  142. basiπ ZCPR│ concepts« 
  143.  
  144. 2.1.1. Thσ ZCPR│ CommanΣ Processor
  145.  
  146. Thσ áZCPR│ áCommanΣ Processo≥ i≤ thσ equivalen⌠ oµ thσ CC╨ áiε áß ì
  147. conventiona∞ áCP/═ 2.▓ system¼ o≥ COMMAND.CO═ iε áMSDO╙ ásystems«  ì
  148. It≤ áfunctioε i≤ t∩ acquirσ thσ nex⌠ commanΣ t∩ bσ executed¼ áanΣ ì
  149. theε executσ it« 
  150.  
  151. Fo≥ ácompatibilit∙ áreasons¼ áthσ ásizσ áoµ áthσ áZCPR│ ááCommanΣ ì
  152. Processo≥ ái≤ á2δ bytes¼ samσ a≤ thσ CP/═ 2.▓ CCP«  Iε áorde≥ át∩ ì
  153. makσ áspacσ áfo≥ áthσ áman∙ áadditiona∞ áfeature≤ áoffered¼ áman∙ ì
  154. formerl∙-interna∞ component≤ oµ thσ CP/═ CC╨ havσ beeε moveΣ áou⌠ ì
  155. oµ áthσ áZCPR│ CommanΣ Processo≥ anΣ int∩ reserveΣ ámemor∙ áarea≤ ì
  156. (typicall∙ abovσ thσ BIOS¼ wherσ the∙ wil∞ no⌠ bσ overwritteε áb∙ ì
  157. systeφ áactivity)«  Thesσ component≤ includσ construct≤ ásucΦ áa≤ ì
  158. thσ commanΣ linσ buffer¼ thσ FC┬ useΣ wheε loadinτ programs¼ áthσ ì
  159. stack¼ etc« 
  160.  
  161. Also¼ ZCPR│ typicall∙ utilize≤ Z8░ opcode≤ iε ß furthe≥ effor⌠ t∩ ì
  162. reducσ ácodσ ásize¼ makinτ eveε morσ spacσ áavailablσ áfo≥ áaddeΣ ì
  163. functions« á Othe≥ áideas¼ sucΦ a≤ movinτ thσ áresiden⌠ ácommand≤ ì
  164. sucΦ a≤ DIR¼ ERA¼ etc.¼ t∩ ß separate¼ dynamicall∙-loadablσ area¼ ì
  165. arσ áals∩ áemployed« á Thσ ne⌠ resul⌠ i≤ átha⌠ áß átypica∞ áZCPR│ ì
  166. CommanΣ áProcesso≥ possesse≤ highl∙ advanceΣ ácommanΣ áprocessinτ ì
  167. function≤ ácompareΣ át∩ áthσ CC╨ o≥ áCOMMAND.COM¼ áwitΦ ámultiplσ 
  168. .paèhierarchie≤ áoµ acquirinτ anΣ executinτ commands«  (reµ pτ á2╡-2╕ ì
  169. oµ ZCP╥ 3.│ User'≤ Guide⌐
  170.  
  171. AlthougΦ thσ codσ sizσ oµ thσ ZCPR│ CommanΣ Processo≥ remain≤ thσ ì
  172. samσ áa≤ thσ CP/═ 2.▓ CCP¼ thσ actua∞ memor∙ usagσ increase≤ áduσ ì
  173. t∩ thσ placemen⌠ oµ thσ formerl∙-interna∞ component≤ int∩ ámemor∙ ì
  174. area≤ áabovσ áthσ áBIOS«  Thσ ne⌠ resul⌠ i≤ ß ádecreasσ áoµ áfreσ ì
  175. memor∙ seeε b∙ applicatioε programs«  Thi≤ i≤ thσ tradσ-ofµ ZCPR│ ì
  176. represents║ ávastl∙ increaseΣ functionalit∙ doe≤ no⌠ comσ áa⌠ án∩ ì
  177. cost« 
  178.  
  179. Echeloε ha≤ certaiε recommendation≤ regardinτ thi≤ memor∙ áusage«  ì
  180. ┴ átypica∞ ZCPR│ implementatioε wil∞ rangσ betweeε 1δ anΣ á5δ áoµ ì
  181. additiona∞ ámemor∙ áusagσ compareΣ t∩ standarΣ CP/═ á2.2« á ┴ á1δ ì
  182. "overheadó áprovide≤ áaε áincompletσ áimplementatioε áoµ áZCPR3'≤ ì
  183. components¼ ábu⌠ áonσ áiε whicΦ thσ use≥ caε áusσ áZCPR│ át∩ áhi≤ ì
  184. advantage╗ ß 5δ "overheadó give≤ ß completσ implementatioε oµ al∞ ì
  185. oµ áZCPR3'≤ components¼ anΣ iε Echelon'≤ opinioε árepresent≤ áthσ ì
  186. bes⌠ átradσ-ofµ oµ freσ memor∙ versu≤ thσ enhanceΣ áfunctionalit∙ ì
  187. tha⌠ ZCPR│ caε offer« 
  188.  
  189. 2.1.2. Environmen⌠ Descriptor
  190.  
  191. Thσ áenvironmen⌠ descripto≥ (shor⌠ form║ ENV⌐ i≤ ß 25╢ bytσ áraφ-ì
  192. residen⌠ datß structurσ whicΦ describe≤ ß giveε compute≥ system'≤ ì
  193. ZCPR│ áimplementatioε áanΣ machinσ environment«  Thσ EN╓ ái≤ áthσ ì
  194. "heartó áoµ ß ZCPR│ installatioε anΣ thσ áapplicatioε áprogramme≥ ì
  195. wh∩ áwishe≤ t∩ takσ advantagσ oµ ZCPR│ shoulΣ ábecomσ áintimatel∙ ì
  196. acquainteΣ witΦ it«  (reµ pτ 245¼ 30░-304¼ ZCPR3: The Manual⌐ 
  197.  
  198. Thσ áEN╓ ái≤ aε ingeniou≤ solutioε t∩ thσ probleφ áfaceΣ áb∙ áan∙ ì
  199. transien⌠ prograφ oµ easil∙ locating¼ accessing¼ o≥ ámanipulatinτ ì
  200. ß ádesireΣ áfeaturσ áo≥ áaspec⌠ áoµ áthσ áZCPR│ áenvironment« á ┴ ì
  201. transien⌠ áprograφ neeΣ onl∙ kno≈ thσ locatioε oµ thσ EN╓ anΣ ái⌠ ì
  202. ma∙ determinσ a⌠ runtimσ thσ addres≤ anΣ sizσ oµ an∙ giveε áZCPR│ ì
  203. CommanΣ áProcesso≥ áexterna∞ ácomponent¼ o≥ áacces≤ áan∙ áoµ áthσ ì
  204. extendeΣ environmen⌠ definitioε datß thereiε available« 
  205.  
  206. 2.1.2.1. TCAP
  207.  
  208. ┴ significan⌠ portioε oµ thσ EN╓ (12╕ bytes⌐ i≤ allocateΣ t∩ áthσ ì
  209. Termina∞ áCapabilitie≤ Segment¼ referreΣ t∩ a≤ thσ TCAP«  Onσ áoµ ì
  210. thσ majo≥ shortcoming≤ oµ CP/═ wa≤ tha⌠ i⌠ haΣ n∩ facilitie≤ áfo≥ ì
  211. describinτ áthσ vide∩ characteristic≤ anΣ command≤ oµ thσ áuser'≤ ì
  212. consolσ device«  Becausσ thi≤ informatioε wa≤ no⌠ availablσ áfroφ ì
  213. thσ áoperatinτ ásystem¼ áever∙ ávide∩-orienteΣ áapplicatioε ááwa≤ ì
  214. requireΣ t∩ internall∙ describσ thσ characteristic≤ oµ thσ systeφ ì
  215. console¼ ásucΦ a≤ escapσ sequence≤ fo≥ curso≥ ápositioning¼ áetc«  ì
  216. Obviously¼ ái⌠ i≤ highl∙ redundan⌠ fo≥ ever∙ applicatioε áprograφ ì
  217. t∩ ámaintaiε áthi≤ áinformatioε internally¼ áanΣ áiµ áthσ ásysteφ ì
  218. console'≤ ácharacteristic≤ áeve≥ áchange¼ áthσ áuse≥ ámus⌠ áátheε ì
  219. reconfigurσ eacΦ applicatioε individually« 
  220.  
  221. Thσ áTCA╨ ái≤ ß datß areß whicΦ describe≤ thσ ácontro∞ ásequence≤ ì
  222. needeΣ t∩ bσ sen⌠ t∩ thσ consolσ t∩ perforφ commoε vide∩-orienteΣ ìèoperations« á Thi≤ áinclude≤ ácurso≥ ápositioning¼ áclearinτ áthσ ì
  223. screen¼ clea≥ t∩ enΣ oµ line¼ etc« I⌠ als∩ include≤ thσ characte≥ ì
  224. code≤ áemitteΣ b∙ thσ console'≤ arro≈ key≤ (iµ áavailable)« á Thσ ì
  225. benefi⌠ oµ usinτ thσ TCA╨ i≤ simple║ transien⌠ program≤ neeΣ áno⌠ ì
  226. bσ reconfigureΣ t∩ ruε oε system≤ witΦ differen⌠ vide∩ ácommands«  ì
  227. Echeloε ácall≤ thi≤ concep⌠ "termina∞ independence"¼ anΣ use≤ ái⌠ ì
  228. extensivel∙ iε ou≥ ZCPR│-orienteΣ product≤ t∩ gooΣ advantage« 
  229.  
  230. 2.1.3. Systeφ Segments
  231.  
  232. ┴ áZCPR│ Systeφ Segmen⌠ i≤ ß codσ packagσ o≥ datß filσ whicΦ ácaε ì
  233. bσ loadeΣ usinτ thσ LDR.CO═ utilit∙ int∩ RAM¼ anΣ oncσ s∩ loaded¼ ì
  234. caε ábσ ácalleΣ áupoε b∙ thσ ZCPR│ CommanΣ áProcesso≥ áo≥ áZCPR│-ì
  235. orienteΣ átransien⌠ áprogram≤ t∩ perforφ ß áfunctioε áo≥ áprovidσ ì
  236. information« 
  237.  
  238. Previousl∙ ámentioneΣ werσ thσ EN╓ anΣ TCAP¼ eacΦ oµ whicΦ ái≤ áß ì
  239. Systeφ áSegment« Wσ wil∞ introducσ thσ remaininτ type≤ here¼ áanΣ ì
  240. givσ aε overvie≈ oµ wha⌠ functioε eacΦ performs« 
  241.  
  242. 2.1.3.1. Residen⌠ CommanΣ Package
  243.  
  244. Thσ áResiden⌠ CommanΣ Packagσ (RCP⌐ i≤ ß direc⌠ extensioε oµ áthσ ì
  245. ZCPR│ áCommanΣ áProcesso≥ áfunctioε oµ áprovidinτ áresiden⌠ á(no⌠ ì
  246. transient⌐ ácommands¼ áexemplifieΣ witΦ thσ CP/═ áCCP'≤ ácommand≤ ì
  247. DIR¼ ERA¼ REN¼ etc«  Thσ basiπ ideß i≤ t∩ removσ thesσ áfunction≤ ì
  248. froφ áthσ commanΣ processo≥ t∩ increasσ thσ codσ spacσ áavailablσ ì
  249. withiε áthσ á2δ álimi⌠ oµ thσ commanΣ processo≥ át∩ ábσ áuseΣ áb∙ ì
  250. commanΣ áprocessinτ functions«  Anothe≥ benefi⌠ oµ ámakinτ áthesσ ì
  251. noε-transien⌠ ácommand≤ áß separatσ entit∙ i≤ tha⌠ áthe∙ áma∙ ábσ ì
  252. changeΣ oε-thσ-fl∙ o≥ eliminateΣ iµ desired« 
  253.  
  254. Iµ aε RC╨ i≤ presen⌠ iε ß giveε ZCPR│ installation¼ i⌠ i≤ usuall∙ ì
  255. 2δ-byte≤ iε size¼ althougΦ thi≤ caε var∙ anΣ i≤ exactl∙ describeΣ ì
  256. iε thσ ENV«  Typica∞ command≤ availablσ arσ ERA¼ REN¼ TYPE¼ PEEK¼ ì
  257. POKE¼ áPORT¼ áCP¼ áanΣ áLIST¼ áalthougΦ áman∙ ácombination≤ ááarσ ì
  258. possible« 
  259.  
  260. Reµ page≤ 1▓-13¼ 191¼ 29▒-29╢ oµ ZCPR3: The ManualÖ 
  261.  
  262. 2.1.3.2. Flo≈ CommanΣ Package
  263.  
  264. Thσ Flo≈ CommanΣ Packagσ (FCP⌐ i≤ simila≥ iε man∙ respect≤ t∩ thσ ì
  265. RCP«  Likσ thσ RCP¼ thσ FC╨ i≤ bes⌠ vieweΣ a≤ aε extensioε oµ thσ ì
  266. ZCPR│ ááCommanΣ áProcesso≥ áintrinsiπ áá(noε-transient⌐ áácommanΣ ì
  267. functions« á However¼ áthσ FC╨ provide≤ thσ specia∞ áfunctioε áoµ ì
  268. conditiona∞ átestinτ a⌠ thσ operatinτ-systeφ-commanΣ álevel¼ áeg¼ ì
  269. IF¼ AND¼ OR¼ ELSE¼ etc«  Thi≤ functioε enable≤ ß ZCPR│ systeφ át∩ ì
  270. bσ ááver∙ áintelligen⌠ ádurinτ áan∙ átypσ áoµ ábatcΦ áo≥ ááscrip⌠ ì
  271. processing« 
  272.  
  273. Aε áinterestinτ ásidσ ánotσ oε thσ FC╨ i≤ tha⌠ ái⌠ ái≤ áspeciall∙ ì
  274. supplementeΣ áwitΦ ß transien⌠ program«  Becausσ thσ áactua∞ áFC╨ ì
  275. spacσ áiε áRA═ i≤ typicall∙ onl∙ 51▓ bytes¼ áthσ ámorσ áelaboratσ ì
  276. conditiona∞ áátestinτ áfunction≤ áarσ áplaceΣ áiε áthi≤ ááspecia∞ ìètransient¼ whicΦ i≤ automaticall∙ loadeΣ anΣ executeΣ b∙ thσ áFC╨ ì
  277. a≤ necessary« 
  278.  
  279. 2.1.3.3. Input/Outpu⌠ Package
  280.  
  281. Thσ ááInput/Outpu⌠ ápackagσ á(IOP⌐ áallow≤ áeasil∙ ááredirectablσ ì
  282. characte≥ áI/╧ áusinτ áeithe≥ ácustoφ ádriver≤ áo≥ ááprσ-packageΣ ì
  283. commercia∞ software«  ┴ variet∙ oµ implementation≤ arσ ápossible«  ì
  284. Thσ áIO╨ concep⌠ provide≤ ß solutioε fo≥ ß shortcominτ áoµ áCP/M¼ ì
  285. specificall∙ áß álacδ oµ ß standardizeΣ methoΣ áoµ áintercepting¼ ì
  286. handling¼ anΣ redirectinτ characte≥-orienteΣ I/╧ streams« 
  287.  
  288. Thσ áIO╨ ásolutioε lend≤ itselµ t∩ application≤ ásucΦ áa≤ áremotσ ì
  289. acces≤ ásystems¼ áwherσ specia∞ áhandlinτ áoµ ácharacte≥-orienteΣ ì
  290. peripheral≤ i≤ necessary« 
  291.  
  292. Echeloε ámarket≤ commercia∞ IOP'≤ whicΦ perforφ certaiε ávaluablσ ì
  293. functions¼ a≤ showε below║ 
  294.  
  295. NuKe∙ ¡ ß keyboarΣ redefine≥ whicΦ allow≤ an∙ ke∙ oε thσ keyboarΣ ì
  296. t∩ ábσ redefineΣ int∩ ß desireΣ strinτ oµ characters«  ┴ áspecia∞ ì
  297. featurσ áoµ NuKe∙ i≤ it≤ capabilit∙ oµ applyinτ thσ áredefinitioε ì
  298. functioε át∩ ákey≤ whicΦ emi⌠ multiplσ ácharacter≤ á(eg¼ áspecia∞ ì
  299. editinτ áo≥ functioε keys⌐ a≤ easil∙ a≤ key≤ whicΦ emi⌠ ß ásinglσ ì
  300. character« 
  301.  
  302. Input/Outpu⌠ áRecorde≥ á¡ Allow≤ outpu⌠ t∩ thσ áconsolσ áo≥ ális⌠ ì
  303. devicσ t∩ bσ captureΣ t∩ ß file« 
  304.  
  305. BackgrounΣ Printe≥ ¡ ┴ backgrounΣ prin⌠ spoole≥ whicΦ spool≤ datß ì
  306. froφ ádisδ file≤ t∩ thσ lis⌠ device¼ whilσ permittinτ usσ oµ áthσ ì
  307. compute≥ b∙ thσ user« 
  308.  
  309. 2.1.3.4. NameΣ Director∙ Register
  310.  
  311. Thσ áNameΣ áDirector∙ áRegiste≥ á(NDR⌐ ái≤ áuseΣ áb∙ áZCPR│ ááanΣ ì
  312. compatiblσ áprogram≤ t∩ parsσ anΣ resolvσ reference≤ át∩ áZCPR3'≤ ì
  313. NameΣ áDirectories« á ┴ átypica∞ ND╥ i≤ 25╢ byte≤ áiε ásize¼ áanΣ ì
  314. permit≤ á1┤ ánameΣ ádirectorie≤ át∩ ábσ áactivσ áásimultaneously«  ì
  315. However¼ variation≤ arσ commonplace« 
  316.  
  317. ┴ director∙ namσ unde≥ ZCPR│ i≤ bes⌠ though⌠ oµ a≤ ß synonyφ áfo≥ ì
  318. ß disk/use≥ area« 
  319.  
  320. Thσ áfunctioε áoµ ánameΣ directorie≤ i≤ t∩ ágivσ áthσ áuse≥ ámorσ ì
  321. meaningfu∞ way≤ oµ referrinτ t∩ area≤ oµ hi≤ filσ storagσ system«  ì
  322. Thσ techniquσ useΣ i≤ "flat"¼ eg¼ noε-hierarchical« 
  323.  
  324. Iε áterminology¼ thσ ZCPR│ NameΣ Director∙ functioε i≤ áindicateΣ ì
  325. b∙ áthσ symbolog∙ "DIR:"¼ anΣ thσ alternativσ oµ áspecifyinτ áthσ ì
  326. explici⌠ disδ anΣ use≥ areß i≤ symbolizeΣ b∙ "DU:"« 
  327. .paè2.1.4. Buffer≤ anΣ Worδ Areas
  328.  
  329. A≤ stateΣ previously¼ ß variet∙ oµ component≤ previousl∙ interna∞ ì
  330. t∩ áthσ CP/═ CC╨ arσ madσ externa∞ iε ß ZCPR│ installation« á Thσ ì
  331. ZCPR│ CommanΣ Processo≥ anΣ compatiblσ utilitie≤ caε refe≥ t∩ anΣ ì
  332. manipulatσ thesσ area≤ t∩ initiatσ ne≈ processe≤ o≥ terminatσ olΣ ì
  333. ones¼ o≥ determinσ statu≤ information« 
  334.  
  335. Therσ arσ man∙ buffer≤ anΣ worδ areas¼ to∩ man∙ t∩ bσ covereΣ áiε ì
  336. thi≤ áovervie≈ document«  However¼ threσ tha⌠ arσ ver∙ usefu∞ át∩ ì
  337. thσ application≤ programme≥ arσ thσ Multiplσ CommanΣ Linσ Buffer¼ ì
  338. thσ Shel∞ Stack¼ anΣ thσ CommanΣ SearcΦ Path« 
  339.  
  340. 2.1.4.1. Multiplσ CommanΣ Linσ Buffer
  341.  
  342. Thσ áMultiplσ CommanΣ Linσ Buffe≥ i≤ thσ sourcσ fo≥ al∞ ácommand≤ ì
  343. executeΣ áb∙ áthσ ZCPR│ CommanΣ áProcessor« á Application≤ áwhicΦ ì
  344. desirσ t∩ issuσ operatinτ-systeφ-leve∞ command≤ caε d∩ s∩ áeasil∙ ì
  345. b∙ ásimpl∙ áplacinτ thσ desireΣ commanΣ iε thσ buffer¼ áanΣ áwarφ ì
  346. booting« á I⌠ áshoulΣ ábσ understooΣ tha⌠ therσ áma∙ áalread∙ ábσ ì
  347. command≤ ápendinτ iε thσ buffer¼ s∩ thσ applicatioε shoulΣ áchecδ ì
  348. fo≥ thi≤ situatioε anΣ iµ i⌠ applie≤ shoulΣ preservσ thσ ápendinτ ì
  349. commands« á Thσ applicatioε programme≥ ma∙ desirσ hi≤ prograφ át∩ ì
  350. bσ automaticall∙ rσ-invoked╗ thi≤ i≤ oµ coursσ possiblσ b∙ simpl∙ ì
  351. appendinτ áthσ áthσ commanΣ witΦ thσ ástrinτ á";progname"¼ áwherσ ì
  352. prognamσ ái≤ áthσ namσ oµ thσ desireΣ .CO═ filσ át∩ ábσ áinvoked«  ì
  353. However¼ áß bette≥ solutioε t∩ thi≤ questioε i≤ thσ Shel∞ áStack¼ ì
  354. describeΣ below« 
  355.  
  356. 2.1.4.2. Shel∞ Stack
  357.  
  358. Thσ áShel∞ áStacδ ái≤ ádesigneΣ t∩ copσ áwitΦ áthσ ásituatioε áoµ ì
  359. multiplσ program≤ whicΦ al∞ wisΦ t∩ bσ automaticall∙ árσ-invoked«  ì
  360. Fo≥ example¼ thσ Echeloε utilitie≤ MENU¼ VMEN╒ (Vide∩ Menu)¼ áHS╚ ì
  361. (Historica∞ ááShell⌐ ááarσ áal∞ áprogram≤ áwhicΦ ááneeΣ áát∩ áábσ ì
  362. automaticall∙ árσ-invokeΣ afte≥ generatinτ systeφ ácommands« á Iµ ì
  363. thσ áShel∞ áStacδ werσ no⌠ present¼ thesσ program≤ coulΣ áno⌠ ábσ ì
  364. useΣ átogethe≥ áiε an∙ predictablσ fashion¼ a≤ "nestingó áoµ áthσ ì
  365. sequencσ oµ rσ-invocatioε woulΣ no⌠ bσ possible« 
  366.  
  367. Wσ ácal∞ program≤ oµ thi≤ naturσ "shellsó (deriveΣ froφ thσ áUni° ì
  368. meaninτ áoµ áthσ áword)« á Thσ Shel∞ Stacδ ái≤ áß átypica∞ ástacδ ì
  369. structurσ á(eg¼ LIFO)¼ whicΦ contain≤ thσ name≤ oµ thσ ácurrentl∙ ì
  370. activσ shells«  Thσ ZCPR│ CommanΣ Processo≥ wil∞ ruε thσ ácommanΣ ì
  371. oε áto≡ oµ thσ Shel∞ Stacδ wheε thσ Multiplσ CommanΣ Linσ áBuffe≥ ì
  372. i≤ empty«  Thus¼ ß shel∞ prograφ ma∙ placσ aε entr∙ iε thσ áshel∞ ì
  373. stack¼ ágeneratσ thσ desireΣ operatinτ-systeφ-leve∞ command≤ á(b∙ ì
  374. placinτ theφ iε thσ Multiplσ CommanΣ Linσ Buffer)¼ havσ thσ ZCPR│ ì
  375. CommanΣ ááProcesso≥ ááexecutσ áthσ ádesireΣ ácommands¼ ááanΣ áábσ ì
  376. automaticall∙ rσ-invokeΣ wheε commanΣ processinτ i≤ completed« 
  377.  
  378. Becausσ áoµ áthσ ástacδ nature¼ iµ thσ firs⌠ áshel∞ ágenerate≤ áß ì
  379. commanΣ áwhicΦ áactivate≤ ß seconΣ shell¼ thσ áfirs⌠ áshel∞ áwil∞ ì
  380. remaiε suspendeΣ unti∞ thσ seconΣ shel∞ i≤ terminated«  Meanwhilσ 
  381. .paèthσ áseconΣ áshel∞ caε perforφ al∞ norma∞ shel∞ áfunctions¼ áeveε ì
  382. invokinτ ß thirΣ shell¼ etc« 
  383.  
  384. (Seσ Echeloε Applicatioε Notσ #1¼ ZCPR│ Shells¼ anΣ reµ pg≤ á13│-ì
  385. 14╖ anΣ 22╡-22╢ ZCPR3║ Thσ Manual⌐ 
  386.  
  387. 2.1.4.3. CommanΣ SearcΦ Path
  388.  
  389. Iε thσ proces≤ oµ attemptinτ t∩ resolvσ command≤ generateΣ iε thσ ì
  390. system¼ áthσ ZCPR│ CommanΣ Processo≥ consult≤ thσ CommanΣ áSearcΦ ì
  391. PatΦ áfo≥ informatioε oε wherσ t∩ searcΦ fo≥ átransien⌠ áprogram≤ ì
  392. (.CO═ áfiles)« á T∩ illustrate¼ comparσ ZCPR│ áwitΦ áconventiona∞ ì
  393. CP/═ 2.2¼ a≤ follows« 
  394.  
  395. Thσ áCP/═ áCCP¼ áwheε searchinτ fo≥ ß á.CO═ áfile¼ áexamine≤ áthσ ì
  396. director∙ áoµ file≤ iε thσ currentl∙ loggeΣ disδ anΣ áuse≥ áarea«  ì
  397. Iµ thσ desireΣ filσ i≤ no⌠ found¼ thσ commanΣ i≤ aborted« á Late≥ ì
  398. version≤ áoµ CP/M¼ sucΦ a≤ CP/═ 3¼ wil∞ additionall∙ searcΦ áuse≥ ì
  399. areß zer∩ oµ thσ currentl∙ loggeΣ drive« 
  400.  
  401. ZCPR│ allow≤ thσ use≥ t∩ specif∙ wha⌠ disks/use≥ area≤ arσ t∩ ábσ ì
  402. searcheΣ áfo≥ áinvokeΣ programs«  Thus¼ insteaΣ oµ havinτ án∩ áo≥ ì
  403. ver∙ littlσ contro∞ (a≤ i≤ thσ casσ witΦ CP/M)¼ thσ use≥ i≤ áfreσ ì
  404. t∩ áorganizσ hi≤ systeφ iε ß manne≥ mos⌠ convenien⌠ t∩ áhim« á Hσ ì
  405. ma∙ áspecif∙ ß PatΦ sucΦ a≤ "A0║ M15║ B3:ó anΣ thσ ZCPR│ áCommanΣ ì
  406. Processo≥ wil∞ searcΦ thesσ area≤ oµ hi≤ systeφ wheε lookinτ áfo≥ ì
  407. CO═ files«  Thi≤ specificatioε i≤ thσ "CommanΣ SearcΦ Path"« 
  408.  
  409. ┴ átypica∞ ZCPR│ implementatioε possesse≤ ß CommanΣ áSearcΦ áPatΦ ì
  410. whicΦ contain≤ u≡-t∩-╡ entries¼ bu⌠ thσ actua∞ lengtΦ oµ thσ patΦ ì
  411. i≤ ádynamicall∙ changeable« EacΦ entr∙ i≤ ß disk/use≥ t∩ ásearch¼ ì
  412. witΦ tw∩ byte≤ pe≥ entry« 
  413.  
  414. Thσ áPatΦ ái≤ áuseΣ áals∩ áb∙ áZCPR│-compatiblσ átransient≤ áwheε ì
  415. searchinτ fo≥ datß anΣ accessor∙ files¼ eg¼ thσ HELP.CO═ áprograφ ì
  416. searche≤ áthσ PatΦ fo≥ invokeΣ *.HL╨ files« á Echeloε árecommend≤ ì
  417. tha⌠ áaε applicatioε tha⌠ take≤ advantagσ oµ ZCPR│ áals∩ áutilizσ ì
  418. thσ PatΦ function¼ iµ applicable« 
  419.  
  420. 2.2. Structures
  421.  
  422. Iε áthi≤ ásubsectioε wσ wil∞ documen⌠ thσ áprecisσ ástructurσ áoµ ì
  423. variou≤ component≤ oµ thσ ZCPR│ environment¼ primaril∙ t∩ ágathe≥ ì
  424. thi≤ áinformatioε áint∩ áß ásinglσ ádocument¼ áanΣ áprovidσ ááthσ ì
  425. interesteΣ application≤ programme≥ conveniencσ wheε referrinτ át∩ ì
  426. thi≤ information« 
  427.  
  428. Thσ áarσ áman∙ ádifferen⌠ structure≤ whicΦ arσ par⌠ áoµ áß áZCPR│ ì
  429. installation« áThi≤ subsectioε wil∞ documen⌠ thσ one≤ ádeemeΣ áoµ ì
  430. majo≥ áimportance« á Iµ yo⌡ neeΣ informatioε oε ß ástructurσ áno⌠ ì
  431. covereΣ herein¼ thσ bes⌠ sourcσ oµ informatioε i≤ thσ sourcσ codσ ì
  432. t∩ thσ ZCPR│ CommanΣ Processor¼ anΣ thσ sourcσ codσ t∩ thσ áZ3LI┬ ì
  433. anΣ VLI┬ codσ libraries« 
  434. .paèThσ structure≤ illustrateΣ hereiε arσ donσ s∩ usinτ Z8░ assemble≥ ì
  435. sourcσ notation« 
  436.  
  437. Fo≥ ááaε áexamplσ áoµ áthσ ámemor∙ áma≡ áoµ áß áápossiblσ ááZCPR│ ì
  438. installation¼ árefe≥ t∩ thσ samplσ Z3BASE.LI┬ filσ listinτ oε ápτ ì
  439. 24╖ oµ ZCPR3: The Manual« 
  440.  
  441. 2.2.1. Environmen⌠ Descriptor
  442.  
  443. (reµ pτ 30░-303¼ ZCPR3: The Manual⌐ 
  444.  
  445. Thσ áEN╓ segment¼ a≤ mentioneΣ previously¼ actuall∙ include≤ áthσ ì
  446. ZCPR│ TCA╨ (termina∞ capabilities⌐ segmen⌠ iε additioε t∩ wha⌠ i≤ ì
  447. considereΣ thσ environmen⌠ descriptor«  Thσ TCA╨ i≤ discusseΣ áiε ì
  448. detai∞ iε thσ followinτ section« 
  449.  
  450. Ever∙ áZCPR│-compatiblσ áprograφ ácarrie≤ ß pointe≥ át∩ áthσ áEN╓ ì
  451. segment¼ áwhicΦ áallow≤ i⌠ t∩ finΣ thσ othe≥ ácomponent≤ áoµ áthσ ì
  452. ZCPR│ implementatioε iε ß standardizeΣ fashion« 
  453.  
  454. .po 0
  455. .rm 79
  456. .bpoff
  457. ENV: 
  458.         jp      0               ; in case someone jumps here by accident 
  459.         db      'Z3ENV'         ; signature string 
  460.         db      1               ; 1 = external ENV, 2 = internal ENV 
  461. ENV+9: 
  462.         dw      expath          ; address of PATH 
  463.         db      expaths         ; size of path in entries (2-byte elements) 
  464. ENV+0Ch: 
  465.         dw      rcp             ; address of RCP 
  466.         db      rcps            ; size of RCP in 128-byte blocks 
  467. ENV+0Fh: 
  468.         dw      iop             ; address of IOP 
  469.         db      iops            ; size of IOP in 128-byte blocks 
  470. ENV+12h: 
  471.         dw      fcp             ; address of FCP 
  472.         db      fcps            ; size of FCP in 128-byte blocks 
  473. ENV+15h: 
  474.         dw      z3ndir          ; address of NDR 
  475.         db      z3ndirs         ; # of entries (18 bytes each) in NDR 
  476. ENV+18h: 
  477.         dw      z3cl            ; address of multiple command line buffer 
  478.         db      z3cls           ; size of buffer in bytes 
  479. ENV+1Bh: 
  480.         dw      z3env           ; address of ENV 
  481.         db      z3envs          ; size of ENV in 128-byte blocks 
  482. ENV+1Eh: 
  483.         dw      shstk           ; address of Shell Stack 
  484.         db      shstks          ; number of entries 
  485.         db      shsize          ; size of each entry in bytes 
  486. ENV+22h: 
  487.         dw      z3msg           ; address of Message Buffer 
  488. ENV+24h: 
  489.         dw      extfcb          ; address of external 36-byte FCB 
  490. ENV+26h: 
  491.         dw      extstk          ; address of External Stack (always 48 bytes) èENV+28h: 
  492.         db      0               ; quiet flag (0 = not quiet, 1 = quiet) 
  493. ENV+29h: 
  494.         dw      z3whl           ; address of WHEEL byte 
  495. ENV+2Bh: 
  496.         db      speed           ; Processor speed in MHz 
  497. ENV+2Ch: 
  498.         db      'D'-'@'         ; maximum disk 
  499.         db      31              ; maximum user 
  500. ENV+2Eh: 
  501.         db      1               ; DUOK flag: 1 = OK to accept DU: 
  502. ENV+2Fh: 
  503.         db      0               ; CRT selection flag (0 or 1) 
  504.         db      0               ; Printer selection flag (0 or 1) 
  505. ENV+31h: 
  506.         db      80              ; width of CRT 0 
  507.         db      24              ; height of CRT 0 
  508.         db      22              ; number of lines of text to display on CRT 0 
  509. ENV+34h: 
  510.         db      132             ; width of CRT 1 
  511.         db      24              ; height of CRT 1 
  512.         db      22              ; number of lines of text to display on CRT 1 
  513. ENV+37h: 
  514.         db      80              ; width of Printer 0 
  515.         db      66              ; height of Printer 0 
  516.         db      58              ; number of lines of text on Printer 0 
  517.         db      1               ; formfeed flag (0=can't formfeed, 1=can) 
  518. ENV+3Bh: 
  519.         db      102             ; width of Printer 1 
  520.         db      66              ; height 
  521.         db      58              ; lines of text 
  522.         db      1               ; formfeed flag 
  523. ENV+7Eh: 
  524.         db      pubdrive        ; drive component of ZRDOS PUBLIC declaration 
  525. ENV+7Fh: 
  526.         db      pubuser         ; user component of ZRDOS PUBLIC declaration 
  527.  
  528. .rm 65
  529. .bpon
  530. .po 8
  531. 2.2.2. TCAP
  532.  
  533. Thσ áTermina∞ áCapabilitie≤ Segmen⌠ (TCAP⌐ oµ ZCPR│ ái≤ áß ámajo≥ ì
  534. asse⌠ át∩ áthσ áoperatioε áoµ áZCPR3« á Thi≤ ástructurσ áuse≤ ááß ì
  535. combinatioε áoµ áfixeΣ-lengtΦ áanΣ ávariablσ álengtΦ áfield≤ áát∩ ì
  536. describσ ke∙ vide∩ termina∞ characteristics« 
  537.  
  538. Thσ áTCA╨ ái≤ áalway≤ locateΣ 12╕ ábyte≤ áabovσ áthσ áEnvironmen⌠ ì
  539. Descriptor« á I⌠ áma∙ bσ loadeΣ independentl∙ usinτ áthσ áLDR.CO═ ì
  540. utility« 
  541.  
  542. Dozen≤ áoµ áprogram≤ árefe≥ át∩ áthσ áTCA╨ áfo≥ áeas∙ á"termina∞-ì
  543. independentó áoperation╗ ásevera∞ program≤ anΣ áß ádatabasσ áals∩ ì
  544. manipulatσ thσ TCAP«  Examples║ TCSELEC╘ anΣ thσ associateΣ áTCA╨ ì
  545. databasσ áZ3TCAP.TC╨ á(whicΦ ácontain≤ ove≥ 7░ áTCAP≤ áwhicΦ áarσ ì
  546. selecteΣ viß TCSELECT)¼ TCMAKE¼ etc« 
  547. .paèFo≥ codσ sample≤ showinτ ho≈ thesσ field≤ arσ accesseΣ anΣ áused¼ ì
  548. seσ thσ sourcσ codσ thσ thσ VLI┬ subroutinσ library«  Als∩ árefe≥ ì
  549. t∩ ápage≤ á304¼ áanΣ 30╣-32╖ oµ ZCPR│: Thσ ═anualÖ áfo≥ áfurthe≥ ì
  550. information« 
  551.  
  552. .po 0
  553. .rm 79
  554. .bpoff
  555. (f)= fixed length 
  556. (v)= variable length, terminated with binary zero 
  557.  
  558.         db      'Name of Terminal    '  ; 20 characters (f) 
  559.         db      'K'-'@'                 ; Arrow Key UP (f) 
  560.         db      'V'-'@'                 ; Arrow Key DOWN (f) 
  561.         db      'L'-'@'                 ; Arrow Key RIGHT (f) 
  562.         db      'H'-'@'                 ; Arrow Key LEFT (f) 
  563.         db      0                       ; Clear Screen Delay (ms) (f) 
  564.         db      0                       ; Cursor Addressing Delay (ms) (f) 
  565.         db      0                       ; Clear-To-End-Of-Line Delay (ms) (f) 
  566.         db      esc,'*',0               ; Clear Screen String (v) 
  567.         db      esc,'=%+ %+ ',0         ; Cursor Addressing String (v) 
  568.  
  569. .bpon
  570. (Seσ pagσ 31│ oµ ZCPR3: The ManualÖ fo≥ ß discussioε oµ thσ curso≥ addressinτ ì
  571. symbology)
  572. .bpoff
  573.  
  574.         db      esc,'t',0               ; Clear-To-End-Of-Line String (v) 
  575.         db      esc,')',0               ; Begin Standout (dim) Mode (v) 
  576.         db      esc,'(',0               ; End Standout (normal) Mode (v) 
  577.         db      0                       ; Terminal Init String (v) 
  578.         db      0                       ; Terminal De-init String (v) 
  579.  
  580. .po 8
  581. .rm 65
  582. .bpon
  583. 2.2.3. CommanΣ SearcΦ Path
  584.  
  585. Thσ CommanΣ SearcΦ PatΦ caε bσ useΣ b∙ application≤ searchinτ fo≥ ì
  586. accessor∙ o≥ datß files¼ fo≥ example¼ prograφ overlays«  Seσ áthσ ì
  587. sourcσ codσ t∩ thσ Z3LI┬ routinσ PFIN─ fo≥ samplσ codσ t∩ álocatσ ì
  588. ß filσ alonτ thσ CommanΣ SearcΦ Path« 
  589.  
  590. (Reµ pτ ╣ oµ ZCPR3: The Manual⌐ 
  591.  
  592. EacΦ áentr∙ i≤ tw∩ byte≤ long«  ┴ terminatinτ entr∙ i≤ ásignifieΣ ì
  593. wheε áthσ disδ bytσ i≤ ß binar∙ zero«  Iµ thσ specia∞ symbo∞ á"$ó ì
  594. appears¼ ái⌠ árefer≤ t∩ eithe≥ thσ defaul⌠ disδ o≥ ádefaul⌠ áuse≥ ì
  595. area¼ a≤ appropriate« 
  596.  
  597. .bpoff
  598. path:
  599.         db      'A'-'@',0       ; Drive A, user 0 (A0:) 
  600.         db      'A'-'@',0       ; Drive A, User 15 (A15:) 
  601.         db      'C'-'@',3       ; Drive C, User 3 (C3:) 
  602.         db      0               ; end of Path 
  603. .bpon
  604.  
  605. 2.2.4. NameΣ Director∙ Register
  606.  
  607. Thσ NameΣ Director∙ Registe≥ (NDR⌐ allow≤ meaningfu∞ name≤ t∩ ábσ ì
  608. associateΣ witΦ specifiπ disk/use≥ areas«  EacΦ namσ ma∙ bσ áfroφ ì
  609. onσ át∩ eigh⌠ characters¼ anΣ aε u≡-t∩-eigh⌠ ácharacte≥ ápassworΣ ì
  610. ma∙ ábσ áassociateΣ áwitΦ ß giveε name«  Refe≥ t∩ ápage≤ á╖-╣ áoµ ì
  611. ZCPR3║ Thσ Manual« è.pa
  612. Thσ ásizσ oµ thσ NameΣ Director∙ Registe≥ caε var∙ ásignificantl∙ ì
  613. froφ ásysteφ t∩ system«  A≤ always¼ aε applicatioε shoulΣ áalway≤ ì
  614. examinσ áthσ Environmen⌠ Descripto≥ oµ thσ machinσ áfo≥ áaccuratσ ì
  615. sizσ information« 
  616.  
  617. ┴ áquestioε átha⌠ áarise≤ wheε therσ arσ tw∩ ádifferen⌠ áway≤ áoµ ì
  618. referrinτ t∩ ß director∙ (iε thi≤ case¼ eithe≥ thσ director∙ namσ ì
  619. o≥ thσ DU:⌐ i≤ whicΦ referencσ methoΣ ha≤ priority«  Fo≥ example¼ ì
  620. ß director∙ namσ oµ "C:ó ma∙ bσ resolveΣ onσ wa∙ iµ DU║ áscanninτ ì
  621. occur≤ first¼ anΣ anothe≥ wa∙ iµ DIR║ scanninτ take≤ placσ áfirs⌠ ì
  622. (anΣ therσ i≤ ß NameΣ Director∙ witΦ ß matchinτ name)«  Echelon'≤ ì
  623. officia∞ distributioε ZCPR│ alway≤ scan≤ thσ DIR║ forφ first¼ át∩ ì
  624. preven⌠ áthσ ásituatioε oµ thσ use≥ defininτ áß ánameΣ ádirector∙ ì
  625. whicΦ i≤ no⌠ accessible« 
  626.  
  627. Password≤ ácaε bσ associateΣ witΦ ß giveε nameΣ directory« á Thi≤ ì
  628. passworΣ ái≤ onl∙ oµ significancσ iµ ß referencσ i≤ madσ t∩ átha⌠ ì
  629. director∙ áviß thσ DIR║ form¼ anΣ i≤ unapplicablσ át∩ áreference≤ ì
  630. usinτ thσ DU║ form«  Thus¼ iµ thσ DU║ forφ i≤ allowed¼ ápassword≤ ì
  631. arσ ábypassed« á Thi≤ ái≤ áthσ áreasoε áfo≥ áthσ áfielΣ áoµ ááthσ ì
  632. Environmen⌠ Descripto≥ labeleΣ thσ "DUO╦ flag"«  Wheε ß securit∙-ì
  633. orienteΣ ásysteφ i≤ implemented¼ thσ systeφ implemento≥ wil∞ áse⌠ ì
  634. thσ áDUO╦ áflaτ t∩ indicatσ tha⌠ program≤ shoulΣ no⌠ áaccep⌠ áDU║ ì
  635. references╗ áthi≤ áforce≤ thσ use≥ t∩ usσ onl∙ áDIR║ áforms¼ áanΣ ì
  636. thereforσ password≤ canno⌠ bσ bypassed« 
  637.  
  638. Echeloε recommend≤ tha⌠ application≤ conforφ t∩ thi≤ respec⌠ áfo≥ ì
  639. thσ securit∙ oµ directories¼ a≤ otherwisσ you≥ applicatioε ma∙ bσ ì
  640. unsuitablσ fo≥ securσ systeφ usage« 
  641.  
  642. EacΦ áentr∙ áiε thσ ND╥ i≤ 1╕ byte≤ long«  Thσ áfirs⌠ átw∩ ábyte≤ ì
  643. indicatσ áthσ disk/use≥ thi≤ entr∙ i≤ t∩ bσ associateΣ áwith╗ áiµ ì
  644. thσ ádisδ ábytσ ái≤ zero¼ thi≤ indicate≤ thσ áenΣ áoµ áthσ álist«  ì
  645. Followinτ thσ firs⌠ tw∩ byte≤ arσ ╕ character≤ oµ uppercasσ átex⌠ ì
  646. whicΦ denotσ thσ actua∞ namσ beinτ defined«  Followinτ thi≤ i≤ aε ì
  647. additiona∞ eigh⌠ bytσ fielΣ whicΦ ma∙ contaiε ß password« 
  648.  
  649. .bpoff
  650. .po 0
  651. .rm 79
  652. z3ndir:
  653.         db      'A'-'@',0       ; DU: associated with this entry (A0:) 
  654.         db      'ROOT    '      ; Name declared by this entry 
  655.         db      '        '      ; Password field (blanks=no password) 
  656.  
  657.         db      'B'-'@',0       ; DU: associated with this entry (B0:) 
  658.         db      'WORK    '      ; Name declared by this entry 
  659.         db      'XYZZY   '      ; password 
  660.  
  661.         db      0               ; End of NDR 
  662. .bpon
  663. .po 8
  664. .rm 65
  665.  
  666. 2.2.5. Multiplσ CommanΣ Linσ Buffer
  667.  
  668. Thσ áZCPR│ Multiplσ CommanΣ Linσ Buffe≥ i≤ useΣ b∙ ß ávariet∙ áoµ ì
  669. ZCPR│ tools« Iµ yo⌡ wisΦ t∩ utilizσ it¼ yo⌡ shoulΣ bσ awarσ átha⌠ ì
  670. i⌠ i≤ possiblσ tha⌠ pendinτ command≤ ma∙ stil∞ bσ residen⌠ withiε ì
  671. thσ ábuffer¼ áanΣ ápreservσ átheφ áiµ áso« á Also¼ áthσ ácommanΣ-ì
  672. generatioε áproces≤ áshoulΣ átakσ int∩ áaccoun⌠ áthσ ápossibilit∙ ìègenerateΣ ácommanΣ plu≤ pendinτ command≤ ma∙ bσ to∩ largσ t∩ áfi⌠ ì
  673. int∩ thσ buffer« 
  674.  
  675. Thσ ásizσ oµ thσ buffe≥ oε mus⌠ ZCPR│ system≤ i≤ 20░ ábytes¼ ábu⌠ ì
  676. thi≤ ácaε ávary« Refe≥ t∩ thσ Environmen⌠ áDescripto≥ át∩ áobtaiε ì
  677. accuratσ information« 
  678.  
  679. ┴ ágooΣ examplσ oµ sourcσ codσ fo≥ handlinτ thσ multiplσ ácommanΣ ì
  680. linσ ábuffe≥ ái≤ ágiveε áiε Z3LIB'≤ áGETCL1¼ áGETCL2¼ áanΣ áPUTC╠ ì
  681. routines« 
  682.  
  683. Thσ áusua∞ ámultiplσ ácommanΣ delimite≥ ái≤ áthσ ásemicoloε á(;)«  ì
  684. Leadinτ áspace≤ áiε áindividua∞ ácommand≤ ácaε ábσ áásignificant¼ ì
  685. especiall∙ unde≥ ZCP╥ 3.3«   
  686.  
  687. .bpoff
  688. .po 0
  689. .rm 79
  690. Z3CL: 
  691.      dw      nxtcmd        ; address of next command in buffer 
  692.      db      z3cls         ; size of command line buffer in bytes 
  693.      dΓ      dumm∙         ╗ dumm∙ bytσ se⌠ durinτ BDO╙ "ReaΣ Consolσ Bufferó
  694.                            ╗ Functioε 
  695. nxtcmd:                    ; this varies depending on command execution 
  696.      db      'DIR;WS TEXT1'; Uppercase string of commands 
  697.      db      0             ; terminating binary zero 
  698.  
  699. .bpon
  700. .po 8
  701. .rm 65
  702. 2.2.6. Shel∞ Stack
  703.  
  704. Thσ áShel∞ áStacδ ái≤ áuseΣ t∩ áassurσ ápredictablσ áfunctioε áoµ ì
  705. multiplσ shel∞ program≤ ¡ program≤ tha⌠ arσ designeΣ t∩ ágeneratσ ì
  706. operatinτ-systeφ-leve∞ ácommand≤ anΣ bσ automaticall∙ árσ-invokeΣ ì
  707. wheε executioε oµ thosσ command≤ i≤ complete« 
  708.  
  709. A≤ it≤ namσ implies¼ thσ Shel∞ Stacδ i≤ ß standarΣ Las⌠-Iε-Firs⌠-ì
  710. Ou⌠ stack« Thσ programme≥ shoulΣ bσ awarσ tha⌠ i⌠ i≤ possiblσ át∩ ì
  711. overflo≈ áthσ ástack¼ anΣ thi≤ shoulΣ bσ aε áerro≥ áconditioε át∩ ì
  712. checδ for« 
  713.  
  714. EacΦ áentr∙ iε thσ Shel∞ Stacδ i≤ ß u≡-t∩-3▓-bytσ (usually⌐ átex⌠ ì
  715. strinτ áwhicΦ ái≤ essentiall∙ ß commanΣ t∩ reinvokσ áthσ ádesireΣ ì
  716. program¼ plu≤ an∙ desireΣ trailinτ commanΣ linσ parameters« á Thσ ì
  717. arσ áátypicall∙ áá┤ ásucΦ áentrie≤ áavailablσ áiε ááthσ áádefaul⌠ ì
  718. configuratioε áoµ áZCPR│ recommendeΣ b∙ Echelon¼ bu⌠ áthσ áactua∞ ì
  719. numbe≥ ái≤ declareΣ iε thσ system'≤ Environmen⌠ Descriptor« á Thσ ì
  720. topmos⌠ áentr∙ áiε thσ stacδ wil∞ bσ executeΣ wheε therσ áarσ án∩ ì
  721. pendinτ command≤ iε thσ Multiplσ CommanΣ Linσ Buffer« 
  722.  
  723. Seσ áthσ ásectioε áoµ thi≤ documen⌠ átitleΣ á"Usinτ áZCPR│ áShel∞ ì
  724. Featuresó fo≥ furthe≥ information¼ a≤ wel∞ a≤ thσ sourcσ codσ fo≥ ì
  725. thσ ááZ3LI┬ ároutine≤ áGETSH1¼ áGETSH2¼ áanΣ áQSHELL¼ ááanΣ ááthσ ì
  726. publicatioε Applicatioε Notσ #▒ ¡ ZCPR│ ShellsÖ.
  727.  
  728. EacΦ áshel∞ ástacδ áentr∙ ái≤ typicall∙ 3▓ ábyte≤ álong¼ áanΣ ái≤ ì
  729. terminateΣ b∙ ß binar∙ zer∩ (whicΦ mus⌠ bσ counteΣ a≤ par⌠ oµ thσ ì
  730. string'≤ length)« 
  731. .paè.bpoff
  732. .po 0
  733. .rm 79
  734. shstk:
  735.         db      'VFILER A15:',0 ; VFILER is on the "top" of the stack 
  736.         ds      20              ; space unused by above entry 
  737.         db      'M15:HSH',0     ; HSH will resume when VFILER terminates 
  738.         ds      24              ; space unused by above entry 
  739.         db      0               ; no entry 
  740.         ds      63              ; unused space 
  741.  
  742. .bpon
  743. .po 8
  744. .rm 65
  745. 2.2.7. ZCPR│ Utilit∙ Header
  746.  
  747. Ever∙ ZCPR│-compatiblσ prograφ need≤ aε eas∙ wa∙ t∩ determinσ thσ ì
  748. addres≤ áoµ thσ Environmen⌠ Descripto≥ s∩ tha⌠ i⌠ ma∙ áacces≤ áo≥ ì
  749. manipulatσ áthσ expandeΣ function≤ offereΣ b∙ ZCPR3« á Thi≤ áeas∙ ì
  750. wa∙ áoµ findinτ thσ Environmen⌠ Descripto≥ i≤ ásupporteΣ áthrougΦ ì
  751. thσ usσ oµ ß standarΣ heade≥ fo≥ transien⌠ programs«  Onσ oµ áthσ ì
  752. element≤ oµ thσ heade≥ i≤ ß pointe≥ t∩ thσ iε-RA═ ENV¼ anΣ i≤ se⌠ ì
  753. eithe≥ áautomaticall∙ wheε thσ prograφ i≤ loadeΣ anΣ executeΣ áb∙ ì
  754. thσ áZCPR│ áCommanΣ áProcesso≥ á(iε thσ casσ áoµ áZCP╥ á3.3)¼ áo≥ ì
  755. manuall∙ áusinτ thσ installatioε too∞ Z3INS.CO═ (iε thσ ácasσ áoµ ì
  756. ZCP╥ á3.0)«  Thi≤ pointe≥ i≤ thσ singlσ linδ tha⌠ áthσ átransien⌠ ì
  757. ha≤ witΦ thσ ZCPR│ environment¼ anΣ obviousl∙ mus⌠ bσ correc⌠ fo≥ ì
  758. thσ ásysteφ átha⌠ ái⌠ i≤ runninτ on¼ áotherwisσ áresult≤ áma∙ ábσ ì
  759. unpredictable« 
  760.  
  761. Iµ you≥ applicatioε i≤ actuall∙ goinτ t∩ bσ directl∙ (a≤ áopposeΣ ì
  762. t∩ álettinτ áthσ ZCPR│ CommanΣ Processo≥ d∩ i⌠ fo≥ áyou⌐ áloadinτ ì
  763. anothe≥ prograφ int∩ thσ TPA¼ i⌠ i≤ recommendeΣ tha⌠ you≥ prograφ ì
  764. scaε áfo≥ áthσ standarΣ header¼ anΣ iµ onσ i≤ found¼ áensurσ áthσ ì
  765. pointe≥ át∩ áthσ áEnvironmen⌠ áDescripto≥ ácontaineΣ áthereiε ái≤ ì
  766. accurate« 
  767.  
  768. I⌠ ái≤ áals∩ áthougΦ thσ usσ oµ thσ ástandarΣ áheade≥ átha⌠ áyou≥ ì
  769. prograφ ácaε automaticall∙ determinσ whethe≥ i⌠ i≤ runninτ áiε áß ì
  770. ZCPR│ ásystem«  Seσ thσ subsectioε titleΣ "Programminτ áExamplesó ì
  771. fo≥ thσ detail≤ oµ ho≈ thi≤ i≤ done« 
  772.  
  773. Refe≥ áát∩ ápagσ á22╣ áoµ áZCPR3║ áThσ áManualÖ ááfo≥ ááadditiona∞ ì
  774. information« 
  775.  
  776. Thσ standarΣ heade≥ fo≥ ß transien⌠ prograφ i≤ expecteΣ t∩ ábegiε ì
  777. a⌠ áaddres≤ á100h«  T∩ determinσ iµ ß giveε .CO═ filσ ái≤ áZCPR│-ì
  778. compatible¼ simpl∙ checδ fo≥ thσ "Z3ENVó string« 
  779.  
  780. .bpoff
  781. .po 8
  782. .rm 79
  783. 100h: 
  784.         jp      start           ; jump over header... 
  785.         db      'Z3ENV'         ; signature string for identification 
  786.         db      1               ; denotes external environment 
  787. z3eadr: 
  788.         dw      z3env           ; pointer to ENV 
  789.         ...                     ; possible other data areas 
  790. start:                          ; the actual code start of your program 
  791.         ...                     ; your code 
  792.  
  793. .bpon
  794. .po 8
  795. .rm 65
  796. .paè2.3. Initialization Environment
  797.  
  798. Thi≤ áásubsectioε ádescribe≤ áwha⌠ ákinΣ áoµ ááenvironmen⌠ ááyou≥ ì
  799. applicatioε ácaε áexpec⌠ wheε i⌠ i≤ loadeΣ anΣ ruε b∙ áthσ áZCPR│ ì
  800. CommanΣ áProcessor«  I⌠ cover≤ thσ variation≤ betweeε áZCPR│ áanΣ ì
  801. CP/═ áregardinτ ádefaul⌠ FC┬ initialization¼ anΣ als∩ áß áfeaturσ ì
  802. uniquσ át∩ áZCPR│ átha⌠ allow≤ yo⌡ t∩ determinσ áwha⌠ ánamσ áyou≥ ì
  803. prograφ wa≤ invokeΣ with« 
  804.  
  805. 2.3.1. Defaul⌠ FCBs
  806.  
  807. Thσ átw∩ ádefaul⌠ FCB≤ (a⌠ 005CΦ anΣ 006Ch⌐ áarσ ástructureΣ áanΣ ì
  808. initializeΣ áb∙ áthσ commanΣ linσ parse≥ interna∞ át∩ áthσ áZCPR│ ì
  809. CommanΣ áProcessor«  Thσ parse≥ scan≤ thσ commanΣ tai∞ passeΣ áb∙ ì
  810. thσ áuser¼ áwhicΦ ma∙ contaiε ß filenamσ referencσ oµ áthσ áform≤ ì
  811. FILENAME.TYP¼ D:FILENAME.TYP¼ U:FILENAME.TYP¼ DU:FILENAME.TYP¼ o≥ ì
  812. DIR:FILENAME.TYP« áá Thσ ááadditiona∞ ádatß áavailablσ áát∩ ááthσ ì
  813. programme≥ áiε thesσ situation≤ i≤ thσ use≥ numbe≥ oµ thσ áparseΣ ì
  814. filename¼ áwhicΦ i≤ alway≤ placeΣ a⌠ FCB+1│ (thσ S▒ byte¼ iε áDR╔ ì
  815. parlance)« á ┴ áprograφ runninτ unde≥ ZCPR│ shoulΣ ápreservσ áthσ ì
  816. content≤ oµ thi≤ bytσ internally¼ anΣ prio≥ t∩ openinτ thσ áfile¼ ì
  817. ensurσ áthσ appropriatσ use≥ numbe≥ i≤ selecteΣ viß DO╙ ácal∞ á3▓ ì
  818. (set/ge⌠ áuser)«  Remember¼ thσ bytσ a⌠ FCB+░ i≤ thσ ádrivσ ábytσ ì
  819. (jus⌠ áa≤ witΦ standarΣ cp/m⌐ anΣ therefore¼ n∩ matte≥ wha⌠ átypσ ì
  820. oµ ádu║ áo≥ ádir║ prefi° wa≤ giveε b∙ thσ use≥ áa≤ ápar⌠ áoµ áthσ ì
  821. commanΣ tail¼ thσ programme≥ caε alway≤ extrac⌠ thσ resolveΣ áDU║ ì
  822. froφ FCB+░ anΣ FCB+1│ respectively«  Iµ thσ parse≥ canno⌠ resolvσ ì
  823. thσ áDU║ o≥ DIR║ specification¼ FCB+░ anΣ FCB+1│ wil∞ bσ áse⌠ át∩ ì
  824. thσ ácurren⌠ "defaultó DU:«  Thi≤ applie≤ t∩ onl∙ thσ áfirs⌠ átw∩ ì
  825. token≤ oµ thσ commanΣ tail╗ an∙ additiona∞ token≤ arσ no⌠ áparseΣ ì
  826. fo≥ FC┬ initialization« 
  827.  
  828. Fo≥ ß sourcσ codσ samplσ oµ thσ algorithφ useΣ t∩ parsσ áfilenamσ ì
  829. specifications¼ seσ thσ Z3LI┬ routinσ ZPRSFN« 
  830.  
  831. 2.3.2. CommanΣ Linσ Tai∞ Text
  832.  
  833. A≤ áwitΦ ácp/m¼ thσ actua∞ tex⌠ oµ thσ commanΣ linσ tai∞ ácaε ábσ ì
  834. founΣ beginninτ a⌠ addres≤ 0080h«  Thσ firs⌠ bytσ i≤ ß ácharacte≥ ì
  835. count¼ followeΣ b∙ thσ text¼ terminateΣ witΦ ß binar∙ zero«  Thi≤ ì
  836. i≤ áwherσ thσ programme≥ ma∙ locatσ token≤ beyonΣ thσ áfirs⌠ áanΣ ì
  837. second¼ o≥ t∩ perforφ hi≤ owε parsinτ iµ s∩ desired« 
  838.  
  839. 2.3.3. What'≤ You≥ Program'≤ Name?
  840.  
  841. Onσ áadditiona∞ áiteφ oµ informatioε whicΦ ma∙ bσ usefu∞ át∩ áthσ ì
  842. programme≥ ái≤ áthσ ádeterminatioε oµ thσ ánamσ áunde≥ áwhicΦ ái≤ ì
  843. prograφ wa≤ invoked«  Becausσ thσ FC┬ buil⌠ anΣ useΣ b∙ thσ ZCPR│ ì
  844. CommanΣ áProcesso≥ áwheε loadinτ thσ prograφ i≤ átypicall∙ áiε áß ì
  845. reserveΣ ámemor∙ áarea¼ áit≤ content≤ arσ áprotecteΣ áfroφ ábeinτ ì
  846. overwritteε b∙ thσ transien⌠ loaΣ operation«  Thσ programme≥ áma∙ ì
  847. determinσ thσ curren⌠ namσ oµ hi≤ prograφ b∙ firs⌠ examininτ áthσ ì
  848. EN╓-residen⌠ pointe≥ t∩ thσ "externa∞ FCBó (founΣ a⌠ ENV+24h)╗ iµ 
  849. .paèthi≤ i≤ nonzero¼ i⌠ hold≤ thσ addres≤ oµ thσ externa∞ FCB¼ áwhicΦ ì
  850. i≤ aε FC┬ containinτ thσ namσ thi≤ prograφ wa≤ invokeΣ with« 
  851.  
  852. Thσ áaddres≤ áoµ áthσ externa∞ FC┬ i≤ founΣ áiε áthσ áEnvironmen⌠ ì
  853. Descriptor« 
  854. .paè3. Usinτ ZCPR│ Shel∞ Features
  855.  
  856. Thi≤ ásubsectioε ádiscusse≤ thσ necessar∙ step≤ fo≥ ámakinτ áyou≥ ì
  857. applicatioε prograφ int∩ ß ZCPR│ Shell«  Thσ advantage≤ oµ áusinτ ì
  858. thσ áZCPR│ Shel∞ Stacδ havσ beeε previousl∙ ádiscussed« á Becausσ ì
  859. thσ internal≤ oµ shel∞ operatioε havσ no⌠ beeε adequatel∙ covereΣ ì
  860. iε áothe≥ Echeloε documentation¼ i⌠ wil∞ bσ discusseΣ áiε ádetai∞ ì
  861. here.
  862.  
  863. Therσ arσ threσ aspect≤ oµ shel∞ operatioε whicΦ arσ necessar∙ iε ì
  864. an∙ áshell¼ áwhicΦ áarσ discusseΣ iε ádetai∞ ábelow« á The∙ áare║ ì
  865. Invocation¼ Generatinτ Commands¼ anΣ Exiting.
  866.  
  867. 3.1. Invocation
  868.  
  869. Invocatioε áoµ ß prograφ witΦ shel∞ characteristic≤ i≤ áthσ ámos⌠ ì
  870. comple° aspec⌠ oµ usinτ shel∞ features.
  871.  
  872. 3.1.1. Ho≈ Wa≤ You≥ Prograφ Invoked?
  873.  
  874. Thσ áfirs⌠ áaspec⌠ oµ shel∞ operatioε i≤ thσ áinvocatioε áoµ áthσ ì
  875. shell¼ wherσ i⌠ i≤ loadeΣ froφ disδ int∩ RAM«  Thi≤ ma∙ occu≥ áiε ì
  876. eithe≥ áoµ tw∩ ways«  Onσ wa∙ tha⌠ thi≤ caε occu≥ i≤ b∙ thσ áuse≥ ì
  877. enterinτ áß ácommanΣ áa⌠ áthσ commanΣ álinσ áwhicΦ áinvokeΣ áthi≤ ì
  878. program« á Thi≤ i≤ referreΣ t∩ iε thσ subsequen⌠ tex⌠ a≤ á"manua∞ ì
  879. invocation"« á Thσ othe≥ wa∙ oµ invocatioε i≤ wheε thσ áshel∞ ái≤ ì
  880. automaticall∙ áinvokeΣ áb∙ áthσ ZCPR│ CommanΣ áProcesso≥ áa≤ áthσ ì
  881. topmos⌠ ááentr∙ áiε áthσ áShel∞ áStack« á Thi≤ ái≤ áreferreΣ áát∩ ì
  882. subsequentl∙ a≤ "shel∞ invocation".
  883.  
  884. I⌠ ái≤ importan⌠ t∩ initiall∙ determinσ whicΦ oµ thesσ tw∩ átype≤ ì
  885. oµ áinvocation≤ átooδ place¼ becausσ iµ thσ áshel∞ áwa≤ ámanuall∙ ì
  886. invokeΣ b∙ thσ user¼ thσ shel∞ mus⌠ instal∞ aε appropriatσ áentr∙ ì
  887. iε thσ Shel∞ Stack.
  888.  
  889. ZCPR│ áprovide≤ ß signa∞ a≤ t∩ whicΦ typσ oµ invocatioε áoccurreΣ ì
  890. witΦ áß áflaτ iε thσ ZCPR│ Messagσ Buffers« á Thσ áZ3LI┬ ároutinσ ì
  891. QSHEL╠ read≤ thi≤ flaτ anΣ return≤ aε appropriatσ resul⌠ (reµ 1╖-ì
  892. 4¼ 1╖-╡ oµ ZCPR3║ Thσ Libraries).
  893.  
  894. 3.1.2. Pausing
  895.  
  896. Iµ you≥ prograφ wa≤ shel∞ invoked¼ onσ decisioε yo⌡ mus⌠ makσ ái≤ ì
  897. whethe≥ áyo⌡ áwisΦ you≥ prograφ t∩ responΣ t∩ ß "pauseó áflaτ áoµ ì
  898. somσ átype« á ┴ pausσ i≤ usuall∙ necessar∙ t∩ allo≈ áthσ áuse≥ áß ì
  899. chancσ át∩ áobservσ thσ result≤ oµ whateve≥ operation≤ áhaΣ ábeeε ì
  900. performeΣ áimmediatel∙ prio≥ t∩ thσ shel∞ invocation«  ┴ flaτ áoµ ì
  901. somσ átypσ wil∞ permi⌠ ß n∩-pausσ modσ oµ operatioε anΣ ápresume≤ ì
  902. thσ áuse≥ ácaε áindicatσ áwheε hσ áwishe≤ át∩ ápausσ áupoε áshel∞ ì
  903. invocatioε anΣ wheε hσ doe≤ not.
  904.  
  905. Somσ áZCPR│ áshell≤ usσ thσ "Shel∞ Messageó byte≤ áoµ áthσ áZCPR│ ì
  906. Messagσ áBuffe≥ át∩ storσ thσ indicatioε oµ áwhethe≥ ápausinτ ái≤ ì
  907. desireΣ áo≥ ánot« á Thesσ ácontent≤ oµ áthesσ ábyte≤ áarσ áeasil∙ 
  908. .paèaccesseΣ viß thσ Z3LI┬ routine≤ GETSH═ anΣ PUTSH═ (reµ pagσ á1╡-▓ ì
  909. oµ ZCPR3║ Thσ Libraries).
  910.  
  911. 3.1.3. Resettinτ Shel∞ Invocatioε Flag
  912.  
  913. Wheε ááyou≥ áprograφ ái≤ áshel∞ áinvoked¼ ái⌠ ái≤ áthσ ááprogram≤ ì
  914. responsibilit∙ át∩ árese⌠ áthσ flaτ whicΦ áindicate≤ ái⌠ áwa≤ ás∩ ì
  915. invoked¼ ás∩ áan∙ subsequen⌠ ZCPR│ transient≤ wil∞ ábσ ápresenteΣ ì
  916. witΦ ácorrec⌠ information«  Thi≤ i≤ usuall∙ donσ througΦ thσ áusσ ì
  917. oµ Z3LIB'≤ PUTCS╘ routinσ (reµ pagσ 17-┤ oµ ZCPR3║ Thσ Manual).
  918.  
  919. 3.1.4. Environmen⌠ Verification
  920.  
  921. A≤ ástateΣ previously¼ iµ you≥ prograφ wa≤ manuall∙ áinvoked¼ ái⌠ ì
  922. mus⌠ instal∞ itselµ oε thσ Shel∞ Stack«  Iε orde≥ fo≥ thi≤ t∩ ábσ ì
  923. successful¼ áthσ ZCPR│ implementatioε mus⌠ posses≤ thσ ánecessar∙ ì
  924. elements« á Fo≥ prope≥ shel∞ behavior¼ therσ mus⌠ obviousl∙ bσ áß ì
  925. Shel∞ Stacδ defineΣ iε thσ system«  Also¼ iµ systeφ command≤ áarσ ì
  926. t∩ ábσ ágenerateΣ áb∙ thσ application¼ therσ mus⌠ áals∩ áexis⌠ áß ì
  927. Multiplσ áCommanΣ Linσ Buffer«  I⌠ i≤ adviseΣ tha⌠ áyou≥ áprograφ ì
  928. checδ áfo≥ thσ presencσ anΣ appropriatσ characteristic≤ oµ áthesσ ì
  929. element≤ ááoµ ááthσ áZCPR│ áenvironmen⌠ ááprio≥ áát∩ ááattemptinτ ì
  930. installatioε oε thσ Shel∞ Stack«
  931.  
  932. Thσ Z3LI┬ routine≤ GETSH▒ (reµ pagσ 1╡-╢ oµ ZCPR3║ Thσ Libraries⌐ ì
  933. anΣ áGETCL▒ (reµ pagσ 1┤-┤ oµ ZCPR3║ Thσ Libraries⌐ áprovidσ áthσ ì
  934. desireΣ informatioε oε thesσ systeφ elements«  Thesσ element≤ ma∙ ì
  935. als∩ ábσ áverifieΣ áthrougΦ direc⌠ checkinτ oµ áthσ áENV« á Thesσ ì
  936. element≤ áarσ considereΣ indispensiblσ t∩ thσ operatioε oµ áZCPR│ ì
  937. a≤ áß áwhole¼ áanΣ áarσ ápresen⌠ áiε áeveε áthσ ásmalles⌠ ááZCPR│ ì
  938. implementation≤ distributeΣ b∙ Echelon.
  939.  
  940. 3.1.5. Buildinτ ß Shel∞ Stacδ Entry
  941.  
  942. Thσ ábes⌠ áwa∙ t∩ thinδ oµ aε entr∙ iε thσ Shel∞ Stacδ ái≤ áa≤ áß ì
  943. smal∞ áZCPR│ ácommanΣ line¼ whicΦ i≤ designeΣ át∩ áreinvokσ áyou≥ ì
  944. prograφ áautomatically«  Obviously¼ t∩ d∩ this¼ thσ áshel∞ ástacδ ì
  945. entr∙ ámus⌠ ácontaiε áthσ ánamσ oµ you≥ áprograφ á(refe≥ át∩ áthσ ì
  946. previou≤ áásubsectioε áoµ áthi≤ ádocumen⌠ átitleΣ á"What'≤ ááYou≥ ì
  947. Program'≤ Name?"⌐ anΣ an∙ trailinτ parameter≤ yo⌡ deeφ necessary¼ ì
  948. terminateΣ b∙ ß binar∙ zero.
  949.  
  950. Trailinτ ááparameter≤ ácaε ábσ áusefu∞ áfo≥ áápreservinτ áástatu≤ ì
  951. informatioε áregardinτ áyou≥ program«  Wheε shel∞ áinvoked¼ áyou≥ ì
  952. prograφ ácaε áexaminσ áthesσ átrailinτ áparameter≤ áanΣ ááresponΣ ì
  953. appropriately« á ┴ gooΣ examplσ oµ thi≤ i≤ thσ casσ oµ ß áprograφ ì
  954. whicΦ áma∙ áloτ áint∩ ádifferen⌠ DU:'≤ áthaε áthσ áonσ ácurrentl∙ ì
  955. selecteΣ á("default"⌐ b∙ thσ ZCPR│ CommanΣ áProcessor« á Conside≥ ì
  956. thσ scenari∩ oµ ß shel∞ manuall∙ invokeΣ wheε A0║ wa≤ thσ curren⌠ ì
  957. directory¼ áanΣ withiε whicΦ thσ use≥ log≤ int∩ B3:« á Then¼ áthσ ì
  958. use≥ áinitiate≤ somσ typσ oµ externa∞ command¼ whicΦ i≤ run¼ áanΣ ì
  959. theε áthσ áshel∞ i≤ reinvokeΣ froφ thσ Shel∞ Stack« á Unles≤ áyo⌡ ì
  960. havσ ástoreΣ thσ informatioε tha⌠ B3║ wa≤ thσ currentl∙ áselecteΣ ì
  961. director∙ anΣ examinσ tha⌠ informatioε oε shel∞ invocation¼ áyou≥ 
  962. .paèprograφ áwil∞ apparentl∙ changσ it≤ loggeΣ director∙ froφ B3║ át∩ ì
  963. A0:.
  964.  
  965. 3.1.6. Pushinτ aε Entr∙ Ont∩ thσ Shel∞ Stack
  966.  
  967. Thσ áac⌠ oµ placinτ ß ne≈ entr∙ int∩ thσ Shel∞ Stacδ i≤ áreferreΣ ì
  968. t∩ a≤ ß "pushó operation«  I⌠ i≤ quitσ eas∙ t∩ utilizσ thσ áZ3LI┬ ì
  969. routinσ SHPUS╚ (reµ pagσ 1╕-╣ oµ ZCPR3║ Thσ Libraries⌐ t∩ perforφ ì
  970. thi≤ function.
  971.  
  972. Essentially¼ áSHPUS╚ áattempt≤ t∩ movσ an∙ existinτ áShel∞ áStacδ ì
  973. entrie≤ onσ leve∞ deepe≥ iε thσ Shel∞ Stack¼ anΣ theε place≤ áthσ ì
  974. ne≈ entr∙ oε to≡ oµ thσ stack.
  975.  
  976. I⌠ ái≤ áadviseΣ tha⌠ thσ programme≥ bσ awarσ i⌠ ái≤ ápossiblσ át∩ ì
  977. overflo≈ áthσ Shel∞ Stack¼ anΣ thi≤ shoulΣ bσ aε erro≥ áconditioε ì
  978. t∩ checδ for.
  979.  
  980. 3.1.7. Pendinτ Commands
  981.  
  982. Thσ las⌠ actioε ß shel∞ mus⌠ takσ afte≥ beinτ manuall∙ invokeΣ i≤ ì
  983. t∩ áchecδ thσ ZCPR│ Multiplσ CommanΣ Linσ Buffe≥ t∩ determinσ áiµ ì
  984. therσ áarσ áan∙ pendinτ commands«  Iµ therσ áarσ ástil∞ ácommand≤ ì
  985. pendinτ iε thσ buffer¼ thσ shel∞ prograφ mus⌠ exi⌠ (warφ boot⌐ t∩ ì
  986. permi⌠ áthosσ command≤ t∩ bσ executeΣ prio≥ t∩ thσ actua∞ usσ áoµ ì
  987. thσ áshel∞ program«  Thσ Z3LI┬ routinσ GETCL▓ (reµ pagσ á1┤-┤ áoµ ì
  988. ZCPR3║ áThσ Libraries⌐ allow≤ thσ programme≥ t∩ easil∙ checδ áthσ ì
  989. statu≤ oµ thσ Multiplσ CommanΣ Linσ Buffer.
  990.  
  991. Aε áexamplσ wil∞ hel≡ t∩ clarif∙ thi≤ subtlσ topic«  VFILE╥ i≤ áß ì
  992. widel∙ áuseΣ áZCPR│ áshell«  Assumσ thσ use≥ invoke≤ ái⌠ áwitΦ áß ì
  993. commanΣ linσ of:
  994.  
  995. A0:COMMAND>vfiler;dir<cr>
  996.  
  997. VFILE╥ áwil∞ ásensσ i⌠ ha≤ beeε manuall∙ invoked¼ áwil∞ ápusΦ áaε ì
  998. entr∙ áont∩ thσ Shel∞ Stack¼ anΣ wheε i⌠ detect≤ tha⌠ átherσ áarσ ì
  999. stil∞ pendinτ commands¼ i⌠ wil∞ exit«  Thσ DI╥ commanΣ wil∞ átheε ì
  1000. bσ áexecuted«  Afterward¼ thσ CommanΣ Linσ Buffe≥ i≤ áempty¼ áanΣ ì
  1001. ZCPR│ wil∞ theε nex⌠ ruε thσ topmos⌠ commanΣ iε thσ Shel∞ áStack¼ ì
  1002. whicΦ wil∞ shel∞ invokσ VFILER.
  1003.  
  1004. Thσ áreasoninτ fo≥ thi≤ aspec⌠ oµ shel∞ behavio≥ i≤ aε áextensioε ì
  1005. oµ áthσ áhierarchica∞ naturσ iε whicΦ ZCPR│ áprocesse≤ ácommands«  ì
  1006. Thσ áMultiplσ áCommanΣ Linσ Buffe≥ alway≤ ha≤ priorit∙ áove≥ áthσ ì
  1007. Shel∞ Stack«  Thσ neeΣ fo≥ thi≤ caε bes⌠ bσ observeΣ iε ß commanΣ ì
  1008. sequencσ sucΦ as:
  1009.  
  1010. A0:COMMAND>shell1;shell2;shell3<cr>
  1011.  
  1012. Iµ áthesσ shell≤ diΣ no⌠ behavσ iε thσ wa∙ outlineΣ áabove¼ áthe∙ ì
  1013. woulΣ no⌠ bσ nesteΣ properl∙ iε thσ shel∞ stack¼ anΣ an∙ áattemp⌠ ì
  1014. t∩ áruε aε externa∞ commanΣ froφ ß shel∞ earlie≥ iε thσ ásequencσ ì
  1015. woulΣ resul⌠ iε thσ use≥ endinτ u≡ runninτ thσ nex⌠ shel∞ oµ áthσ ì
  1016. sequence.è.pa
  1017. 3.1.8. Examplσ Pseudocodσ fo≥ Invocation
  1018.  
  1019. .bpoff
  1020. Savσ Curren⌠ DU:
  1021. Executσ QSHELL
  1022. I╞ Manuall∙ Invoked
  1023.   Verif∙ Shel∞ Stacδ availablσ (GETSH1)
  1024.   Verif∙ sizσ oµ Shel∞ Stacδ entr∙ acceptablσ (als∩ GETSH1)
  1025.   Verif∙ numbe≥ oµ entrie≤ greate≥ thaε zer∩ (als∩ GETSH1)
  1026.   I╞ shel∞ wil∞ generatσ externa∞ commands
  1027.     Verif∙ Multiplσ CommanΣ Linσ Buffe≥ availablσ (GETCL1)
  1028.   ENDIF
  1029.   I╞ an∙ oµ thσ abovσ verification≤ failed
  1030.     Abor⌠ Shel∞ Functions
  1031.   ENDIF
  1032.   (Nex⌠ tw∩ line≤ builΣ ne≈ ß Shel∞ Stacδ entry)
  1033.   Ge⌠ Namσ oµ Prograφ (GETEFCB)
  1034.   Proces≤ Curren⌠ DU║ a≤ trailinτ paramete≥ iε ne≈ stacδ entry
  1035.   PusΦ ne≈ entr∙ ont∩ Shel∞ Stacδ (SHPUSH)
  1036.   I╞ an∙ error≤ durinτ Push
  1037.     Abor⌠ Shel∞ Functions
  1038.   ENDIF
  1039.   I╞ an∙ pendinτ command≤ iε thσ buffe≥ (GETCL2)
  1040.     Warφ Boot
  1041.   ENDIF
  1042. ELS┼ (thσ prograφ ha≤ beeε shel∞ invoked)
  1043.   I╞ pausσ desired
  1044.     Wai⌠ fo≥ Keypress
  1045.   ENDIF
  1046.   Rese⌠ Shel∞ Invocatioε Flaτ (PUTCS╘ witΦ A=0)
  1047. ENDIF
  1048. <Prograφ codσ commences>
  1049. .bpon
  1050.  
  1051. 3.2. Generatinτ Commands
  1052.  
  1053. Thi≤ ásubsectioε discusse≤ generatinτ ZCPR│ command≤ froφ áwithiε ì
  1054. shel∞ áprograms«  I⌠ caε bσ assumeΣ tha⌠ an∙ shel∞ wil∞ ágeneratσ ì
  1055. operatinτ-systeφ-leve∞ ácommands¼ a≤ otherwisσ therσ woulΣ bσ án∩ ì
  1056. neeΣ fo≥ shel∞ functions.
  1057.  
  1058. 3.2.1. Promptinτ thσ User
  1059.  
  1060. AlthougΦ i⌠ i≤ strictl∙ thσ programmer'≤ decisioε a≤ t∩ wha⌠ forφ ì
  1061. an∙ ágiveε áuse≥ promp⌠ wil∞ take¼ Echeloε árecommend≤ átha⌠ áan∙ ì
  1062. promp⌠ áfo≥ áß ZCPR│ commanΣ mimiπ thσ áZCPR│ áCommanΣ áProcesso≥ ì
  1063. prompt« á Thi≤ usuall∙ take≤ thσ forφ "DU:DIR>"¼ wherσ D╒ i≤ áthσ ì
  1064. defaul⌠ ádisδ anΣ use≥ area¼ anΣ DI╥ i≤ thσ ácorrespondinτ ánameΣ ì
  1065. director∙ áentr∙ á(iµ onσ exists)«  DIR║ form≤ ácaε ábσ áproduceΣ ì
  1066. easil∙ usinτ thσ Z3LI┬ routinσ DUND╥ (reµ pagσ 1╡-│ oµ ZCPR3║ Thσ ì
  1067. Libraries).
  1068.  
  1069. Somσ áshel∞ program≤ wil∞ havσ buil⌠-iε function≤ t∩ áchangσ áthσ ì
  1070. DU║ átha⌠ áthσ shel∞ i≤ operatinτ in«  Iµ thi≤ i≤ átruσ áoµ áyou≥ ì
  1071. application¼ you≥ promp⌠ t∩ thσ use≥ ma∙ requirσ specia∞ handlinτ ì
  1072. t∩ ásho≈ thσ actua∞ DU║ whicΦ wil∞ bσ useΣ b∙ thσ áZCPR│ áCommanΣ 
  1073. .paèProcesso≥ wheε i⌠ i≤ processinτ commands¼ a≤ thi≤ ma∙ diffe≥ froφ ì
  1074. whateve≥ áDU║ you≥ shel∞ i≤ currentl∙ loggeΣ into«
  1075.  
  1076. Conside≥ thσ VFILE╥ prograφ a≤ aε example«  VFILE╥ i≤ áoriginall∙ ì
  1077. invokeΣ áwheε áthσ áuse≥ wa≤ loggeΣ int∩ A0:« á Whilσ áVFILE╥ ái≤ ì
  1078. running¼ áthσ áuse≥ áuse≤ thσ "Ló commanΣ t∩ áloτ áint∩ áthσ áB3║ ì
  1079. directory«  I⌠ i≤ importan⌠ t∩ notσ tha⌠ thi≤ changσ i≤ áinterna∞ ì
  1080. t∩ VFILE╥ anΣ doe≤ no⌠ affec⌠ thσ ZCPR│ CommanΣ Processor« á (Thσ ì
  1081. onl∙ áwa∙ t∩ affec⌠ thσ ZCPR│ CommanΣ Processo≥ i≤ t∩ changσ áthσ ì
  1082. CDIS╦ fielΣ a⌠ addres≤ 0004h¼ bu⌠ i⌠ i≤ considereΣ "illegaló áfo≥ ì
  1083. ß transien⌠ t∩ d∩ this.⌐  Iµ VFILE╥ prompt≤ thσ use≥ fo≥ ß áZCPR│ ì
  1084. command¼ aε inclusioε oµ B3║ iε thσ promp⌠ woulΣ bσ incorrect¼ a≤ ì
  1085. thσ áZCPR│ CommanΣ Processo≥ i≤ no⌠ loggeΣ int∩ átha⌠ ádirectory«  ì
  1086. Thσ ácorrec⌠ áDU║ t∩ displa∙ iε thσ promp⌠ i≤ áthσ áorigina∞ áDU║ ì
  1087. selecteΣ wheε VFILE╥ wa≤ initiall∙ loaded¼ A0:.
  1088.  
  1089. 3.2.2. Settinτ Returε Parameters
  1090.  
  1091. RelateΣ át∩ thσ jus⌠-discusseΣ neeΣ t∩ ensurσ thσ prope≥ áDU║ ái≤ ì
  1092. presenteΣ át∩ áthσ user¼ i⌠ ma∙ als∩ bσ necessar∙ át∩ áprovidσ áß ì
  1093. mechanisφ áwhereiε you≥ shel∞ wil∞ returε t∩ thσ prope≥ DU║ áwheε ì
  1094. i⌠ ái≤ áshel∞ invokeΣ afte≥ thσ user'≤ ácommand≤ áarσ áprocessed«  ì
  1095. Thi≤ ái≤ ábecausσ wheε you≥ prograφ i≤ shel∞ invoked¼ áthσ áZCPR│ ì
  1096. CommanΣ áProcessor'≤ defaul⌠ DU║ i≤ selected«  Iµ actioε ái≤ áno⌠ ì
  1097. takeε t∩ handlσ thi≤ situation¼ i⌠ ma∙ appea≥ t∩ thσ use≥ tha⌠ hσ ì
  1098. raε thσ ZCPR│ commanΣ successfully¼ bu⌠ oε rσ-entr∙ t∩ thσ áshel∞ ì
  1099. i⌠ seem≤ t∩ bσ loggeΣ int∩ thσ "wrongó DU║ (eg¼ no⌠ thσ samσ áonσ ì
  1100. i⌠ wa≤ loggeΣ int∩ wheε thσ externa∞ command(s⌐ werσ generated).
  1101.  
  1102. Thσ áeasies⌠ áwa∙ át∩ áhandlσ thi≤ ásituatioε ái≤ áwitΦ átrailinτ ì
  1103. parameter≤ iε thσ Shel∞ Stacδ topmos⌠ entr∙ (whicΦ wσ caε áassumσ ì
  1104. belong≤ t∩ you≥ shell)«  Settinτ thesσ parameter≤ t∩ thσ áshell'≤ ì
  1105. presentl∙-selecteΣ áDU║ wheε generatinτ ZCPR│ commands¼ anΣ átheε ì
  1106. checkinτ áfo≥ átheφ áoε áshel∞ á(re)invocatioε áwil∞ ápermi⌠ áthσ ì
  1107. programme≥ át∩ pas≤ informatioε oµ thi≤ typσ ábetweeε ásuccessivσ ì
  1108. run≤ áoµ thσ shell«  An∙ kinΣ oµ informatioε ma∙ bσ ápasseΣ áthi≤ ì
  1109. way¼ ás∩ álonτ áa≤ ái⌠ ái≤ árepresenteΣ áiε álega∞ ácommanΣ álinσ ì
  1110. characters.
  1111.  
  1112. 3.2.3. Placinτ thσ DesireΣ CommanΣ iε thσ Buffer
  1113.  
  1114. Placinτ áthσ desireΣ commanΣ iε thσ Multiplσ CommanΣ Linσ áBuffe≥ ì
  1115. i≤ áfairl∙ ástraightforward«  A≤ wa≤ ámentioneΣ ápreviously¼ áal∞ ì
  1116. shell≤ ádefe≥ áinitiall∙ t∩ an∙ pendinτ command≤ iε áthσ ábuffer«  ì
  1117. Thus¼ i⌠ caε bσ safel∙ assumeΣ tha⌠ therσ arσ n∩ pendinτ command≤ ì
  1118. t∩ preserve.
  1119.  
  1120. Thσ áZ3LI┬ routinσ PUTC╠ (reµ pagσ 1┤-╡ oµ ZCPR3║ Thσ áLibraries⌐ ì
  1121. caε ábσ áuseΣ át∩ áeasil∙ placσ thσ ádesireΣ ácommand≤ áint∩ áthσ ì
  1122. Multiplσ áCommanΣ Linσ Buffer«  Thσ desireΣ commanΣ strinτ t∩ ábσ ì
  1123. placeΣ iε thσ buffe≥ shoulΣ bσ capitalized.
  1124. .paè3.2.4. Pseudocodσ fo≥ Shel∞ "Generatσ Commandó Function
  1125.  
  1126. .bpoff
  1127. Ge⌠ origina∞ DU║ (selecteΣ wheε prograφ wa≤ initiall∙ invoked)
  1128. Promp⌠ use≥ fo≥ desireΣ command¼ usinτ origina∞ DU║ (DUNDR)
  1129. I╞ nul∞ command
  1130.   Abor⌠ generatσ commanΣ function
  1131. ENDIF
  1132. I╞ usinτ ß pausσ flag
  1133.   Se⌠ i⌠ a≤ appropriatσ (PUTSHM)
  1134. ENDIF
  1135. Se⌠ returε parameter≤ iε Shel∞ Stacδ a≤ desired
  1136. Placσ commanΣ iε buffe≥ (PUTCL)
  1137. Warφ Boot
  1138. .bpon
  1139.  
  1140. 3.3. Terminatinτ ß Shell
  1141.  
  1142. Actually¼ áterminatinτ áß shel∞ i≤ quitσ simplσ compareΣ át∩ áthσ ì
  1143. othe≥ áaspect≤ áoµ áshel∞ operation«  Al∞ ß shel∞ ámus⌠ ád∩ áwheε ì
  1144. terminatinτ ái≤ "popó thσ Shel∞ Stack¼ anΣ warφ boot«  Thσ áZ3LI┬ ì
  1145. routinσ SHPO╨ (reµ pagσ 1╕-╣ oµ ZCPR3║ Thσ Libraries⌐ i≤ áusuall∙ ì
  1146. useΣ fo≥ thi≤ function.
  1147. .paè4. Programminτ Examples
  1148.  
  1149. Thi≤ ásubsectioε ápresent≤ ß fe≈ usefu∞ "tricksó tha⌠ áhavσ ábeeε ì
  1150. developeΣ át∩ ácopσ áwitΦ certaiε basiπ áquestion≤ áfaceΣ áb∙ áaε ì
  1151. applicatioε runninτ iε ß ZCPR│ environment«  Wσ recorΣ theφ áherσ ì
  1152. iε aε effor⌠ t∩ savσ thσ applicatioε programme≥ timσ anΣ energy« 
  1153.  
  1154. 4.1. I≤ ZCPR│ Available?
  1155.  
  1156. Thi≤ tricδ build≤ oε thσ fac⌠ tha⌠ ever∙ ZCPR│-compatiblσ prograφ ì
  1157. shoulΣ áhavσ áthσ ástandarΣ áutilit∙ áheade≥ á(seσ áthσ ápreviou≤ ì
  1158. subsectioε oε thσ topiπ "ZCPR│ utilit∙ headeró fo≥ thσ details)« 
  1159.  
  1160. Thi≤ átricδ ápresume≤ tha⌠ you≥ applicatioε wil∞ ábσ ádistributeΣ ì
  1161. witΦ thσ pointe≥ t∩ thσ EN╓ iε thσ utilit∙ heade≥ se⌠ t∩ áaddres≤ ì
  1162. 0000h« á Iµ áthσ pointe≥ i≤ changeΣ t∩ ß nonzer∩ ávaluσ áb∙ ásomσ ì
  1163. externa∞ process¼ thi≤ indicate≤ you≥ applicatioε i≤ runninτ iε ß ì
  1164. ZCPR│ environment« 
  1165.  
  1166. Here's a code sample: 
  1167.  
  1168. .bpoff
  1169. .po 8
  1170. .rm 79
  1171. testz3: 
  1172.         ld      hl,(z3eadr)     ; get pointer from header 
  1173.         ld      a,l             ; setup to test 
  1174.         or      h 
  1175.         jp      z,noz3          ; if Z result, ZCPR3 not available 
  1176. yesz3:                          ; if we get here, ZCPR3 is available 
  1177.  
  1178. .bpon
  1179. .po 8
  1180. .rm 65
  1181. 4.2. I≤ ZRDO╙ Available?
  1182.  
  1183. Aε applicatioε ma∙ als∩ wisΦ t∩ tes⌠ fo≥ thσ presencσ oµ ZRDO╙ t∩ ì
  1184. takσ advantagσ oµ it≤ specia∞ feature≤ iµ i⌠ i≤ available« á Herσ ì
  1185. i≤ ß codσ samplσ enablinτ this║ 
  1186.  
  1187. .bpoff
  1188. .po 0
  1189. .rm 79
  1190. dos     equ     5            ; bdos/zrdos entry vector 
  1191.  
  1192. test$zrdos: 
  1193.         ld      c,12         ; DRI return version # function 
  1194.         call    dos          ; go perform function 
  1195.         ld      a,l          ; get result into A 
  1196.         cp      22h          ; did we get 2.2? 
  1197.         jp      nz,not$zrdos ; if not, we aren't using the 2.2 BDOS or ZRDOS 
  1198.         ld      c,48         ; now let's differentiate between BDOS and ZRDOS 
  1199.         call    dos          ; BDOS will return 0; ZRDOS returns version 
  1200.         ld      a,l          ; get result into A 
  1201.         or      a            ╗ i≤ i⌠ zero?
  1202.         jp      z,not$zrdos 
  1203. zrdos$present║               ╗ iµ wσ ge⌠ here¼ ZRDO╙ i≤ available
  1204.         ... 
  1205.