Changes
Z80
,/* Z80 Instructions: S */
{| class="wikitable"
! Instruction !! Opcode !! NOPs !! 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 a,N || 11011110 nnnnnnnn || || 7 || + || + || + || + || + || V || 1 || + || a -= N + cf
|-
| sbc a,(hl) || 10011110 || || 7 || + || + || + || + || + || V || 1 || + || a -= (hl) + cf
|-
| sbc a,(I+D) || 11i11101 10011110 dddddddd || || 19 || + || + || + || + || + || V || 1 || + || a -= (I+D) + 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) || 11i11101 11001011 dddddddd 11bbb110 || || 23 || - || - || - || - || - || - || - || - || (I+D) := (I+D) 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) || 11i11101 11001011 dddddddd 00100110 || || 23 || + || + || + || 0 || + || P || 0 || X || cf := (I+D).7, (I+D) := (I+D) << 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) || 11i11101 11001011 dddddddd 00101110 || || 23 || + || + || + || 0 || + || P || 0 || X || cf := (I+D).0, (I+D) := (I+D) >> 1, (I+D).7 := (I+D).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) || 11i11101 11001011 dddddddd 00110110 || || 23 || + || + || + || 0 || + || P || 0 || X || cf := (I+D).7, (I+D) := [(I+D) << 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) || 11i11101 11001011 dddddddd 00111110 || || 23 || 0 || + || + || 0 || + || P || 0 || X || cf := (I+D).0, (I+D) := (I+D) >> 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
|-
| sub N || 11010110 nnnnnnnn || || 7 || + || + || + || + || + || V || 1 || + || a -= N
|-
| sub (hl) || 10010110 || || 7 || + || + || + || + || + || V || 1 || + || a -= (hl)
|-
| sub (I+D) || 11i11101 10010110 dddddddd || || 19 || + || + || + || + || + || V || 1 || + || a -= (I+D)
|}