delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/12/04:01:54

From: "M. Schulter" <mschulter AT value DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Why can't I refer to local variables in in-line assembly?
Date: 12 Oct 1997 07:01:09 GMT
Organization: Value Net Internetwork Services Inc.
Lines: 33
Message-ID: <61psjl$8j0$2@vnetnews.value.net>
References: <876550769 DOT 20180 AT dejanews DOT com>
NNTP-Posting-Host: value.net
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

LL <username AT sprint DOT ca> 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?

Hi, there.

Please note, if I understand your question correctly, that it is certainly
possible to make a reference to a local C variable in an inline assembly
statement using DJGPP's version of gcc, the GNU C compiler.

Please see Section 17.1 of the DJGPP FAQ for a reference to a great
tutorial, much of it devoted this point, by Brennan "Bas" Underwood. There
are lots of examples:

http://www.rt66.com/~brennan/djgpp/djgpp_asm.html

For an official reference, see also

info gcc

and then go to 'c extensions', and then 'extended asm', to get the details
on how to include local variables in inline asm.

I would recommend Brennan's tutorial for a step-by-step presentation with
examples, and the gcc docs for a more manual-like treatment.

Most respectfully,

Margo Schulter
mschulter AT value DOT net

- Raw text -


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