Chris Collins

Tools · retro

Amiga hunk executables and 68000 disassembler

Inspect Amiga executables — hunk header, CODE/DATA/BSS hunks with CHIP and FAST flags, relocations, symbols, LINE debug info, and overlays — disassemble 68000 code with labels, turn hex into 68000 instructions, and look up any 68000 instruction's flags and cycle timings.

Added

How to use it
  • Executable — drop an AmigaOS program, library, device or handler (or Load a sample executable). You get the hunk table (type, size, memory type, relocations, symbols), the file’s block structure in order, and the selected hunk: CODE is disassembled, DATA is shown as a hex dump. Labels come from HUNK_SYMBOL, branch targets (L…), and PC-relative data references (D…, shown as dc.b); relocated addresses show the target hunk or symbol. Library calls through A6 are annotated with their exec or dos function name. Copy listing or Download .s.

  • Hex → 68000 — paste bytes in almost any notation (4e75 4e71, $4E75,$4E71, dc.w …) with a base address and get a labelled listing.

  • 68000 reference — every instruction with its syntax, sizes, X N Z V C flags, and cycle counts, plus the effective-address timing table. Search by mnemonic or by words like "shift" or "privileged".

The disassembler is plain 68000: 68010+ and 68020+ encodings, line-A and line-F words are shown as dc.w.

Format notes

  • An executable starts with HUNK_HEADER ($3F3): resident library names (always none in practice), the table size, the first and last hunk numbers, and one size per hunk in longwords. Bits 30–31 of a size are the memory type: 01 CHIP, 10 FAST, 11 an extra longword of MEMF flags follows.

  • Each hunk is HUNK_CODE ($3E9), HUNK_DATA ($3EA) or HUNK_BSS ($3EB, size only), then optional blocks, then HUNK_END ($3F2):

    • HUNK_RELOC32 ($3EC): groups of count, target hunk, offsets — add the target hunk’s load address to the longword at each offset; a zero count ends the list. HUNK_RELOC32SHORT ($3FC, and $3F7 in executables) is the same with 16-bit words.

    • HUNK_SYMBOL ($3F0): name length in longwords, name, value; zero ends.

    • HUNK_DEBUG ($3F1): a length and free-form data. The common LINE format is a base offset, LINE, the source file name, and pairs of line number and code offset.

  • HUNK_OVERLAY ($3F5) starts an overlay table; overlay nodes follow, separated by HUNK_BREAK ($3F6). The tool lists them but does not resolve the overlay tree.

  • Timings are 68000 clock periods with no wait states, from the MC68000 User’s Manual section 8. Chip RAM contention and the 68000’s 4-cycle bus make real Amiga timing vary.

Sharing

Share link copies a link to the open tab: hex words to disassemble (?hex=, ?base=) or a reference search (?rq=) — for example ?hex=4e75. Executables are opened from your disk and never travel in links.

To add up the cycles of a whole routine against an Amiga or ST frame, use the 68000 cycle counter.

Runs entirely in your browser; nothing you type leaves this page.