tool-ticks

Runs z88dk-ticks emulator to count T-states, debug binaries, and profile hotspots.

1.1k|206|Updated Mar 16, 2016
One-click install
npx skills add https://github.com/z88dk/z88dk --skill tool-ticks-z88dk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tool-ticks
Source: https://github.com/z88dk/z88dk/tree/main/.agents/skills/tool-ticks
Command: npx skills add https://github.com/z88dk/z88dk --skill tool-ticks-z88dk

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Timing Z80/8080 code on real hardware is impractical, and wall-clock timing is inaccurate for retro targets. This Skill guides correct use of the z88dk-ticks cycle-accurate emulator so you can measure T-states, debug binaries, and find performance hotspots without hardware. ## Core Features & Use Cases - Cycle-accurate execution: Run compiled binaries under the correct CPU model (-m8080, -m8085, -mz80, -mz80n, -mgbz80, and more) to count exact T-states. - TIMER-based benchmarking: Bound measurement regions with -x map, -start TIMER_START, -end TIMER_STOP, and -counter for library timing and benchmark suites. - Debugger and hotspot profiling: Enable the interactive debugger and 'hotspot on' to produce a hotspots file identifying expensive code paths. - Use Case: Compile an n-body benchmark with zcc +test, then run it under z88dk-ticks with a raised -counter to get precise cycle counts for A/B library comparisons. ## Quick Start Compile my C program with zcc +test and run the resulting binary under z88dk-ticks with the matching CPU model to count its T-states.

Frequently Asked Questions about tool-ticks

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run a binary with z88dk-ticks?

Compile with zcc +test -vn prog.c -o prog.bin -m, then run z88dk-ticks with the CPU flag before the binary, for example z88dk-ticks -mz80 prog.bin. The CPU model must match how the binary was compiled.

How do I measure T-states for a specific code region in ticks?

Use the TIMER bounds: pass -x with the map file, then -start TIMER_START and -end TIMER_STOP with a -counter limit. The emulator reports cycle counts only for the bounded region, which suits library timing.

Why does z88dk-ticks -h fail?

The tool treats -h as an input filename rather than a help flag, so it errors out. Run z88dk-ticks with no arguments to print the usage information instead.

Why does my benchmark stop mid-loop under ticks?

The default -counter limit of 100000000 instructions caps execution, so long runs like n-body with n above roughly 125 die mid-loop. Raise the -counter value to let the whole program complete.

Which CPU models does z88dk-ticks support?

Supported models include -m8080, -m8085, -mz80, -mz80_strict, -mz80n, -mz180, -mgbz80, -mez80_z80, -mr800, and Rabbit variants -mr2ka through -mr6k. Using the wrong model produces incorrect illegal-opcode behavior and timings.