8XC251SA, SB, SP, SQ USER’S MANUAL
A-50
Hex Code in: Binary Mode = [Encoding]
Source Mode = [Encoding]
Operation: CPL
(A) ← Ø(A)
CPL bit
Function: Complement bit
Description: Complements (Ø) the specified bit variable. A clear bit is set, and a set bit is cleared. CPL
can operate on the CY or any directly addressable bit.
Note: When this instruction is used to modify an output pin, the value used as the original
data is read from the output data latch, not the input pin.
Flags: Only for instructions with CY as the operand.
Example: Port 1 contains 5BH (01011101B). After executing the instruction sequence
CPL P1.1
CPL P1.2
port 1 contains 5BH (01011011B).
Variations
CPL bit51
Binary Mode Source Mode
Bytes: 22
States: 2† 2†
†If this instruction addresses a port (P
x
,
x
= 0–3), add 2 states.
Hex Code in: Binary Mode = [Encoding]
Source Mode = [Encoding]
Operation: CPL
(bit51) ← Ø(bit51)
CPL CY
Binary Mode Source Mode
Bytes: 11
States: 11
Hex Code in: Binary Mode = [Encoding]
Source Mode = [Encoding]
CY AC OV N Z
✓ ————
[Encoding] 1 0 1 1 0 0 1 0 bit addr
[Encoding] 1 0 1 1 0 0 1 1