home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / program / compiler / reass_us / document / reassemb.doc
Encoding:
Text File  |  1994-04-18  |  18.1 KB  |  489 lines

  1.  
  2.                     ************************************
  3.                     * 8-bit CPU Reassembler package    *
  4.                     * incl. PurePASCAL GEM source code *
  5.                     ************************************
  6.  
  7. Program author :
  8.  
  9. Jens Schulz
  10. Rosenstrasse 5
  11. D-25368 Kiebitzreihe
  12. Germany
  13.  
  14. ****************************************************************************
  15.  
  16.            Reassembler package for these 8-bit CPU processors :
  17.            ----------------------------------------------------
  18.  
  19.        - INTEL 8051/52/252/535 microcontroller
  20.        - INTEL 8048 microcontroller series
  21.        - Zilog Z-80 CPU
  22.        - Mostek/Rockwell 6502-CPU
  23.        - Motorola 68HC11 microcontroller
  24.        - INTEL 8080/85-CPU
  25.  
  26. *****************************************************************************
  27.  
  28. System: ATARI ST/TT/FALCON
  29.         GEM / MultiTOS
  30.         screen resolution independent > 640*400 dots
  31.         requires 1 MB RAM
  32.  
  33. ****************************************************************************
  34.  
  35.                    These programs are Freeware
  36.  
  37. You can copy and swap these programs freely without any charge. Sale or
  38. use in any other software for profit is strict forbidden. It's free for
  39. BBS downloading and PD collections.
  40.  
  41. ***************************************************************************
  42.  
  43.                        What's a reassembler ?
  44.                        ----------------------
  45.  
  46. First, let's talk about the PurePASCAL GEM source code. If you are a GFA-
  47. or OMIKRON BASIC programmer, you can learn GEM programming under PurePASCAL.
  48. I've put the complete PurePASCAL 1.1 GEM source code of the 8080/85 reassemb-
  49. ler in the folder SOURCE85.PAS.
  50.  
  51. The source code is very useful for learning the main aspects of screen
  52. resolution independent GEM programming. The source code shows you the
  53. handling of dialogues, GEM redraws, VDI 109 and dynamic memory allocations.
  54. I've programmed in many programming languages GEM programs. PurePASCAL is
  55. the easiest way to learn GEM. Forget all these 'damned' BASIC POKES and
  56. use the power of PP GEM-handling. PP GEM programming is easier than C
  57. GEM handling.
  58.  
  59.                            Reassembler
  60.                            -----------
  61.  
  62. Reassembler are very useful for decoding machine language programs. If
  63. you've never programmed 8-bit CPU's in assembler, you don't need these
  64. programs. You can only use the PP source code for your own programs.
  65.  
  66. Next chapters are only for assembler experts :
  67. ----------------------------------------------
  68.  
  69. A reassembler is an extended disassembler. It can decode machine programs
  70. with mnemonics and labels. Reassemblers insert labels of jumps or absolute
  71. addresses in the disassembler listing.
  72.  
  73. Reassembler listing are address independent. You can use the generated
  74. ASCII outputs for your assembler programs.
  75.  
  76. The Z80- and 6502 reassembler additional support the symbolic reassembling.
  77. Normally the reassemblers produce automatic labels, like LXXXX. XXXX is
  78. the hexadecimal address of the label. Symbolic reassemblers can exchange
  79. these automatic labels with symbolic names. Symbolic reassemblers need
  80. a symbol table. These symbol tables exist often for the standard home
  81. computers (C64, Amstrad CPC 464 etc.). These home computers use 6502 or
  82. Z 80 CPU's.
  83.  
  84.                           Who uses a reassembler ?
  85.                           ------------------------
  86.  
  87. 1.)  very rare use :
  88.  
  89.      You believe, that your high level compiler codes ineffective or
  90.      wrong code.
  91.  
  92. 2.)  rare use :
  93.  
  94.      You've formatted or lost your assembler source code of your last
  95.      machine control board programming.
  96.  
  97. 3.)  normal use :
  98.  
  99.      You've got a program from a programming competitor. You will do all
  100.      for cracking his 'Hyperpokes'.
  101.  
  102. 4.) worst case :
  103.  
  104.     The competitor uses self modifying code or the microcontroller allows
  105.     the the locking of the ROM, like 68HC11. That's the worst case for
  106.     reassembler use.
  107.  
  108. ****************************************************************************
  109.  
  110.                       General handling of the reassemblers
  111.                       ------------------------------------
  112.  
  113. The six reassemblers have only a few differences in their programming
  114. handling. The most menu entries are equal. Special functions of each
  115. reassembler is described in a separate info file.
  116.  
  117. 1. Max. code size for the reassemblers
  118. ---------------------------------------
  119.  
  120.    The max. size of a code block is restricted to 8 KByte, why ?
  121.    8 KB machine code produces thousands of reassembler lines.
  122.  
  123.    The reassembler label handling allows the addition of code segments.
  124.    Additional, you can concat the ASCII outputs with a standard ASCII
  125.    editor.
  126.  
  127. 2. Reassembling of the code
  128. ---------------------------
  129.  
  130.    - load your max. 8 KB code file (.BIN) from disc (Menu File)
  131.  
  132.    - reassemble the code with the key F1 or the menu entry 'Reassemble'
  133.  
  134.    - the reassembler decodes the whole binary code segment with all
  135.      machine command and symbolic labels.
  136.  
  137.    - you can scroll the output listing with mouse or cursor keys and
  138.      change the output window size.
  139.  
  140. 3. Set of the start address (ORG)
  141. ---------------------------------
  142.  
  143. Normally, the reassembler uses the base address $0000 for the code start.
  144. This code start address is called the origin address (ORG). You can set
  145. this ORG address on a new value, for example $1000.
  146.  
  147.   -> Menu File, Set start address
  148.  
  149. 4. Set of a file offset
  150. -----------------------
  151.  
  152. Normally, the reassembler starts at the first byte of your binary code
  153. file. You can change the reassembler start in your file. For example,
  154. you set this file offset to $100. Now, the reassembler ignores the first
  155. 256 bytes of your binary code file.
  156.  
  157. The second way is the split of your code file with a debugger.
  158.  
  159.   -> menu File, set start address
  160.  
  161. 5. Reduction of the reassembler ASCII output
  162. --------------------------------------------
  163.  
  164. The reassembler produces an enormous number of output lines. You can
  165. limit the number of bytes for decode.
  166.  
  167. You must set to max. reassembler decode length in the menu File (Set start
  168. address). Normally, the reassembler decodes the whole code block.
  169.  
  170. For example, you can limit the max. reassembler decode length to 100 bytes.
  171.  
  172. 6. Jump to a code address
  173. -------------------------
  174.  
  175. You can use the cursor keys or the mouse for the scrolling of the
  176. reassembler output. Additional, you can jump to a specified code
  177. address.
  178.  
  179.   -> Menu file, Jump to address
  180.  
  181. Please input the hexadecimal address of the new output listing start.
  182.  
  183. 7. Hiding of code and addresses
  184. -------------------------------
  185.  
  186. Normally, the reassembler output includes code, addresses, mnemonics
  187. and label. Code and addresses aren't needed for assemblers. Assemblers
  188. only use label und mnemonics for new compilations.
  189.  
  190.   -> Set hiding of code and addresses (Menu File, Show code/addresses)
  191.  
  192. 8. Reassembler output as ASCII file or printer output
  193. -----------------------------------------------------
  194.  
  195. You can store or print reassembler outputs.
  196.  
  197.   -> Menu Output, Printer or File
  198.  
  199. After the selection of printer or file, you must reassemble the code.
  200.  
  201. **************************************************************************
  202.  
  203.                   Label handling / Symbolic reassembling
  204.                   --------------------------------------
  205.  
  206. 1. Label handling
  207. -----------------
  208.  
  209. The reassembler uses a 64 KB array for storing label positions. This
  210. label list is normally cleared by every reassembler start.
  211.  
  212. The menu entry 'Clear automat. label' sets or resets the automatic
  213. clear of this label list.
  214.  
  215. You can disable the automatic clearing of this list. Now, you can add
  216. several other code blocks to the label list. This option is very useful
  217. for the detection of jumps from other code segments in the actual code
  218. segment.
  219.  
  220. 2. Save label file
  221. ------------------
  222.  
  223. You can save the actual label list on disc for later analysis of the
  224. code. Label list files have the file extension .LAB.
  225.  
  226. 3. Load label file
  227. ------------------
  228.  
  229. You can load the 64 KB label list file from disc. The clear of the
  230. label list will be disabled.
  231.  
  232.                       Symbolic reassembling
  233.                       ---------------------
  234.  
  235. Symbolic reassembling is only supported by the Z-80 and 6502 reassembler.
  236. Z80 and 6502 processor are often used for home computers, like C64 or
  237. Amstrad CPC 464.
  238.  
  239. For these home computers exist symbol tables of important ROM and port
  240. addresses.
  241.  
  242. Main differences between disassembler and reassembler decoding :
  243. ----------------------------------------------------------------
  244.  
  245.  - Disassembler : generates jumps/absolute addresses in hexadecimal
  246.                   terms, like LDA $12AE
  247.  
  248.  - Standard reassembler : generates jumps/absolute addresses in auto-
  249.                           matic labels, like LDA L12AE. Reassembler
  250.                           outputs are address independent for assemblers.
  251.  
  252.  - Symbolic reassembler : generates jumps/absolute addresses with your
  253.                           symbols, like LDA VALUE_1. You can find
  254.                           important ROM and port addresses much easier.
  255.  
  256. 1. Definition of symbols
  257. ------------------------
  258.  
  259.     - max. 2000 symbols are allowed
  260.     - max. symbol length = 8 characters
  261.  
  262. All symbols are written with a standard ASCII editor in an ASCII file.
  263. The ASCII file has the file extension .LBI. The symbol addresses must
  264. be specified in hexadecimal form.
  265.  
  266.     Symbol file example (6502.LBI):
  267.     -------------------------------
  268.  
  269.     POS_1=203
  270.     LOOP=20D
  271.     LOOP_1=214
  272.     SET_TST=219
  273.     PROC_1=223
  274.     PROC_2=22E
  275.     VALUE_1 = 68
  276.     VALUE_2 = 69
  277.  
  278. 2. Import of ASCII symbols :
  279. ----------------------------
  280.  
  281.    -> Menu Symbols, Import symbols
  282.  
  283.    Symbol file has the file extension .LBI. The reassembler imports this
  284.    file and sort it by address. Now you can use this symbols for your
  285.    next reassembler run.
  286.  
  287. 3. Generating of a symbol file
  288. ------------------------------
  289.  
  290. After the import of a symbol file, you can generate a compact label
  291. file. This label file stores all symbolic informations in a compact
  292. and sorted form. This label file will be loaded faster than a ASCII
  293. symbol list.
  294.  
  295. Label symbol files has the file extension .SYM.
  296.  
  297. 4. Load a symbol file
  298. ---------------------
  299.  
  300. The menu entry loads compact label symbol files with the file extension
  301. .SYM.
  302.  
  303. ***************************************************************************
  304.  
  305.                    Colors of reassembler lines
  306.                    ---------------------------
  307.  
  308. If you use the reassembler with color monitor (min. 640*400 16 colors),
  309. then the reassembler use colored lines for extra informations.
  310.  
  311. - Red color   : address has a label
  312. - Black color : mnemonic has absolute address/jump
  313. - Blue color  : no label/absolute information
  314.  
  315. The color red has the main priority. It can overwrite black informations
  316. with red informations.
  317.  
  318. ***************************************************************************
  319.  
  320.                 Special control und port addresses
  321.                 ----------------------------------
  322.  
  323. The INTEL 8051-series and the Motorola 68HC11 have special function
  324. registers. The reassembler use this SFR names instead of automatic
  325. labels.
  326.  
  327. The 68HC11 reassemblers allows the disabling of this register name
  328. display.
  329.  
  330.                        Keyboard shortcuts
  331.                        ------------------
  332.  
  333.      Overview of the standard keyboard shortcuts of all reassemblers.
  334.  
  335.      Menu File
  336.      ---------
  337.  
  338.      Load code            Control L
  339.      Set start address    Control S
  340.      Jump to address      Control A
  341.      Reassemble           Key F1
  342.      Exit program         Control Q
  343.  
  344.      Menu Output
  345.      -----------
  346.  
  347.      Screen               Control B
  348.      Printer              Control P
  349.      File                 Control F
  350.  
  351.      Menu Label
  352.      ----------
  353.  
  354.      Load label file      Control T
  355.      Save label file      Control N
  356.      Clear autom. label   Control C
  357.  
  358. *****************************************************************************
  359.  
  360.               Source code of the 8080/85 reassembler
  361.               --------------------------------------
  362.  
  363. The 8085 reassembler source code is available in the folder SOURCE85.PAS.
  364. You can use this source code free for your own Pure PASCAL GEM or
  365. reassembler experiments. All other reassembler source codes aren't free
  366. and not available for programmers.
  367.  
  368. Files of the source code :
  369. --------------------------
  370.  
  371. Compilation: only compiler flag Z is set, stack size 16384 bytes
  372.  
  373.     REASS_85.PAS  - Source code of 8080/85 reassembler
  374.     REASS_85.RSC  - Resource file of 8080/85 reassembler
  375.     REASS_85.I    - Resource file constants (Interface 2.2 RCS PASCAL output)
  376.     REASS_85.HRD  - RCS Interface 2.2 RCS info file
  377.     GEMINIT.PAS   - Include file for GEM init
  378.     GEMINIT.PPU   - GEM-Init as UNIT
  379.  
  380. ******************************************************************************
  381.  
  382.                  Other free PD-/Shareware assemblers
  383.                  -----------------------------------
  384.  
  385. The german Computer Club Elmshorn has collected a lot PD-/Shareware
  386. assemblers. You can get these assemblers without any charge. Select
  387. the disc number and send me the empty discs and the postage costs for
  388. return.
  389.  
  390. Short information about the PD list codes :
  391.  
  392.    X = runs on every ATARI system (min. 1 MB)
  393.    S = runs only on ST/STE
  394.    G = GEM program
  395.    N = TOS/TTP programm
  396.    A = screen resolution independent
  397.    M = only in monochrome ST-High
  398.    HD = needs 1.44 MB disc
  399.  
  400. Asterix : quality level
  401.  
  402. ------------------------------- (Assembler) -------------------------------
  403.  
  404.   31  68000-ASSEMBLER-Package                             MXN          *
  405.   58  Disassembler 68000                                  AXN
  406.   95  Disassembler 68000                                  AXN
  407.   98  Turbo-Ass 1.72 & Debugger                           BSP          **
  408.  143  Assembler 6303                                      AXN          *
  409.  143  Assembler 65c02                                     AXG          *
  410.  146  Z-80 Crossassembler                                 MSN          *
  411.  220  Sharp Pocket Assembler                              MSN          *
  412.  263  68000-Assembler (incl. ASM-Source)                  AXN          *
  413.  263  8048-Assembler/Disassembler (Incl. ASM-Source)      AXN          *
  414.  300  Assembler NEC 78310/312                             AXN          *
  415.  300  Assembler MCS 48                                    AXN          *
  416.  300  Assembler 8051                                      AXN          *
  417.  341  Desert Drain 1.1 680xx-Reassembler                  AXG          *
  418.  380  Desert Drain 1.3 680XX-Reassembler                  AXG          **
  419.  450  6502-Emulator-Demo                                  AXG          **
  420.  457  GNU-Assembler 1.38                                  AXN          **
  421.  505  TurboAss & Debugger 1.77                            AXP          **
  422.  580  MIT2MOT-Konverter GNU68000-Syntax to Motorola       AXN          *
  423.  611  6502-Disassembler                                   AXN          *
  424.  721  Crossassembler 6800/02/04/05/6303                   AXN          **
  425.  721  Crossassembler 6809/6811                            AXN          **
  426.  721  Crossassembler Z80/HD64180                          AXN          **
  427.  721  Crossassembler 8080/85                              AXN          **
  428.  721  Disassembler 68000                                  AXN
  429.  721  Assembler HP-48 0.99b                               AXN          **
  430.  748  FAS Crossassembler RCA 1805         HD              AXN          **
  431.  748  FAS Crossassembler 2650 SC/MP II    HD              AXN          **
  432.  748  FAS Crossassembler 6301             HD              AXN          **
  433.  748  FAS Crossassembler 6805             HD              AXN          **
  434.  748  FAS Crossassembler 6809             HD              AXN          **
  435.  748  FAS Crossassembler 6811             HD              AXN          **
  436.  748  FAS Crossassembler Zilog Z8         HD              AXN          **
  437.  748  FAS Crossassembler Zilog Z80        HD              AXN          **
  438.  748  FAS Crossassembler TI 7000          HD              AXN          **
  439.  748  FAS Crossassembler 6502             HD              AXN          **
  440.  748  FAS Crossassembler Intel 8048       HD              AXN          **
  441.  748  FAS Crossassembler Intel 8051       HD              AXN          **
  442.  748  FAS Crossassembler Intel 8096       HD              AXN          **
  443.  748  FAS Source codes (.LZH)             HD              AXN          **
  444.  
  445. ------------------------------ Assembler (DSP 56001) -----------------------
  446.  
  447.  502  DSP-56000/01-ASSEMBLER                              AXN          **
  448.  682  DSP-Shell 1.0 for DSP-ASSEMBLER                     AXG          **
  449.  756  DSP 56001-Disassembler (.LOD)                       AXN          **
  450.  756  DSP converter .OUT to .LOD                          AXN          *
  451.  
  452. ***************************************************************************
  453.  
  454.                            Bug reports
  455.                            -----------
  456.  
  457. The coding of reassemblers is a very hard work. Thousands of bit combina-
  458. tions must be checked. These 6 reassemblers was designed and checked in
  459. 1 month ! That's a every short developing time.
  460.  
  461. If you find some bugs in the reassemblers, please inform me. I will send
  462. you an update.
  463.  
  464. **************************************************************************
  465.  
  466.                     Soft- and hardware system
  467.                     -------------------------
  468.  
  469. The reassemblers were programmed with :
  470.  
  471.    - ATARI TT 4MB/105MB HD and Proscreen TT/PTC 1526
  472.    - PurePASCAL 1.1 Application Systems Heidelberg
  473.    - Interface 2.2 RCS
  474.  
  475. *************************************************************************
  476.  
  477.                              Epilogue
  478.                              --------
  479.  
  480. ATARI systems need new software ideas. We must enter in the classic
  481. areas of PC software. ATARI programs must have the lower price and the
  482. better quality as PC applications. Please, don't write the REVERSI
  483. number 1000. Take your programming power for new application areas.
  484.  
  485. Have a lot fun with the reassemblers !
  486.  
  487. Jens Schulz
  488. 18th april 1994
  489.