forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Inline assembly

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
SubZero9



Joined: 18 Jun 2006
Posts: 1

PostPosted: Sun Jun 18, 2006 4:54 pm    Post subject: Inline assembly Reply with quote

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
View user's profile Send private message
Kojima



Joined: 26 Jun 2006
Posts: 275

PostPosted: Fri Jul 07, 2006 2:19 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
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