divu

Operands

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

Divide unsigned : Divides $t1 by $t2 treating both as unsigned 32-bit integers. Sets LO to the quotient and HI to the remainder. Division by zero produces undefined results with no exception. Use 'mflo' for the quotient; 'mfhi' for the remainder.

Variants

  • Divide unsigned : Divides $t1 by $t2 treating both as unsigned 32-bit integers. Sets LO to the quotient and HI to the remainder. Division by zero produces undefined results with no exception. Use 'mflo' for the quotient; 'mfhi' for the remainder. divu $t1,$t2
  • DIVision Unsigned : Set $t1 to ($t2 divided by $t3, unsigned integer division) divu $t1,$t2,$t3
  • DIVision Unsigned : Set $t1 to ($t2 divided by 16-bit immediate, unsigned integer division) divu $t1,$t2,-100
  • DIVision Unsigned : Set $t1 to ($t2 divided by 32-bit immediate, unsigned integer division) divu $t1,$t2,100000
# Divide 23 by 5. Inspect LO: quotient 4; inspect HI: remainder 3.
li $t0, 23
li $t1, 5
divu $t0, $t1
mflo $t2
mfhi $t3