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