WiiRd forum

Wii & Gamecube Hacking => WiiRD Remote Debugger => Topic started by: Panda On Smack on May 18, 2009, 05:10:25 PM

Title: Floating Point Register - stfs
Post by: Panda On Smack on May 18, 2009, 05:10:25 PM
Hey people

How would I go about loading a value into a float point register so i can create a C2 code?

I have this:

stfs f0,512(r3)

I would like to load the value of 0 in to f0 and not use the value 512 places on from r3

ta
Title: Re: Floating Point Register - stfs
Post by: Panda On Smack on May 18, 2009, 05:23:41 PM
yeah sorry, i realise that

I want to change the value held in f0 to 0 before calling: stfs f0,512(r3)

Title: Re: Floating Point Register - stfs
Post by: Panda On Smack on May 18, 2009, 05:57:43 PM
Thanks

Since posting I just changed:

stfs f0,512(r3)

to

stfs f31,512(r3)

as f31 is unused and always 0 so bit of a cheat but works for time being
Title: Re: Floating Point Register - stfs
Post by: Y.S. on May 19, 2009, 12:27:27 AM
You can also load 0 into f0 by the following;

fsubs f0,f0,f0

When loading a value other than 0, a macro could be useful;

.macro lfsi freg,symbol
lis r12,\sumbol@h
ori r12,r12,\symbol@l
stw r12,-4(r1)
lfs \freg,-4(r1)
.endm


Title: Re: Floating Point Register - stfs
Post by: Panda On Smack on May 19, 2009, 12:37:21 AM
Excellent, thanks