delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/23/00:12:37

Comments: Authenticated sender is <mert0407 AT sable DOT ox DOT ac DOT uk>
From: "George Foot" <george DOT foot AT merton DOT oxford DOT ac DOT uk>
To: Endlisnis <s257m AT unb DOT ca>
Date: Sun, 23 Aug 1998 05:10:53 +0000
MIME-Version: 1.0
Subject: Re: ASM
Reply-to: george DOT foot AT merton DOT oxford DOT ac DOT uk
CC: djgpp AT delorie DOT com
Message-Id: <E0zARVp-0004QJ-00@sable.ox.ac.uk>

On 22 Aug 98 at 23:31, Endlisnis wrote:

> Nate Eldredge wrote:
> 
> > >     Is there any way to load a variable into a register without putting it
> > > in the 'input registers' section?
> > Yes, just as you describe.
> 
> int main(){
>  int T=9;
>  asm("movl T, %eax");
>  }
> 
>     How can I make that program compile.  How can I load 'T' into %eax without
> using input registers.

You have to ask gcc to load it for you, because there's no guarrantee 
that `T' has a place in memory.  It might for instance be stored in a 
register throughout its useful life.

You can only load global variables directly; prefix the variable's 
name with an underline.

Why don't you want to use input registers?

-- 
george DOT foot AT merton DOT oxford DOT ac DOT uk

- Raw text -


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