The Atari binary disassembler

rg-dis

Turn Atari 680x0 binaries back into re-assemblable source you can understand and rebuild.

Loading release…

Key features

  • Byte-Identical Re-assembly: Generates clean source code whose code and data sections re-assemble byte-for-byte through rg-asm --no-opt-size, tested against a large range of Atari binaries.
  • Atari OS Trap Annotations: Automatic trap-call decoding for GEMDOS, BIOS, XBIOS, AES, VDI and Line-A calls, annotating function names, stack arguments, and return values.
  • Hardware & System Annotation: Built-in knowledge of Atari hardware registers (MFP, Blitter, YM2149 etc), system vectors and TOS variables.
  • Smart Labelling: Derives contextual names for strings, system variables, hardware vectors, and trap return points to make disassembled code easier to read.
  • VT-52 Annotations: Decodes and annotates VT-52 terminal escape sequences (cursor positioning, clearing, styles) in data strings with contextual VT52_ smart labels.
  • Symbol Tables: Supports embedded symbols across Atari toolchains — DRI/Alcyon, Devpac/HiSoft GST, ELF, and VBCC a.out, plus external .sym sidecars for raw images.
  • String Extraction: Extracts readable strings, filtering out the opcode noise in decoded instruction regions, with quality scoring, ASCII decoding, and Atari ST character set recognition.
  • Floppy & Boot Sector Disassembly: Disassembles executable boot sectors or raw tracks directly from .ST, .MSA, and Pasti .STX disk images — ideal for custom loaders, demos, and games.
  • Floppy & Image Inspection: Inspects disk geometry, executable boot blocks, FAT12 filesystem health, cluster allocations, and file directory trees (--inspect disk) across .ST, .MSA, and Pasti .STX floppy images.
  • Direct Archive & Disk Extraction: Disassembles files nested inside .ZIP, .LZH, or floppy disk images in memory without unpacking them first.
  • Instruction Cycle Annotations: Annotates each instruction line with right-aligned CPU cycle execution costs (--annotate-cycles) dynamically calculated for 68000 and 68030 architectures.
  • Binary Formats: Handles GEMDOS .TOS/.PRG executables, ELF objects, DRI/GST relocatables, VBCC a.out, static .a libraries, and raw binary dumps.
  • Function & Cycle Metrics: Maps routine extents and estimates 68000 cycle costs per function as formatted terminal tables or structured JSON.
rg-dis; OS trap argument decode & hardware memory map
$ rg-dis GAME.TOS
 
  █▀▀▄ █▀▀▀
  █▀█▄ █ ▀█   RESERVOIR GODS
  ▀  ▀ ▀▀▀▀   rg-dis 0.7.3 · m68k disassembler
 
   Disassembling GAME.TOS (564,066 bytes)
  ✓ Disassembled 564,066 bytes in 1.69s
 
_start:
    MOVE.L    4(A7),A5                   ; basepage pointer
    MOVE.L    $0C(A5),D0                  ; text size
    ADD.L     $14(A5),D0                  ; data size
    ADD.L     $1C(A5),D0                  ; bss size
    ADDI.L    #$0100,D0                   ; basepage header (256 bytes)
    MOVE.L    D0,-(A7)                    ; newsiz - new size in bytes
    MOVE.L    A5,-(A7)                    ; block - start of block to shrink
    CLR.W     -(A7)                       ; zero - reserved, must be 0
    MOVE.W    #74,-(A7)                   ; Mshrink - shrink a memory block
    TRAP      #1                          ; GEMDOS #74 (Mshrink)
    LEA       $C(A7),A7
    CLR.L     -(A7)                       ; Super(0) -> enter supervisor mode
    MOVE.W    #32,-(A7)                   ; GEMDOS #32 (Super)
    TRAP      #1                          ; GEMDOS #32 -> D0 = old SSP
    LEA       6(A7),A7
    MOVE.W    #$0000,($FFFF8240).W        ; write palette[0]
    MOVE.B    #$00,($FFFF8260).W          ; sshiftmod - ST low resolution

$ 

Quick start

rg-dis game.tos -o game.s                        # disassemble executable → .s
rg-dis game.tos --annotate-cycles -o game.s       # per-instruction CPU cycle costs
rg-dis game.tos --inspect cpu                    # minimum CPU & FPU requirements
rg-dis game.tos --inspect functions,cycles       # function sizes & 68000 cycles
rg-dis game.tos --inspect strings                # scored string extraction
rg-dis cuddly.msa --bootsector                   # extract & disassemble boot block
rg-dis cuddly.msa                                # floppy image: auto-routed to the disk pipeline
rg-dis game.st --disk 10/0/1..10/1/9             # floppy track & sector range
rg-dis AUTO/GAME.PRG --container game.msa        # direct in-container extraction
rg-dis tos.img --org 0xFC0000 --sym tos.sym      # ROM image with DRI/GST symbol map

Verify

After unzipping, check the extracted files (the archive includes SHA256SUMS):

sha256sum -c SHA256SUMS

Learn more