Mail Archives: djgpp/1996/07/15/11:49:45
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 <stdio.h>
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.
- Raw text -