This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: How to use C macros in asm
I get an error when using this syntax. It says parse error before REG.
--Kapil
On Wed, 2003-11-05 at 17:39, Mihnea Balta wrote:
> If it's for registers, maybe you could use extended asm syntax like this:
>
> #define REG "a"
> int x;
>
> __asm__ __volatile__ (" \n\
> movl %0, 0x01 \n\
> "
> :"="REG(x)
> :
> );
>
> On Wednesday 05 November 2003 12:12, Kapileswar Rao wrote:
> > Hello,
> > I am trying to use a C macro inside the asm instruction.But inside
> > the asm instruction macro is not replaced by macro definition. Is there
> > anyway I can do that.
> >
> > Here is an Example what I want to do.
> >
> > #define Register R0
> >
> > asm("mov Register, #1");
> >
> > I want the Register in assembly instruction to be replaced by R0. Is
> > there any option which could do that.
> >
> > Thanks and Regards,
> > --Kapil
> >
> >
> > ---------------------------------------------------------------
> > Acasa.ro vine cu albumele, tu vino doar cu pozele ;)
> > http://poze.acasa.ro/