home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / DRI-archive / roche / ASM86.TXT < prev    next >
Internet Message Format  |  2009-12-11  |  7KB

  1. From: "arobase, Salle multimΘdia" <arobase1.rochef...@wanadoo.fr>
  2. Newsgroups: comp.os.cpm
  3. Subject: How to Disassemble ASM86.COM
  4. Date: Fri, 15 Jun 2001 14:02:13 +0200
  5. Organization: Wanadoo, l'internet avec France Telecom
  6. Lines: 208
  7. Message-ID: <9gct41$3to$1@wanadoo.fr>
  8. NNTP-Posting-Host: apoitiers-102-2-1-54.abo.wanadoo.fr
  9. X-Trace: wanadoo.fr 992606145 4024 193.253.213.54 (15 Jun 2001 11:55:45 GMT)
  10. X-Complaints-To: abuse@wanadoo.fr
  11. NNTP-Posting-Date: 15 Jun 2001 11:55:45 GMT
  12. X-Priority: 3
  13. X-MSMail-Priority: Normal
  14. X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
  15. X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
  16.  
  17. ASM86.TXT
  18. ---------
  19.  
  20. "How to disassemble ASM86.COM Ver 1.0"
  21. --------------------------------------
  22.  
  23. Last night, circa 1 o'clock of the morning, VDE told me "I/O
  24. error" when I finally decided to save the first version of this
  25. report... This time, I hope that everything will work!
  26.  
  27. So. 2 days ago, someone named "Randy" told me where to find
  28. ASM86.COM, that is to say the 8086 assembler used by Digital
  29. Research under CP/M-80 to "boot" their programs on the IBM Clown
  30. (That's the chicken and egg problem).
  31.  
  32. How could I resist such temptation?
  33.  
  34. Since I am an Old Timer, I printed a dump of the file, then went
  35. to inspect it with SID (DDT would have sufficed, but my main
  36. tools are MAC and SID), and wrote down, on the dump, the various
  37. areas: bytes, words, strings, jump tables, etc.
  38.  
  39. ASM86 is a standard 8080 CP/M COMmand file: the code starts at
  40. 0100H. The only thing noticeable in this file is the number of
  41. jump tables, and the way they are arranged: the subroutines are
  42. between the PCHL instruction and the addresses of the
  43. subroutines.
  44.  
  45. The first jump table is at 016C, and contains 3 addresses: 015A,
  46. 0160, and 0166.
  47.  
  48. The second jump table is at 01F3: 01BB, 01BE, 01CB, 01DB, 01E3,
  49. 01EB.
  50.  
  51. The third jump table is at 023A: 0225, 022B, 0231, 0237.
  52.  
  53. Everything else is "straight" 8080 assembly language.
  54.  
  55. We now reach, at 03A8, a table of byte/word values, whose purpose
  56. I had not enough time to find (also, I know almost nothing about
  57. the 8086: the only doc that I have is the ASM86 doc found on the
  58. Internet...).
  59.  
  60. The first  entry is: 00 00 00 00 37 06
  61. The second entry is: 00 00 00 02 D5 0A 06
  62. The third  entry is: 00 00 00 02 D4 0A 06
  63.  
  64. Then, it seems to be variable entries, during 3 pages.
  65.  
  66. Then, there is a table (starting at 1133) containing only the
  67. opcodes. The format is:
  68.  
  69. address, length of opcode, address in previous table, opcode in
  70. ASCII
  71.  
  72. Then, at 14E9, there are the addresses of the opcodes entries
  73. (but not the first one, TEST), then 3 strings: LABELS, VARIABLES,
  74. and NUMBERS.
  75.  
  76. Then, back to code (during 2 pages).
  77.  
  78. Another strings (A86, H86, LST, SYM, A, H, P, S, F) at 1E88.
  79.  
  80. I will now gives the start of the jump tables, and their length:
  81.  
  82. 2163: 4 addresses
  83. 2636: 6
  84. 293D: 5
  85. 2B44: 4
  86.  
  87. One funny thing: a patch (00 00 00) at 2C94...
  88.  
  89. The register "names" and pseudo-ops at 2EF8:
  90. 34 two   letters keywords
  91. 11 three letters keywords
  92. 13 four  letters keywords
  93.  6 five  letters keywords
  94.  4 six   letters keywords
  95.  2 seven letters keywords
  96.  2 eight letters keywords
  97.  2 nine  letters keywords
  98.  
  99. followed by a table of words. The first 10 entries are the
  100. addresses of 2 bytes, then the bytes holding the number of x
  101. letters keywords.
  102.  
  103. After that, it must be the value of the register or pseudo-ops,
  104. then there are 2 addresses in RAM, then the addresses (inside the
  105. table of words) corresponding to the registers/pseudo-ops.
  106.  
  107. Then back to code (at 314F).
  108.  
  109. Another jump table at 3260: 31F3, 322C, and 3253.
  110.  
  111. Then the error messages, starting at 32C6, each terminated by a
  112. 00 byte. Then the addresses of the error messages (and a byte).
  113. Then 3 strings used in error messages. Then some unknown bytes
  114. (from 00 to 1F: at first, I was thinking that is was the error
  115. numbers, but my ASM86 doc says that there are only 24 errors...
  116. since there happens to be 32 error messages in the above table,
  117. they must be their numbers? (but why?...)).
  118.  
  119. Then back to code at 2718.
  120.  
  121. Then the console messages at 380F: Y(es), N(o), then "ASM86 VER
  122. 1.0 ". Some addresses after "END OF PASS 2", some unknown bytes
  123. (81, 82, 83, 84, 85, 86, 87, 88 ???), then back to code at 3906.
  124.  
  125. Back to some jump tables:
  126.  
  127. 3BD3: 8 addresses
  128. 41E3: 5
  129. 436B: 5
  130. 45D4: 5
  131. 4778: 6
  132. 4ABA: 4
  133. 4BFD: 3
  134. 4ED0: 3
  135. 519E: 3
  136. 54B0: 4
  137. 55F3: 3
  138. 56F0: 3
  139. 5929: 4
  140. 59E9: 8
  141. 5B27: 13
  142. 60A1: 31
  143. 619B: 9
  144.  
  145. (There are also a few areas of bytes values which seem to be
  146. copied by subroutines, but your disassembler should be able to
  147. find them. (The C-register holds the number of bytes to be
  148. copied.))
  149.  
  150. Now, some strange thing: the string: ", Digital ResearchBox 579,
  151. Pacific Grove, Ca. " ??? (Personally, I think that this is some
  152. garbage left in RAM that found its way inside a DS pseudo-op. For
  153. instance, the (HUGE!) initialisation subroutine starts just
  154. after... Anyway, there are 46 bytes available for patches...)
  155.  
  156. Then the huge initialisation subroutine, starting at 6320.
  157.  
  158. Back to some jump tables:
  159.  
  160. 6526: 5 addresses
  161.  
  162. Some ASCII chars (ACDEMRSXBWDS) at 6917.
  163.  
  164. 6C8D: 21 addresses
  165.  
  166. And, finally, the CP/M End-Of-File byte (1A) at 6FEB. Those 21
  167. bytes are also available, of course, for patching...
  168.  
  169. So, here lies the problem (for me): ASM86 is just under 32
  170. KiloBytes long...
  171.  
  172. But, everytime that I have disassembled a file, the resultant ASM
  173. file, straight from the disassembler, was 10 times bigger than
  174. the COM file, and (a few weeks later...) my recreated source code
  175. was 20 TIMES that... 32 x 20 = 640 KB...
  176.  
  177. That's a much too big file for my computers (4 MHz Z-80 and 12
  178. MHz 286).
  179.  
  180. For instance, when manipulating a 240 KB file, WS takes more than
  181. one minute to go from the beginning to the end of the file...
  182.  
  183. I simply can't imagine waiting 3 minutes for each "Find and
  184. Replace" to take place, since there will be thousands of them to
  185. be done.
  186.  
  187. I won't be able to buy a powerfuler computer in the near (and
  188. far) future.
  189.  
  190. (If someone in Europe has a 400 MHz 64 MB PIII that he no longer
  191. use, I know someone who need something as powerful as this, and
  192. who will really use it...)
  193.  
  194. By the way, under CP/M-86 Plus all the editors and word-
  195. processors found so far thinks that they have only (at most) a 64
  196. KB segment for buffering the file. If someone has the source code
  197. of a 32 bit file editor (a 32 bit version of ED would be enough:
  198. I don't need a word-processor to do several thousands of "Find
  199. and Replace": just the quickest possible file editor: that is to
  200. say: editing this 640 KB file in RAM.
  201.  
  202. If someone has more knowledge about the 16 and 32 bit Intel
  203. processors, such a 32 bit file editor is missing for CP/M-86 Plus
  204. (and CP/M-86).
  205.  
  206. (I have the source code of at least two old CP/M file editors
  207. which were 3 KB long, and maybe others could be found in the
  208. archives. All that is needed is a 32 bit version of those old
  209. tools. If someone is interested, let me know.) (I would also be
  210. interested in any Intel doc dealing with the 32 bit processors,
  211. and how to use them from CP/M-86 Plus.)
  212.  
  213. Yours Sincerely,
  214. "French Luser"
  215.  
  216. Post-Scriptum
  217.    Once the source code of ASM86 will have been re-created,
  218. it will be very easy to add macros... since I already have
  219. disassembled MAC (but not RMAC yet). Then, we will have
  220. MAC86... running under CP/M-80!... Enjoy!
  221.