MIPS 双精度立即数
我正在尝试为双精度数字创建与 li 等效的内容。看起来以下内容应该有效,但事实并非如此:
.main:
li $t0, 0
li $t1, 5
mtc1 $t1, $f12
mtc1 $t0, $f13
li $v0, 3
syscall
当我查看 $f12 和 $f13 时,它的值为 5,我认为应该将其解释为 5*2^0。但事实并非如此。相反,它给了我 2.5E-323。我做错了什么?我认为 SPIM 可以让你做到这一点,所以我一直在深入研究他们的源代码,但没有成功地复制它。
I'm trying to create an equivalent of li
for double-precision numbers. It seems like the following should work, but it doesn't:
.main:
li $t0, 0
li $t1, 5
mtc1 $t1, $f12
mtc1 $t0, $f13
li $v0, 3
syscall
When I look at $f12 and $f13 it has the value 5, which I think should be interpreted as 5*2^0. But it's not. Instead, it gives me 2.5E-323. What am I doing wrong? I think SPIM lets you do this, so I've been diving through their source unsuccessfully to copy it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您已创建一个非规格化数字(使用零指数值和非零尾数)。您需要查看
double
的格式。You have created a denormalized number (using an exponenent value of zero and a non-zero mantissa). You need to look at the format of
double
s.