Mail Archives: djgpp/1996/06/16/19:39:12
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.
- Raw text -