www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/16/23:12:58

Date: Sat, 17 Oct 1998 04:10:07 +0100 (BST)
From: George Foot <george DOT foot AT merton DOT oxford DOT ac DOT uk>
To: djgpp AT delorie DOT com
Subject: Re: Accessing local variables from an asm block
In-Reply-To: <3627f023.23531526@news.flashnet.it>
Message-ID: <Pine.OSF.4.05.9810170408060.3870-100000@sable.ox.ac.uk>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

On Sat, 17 Oct 1998, Fogbank wrote:

> As the subject says, what's the syntax for accessing local variables
> (and function parameters) from within an asm block?

Use `extended' inline assembler:

    asm ("movl %0, %1"
       : "=r" (variable_to_copy_to)
       : "r" (variable_to_copy_from)
    );

See Brennan's Guide to Inline Assembler, and the documentation
it points to:

    http://brennan.home.ml.org/djgpp/djgpp_asm.html

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

xu do tavla fo la lojban  --  http://xiron.pc.helsinki.fi/lojban/lojban.html

- Raw text -


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