Changes

Z80

223 bytes added, 10:17, 1 September 2024
/* Z80 Instructions: S */
! Instruction !! Opcode !! Cycles !! S !! Z !! 5 !! H !! 3 !! P !! N !! C !! Effect !! Description
|-
| sbc a,R || 10011rrr || 4 || + || + || + || + || + || V || 1 || + || a -= R + cf||rowspan=6|Subtract with Carry
|-
| sbc a,J || 11i11101 1001110b || 8 || + || + || + || + || + || V || 1 || + || a -= J + cf
| sbc hl,Q || 11101101 01qq0010 || 15 || + || + || + || + || + || V || 1 || + || hl -= Q + cf
|-
| scf || 00110111 || 4 || - || - || A || 0 || A || - || 0 || 1 || nothing else|| Set Carry Flag
|-
| set B,R || 11001011 11bbbrrr || 8 || - || - || - || - || - || - || - || - || R := R OR [1 << B]||rowspan=4|Set Bit
|-
| set B,(hl) || 11001011 11bbb110 || 15 || - || - || - || - || - || - || - || - || (hl) := (hl) OR [1 << B]
| set B,(I+D)->R || 11i11101 11001011 dddddddd 11bbbrrr || 23 || - || - || - || - || - || - || - || - || (I+D) := R := (I+D) OR [1 << B]
|-
| sla R || 11001011 00100rrr || 8 || + || + || + || 0 || + || P || 0 || X || cf := R.7, R := R << 1||rowspan=4|Shift Left Arithmetic
|-
| sla (hl) || 11001011 00100110 || 15 || + || + || + || 0 || + || P || 0 || X || cf := (hl).7, (hl) := (hl) << 1
| sla (I+D)->R || 11i11101 11001011 dddddddd 00100rrr || 23 || + || + || + || 0 || + || P || 0 || X || cf := (I+D).7, (I+D) := R := (I+D) << 1
|-
| sra R || 11001011 00101rrr || 8 || + || + || + || 0 || + || P || 0 || X || cf := R.0, R := R >> 1, R.7 := R.6||rowspan=4|Shift Right Arithmetic
|-
| sra (hl) || 11001011 00101110 || 15 || + || + || + || 0 || + || P || 0 || X || cf := (hl).0, (hl) := (hl) >> 1, (hl).7 := (hl).6
| sra (I+D)->R || 11i11101 11001011 dddddddd 00101rrr || 23 || + || + || + || 0 || + || P || 0 || X || cf := (I+D).0, tmp := (I+D) >> 1, tmp.7 := tmp.6, (I+D) := R := tmp
|-
| sll R || 11001011 00110rrr || 8 || + || + || + || 0 || + || P || 0 || X || cf := R.7, R := [R << 1] + 1||rowspan=4|Shift Left Logical
|-
| sll (hl) || 11001011 00110110 || 15 || + || + || + || 0 || + || P || 0 || X || cf := (hl).7, (hl) := [(hl) << 1] + 1
| sll (I+D)->R || 11i11101 11001011 dddddddd 00110rrr || 23 || + || + || + || 0 || + || P || 0 || X || cf := (I+D).7, (I+D) := R := [(I+D) << 1] + 1
|-
| srl R || 11001011 00111rrr || 8 || 0 || + || + || 0 || + || P || 0 || X || cf := R.0, R := R >> 1||rowspan=4|Shift Right Logical
|-
| srl (hl) || 11001011 00111110 || 15 || 0 || + || + || 0 || + || P || 0 || X || cf := (hl).0, (hl) := (hl) >> 1
| srl (I+D)->R || 11i11101 11001011 dddddddd 00111rrr || 23 || 0 || + || + || 0 || + || P || 0 || X || cf := (I+D).0, (I+D) := R := (I+D) >> 1
|-
| sub R || 10010rrr || 4 || + || + || + || + || + || V || 1 || + || a -= R||rowspan=5|Subtract
|-
| sub J || 11i11101 1001010b || 8 || + || + || + || + || + || V || 1 || + || a -= J
13,173
edits