This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Inline Assembler for PPC
- From: "Martin Payne" <martin at microcosm dot co dot uk>
- To: <gcc-help at gcc dot gnu dot org>
- Date: Wed, 22 Dec 2004 15:35:59 -0000
- Subject: Inline Assembler for PPC
I am trying to do some very simple inline assembler with GCC, compiling on the Mac (MACOSX).
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?
---
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.766 / Virus Database: 513 - Release Date: 17/09/2004