Date: Sat, 11 Oct 1997 16:53:14 -0700 (PDT) Message-Id: <199710112353.QAA25412@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: "Newbie" , djgpp AT delorie DOT com From: Nate Eldredge Subject: Re: Why can't I refer to local variables in in-line assembly? Precedence: bulk At 12:27 10/10/1997 GMT, Newbie wrote: >I just found out I can't make reference to any local variable using in-line >assembler with Rhide 1.4. >Is this a restriction of Rhide per say, or it's universal for all DJGPP >compilers. >Is there any way around this shorting of changing those variables to glabal? It is universal for all compilers. You can use GCC's inline asm constraints, see `info gcc "C Extensions" "Extended Asm"'. These will give you the address of the variable. For instance: int add_four(int x) { asm("addl $4,%0" : "=g" (x) : "g" (x)); return x; } Nate Eldredge eldredge AT ap DOT net