So, it is impossible to get the value of r3 into a local variable? > -----Original Message----- > From: Ian Lance Taylor [mailto:ian@xxxxxxxx] > Sent: 22 December 2004 20:44 > To: Martin Payne > Cc: gcc-help@xxxxxxxxxxx > Subject: Re: FW: Inline Assembler for PPC > > > "Martin Payne" <martin@xxxxxxxxxxxxxxx> writes: > > > Well, that same code does not work for me. > > If I have this code: > > > > main(int argc, char* argv[]) { > > int i; > > asm("stw %%r3, %0" : : "r" (i)); > > > > return 0; > > } > > > > and compile it by running: > > > > gcc mytest.c > > > > it gives the following output: > > > > /var/tmp//ccOB6jdo.s:16:Parameter syntax error (parameter 1) > > > > I am using gcc 3.3 20030304 by Apple, build 1666. > > OK, that error is coming from the assembler, not the compiler. Note > that the file name is the .s file, not the .c file. > > First I'll note that the error message is not from the mainline GNU > assembler. My understanding is that Apple uses an assembler based on > very very old version of the GNU assembler. I don't have access to > any Apple development systems. > > That said, the above C source code will generate something like this > in the assembler file (you can check yourself by using the > --save-temps option to get the assembler file): > stw %r3, 3 > That of course won't work. The stw instruction doesn't expect the > second parameter to be a register. > > Ian > > --- > > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.766 / Virus Database: 513 - Release Date: 17/09/2004 > --- Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.766 / Virus Database: 513 - Release Date: 17/09/2004