UM012811-0904
eZ8 CPU Instruction Set Description
eZ8 CPU
User Manual
70
BIT
Bit Set/Reset
BIT p, bit, dst
Operation
dst[bit]
←
p
Description
The selected bit in the destination operand is the binary value p (0 or 1). All other bits are
unaffected.
Flags
Attributes
Example
•
If Working Register R7 contains the value
38H
(00111000B), the statement:
BIT 0, 4, R7
Object Code: E2 47
leaves the value
28H
(00101000B)
in Working Register R7 and clears the V flag.
•
If Working Register R7 contains the value
38H
(00111000B), the statement:
BIT 1, 2, R7
Object Code: E2 A7
leaves the value
3AH
(00111010B)
in Working Register R7 and clears the V flag.
C
Unaffected.
Z
Set if the result is zero; reset otherwise.
S
Set if the result is negative; reset otherwise.
V
Reset to 0.
D
Unaffected.
H
Unaffected.
Mnemonic
Polarity, Bit,
Destination Opcode
(Hex)
Operand 1
Operand 2
Operand 3
BIT
p, bit, r1
E2
{p, bit, r1}
—
—