delorie.com/archives/browse.cgi | search |
Message-ID: | <f4673c9fa27c94840138b651bb2b6e1e@antares.4ax.com> |
Newsgroups: | comp.os.msdos.djgpp |
From: | Xeno Antares <xeno AT antares DOT scorpio DOT space DOT nsa DOT gov> |
Date: | Sat, 14 Dec 2002 20:07:38 GMT |
References: | <uvhqfmcgbgs2f2 AT corp DOT supernews DOT com> |
<atc588$m3m$3 AT antares DOT lu DOT erisoft DOT se> | |
<3DF9B0CA DOT 9050500 AT mail DOT inf DOT tu-dresden DOT de> | |
<uvju8uis6k4he6 AT corp DOT supernews DOT com> | |
<200212131744 DOT gBDHiDd11835 AT envy DOT delorie DOT com> | |
<uvknsdoml9c8f1 AT corp DOT supernews DOT com> | |
MIME-Version: | 1.0 |
Subject: | Re: Quest about inline asm... |
Lines: | 41 |
NNTP-Posting-Host: | 213.6.109.131 |
X-Trace: | 1039901169 news.freenet.de 3013 213.6.109.131:1776 |
X-Complaints-To: | abuse AT freenet DOT de |
To: | djgpp AT delorie DOT com |
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
X-MIME-Autoconverted: | from quoted-printable to 8bit by delorie.com id gBELU4i13149 |
Reply-To: | djgpp AT delorie DOT com |
On Fri, 13 Dec 2002 14:30:10 -0800, "lewi9908" <lewi9908 AT ghc DOT ctc DOT edu> wrote: >> Omit the last colon. >> >> __asm__("pushl %eax" >> : /*No output*/ >> :"a"(ResultsMod)); > As stated in last msg I get the compiler error below with this... > > ...: invalid 'asm' : operand number missing after %-letter > > So I reread the error and remember I needed to use > __asm__("pushl %%eax" and not __asm__("pushl %eax". > > So it links now but I still got someways to go on my own... > > Thanks for the help... Hey! I'd suggest you try this one: ,---- | __asm__("pushl %0" | : /*No output*/ | :"a"(ResultsMod)); `---- You cannot rely on ResultsMod being stored in eax, and that would be contrary to the idea behind the templated approach taken in arg0 of __asm__. So the snippet above means "no outputs; store ResultsMod into any 'a-register' (despite intel having only one) referenced as '%0'; push the value contained in register ref'ed by '%0'". Hope that's kinda right, -- Xenocryst @ Antares Scorpii -- Hasta la victoria siempre -- Che
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |