Mail Archives: djgpp/1999/05/22/05:25:40
> > the static and the automatic variables are located in memory one next to
> > another, if they are declared so
>
> This is simply not true. Static variables go to the data section
> while automatic variables are on the stack. So they could be
> megabytes apart. You can easily verify that by taking an address of a
> variable and printing it.
you didn't understand what i'm talking about. you have to know the address of
one static variable and then you can address the others using the following
model:
static short a,b;
asm("
mov 2+%0,%%ax
"
:
:"g"(a));
and you get
mov b,ax
if both a and b are automatic variables, you may also do this stuff but there
should be -2+%0 instead 2+%0 ,IMHO
- Raw text -