Changes

Z80

388 bytes added, 10:12, 1 September 2024
/* Z80 Instructions: R */
! Instruction !! Opcode !! Cycles !! S !! Z !! 5 !! H !! 3 !! P !! N !! C !! Effect !! Description
|-
| res B,R || 11001011 10bbbrrr || 8 || - || - || - || - || - || - || - || - || R := R AND ~[1 << B]||rowspan=4|Reset Bit
|-
| res B,(hl) || 11001011 10bbb110 || 15 || - || - || - || - || - || - || - || - || (hl) := (hl) AND ~[1 << B]
| res B,(I+D)->R || 11i11101 11001011 dddddddd 10bbbrrr || 23 || - || - || - || - || - || - || - || - || (I+D) := R := (I+D) AND ~[1 << B]
|-
| ret || 11001001 || 10 || - || - || - || - || - || - || - || - || pc := (sp), sp += 2|| Return
|-
| ret C || 11ccc000 || 11/5 || - || - || - || - || - || - || - || - || if C then pc := (sp), sp += 2|| Conditional Return
|-
| reti || 11101101 01**1101 || 14 || - || - || - || - || - || - || - || - || pc := (sp), sp += 2, iff1 := iff2|| Return from Interrupt
|-
| retn || 11101101 01**0101 || 14 || - || - || - || - || - || - || - || - || pc := (sp), sp += 2, iff1 := iff2|| Return from NMI
|-
| rla || 00010111 || 4 || - || - || + || 0 || + || - || 0 || X || ocf := cf, cf := a.7, a := [a << 1] + ocf|| Rotate Left Accumulator
|-
| rl R || 11001011 00010rrr || 8 || + || + || + || 0 || + || P || 0 || X || ocf := cf, cf := R.7, R := [R << 1] + ocf||rowspan=4|Rotate Left
|-
| rl (hl) || 11001011 00010110 || 15 || + || + || + || 0 || + || P || 0 || X || ocf := cf, cf := (hl).7, (hl) := [(hl) << 1] + ocf
| rl (I+D)->R || 11i11101 11001011 dddddddd 00010rrr || 23 || + || + || + || 0 || + || P || 0 || X || ocf := cf, cf := (I+D).7, (I+D) := R := [(I+D) << 1] + ocf
|-
| rlca || 00000111 || 4 || - || - || + || 0 || + || - || 0 || X || cf := a.7, a := [a << 1] + cf|| Rotate Left Carry Accumulator
|-
| rlc R || 11001011 00000rrr || 8 || + || + || + || 0 || + || P || 0 || X || cf := R.7, R := [R << 1] + cf||rowspan=4|Rotate Left Carry
|-
| rlc (hl) || 11001011 00000110 || 15 || + || + || + || 0 || + || P || 0 || X || cf := (hl).7, (hl) := [(hl) << 1] + cf
| rlc (I+D)->R || 11i11101 11001011 dddddddd 00000rrr || 23 || + || + || + || 0 || + || P || 0 || X || cf := (I+D).7, (I+D) := R := [(I+D) << 1] + cf
|-
| rld || 11101101 01101111 || 18 || + || + || + || 0 || + || P || 0 || - || tmp := [(hl) << 4] + [a AND 0x0f], (hl) := tmp, a := [a AND 0xf0] + [tmp >> 8] => flags|| Rotate Left Decimal
|-
| rra || 00011111 || 4 || - || - || + || 0 || + || - || 0 || X || ocf := cf, cf := a.0, a := [a >> 1] + [ocf << 7]|| Rotate Right Accumulator
|-
| rr R || 11001011 00011rrr || 8 || + || + || + || 0 || + || P || 0 || X || ocf := cf, cf := R.0, R := [R >> 1] + [ocf << 7]||rowspan=4|Rotate Right
|-
| rr (hl) || 11001011 00011110 || 15 || + || + || + || 0 || + || P || 0 || X || ocf := cf, cf := (hl).0, (hl) := [(hl) >> 1] + [ocf << 7]
| rr (I+D)->R || 11i11101 11001011 dddddddd 00011rrr || 23 || + || + || + || 0 || + || P || 0 || X || ocf := cf, cf := (I+D).0, (I+D) := R := [(I+D) >> 1] + [ocf << 7]
|-
| rrca || 00001111 || 4 || - || - || + || 0 || + || - || 0 || X || cf := a.0, a := [a >> 1] + [cf << 7]|| Rotate Right Carry Accumulator
|-
| rrc R || 11001011 00001rrr || 8 || + || + || + || 0 || + || P || 0 || X || cf := R.0, R := [R >> 1] + [cf << 7]||rowspan=4|Rotate Right Carry
|-
| rrc (hl) || 11001011 00001110 || 15 || + || + || + || 0 || + || P || 0 || X || cf := (hl).0, (hl) := [(hl) >> 1] + [cf << 7]
| rrc (I+D)->R || 11i11101 11001011 dddddddd 00001rrr || 23 || + || + || + || 0 || + || P || 0 || X || cf := (I+D).0, (I+D) := R := [(I+D) >> 1] + [cf << 7]
|-
| rrd || 11101101 01100111 || 18 || + || + || + || 0 || + || P || 0 || - || tmp := (hl), (hl) := [tmp >> 4] + [[a AND 0x0f] << 4], a := [a AND 0xf0] + [tmp AND 0x0f] => flags|| Rotate Right Decimal
|-
| rst S || 11sss111 || 11 || - || - || - || - || - || - || - || - || sp -= 2, (sp)|| Restart
|}
13,173
edits