MPC: Inline assembly info

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MPC: Inline assembly info

3,264 Views
MGotcha
Contributor I
I am using CW v8.6 for PPC, and am attempting to use the inline assy feature to simplify some lower level stuff from 'C', but there does not seem to be any documentation on this in the 'C' or 'C++' ref manual as stated in Assembler Reference Manual. In particular, I need to use a command like "lbz rD,d(rA)" where rD and rA are 'C' register types, and 'd' is a constant. I can use "lbzx rD,rA,rB" OK by simply calling out "asm(lbzx vara,varb,varc)" but I do not know how to handle the immediate field 'd' with the "lbz rD,d(rA)" command. Thanks for any guidance!

Message Edited by CrasyCat on 2007-04-13 11:40 AM

Labels (1)
0 Kudos
Reply
2 Replies

939 Views
MGotcha
Contributor I
I could not find a section in the "Targeting Embedded PowerPC" manual, but the example you gave does work, and I had thought I tried this before without success after refering to some other info on GCC inline asm extensions. Anyway, problem solved! Thanks!
0 Kudos
Reply

939 Views
CompilerGuru
NXP Employee
NXP Employee
Did you have a look into the "Working With the Inline Assembler" chapter of the Targeting_Embedded_PowerPC.pdf manual?

Anyway, not sure what the problem is you try to solve, the following code builds fine for me:

static int test(register int reg_b)
{
 register int reg_a;
 __asm(lbz reg_a,1(reg_b));
 return reg_a;
}


Daniel
0 Kudos
Reply