Re: FW: Inline Assembler for PPC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[ I see that you did reply to the mailing list as well--thanks for
  doing that--so I am sending my reply here also.  ]

> I have read that but it does not tell me how to specify a register in the assembler command.
> 
> I want to get the value of r3 into my local C variable: i.
> 
> I have tried: asm ("stw %%r3, %0" : : "r" (i) : "r3")
> 
> However, that does not compile giving error "parameter syntax error (parameter 1)".

First, there is no need to put "r3" in the list of clobbered
registers, as your instruction does not clobber r3.

Second, please send a complete example.  I tried this, and it appeared
to work fine.

int foo (int i)
{
  asm ("stw %%r3, %0" : : "r" (i));
}

Ian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux