.data
time: .float 310.4, 390.8
miles: .float 12.0, 96.2
.text
li $t0, 3 #terminating value
li $t1, 4 #byte shifting
li $t2, 1 #i increments by 1
la $a1, time # put address of time into $a1
la $a2, miles # put address of miles into $a2
l.s $f1, ($a1)
l.s $f2, ($a2)
mul.s $f3, $f1, $f2
li $v0, 2
l.s $f12, __ <------- here????
syscall
如何打印f3?这开始变得令人沮丧。我可以打印$ a1或$ a2并移动它,但我需要将一些数字相乘并打印出来....谢谢!
答案 0 :(得分:2)
以下是完成背后理由的答案:
l.s $f12, ($a1)
$f12
中),则必须从浮点寄存器中移动内容,该浮点寄存器具有值为$f12
,使用说明mov.s
所以,在你的例子中你会这样做:
li $v0, 2
mov.s $f12, $f3 # Move contents of register $f3 to register $f12
syscall