go to previous page   go to home page   hear noise   go to next page

Answer:

div $t0,$s1,$s2

Translates into:

div   $s1, $s2

mflo  $t0

div and divu Pseudoinstruction

The SPIM extended assembler includes these instructions:

div  d,s,t # divide $s by $t. Put the
           # quotient in $d. Operands are
           # two's complement.
           # (pseudoinstruction)

and

divu d,s,t # divide $s by $t. Put the
           # quotient in $d. Operands are
           # unsigned.
           # (pseudoinstruction)

QUESTION 8:

Is the remainder of an integer division sometimes useful?