JNEXT
Skip to content

Disassembly

Disassembly panel

Z80 plus all 26 Z80N instructions, disassembled live from memory as the CPU sees it. Columns, left to right, are the Mem column (which memory the line's bytes come from: P04, ROM0, DIVROM, or the physical address; details), the address, the BP column (the breakpoint gutter), the mnemonic and the raw opcode bytes, so the instruction sits next to where you set its breakpoint. At a DivMMC entry the line at PC shows the DivMMC ROM's instruction, the one the CPU is about to run, with DIVROM beside it. The line at PC is highlighted in yellow and set in bold; the lines you select are highlighted in blue — over the top of the yellow, so the PC line stays recognisable inside a selection, and clear of the BP column, so breakpoint dots stay visible.

  • Click the BP column (the gutter between the address and the instruction) on any line to set or clear an execute breakpoint (shown as a red dot). A breakpoint that has been suspended — unticked in the Breakpoints panel, or covered by its master switch — is drawn as a hollow red ring instead; clicking its gutter still removes it. The gutter draws and changes only this window's own breakpoints, never one that GDB, ZRCP, DeZog or a script set: see Whose breakpoints the gutters show and change.
  • With memory coverage on, a green bar sits just right of the BP column, before the instruction, on every line whose instruction ran.
  • Click and drag over the listing to select a range of lines, or click one line to select just that one. Shift+click extends the selection from where it started, and Shift + ↑ ↓ Page Up/Down Home End do the same from the keyboard. Ctrl+A selects everything in the view.
  • Address box: type a hex address (8000, $8000, 0x8000) or a loaded symbol and press Enter to centre the view there. A number wins over a symbol spelled like one; write @name to mean the symbol.
  • Go to PC re-centres on the current instruction.
  • A Label column appears between the BP column and the instruction once any label is known: the name of the line's own address in its memory, loaded or your own, shortened after 16 characters. Your comment follows the opcode bytes as ; first line. See Your own labels and comments.
  • With a source map loaded, a selection here moves the Source tab (the cursor goes to the line of the instruction you clicked, and the lines of the whole range are tinted), and the instructions of the Source tab's selected lines are tinted pale violet here. The right-click menu adds Show in Source, which raises the Source tab on the line of that instruction; it is disabled, with the tooltip no source line at $A000, where no line covers the address, and not offered without a source map.
  • The scrollbar spans the whole $0000–$FFFF address space. ↑ ↓, Page Up/Down, Home and End navigate; Enter runs to the selected line.

Copying the listing

Ctrl+C, or Copy in the right-click menu, puts the selected lines on the clipboard as assembly only — mnemonics and operands, one instruction per line, indented four spaces. The address column, the opcode bytes and the breakpoint gutter are all stripped, and symbols from a loaded MAP file are kept, so what you paste is what you would have written by hand:

    LD HL,screen_buf
    NOP
    CALL entry

Copy with Addresses is the same selection with the address and opcode columns kept, for a bug report or an annotated trace. It keeps the order of an assembler listing (address, bytes, instruction), not the panel's:

$8000  21 34 12     LD HL,screen_buf
$8003  00           NOP
$8004  CD 00 80     CALL entry

A z88dk C symbol is painted by its C name (counter) but copied by its assembler name (_counter), so the pasted text still assembles.

Right-clicking inside the selection keeps it; right-clicking outside collapses it onto the line you clicked, so Copy on a line you have not selected copies that one line. Both chords only apply while the disassembly panel has focus — click in it first if you have been typing somewhere else.

A few things worth knowing:

  • The selection is a range of addresses, not of screen rows. Scrolling the view, stepping the CPU and Go to PC all leave it alone, and a copy still produces the whole range even when none of it is on screen any more.
  • The text is disassembled from memory at the moment you copy, not from what is painted. That is what makes the point above work, and it also means copying while the machine runs freely — when the panel has deliberately stopped redrawing — gives you the code that is in memory now.
  • Copying with nothing selected does nothing; it never clears the clipboard.

The right-click menu

The right-click menu is where most of the day-to-day work happens:

Entry Effect
Copy The selected lines as assembly only
Copy with Addresses The selected lines with the address and opcode columns
Select All Select every line in the view
Toggle Breakpoint Execute breakpoint on this line
Run to Here Resume until this address is reached
Go to Address… Jump to the address box
Add / Rename Label…, Remove Label, Add / Edit Comment… Your own label and comment for this line's address, in its memory (Your own labels and comments)
Watch symbol / Watch $nnnn Watch this line's symbol, or a 16-bit immediate in the instruction
Watch (HL) (DE) (BC) (IX (IY (SP) Watch the address the register currently holds
Break on Read / Break on Write Data breakpoint on that immediate, or on the register's current value

The register entries only appear when the instruction actually references that register indirectly, and they capture the register's value at the moment you open the menu — they are a shortcut for "watch what HL is pointing at right now", not a moving target.

The panel does not follow PC while the machine runs freely, or during a "Run to Here" — it is only redrawn when execution stops.