8051 Instruction Set Manual

CPL

The CPL instruction logically complements the value of the specified destination operand and stores the result back in the destination operand. Bits that previously contained a 1 will be changed to a 0 and bits that previously contained a 0 will be changed to a 1.

CPL A
CACF0RS1RS0OV P
Bytes1
Cycles1
Encoding
11110100
Operation
CPL
A = NOT A
Example
CPL A
CPL bit
CACF0RS1RS0OV P
Bytes2
Cycles1
Encoding
10110010bit
Operation
CPL
(bit) = NOT (bit)
Example
CPL 55h
CPL C
CACF0RS1RS0OV P
Bytes1
Cycles1
Encoding
10110011
Operation
CPL
C = NOT C
Example
CPL C