🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #53668

Re: Using asm templates on 386 wiht %-register names??

#53668
From: DJ Delorie
Date: Fri, 27 Sep 1991 12:13
22 lines
1249 bytes
In article <91Sep26.214944pdt.11704@alpha.xerox.com>, John_D._Sybalsky.MV@envos.xerox.COM writes:
> I need to do something like
> 
> 	asm("	movl %0, %esi" : : "g" (page));
> 
> But the danged % scanner (for %0) barfs on %esi, the legal register name.


Try this:

 	asm("	movl %0, %%esi" : : "g" (page));

Note that, at least in 1.39, the "register" in the third group of the
asm() must be the 16-bit version, not the 32-bit version, even though
it means the 32-bit version.  Example:

	asm("lodsd" : : : "ax");

I consider this to be a bug, but it's more annoying than disturbing.

DJ
dj@ctron.com
Technical Details
Message-ID: <2278@balrog.ctron.com>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!cs.utexas.edu!samsung!balrog!ctron.com
References: <91Sep26.214944pdt.11704@alpha.xerox.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,21977d8721121476
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1991-09-28 04:02:49 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!cs.utexas.edu!samsung!balrog!ctron.com
From: dj@ctron.com (DJ Delorie)
Newsgroups: gnu.gcc.help
Subject: Re: Using asm templates on 386 wiht %-register names??
Message-ID: <2278@balrog.ctron.com>
Date: 27 Sep 91 12:13:10 GMT
References: <91Sep26.214944pdt.11704@alpha.xerox.com>
Sender: news@balrog.ctron.com
Reply-To: dj@ctron.com
Distribution: gnu
Organization: None whatsoever
Lines: 22
Nntp-Posting-Host: bragi