Hi I'm coding a small program in MIPS that divide 2 between 9 and show the result.This is the code
li $t1, 2
li $t2, 9
li $v0, 2
div $t0,$t2,$t1
move $a0,$t0
syscall
(this is not the full code, just the section handling division)
So, 2 / 9 is 0.2222222222222222
But when I run it I only get 0.0
How I show the true result (0.2222222222222222)?
I've been said that I'm using integer instead of floating point, that I must use the floating point instructions to get results in decimal. That I should look up the div.x instruction, but div.x is not a recognized operator.
So, I'm pretty much in blank. I don't understand what to do.
Could someone post the code to show the floating point result?
Thanks in advance.