如何在装配中进行浮点乘法? [英] how can do float multiplication in assembly?

查看:116
本文介绍了如何在装配中进行浮点乘法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想写这段代码:



I want to write this code:

y= 0.4*x+1 





但是我有一些错误MIPS组装





我在寄存器$ t1中有一个整数值,我想将它乘以0.4但它在第二行有错误:



but I have some errors in MIPS assembly


I have an integer value in register $t1 and I want to multiply it with 0.4 but it has error in the second line:

li.s $f0, 0.4
mul.d $f1, $f0, $t1
mfhi $a2
mflo $v0

# print the result
li $v0, 2 # load appropriate system call code into reg $v0
la $a0, 0($v0) # load address of string to be printed on $a0
syscal



[/ Edit]


[/Edit]

推荐答案

t1我希望将它倍增0.4但是哈哈第二行中的错误:

t1 and I want to multiply it with 0.4 but it has error in the second line:
li.s


f0, 0 4
mul.d
f0, 0.4 mul.d


f1,


这篇关于如何在装配中进行浮点乘法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆