Xref: news2.mv.net comp.os.msdos.djgpp:4774 From: Brian Drum Newsgroups: comp.os.msdos.djgpp Subject: Inline ASM and variables Date: Sun, 09 Jun 1996 15:42:41 -0400 Organization: Netcom Lines: 24 Message-ID: <31BB2931.3BB0@ix.netcom.com> NNTP-Posting-Host: knx-tn5-04.ix.netcom.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp I'm trying to learn how to use my newly aquired copy of DJGPP and am running into trouble with using the inline assembler. When I have some inline assembly inside a function I can't access varialbes that are passed to the function. For eaxample: void foo(int x) { __asm__ __volatile__ (" movl _x, %%eax" : : :"eax" ); } Won't work. I get the following linker error: test_asm.c(.text+0x4): undefined reference to `x' I know that I could simply have GCC load x for me but that won't do in the more complicated things that I'm doing because I don't want to use up a bunch of registers. Is there anyway to access these variables that are passed to the function? Thanks.