movz

Operands

$reg, $reg, $reg

Move if zero : Copies $t2 into $t1 only if $t3 == 0. Allows branchless conditional assignment — avoids a branch instruction when you only need to update a register conditionally.

Variants

  • Move if zero : Copies $t2 into $t1 only if $t3 == 0. Allows branchless conditional assignment — avoids a branch instruction when you only need to update a register conditionally. movz $t1,$t2,$t3
# Set condition to make movz copy its source. Inspect $t2: 7.
li $t1, 7
li $t0, 0
movz $t2, $t1, $t0