UM012811-0904
eZ8 CPU Instruction Set Description
eZ8 CPU
User Manual
89
COM
Complement
COM dst
Operation
dst
←
~dst
Description
The contents of the destination operand are complemented (one’s complement). All 1 bits
are changed to 0 and all 0 bits are changed to 1.
Flags
Attributes
Escaped Mode Addressing
Using Escaped Mode Addressing, address modes R or IR can specify a Working Register.
If the destination address is prefixed by
EH
(1110B), a Working Register is inferred. For
example, if Working Register R12 (
CH
) is the desired destination operand, use
ECH
as the
destination operand in the opcode. To access Registers with addresses
E0H
to
EFH
, either
set the Working Group Pointer, RP[7:4], to
EH
or use indirect addressing.
Examples
•
If Register 08H contains
24H
(00100100B), the statement:
COM 08H
Object Code: 60 08
leaves the value
DBH
(11011011B) in Register 08H, sets the S flag and clears the Z and
V flags.
C
Unaffected.
Z
Set if the result is zero; reset otherwise.
S
Set if Bit 7 of the result is set; reset otherwise.
V
Reset to 0.
D
Unaffected.
H
Unaffected.
Mnemonic
Destination
Opcode (Hex)
Operand 1
Operand 2
Operand 3
COM
R1
60
R1
—
—
COM
@R1
61
R1
—
—