CPL
General Purpose Arithmetic and CPU Control Group | Exchange, Block Transfer and Search Group
Expansion:
ComPLement accumulator
Usage:
dec {r}
The CPL inverts the bit values stored in the Accumulator. This is equivalent to using XOR $FF.
| Instruction | Description | Opcode |
|---|---|---|
| CPL | ComPLement accumulator | 2F |
Example
; Example
ld a, %10110010 ; load a immediate binary byte value
cpl ; invert the byte to %01001101
cpl ; and back again