[destination] ← [source] . [destination]
AND <ea>,Dn
AND Dn,<ea>
Size
byte, word, longword
AND
the source operand to the destination operand and store the result in the destination location.
AND
is used to mask bits. If we wish to clear bits 3 to 6 of data register D7, we can execute AND #%10000111,D7
. Unfortunately, the AND
operation cannot be used with an address register as either a source or a destination operand. If you wish to perform a logical operation on an address register, you have to copy the address to a data register and then perform the operation there.
X | N | Z | V | C |
---|---|---|---|---|
- | * | * | 0 | 0 |
Dn | An | (An) | (An)+ | ‑(An) | (d,An) | (d,An,Xi) | ABS.W | ABS.L | (d,PC) | (d,PC,Xn) | imm |
---|---|---|---|---|---|---|---|---|---|---|---|
✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Dn | An | (An) | (An)+ | ‑(An) | (d,An) | (d,An,Xi) | ABS.W | ABS.L | (d,PC) | (d,PC,Xn) | imm |
---|---|---|---|---|---|---|---|---|---|---|---|
✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
From MOTOROLA M68000 FAMILY Programmer's reference manual. Copyright 1992 by Motorola Inc./NXP. Adapted with permission.