and

Logical AND

AND r/m, r

Performs bitwise AND.

Details

The Logical AND instruction performs bitwise AND.

Pseudocode Operation

DEST <- DEST AND SRC
// Flags affected: SF, ZF, PF (OF=CF=0)

Example

AND EAX, 0xFF ; Keep lowest 8 bits AND ECX, EDX ; Bitwise AND of ECX and EDX

Encoding

Binary Layout
21
+0
 
Format Legacy
Opcode 21
Extension Base

Operands

  • dest
    Register/Memory
  • src
    Register