mips div code example
Example 1: quotient mips
div $a0, $a1
mfhi $t1 # remainder
mflo $t2 # quotient
Example 2: mips div
div $a0, $a1
mfhi $a2 # remainder
mflo $v0 # quotient
div $a0, $a1
mfhi $t1 # remainder
mflo $t2 # quotient
div $a0, $a1
mfhi $a2 # remainder
mflo $v0 # quotient