www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/05/22/05:25:40

Message-ID: <3743B4E7.12663C12@go.ro>
Date: Thu, 20 May 1999 10:08:23 +0300
From: Radu Georgescu aka skoola <skoola AT go DOT ro>
X-Mailer: Mozilla 4.5 [en] (Win95; I)
X-Accept-Language: en
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: problem with extended inline asm
References: <Pine DOT SUN DOT 3 DOT 91 DOT 990518135146 DOT 24330X-100000 AT is>
Reply-To: djgpp AT delorie DOT com

> > 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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019