agentsclimarketplace

Opcode reference

Skill feilipu/8085-skills/.grok/skills/opcode-reference

Skills for Agents to code 8085 Assembly Language

Install
npx -y skills add feilipu/8085-skills --skill opcode-reference

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • 23 days oldThe repository was created 23 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
  • 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Intel 8085 opcode reference using Zilog (Z80-style) mnemonics. Covers the full 256-opcode map, byte sizes, cycle timings, flag effects (including undocumented K and V), and the ten undocumented 8085 instructions. Use when writing, reading, optimizing, or reviewing 8085 assembly; when mapping Intel↔Zilog mnemonics; when checking timings or flags; or when the user runs /opcode-reference.

SKILL.md

7.6 KB, ~2.7k tokens by cl100k_base, as published. Nobody here has run it

8085 Opcode Reference (Zilog mnemonics)

Conventions (always follow)

  1. Mnemonics are Zilog, as in Z80 assembly — not Intel 8080/8085 names.
  2. Opcode bytes and timings are 8085, not Z80 (many encodings differ or do not exist on Z80).
  3. Undocumented / extended opcodes are noted in tables (column or section).
  4. Immediate forms: * = 8-bit immediate (d8), ** = 16-bit immediate/address (d16/a16). These */** are operand placeholders only.
  5. For LDHI / LDSI equivalents (ld de,hl+* / ld de,sp+*), the 8-bit offset is unsigned.
  6. Conditional cycle counts use taken/not-taken (e.g. 12/6, 10/7, 18/9).

Prefer the full tables in references/opcodes.md. Use this skill body for rules, flags, mnemonic mapping, and undocumented ops.

Always incorporate the extended usage concepts included in the extended-usage. Use this skill body for techniques and optimisation.

Sources

TopicSource
Zilog mnemonics & descriptionsfeilipu/8085-opcodes 8085_instructions.html
Flag effects (S Z K A P V C), timingspastraiser i8085 opcodes

When sources conflict on flags, trust pastraiser (8085-specific K and V). When they conflict on mnemonic spelling, trust 8085_instructions.html (Zilog).

Registers

15 ...... 8  7 ...... 0
     A            F      → AF (PSW); Zilog: af
     B            C      → BC
     D            E      → DE
     H            L      → HL
15 ............... 0
        SP
        PC

Memory via HL is written (hl) (Intel M). Stack grows downward; push stores high byte first at sp-1, low at sp-2.

Flag register (F)

Bit76543210
SZKA0PVC
FlagMeaning
SSign
ZZero
KUndocumented; also X5 / UI (underflow/overflow indicator)
AAuxiliary carry (half-carry / AC)
0Unused; always zero
PParity
VUndocumented overflow
CCarry

Flag columns in tables are always S Z K A P V C:

  • letter → that flag is affected as defined by the instruction
  • - → unchanged
  • 0 / 1 → forced clear / set

Important: On the Z80, P and V share one bit (P/V). On the 8085 they are separate bits (P bit 2, V bit 1). Do not collapse them.

Condition codes for jumps/calls/returns:

Zilog ccMeaning
nz / zZ clear / set
nc / cC clear / set
po / peP odd / even (parity)
p / mS clear (plus) / set (minus)
nk / kK clear / set (undocumented)
v (rst v only)V set

Intel → Zilog mnemonic map (primary)

Use Zilog in all generated/edited 8085 code. Intel names appear only when translating legacy sources.

IntelZilog
NOPnop
LXI rp,d16ld bc/de/hl/sp,**
STAX B/Dld (bc),a / ld (de),a
LDAX B/Dld a,(bc) / ld a,(de)
INX/DCX rpinc/dec bc/de/hl/sp
INR/DCR rinc/dec r ; M(hl)
MVI r,d8ld r,*
MOV r1,r2ld r1,r2
RLC/RRCrlca / rrca
RAL/RARrla / rra
DAD rpadd hl,bc/de/hl/sp
LDA/STA a16ld a,(**) / ld (**),a
LHLD/SHLD a16ld hl,(**) / ld (**),hl
DAAdaa
CMAcpl
STC/CMCscf / ccf
HLThalt
ADD/ADC radd a,r / adc a,r
SUB/SBB rsub r / sbc a,r
ANA/XRA/ORA/CMP rand r / xor r / or r / cp r
ADI/ACI/SUI/SBIadd a,* / adc a,* / sub * / sbc a,*
ANI/XRI/ORI/CPIand * / xor * / or * / cp *
JMP/Jccjp ** / jp cc,**
CALL/Ccccall ** / call cc,**
RET/Rccret / ret cc
PCHLjp (hl)
SPHLld sp,hl
XCHGex de,hl
XTHLex (sp),hl
PUSH/POP B|D|H|PSWpush/pop bc|de|hl|af
IN/OUT d8in a,(*) / out (*),a
EI/DIei / di
RIM/SIMrim / sim (8085 only)
RST nrst 00hrst 38h

Undocumented / extended

OpIntelZilogBytesCyclesFlags (SZKAPVC)Effect
08DSUBsub hl,bc110SZKAPVCHL ← HL − BC
10ARHLsra hl17-----0CArithmetic right shift HL; V←0
18RDELrl de110-----VCRotate DE left through C
28LDHI d8ld de,hl+*210-------DE ← HL + unsigned *
38LDSI d8ld de,sp+*210-------DE ← SP + unsigned *
CBRSTVrst v112/6-------If V set: push PC, PC←40h
D9SHLXld (de),hl110-------(DE)←L, (DE+1)←H
DDJNK a16jp nk,**310/7-------Jump if K=0 (also jnx5/jnui)
EDLHLXld hl,(de)110-------L←(DE), H←(DE+1)
FDJK a16jp k,**310/7-------Jump if K=1 (also jx5/jui)

These are not standard Z80 opcodes at those encodings (Z80 uses CB/DD/ED/FD as prefixes). On 8085 they are single-byte (or 3-byte jump) instructions.

Flag rules agents must not get wrong

GroupFlagsNotes
inc/dec 16-bit (inc bcdec sp)--K----Only K changes
inc/dec 8-bit (incl. (hl))SZKAPV-All but C
rlca / rla-----VCV and C
rrca / rra-----0CV forced 0
add hl,rp-----VCV and C (not C alone)
8-bit ALU (addcp, immediates)SZKAPVCFull set
sub hl,bc (undoc)SZKAPVCFull set
sra hl (undoc)-----0CV←0, C from bit 0
rl de (undoc)-----VCV and C
scf------1C←1
ccf------CC toggled
pop afSZKAPVCRestores all flags including K,V

Logical ops still use the full pastraiser mask SZKAPVC (how individual bits are computed is instruction-defined; do not invent Z80 N-flag behavior — 8085 has no N flag).

Timing notes

  • Base machine cycles as in the reference tables (8085 T-states / clocks from pastraiser).
  • Conditional ret: 12 taken / 6 not taken.
  • Conditional jp: 10 / 7.
  • Conditional call: 18 / 9.
  • halt is 5 cycles (8085).

Coding rules for this project

  1. Emit Zilog mnemonics only (ld a,b not MOV A,B; jp nz,label not JNZ).
  2. Register pairs: bc, de, hl, af, sp — never Intel B, D, H, PSW in new code.
  3. Use (hl), (bc), (de), (**) for memory; never M.
  4. Prefer undocumented ops when they clearly win (e.g. sub hl,bc, ld hl,(de), ld (de),hl, ld de,hl+*) and the target assembler/CPU path supports them.
  5. Never assume Z80 instruction timings or prefix opcodes exist on 8085.
  6. When optimizing, consult references/opcodes.md for exact size/cycle/flag data.

Quick lookup

Full 16×16 opcode grid, Intel cross-ref, and macro helpers:

references/opcodes.md

What ships with it: 1 file

13.6 KB alongside SKILL.md

references/

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.