delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/12/19/08:45:06

From: eplmst AT lu DOT erisoft DOT se (Martin Stromberg)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: inline assembly syntax for accessing variables ?
Date: 19 Dec 2002 13:26:18 GMT
Organization: Ericsson Erisoft AB, Sweden
Lines: 19
Message-ID: <atshdq$rji$2@antares.lu.erisoft.se>
References: <atses9$d2v$1 AT news DOT online DOT de> <atshbq$rji$1 AT antares DOT lu DOT erisoft DOT se>
NNTP-Posting-Host: lws256.lu.erisoft.se
X-Newsreader: TIN [version 1.2 PL2]
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Martin Stromberg (eplmst AT lu DOT erisoft DOT se) wrote:
: : int a,b;
: : a=4;
: : b=8;
: : asm ADD b,a

: : this should result in b being 12 (a+b);

: asm ("add %1, %0"
:     : "=r" (b)
:     : "r" (a)
:      );

I forgot to say that this is untested code.


Right,

						MartinS

- Raw text -


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