Skip to content

mzd: add --show-cycles flag for per-instruction T-state annotation #12

@oisee

Description

@oisee

Description

mzd --analyze provides recursive descent disassembly with labels and cross-references, but doesn't annotate instructions with their T-state costs. A --show-cycles flag would add cycle counts as comments after each instruction.

Desired output

; ---- sub_8000 ($8000) ----
8000: 3E 02       LD A,$02           ; 7T
8002: D3 FE       OUT ($FE),A        ; 11T
8004: 76          HALT               ; 4T

Options

Could be:

  • --show-cycles — dedicated flag
  • Part of --analyze output by default
  • Separate output format --format cycles

Context

We want to validate T-state annotations in book chapter examples ("Coding the Impossible" — Z80 demoscene book). Having mzd annotate instructions with cycles would let us diff against hand-written cycle comments in the book's .a80 files.

Note

The T-state data is already in the emulator (mze), so the instruction timing tables exist. This is about exposing them through the disassembler output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions