delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/04/01/16:17:31

From: Nate Eldredge <neldredge AT hmc DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Usign C variables in ASM with gcc
Date: 01 Apr 2001 13:09:09 -0700
Organization: InterWorld Communications
Lines: 20
Sender: nate AT mercury DOT st DOT hmc DOT edu
Message-ID: <83zoe0757e.fsf@mercury.st.hmc.edu>
References: <9a750m$j2r$1 AT news1 DOT sunrise DOT ch>
NNTP-Posting-Host: mercury.st.hmc.edu
Mime-Version: 1.0
X-Trace: nntp1.interworld.net 986155749 40539 134.173.57.219 (1 Apr 2001 20:09:09 GMT)
X-Complaints-To: usenet AT news DOT interworld DOT net
NNTP-Posting-Date: Sun, 1 Apr 2001 20:09:09 +0000 (UTC)
User-Agent: Gnus/5.0802 (Gnus v5.8.2) Emacs/20.5
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"Christophe Pollet" <seyev AT infomaniak DOT ch> writes:

> Hi !
> I'd like to use C variable in ASM peration...
> 
> I have :
>     asm ("mov %al, my_variable");
> but it doesn't work...
> 
> What have I to do ??

Read about Extended Asm in the gcc manual.  From memory, I think what
you want is

asm("mov %%al, %0" : "=g" (my_variable));

-- 

Nate Eldredge
neldredge AT hmc DOT edu

- Raw text -


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