Changes

Z80

No change in size, 10 March
/* Z80 Instructions */
{| class="wikitable" style="white-space: nowrap;"
! notation !! Meaning !! Respective respective Opcode Bits
|-
| A || 16-bit address or immediate || alalalal ahahahah
| Q || 16-bit register (bc, de, hl/ix/iy, sp) || qq = 00, 01, 10, 11
|-
| R r || 8-bit general purpose register (a, b, c, d, e, h, l) || rrr (or sss) = 111, 000, 001, 010, 011, 100, 101
|-
| S || Restart restart address (0x00, 0x08,..., 0x38) || sss = 000, 001,..., 111
|}
* P = parity (only for the parity flag)
* V = overflow (only for the parity flag)
* A = OR Or with the respective bit of the accumulator
* C = set if the counter (bc) is nonzero after decrementing
! Instruction !! Opcode !! nOPs !! Cycles !! S !! Z !! 5 !! H !! 3 !! P !! n !! C !! Effect !! Description
|-
| add a,R r || 10000rrr || 1 || 4 (4) || + || + || + || + || + || V || 0 || + || a += R r ||rowspan=5|Add
|-
| add a,J || 11i11101 1000010b || 2 || 8 (4,4) || + || + || + || + || + || V || 0 || + || a += J
| add a,(ixy+d) || 11i11101 10000110 dddddddd || 5 || 19 (4,4,3,5,3) || + || + || + || + || + || V || 0 || + || a += (ixy+d)
|-
| adc a,R r || 10001rrr || 1 || 4 (4) || + || + || + || + || + || V || 0 || + || a += R r + cf ||rowspan=5|Add with Carry
|-
| adc a,J || 11i11101 1000110b || 2 || 8 (4,4) || + || + || + || + || + || V || 0 || + || a += J + cf
| adc a,(ixy+d) || 11i11101 10001110 dddddddd || 5 || 19 (4,4,3,5,3) || + || + || + || + || + || V || 0 || + || a += (ixy+d) + cf
|-
| sub R r || 10010rrr || 1 || 4 (4) || + || + || + || + || + || V || 1 || + || a -= R r ||rowspan=5|Subtract
|-
| sub J || 11i11101 1001010b || 2 || 8 (4,4) || + || + || + || + || + || V || 1 || + || a -= J
| sub (ixy+d) || 11i11101 10010110 dddddddd || 5 || 19 (4,4,3,5,3) || + || + || + || + || + || V || 1 || + || a -= (ixy+d)
|-
| sbc a,R r || 10011rrr || 1 || 4 (4) || + || + || + || + || + || V || 1 || + || a -= R r + cf ||rowspan=5|Subtract with Carry
|-
| sbc a,J || 11i11101 1001110b || 2 || 8 (4,4) || + || + || + || + || + || V || 1 || + || a -= J + cf
| sbc a,(ixy+d) || 11i11101 10011110 dddddddd || 5 || 19 (4,4,3,5,3) || + || + || + || + || + || V || 1 || + || a -= (ixy+d) + cf
|-
| and R r || 10100rrr || 1 || 4 (4) || + || + || + || 1 || + || P || 0 || 0 || a := a AnD R r ||rowspan=5|Logical AnD
|-
| and J || 11i11101 1010010b || 2 || 8 (4,4) || + || + || + || 1 || + || P || 0 || 0 || a := a AnD J
| and (ixy+d) || 11i11101 10100110 dddddddd || 5 || 19 (4,4,3,5,3) || + || + || + || 1 || + || P || 0 || 0 || a := a AnD (ixy+d)
|-
| xor R r || 10101rrr || 1 || 4 (4) || + || + || + || 0 || + || P || 0 || 0 || a := a XOR R XOr r ||rowspan=5|Logical eXclusive OROr
|-
| xor J || 11i11101 1010110b || 2 || 8 (4,4) || + || + || + || 0 || + || P || 0 || 0 || a := a XOR XOr J
|-
| xor n || 11101110 nnnnnnnn || 2 || 7 (4,3) || + || + || + || 0 || + || P || 0 || 0 || a := a XOR XOr n
|-
| xor (hl) || 10101110 || 2 || 7 (4,3) || + || + || + || 0 || + || P || 0 || 0 || a := a XOR XOr (hl)
|-
| xor (ixy+d) || 11i11101 10101110 dddddddd || 5 || 19 (4,4,3,5,3) || + || + || + || 0 || + || P || 0 || 0 || a := a XOR XOr (ixy+d)
|-
| or R r || 10110rrr || 1 || 4 (4) || + || + || + || 0 || + || P || 0 || 0 || a := a OR R Or r ||rowspan=5|Logical Inclusive OROr
|-
| or J || 11i11101 1011010b || 2 || 8 (4,4) || + || + || + || 0 || + || P || 0 || 0 || a := a OR Or J
|-
| or n || 11110110 nnnnnnnn || 2 || 7 (4,3) || + || + || + || 0 || + || P || 0 || 0 || a := a OR Or n
|-
| or (hl) || 10110110 || 2 || 7 (4,3) || + || + || + || 0 || + || P || 0 || 0 || a := a OR Or (hl)
|-
| or (ixy+d) || 11i11101 10110110 dddddddd || 5 || 19 (4,4,3,5,3) || + || + || + || 0 || + || P || 0 || 0 || a := a OR Or (ixy+d)
|-
| cp R r || 10111rrr || 1 || 4 (4) || + || + || X || + || X || V || 1 || + || tmp := a - Rr, f5 := Rr.5, f3 := Rr.3 ||rowspan=5|Compare
|-
| cp J || 11i11101 1011110b || 2 || 8 (4,4) || + || + || X || + || X || V || 1 || + || tmp := a - J, f5 := J.5, f3 := J.3
| cp (ixy+d) || 11i11101 10111110 dddddddd || 5 || 19 (4,4,3,5,3) || + || + || X || + || X || V || 1 || + || tmp := a - (ixy+d), f5 := (ixy+d).5, f3 := (ixy+d).3
|-
| dec R r || 00rrr101 || 1 || 4 (4) || + || + || + || + || + || V || 1 || - || R r -= 1 ||rowspan=4|Decrement
|-
| dec J || 11i11101 0010b101 || 2 || 8 (4,4) || + || + || + || + || + || V || 1 || - || J -= 1
| dec (ixy+d) || 11i11101 00110101 dddddddd || 6 || 23 (4,4,3,5,4,3) || + || + || + || + || + || V || 1 || - || (ixy+d) -= 1
|-
| inc R r || 00rrr100 || 1 || 4 (4) || + || + || + || + || + || V || 0 || - || R r += 1 ||rowspan=4|Increment
|-
| inc J || 11i11101 0010b100 || 2 || 8 (4,4) || + || + || + || + || + || V || 0 || - || J += 1
endif,
tmp => flags, cf := cf OR Or [a > 0x99],
hf := a.4 XOR XOr tmp.4, a := tmp
|| Decimal Adjust Accumulator
|-
| rld || 11101101 01101111 || 5 || 18 (4,4,3,4,3) || + || + || + || 0 || + || P || 0 || - || tmp := [(hl) << 4] + [a AnD 0x0f], (hl) := tmp,
a := [a AnD 0xf0] + [tmp >> 8] => flags
|| Rotate rotate Left Decimal
|-
| rrd || 11101101 01100111 || 5 || 18 (4,4,3,4,3) || + || + || + || 0 || + || P || 0 || - || tmp := (hl), (hl) := [tmp >> 4] + [[a AnD 0x0f] << 4],
a := [a AnD 0xf0] + [tmp AnD 0x0f] => flags
|| Rotate Right rotate right Decimal
|}
=== ROT rOT group ===
{| class="wikitable" style="white-space: nowrap;"
! Instruction !! Opcode !! nOPs !! Cycles !! S !! Z !! 5 !! H !! 3 !! P !! n !! C !! Effect !! Description
|-
| rla || 00010111 || 1 || 4 (4) || - || - || + || 0 || + || - || 0 || X || ocf := cf, cf := a.7, a := [a << 1] + ocf ||rowspan=5|Rotate rotate Left
|-
| rl R r || 11001011 00010rrr || 2 || 8 (4,4) || + || + || + || 0 || + || P || 0 || X || ocf := cf, cf := Rr.7, R r := [R r << 1] + ocf
|-
| rl (hl) || 11001011 00010110 || 4 || 15 (4,4,4,3) || + || + || + || 0 || + || P || 0 || X || ocf := cf, cf := (hl).7, (hl) := [(hl) << 1] + ocf
| rl (ixy+d) || 11i11101 11001011 dddddddd 00010110 || 7 || 23 (4,4,3,5,4,3) || + || + || + || 0 || + || P || 0 || X || ocf := cf, cf := (ixy+d).7, (ixy+d) := [(ixy+d) << 1] + ocf
|-
| rl (ixy+d)->R r || 11i11101 11001011 dddddddd 00010rrr || 7 || 23 (4,4,3,5,4,3) || + || + || + || 0 || + || P || 0 || X || ocf := cf, cf := (ixy+d).7, (ixy+d) := R r := [(ixy+d) << 1] + ocf
|-
| rlca || 00000111 || 1 || 4 (4) || - || - || + || 0 || + || - || 0 || X || cf := a.7, a := [a << 1] + cf ||rowspan=5|Rotate rotate Left Carry
|-
| rlc R r || 11001011 00000rrr || 2 || 8 (4,4) || + || + || + || 0 || + || P || 0 || X || cf := Rr.7, R r := [R r << 1] + cf
|-
| rlc (hl) || 11001011 00000110 || 4 || 15 (4,4,4,3) || + || + || + || 0 || + || P || 0 || X || cf := (hl).7, (hl) := [(hl) << 1] + cf
| rlc (ixy+d) || 11i11101 11001011 dddddddd 00000110 || 7 || 23 (4,4,3,5,4,3) || + || + || + || 0 || + || P || 0 || X || cf := (ixy+d).7, (ixy+d) := [(ixy+d) << 1] + cf
|-
| rlc (ixy+d)->R r || 11i11101 11001011 dddddddd 00000rrr || 7 || 23 (4,4,3,5,4,3) || + || + || + || 0 || + || P || 0 || X || cf := (ixy+d).7, (ixy+d) := R r := [(ixy+d) << 1] + cf
|-
| rra || 00011111 || 1 || 4 (4) || - || - || + || 0 || + || - || 0 || X || ocf := cf, cf := a.0, a := [a >> 1] + [ocf << 7] ||rowspan=5|Rotate Rightrotate right
|-
| rr R r || 11001011 00011rrr || 2 || 8 (4,4) || + || + || + || 0 || + || P || 0 || X || ocf := cf, cf := Rr.0, R r := [R r >> 1] + [ocf << 7]
|-
| rr (hl) || 11001011 00011110 || 4 || 15 (4,4,4,3) || + || + || + || 0 || + || P || 0 || X || ocf := cf, cf := (hl).0, (hl) := [(hl) >> 1] + [ocf << 7]
| rr (ixy+d) || 11i11101 11001011 dddddddd 00011110 || 7 || 23 (4,4,3,5,4,3) || + || + || + || 0 || + || P || 0 || X || ocf := cf, cf := (ixy+d).0, (ixy+d) := [(ixy+d) >> 1] + [ocf << 7]
|-
| rr (ixy+d)->R r || 11i11101 11001011 dddddddd 00011rrr || 7 || 23 (4,4,3,5,4,3) || + || + || + || 0 || + || P || 0 || X || ocf := cf, cf := (ixy+d).0, (ixy+d) := R r := [(ixy+d) >> 1] + [ocf << 7]
|-
| rrca || 00001111 || 1 || 4 (4) || - || - || + || 0 || + || - || 0 || X || cf := a.0, a := [a >> 1] + [cf << 7] ||rowspan=5|Rotate Right rotate right Carry
|-
| rrc R r || 11001011 00001rrr || 2 || 8 (4,4) || + || + || + || 0 || + || P || 0 || X || cf := Rr.0, R r := [R r >> 1] + [cf << 7]
|-
| rrc (hl) || 11001011 00001110 || 4 || 15 (4,4,4,3) || + || + || + || 0 || + || P || 0 || X || cf := (hl).0, (hl) := [(hl) >> 1] + [cf << 7]
| rrc (ixy+d) || 11i11101 11001011 dddddddd 00001110 || 7 || 23 (4,4,3,5,4,3) || + || + || + || 0 || + || P || 0 || X || cf := (ixy+d).0, (ixy+d) := [(ixy+d) >> 1] + [cf << 7]
|-
| rrc (ixy+d)->R r || 11i11101 11001011 dddddddd 00001rrr || 7 || 23 (4,4,3,5,4,3) || + || + || + || 0 || + || P || 0 || X || cf := (ixy+d).0, (ixy+d) := R r := [(ixy+d) >> 1] + [cf << 7]
|-
| sla R r || 11001011 00100rrr || 2 || 8 (4,4) || + || + || + || 0 || + || P || 0 || X || cf := Rr.7, R r := R r << 1 ||rowspan=4|Shift Left Arithmetic
|-
| sla (hl) || 11001011 00100110 || 4 || 15 (4,4,4,3) || + || + || + || 0 || + || P || 0 || X || cf := (hl).7, (hl) := (hl) << 1
| sla (ixy+d) || 11i11101 11001011 dddddddd 00100110 || 7 || 23 (4,4,3,5,4,3) || + || + || + || 0 || + || P || 0 || X || cf := (ixy+d).7, (ixy+d) := (ixy+d) << 1
|-
| sla (ixy+d)->R r || 11i11101 11001011 dddddddd 00100rrr || 7 || 23 (4,4,3,5,4,3) || + || + || + || 0 || + || P || 0 || X || cf := (ixy+d).7, (ixy+d) := R r := (ixy+d) << 1
|-
| sra R r || 11001011 00101rrr || 2 || 8 (4,4) || + || + || + || 0 || + || P || 0 || X || cf := Rr.0, R r := R r >> 1, Rr.7 := Rr.6 ||rowspan=4|Shift Right right Arithmetic
|-
| sra (hl) || 11001011 00101110 || 4 || 15 (4,4,4,3) || + || + || + || 0 || + || P || 0 || X || cf := (hl).0, (hl) := (hl) >> 1, (hl).7 := (hl).6
| sra (ixy+d) || 11i11101 11001011 dddddddd 00101110 || 7 || 23 (4,4,3,5,4,3) || + || + || + || 0 || + || P || 0 || X || cf := (ixy+d).0, (ixy+d) := (ixy+d) >> 1, (ixy+d).7 := (ixy+d).6
|-
| sra (ixy+d)->R r || 11i11101 11001011 dddddddd 00101rrr || 7 || 23 (4,4,3,5,4,3) || + || + || + || 0 || + || P || 0 || X || cf := (ixy+d).0, tmp := (ixy+d) >> 1, tmp.7 := tmp.6, (ixy+d) := R r := tmp
|-
| sll R r || 11001011 00110rrr || 2 || 8 (4,4) || + || + || + || 0 || + || P || 0 || X || cf := Rr.7, R r := [R r << 1] + 1 ||rowspan=4|Shift Left Logical
|-
| sll (hl) || 11001011 00110110 || 4 || 15 (4,4,4,3) || + || + || + || 0 || + || P || 0 || X || cf := (hl).7, (hl) := [(hl) << 1] + 1
| sll (ixy+d) || 11i11101 11001011 dddddddd 00110110 || 7 || 23 (4,4,3,5,4,3) || + || + || + || 0 || + || P || 0 || X || cf := (ixy+d).7, (ixy+d) := [(ixy+d) << 1] + 1
|-
| sll (ixy+d)->R r || 11i11101 11001011 dddddddd 00110rrr || 7 || 23 (4,4,3,5,4,3) || + || + || + || 0 || + || P || 0 || X || cf := (ixy+d).7, (ixy+d) := R r := [(ixy+d) << 1] + 1
|-
| srl R r || 11001011 00111rrr || 2 || 8 (4,4) || 0 || + || + || 0 || + || P || 0 || X || cf := Rr.0, R r := R r >> 1 ||rowspan=4|Shift Right right Logical
|-
| srl (hl) || 11001011 00111110 || 4 || 15 (4,4,3) || 0 || + || + || 0 || + || P || 0 || X || cf := (hl).0, (hl) := (hl) >> 1
| srl (ixy+d) || 11i11101 11001011 dddddddd 00111110 || 7 || 23 (4,4,3,5,4,3) || 0 || + || + || 0 || + || P || 0 || X || cf := (ixy+d).0, (ixy+d) := (ixy+d) >> 1
|-
| srl (ixy+d)->R r || 11i11101 11001011 dddddddd 00111rrr || 7 || 23 (4,4,3,5,4,3) || 0 || + || + || 0 || + || P || 0 || X || cf := (ixy+d).0, (ixy+d) := R r := (ixy+d) >> 1
|}
! Instruction !! Opcode !! nOPs !! Cycles !! S !! Z !! 5 !! H !! 3 !! P !! n !! C !! Effect !! Description
|-
| bit B,R r || 11001011 01bbbrrr || 2 || 8 (4,4) || + || + || + || 1 || + || P || 0 || - || tmp := R r AnD [1 << B] ||rowspan=3|Test Bit
|-
| bit B,(hl) || 11001011 01bbb110 || 3 || 12 (4,4,4) || + || + || X || 1 || X || P || 0 || - || tmp := (hl) AnD [1 << B],
f5 := [ixy+d].13, f3 := [ixy+d].11
|-
| res B,R r || 11001011 10bbbrrr || 2 || 8 (4,4) || - || - || - || - || - || - || - || - || R r := R r AnD ~[1 << B] ||rowspan=4|Reset reset Bit
|-
| res B,(hl) || 11001011 10bbb110 || 4 || 15 (4,4,4,3) || - || - || - || - || - || - || - || - || (hl) := (hl) AnD ~[1 << B]
| res B,(ixy+d) || 11i11101 11001011 dddddddd 10bbb110 || 7 || 23 (4,4,3,5,4,3) || - || - || - || - || - || - || - || - || (ixy+d) := (ixy+d) AnD ~[1 << B]
|-
| res B,(ixy+d)->R r || 11i11101 11001011 dddddddd 10bbbrrr || 7 || 23 (4,4,3,5,4,3) || - || - || - || - || - || - || - || - || (ixy+d) := R r := (ixy+d) AnD ~[1 << B]
|-
| set B,R r || 11001011 11bbbrrr || 2 || 8 (4,4) || - || - || - || - || - || - || - || - || R r := R OR r Or [1 << B] ||rowspan=4|Set Bit
|-
| set B,(hl) || 11001011 11bbb110 || 4 || 15 (4,4,4,3) || - || - || - || - || - || - || - || - || (hl) := (hl) OR Or [1 << B]
|-
| set B,(ixy+d) || 11i11101 11001011 dddddddd 11bbb110 || 7 || 23 (4,4,3,5,4,3) || - || - || - || - || - || - || - || - || (ixy+d) := (ixy+d) OR Or [1 << B]
|-
| set B,(ixy+d)->R r || 11i11101 11001011 dddddddd 11bbbrrr || 7 || 23 (4,4,3,5,4,3) || - || - || - || - || - || - || - || - || (ixy+d) := R r := (ixy+d) OR Or [1 << B]
|-
| cpl || 00101111 || 1 || 4 (4) || - || - || + || 1 || + || - || 1 || - || a := ~a || Complement
|| Compare and Increment
|-
| cpdr || 11101101 10111001 || 6/4 || 21/16 (4,4,3,5,5)/(4,4,3,5) || + || + || X || + || X || C || 1 || - || cpd, if bc <> 0 and nz then pc -= 2 || Compare and Decrement, Repeatrepeat
|-
| cpir || 11101101 10110001 || 6/4 || 21/16 (4,4,3,5,5)/(4,4,3,5) || + || + || X || + || X || C || 1 || - || cpi, if bc <> 0 and nz then pc -= 2 || Compare and Increment, Repeatrepeat
|-
| ldd || 11101101 10101000 || 5 || 16 (4,4,3,5) || - || - || X || 0 || X || C || 0 || - || tmp := (hl), (de) := tmp, de -= 1, hl -= 1,
|| Load and Increment
|-
| lddr || 11101101 10111000 || 6/5 || 21/16 (4,4,3,5,5)/(4,4,3,5) || - || - || X || 0 || X || C || 0 || - || ldd, if bc <> 0 then pc -= 2 || Load and Decrement, Repeatrepeat
|-
| ldir || 11101101 10110000 || 6/5 || 21/16 (4,4,3,5,5)/(4,4,3,5) || - || - || X || 0 || X || C || 0 || - || ldi, if bc <> 0 then pc -= 2 || Load and Increment, Repeatrepeat
|-
| ind || 11101101 10101010 || 5 || 16 (4,5,4,3) || + || + || + || X || + || X || X || X || tmp := ((c)), (hl) := tmp, hl -= 1,
tmp2 = tmp + [[c - 1] AnD 0xff],
pf := parity of [[tmp2 AnD 0x07] XOR XOr b],
hf := cf := tmp2 > 255
tmp2 := tmp + [[c + 1] AnD 0xff],
pf := parity of [[tmp2 AnD 0x07] XOR XOr b],
hf := cf := tmp2 > 255
|| I/O Input and Increment
|-
| indr || 11101101 10111010 || 6/5 || 21/16 (4,5,4,3,5)/(4,5,4,3) || + || + || + || X || + || X || X || X || ind, if b <> 0 then pc -= 2 || I/O Input and Decrement, Repeatrepeat
|-
| inir || 11101101 10110010 || 6/5 || 21/16 (4,5,4,3,5)/(4,5,4,3) || + || + || + || X || + || X || X || X || ini, if b <> 0 then pc -= 2 || I/O Input and Increment, Repeatrepeat
|-
| outd || 11101101 10101011 || 5 || 16 (4,5,3,4) || + || + || + || X || + || X || X || X || tmp := (hl), ((c)) := tmp, hl -= 1,
b -= 1 => flags, nf := tmp.7, tmp2 = tmp + l,
pf := parity of [[tmp2 AnD 0x07] XOR XOr b],
hf := cf := tmp2 > 255
b -= 1 => flags, nf := tmp.7, tmp2 = tmp + l,
pf := parity of [[tmp2 AnD 0x07] XOR XOr b],
hf := cf := tmp2 > 255
|| I/O Output and Increment
|-
| otdr || 11101101 10111011 || 6/5 || 21/16 (4,5,3,4,5)/(4,5,3,4) || + || + || + || X || + || X || X || X || outd, if b <> 0 then pc -= 2 || I/O Output and Decrement, Repeatrepeat
|-
| otir || 11101101 10110011 || 6/5 || 21/16 (4,5,3,4,5)/(4,5,3,4) || + || + || + || X || + || X || X || X || outi, if b <> 0 then pc -= 2 || I/O Output and Increment, Repeatrepeat
|}
| in a,(n) || 11011011 nnnnnnnn || 3 || 11 (4,3,4) || - || - || - || - || - || - || - || - || a := ((n)) ||rowspan=3|I/O Input
|-
| in Rr,(c) || 11101101 01rrr000 || 4 || 12 (4,4,4) || + || + || + || 0 || + || P || 0 || - || R r := ((c))
|-
| in f,(c) || 11101101 01110000 || 4 || 12 (4,4,4) || + || + || + || 0 || + || P || 0 || - || tmp := ((c))
| out (n),a || 11010011 nnnnnnnn || 3 || 11 (4,3,4) || - || - || - || - || - || - || - || - || ((n)) := a ||rowspan=3| I/O Output
|-
| out (c),R r || 11101101 01rrr001 || 4 || 12 (4,4,4) || - || - || - || - || - || - || - || - || ((c)) := Rr
|-
| out (c),0 || 11101101 01110001 || 4 || 12 (4,4,4) || - || - || - || - || - || - || - || - || ((c)) := 0 (255 on CMOS CPU)
| jp C,A || 11ccc010 alalalal ahahahah || 3 || 10 (4,3,3) || - || - || - || - || - || - || - || - || if C then pc := A || Conditional Jump
|-
| jr E || 00011000 dddddddd || 3 || 12 (4,3,5) || - || - || - || - || - || - || - || - || pc := E || Relative relative Jump
|-
| jr nz,E || 00100000 dddddddd || 3/2 || 12/7 (4,3,5)/(4,3) || - || - || - || - || - || - || - || - || if nz then pc := E ||rowspan=4|Conditional Relative relative Jump
|-
| jr z,E || 00101000 dddddddd || 3/2 || 12/7 (4,3,5)/(4,3) || - || - || - || - || - || - || - || - || if zf then pc := E
| djnz E || 00010000 dddddddd || 4/3 || 13/8 (5,3,5)/(5,3) || - || - || - || - || - || - || - || - || b -= 1, if b <> 0 then pc := E || Decrement, Jump non-Zero
|-
| ret || 11001001 || 3 || 10 (4,3,3) || - || - || - || - || - || - || - || - || pc := (sp), sp += 2 || Returnreturn
|-
| ret C || 11ccc000 || 4/2 || 11/5 (5,3,3)/(5)|| - || - || - || - || - || - || - || - || if C then pc := (sp), sp += 2 || Conditional Returnreturn
|-
| reti || 11101101 01001101 || 4 || 14 (4,4,3,3) || - || - || - || - || - || - || - || - || pc := (sp), sp += 2, iff1 := iff2 || Return return from Interrupt
|-
| retn || 11101101 01***101 || 4 || 14 (4,4,3,3) || - || - || - || - || - || - || - || - || pc := (sp), sp += 2, iff1 := iff2 || Return return from nMI
|-
| rst S || 11sss111 || 4 || 11 (5,3,3) || - || - || - || - || - || - || - || - || sp -= 2, (sp) := pc, pc := S || Restartrestart
|}
! Instruction !! Opcode !! nOPs !! Cycles !! S !! Z !! 5 !! H !! 3 !! P !! n !! C !! Effect !! Description
|-
| ld R1r1,R2 r2 || 01rrrsss || 1 || 4 (4) || - || - || - || - || - || - || - || - || R1 r1 := R2 r2 ||rowspan=20|8-bit Load
|-
| ld Rr,J || 11i11101 01rrr10b || 2 || 8 (4,4) || - || - || - || - || - || - || - || - || R r := J
|-
| ld J,R r || 11i11101 0110brrr || 2 || 8 (4,4) || - || - || - || - || - || - || - || - || J := Rr
|-
| ld ixh,ixl || 11011101 01100101 || 2 || 8 (4,4) || - || - || - || - || - || - || - || - || ixh := ixl
| ld iyl,iyh || 11111101 01101100 || 2 || 8 (4,4) || - || - || - || - || - || - || - || - || iyl := iyh
|-
| ld Rr,n || 00rrr110 nnnnnnnn || 2 || 7 (4,3) || - || - || - || - || - || - || - || - || R r := n
|-
| ld Rr,(hl) || 01rrr110 || 2 || 7 (4,3) || - || - || - || - || - || - || - || - || R r := (hl)
|-
| ld Rr,(ixy+d) || 11i11101 01rrr110 dddddddd || 5 || 19 (4,4,3,5,3) || - || - || - || - || - || - || - || - || R r := (ixy+d)
|-
| ld (hl),R r || 01110rrr || 2 || 7 (4,3) || - || - || - || - || - || - || - || - || (hl) := Rr
|-
| ld (hl),n || 00110110 nnnnnnnn || 3 || 10 (4,3,3) || - || - || - || - || - || - || - || - || (hl) := n
|-
| ld (ixy+d),R r || 11i11101 01110rrr dddddddd || 5 || 19 (4,4,3,5,3) || - || - || - || - || - || - || - || - || (ixy+d) := Rr
|-
| ld (ixy+d),n || 11i11101 00110110 dddddddd nnnnnnnn || 6 || 19 (4,4,3,5,3) || - || - || - || - || - || - || - || - || (ixy+d) := n
13,173
edits