 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
SubZero9
Joined: 18 Jun 2006 Posts: 1
|
Posted: Sun Jun 18, 2006 4:54 pm Post subject: Inline assembly |
|
|
I've got a problem with the toolchain, where I'm doing something like this:
static inline void SetupMatrix (MATRIX mat)
{
asm __volatile__ ("\n\
lqc2 vf4,0x00(%0)\n\
lqc2 vf5,0x10(%0)\n\
lqc2 vf6,0x20(%0)\n\
lqc2 vf7,0x30(%0)\n\
": : "r" (mat));
}
The compiler is throwing up this error:
error: Internal compiler error at expr.c:2672
Where the line it is throwing up on is asm __volatile__ line. It is also complaining about this:
error C2143: syntax error : missing ')' before ':'
Which is referring to the ": : "r" (mat)); line
Any ideas? |
|
| Back to top |
|
 |
Kojima
Joined: 26 Jun 2006 Posts: 275
|
Posted: Fri Jul 07, 2006 2:19 am Post subject: |
|
|
Probably your compiler settings because I copied and pasted it into my code and it compiled perfectly.
I even used it to write my own little asm test,
| Code: |
void AddTest()
{
int num1=5;
int num2=10;
int out=0;
asm __volatile__ ("\n\
mult %0,%1,%2\n\
":"=r"(out):"r"(num1),"r"(num2));
printf("Result:%d \n",out);
}
|
which again compiled perfectly and worked(I.e it outputted 50) so I don't think your code is at fault. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|