# AND Instruction

The instruction AND performs the logical operation "AND", bit for bit.
1. The source is and effective address, the destination is a data register.
2. The source is the data register and the destination is the effective address.

ADDRESS METHODS: | 1) Dn, (An), (An)+, -(An), x(An), x(An,xr.s), x.w, x.l, x(PC), x(PC,xr.s), #x
2) (An), (An)+, -(An), x(An), x(An,xr.s), x.w, x.l

DATA LENGTH: Byte, word, longword

FLAGS: | X - U
N - S
Z - S
C - 0
V - 0

SYNTAX: | AND <ea>,Dn
AND Dn,<ea>

EXAMPLE CODE:

AND #%11110000,D0 If D0 contained 00111100, it would then contain 00110000

Use AND to selectively clear bits in the destination. Each bit in the source operand that is 0 will cause the corresponding bit in the destination to be 0. Each bit in the source that is 1 will leave the corresponding bit in the destination unchanged. For example:

SOURCE 0000 0101
DESTINATION 0011 0011
----------- ---- ----
RESULT 0000 0001