From: Leath Muller Message-Id: <199606162318.JAA03475@gbrmpa.gov.au> Subject: Referencing C var's in inline asm To: djgpp AT delorie DOT com Date: Mon, 17 Jun 1996 09:18:14 +1000 (EST) Content-Type: text Content-Length: 745 I am trying to write some assembly routines, and I want to do them inline, so I can pretty much mix the C and asm a lot...how do I access C vars in a subroutine from within the asm code? eg: void foo(int a, int b...) { static int fred = a; _asm_ __voloatile__ (" movl _fred, %eax; ... ") printf("%bd\n",fred); } This isnt the actual code, but demonstrates what I basically want to do. The compiler keeps telling me that I have an undefined reference to 'fred'. I cant imagine this being a really hard problem to fix... :) I also want to do things this way cause I have a lot of variables, and dont want to be continually passing stuff in and out in registers with : : stuff at the end of the statements...any clues? Leathal.