cpu-z180

Documents Z180 and eZ80 Z80-mode CPU specifics for z88dk assembly and float code.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When writing or benchmarking Z180 or eZ80 Z80-mode code in z88dk, developers need accurate facts about hardware multiply instructions, math32 library variants, ticks emulator flags, and CPU preprocessor defines, which are easy to confuse across similar targets. ## Core Features & Use Cases - Hardware multiply reference: Documents the mlt bc/de/hl/sp instructions (ED 4C/5C/6C/7C) shared by Z180 and eZ80 Z80-mode, useful for multiply-heavy float code. - Toolchain flags and defines: Maps -mz180 to __CPU_Z180__ and -mez80_z80 to __CPU_EZ80_Z80__, and links math32_z180.lib versus math32_ez80_z80.lib. - Benchmarking guidance: Explains z88dk-ticks -mz180 versus -mez80_z80 and warns against mixing tick counts between the two CPUs. - Use Case: While optimizing a math32 floating-point routine for a yaz180 target, check which mlt encodings z80asm accepts and which ticks flag produces correct cycle counts. ## Quick Start Ask the agent which z88dk flags, mlt instructions, and math32 library apply when writing Z180 float code for the yaz180 target.

Frequently Asked Questions about cpu-z180

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

FAQPage Schema
How do I use the Z180 mlt hardware multiply instruction in z88dk?

The Z180 mlt instruction multiplies 8-bit register pairs using forms mlt bc, de, hl, or sp with encodings ED 4C/5C/6C/7C. The same encodings work on eZ80 in Z80-mode, and they help multiply-heavy float code but not division restoration.

What is the difference between math32_z180.lib and math32_ez80_z80.lib?

math32_z180.lib is the Z180 float library, while math32_ez80_z80.lib is the eZ80 Z80-mode product built via newlibfiles_ez80_z80.lst. Both share the same Z180 mlt helper routines for multiplication.

Which ticks flag should I use for Z180 versus eZ80 Z80-mode benchmarking?

Use z88dk-ticks -mz180 for Z180 targets and -mez80_z80 for eZ80 running in Z80-mode. Do not paste ez80_z80 tick counts into a z180 results row, since the cycle counts differ between the two CPUs.

What preprocessor define does -mz180 set in z88dk?

Compiling with -mz180 defines __CPU_Z180__. The -mez80_z80 flag defines __CPU_EZ80_Z80__ instead, which is distinct from __CPU_EZ80__ used only for ADL mode with -mez80.

Does z80asm allow synthetic instructions in Z180 strict mode?

No, strict mode forbids free synthetic instructions such as word-copy sequences like ld de,hl. In normal mode z80asm may accept synthetics or helper calls, but strict mode accepts only real opcodes and approved aliases.