-->

Show division result in MIPS

2019-08-18 09:24发布

问题:

Hi I'm coding a small program in MIPS and I have this code

li $v0, 2
div $t0,$t2,$t1
move $a0,$t0
syscall

(it's not the full code, just the section handling division)

Where $t1 is 2, $t2 is 9.

So, 2/9 is 0.2222222222222222

But when I run it I only get 0.0

Why?, how I show the true result?

Thanks in advance.