From Atari Wiki
Jump to navigation Jump to search

                    * 8-bit CPU Reassembler package    *
                    * incl. PurePASCAL GEM source code *

Program author :

Jens Schulz
Rosenstrasse 5
D-25368 Kiebitzreihe


           Reassembler package for these 8-bit CPU processors :

       - INTEL 8051/52/252/535 microcontroller
       - INTEL 8048 microcontroller series
       - Zilog Z-80 CPU
       - Mostek/Rockwell 6502-CPU
       - Motorola 68HC11 microcontroller
       - INTEL 8080/85-CPU


        GEM / MultiTOS
        screen resolution independent > 640*400 dots
        requires 1 MB RAM


                   These programs are Freeware

You can copy and swap these programs freely without any charge. Sale or
use in any other software for profit is strict forbidden. It's free for
BBS downloading and PD collections.


                       What's a reassembler ?

First, let's talk about the PurePASCAL GEM source code. If you are a GFA-
or OMIKRON BASIC programmer, you can learn GEM programming under PurePASCAL.
I've put the complete PurePASCAL 1.1 GEM source code of the 8080/85 reassemb-
ler in the folder SOURCE85.PAS.

The source code is very useful for learning the main aspects of screen
resolution independent GEM programming. The source code shows you the
handling of dialogues, GEM redraws, VDI 109 and dynamic memory allocations.
I've programmed in many programming languages GEM programs. PurePASCAL is
the easiest way to learn GEM. Forget all these 'damned' BASIC POKES and
use the power of PP GEM-handling. PP GEM programming is easier than C
GEM handling.


Reassembler are very useful for decoding machine language programs. If
you've never programmed 8-bit CPU's in assembler, you don't need these
programs. You can only use the PP source code for your own programs.

Next chapters are only for assembler experts :

A reassembler is an extended disassembler. It can decode machine programs
with mnemonics and labels. Reassemblers insert labels of jumps or absolute
addresses in the disassembler listing.

Reassembler listing are address independent. You can use the generated
ASCII outputs for your assembler programs.

The Z80- and 6502 reassembler additional support the symbolic reassembling.
Normally the reassemblers produce automatic labels, like LXXXX. XXXX is
the hexadecimal address of the label. Symbolic reassemblers can exchange
these automatic labels with symbolic names. Symbolic reassemblers need
a symbol table. These symbol tables exist often for the standard home
computers (C64, Amstrad CPC 464 etc.). These home computers use 6502 or
Z 80 CPU's.

                          Who uses a reassembler ?

1.)  very rare use :

     You believe, that your high level compiler codes ineffective or
     wrong code.

2.)  rare use :

     You've formatted or lost your assembler source code of your last
     machine control board programming.

3.)  normal use :

     You've got a program from a programming competitor. You will do all
     for cracking his 'Hyperpokes'.

4.) worst case :

    The competitor uses self modifying code or the microcontroller allows
    the the locking of the ROM, like 68HC11. That's the worst case for
    reassembler use.


                      General handling of the reassemblers

The six reassemblers have only a few differences in their programming
handling. The most menu entries are equal. Special functions of each
reassembler is described in a separate info file.

1. Max. code size for the reassemblers

   The max. size of a code block is restricted to 8 KByte, why ?
   8 KB machine code produces thousands of reassembler lines.

   The reassembler label handling allows the addition of code segments.
   Additional, you can concat the ASCII outputs with a standard ASCII

2. Reassembling of the code

   - load your max. 8 KB code file (.BIN) from disc (Menu File)

   - reassemble the code with the key F1 or the menu entry 'Reassemble'

   - the reassembler decodes the whole binary code segment with all
     machine command and symbolic labels.

   - you can scroll the output listing with mouse or cursor keys and
     change the output window size.

3. Set of the start address (ORG)

Normally, the reassembler uses the base address $0000 for the code start.
This code start address is called the origin address (ORG). You can set
this ORG address on a new value, for example $1000.

  -> Menu File, Set start address

4. Set of a file offset

Normally, the reassembler starts at the first byte of your binary code
file. You can change the reassembler start in your file. For example,
you set this file offset to $100. Now, the reassembler ignores the first
256 bytes of your binary code file.

The second way is the split of your code file with a debugger.

  -> menu File, set start address

5. Reduction of the reassembler ASCII output

The reassembler produces an enormous number of output lines. You can
limit the number of bytes for decode.

You must set to max. reassembler decode length in the menu File (Set start
address). Normally, the reassembler decodes the whole code block.

For example, you can limit the max. reassembler decode length to 100 bytes.

6. Jump to a code address

You can use the cursor keys or the mouse for the scrolling of the
reassembler output. Additional, you can jump to a specified code

  -> Menu file, Jump to address

Please input the hexadecimal address of the new output listing start.

7. Hiding of code and addresses

Normally, the reassembler output includes code, addresses, mnemonics
and label. Code and addresses aren't needed for assemblers. Assemblers
only use label und mnemonics for new compilations.

  -> Set hiding of code and addresses (Menu File, Show code/addresses)

8. Reassembler output as ASCII file or printer output

You can store or print reassembler outputs.

  -> Menu Output, Printer or File

After the selection of printer or file, you must reassemble the code.


                  Label handling / Symbolic reassembling

1. Label handling

The reassembler uses a 64 KB array for storing label positions. This
label list is normally cleared by every reassembler start.

The menu entry 'Clear automat. label' sets or resets the automatic
clear of this label list.

You can disable the automatic clearing of this list. Now, you can add
several other code blocks to the label list. This option is very useful
for the detection of jumps from other code segments in the actual code

2. Save label file

You can save the actual label list on disc for later analysis of the
code. Label list files have the file extension .LAB.

3. Load label file

You can load the 64 KB label list file from disc. The clear of the
label list will be disabled.

                      Symbolic reassembling

Symbolic reassembling is only supported by the Z-80 and 6502 reassembler.
Z80 and 6502 processor are often used for home computers, like C64 or
Amstrad CPC 464.

For these home computers exist symbol tables of important ROM and port

Main differences between disassembler and reassembler decoding :

 - Disassembler : generates jumps/absolute addresses in hexadecimal
                  terms, like LDA $12AE

 - Standard reassembler : generates jumps/absolute addresses in auto-
                          matic labels, like LDA L12AE. Reassembler
                          outputs are address independent for assemblers.

 - Symbolic reassembler : generates jumps/absolute addresses with your
                          symbols, like LDA VALUE_1. You can find
                          important ROM and port addresses much easier.

1. Definition of symbols

    - max. 2000 symbols are allowed
    - max. symbol length = 8 characters

All symbols are written with a standard ASCII editor in an ASCII file.
The ASCII file has the file extension .LBI. The symbol addresses must
be specified in hexadecimal form.

    Symbol file example (6502.LBI):

    VALUE_1 = 68
    VALUE_2 = 69

2. Import of ASCII symbols :

   -> Menu Symbols, Import symbols

   Symbol file has the file extension .LBI. The reassembler imports this
   file and sort it by address. Now you can use this symbols for your
   next reassembler run.

3. Generating of a symbol file

After the import of a symbol file, you can generate a compact label
file. This label file stores all symbolic informations in a compact
and sorted form. This label file will be loaded faster than a ASCII
symbol list.

Label symbol files has the file extension .SYM.

4. Load a symbol file

The menu entry loads compact label symbol files with the file extension


                   Colors of reassembler lines

If you use the reassembler with color monitor (min. 640*400 16 colors),
then the reassembler use colored lines for extra informations.

- Red color   : address has a label
- Black color : mnemonic has absolute address/jump
- Blue color  : no label/absolute information

The color red has the main priority. It can overwrite black informations
with red informations.


                Special control und port addresses

The INTEL 8051-series and the Motorola 68HC11 have special function
registers. The reassembler use this SFR names instead of automatic

The 68HC11 reassemblers allows the disabling of this register name

                       Keyboard shortcuts

     Overview of the standard keyboard shortcuts of all reassemblers.

     Menu File

     Load code            Control L
     Set start address    Control S
     Jump to address      Control A
     Reassemble           Key F1
     Exit program         Control Q

     Menu Output

     Screen               Control B
     Printer              Control P
     File                 Control F

     Menu Label

     Load label file      Control T
     Save label file      Control N
     Clear autom. label   Control C


              Source code of the 8080/85 reassembler

The 8085 reassembler source code is available in the folder SOURCE85.PAS.
You can use this source code free for your own Pure PASCAL GEM or
reassembler experiments. All other reassembler source codes aren't free
and not available for programmers.

Files of the source code :

Compilation: only compiler flag Z is set, stack size 16384 bytes

    REASS_85.PAS  - Source code of 8080/85 reassembler
    REASS_85.RSC  - Resource file of 8080/85 reassembler
    REASS_85.I    - Resource file constants (Interface 2.2 RCS PASCAL output)
    REASS_85.HRD  - RCS Interface 2.2 RCS info file
    GEMINIT.PAS   - Include file for GEM init
    GEMINIT.PPU   - GEM-Init as UNIT


                 Other free PD-/Shareware assemblers

The german Computer Club Elmshorn has collected a lot PD-/Shareware
assemblers. You can get these assemblers without any charge. Select
the disc number and send me the empty discs and the postage costs for

Short information about the PD list codes :

   X = runs on every ATARI system (min. 1 MB)
   S = runs only on ST/STE
   G = GEM program
   N = TOS/TTP programm
   A = screen resolution independent
   M = only in monochrome ST-High
   HD = needs 1.44 MB disc

Asterix : quality level

------------------------------- (Assembler) -------------------------------

  31  68000-ASSEMBLER-Package                             MXN          *
  58  Disassembler 68000                                  AXN
  95  Disassembler 68000                                  AXN
  98  Turbo-Ass 1.72 & Debugger                           BSP          **
 143  Assembler 6303                                      AXN          *
 143  Assembler 65c02                                     AXG          *
 146  Z-80 Crossassembler                                 MSN          *
 220  Sharp Pocket Assembler                              MSN          *
 263  68000-Assembler (incl. ASM-Source)                  AXN          *
 263  8048-Assembler/Disassembler (Incl. ASM-Source)      AXN          *
 300  Assembler NEC 78310/312                             AXN          *
 300  Assembler MCS 48                                    AXN          *
 300  Assembler 8051                                      AXN          *
 341  Desert Drain 1.1 680xx-Reassembler                  AXG          *
 380  Desert Drain 1.3 680XX-Reassembler                  AXG          **
 450  6502-Emulator-Demo                                  AXG          **
 457  GNU-Assembler 1.38                                  AXN          **
 505  TurboAss & Debugger 1.77                            AXP          **
 580  MIT2MOT-Konverter GNU68000-Syntax to Motorola       AXN          *
 611  6502-Disassembler                                   AXN          *
 721  Crossassembler 6800/02/04/05/6303                   AXN          **
 721  Crossassembler 6809/6811                            AXN          **
 721  Crossassembler Z80/HD64180                          AXN          **
 721  Crossassembler 8080/85                              AXN          **
 721  Disassembler 68000                                  AXN
 721  Assembler HP-48 0.99b                               AXN          **
 748  FAS Crossassembler RCA 1805         HD              AXN          **
 748  FAS Crossassembler 2650 SC/MP II    HD              AXN          **
 748  FAS Crossassembler 6301             HD              AXN          **
 748  FAS Crossassembler 6805             HD              AXN          **
 748  FAS Crossassembler 6809             HD              AXN          **
 748  FAS Crossassembler 6811             HD              AXN          **
 748  FAS Crossassembler Zilog Z8         HD              AXN          **
 748  FAS Crossassembler Zilog Z80        HD              AXN          **
 748  FAS Crossassembler TI 7000          HD              AXN          **
 748  FAS Crossassembler 6502             HD              AXN          **
 748  FAS Crossassembler Intel 8048       HD              AXN          **
 748  FAS Crossassembler Intel 8051       HD              AXN          **
 748  FAS Crossassembler Intel 8096       HD              AXN          **
 748  FAS Source codes (.LZH)             HD              AXN          **

------------------------------ Assembler (DSP 56001) -----------------------

 502  DSP-56000/01-ASSEMBLER                              AXN          **
 682  DSP-Shell 1.0 for DSP-ASSEMBLER                     AXG          **
 756  DSP 56001-Disassembler (.LOD)                       AXN          **
 756  DSP converter .OUT to .LOD                          AXN          *


                           Bug reports

The coding of reassemblers is a very hard work. Thousands of bit combina-
tions must be checked. These 6 reassemblers was designed and checked in
1 month ! That's a every short developing time.

If you find some bugs in the reassemblers, please inform me. I will send
you an update.


                    Soft- and hardware system

The reassemblers were programmed with :

   - ATARI TT 4MB/105MB HD and Proscreen TT/PTC 1526
   - PurePASCAL 1.1 Application Systems Heidelberg
   - Interface 2.2 RCS



ATARI systems need new software ideas. We must enter in the classic
areas of PC software. ATARI programs must have the lower price and the
better quality as PC applications. Please, don't write the REVERSI
number 1000. Take your programming power for new application areas.

Have a lot fun with the reassemblers !

Jens Schulz
18th april 1994