asm related error while compilation with gcc

View: New views
3 Messages — Rating Filter:   Alert me  

asm related error while compilation with gcc

by Arjun Prasad :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi All,

While compiling(with gcc cross compiler build for powerpc target
proccessor + AMX RTOS) a xyz.c file containing some code in following
format:-
asm void abcxyz(void *ptr,int arjunSroll)
{

!"r6"
......
......
......
mfspr r6,hido
......
......
addi  r6,r0,...@1
}
I got following errors..
error:expected '(' before 'void'
error:stray '@' in program

Can anybody tell me the reason of geting such errors.
Thanks in advance...
Cheers..
Arjun Prasad

Re: asm related error while compilation with gcc

by Ian Lance Taylor-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Arjun Prasad <arjunprasadmca@...> writes:

> While compiling(with gcc cross compiler build for powerpc target
> proccessor + AMX RTOS) a xyz.c file containing some code in following
> format:-
> asm void abcxyz(void *ptr,int arjunSroll)
> {
>
> !"r6"
> ......
> ......
> ......
> mfspr r6,hido
> ......
> ......
> addi  r6,r0,...@1
> }
> I got following errors..
> error:expected '(' before 'void'
> error:stray '@' in program
>
> Can anybody tell me the reason of geting such errors.

That is not the gcc asm syntax.  That is the asm syntax for some other
compiler.

Ian

Parent Message unknown Fwd: asm related error while compilation with gcc

by Arjun Prasad :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

---------- Forwarded message ----------
From: Ian Lance Taylor <iant@...>
Date: Thu, Nov 12, 2009 at 12:09 PM
Subject: Re: asm related error while compilation with gcc
To: Arjun Prasad <arjunprasadmca@...>


Arjun Prasad <arjunprasadmca@...> writes:

> Can u plz tell me which compiler syntax it can be....

Please reply to the mailing list, not just to me.

Sorry, I have no idea which compiler this is for.

> and how to solve this error

You have to rerite it into gcc's asm syntax, which you can find
described in detail in the friendly manual.

Ian

> On Fri, Nov 6, 2009 at 9:25 PM, Ian Lance Taylor <iant@...> wrote:
>> Arjun Prasad <arjunprasadmca@...> writes:
>>
>>> While compiling(with gcc cross compiler build for powerpc target
>>> proccessor + AMX RTOS) a xyz.c file containing some code in following
>>> format:-
>>> asm void abcxyz(void *ptr,int arjunSroll)
>>> {
>>>
>>> !"r6"
>>> ......
>>> ......
>>> ......
>>> mfspr r6,hido
>>> ......
>>> ......
>>> addi  r6,r0,...@1
>>> }
>>> I got following errors..
>>> error:expected '(' before 'void'
>>> error:stray '@' in program
>>>
>>> Can anybody tell me the reason of geting such errors.
>>
>> That is not the gcc asm syntax.  That is the asm syntax for some other
>> compiler.
>>
>> Ian
>>