Gang,
We're porting our code from CodeWarrioir to Xcode and are encountering errors when we use r31 (error: PIC register 'r31' clobbered in 'asm')
Two questions:
1) Is there a setting where we can instruct Xcode not to generate an error when we use r31?
2) And two, it looks like our code (I didnt write it) is assuming that CodeWarrior's asm pre/postamble code is saving/restoring registers r20 through r31. Is this something we'll have to change? Perhaps save off registers ourself? Or do we now have to save off and restore registers ourselves?
I created a simple fn foo
asm void foo() { li r5,0 }
which disassembled into this:
stmw r30,-8(r1) stwu r1,-48(r1) mr r30,r1
li r5,0
lwz r1,0(r1) lmw r30,-8(r1) blr
I havent studied (yet) PPC asm so I cant say for sure what is happening with r30 and r1, but I assume that if I use the other registers I must save and restore them myself...
So, any feedback from those of you in the know?
Thx, ando |