and

Operands

$reg, [$reg / imm], [$reg / imm]

Bitwise AND : Sets $t1 = $t2 & $t3. Each bit of $t1 is 1 only if the corresponding bit is 1 in both $t2 and $t3. Commonly used to mask (isolate) specific bits in a value.

Variants

  • Bitwise AND : Sets $t1 = $t2 & $t3. Each bit of $t1 is 1 only if the corresponding bit is 1 in both $t2 and $t3. Commonly used to mask (isolate) specific bits in a value. and $t1,$t2,$t3
  • AND : set $t1 to ($t2 bitwise-AND 16-bit unsigned immediate) and $t1,$t2,100
  • AND : set $t1 to ($t1 bitwise-AND 16-bit unsigned immediate) and $t1,100
# Initialize both inputs, then execute and with initialized inputs. Inspect $t2: 3.
li $t0, 7
li $t1, 3
and $t2, $t0, $t1