Aliaó 1.5 bù Joå Wrighô ± Septembeò 1990 ALIAS°  ió thå actuaì aliaó modulå writteî tï disk® Iô  haó  beeî enhanceä  somewhaô  tï  allo÷ alì fivå  systeí  filenameó  tï  bå addressed¬  $F° beinç thå prototypå SH.VAÒ shelì  variablå  file® Thå  'T§  filetypå operatoò waó puô bacë iî sucè  thaô  $T°  wilì poinô  tï VAR® Thå 'T§ variablå waó removeä iî versioî  1.±  foò somå reasoî thaô É don'ô understand® Iî anù case¬ É havå puô  iô bacë in. Aó  before¬  ALIAÓ haó onå 'escape§ character¬ '$§  dollar®   Thå characteró followinç '$§ arå interpreteä tï mean.. $î Wherå î varieó ° througè 9® $° returnó thå NAMÅ oæ thió aliaó (froí EXTFCB) $± returnó thå firsô tokeî oî thå commanä line $¹ returnó thå nintè tokeî oî thå commanä line Anù  $î whicè doeó noô havå á correspondinç tokeî returnó á  NULÌ string¬ nothing. $ª Thå entirå commanä linå withouô furtheò translatioî $Ä Thå currenô drivå letter $Õ Thå currenô useò number Foò  F¬  Î anä T¬ n=° ió thå SH.VAÒ filenamå anä n=1..´  arå  thå standarä Systeí Filå names. $Fî Systeí Filå î Namå anä Typå aó NAME.TYÐ (î ió 0..4) $Nî Systeí Filå î Namå aó simplù NAMÅ (î ió 0..4) $Tî Systeí Filå î Typå aó simplù TYÐ (î ió 0..4) $¤ Simplù returî onå '$§ tï thå commanä line ALIAS1µ implemenôs á ne÷ Pointeò parameteò whicè wilì expanä tï á hexadecimaì  address® Thå Pointeò wilì allo÷ accesó  tï  dynamiã memorù valueó withiî á knowî datá structurå (thå baså pagå oò thå environmenô descriptor¬ á jumð table¬ etc.)® Syntaxº $.ADDR[[[.OFF].OFF]+OFF] Thå aliaó parameteò ió formeä witè á '$§ followeä bù á '.§  poinô followeä bù aî address® Oî expansion¬ iô wilì returî thå Worä aô thå  address®   Foò  example¬  '$.6§ wilì  returî  thå  valuå  iî locationó  ¶  anä  · oæ thå baså  page¬  thå  'protecteä  memory§ address¬ somethinç likå C70¶ oò whateveò thå BDOÓ entrù is® Wå caî alsï finä thå Z³ Environment® Thå aliaó itselæ ió á ZCPR³ Typå  ± filå witè á standarä Z³ header® Thå addresó oæ Z3ENÖ  ió alwayó  aô 109è iî sucè á file® Thå forí '$.109§ wilì expanä  tï thå heø addresó oæ thå Environmenô (E78° iî mù case). Tï  finä  aî  addresó iî thå  Environmenô  Descriptor¬  Z3CÌ  foò Šexample¬   wå  appenä  itó  offset®   '$.109.18§  wilì  geô   thå environmenô  addresó aô 109h¬ adä 18è tï iô anä returî thå  valuå containeä  there¬  thå addresó oæ Z3CÌ (E90° iî  mù  case)®   Thå valuå  aô Z3CÌ ió thå NXTCHÒ pointer® Returî thió witè onå  morå leveì oæ indirectioî aó '$.109.18.0'® $.± (0001H© BIOS+³ D50³ (mù system) $.¶ (0006H© BDOÓ C706 $.10¹ (0109H© Z3ENÖ E780 $.109.1¸ (Z3ENV+18© Z3CÌ E900 $.109.18.° (Z3CL© NXTCHÒ E9nn Let'ó consideò thå Z3MSÇ buffer. $.109.2² (Z3ENV+22© Z3MSÇ E880 Thå Erroò Addresó aô Z3MSG+´ ió returneä with.. $.109.22.´ (Z3MSG+4) Thå pointeró caî havå aó manù leveló oæ indirectioî aó  necessarù buô É usuallù gåô losô afteò twï oò three. Wå caî alsï adä aî offseô tï á pointer® Foò example.. $.109.22+¶  wilì poinô tï thå Prograí Erroò flaç aô Z3MSG+6®   Oò poinô  tï Systeí Filå ± iî thå environmenô witè  '$.109+52'®   Wå caî  uså thå '+§ oò §-§ operatoró tï providå aî offseô  froí  thå memorù  variable® Foò example¬ '$.1+3§ wilì returî  BIOS+6¬  thå CONSÔ  entrù whilå '$.±-3§ returnó BIOS+0¬ thå beginninç  oæ  thå bios®   Wå caî alsï uså thió aó thå basió oæ thå nexô elemenô  iî thå Pointeò parameter® Anotheò example.. Thå Amprï bioó ió structureä sucè thaô thå Disë Parameteò Headeró oæ  alì sixteeî possiblå driveó reside¬ startinç witè  thå  firsô floppù drive¬ aô BIOS+80H® Wå caî extracô anù oæ thå pointeró iî anù oæ thå headeró witè somå simplå math® Let'ó geô thå  addresó oæ  thå  Sectoò Translatå Tablå foò drivå Å (4)®   XLATÅ  ió  thå firsô pointeò iî anù DPH. Assuminç NZCOM¬ iô ió thå CBIOÓ wå arå interesteä in® É wilì  gï througè thió steð bù steð anä simplifù thingó aô thå end.. $.109.± (Z3ENV+1© CBIOS+¶ EA06 $.109.1-¶ CBIOS+6-¶ CBIOÓ EA00 $.109.1-6+8° CBIOS+8° CBIOS+8° EA80 $.109.1-6+80+4° CBIOS+C0È CBIOS+C0È EAC0 $.109.1-6+80+40.° (CBIOS+C0H© EXLATÅ EC22 Wå simplifù thå matè with.. $.109.1+BA.°   anä  wå havå it® É aí noô surå  ho÷  usefuì  thió reallù ió buô iô ió therå iæ wå eveò neeä it. ŠThå aliaó createä bù ALIAS1µ ió seveî recordó long® Thå standarä aliaó  waó  eighô  recordó anä nï aliaó  maù  bå  longer®   Aliaó editoró iî generaì wilì rejecô á filå oæ ninå oò morå recordó anä declarå iô 'Noô aî Alias'® Thió eighô-recorä lengtè ió arbitrarù buô historical® Thå aliaó wilì builä á CCÐ commanä iî á locaì buffeò accordinç tï itó  argumentó anä thå taiì passeä tï iô aó iô waó  called®   Anù pendinç commandó iî thå MCÌ wilì bå appendeä tï thió locaì buffeò anä  theî thå entirå buffeò copieä tï thå beginninç oæ  thå  MCL® Thå aliaó theî 'returns§ tï thå CCÐ (ZCPR3© foò execution. VALIAÓ  anä  SALIAÓ implementeä á Modå controì iî  thå  aliaó  aó Normaì oò Recursive® Iî Recursivå Modå thå aliaó wilì cleaò  thå resô  oæ thå MCÌ anä copù onlù itó expansioî tï thå beginninç  oæ thå  MCL® Botè VALIAÓ anä SALIAÓ maintaiî thió flaç aô  10Cè  iî thå  aliaó aó 00è iæ Normaì anä 0FFè iæ recursive¬ anä á 46è  'F§ characteò aô 10Bh® Thå commanä taiì oæ á giveî aliaó entrù maù bå nï longeò thaî 12¶ characteró becauså oæ thå constraintó oæ thå TBUFÆ size® Iæ  thå expansioî oæ á particulaò aliaó linå ió longeò thaî 12¶ byteó  wå flaç aî Ovfì erroò anä dï NOÔ movå thå aliaó intï thå MCL. No÷  tï thå subjecô oæ recursivå aliases® Recursioî occuró  wheî aî  aliaó  calló  itself®   Thió mighô  bå  usefuì  iî  aî  EDIT¬ ASSEMBLE¬ LINË sessioî wherå aî erroò flaggeä bù thå assembleò oò linkeò  woulä  automaticallù puô yoõ bacë iî youò editoò  tï  trù agaiî  anä  thå absencå oæ erroró woulä linë anä  exit®   É  wilì leavå thå uså oæ 'recursion§ tï thå readeò anä concentratå oî ho÷ tï writå aliaeó whicè arå properlù recursive. Aô  firsô  blush¬ iô woulä seeí thaô wå coulä dï  somethinç  likå this.. FOOº PROGRAÍ Somå prograí whicè setó thå Erroò flag IÆ EÒ No÷ checë foò Error FOÏ Re-ruî FOÏ oî error FÉ Closå thå IF Anä  wå can¬ almost® Iæ therå ió aî error¬ FOÏ ió  rerun®   Thió leaveó aî unresolveä IÆ oî thå Flo÷ stacë anä appendó thå lasô FÉ tï thå 'new§ aliaó iî thå MCL® Eacè iteratioî pusheó anotheò  IÆ ontï  thå Flo÷ stacë anä addó anotheò FÉ tï thå MCL®   Everythinç ió finå untiì eitheò thå Flo÷ stacë overflowó (eighô IF'ó max© oò thå  MCÌ filló uð witè alì thå FI's® Noô reallù cooì becauså  wå neveò kno÷ ho÷ manù timeó wå reruî FOÏ noò ho÷ mucè rooí wå  havå iî thå MCL® Thå  solutioî  ió  simplå  buô  requireó  á  littlå  explanation® Rewritå  thå aliaó sï thaô itó 'recursion§ neitheò overflowó  thå Flo÷ stacë noò thå MCL® Consider.. FOOº FÉ Closå IÆ ER PROGRAM Š IÆ ER FOÏ Reruî thió alias Thió onå haó nï pendinç FÉ tï overflo÷ thå MCÌ anä wilì keeð  thå Flo÷  stacë  straighô whilå iô ió 'recurring'® Thå firsô  FÉ  ió balanceä bù callinç iô correctlù witè anotheò alias¬ likå this.. RUNº IÆ Ô Impresó Truå oî thå Flo÷ stack FOÏ Executå FOO FÉ Closå thå IF Watcè ho÷ nicelù thió expands.. RUNº IÆ Ô Seô Flo÷ True FOOº FÉ Closå IÆ Ô froí RUÎ oò IÆ EÒ froí FOO PROGRAÍ Clearó (anä maybå sets© Erroò flag IÆ ER FOÏ Ruî FOÏ agaiî iæ ER FÉ Froí RUN¬ Closå IÆ EÒ froí FOÏ wheî nï Error Perfectlù  balanced® Writteî thió way¬ recursivå aliaseó dï  noô corrupô eitheò thå Flo÷ stacë oò thå MCL® Yoõ caî enteò commandó followinç  RUÎ oî thå commanä linå anä theù wilì  remaiî  pendinç untiì RUÎ ió finisheä anä theî bå executeä automatically. Therå  ió  nï apparenô neeä foò á 'Recursivå  Mode§  aliaó  whicè clearó  pendinç commandó froí thå MCÌ aó iô runs® 'Normaì  Mode§ workó quitå nicely¬ thanë you® Roâ Friefelä haó appriseä må oæ aî articlå iî TCÊ 2¸ bù Jaù  Sagå whicè presentó thå samå argumenô oî recursioî aó above® É swear¬ É  didn'ô  reaä thaô article® Maybå 'greaô  minds§  thinë  alikå afteò all® Perhapó É caî offeò 'nesting§ oæ aliases.. RUN: IÆ Ô Pusè Truå ontï thå Flo÷ stack MAIÎ Ruî MAIN FÉ Poð thå Flo÷ stacë anä resumå MCÌ commands MAIN: FÉ Poð thå Flo÷ stack PROG± Dï something® Seô EÒ iæ wå neeä FOO. IÆ ER FOÏ Ruî FOÏ iæ anù error FI IÆ EÒ FOÏ returnó EÒ tï forcå onå morå PROG1 Š MAIN FOO: FI PROG² Dï something® Cleaò EÒ tï dï PROG² again. IÆ ~EÒ Checë thå EÒ flag FOÏ Reruî PROG2 Iî  thió scenario¬ PROG± wilì bå ruî anä oî error¬ PROG² ió  run® Iæ  PROG² ió run¬ iô wilì repeaô untiì iô setó EÒ anä theî  PROG± wilì  bå ruî again® Thió keepó uð untiì PROG± doeó noô  seô  thå erroò flag. É  wilì  leavå iô tï thå readeò discerî á uså foò this¬  buô  thå forí oæ thå aliaseó ió correcô anä allowó yoõ tï appenä  commandó tï RUÎ tï thå extenô oæ thå MCÌ lengtè® Iô expandó likå this.. RUN: IÆ Ô Pusè Truå ontï thå Flo÷ stack MAIN: FÉ Poð thå Flo÷ stack PROG± Dï something® Seô EÒ iæ wå neeä FOO. IÆ EÒ Ruî FOÏ iæ anù error FOO: FI PROG² Dï something® Cleaò EÒ tï dï PROG² again. IÆ ~EÒ Checë thå EÒ flag FOÏ Reruî FOÏ iæ nï error FI IÆ EÒ FOÏ returnó EÒ tï forcå onå morå PROG1 MAIÎ Ruî MAIN FÉ Poð thå Flo÷ stacë anä resumå MCÌ commands