cpu-8080

Guides writing and reviewing Intel 8080 assembly for z88dk using Zilog mnemonics.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing correct Intel 8080 assembly inside the z88dk toolchain is error-prone: opcode bytes, flag behavior, and timings differ from the 8085, Z80, and gbz80, and z88dk sources must use Zilog mnemonics rather than the Intel names found in most references. This Skill provides the authoritative rules, mnemonic mappings, flag tables, and portable coding patterns needed to produce valid 8080 library code. ## Core Features & Use Cases - Intel-to-Zilog mnemonic translation: Complete mapping table (MOV→ld, LXI→ld rp, DAD→add hl,rp, etc.) so code imported from Intel manuals or Pastraiser is emitted correctly. - Flag and timing authority: Exact S Z A P C flag behavior per instruction group and Pastraiser T-state timings, including traps like 16-bit inc/dec setting no flags and rotates not setting Z. - 8080-portable coding patterns: Stack-only locals, open-coded 16-bit subtract and shifts through A, counted loops without djnz, and rules for which z80asm synthetics (jr, ld hl,sp+n, word copies) are safe. - Use Case: When adding a routine to libsrc/l/sccz80/8-8080/ or building with zcc +cpm -clib=8080, use this Skill to verify every instruction is native 8080, flags are tested correctly, and no 8085/Z80-only opcodes slip in. ## Quick Start Ask the AI to write or review an 8080 assembly routine for z88dk, for example: "Write an 8080-portable 16-bit memcpy loop for libsrc using Zilog mnemonics."

Frequently Asked Questions about cpu-8080

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

FAQPage Schema
How do I write Intel 8080 assembly for z88dk?

Write Zilog mnemonics (ld, jp, add hl,rp) rather than Intel names (MOV, JMP, DAD), assemble with -m8080 or build via zcc +cpm -clib=8080. Keep locals on the stack and avoid any 8085 or Z80-only instructions.

How do I translate Intel 8080 mnemonics to Zilog syntax?

Use the mapping table: MOV becomes ld, LXI becomes ld rp,d16, DAD becomes add hl,rp, STAX/LDAX become ld (bc),a and ld a,(bc), and JMP/CALL/RET become jp/call/ret. The Skill provides the complete translation table for all 8080 instructions.

Can I use Z80 instructions like djnz or exx in 8080 code?

No. Opcodes like djnz, exx, and IX/IY prefixes occupy bytes that are unused alternate encodings on the 8080. The jr instruction is allowed only as a z80asm synthetic that expands to a 3-byte jp in normal mode.

Why does my 8080 loop counter test fail after dec bc?

16-bit inc and dec on register pairs set no flags on the 8080, so dec bc never sets Z. Test the count through A with ld a,b followed by or c, then branch with jp nz, or split the count into inner and outer 8-bit loops.

What is the difference between 8080 and 8085 assembly in z88dk?

The 8085 adds instructions like rim, sim, sub hl,bc, and ld de,sp+n on bytes that are unused NOPs on the 8080, plus extra K/V flags. Load the cpu-8085 skill only when emitting those extended ops; never mix both for one target.

Why should pop af never hold a return address on the 8080?

Flag register bits 5 and 3 are hardwired to 0 and bit 1 is hardwired to 1, so a word popped into AF is corrupted ($FFFF becomes $FFD7). Use BC, DE, or HL to preserve return addresses; pop af is only safe for discarding stack words.