Gang,
I'm new to xcode (using 2.1) and am importing some of our CodeWarrior
projects. Got all but one hurdle tackled and that's the inline
assembly we have.
I've done a bit of home work on this issue (online docs, list archives,
etc) but am still stymied. Here's the sitch:
I *have* checked the "codewarrior style inline assembly"
check box in the language settings. As such, when I try to compile this:
asm void
foo()
{
li
r0,0
blr
}
I get: "error: syntax error before 'void'"
If I retool it to be:
void foo()
{
asm {
li
r0,0
blr
}
}
I get: "error: 'asm' undeclared (first use in this function)"
If I try the GCC/GNU style of inline asm (as I found on the web but
still not terribly familiar with) and retool foo again to be:
void foo()
{
asm("
li r0,0 ");
asm("
blr ");
}
I get no compile errors but looking at the Assemply Code dump I very
strangely get:
_foo:
.stabd 68,0,94
mflr r0
stmw r30,-8(r1)
stw r0,8(r1)
stwu r1,-80(r1)
mr r30,r1
bcl 20,31,"L00000000001$pb"
"L00000000001$pb":
mflr r31
.stabd 68,0,95
addis r2,r31,ha16(LC0-"L00000000001$pb")
la r3,lo16(LC0-"L00000000001$pb")(r2)
bl L_asm$stub
.stabd 68,0,96
addis r2,r31,ha16(LC1-"L00000000001$pb")
la r3,lo16(LC1-"L00000000001$pb")(r2)
bl L_asm$stub
.stabd 68,0,97
lwz r1,0(r1)
lwz r0,8(r1)
mtlr r0
lmw r30,-8(r1)
blr
At this point I don't know what else to try to get xcode to be happy
with my inline asm from CodeWarrior.
Can anyone share their insight?
Thx,
ando