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 ASM in C/C++ code

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



Joined: 20 Aug 2005
Posts: 100

PostPosted: Sat Aug 27, 2005 8:01 pm    Post subject: Inline ASM in C/C++ code Reply with quote

Is there a reason why code that compiled perfectly on GCC 2.95.2 (PS2Linux... yeah I know some instructions cannot be used on ALLEGREX, etc... it is a question of inline ASM syntax) have to be modified very uglily to even be recognized.

Example:

Original:

Code:
asm __volatile__ ("
.set push
.set noreorder
div.s %0, %1, %2
mtc1 $0, $f8

...

 


Modified to be recognized...:

Code:
asm __volatile__ (".set\tpush\n\t"
".set\tnoreorder\n\t"
"div.s\t%0, %1, %2\n\t"
"mtc1\t$0, $f8\n\t"

...



It makes writing in-line ASM slower and more annoying. Is there anything that can be done to get gcc/g++ to recognize the original inline ASM syntax ?
Back to top
View user's profile Send private message
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Sat Aug 27, 2005 8:23 pm    Post subject: Reply with quote

The PS2 Linux compiler is extremely old. Multiline literals (continuing quotes) were deprecated and obsoleted a long time ago. There's nothing you can do to get psp-gcc to support multiline literals.

BTW you don't need tabs, a space should be fine. You don't need a tab after the newline either.
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 -> PSP 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