DDu*_*man 0 floating-point mips
.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
Run Code Online (Sandbox Code Playgroud)
如何打印 f3?这开始变得令人沮丧。我可以打印 $a1 或 $a2 并移动它,但我需要乘以一些数字并打印它们......谢谢!
以下是完成背后原理的答案:
l.s $f12, ($a1)加载浮点值时应该使用$f12从浮点寄存器中移动其值为 的内容$f12mov.s所以,在你的例子中你会这样做:
li $v0, 2
mov.s $f12, $f3 # Move contents of register $f3 to register $f12
syscall
Run Code Online (Sandbox Code Playgroud)