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,nnLoading...
Variants
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 | CN=1P/V=VHZS | 1 | 4 | |
| cp c | CN=1P/V=VHZS | 1 | 4 | |
| cp d | CN=1P/V=VHZS | 1 | 4 | |
| cp e | CN=1P/V=VHZS | 1 | 4 | |
| cp h | CN=1P/V=VHZS | 1 | 4 | |
| cp l | CN=1P/V=VHZS | 1 | 4 | |
| cp (hl) | CN=1P/V=VHZS | 1 | 7 | |
| cp a | CN=1P/V=VHZS | 1 | 4 | |
| cp ixh undocumented | CN=1P/V=VHZS | 2 | 8 | |
| cp ixl undocumented | CN=1P/V=VHZS | 2 | 8 | |
| cp (ix+dd) | CN=1P/V=VHZS | 3 | 19 | |
| cp iyh undocumented | CN=1P/V=VHZS | 2 | 8 | |
| cp iyl undocumented | CN=1P/V=VHZS | 2 | 8 | |
| cp (iy+dd) | CN=1P/V=VHZS | 3 | 19 | |
| cp nn | CN=1P/V=VHZS | 2 | 7 |