andi

Logical AND immediate

Performs a logical AND of an immediate value and the second operand, storing the result in the second operand.

XNZVC –●●00
  • ● set from the result
  • 0 always 0
  • – not changed

Forms

  • andi , Size .b

Privileged

A 68000 runs these only in supervisor mode; s68k runs every program in supervisor mode, as EASy68K does, so they run here too.

  • andi , Size .w

Operands

#imm
An immediate value written after #: a number, character or label, such as #10, #$FF or #'a'. It must fit the operation’s size: byte -128 to 255, word -32768 to 65535, or long -2147483648 to 4294967295; signed and unsigned spellings are accepted. More
<ea>
An operand using one of the instruction’s supported addressing modes, such as d0, (a0)+ or 4(a1). It may name a register, memory or an immediate value. More
ccr
The condition-code register: the low byte of sr, containing the X, N, Z, V and C flags. More
sr
The 16-bit status register. Its upper byte contains system flags; its lower byte contains the condition codes. More
move.l #$ABCD, d0
andi.w #$FF00, d0 ; keep high byte only: d0 = $AB00