Subtracts B from A and affects flags according to the result. A is not modified.
cp
Operands
cp r | cp r,r' | cp (rr) | cp r,(rr) | cp (ii+dd) | cp r,(ii+dd) | cp nn | cp r,nnVariants
Every form of cp the assembler accepts. The cycles column counts clock
cycles, written as taken/not taken for the conditional forms.
| Instruction | Description | Flags | Bytes | Cycles |
|---|---|---|---|---|
| cp b | Subtracts B from A and affects flags according to the result. A is not modified. | CN=1P/V=VHZS | 1 | 4 |
| cp c | Subtracts C from A and affects flags according to the result. A is not modified. | CN=1P/V=VHZS | 1 | 4 |
| cp d | Subtracts D from A and affects flags according to the result. A is not modified. | CN=1P/V=VHZS | 1 | 4 |
| cp e | Subtracts E from A and affects flags according to the result. A is not modified. | CN=1P/V=VHZS | 1 | 4 |
| cp h | Subtracts H from A and affects flags according to the result. A is not modified. | CN=1P/V=VHZS | 1 | 4 |
| cp l | Subtracts L from A and affects flags according to the result. A is not modified. | CN=1P/V=VHZS | 1 | 4 |
| cp (hl) | Subtracts (HL) from A and affects flags according to the result. A is not modified. | CN=1P/V=VHZS | 1 | 7 |
| cp a | Subtracts A from A and affects flags according to the result. A is not modified. | CN=1P/V=VHZS | 1 | 4 |
| cp ixh undocumented | Subtracts IXH from A and affects flags according to the result. A is not modified. | CN=1P/V=VHZS | 2 | 8 |
| cp ixl undocumented | Subtracts IXL from A and affects flags according to the result. A is not modified. | CN=1P/V=VHZS | 2 | 8 |
| cp (ix+dd) | Subtracts the value pointed to by IX plus | CN=1P/V=VHZS | 3 | 19 |
| cp iyh undocumented | Subtracts IYH from A and affects flags according to the result. A is not modified. | CN=1P/V=VHZS | 2 | 8 |
| cp iyl undocumented | Subtracts IYL from A and affects flags according to the result. A is not modified. | CN=1P/V=VHZS | 2 | 8 |
| cp (iy+dd) | Subtracts the value pointed to by IY plus | CN=1P/V=VHZS | 3 | 19 |
| cp nn | Subtracts | CN=1P/V=VHZS | 2 | 7 |