Hi, I'm trying to load the value from r12 into f12.
Doesn't seem to work.
r12 : C6FA0000
f12 : 60000000
lfs f12,0(r12)
Am I doing something wrong?
Yeah. Floats are loaded and stored from memory, not other registers.
0(r12) means load the value that r12 is pointing at.
Quote from: Mathew_Wi on July 28, 2010, 01:58:38 AM
Hi, I'm trying to load the value from r12 into f12.
Doesn't seem to work.
r12 : C6FA0000
f12 : 60000000
lfs f12,0(r12)
Am I doing something wrong?
find some empty place in memory. I'n my example i'll use 0x8000098
lis r9, 0x8000 # base address
lis r12, 0xC6FA # value u want to load into float register
stw r12, 0x98(r9) # stores value into memory at 0x8000098
lfs f12, 0x98(r9) # reads value from 0x8000098 into f12
That makes me nervous...r9 needs to be safe, and I'm not sure that 0x80000098 is free.
I believe ZiT used a "negative stack frame" for loading floats in an SMG2 code.
lis r12, 0xC6FA
stw r12,-4(r1)
lfs f12,-4(r1)
it is safe, he's hacking Legend of Zelda: Ocarina of Time. I just check :p