From: Leath Muller Message-Id: <199607102332.JAA14331@gbrmpa.gov.au> Subject: Problems with inline ASM To: djgpp AT delorie DOT com Date: Thu, 11 Jul 1996 09:32:09 +1000 (EST) Content-Type: text Hi guys... I was converting my blit routines to asm last night, and encountered a problem with accessing C variables. As a result of the problem, I wrote the following test program: --- #include volatile int x = 0; int main(void) { volatile asm (" movl $50, _x; "); printf("%d\n",x); exit(0); } --- This code compiled flawlessly, and ran as expected, ie: printing out the number 50. However, when i try to do something similar in my main blitting program, I experience some problems: It seems to compile ok through the first stage of my makefile, but seems to complain when it tries to link the file. The problem is this error: vbe.exe:0 undeclared reference to variable 'x' I get this with all the variables I use in the inline function. Is this a common problem? I tried static, as well as volatile, and it make no difference! It also brings up this problem whenever I try to access any C variable, whether it be global, local or whatever. Can someone help me at all? Leathal.