and
Logical AND
Performs a logical AND of the first and second operands and stores the result in the second operand.
Sizes .b .w .l, .w by default
Used in
- The screen, keyboard and mouse through trapsM68K assembly
XNZVC –●●00
- ● set from the result
- 0 always 0
- – not changed
Forms
Operands
<ea>- An operand using one of the instruction’s supported addressing modes, such as
d0,(a0)+or4(a1). It may name a register, memory or an immediate value. More #imm- An immediate value written after
#: a number, character or label, such as#10,#$FFor#'a'. It must fit the operation’s size: byte-128to255, word-32768to65535, or long-2147483648to4294967295; signed and unsigned spellings are accepted. More
move.l #%11110000, d0
move.l #%10101010, d1
and.b d1, d0 ; d0 = %10100000
* --- Use for masking (keeping specific bits) ---
move.l #$ABCD, d2
and.w #$00FF, d2 ; keep low byte only: d2 = $00CD