tags:

views:

67

answers:

1

I have the following bit of MIPS assembly, run on the MARS simulator, given below:

.data

x: .space 4 # 4 bytes = 32 bits

li $v0, 6
syscall

At this point, the floating point value I need is in $f0, but I need to move the value to x. If I could transfer the contents of the floating point register $f0 to $t0, I would be able to do this. Is this possible? If not, what is the workaround?

+1  A: 

You want the 'single precision store' pseudoinstruction. I think this one should stick whatever 32 bits are in $f0 to x.

s.s $f0, x

I just went and downloaded MARS and tested it out, it works fine here.

Carl Norum
Exactly what I needed.
Stefan Kendall