Instruction Set ArchitectureIP2022 Users Manual
118
www.ubicom.com
AND W,#lit8
AND W,Literal into W
Operation:
W = W & lit8
Bits affected:
Z
Opcode:
1110 kkkk kkkk kkkk
Description:
This instruction performs a bitwise logical AND of
the contents of W and an 8-bit literal value, and
writes the 8-bit result into W. If the result is zero,
the Z bit is set.
Cycles:
1
Example:
and w,#0x0F
This example performs a bitwise logical AND of
W with the literal value 0x0F. The result is written
back to W.
For example, suppose that W holds the value
0x50. The instruction takes the logical AND of this
value with 0x0F and writes the result 0x00 into W.
The result is zero, so the Z bit is set.