Changes

Z80

60 bytes added, 09:00, 1 September 2024
/* Opcodes */
== Opcodes ==
Check the end of the document for explanations of abbreviations used below.
=== Alphabetical list Z80 Instructions: A ===
{| class="wikitable" border="1"
|+ Z80 Instructions: A
|-
! Instruction !! Opcode !! Cycles !! S !! Z !! X !! H !! Y !! P !! N !! C !! Effect !! Description
| and (I+D) || 11i11101 10100110 dddddddd || 19 || + || + || + || 1 || + || P || 0 || 0 || a := a AND (I+D)
|}
 
=== Z80 Instructions: B ===
{| class="wikitable" border="1"
|+ Z80 Instructions: B
|-
! Instruction !! Opcode !! Cycles !! S !! Z !! X !! H !! Y !! P !! N !! C !! Effect !! Description
| bit B,(I+D) || 11i11101 11001011 dddddddd 01bbb*** || 20 || + || + || X || 1 || X || P || 0 || - || tmp := (I+D) AND [1 << B], xf := [I+D].13, yf := [I+D].11
|}
 
=== Z80 Instructions: C ===
{| class="wikitable" border="1"
|+ Z80 Instructions: C
|-
! Instruction !! Opcode !! Cycles !! S !! Z !! X !! H !! Y !! P !! N !! C !! Effect !! Description
| cpl || 00101111 || 4 || - || - || + || 1 || + || - || 1 || - || a := ~a
|}
 
=== Z80 Instructions: D ===
{| class="wikitable" border="1"
|+ Z80 Instructions: D
|-
! Instruction !! Opcode !! Cycles !! S !! Z !! X !! H !! Y !! P !! N !! C !! Effect !! Description
| djnz E || 00010000 dddddddd || 13/8 || - || - || - || - || - || - || - || - || b -= 1, if b <> 0 then pc := E
|}
 
=== Z80 Instructions: E ===
{| class="wikitable" border="1"
|+ Z80 Instructions: E
|-
! Instruction !! Opcode !! Cycles !! S !! Z !! X !! H !! Y !! P !! N !! C !! Effect !! Description
| exx || 11011001 || 4 || - || - || - || - || - || - || - || - || bc, de, hl <=> bc', de', hl'
|}
 
=== Z80 Instructions: H ===
{| class="wikitable" border="1"
|+ Z80 Instructions: H
|-
! Instruction !! Opcode !! Cycles !! S !! Z !! X !! H !! Y !! P !! N !! C !! Effect !! Description
| halt || 01110110 || 4 || - || - || - || - || - || - || - || - || wait for interrupt
|}
 
=== Z80 Instructions: I ===
{| class="wikitable" border="1"
|+ Z80 Instructions: I
|-
! Instruction !! Opcode !! Cycles !! S !! Z !! X !! H !! Y !! P !! N !! C !! Effect !! Description
| inir || 11101101 10110010 || 21/16 || + || + || + || X || + || X || X || X || ini, if b <> 0 then pc -= 2
|}
 
=== Z80 Instructions: J ===
{| class="wikitable" border="1"
|+ Z80 Instructions: J
|-
! Instruction !! Opcode !! Cycles !! S !! Z !! X !! H !! Y !! P !! N !! C !! Effect !! Description
| jr c,E || 00111000 dddddddd || 12/7 || - || - || - || - || - || - || - || - || if cf then pc := E
|}
 
=== Z80 Instructions: L ===
{| class="wikitable" border="1"
|+ Z80 Instructions: L
|-
! Instruction !! Opcode !! Cycles !! S !! Z !! X !! H !! Y !! P !! N !! C !! Effect !! Description
| ldir || 11101101 10110000 || 21/16 || - || - || X || 0 || X || C || 0 || - || ldi, if bc <> 0 then pc -= 2
|}
 
=== Z80 Instructions: N ===
{| class="wikitable" border="1"
|+ Z80 Instructions: N
|-
! Instruction !! Opcode !! Cycles !! S !! Z !! X !! H !! Y !! P !! N !! C !! Effect !! Description
| nop || 00000000 || 4 || - || - || - || - || - || - || - || - || nothing
|}
 
=== Z80 Instructions: O ===
{| class="wikitable" border="1"
|+ Z80 Instructions: O
|-
! Instruction !! Opcode !! Cycles !! S !! Z !! X !! H !! Y !! P !! N !! C !! Effect !! Description
| otir || 11101101 10110011 || 21/16 || + || + || + || X || + || X || X || X || outi, if b <> 0 then pc -= 2
|}
 
=== Z80 Instructions: P ===
{| class="wikitable" border="1"
|+ Z80 Instructions: P
|-
! Instruction !! Opcode !! Cycles !! S !! Z !! X !! H !! Y !! P !! N !! C !! Effect !! Description
| push I || 11i11101 11100101 || 15 || - || - || - || - || - || - || - || - || sp -= 2, (sp) := I
|}
 
=== Z80 Instructions: R ===
{| class="wikitable" border="1"
|+ Z80 Instructions: R
|-
! Instruction !! Opcode !! Cycles !! S !! Z !! X !! H !! Y !! P !! N !! C !! Effect !! Description
| rst S || 11sss111 || 11 || - || - || - || - || - || - || - || - || sp -= 2, (sp)
|}
 
=== Z80 Instructions: S ===
{| class="wikitable"
|+ Z80 Instructions: S
! Instruction !! Opcode !! Cycles !! S !! Z !! X !! H !! Y !! P !! N !! C !! Effect !! Description
|-
| sub (I+D) || 11i11101 10010110 dddddddd || 19 || + || + || + || + || + || V || 1 || + || a -= (I+D)
|}
 
=== Z80 Instructions: X ===
{| class="wikitable"
|+ Z80 Instructions: X
! Instruction !! Opcode !! Cycles !! S !! Z !! X !! H !! Y !! P !! N !! C !! Effect !! Description
|-
|}
=== CPC Timings ===
{| class="wikitable sortable"
13,173
edits