home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / znode3 / tcj / tcj48.ws < prev    next >
Encoding:
Text File  |  1994-09-02  |  39.9 KB  |  840 lines

  1.                                Z-System Corne≥ (c)
  2.                                  by Jay Sage
  3.                         The Computer Journal, Issue 48
  4.                           Reproduced with permission
  5.                            of author and publisher
  6.  
  7.                   Patchinτ MEX-Plu≤ anΣ Thσ Word¼ Usinτ ZEX
  8.  
  9. Fo≥ thi≤ issuσ ╔ havσ ß largσ numbe≥ oµ smal∞ subject≤ t∩ cover« ╔ wil∞ ábegiε ì
  10. witΦ thσ lonτ-promiseΣ patche≤ t∩ ME╪¡ Plus¼ thσ one≤ ╔ los⌠ wheε m∙ harΣ disδ ì
  11. crasheΣ anΣ theε recovereΣ wheε thσ harΣ disδ miraculousl∙ resurrecteΣ itself« ì
  12. ╔ haven'⌠ haΣ timσ t∩ incorporatσ al∞ thσ correction≤ anΣ addition≤ tha⌠ áhavσ ì
  13. beeε oε m∙ list¼ bu⌠ thi≤ wil∞ bσ ß gooΣ star⌠ oε aε oε-goinτ project.
  14.  
  15. Whilσ áoε áthσ subjec⌠ oµ patching¼ ╔ wil∞ enlargσ oε thσ ádiscussioε áoµ áthσ ì
  16. patcΦ át∩ áThσ WorΣ Plu≤ tha⌠ ╔ presenteΣ iε issuσ #45« I⌠ turn≤ ou⌠ átha⌠ áa⌠ ì
  17. leas⌠ átw∩ differen⌠ version≤ oµ TW.CO═ arσ currentl∙ iε circulation¼ anΣ áthσ ì
  18. origina∞ patcΦ work≤ onl∙ witΦ one.
  19.  
  20. ┴ couplσ oµ reader≤ havσ requesteΣ hel≡ witΦ ZEX« The∙ arσ awarσ tha⌠ áBridge≥ ì
  21. Mitchel∞ áprovideΣ áful∞ documentatioε iε hi≤ columε iε issuσ á#38¼ ábu⌠ áthe∙ ì
  22. pointeΣ áou⌠ átha⌠ áthσ ásubjec⌠ i≤ rathe≥ ácomple° áanΣ áwoulΣ ábσ áclarifieΣ ì
  23. considerabl∙ áb∙ ß fe≈ examples« Giveε thσ powe≥ oµ commanΣ alia≤ áscripts¼ á╔ ì
  24. rarel∙ havσ an∙ neeΣ fo≥ ZEX¼ bu⌠ ╔ wil∞ presen⌠ thσ tw∩ ZE╪ script≤ tha⌠ ╔ d∩ ì
  25. usσ regularly« Perhap≤ somσ reader≤ wil∞ hel≡ ou⌠ b∙ sendinτ mσ copie≤ oµ somσ ì
  26. interestinτ script≤ tha⌠ the∙ havσ developeΣ tha⌠ usσ thσ advanceΣ feature≤ oµ ì
  27. ZEX5.
  28.  
  29. Finally¼ á╔ áwil∞ ácontinuσ m∙ discussioε oµ ZMATE« Rathe≥ áthaε álistinτ áthσ ì
  30. remaininτ command≤ tha⌠ ╔ diΣ no⌠ cove≥ las⌠ time¼ ╔ wil∞ describσ m∙ áspecia∞ ì
  31. autoexeπ ámacr∩ átha⌠ áallow≤ ámσ t∩ pas≤ macr∩ command≤ át∩ áZMAT┼ áfroφ áthσ ì
  32. operatinτ systeφ commanΣ line« Thi≤ provide≤ ß ver∙ powerfu∞ interfacσ betweeε ì
  33. ZMAT┼ anΣ ┌-Systeφ commanΣ alia≤ scripts.
  34.  
  35. Thi≤ ái≤ áno⌠ thσ onl∙ informatioε abou⌠ ZMAT┼ iε thi≤ issue« ╔ áaφ áhapp∙ át∩ ì
  36. announcσ tha⌠ wσ arσ inauguratinτ ß ne≈ columε b∙ Cliµ Kinnσ oε MAT┼ macros.
  37.  
  38. Onσ áothe≥ quicδ announcement« Thσ ┌-Systeφ Softwarσ Updatσ Service¼ áproduceΣ ì
  39. b∙ Bil∞ Tishe∙ anΣ Chri≤ McEwen¼ i≤ expandinτ it≤ services« ZSU╙ wil∞ no≈ makσ ì
  40. u≡ ácustoφ ádisk≤ containinτ thσ ful∞ LB╥ release≤ oµ an∙ file≤ áyo⌡ árequest« ì
  41. Therσ wil∞ als∩ sooε bσ specia∞ softwarσ collections« ╔ believσ thσ firs⌠ wil∞ ì
  42. contaiε materia∞ oµ interes⌠ t∩ assembl∙ languagσ programmers« ╔ invitσ yo⌡ t∩ ì
  43. writσ t∩ mσ fo≥ ß ne≈ flye≥ o≥ t∩ looδ fo≥ announcement≤ oε BBSs.
  44.  
  45. Fixinτ U≡ ME╪-Plus
  46.  
  47. A≤ áwonderfu∞ a≤ ╔ finΣ ME╪-Plus¼ therσ arσ quitσ ß fe≈ bug≤ tha⌠ neeΣ át∩ ábσ ì
  48. fixeΣ áanΣ quitσ ß fe≈ additiona∞ feature≤ tha⌠ ╔ woulΣ likσ t∩ seσ áadded« á╔ ì
  49. havσ ájus⌠ ágotteε starteΣ oε thi≤ projec⌠ anΣ wil∞ describσ ám∙ áprogres≤ át∩ ì
  50. date.
  51.  
  52. ME╪ Improvemen⌠ List
  53. è
  54. Beside≤ thσ item≤ tha⌠ m∙ curren⌠ patcΦ deal≤ with¼ thσ followinτ item≤ arσ oε ì
  55. m∙ lis⌠ oµ needeΣ improvements.
  56.  
  57. Thσ CLON┼ command¼ whicΦ create≤ ß ne≈ cop∙ oµ ME╪ (i.e.¼ ß ne≈ CO═ file⌐ witΦ ì
  58. thσ ácurren⌠ setting≤ a≤ thσ default¼ ha≤ thσ followinτ mino≥ bug║ wheε i⌠ ái≤ ì
  59. entereΣ withou⌠ specifyinτ ß filσ name¼ i⌠ wil∞ makσ ß filσ witΦ exten⌠ á"COMó ì
  60. anΣ ß filσ namσ oµ al∞ spacesí Iε thi≤ case¼ i⌠ woulΣ bσ mucΦ morσ sensiblσ iµ ì
  61. i⌠ eithe≥ (1⌐ defaulteΣ t∩ ß namσ oµ MEX.CO═ o≥ (2⌐ refuseΣ t∩ d∩ anything.
  62.  
  63. Therσ ái≤ ß ver∙ annoyinτ erro≥ iε thσ wa∙ numerica∞ variable≤ arσ áprocessed« ì
  64. Wheε thσ variable≤ havσ particula≥ values¼ ME╪ report≤ ß synta° error« S∩ áfa≥ ì
  65. ╔ áhavσ áno⌠ ábeeε ablσ t∩ determinσ thσ precisσ condition≤ áunde≥ áwhicΦ áthσ ì
  66. probleφ áarises¼ bu⌠ ╔ hopσ tha⌠ witΦ carefu∞ stud∙ oµ thσ codσ ╔ wil∞ áfigurσ ì
  67. ou⌠ áwha⌠ ái≤ áwrong« áM∙ gues≤ i≤ tha⌠ somσ CP╒ áflaτ ái≤ ábeinτ ámi≤-se⌠ áo≥ ì
  68. misinterpreted.
  69.  
  70. Therσ i≤ ß mino≥ buτ iε thσ DAT┼ command« A≤ thing≤ arσ now¼ TIM┼ anΣ DAT┼ arσ ì
  71. identica∞ áfunctions¼ áanΣ ábotΦ áreturε áthσ átimσ áiε áthσ áVALU┼ ávariable« ì
  72. Obviously¼ DAT┼ shoulΣ returε thσ curren⌠ date.
  73.  
  74. Iε casσ yo⌡ havσ trieΣ t∩ usσ thσ MENU.MO─ modulσ anΣ havσ founΣ tha⌠ thσ HEL╨ ì
  75. functioε ádoe≤ áno⌠ áwork¼ don'⌠ worry« Yo⌡ arσ no⌠ doinτ áanythinτ áwronτ áo≥ ì
  76. missinτ an∙ piecσ oµ thσ code« Thi≤ functioε wa≤ implementeΣ improperl∙ o≥ no⌠ ì
  77. implementeΣ áa⌠ al∞ iε thσ CP/═ versioε oµ ME╪-Plus« Wσ probabl∙ wil∞ áno⌠ ábσ ì
  78. ablσ át∩ d∩ mucΦ abou⌠ thi≤ unti∞ wσ havσ figureΣ ou⌠ MEX'≤ interfacσ át∩ áthσ ì
  79. externa∞ modules.
  80.  
  81. ╔ woulΣ likσ t∩ mentioε somethinτ tha⌠ causeΣ mσ grieµ recentl∙ witΦ onσ oµ m∙ ì
  82. macros║ áWAI╘ áSTRIN╟ string≤ arσ limiteΣ t∩ 1╢ charactersí ╔ ádon'⌠ áthinδ á╔ ì
  83. woulΣ changσ this¼ bu⌠ onσ mus⌠ bea≥ thi≤ limitatioε iε mind.
  84.  
  85. Onσ oµ thσ mos⌠ importan⌠ addition≤ woulΣ bσ morσ strinτ variable≤ beyonΣ áthσ ì
  86. si° á(A..F⌐ ácurrentl∙ áimplemented« Eveε tw∩ morσ woulΣ benefi⌠ ásomσ áoµ ám∙ ì
  87. script≤ enormously.
  88.  
  89. Finally¼ á╔ áwoulΣ álikσ át∩ áreplacσ thσ áfilσ ánamσ áparser¼ áwhicΦ áalread∙ ì
  90. recognize≤ áthσ áDU║ áprefix¼ áwitΦ áonσ átha⌠ áhandle≤ áful∞ á┌-Systeφ ááfilσ ì
  91. specifications.
  92.  
  93. M∙ ME╪ Patch
  94.  
  95. M∙ áME╪ patcΦ i≤ showε iε Listinτ 1« I⌠ i≤ heavil∙ commented¼ anΣ ╔ áwil∞ áno⌠ ì
  96. repea⌠ thσ detail≤ iε thσ text« Thσ patcΦ make≤ threσ changes.
  97.  
  98. ME╪ áha≤ áß áSTA╘ commanΣ tha⌠ turn≤ oε o≥ ofµ ß functioε átha⌠ áconvert≤ áthσ ì
  99. backspacσ ke∙ int∩ ß rubout/deletσ characte≥ (whicΦ wσ wil∞ cal∞ DE╠ froφ áno≈ ì
  100. on)« á╔ áhavσ áalway≤ assumeΣ tha⌠ thi≤ wa≤ includeΣ froφ áoldeε átimes¼ áwheε ì
  101. microcomputer≤ sometime≤ haΣ n∩ DE╠ ke∙ anΣ mainframσ computer≤¡-whicΦ ME╪ wa≤ ì
  102. useΣ t∩ communicatσ witΦ¡-requireΣ tha⌠ ke∙ fo≥ somσ critica∞ functions.
  103.  
  104. Today¼ thσ situatioε i≤ generall∙ quitσ different« First¼ almos⌠ al∞ computer≤ ìèanΣ áterminal≤ no≈ havσ ß DE╠ key« Second¼ witΦ thσ ┌-System¼ onσ áofteε áuse≤ ì
  105. DE╠ interchangeabl∙ witΦ backspace¼ anΣ ╔ havσ gotteε quitσ useΣ t∩ that« Wheε ì
  106. ╔ ácal∞ noε-┌ remotσ acces≤ systems¼ ╔ finΣ i⌠ ß rea∞ nuisancσ wheε áDE╠ ádoe≤ ì
  107. no⌠ work« Tha⌠ i≤ wh∙ ╔ decideΣ t∩ reversσ thσ functioε oµ thi≤ STA╘ command.
  108.  
  109. Makinτ thσ changσ itselµ wa≤ quitσ simple╗ thσ harΣ par⌠ wa≤ findinτ thσ righ⌠ ì
  110. place≤ iε thσ code« Threσ change≤ arσ required¼ a≤ showε a⌠ thσ enΣ oµ Listinτ ì
  111. 1« áOnσ bytσ contain≤ thσ keycodσ oµ thσ ke∙ t∩ bσ intercepted¼ whilσ áanothe≥ ì
  112. bytσ contain≤ thσ keycodσ witΦ whicΦ i⌠ i≤ t∩ bσ replaced« Thσ thirΣ changσ i≤ ì
  113. no⌠ áneedeΣ fo≥ prope≥ operation¼ bu⌠ i⌠ i≤ nicσ t∩ havσ thσ STA╘ RU┬ ámessagσ ì
  114. reflec⌠ thσ ne≈ function.
  115.  
  116. Thσ ánex⌠ changσ i≤ t∩ thσ STA╘ BU╞ command« ME╪ ver∙ ofteε ha≤ áit≤ ácommand≤ ì
  117. returε iε thσ VALU┼ variablσ somσ informatioε developeΣ b∙ tha⌠ function« áFo≥ ì
  118. example¼ áthσ áDI╥ áfunctioε return≤ thσ numbe≥ oµ matchinτ áfile≤ átha⌠ áwerσ ì
  119. found« áUnfortunately¼ áthσ STA╘ BU╞ commanΣ display≤ áinformatioε áabou⌠ áthσ ì
  120. statu≤ áoµ áthσ ácapturσ áanΣ áke∙ macr∩ ábuffer≤ ábu⌠ ádoe≤ áno⌠ áreturε áan∙ ì
  121. informatioε iε VALUE.
  122.  
  123. ╔ áhaΣ writteε ß scrip⌠ fo≥ callinτ u≡ GEniσ anΣ capturinτ m∙ áemai∞ áletters« ì
  124. Wheε á╔ relieΣ oε XON/XOF╞ flo≈ contro∞ t∩ pausσ GEnie'≤ outpu⌠ whilσ ME╪ áwa≤ ì
  125. flushinτ it≤ buffer¼ ╔ founΣ tha⌠ somσ tex⌠ wa≤ sometime≤ lost« T∩ ge⌠ áarounΣ ì
  126. this¼ á╔ manuall∙ closeΣ anΣ reopeneΣ thσ capturσ buffer« Rathe≥ thaε áwastinτ ì
  127. thσ átimσ t∩ d∩ thi≤ afte≥ eacΦ letter¼ ╔ wanteΣ t∩ checδ thσ amoun⌠ oµ áspacσ ì
  128. remaininτ áiε áthσ capturσ buffer« Iµ thi≤ spacσ droppeΣ belo≈ somσ ávaluσ á(╔ ì
  129. thinδ ╔ useΣ 3K)¼ theε ╔ woulΣ closσ anΣ reopeε thσ buffer.
  130.  
  131. Implementinτ áthi≤ functioε requireΣ addinτ somσ ne≈ instruction≤ t∩ thσ ácodσ ì
  132. fo≥ áthσ áSTA╘ áBU╞ command« Thi≤ raiseΣ tw∩ problems║ ho≈ át∩ áta≡ áint∩ áthσ ì
  133. origina∞ codσ anΣ wherσ t∩ pu⌠ thσ ne≈ instructions.
  134.  
  135. Le⌠ áu≤ ástar⌠ witΦ thσ seconΣ problem« WitΦ somσ programs¼ ne≈ ácodσ ácaε ábσ ì
  136. addeΣ a⌠ thσ enΣ oµ thσ origina∞ code« Iµ thσ prograφ place≤ it≤ ruε-timσ datß ì
  137. a⌠ thσ enΣ oµ it≤ code¼ however¼ thi≤ caε obviousl∙ presen⌠ somσ difficulties« ì
  138. Iµ áonσ i≤ patchinτ iε somσ ne≈ initializatioε codσ tha⌠ i≤ performeΣ anΣ ácaε ì
  139. bσ discardeΣ beforσ thσ prograφ start≤ t∩ usσ it≤ datß space¼ theε onσ caε ge⌠ ì
  140. awa∙ áwitΦ this« Wheε ╔ adΣ thi≤ kinΣ oµ patch¼ ╔ tr∙ t∩ havσ i⌠ includσ ácodσ ì
  141. tha⌠ ápatche≤ áou⌠ thσ patcΦ anΣ restore≤ thσ origina∞ ácode« áOtherwise¼ áthσ ì
  142. prograφ canno⌠ safel∙ bσ reruε usinτ thσ G╧ command¼ sincσ thσ patcΦ codσ áma∙ ì
  143. havσ beeε overwritteε b∙ prograφ data« Attemptinτ t∩ executσ datß ha≤ ß wa∙ oµ ì
  144. wreakinτ havoπ witΦ thσ system!
  145.  
  146. Iε áou≥ presen⌠ case¼ wσ arσ addinτ codσ tha⌠ mus⌠ bσ availablσ a⌠ áan∙ átime¼ ì
  147. anΣ áME╪ ácertainl∙ áwrite≤ ádatß int∩ thσ freσ memor∙ áafte≥ áit≤ áowε ácode« ì
  148. Consequently¼ áwσ áhavσ t∩ finΣ somσ spacσ withiε thσ bound≤ oµ áthσ áorigina∞ ì
  149. program« Thσ techniquσ ╔ havσ useΣ herσ i≤ t∩ stea∞ nonessentia∞ interna∞ datß ì
  150. space.
  151.  
  152. ME╪ ánormall∙ ásign≤ oε witΦ ß ver∙ elaboratσ screeε displa∙ átha⌠ átake≤ á34│ ì
  153. byte≤¡-enougΦ rooφ fo≥ ß lo⌠ oµ patcΦ codeí Wσ canno⌠ deletσ al∞ oµ it¼ bu⌠ wσ ì
  154. caε áreplacσ i⌠ witΦ ß mucΦ simple≥ signoε message« Thσ ne≈ onσ iε áthσ ápatcΦ ì
  155. use≤ áonl∙ á3▒ ábyte≤ (iµ ╔ counteΣ correctly)« I⌠ let≤ u≤ kno≈ átha⌠ áwσ áarσ ìèrunninτ thσ specia∞ versioε oµ ME╪ anΣ tell≤ u≤ thσ datσ oµ thσ patch.
  156.  
  157. T∩ ta≡ int∩ thσ origina∞ code¼ wσ choosσ ß convenien⌠ poin⌠ anΣ pu⌠ iε ß ájum≡ ì
  158. instructioε át∩ thσ patcΦ area« Thσ instructioε tha⌠ wσ replaceΣ b∙ tha⌠ ájum≡ ì
  159. i≤ thσ firs⌠ instructioε iε thσ patcΦ area« Theε wσ adΣ thσ additiona∞ codσ t∩ ì
  160. savσ thσ capturσ buffe≥ freσ spacσ valuσ int∩ thσ VALU┼ variable« Finally¼ áwσ ì
  161. returε t∩ thσ origina∞ codσ jus⌠ pas⌠ thσ jum≡ wσ inserted.
  162.  
  163. Thσ áthirΣ áchangσ implementeΣ iε thσ patcΦ concern≤ thσ áBEL╠ ácommand« áThi≤ ì
  164. commanΣ ái≤ áconvenien⌠ t∩ aler⌠ thσ use≥ t∩ somσ event« I⌠ woulΣ bσ ánicσ át∩ ì
  165. havσ áthσ bel∞ rinτ repeatedl∙ unti∞ thσ use≥ signal≤ tha⌠ hσ i≤ read∙ át∩ ág∩ ì
  166. on« Unfortunately¼ thσ commanΣ "BEL╠ 100ó wil∞ insis⌠ oε ringinτ thσ bel∞ áonσ ì
  167. hundreΣ átimes« "BEL╠ 0ó wil∞ insis⌠ oε ringinτ i⌠ 65,00░ timesí Thσ onl∙ áwa∙ ì
  168. onσ ácaε interrup⌠ thσ bel∞ i≤ t∩ pres≤ contro∞-c¼ bu⌠ thi≤ abort≤ thσ áentirσ ì
  169. script« áThσ ápatcΦ áallow≤ an∙ keypres≤ t∩ abor⌠ áthσ áBEL╠ ácommanΣ áwithou⌠ ì
  170. abortinτ thσ entirσ script.
  171.  
  172. Thi≤ ápatcΦ work≤ usinτ ß slightl∙ differen⌠ technique« Thσ BEL╠ codσ áalread∙ ì
  173. contain≤ áß ácal∞ t∩ ß routinσ tha⌠ check≤ fo≥ contro∞-c« Wσ jus⌠ áreplacσ ái⌠ ì
  174. witΦ áß cal∞ t∩ ß ne≈ routinσ iε thσ patcΦ areß tha⌠ check≤ fo≥ an∙ ákeypress« ì
  175. Afte≥ áthi≤ call¼ thσ origina∞ codσ performeΣ ß conditiona∞ jum≡ t∩ exi⌠ áfroφ ì
  176. thσ routine¼ bu⌠ fo≥ reason≤ ╔ don'⌠ remember¼ thi≤ patΦ wa≤ neve≥ taken« áFo≥ ì
  177. ou≥ áne≈ ároutine¼ thσ conditiona∞ ha≤ t∩ bσ switcheΣ froφ ß zer∩ checδ át∩ áß ì
  178. nonzer∩ check.
  179.  
  180. Patchinτ TW.COM
  181.  
  182. Sincσ wσ arσ alread∙ oε thσ subjec⌠ oµ patching¼ thi≤ seem≤ likσ ß gooΣ áplacσ ì
  183. fo≥ ß follo≈-u≡ discussioε oµ m∙ patcΦ iε issuσ #4╡ t∩ makσ TW.COM¼ thσ maste≥ ì
  184. prograφ oµ Thσ WorΣ Plu≤ spel∞ checkinτ program¼ no⌠ sto≡ anΣ asδ thσ use≥ áiµ ì
  185. thσ ácurren⌠ áconfiguratioε i≤ acceptable« Wheε wσ arσ runninτ froφ áaε áalia≤ ì
  186. script¼ wσ jus⌠ wan⌠ t∩ ge⌠ oε witΦ thσ job.
  187.  
  188. Severa∞ ápeoplσ trieΣ implementinτ m∙ patcΦ scrip⌠ anΣ complaineΣ tha⌠ i⌠ ádiΣ ì
  189. no⌠ worδ properly« Thi≤ wa≤ strange¼ becausσ ╔ havσ beeε usinτ i⌠ áconstantly« ì
  190. Ha∞ áVoge∞ finall∙ figureΣ ou⌠ wha⌠ wa≤ goinτ wrong« I⌠ seem≤ tha⌠ átherσ áarσ ì
  191. tw∩ áversion≤ áoµ T╫ iε curren⌠ distribution« Mine¼ whicΦ camσ áwitΦ áWordSta≥ ì
  192. Releasσ á4¼ ái≤ versioε 1.21« Othe≥ peoplσ havσ ß late≥ áversion¼ á1.22« áBotΦ ì
  193. displa∙ áß 198▒ copyright¼ anΣ i⌠ seem≤ odΣ tha⌠ thσ ne≈ versioε áoµ áWordSta≥ ì
  194. woulΣ ácomσ witΦ aε olde≥ versioε oµ TW« I⌠ make≤ mσ wonde≥ whicΦ áversioε ái≤ ì
  195. better.
  196.  
  197. Iε áan∙ ácase¼ versioε 1.2▓ ha≤ threσ byte≤ morσ codσ beforσ m∙ áseconΣ ápatcΦ ì
  198. point¼ anΣ s∩ botΦ thσ addres≤ oµ thσ pokσ anΣ thσ addres≤ pokeΣ iε havσ t∩ bσ ì
  199. incrementeΣ b∙ three« Herσ i≤ thσ origina∞ TWPA╘ alia≤ fo≥ versioε 1.21:
  200.  
  201.      ge⌠ 10░ tw:tw.com
  202.      pokσ 10│ c│ 3Γ 01
  203.      pokσ 39╡ c│ 2ß 04
  204.      g∩ $*
  205.  
  206. Fo≥ versioε 1.22¼ onl∙ thσ seconΣ pokσ ha≤ t∩ bσ changed:
  207. è
  208.         pokσ 39╕ c│ 2Σ 04.
  209.  
  210. Iε ám∙ origina∞ discussion¼ ╔ diΣ no⌠ describσ ho≈ ╔ figureΣ ou⌠ ho≈ t∩ ápatcΦ ì
  211. arounΣ áthσ áprompt« Ha∞ Voge∞ askeΣ abou⌠ m∙ method¼ s∩ ╔ wil∞ sa∙ áß álittlσ ì
  212. abou⌠ i⌠ here« It'≤ thσ leas⌠ ╔ caε d∩ t∩ thanδ hiφ fo≥ solvinτ thσ mystery.
  213.  
  214. ╔ kne≈ tha⌠ thσ offendinτ promp⌠ begaε witΦ "Thesσ arσ thσ curren⌠ ásettings.ó ì
  215. So¼ á╔ ásearcheΣ áwitΦ ß debugge≥ fo≥ tha⌠ text¼ anΣ ╔ founΣ ái⌠ ástartinτ áa⌠ ì
  216. addres≤ 07FFH« Sincσ i⌠ wa≤ par⌠ oµ ß collectioε oµ sucΦ messages¼ al∞ áendinτ ì
  217. witΦ áß ádolla≥ ásign¼ á╔ ákne≈ tha⌠ the∙ werσ áno⌠ ápar⌠ áoµ áiε-linσ ácalls« ì
  218. Therefore¼ áwherσ áthσ ámessagσ áwa≤ actuall∙ ádisplayeΣ átherσ áwoulΣ áalmos⌠ ì
  219. certainl∙ bσ aε instructioε loadinτ thσ addres≤ oµ thσ messagσ int∩ onσ oµ thσ ì
  220. doublσ registers.
  221.  
  222. ╔ áuseΣ thσ DS─ debugger'≤ searcΦ functioε t∩ locatσ occurrence≤ oµ áthσ ábytσ ì
  223. pai≥ FF,07« Thσ firs⌠ onσ wa≤ par⌠ oµ thσ codσ sequence
  224.  
  225.      041π    lΣ   de,07ff
  226.      041µ    cal∞ 17bd
  227.      042▓    cal∞ 17cb
  228.      042╡    c≡   º '
  229.      042╖    j≡   z,02a4
  230.      042a
  231.  
  232. I⌠ áwa≤ prett∙ clea≥ tha⌠ 17bΣ wa≤ thσ routinσ fo≥ displayinτ ß ástrinτ áwhosσ ì
  233. addres≤ wa≤ iε registe≥ pai≥ D┼ anΣ tha⌠ 17cΓ wa≤ thσ routinσ t∩ ge⌠ aε áinpu⌠ ì
  234. characte≥ froφ thσ user« T╫ take≤ ß spacσ characte≥ t∩ indicatσ tha⌠ thσ áuse≥ ì
  235. want≤ át∩ makσ ß change¼ whicΦ mus⌠ bσ handleΣ b∙ thσ codσ a⌠ 02a4« An∙ áothe≥ ì
  236. characte≥ áwoulΣ áaccep⌠ áthσ ádefaul⌠ setu≡ anΣ ácontinuσ áa⌠ áaddres≤ á042a« ì
  237. Therefore¼ changinτ thσ codσ a⌠ 042│ to
  238.  
  239.      042│    j≡   042a
  240.  
  241. woulΣ b∙-pas≤ thσ user'≤ responsσ anΣ g∩ righ⌠ int∩ thσ spel∞ checking.
  242.  
  243. However¼ tha⌠ changσ woulΣ stil∞ senΣ thσ displa∙ oµ thσ promp⌠ t∩ thσ screen« ì
  244. Backinτ áu≡ anΣ puttinτ m∙ replacemen⌠ jum≡ instructioε a⌠ addres≤ 041Σ áwoulΣ ì
  245. suppres≤ eveε thσ displa∙ oµ thσ prompt.
  246.  
  247. A≤ á╔ álookeΣ a⌠ stil∞ earlie≥ code¼ ╔ founΣ instruction≤ tha⌠ ádisplayeΣ áthσ ì
  248. curren⌠ ásettings« áSincσ áwσ reall∙ diΣ no⌠ neeΣ t∩ havσ átheφ ásen⌠ át∩ áthσ ì
  249. screen¼ á╔ continueΣ t∩ worδ bacδ unti∞ ╔ camσ t∩ thσ beginninτ oµ tha⌠ áblocδ ì
  250. oµ codσ a⌠ addres≤ 0395¼ wherσ thσ messagσ "Summary¼ Checkinτ file...ó wa≤ pu⌠ ì
  251. up« B∙ placinτ m∙ jum≡ instructioε there¼ al∞ oµ thi≤ extraneou≤ codσ wa≤ áb∙-ì
  252. passed.
  253.  
  254. Yo⌡ ámigh⌠ ábσ áwonderinτ áho≈ ╔ founΣ thσ placσ wherσ áthσ áothe≥ ápatcΦ áwa≤ ì
  255. required« áWitΦ thσ maiε patcΦ installed¼ T╫ terminateΣ witΦ aε erro≥ ámessagσ ì
  256. abou⌠ áß corrupteΣ file« Guessinτ tha⌠ ß checδ oµ tha⌠ typσ woulΣ bσ nea≥ áthσ ì
  257. beginninτ oµ thσ code¼ ╔ jus⌠ executeΣ TW.CO═ unde≥ thσ debugger« Thσ áprobleφ ì
  258. wa≤ clea≥ ver∙ quickly.
  259. è
  260. Somσ Samplσ ZE╪ Scripts
  261.  
  262. A≤ á╔ mentioneΣ earlier¼ Bridge≥ Mitchell¼ autho≥ oµ ZE╪ versioε 5.0¼ ácovereΣ ì
  263. thσ áspecification≤ fo≥ thσ prograφ iε hi≤ columε iε issuσ #3╕ oµ TCJ« áHavinτ ì
  264. jus⌠ árereaΣ tha⌠ column¼ ╔ havσ t∩ agreσ witΦ thσ comment≤ ╔ receiveΣ tha⌠ áß ì
  265. fe≈ example≤ arσ needeΣ t∩ appreciatσ wha⌠ ZE╪ caε do« ╔ wil∞ assumσ tha⌠ áthσ ì
  266. reade≥ ái≤ áalread∙ familia≥ witΦ thσ basiπ operatioε oµ ZE╪ anΣ ápresen⌠ áthσ ì
  267. onl∙ tw∩ ZE╪ script≤ tha⌠ ╔ usσ regularly.
  268.  
  269. Onσ áoµ áthσ áadvantage≤ á╔ go⌠ froφ writinτ áabou⌠ áthesσ áscript≤ ái≤ áthat¼ ì
  270. naturally¼ áiε áthσ coursσ oµ analyzinτ theφ ╔ though⌠ oµ ne≈ áapproache≤ áanΣ ì
  271. havσ ásignificantl∙ árewritteε them« The∙ d∩ seeφ t∩ work¼ bu⌠ yo⌡ áshoulΣ ábσ ì
  272. warneΣ tha⌠ mistake≤ ma∙ havσ crep⌠ in.
  273.  
  274. Iµ al∞ onσ want≤ t∩ d∩ i≤ ruε ß sequencσ oµ commanΣ lines¼ ╔ don'⌠ thinδ átha⌠ ì
  275. ZE╪ ái≤ thσ righ⌠ approacΦ (thougΦ therσ ma∙ bσ somσ exception≤ tha⌠ á╔ ácan'⌠ ì
  276. thinδ oµ now)« Oε thσ othe≥ hand¼ ZE╪ i≤ appropriatσ¡-iε fact¼ necessar∙¡-wheε ì
  277. onσ áwant≤ no⌠ onl∙ t∩ invokσ ß prograφ bu⌠ als∩ t∩ providσ interactivσ áinpu⌠ ì
  278. t∩ áthσ program« ZE╪ i≤ als∩ usefu∞ fo≥ creatinτ fanc∙ screeε displays¼ ásincσ ì
  279. i⌠ áha≤ thσ abilit∙ t∩ generatσ direc⌠ outpu⌠ t∩ thσ consolσ anΣ át∩ ásuppres≤ ì
  280. outpu⌠ generateΣ b∙ runninτ programs« M∙ tw∩ samplσ script≤ fal∞ primaril∙ áiε ì
  281. thσ forme≥ class.
  282.  
  283. M∙ áfirs⌠ script¼ MAP.ZEX¼ i≤ showε iε Listinτ 2« A≤ yo⌡ see¼ i⌠ i≤ áextremel∙ ì
  284. simple« áI⌠ ái≤ áuseΣ át∩ invokσ thσ MA╨ utilit∙ tha⌠ i≤ ápar⌠ áoµ áthσ áXBIO╙ ì
  285. extendeΣ áBIO╙ fo≥ thσ SB18░ computer« Thi≤ utilit∙ caε temporaril∙ áse⌠ áeacΦ ì
  286. flopp∙ drivσ t∩ emulatσ onσ oµ ß numbe≥ oµ foreigε formats.
  287.  
  288. ╔ áwanteΣ t∩ havσ simplσ alia≤ commands¼ sucΦ a≤ "KP4ó o≥ "MD3"¼ tha⌠ se⌠ áthσ ì
  289. appropriatσ flopp∙ t∩ thσ Kaypr∩ DSD─ o≥ Morro≈ MD│ format« Unfortunately¼ MA╨ ì
  290. i≤ áß ápurel∙ áinteractivσ program╗ choice≤ canno⌠ bσ passeΣ t∩ ái⌠ áfroφ áthσ ì
  291. commanΣ line¼ anΣ s∩ ARUN┌ i≤ powerless« Thi≤ i≤ wherσ ZE╪ come≤ in.
  292.  
  293. Thσ áfirs⌠ ásectioε oµ MAP.ZE╪ i≤ aε extendeΣ comment« Wheε áß á'{º ácharacte≥ ì
  294. appear≤ iε thσ firs⌠ columε oµ ß line¼ al∞ tex⌠ u≡ t∩ thσ firs⌠ closinτ ábracσ ì
  295. characte≥ '}º i≤ treateΣ a≤ ß commen⌠ anΣ ignoreΣ b∙ ZEX« ╔ strongl∙ recommenΣ ì
  296. usinτ comment≤ extensively¼ a≤ witΦ an∙ othe≥ programminτ language.
  297.  
  298. Thσ firs⌠ noε-blank¼ noε-commen⌠ linσ invoke≤ thσ MA╨ program¼ whicΦ ╔ kee≡ iε ì
  299. director∙ áB0:« Thσ nex⌠ linσ i≤ thσ onσ tha⌠ doe≤ thσ specia∞ joΓ átha⌠ áonl∙ ì
  300. ZE╪ ácaε ádo« Line≤ tha⌠ begiε witΦ ß '<º characte≥ iε thσ áfirs⌠ ácolumε áarσ ì
  301. interpreteΣ a≤ prograφ inpu⌠ b∙ ZEX¼ whicΦ proceed≤ t∩ emulatσ you≥ typinτ áa⌠ ì
  302. thσ ákeyboard« áIε thi≤ case¼ thσ firs⌠ characte≥ emulateΣ i≤ 'G'« áThσ áfirs⌠ ì
  303. inpu⌠ tha⌠ MA╨ expect≤ i≤ thσ lette≥ oµ thσ drivσ t∩ configure« Sincσ al∞ áthσ ì
  304. foreigε format≤ ╔ usσ arσ fo≥ 4╕-tpΘ drives¼ ╔ alway≤ usσ m∙ ╟ drive.
  305.  
  306. Next¼ áMA╨ áwant≤ onσ t∩ selec⌠ ß forma⌠ b∙ number« Thi≤ wσ pas≤ át∩ áthσ áZE╪ ì
  307. scrip⌠ áa≤ áß paramete≥ oε thσ ZE╪ commanΣ line¼ anΣ wσ represen⌠ ái⌠ áiε áthσ ì
  308. scrip⌠ witΦ thσ symbo∞ "$1"« MA╨ theε want≤ ß carriagσ return« ZE╪ i≤ supposeΣ ì
  309. t∩ ignorσ carriagσ return≤ iε thσ script¼ anΣ s∩ wσ shoulΣ includσ thσ specia∞ ì
  310. directivσ á"|CR|"« However¼ fo≥ reason≤ unknowε t∩ me¼ átria∞-anΣ-erro≥ áshow≤ ìètha⌠ áthi≤ ái≤ áno⌠ necessar∙ here╗ ß carriagσ returε ái≤ ásen⌠ áautomaticall∙ ì
  311. whethe≥ wσ wan⌠ onσ o≥ not.
  312.  
  313. MAP.ZE╪ i≤ aε incredibl∙ simplσ script¼ bu⌠ i⌠ provide≤ ß lo⌠ oµ power« ╔ ácaε ì
  314. no≈ definσ thσ followinτ ARUN┌ aliases:
  315.  
  316.   CLEAR=CL╥     ze° b0:ma≡ 1;msg
  317.   KP4=KP1░      /xxma≡ ╕ KP4
  318.   MD│           /xxma≡ ╣ MD3
  319.   TV,80│        /xxma≡ 2╕ TV803
  320.   XXMA╨         ze° b0:ma≡ $1;msτ **¬ Drivσ ╟ ╜ $▓ ***
  321.   MS╟           ech∩ ^[f$*
  322.  
  323. Thesσ áscript≤ áimplemen⌠ thσ nicet∙ oµ puttinτ ß messagσ iε thσ áuppe≥ árigh⌠ ì
  324. specia∞ messagσ areß oε m∙ Wysσ 5░ termina∞ t∩ reminΣ mσ oµ thσ foreigε forma⌠ ì
  325. setting« áI⌠ i≤ no⌠ reasonablσ t∩ tr∙ t∩ remembe≥ thσ specia∞ escapσ ásequencσ ì
  326. fo≥ programminτ thi≤ messagσ area¼ s∩ ╔ providσ thσ alia≤ MS╟ t∩ d∩ this.
  327.  
  328. ┴ áseconΣ ásubroutinσ áalias¼ áXXMAP¼ save≤ spacσ iε áthσ áALIAS.CM─ áfilσ áb∙ ì
  329. handlinτ ácommand≤ ácommoε át∩ áß ánumbe≥ áoµ áothe≥ áaliases« áI⌠ átake≤ átw∩ ì
  330. parameters« áThσ firs⌠ i≤ thσ forma⌠ numbe≥ fo≥ MAP¼ anΣ i⌠ i≤ passeΣ át∩ áthσ ì
  331. MA╨ ZE╪ script« Thσ seconΣ i≤ thσ namσ oµ thσ format¼ anΣ i⌠ i≤ passeΣ t∩ áthσ ì
  332. MS╟ alias« Thσ othe≥ aliases¼ sucΦ a≤ MD3¼ se⌠ u≡ thσ desireΣ disδ format« Thσ ì
  333. alia≤ CL╥ o≥ CLEA╥ restore≤ drivσ ╟ t∩ it≤ defaul⌠ SB18░ forma⌠ (MA╨ selectioε ì
  334. 1).
  335.  
  336. Thσ seconΣ examplσ scrip⌠ i≤ calleΣ FORMAT.ZE╪ i≤ showε iε Listinτ 3« I⌠ work≤ ì
  337. witΦ anothe≥ XBIO╙ utilit∙ program¼ FVC─ (Forma⌠ Verif∙ Cop∙ Duplicate)« áThi≤ ì
  338. prograφ ácaε forma⌠ diskette≤ no⌠ onl∙ iε thσ standarΣ SB18░ format≤ bu⌠ áals∩ ì
  339. iε ásevera∞ foreigε formats« FVCD¼ likσ MAP¼ i≤ ß purel∙ interactivσ áprogram¼ ì
  340. bu⌠ ╔ wan⌠ t∩ bσ ablσ t∩ format¼ say¼ ß Kaypr∩ ▓ disδ b∙ enterinτ jus⌠ "FORMA╘ ì
  341. KP2"« Again¼ ZE╪ save≤ thσ day.
  342.  
  343. Thi≤ áscrip⌠ ái≤ ámucΦ morσ complicated« Sincσ ╔ wan⌠ al∞ thσ áformat≤ át∩ ábσ ì
  344. handleΣ áb∙ áß ácommoε áalia≤ calleΣ FORMAT¼ thσ áparticula≥ áforma⌠ áwil∞ ábσ ì
  345. designateΣ b∙ ß commanΣ-linσ argumen⌠ anΣ no⌠ b∙ thσ namσ oµ thσ command« Thi≤ ì
  346. require≤ átestinτ áoµ thσ argument¼ ß joΓ tha⌠ caε bσ performeΣ ánicel∙ áb∙ áß ì
  347. sequencσ áoµ áflo≈-contro∞ commands« Tha⌠ mucΦ coulΣ bσ handleΣ b∙ áß ácommanΣ ì
  348. alias¼ ábu⌠ sincσ wσ wil∞ bσ providinτ interactivσ inpu⌠ anyway¼ wσ ámigh⌠ áa≤ ì
  349. wel∞ havσ ZE╪ takσ carσ oµ everything.
  350.  
  351. A≤ witΦ MAP.ZEX¼ wσ begiε thσ scrip⌠ witΦ ß commen⌠ block« Notσ tha⌠ ß ádoublσ ì
  352. semicoloε ácaε bσ useΣ t∩ ente≥ individua∞ comment≤ oε ß line« Thσ áfirs⌠ átw∩ ì
  353. executablσ line≤ tes⌠ thσ firs⌠ argument¼ "$1"¼ t∩ seσ iµ i⌠ i≤ eithe≥ "Fó áo≥ ì
  354. "F:"« Thσ coloε prefi° beforσ thσ paramete≥ i≤ includeΣ t∩ forcσ thσ áargumen⌠ ì
  355. t∩ ábσ átreateΣ a≤ ß strinτ anΣ no⌠ a≤ ß director∙ specificatioε áeveε áiµ ái⌠ ì
  356. contain≤ áß ácolon« Fo≥ reason≤ ╔ canno⌠ entirel∙ remember¼ thσ áflo≈ ácontro∞ ì
  357. strinτ¡ áequatσ testinτ commanΣ doe≤ no⌠ worδ properl∙ iµ i⌠ begin≤ witΦ ájus⌠ ì
  358. ":"« Fo≥ tha⌠ reason¼ ╔ pu⌠ thσ definitσ strinτ firs⌠ anΣ thσ strinτ witΦ áthσ ì
  359. paramete≥ second.
  360.  
  361. No≈ wσ comσ t∩ ß ver∙ importan⌠ ZE╪ directive║ |iµ true|« Thi≤ directivσ tell≤ ìèZE╪ át∩ áignorσ al∞ character≤ u≡ t∩ thσ closinτ |endifⁿ iµ thσ ácurren⌠ áflo≈ ì
  362. statσ ái≤ false« Yo⌡ migh⌠ wonde≥ wh∙ onσ woulΣ neeΣ this¼ sincσ áthσ ácommanΣ ì
  363. processo≥ woulΣ ignorσ command≤ anyway« Thσ answe≥ i≤ tha⌠ thσ scrip⌠ contain≤ ì
  364. materia∞ othe≥ thaε commands« I⌠ contain≤ interactivσ inpu⌠ anΣ direc⌠ consolσ ì
  365. output« Thσ |iµ trueⁿ anΣ |endifⁿ directive≤ makσ surσ tha⌠ thesσ arσ áignoreΣ ì
  366. a≤ well.
  367.  
  368. Afte≥ ZE╪ processe≤ ß command¼ sucΦ a≤ thσ linσ "b0:fvcd"¼ anΣ send≤ i⌠ t∩ thσ ì
  369. commanΣ áprocessor¼ ái⌠ álook≤ áa⌠ thσ nex⌠ line« Iµ ái⌠ ábegin≤ áwitΦ áß á'<º ì
  370. characte≥ iε thσ firs⌠ column¼ theε al∞ thσ character≤ oε tha⌠ linσ u≡ t∩ ábu⌠ ì
  371. no⌠ áincludinτ thσ endinτ carriagσ returε arσ loadeΣ int∩ ß ákeystrokσ ábuffe≥ ì
  372. anΣ áfed¼ a≤ requested¼ a≤ interactivσ inpu⌠ t∩ thσ runninτ program« áIε áthi≤ ì
  373. example¼ wσ senΣ "OSXTFF2"¼ jus⌠ a≤ iµ wσ presseΣ thosσ seveε key≤ manually.
  374.  
  375. Wσ als∩ senΣ ß carriagσ return¼ specifieΣ b∙ thσ |crⁿ directive« A≤ noteΣ witΦ ì
  376. thσ áMAP.ZE╪ script¼ ZE╪ automaticall∙ send≤ onσ carriagσ return¼ bu⌠ wσ áneeΣ ì
  377. tw∩ áfo≥ thi≤ operation« Wσ won'⌠ bothe≥ t∩ explaiε wha⌠ al∞ thosσ ácharacter≤ ì
  378. d∩ iε FVCD« T∩ figurσ ou⌠ wha⌠ t∩ include¼ onσ jus⌠ run≤ thσ prograφ ámanuall∙ ì
  379. anΣ make≤ notσ oµ ever∙ ke∙ pressed.
  380.  
  381. Thi≤ simulateΣ inpu⌠ start≤ thσ firs⌠ diskettσ formatting« Wheε tha⌠ operatioε ì
  382. i≤ ácomplete¼ áFVC─ want≤ morσ use≥ input« Sincσ thσ nex⌠ ZE╪ álinσ ádoe≤ áno⌠ ì
  383. begiε witΦ ß '<'¼ ZE╪ n∩ longe≥ supplie≤ thσ inpu⌠ anΣ return≤ contro∞ t∩ áthσ ì
  384. user« Morσ diskette≤ caε bσ formatteΣ manually.
  385.  
  386. Wheε áonσ eventuall∙ exit≤ froφ FVCD¼ thσ ZE╪ scrip⌠ continue≤ witΦ áthσ álinσ ì
  387. "|say|"« áThi≤ áturn≤ áoε direc⌠ consolσ output« áText¼ áthi≤ átimσ áincludinτ ì
  388. carriagσ returns¼ linσ feeds¼ anΣ almos⌠ al∞ othe≥ character≤ iε thσ file¼ ái≤ ì
  389. sen⌠ ádirectl∙ át∩ thσ screen¼ unti∞ thσ terminatinτ |enΣ ásayⁿ ádirectivσ ái≤ ì
  390. encountered« áThσ directivσ |"|¼ seeε late≥ iε thσ script¼ i≤ ß ámorσ ácompac⌠ ì
  391. alternativσ át∩ á|sayⁿ áanΣ |enΣ say|« I⌠ automaticall∙ átoggle≤ áthσ áconsolσ ì
  392. outpu⌠ state.
  393.  
  394. Wσ coulΣ havσ useΣ thσ ECH╧ commanΣ t∩ displa∙ thi≤ message¼ bu⌠ ZEX'≤ ádirec⌠ ì
  395. screeε outpu⌠ i≤ easie≥ anΣ morσ convenient¼ a≤ i⌠ i≤ casσ sensitive« Yo⌡ jus⌠ ì
  396. writσ thing≤ a≤ yo⌡ wan⌠ theφ t∩ looδ oε thσ screen.
  397.  
  398. Oncσ áwσ áarσ finisheΣ witΦ thσ formatting¼ wσ caε terminatσ áthσ áZE╪ áscrip⌠ ì
  399. immediately« Thi≤ i≤ donσ witΦ thσ |abortⁿ directive« I⌠ automaticall∙ return≤ ì
  400. thσ flo≈ statσ t∩ it≤ origina∞ condition¼ s∩ wσ d∩ no⌠ havσ t∩ worr∙ abou⌠ thσ ì
  401. fac⌠ thσ wσ havσ no⌠ executeΣ thσ "FIó commanΣ tha⌠ balance≤ thσ "IFó ácommanΣ ì
  402. earlier.
  403.  
  404. Thσ áres⌠ oµ thσ scrip⌠ jus⌠ proceed≤ t∩ tes⌠ fo≥ othe≥ argument≤ anΣ t∩ ápas≤ ì
  405. thσ áappropriatσ áinpu⌠ át∩ áFVCD« Thσ onl∙ onσ oµ áthesσ áothe≥ ácase≤ áwortΦ ì
  406. commentinτ áoε i≤ thσ manua∞ formattinτ casσ nea≥ thσ enΣ oµ thσ script« áHerσ ì
  407. wσ ásimulatσ inpu⌠ onl∙ t∩ pu⌠ FVC─ iε forma⌠ modσ witΦ automatiπ áDateStampe≥ ì
  408. initializatioε enableΣ bu⌠ no⌠ t∩ selec⌠ an∙ forma⌠ o≥ t∩ star⌠ thσ operation« ì
  409. Wσ ámus⌠ suppres≤ thσ automatiπ carriagσ returε tha⌠ ZE╪ generate≤ á(otherwisσ ì
  410. formattinτ áwil∞ ástar⌠ áimmediatel∙ áiε somσ ádefaul⌠ áformat)« áThσ á|untilⁿ ì
  411. directivσ stop≤ simulateΣ inpu⌠ unti∞ ß carriagσ returε i≤ entered.
  412.  
  413. èM∙ ZMAT┼ Autoexeπ Macro
  414.  
  415. Thσ tw∩ ZE╪ script≤ werσ needeΣ primaril∙ becausσ thσ tw∩ program≤ MAP.CO═ anΣ ì
  416. FVCD.CO═ ádiΣ áno⌠ providσ ß facilit∙ fo≥ designatinτ option≤ oε áthσ ácommanΣ ì
  417. line« áAmpr∩ alway≤ madσ ß particula≥ poin⌠ oµ providinτ sucΦ ß facilit∙ áwitΦ ì
  418. it≤ utilit∙ programs¼ anΣ ╔ wisΦ al∞ author≤ woulΣ d∩ that« I⌠ i≤ nicσ t∩ havσ ì
  419. interactivσ programs¼ bu⌠ i⌠ shoulΣ bσ possiblσ t∩ ruε theφ "batcΦ modeó too.
  420.  
  421. WitΦ áß worΣ processo≥ o≥ edito≥ onσ expect≤ thσ commanΣ linσ tai∞ t∩ áincludσ ì
  422. thσ áname≤ oµ an∙ file≤ t∩ worδ with« Indeed¼ thi≤ i≤ ZMATE'≤ defaul⌠ áaction« ì
  423. However¼ átherσ áarσ man∙ situation≤ iε whicΦ onσ woulΣ likσ t∩ d∩ ámore« áFo≥ ì
  424. example¼ onσ migh⌠ wan⌠ t∩ star⌠ ZMAT┼ witΦ ß macr∩ alread∙ loadeΣ int∩ onσ oµ ì
  425. thσ áauxiliar∙ ábuffers« áOnσ ámigh⌠ áeveε wan⌠ átha⌠ ámacr∩ át∩ ábσ áexecuteΣ ì
  426. immediately« áTha⌠ macr∩ migh⌠ eveε carr∙ thing≤ t∩ thσ poin⌠ oµ áclosinτ áthσ ì
  427. filσ anΣ exitinτ froφ ZMATEí Iε tha⌠ wa∙ onσ coulΣ usσ ZMAT┼ t∩ creatσ ácustoφ ì
  428. tex⌠ processors.
  429.  
  430. Ho≈ ái≤ thi≤ done┐ Iε aε earlie≥ columε ╔ describeΣ thσ permanen⌠ ámacr∩ áareß ì
  431. (PMA⌐ iε thσ ZMAT┼ tex⌠ editor« Thi≤ buffe≥ areß iε thσ codσ contain≤ ß se⌠ oµ ì
  432. macro≤ átha⌠ becomσ ß permanen⌠ par⌠ oµ ZMAT┼ anΣ arσ availablσ a⌠ al∞ átimes« ì
  433. Thσ firs⌠ macr∩ iε thσ PM┴ caε bσ designateΣ a≤ aε autoexeπ macr∩ b∙ placinτ ß ì
  434. contro∞-╙ iε fron⌠ oµ i⌠ insteaΣ oµ thσ usua∞ contro∞-X« A≤ sooε a≤ ZMAT┼ áha≤ ì
  435. loadeΣ anΣ initializeΣ itselµ¡-anΣ beforσ i⌠ open≤ an∙ file≤¡-i⌠ execute≤ thi≤ ì
  436. autoexeπ macro.
  437.  
  438. Herσ ái≤ áß áver∙ simplσ examplσ oµ ß tex⌠ filte≥ ácreateΣ áusinτ áthi≤ áZMAT┼ ì
  439. facility« Supposσ wσ havσ ß macr∩ tha⌠ open≤ ß file¼ goe≤ througΦ i⌠ áchanginτ ì
  440. eacΦ áoµ áit≤ character≤ t∩ uppe≥ case¼ save≤ thσ file¼ anΣ exits« Iµ áwσ ápu⌠ ì
  441. thi≤ ámacr∩ int∩ thσ PM┴ a≤ thσ autoexeπ macr∩ anΣ theε clonσ ZMAT┼ áwitΦ áthσ ì
  442. commanΣ "XDupcase$"¼ wσ wil∞ havσ ß filσ calleΣ UPCASE.COM« Theε wσ caε áente≥ ì
  443. ß commanΣ like
  444.  
  445.      upcasσ infilσ outfile
  446.  
  447. t∩ perforφ thσ casσ conversioε oε ß file« Thi≤ i≤ jus⌠ ß trivia∞ example« WitΦ ì
  448. thσ áful∞ facilitie≤ oµ ZMAT┼ macros¼ onσ caε easil∙ writσ somσ ver∙ ápowerfu∞ ì
  449. filters.
  450.  
  451. Wha⌠ ╔ wan⌠ t∩ describσ no≈ i≤ thσ autoexeπ macr∩ tha⌠ ╔ havσ installeΣ iε ám∙ ì
  452. standarΣ áversioε áoµ áZMAT┼ (nameΣ EDIT.COM)« Wσ migh⌠ cal∞ ái⌠ áaε áindirec⌠ ì
  453. macro¼ ásincσ i⌠ allow≤ onσ t∩ specif∙ ß macr∩ fo≥ automatiπ executioε oε áthσ ì
  454. commanΣ line« Somσ samplσ command≤ wil∞ illustratσ ho≈ thi≤ works.
  455.  
  456.      edi⌠ source.z8░ ñ b9σ xicomment.matñ bte
  457.  
  458. Thσ ápar⌠ áoµ áthσ ácommanΣ u≡ t∩ ß firs⌠ dolla≥ sigε i≤ átakeε áa≤ áthσ áfilσ ì
  459. specification« áIε áthi≤ case¼ thσ assemble≥ sourcσ filσ áSOURCE.Z8░ áwil∞ ábσ ì
  460. opened« áIε áaddition¼ thσ macr∩ followinτ thσ dolla≥ sigε wil∞ ábσ áexecuted« ì
  461. Thi≤ ámacr∩ goe≤ t∩ edi⌠ buffe≥ 9¼ read≤ iε thσ filσ COMMENT.MA╘ containinτ áß ì
  462. macr∩ áfo≥ reformattinτ assembl∙ codσ comments¼ anΣ theε return≤ t∩ áthσ ámaiε ì
  463. editinτ buffer« Thσ followinτ ARUN┌ alia≤ caε automatσ thi≤ (remembe≥ tha⌠ onσ ì
  464. need≤ doublσ dolla≥ sign≤ t∩ represen⌠ ß singlσ '$º characte≥ iε thσ áexpandeΣ ìèscript):
  465.  
  466.      ZED,I╘  edi⌠ $1.z8░ $ñ b9σ xicomment.mat$ñ bte
  467.  
  468. No≈ wheε ╔ wan⌠ t∩ worδ oε ß Z8░ assemble≥ prograφ filσ calleΣ PROG.Z80¼ ╔ caε ì
  469. ente≥ thσ simplσ command
  470.  
  471.      zeΣ prog
  472.  
  473. Herσ ái≤ áß samplσ commanΣ linσ fo≥ editinτ m∙ ALIAS.CM─ filσ áwitΦ áautomatiπ ì
  474. searchinτ fo≥ thσ alia≤ definitioε wσ jus⌠ showed.
  475.  
  476.      aleΣ zed
  477.  
  478. Thσ definitioε fo≥ ALE─ is
  479.  
  480.      ALE─ iµ n⌡ $1;edi⌠ ram:alias.cmd;else;
  481.           edi⌠ ram:alias.cmΣ $ñ σ s^m$1$$;fi
  482.  
  483. Iµ án∩ ásearcΦ ástrinτ i≤ given¼ thσ alia≤ jus⌠ edit≤ thσ file« áIµ áß ástrinτ ì
  484. argumen⌠ ái≤ given¼ theε ZMAT┼ i≤ passeΣ ß macr∩ t∩ searcΦ fo≥ thσ ástrinτ áa⌠ ì
  485. thσ ábeginninτ áoµ ß line« Thσ care⌠ followeΣ b∙ aε 'mº i≤ áinterpreteΣ áa≤ áß ì
  486. contro∞-═ o≥ carriagσ return.
  487.  
  488. ┴ full∙ commenteΣ versioε oµ thσ autoexeπ alia≤ i≤ giveε iε Listinτ 4« Sincσ ╔ ì
  489. tenΣ t∩ usσ buffer≤ froφ botΦ ends¼ keepinτ tex⌠ iε thσ lo≈-numbe≥ buffer≤ anΣ ì
  490. macro≤ áiε áthσ higΦ-numbereΣ buffers¼ fo≥ thσ autoexeπ macr∩ ╔ usσ áß ámiddlσ ì
  491. buffer¼ ánumbe≥ á5« áThσ ámacr∩ switche≤ t∩ i⌠ anΣ átheε áinsert≤ áthσ ástrinτ ì
  492. argumen⌠ passeΣ oε thσ ZMAT┼ commanΣ line« ZMAT┼ ha≤ thσ specia∞ strinτ symbo∞ ì
  493. contro∞-┴-coloε fo≥ this« [Iε thσ listing¼ contro∞ character≤ arσ indicateΣ b∙ ì
  494. leadinτ carets¼ anΣ escapσ character≤ arσ showε a≤ dolla≥ signs« However¼ somσ ì
  495. oµ áthσ ácharacter≤ reall∙ arσ dolla≥ signs¼ anΣ yo⌡ wil∞ áhavσ át∩ ádeterminσ ì
  496. whicΦ arσ whicΦ b∙ thσ context.]
  497.  
  498. Thσ ánex⌠ áblocδ oµ codσ iε thσ macr∩ remove≤ an∙ leadinτ space« Iµ átherσ ái≤ ì
  499. theε ánothinτ áleft¼ áthσ maiε tex⌠ buffe≥ i≤ reselected¼ áanΣ áthσ ámacr∩ ái≤ ì
  500. aborted.
  501.  
  502. Thσ ánex⌠ tasδ i≤ t∩ spli⌠ an∙ argument≤ passeΣ int∩ thosσ tha⌠ specif∙ áfile≤ ì
  503. anΣ áthosσ átha⌠ ácomprisσ ß macr∩ t∩ execute« Thσ ácodσ ábegin≤ áb∙ ácheckinτ ì
  504. whethe≥ áthσ firs⌠ characte≥ i≤ ß dolla≥ sigε anΣ savinτ thi≤ áinformatioε áoε ì
  505. thσ stack« Iµ thσ firs⌠ characte≥ i≤ '$'¼ theε n∩ edi⌠ filσ wa≤ specified¼ anΣ ì
  506. thσ áres⌠ áoµ thσ linσ i≤ ß macro« Otherwise¼ wσ tr∙ searchinτ áfo≥ áß ádolla≥ ì
  507. sign« áIµ áonσ i≤ found¼ everythinτ beforσ i⌠¡-whicΦ specifie≤ áthσ áfile≤ át∩ ì
  508. opeε¡-i≤ ámoveΣ át∩ buffe≥ 0« Iµ nonσ i≤ found¼ wσ wil∞ bσ a⌠ thσ enΣ áoµ áthσ ì
  509. buffer¼ anΣ thσ entirσ tex⌠ wil∞ bσ treateΣ a≤ thσ filσ specification.
  510.  
  511. Thσ ánex⌠ áblocδ áoµ codσ perform≤ somσ specia∞ interpretatioε áoε áan∙ ámacr∩ ì
  512. commanΣ tha⌠ remains« Sincσ thσ CP/═ commanΣ linσ impose≤ somσ limitation≤ áoε ì
  513. thσ character≤ tha⌠ caε bσ passed¼ wσ providσ mean≤ fo≥ indicatinτ thosσ átha⌠ ì
  514. canno⌠ ábσ pu⌠ int∩ thσ commanΣ line« Wheε ß doublσ quotσ characte≥ i≤ áfound¼ ì
  515. i⌠ áái≤ ádeleted¼ áanΣ áthσ ánex⌠ ácharacte≥ ái≤ áalloweΣ át∩ áápas≤ ááwithou⌠ ìèinterpretation« áOtherwise¼ thσ followinτ specia∞ conversion≤ takσ place║ á(1⌐ ì
  516. al∞ áalphabetiπ ácharacter≤ arσ converteΣ froφ uppe≥ casσ t∩ lowe≥ ácase╗ á(2⌐ ì
  517. dolla≥ ásign≤ arσ converteΣ t∩ escapσ characters╗ (3⌐ ß care⌠ i≤ ádeleteΣ áanΣ ì
  518. thσ characte≥ afte≥ i⌠ i≤ converteΣ int∩ thσ correspondinτ contro∞ character.
  519.  
  520. Oncσ áthσ macr∩ iε buffe≥ ╡ ha≤ beeε full∙ interpreted¼ wσ switcΦ bacδ t∩ áthσ ì
  521. maiε áeditinτ buffer« Iµ thσ Booleaε valuσ oε thσ stacδ i≤ true¼ theε wσ áopeε ì
  522. thσ file≤ (usinτ thσ "XFó macro⌐ specifieΣ b∙ thσ strinτ iε buffe≥ 0« ╔ ádon'⌠ ì
  523. thinδ áwσ átalkeΣ abou⌠ thi≤ beforσ¡-a⌠ leas⌠ no⌠ iε detai∞¡-bu⌠ áthi≤ ái≤ áaε ì
  524. examplσ áoµ thσ wa∙ ZMAT┼ caε usσ thσ content≤ oµ buffer≤ a≤ strinτ áargument≤ ì
  525. fo≥ othe≥ macr∩ commands« Thi≤ greatl∙ enhance≤ ZMATE'≤ power.
  526.  
  527. Thσ ámacr∩ complete≤ it≤ worδ witΦ threσ morσ steps« Buffe≥ ░ i≤ cleareΣ áout« ì
  528. Theε áthσ ámacr∩ iε buffe≥ ╡ i≤ executed« Finally¼ buffe≥ ╡ ái≤ ácleareΣ áout« ì
  529. That'≤ al∞ fo≥ thσ macro¼ anΣ that'≤ al∞ fo≥ thi≤ columní Seσ yo⌡ agaiε iε thσ ì
  530. nex⌠ issue« 
  531.  
  532. LISTIN╟ 1
  533. ╗ Program║              MEXPAT.Z80
  534. ╗ Author║               Ja∙ Sage
  535. ╗ Created║              Junσ 10¼ 1990
  536. ╗ Las⌠ Modified║        Octobe≥ 8¼ 1990
  537.  
  538. ╗ Thi≤ filσ contain≤ ß collectioε oµ patche≤ madσ t∩ Me°-
  539. ╗ Plus¼ versioε 1.65.
  540.  
  541. ╗ Thσ followinτ patche≤ arσ included:
  542. ;
  543. ╗    1« Changσ thσ functioε oµ thσ backspacσ-t∩-rubout
  544. ╗       conversioε functioε t∩ d∩ thσ reversσ ¡¡ make
  545. ╗       pressinτ thσ rubout/deletσ ke∙ generatσ ß backspace
  546. ╗       character«  Thi≤ patcΦ coulΣ bσ useΣ t∩ perforφ the
  547. ╗       conversioε oµ an∙ singlσ characte≥ int∩ an∙ other
  548. ╗       singlσ character«  Thi≤ functioε i≤ invokeΣ b∙ the
  549. ╗       STA╘ RU┬ [ON|OFF▌ command.
  550. ;
  551. ╗    2« Augmen⌠ thσ STA╘ BUFFE╥ commanΣ s∩ tha⌠ thσ amount
  552. ╗       oµ freσ spacσ iε thσ capturσ buffe≥ i≤ returneΣ in
  553. ╗       thσ VALU┼ variable«  ME╪ script≤ caε theε checδ on
  554. ╗       thσ remaininτ spacσ anΣ decidσ t∩ flusΦ thσ buffer
  555. ╗       manuall∙ a⌠ convenien⌠ time≤ anΣ t∩ avoiΣ overflow
  556. ╗       problem≤ tha⌠ caε occu≥ wheε relyinτ oε XON/XOFF
  557. ╗       control.
  558. ;
  559. ╗    3« Augmen⌠ thσ BEL╠ commanΣ s∩ tha⌠ pressinτ an∙ key
  560. ╗       wil∞ terminatσ it«  Thσ standarΣ ME╪ BEL╠ command
  561. ╗       caε bσ cancelleΣ onl∙ b∙ contro∞-C¼ bu⌠ this
  562. ╗       terminate≤ thσ entirσ script«  No≈ thσ bel∞ can
  563. ╗       sounΣ unti∞ thσ operato≥ presse≤ ß noε-abor⌠ key¼ at
  564. ╗       whicΦ poin⌠ thσ scrip⌠ wil∞ proceed.
  565.  
  566. ╗ Addresse≤ iε standarΣ code
  567. è
  568. ilprin⌠     eq⌡ 0724fΦ          ╗ Iε-linσ print
  569. hlsubde2    equ 0417ah          ; Subtraction of DE from HL
  570. capstats    equ 06eafh          ; CAPSTATS function
  571. scrollconin equ 049d3h          ; Console input
  572. getconstat  equ 049c5h          ; Console status
  573. bell2       equ 046c2h          ; BELL2 entry point
  574.  
  575. val     equ     00d64h          ; VALUE variable
  576.  
  577. logo    equ     02662h          ; LOGO entry point
  578. endlogo equ     027b9h          ; First byte past LOGO code
  579.  
  580. saycap  equ     06ea6h          ; Point to patch in
  581.                                 ; ...SAYCAPSTATS
  582. bellins equ     046aeh + 10     ; Point to patch in BELL
  583.  
  584. oldkey  equ     5351h           ; Place where key typed by
  585.                                 ; ...user is detected
  586. newkey  equ     535dh           ; Place where new character
  587.                                 ; ...is substituted
  588. idstr   equ     62a6h           ; Place where STAT command
  589.                                 ; ...message is defined
  590.  
  591. bs      equ       8             ; Backspace character
  592. lf      equ      10             ; Linefeed
  593. cr      equ      13             ; Carriage return
  594. rubout  equ     127             ; Rubout character
  595.  
  596. ; ---------------------------------------------------------
  597.  
  598. ; Standard MEX-Plus has a very elaborate signon screen that
  599. ; affords a perfect place to put the code we need for our
  600. ; patches.  The first thing we do is to replace the LOGO
  601. ; routine with a minimal message.
  602.  
  603.         org     logo
  604.  
  605.         call    ilprint
  606.         db      cr,lf
  607.         db      'MEX v 1.65Z, 06/10/90'
  608.         db      cr,lf,lf,0
  609.         ret
  610.  
  611. ; Make the STAT BUFFER command put the amount of free
  612. ; capture buffer space into the VALUE variable.  We do this
  613. ; by patching some extra code into the SAYCAPSTATS routine.
  614.  
  615. cappat:
  616.         call    capstats        ; Get status info on capture
  617.                                 ; ...buffer
  618.         push    hl
  619. è        ld      h,b             ; Free space (BC) into HL
  620.         ld      l,c
  621.         ld      (val),hl        ; Put it into VALUE
  622.         pop     hl
  623.         jp      capcont
  624.  
  625. ; This is a new routine that checks to see if ANY key has
  626. ; been pressed, not just control-c.  It will be used in the
  627. ; patched BELL routine.
  628.  
  629. chkchar:
  630.         call    getconstat      ; See if key pressed
  631.         ret     z               ; Return now if not
  632. flush:
  633.         call    scrollconin     ; Read in the character
  634.         or      a               ; Set flag to nonzero
  635.         ret
  636.  
  637. ; ---------------------------------------------------------
  638.  
  639. ; Code for cutting into the original code in CAPSTATS
  640.  
  641.         org     saycap
  642.         jp      cappat
  643. capcont:
  644.  
  645. ; ---------------------------------------------------------
  646.  
  647. ; Code for patching the original code in BELL
  648.  
  649.         org     bellins
  650.         call    chkchar         ; See if key pressed
  651.         jp      nz,bell2        ; If so, cancel BELL command
  652.  
  653. ; ---------------------------------------------------------
  654.  
  655. ; Patch to backspace-to-rubout conversion function
  656.  
  657.         org     oldkey
  658.  
  659. db      rubout
  660.  
  661.         org     newkey
  662.  
  663. db      bs
  664.  
  665.         org     idstr
  666.  
  667. ;       'bs-to-rub conversn'    ; String in standard MEX
  668. db      'rub-to-bs conversn'    ; You must fill same space
  669.  
  670.         end
  671. è
  672.  
  673. LISTIN╟ 2
  674. {
  675. MAP.ZEX
  676.  
  677. This ZEX5 script runs the XBIOS MAP utility that sets
  678. a drive to a designated virtual disk format.  Since
  679. MAP itself does not allow command-line parameters, ZEX
  680. is used to pass a parameter.  We use foreign formats
  681. only on the 48-tpi drive G: and hence always supply the
  682. input "G".  The argument to the script is the number of
  683. the desired format.
  684. }
  685.  
  686. b0:map
  687. <G$1
  688.  
  689. LISTIN╟ 3
  690. {
  691. FORMAT.ZEX
  692.  
  693. This ZEX5 script invokes the XBIOS format program FVCD
  694. and feeds it input to perform the desired diskette
  695. formatting operation.  The following arguments are
  696. recognized:
  697.  
  698.    <none>       manual operation of FVCD
  699.    F or F:      SB180 DSQD format in drive F
  700.    G or G:      SB180 DSDD format in drive G
  701.    KP2 or KP2:  Kaypro SSDD format in drive G
  702. }
  703.  
  704. ;; SB180 DSQD Formatting
  705.  
  706. if eq :f: :$1           ;; Test for "F:"
  707. or eq :f :$1            ;; Test for "F"
  708. |if true|
  709. b0:fvcd
  710. <OSXTFF2|cr|
  711. |say|
  712. Formatting in SB180 DSQD format complete.
  713. |end say|
  714. |abort|
  715. |endif|
  716. fi
  717.  
  718. ;; SB180 DSDD Formatting
  719.  
  720. if eq :g: :$1           ;; Test for "G:"
  721. or eq :g :$1            ;; Test for "G"
  722. |if true|
  723. èb0:fvcd
  724. <OSXTGF
  725. |"|
  726. Formatting in SB180 DSDD format complete.
  727. |"|
  728. |abort|
  729. |endif|
  730. fi
  731.  
  732. ;; Kaypro SSDD Formatting
  733.  
  734. if eq :kp2: :$1         ;; Test for "KP2:"
  735. or eq :kp2 :$1          ;; Test for "KP2"
  736. |if true|
  737. b0:fvcd
  738. <OSXTGF6|cr|
  739. |"|
  740. Formatting in Kaypro 2 (SSDD) format complete.
  741. |"|
  742. |abort|
  743. |endif|
  744. fi
  745.  
  746. ;; Manual Formatting
  747.  
  748. if eq :$1 :             ;; Test for no argument
  749. |if true|
  750. b0:fvcd
  751. <OSXTGF|until|
  752. |"|
  753. Formatting in interactive mode complete.
  754. |"|
  755. |abort|
  756. |endif|
  757. fi
  758.  
  759. ;; We get here if an illegal argument was given
  760.  
  761. |"|
  762.  
  763. --> Illegal format specification given: $1 $2 $3
  764.  
  765. |"|
  766.  
  767.  
  768. LISTIN╟ 4
  769. ;Autoexec Macro
  770.  
  771. ; This macro allows ZMATE to be invoked with a macro on the
  772. ; command line.  The syntax is as follows:
  773. ;
  774. ;               ZMATE [infile [outfile]][$<macro>]
  775. è;
  776. ; The macro line is processed using a special syntax.  All
  777. ; letters are normally converted to lower case; characters
  778. ; following a '^' are converted to the corresponding control
  779. ; character and dollar signs are converted to escape
  780. ; characters.  However, a character following a '"' is taken
  781. ; literally so that upper case characters, dollar signs, and
  782. ; carets can be entered.
  783.  
  784. B5E                     ; go to buffer 5
  785. I^A:                    ; read in command tail
  786.  
  787. A                       ; go to beginning
  788. T                       ; tag it
  789. [@T>" _M]               ; move to first non-space, non-
  790.                         ; ...control character
  791. #D                      ; delete the white space
  792. @T=0{                   ; IF nothing left
  793.   BTE                   ;   go to T buffer
  794.   %                     ;   terminate this macro
  795. }                       ; ENDIF
  796.  
  797. @T="${                  ; IF line starts with dollar sign
  798.   D                     ;   delete it
  799.   0,                    ;   push 0 (false ) onto stack
  800. }{                      ; ELSE
  801.   -1,                   ;   push -1 (true) onto the stack
  802.   E                     ;   suppress error trapping
  803.   S$$                   ;   search for a '$' separator
  804.   @E{                   ;   IF none found
  805.     Z                   ;     go to end of buffer
  806.   }{                    ;   ELSE
  807.     -D                  ;     delete the '$' separator
  808.   }                     ;   ENDIF
  809.   #B0M                  ;   move file name specs to buffer 0
  810. }                       ; ENDIF
  811.  
  812. [                       ; REPEAT
  813.   @T<"A!(@T>"Z)'{       ;   IF upper case letter
  814.     @T!96R              ;     replace with lower case
  815.     ^                   ;     loop back
  816.   }                     ;   ENDIF
  817.   @T=""{                ;   IF character is double quote
  818.     D                   ;     delete it
  819.     M                   ;     move past next character
  820.     ^                   ;     loop back
  821.   }                     ;   ENDIF
  822.   @T="^{                ;   IF character is caret
  823.     D                   ;     delete it
  824.     @T&31R              ;     convert next char to control
  825.     ^                   ;     loop back
  826.   }                     ;   ENDIF
  827. è  @T="${                ;   IF character is dollar sign
  828.     "$R                 ;     replace it by escape char
  829.     ^                   ;     loop back
  830.   }                     ;   ENDIF
  831.   M                     ;   (otherwise) move past the char
  832. @T=0]                   ; UNTIL end of text
  833.  
  834. BTE                     ; go to T buffer
  835. @S{                     ; IF stack was true
  836.   XF^A@0$               ;   open the file spec in buffer 0
  837. }                       ; ENDIF
  838.  
  839. B0K                     ; clear buffer 0
  840. .5                      ; execute macro in buffer 5
  841. B5K                     ; clear buffer 5
  842.  
  843. EN─ O╞ LISTINGS
  844.  
  845. [This article was originally published in issue 48 of The Computer Journal,
  846. P.O. Box 12, South Plainfield, NJ 07080-0012 and is reproduced with the
  847. permission of the author and the publishe≥« Furthe≥ reproductioε fo≥ non-
  848. commercia∞ purpose≤ i≤ authorizeΣ« Thi≤ copyrigh⌠ noticσ mus⌠ bσ retained.
  849. (c⌐ Copyrigh⌠ 1990¼ 199▒ Socrate≤ Pres≤ anΣ respectivσ authors]
  850.