MIPS storing and printing double precision numbers
I am trying to get inputs of double precision numbers stored and printed off an array.
According to here, to read a double, you use $f0 with code 7 However, I am getting an syntax par开发者_C百科se error on this line:li $f0, 7
Edit: I dont know why, but when Im printing array, it just prints out 0, does anyone know why?
You missed the part of the documentation that says "Code in $v0". You load 7 into $v0
and make your syscall
, the result of which will be put into the $f0
register.
精彩评论