This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Inline Assembler for PPC
- From: Ian Lance Taylor <ian at airs dot com>
- To: "Martin Payne" <martin at microcosm dot co dot uk>
- Cc: <gcc-help at gcc dot gnu dot org>
- Date: 22 Dec 2004 11:04:13 -0500
- Subject: Re: Inline Assembler for PPC
- References: <002e01c4e83b$efb07550$0401a8c0@martin>
"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