This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Inline Assembler for PPC


"Martin Payne" <martin@microcosm.co.uk> writes:

> All I would like to do is to store the value of a C function I have just called into a C variable called "i".
> 
> So instead of doing:
> 
> i = myfunction();
> 
> I want to do something like this:
> 
> myfunction();
> stw r3, i
> 
> (I know the value of the function is stored into the r3 register.)
> 
> It might look odd but I have my reasons for doing this. However, for everything I try with the keyword "asm" for inline assembler, it doesn't compile.
> 
> All I want to do is put the value in register r3 into my C variable, i.
> 
> Any ideas?

Read
    http://gcc.gnu.org/onlinedocs/gcc-3.4.3/gcc/Extended-Asm.html#Extended-Asm

If you have tried that already, then tell us what you did, and in what
way it did not work.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]