cpu-8085

Guides writing and reviewing Intel 8085 assembly for z88dk using Zilog mnemonics and extended opcodes.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing correct Intel 8085 assembly inside the z88dk toolchain is error-prone: Zilog mnemonics differ from Intel names, the 8085 has undocumented extended opcodes and unique K/V flags, and Z80 assumptions (timings, prefix opcodes, exx/IX/IY) silently break 8085 code. This Skill encodes all of those rules so generated or reviewed 8085 library assembly is correct the first time. ## Core Features & Use Cases - Full opcode reference: Complete 16x16 opcode grid with Zilog mnemonics, Intel cross-references, byte counts, cycle timings, and SZKAPVC flag effects, including the ten undocumented extended instructions. - Coding conventions: Enforces Zilog mnemonics, stack-only locals and intermediates (no invented BSS scratch), correct use of extended ops like sub hl,bc, rl de, sra hl, and ld de,sp+*, plus saccharine assembler sugar rules. - Pitfall prevention: Documents flag traps (K vs Z on 16-bit dec, rotates not writing Z, pop af corrupting return addresses), legal (de) store forms, and jr-as-jp synthetic behavior in normal vs strict assembler modes. - Use Case: When implementing a restoring float divide core for z88dk math32 on the 8085, use this Skill to choose stack-based operand access, sub hl,bc trial subtraction, and K-flag loop control without accidentally using Z80-only instructions. ## Quick Start Ask the AI to write or review an 8085 assembly routine for z88dk, for example: write an 8085 16-bit compare routine using Zilog mnemonics and the extended sub hl,bc instruction.

Frequently Asked Questions about cpu-8085

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

FAQPage Schema
How do I write Intel 8085 assembly in z88dk?▼

Write 8085 assembly in z88dk using Zilog mnemonics, not Intel names: ld a,b instead of MOV A,B, jp nz instead of JNZ. The assembler accepts the ten 8085 extended opcodes like sub hl,bc and ld de,sp+* in normal mode.

What are the undocumented 8085 instructions and when should I use them?▼

The ten extended opcodes include sub hl,bc, sra hl, rl de, ld de,hl+*, ld de,sp+*, rst v, ld (de),hl, ld hl,(de), jp k, and jp nk. Prefer them when they clearly win, such as sub hl,bc for 16-bit compares or ld de,sp+* for stack access.

How do 8085 flags differ from Z80 flags?▼

The 8085 has separate P (parity, bit 2) and V (overflow, bit 1) bits plus an undocumented K flag, while the Z80 shares P/V in one bit. The 8085 has no N flag, and 16-bit inc/dec only affect K, not Z.

Can I use jr and djnz instructions on the 8085?▼

jr and jr cc are allowed in normal assembler mode but expand to 3-byte jp instructions; strict mode rejects them. Native djnz does not exist on 8085 since opcode 10 is sra hl, so use dec b with jp nz instead.

Why does pop af corrupt my return address on the 8085?▼

Flag register bit 3 is hardwired to zero on the 8085, so popping a word into AF can never restore a faithful 16-bit value ($FFFF becomes $FFF7). Use BC, DE, or HL for return addresses and reserve pop af for discarding stack values.

When should 8085 code use the stack instead of static variables?▼

Locals, temporaries, and intermediate results must live on the stack, accessed via ld de,sp+* and ld hl,(de). Only C static or file-scope objects and true module state belong in BSS; never invent scratch cells just to save cycles.