home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / DISASM / REVAS25.LBR / MAN1.WZ / MAN1.WS
Text File  |  2000-06-30  |  13KB  |  296 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.                             REVAS V2
  14.  
  15.                       Z80/8080 DISASSEMBLER
  16.  
  17.                          .USER'S MANUAL
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.                        Copyright (c) 1978
  34.  
  35.                            A.E. HAWLEY
  36.                        LOS ANGELES, CALIF.
  37. .HE          INTRODUCTION
  38. .PAè                          *** REVAS ***
  39.          REVERSE ASSEMBLER FOR Z80 OBJECT CODE PROGRAMS
  40.  
  41.      REVA╙á i≤ aε interactivσ reversσ assemble≥ (disassembler⌐ ì
  42. designeΣá t∩ translatσ Z8░ o≥ 808░ machinσ languagσ codσ int∩á aε ì
  43. assembly-likσ listing«á I⌠ i≤ writteε iε Z8░ codσ anΣ caε bσ useΣ ì
  44. iεá an∙ systeφ tha⌠ use≤ ß Z8░ centra∞ processor«á I⌠ support≤á ß ì
  45. puncΦ anΣ linσ printe≥ a≤ wel∞ a≤ ß CR╘ o≥ TTY.
  46.  
  47.  
  48.  WitΦá 2▓á commands¼á REVA╙á caε hel≡á you║á 
  49.           **Analysσ undocumenteΣ program≤ 
  50. áááááááááá**Documen⌠ you≥ machinσ languagσ patches
  51. áááááááááá**Documen⌠ you≥ specia∞ I/╧ routines
  52. áááááááááá**Debuτ developmenta∞ programs
  53. áááááááááá**Modif∙ anΣ relocatσ you≥ software
  54.  
  55.  Herσ arσ somσ oµ REVASº features║
  56. áááááááááá**Assembl∙ forma⌠ listings
  57.  
  58. áááááááááá**Outpu⌠ suitablσ fo≥ reassembly
  59.  
  60. áááááááááá**Generate≤ synthetiπ labels
  61.  
  62. áááááááááá**Accept≤ you≥ choicσ oµ rea∞ labels
  63.  
  64. áááááááááá**Print≤ table≤ iε datß format
  65.  
  66. áááááááááá**Display≤ alphanumeriπ equivalent≤ oµ thσ machinσ code
  67.  
  68. áááááááááá**Display≤ symbo∞ tablσ a⌠ an∙ time
  69.  
  70. áááááááááá**Cros≤ referencσ listinτ show≤ wherσ anΣ ho≈ eacΦ        ì
  71. áááááááááásymbo∞ i≤ used
  72.  
  73. áááááááááá**U≡ t∩ │ outpu⌠ device≤ caε bσ used
  74.  
  75. áááááááááá**Yo⌡ arσ alway≤ iε completσ contro∞ oµ thσ       ì
  76. áááááááááádisassembl∙ process..sto≡ anΣ restart¼ returε t∩       ì
  77. áááááááááámonitor¼ o≥ returε t∩ commanΣ modσ a⌠ will
  78. .pßè        Thσá instructioε mnemonic≤ produceΣ b∙ REVA╙ arσ thσ samσ ì
  79. a≤ thosσ useΣ b∙ thσ Technica∞ Desigε Labsº Z-8░ Relocatinτ Macr∩ ì
  80. Assembler¼ anΣ b∙ Inte∞ fo≥ thσ 8080.
  81.  
  82.      Thσá remainde≥ oµ thi≤ manua∞ show≤ yo⌡ ho≈ t∩ makσ REVA╙ ì
  83. worδ fo≥ you.
  84.  
  85.      Thσá '┴á LITTL┼ INSIGHTº sectioε introduce≤á thσá genera∞ ì
  86. algorithφá b∙á whicΦ REVA╙ perform≤ ßá disassembly«á Thσá usσá oµ ì
  87. table≤á i≤á explaineΣ anΣ relateΣ t∩ thσ command≤ tha⌠ usσá thesσ ì
  88. tables« Yo⌡ wil∞ neeΣ t∩ understanΣ thi≤ subjec⌠ iε orde≥ t∩ makσ ì
  89. mos⌠ effectivσ usσ oµ thσ REVA╙ capabilities«á Iε particular¼ thσ ì
  90. tw∩ mos⌠ frequentl∙ useΣ command≤ arσ introduceΣ iε tha⌠ section.
  91.  
  92.      Iε thσ 'REVA╙ COMMANDSº section¼ yo⌡ wil∞ finΣ ß detaileΣ ì
  93. descriptioεá oµ thσ synta° anΣ operatioε oµ eacΦá command«á Unti∞ ì
  94. yo⌡á becomσ thoroughl∙ familia≥ witΦ thσ commanΣá set¼á yo⌡á wil∞ ì
  95. havσá frequen⌠á usσ fo≥ thi≤ section«á ┴ carefu∞ readinτá oµá thσ ì
  96. forma∞á commanΣá description≤ wil∞ revea∞ thσ freedoφá oµá forma⌠ ì
  97. tha⌠á i≤ designeΣ int∩ thesσ commands«á ┴ lis⌠ oµ REVA╙á COMMAND╙ ì
  98. appear≤ oε thσ bacδ cove≥ fo≥ read∙ reference.
  99.  
  100.      Thσá IMPLEMENTATIO╬ sectioε contain≤ thσ informatioεá yo⌡ ì
  101. neeΣá t∩á loaΣ REVA╙ int∩ you≥ systeφ anΣ properl∙á interfacσá t∩ ì
  102. you≥á I/╧ devices«á Thσ I/╧ jum≡ vector≤ arσ explaineΣ there¼á a≤ ì
  103. wel∞á a≤á thσ registe≥ usagσ associateΣ witΦá I/O«á Somσá oµá thσ ì
  104. addresse≤á anΣá thei≥ function≤ withiε REVA╙ arσ giveε t∩á permi⌠ ì
  105. mino≥ change≤ t∩ bσ madσ iε outpu⌠ forma⌠ iµ yo⌡ wish.
  106.  
  107.      ReaΣá thσ manua∞ clea≥ througΦ beforσ tryinτá t∩á operatσ ì
  108. REVAS¼ theε refe≥ t∩ i⌠ frequently« Theε g∩ aheaΣ anΣ disassemblσ ì
  109. something!
  110.  
  111.      Onσ caution!
  112.  
  113.      Thinδ carefull∙ beforσ yo⌡ usσ thσ 'Aº commanΣ o≥ thσ 'Gº ì
  114. command«á The∙á caεá causσá ß systeφ crash╗á thσ 'Aºá commanΣá b∙ ì
  115. assigninτá table≤á iεá ß prograφ area¼á anΣ thσá 'Gºá commanΣá b∙ ì
  116. callinτ aε addres≤ tha⌠ i≤ no⌠ thσ subroutinσ yo⌡á intended«á Yo⌡ ì
  117. havσá contro∞á oµá sucΦ situation≤ becausσ yo⌡ arσá thσá onσá wh∩ ì
  118. specifie≤ thσ addres≤ fo≥ thesσ commands.
  119.  
  120.      I⌠á i≤á m∙ inten⌠ t∩ furnisΦ softwarσá anΣá documentatioε ì
  121. tha⌠á i≤á a≤á usefu∞ anΣ freσ oµ error≤ a≤á possible«á Thσá REVA╙ ì
  122. prograφá ha≤ beeε iε constan⌠ usσ durinτ it≤á owεá development(!⌐ ì
  123. anΣ fo≥ man∙ month≤ b∙ severa∞ user≤ beforσ thσ firs⌠ versioε wa≤ ì
  124. released«á Al∞ knowε bug≤ havσ beeε exterminated« ╔ aφ interesteΣ ì
  125. iε improvinτ whereve≥ possiblσ thσ qualit∙ oµ thσ prograφ anΣ it≤ ì
  126. documentation«á Thus¼á ╔ wil∞ welcomσ anΣ responΣ t∩ comment≤ anΣ ì
  127. recommendation≤á sen⌠ t∩ thσ addres≤ below«á (accolade≤ arσá als∩ ì
  128. welcome!⌐ Pleasσ includσ ß stampeΣ self-addresseΣ envelopσ iµ yo⌡ ì
  129. wisΦ ß reply.
  130.                          A∞ Hawley
  131. ì
  132. .hσ          ┴ LITTL┼ INSIGH╘
  133. .pßè                   HO╫ TH┼ DISASSEMBLE╥ WORKS
  134.  
  135. Herσ i≤ ß brieµ descriptioε oµ REVAS:
  136.  
  137. Prograφá size-- 4δ byte≤
  138. Symbo∞ tablσ location--enΣ oµ REVA╙ o≥ a≤ assigned
  139. Symbo∞ tablσ usage--
  140.      synthetiπ symbol≤        ┤ bytes/symbol
  141.      assigneΣ label≤        ╢ bytes/label
  142. Symbo∞ tablσ lengtΦ i≤ initiall∙ zero¼á increasinτ a≤ requireΣ t∩ ì
  143. accomodatσ symbol≤ anΣ u≡ t∩ 68▓ labels.
  144.  
  145.      Thσá objec⌠ prograφ t∩ bσ disassembleΣ mus⌠ bσ iεá memor∙ ì
  146. a⌠á it'≤ norma∞ location«á Wheε contro∞ i≤ passeΣ t∩á REVAS¼á thσ ì
  147. promp⌠á character(#⌐ wil∞ appea≥ anΣ yo⌡ ma∙ responΣ witΦ onσá oµ ì
  148. thσ command≤ describeΣ iε thσ nex⌠ section«á Let'≤ star⌠ witΦ thσ ì
  149. 'Dº (displa∙ disassembly⌐ command:
  150.  
  151.      REVA╙á wil∞ examinσ thσ bytσ locateΣ a⌠ thσ star⌠ addres≤ ì
  152. anΣ analysσ i⌠ a≤ thσ firs⌠ bytσ oµ aε instructioε b∙ findinτá i⌠ ì
  153. iε interna∞ looku≡ tables« Thσ operato≥ mnemoniπ i≤ obtaineΣ froφ ì
  154. thσá tables¼á a≤á wel∞á a≤á thσ numbe≥ oµ byte≤á iεá thσá curren⌠ ì
  155. instruction.
  156.  
  157.      Thσ operanΣ fielΣ contents¼á iµ any¼á arσ nex⌠ determineΣ ì
  158. b∙ ß combinatioε oµ logica∞ operation≤ anΣ tablσ lookup.
  159.  
  160.      Thσ operato≥ anΣ operanΣ arσ storeΣ iε appropriatσ field≤ ì
  161. oµ thσ linσ buffer(LB).
  162.  
  163.      Next¼á thσ addres≤ oµ thσ instructioε anΣ thσ objec⌠ codσ ì
  164. arσá storeΣ iε thσ L┬ a≤ he° characters¼á anΣ thσ objec⌠ codσá i≤ ì
  165. converteΣá anΣá placeΣá iε thσ commen⌠ fielΣ oµá thσá buffe≥á fo≥ ì
  166. printou⌠ a≤ ASCI╔ data.
  167.  
  168.      Thσá symbo∞ table≤ arσ searcheΣ fo≥ ß labe∞á assigneΣá t∩ ì
  169. thσ addres≤ jus⌠ defined«á Iµ ß labe∞ i≤ found¼ i⌠ i≤ inserteΣ iε ì
  170. thσá labe∞ fielΣ oµ thσ linσ buffer«á Iµ therσ i≤ n∩ label¼á theε ì
  171. thσ table≤ arσ searcheΣ fo≥ ß synthetiπ labe∞ t∩ insert«á Iµ nonσ ì
  172. exists¼ theε thσ fielΣ i≤ lef⌠ blank« Label≤ caε bσ righ⌠ o≥ lef⌠ ì
  173. justifieΣ (seσ PatcΦ Location≤ below).
  174.  
  175.      No≈ thσ content≤ oµ L┬ arσ printeΣ oε thσ outpu⌠ devices¼ ì
  176. thσ consolσ i≤ checkeΣ fo≥ an∙ pendinτ commands¼á anΣ thσ proces≤ ì
  177. i≤ repeateΣ unti∞ terminateΣ b∙ reachinτ thσ las⌠ addres≤ o≥ b∙ ß ì
  178. commanΣ froφ thσ console«
  179.  
  180.      Thσ symbo∞ table≤ comprisσ tw∩ tables║ aε inde° tablσ anΣ ì
  181. ß labe∞ table« Thσ inde° tablσ i≤ constructeΣ durinτ executioε oµ ì
  182. thσá 'Bºá command«á I⌠á contain≤ thσ he° valuσá oµá eacΦá 1╢á bi⌠ ì
  183. argumen⌠á encountereΣá iεá thσá addres≤á range≤á tha⌠á havσá beeε ì
  184. disassembled«á I⌠á als∩á contain≤ flag≤ whicΦ indicatσá fo≥á eacΦ ì
  185. entr∙á thσ presencσ oµ aε assigneΣ label¼á thσ modσ oµ thσá labe∞ ì
  186. (instructioεá modσ o≥ tablσ mode)¼á anΣ ß pointe≥ t∩ thσ locatioε ì
  187. oµ thσ assigneΣ labe∞ iε thσ seconΣ (label)table« Thσ 'Kº commanΣ ìèdelete≤ entrie≤ froφ thσ index«á Thσ 'Mº commanΣ change≤ thσ flaτ ì
  188. whicΦ indicate≤ labe∞ mode« Thσ 'Fº commanΣ add≤ it'≤ argumen⌠ t∩ ì
  189. thσ inde° tablσ iµ i⌠ i≤ no⌠ alread∙ there.
  190.  
  191.      Thσá labe∞ tablσ (assigneΣ labels⌐ i≤ constructeΣá durinτ ì
  192. executioεá oµ thσ 'L','S'¼á o≥ 'Tº commands«á Wheε onσá oµá thesσ ì
  193. command≤ i≤ given¼ thσ labe∞ specifieΣ iε thσ commanΣ i≤ addeΣ t∩ ì
  194. thσá labe∞á table«á Thσá inde°á tablσ i≤ theεá searcheΣá fo≥á thσ ì
  195. correspondinτá he°á valuσá (addres≤ oµ thσ labe∞á iεá thσá objec⌠ ì
  196. program⌐ anΣ ß pointe≥ i≤ entereΣ iε thσ inde° tablσ tha⌠á point≤ ì
  197. t∩á thσá labe∞ entry«á Iµ therσ i≤ n∩ correspondinτ entr∙ iεá thσ ì
  198. inde° table¼á theε onσ i≤ created«á Thus¼ thesσ command≤ als∩ ac⌠ ì
  199. t∩á builΣá thσá inde° table«á Thσ 'Sº commanΣ reset≤á ßá flaτá t∩ ì
  200. indicatσá tha⌠á thi≤ labe∞ belong≤ t∩á aεá instruction«á Thσá 'Tº ì
  201. commanΣá set≤á thσ flaτ t∩ indicatσ tha⌠ thi≤ labe∞ belong≤ t∩á ß ì
  202. bytσá iε ß tablσ oµ data«á Thσ 'Lº commanΣ leave≤ thσá modσá flaτ ì
  203. unchanged.
  204.  
  205.      ┴á descriptioεá oµá thσ flaτ anΣ pointe≥á word≤á fo≥á thσ ì
  206. symbo∞á table≤ i≤ includeΣ iε thσ implementatioε section«á Iµ yo⌡ ì
  207. choosσá t∩ storσ thσ table≤ (oε tapσ o≥ disc¼á fo≥á example⌐á fo≥ ì
  208. futurσ use¼á theε yo⌡ mus⌠ bσ surσ t∩ als∩ recorΣ thesσ location≤ ì
  209. anΣ restorσ theφ wheε yo⌡ restorσ thσ tables.
  210.  
  211.  
  212.              Mode¼ Modσ Character¼ anΣ Modσ Control
  213.  
  214.      Thσá characte≥á immediatel∙ followinτ thσ 'Dº o≥á 'Bºá iε ì
  215. thosσá command≤á i≤ thσ modσ character«á Tw∩ mode≤ arσá possible║ ì
  216. instructioε modσ anΣ tablσ mode«á Tablσ modσ i≤ specifieΣ iµá thσ ì
  217. modσ characte≥ i≤ ß 'T'╗ an∙ othe≥ specifie≤ instructioε mode.
  218.  
  219.      Iεá thσ instructioε mode¼á byte≤ froφ thσ objec⌠á prograφ ì
  220. arσ interpreteΣ a≤ Z-8░ anΣ 808░ instructions.
  221.  
  222.      Iεá thσá tablσ mode¼á byte≤ froφ thσ objec⌠á prograφá arσ ì
  223. interpreteΣ a≤ single-bytσ constant≤ whicΦ arσ par⌠ oµ ß tablσ oµ ì
  224. data.
  225.  
  226.      Therσá arσá tw∩ flag≤ associateΣ witΦ modσá control«á Thσ ì
  227. modσ contro∞ flaτ i≤ se⌠ (o≥ reset⌐ b∙ thσ modσ contro∞ characte≥ ì
  228. wheε thσ 'Dº o≥ 'Bº commanΣ i≤ issueΣ t∩ REVAS«á Thσ seconΣ flag¼ ì
  229. thσá modσ bit¼á i≤ par⌠ oµ thσ datß storeΣ fo≥ eacΦ entr∙ iεá thσ ì
  230. inde° table« Thσ modσ bi⌠ i≤ se⌠ o≥ rese⌠ durinτ executioε oµ thσ ì
  231. 'B','M','S',anΣ 'Tº commands«á Thσ functioε oµ thσ 'Mº commanΣ i≤ ì
  232. t∩á definσ thσ statσ oµ thσ modσ bi⌠ fo≥ ßá particula≥á (address⌐ ì
  233. entr∙á iεá thσá inde° table¼á creatinτ ß dumm∙ entr∙ iµá nonσá i≤ ì
  234. presen⌠ wheε thσ commanΣ i≤ given.
  235.  
  236.  
  237.                   Operatioε oµ thσ 'Dº Command
  238.  
  239.      Thσ 'Dº commanΣ display≤ thσ disassembl∙ oε thσá selecteΣ ì
  240. outpu⌠á device(s)¼á usinτ thσ modσ contro∞ flaτ t∩ determinσá thσ ì
  241. forma⌠ oµ thσ output.è
  242.      ***Iµáá aεáá inde°á tablσá entr∙á matchinτá thσáá curren⌠ ì
  243. instructioεá o≥ datß bytσ addres≤ i≤ encountered¼á theε thσá modσ ì
  244. bi⌠á froφ tha⌠ tablσ entr∙ replace≤ thσ modσá contro∞á flag╗á thσ ì
  245. outpu⌠á forma⌠á (o≥ mode⌐ i≤ controlleΣ fo≥ thi≤á anΣá subsequen⌠ ì
  246. byte≤ b∙ thi≤ ne≈ modσ contro∞ flag.***
  247.  
  248.      Clearly¼ wheε thσ inde° tablσ i≤ empt∙ (a⌠ thσ star⌠ oµ ß ì
  249. sessioεá o≥ afte≥ thσ 'Iº command⌐ al∞ outpu⌠ forma⌠ i≤ specifieΣ ì
  250. b∙á thσ modσ contro∞ character«á Afte≥ an∙ oµ thσ tablσá buildinτ ì
  251. command≤á (B,L,M,S,T⌐ havσ beeε executed¼á modσ informatioεá froφ ì
  252. thσ inde° tablσ entrie≤ wil∞ bσ useΣ a≤ appropriate.
  253.  
  254.  
  255.                   Operatioε oµ thσ 'Bº Command
  256.  
  257.      Thσ 'Bº commanΣ function≤ mucΦ likσ thσ 'Dº command«á Onσ ì
  258. differencσ i≤ iε thσ usσ oµ thσ modσ flags.
  259.  
  260.      ***When¼á durinτá disassembly¼á aε inde° tablσá entr∙á i≤ ì
  261. founΣ whicΦ matche≤ thσ curren⌠ instructioε o≥ bytσ address¼á thσ ì
  262. modσá bi⌠á oµá thσá entr∙á i≤ changeΣá t∩á corresponΣá witΦá tha⌠ ì
  263. specifieΣ b∙ thσ curren⌠ modσ contro∞ flag.***
  264.  
  265.      Anothe≥ differencσ i≤ thσ tablσ buildinτ function« Wheε ß ì
  266. 1╢á bi⌠á argumen⌠ i≤ founΣ iε thσ curren⌠ operanΣá field¼á i⌠á i≤ ì
  267. replaceΣ b∙ ß synthetiπ symbo∞ formeΣ b∙ thσ concatenatioε oµá aε ì
  268. 'Sº o≥ 'Tº anΣ thσ he° representatioε oµ thσ argument«á Thσ firs⌠ ì
  269. lette≥á wil∞ bσ aε 'Sº iµ therσ i≤ n∩ inde° tablσ entry«á I⌠ wil∞ ì
  270. bσá eithe≥á 'Sº o≥ 'Tº (dependinτ oε thσ statσ oµ thσá modσá bit⌐ ì
  271. wheε aε entr∙ alread∙ exists«á Iµ thi≤ i≤ thσ firs⌠ occurencσá oµ ì
  272. thσá argumen⌠ value¼á theε aε entr∙ i≤ createΣ iε thσ inde° tablσ ì
  273. whosσá modσ bi⌠ specifie≤ instructioεá modσá ('S')«á Later¼á wheε ì
  274. table≤á oµá datßá arσ beinτ disassembleΣ witΦ thσá 'BTºá command¼ ì
  275. thosσá argument≤ iε thσ inde° tablσ tha⌠ refe≥ t∩ label≤á iεá thσ ì
  276. object-prograφá tablσá areß wil∞ havσ thei≥ modσ bit≤ changeΣá t∩ ì
  277. specif∙ tablσ ('T'⌐ mode«á Incidentally¼á thσ inde° tablσá itselµ ì
  278. caε bσ listeΣ usinτ thσ 'DTº command.
  279.  
  280.      Notσá tha⌠á iµ ß tablσ oµ datß iε thσ objec⌠á prograφá i≤ ì
  281. disassembleΣ usinτ thσ 'B?º (┐á no⌠ ß 'T'⌐ command¼ man∙ spuriou≤ ì
  282. argument≤á wil∞á bσ generateΣ anΣ storeΣ iε thσ inde° tablσá witΦ ì
  283. curiou≤ effect≤ durinτ late≥ listing«á Fo≥ example¼á thσ he° codσ ì
  284. sequencσá 2░á 20...(ASCI╔á blanks⌐á woulΣá bσá interpreteΣá a≤á ß ì
  285. relativσ jum≡ froφ thσ Z-8░ instructioε set¼á anΣ thσ destinatioε ì
  286. oµá thσ jum≡ woulΣ bσ storeΣ iε thσ inde° a≤ thσ curren⌠á addres≤ ì
  287. plu≤ 20H«á simila≥ situation≤ exis⌠ fo≥ codσ sequence≤ tha⌠á looδ ì
  288. likσ LXI¼ SHLD¼ LDA¼ etc.¼ froφ thσ 8080/Z-8░ instructioε sets.
  289.  
  290.      Becausσá oµ thσ abovσ considerations¼á i⌠ i≤ usuall∙ bes⌠ ì
  291. t∩ analysσ objec⌠ codσ initiall∙ witΦ thσ 'Dº command¼á reservinτ ì
  292. thσ usσ oµ thσ 'Bº commanΣ unti∞ thσ instructioε anΣ tablσá area≤ ì
  293. havσá beeεá located«á Theε thσ 'Bº commanΣ caε bσ useΣá t∩á builΣ ì
  294. table≤á (anΣ assigε synthetiπ symbols)¼á firs⌠ t∩ thσ instructioε ì
  295. areas¼ anΣ theε t∩ thσ table≤ oµ data«è
  296.