Show division result in MIPS

眉间皱痕 提交于 2019-12-11 23:20:10

问题


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.

来源:https://stackoverflow.com/questions/6513610/show-division-result-in-mips

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!