comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@gnat.com
Subject: Re: Assembler in Ada?
Date: 1999/01/24
Date: 1999-01-24T00:00:00+00:00	[thread overview]
Message-ID: <78fvjm$82t$1@nnrp1.dejanews.com> (raw)
In-Reply-To: 78a32f$dbr$1@remarQ.com

In article <78a32f$dbr$1@remarQ.com>,
>     Asm (
>              "movl  %1,    %%eax"  & nl &    -- note nl

This is a bad idea, use one Asm call per instruction.
Also you probably do NOT want to use an explicit register
here. It is allowed, but it usually at the wrong level.
It is true one does this more on the ia32 than other
machines, but it is poor as an example.

You do not need to set the clobbers argument in this case
to %%eax, it won't cause trouble to do so, but there is no
need, and in an example it is confusing.

>           False  -- compiler, do not optimise my code

It is quite wrong to mark this as volatile, this is not
a volatile instruction.


> From the last example you can see that it is necessary to
> be very careful when
> manually controlling passing varaibles to the registers.

It is generally a bad idea to write asm code at this level
(a level where you rely on detailed knowledge of the ABI
for passing parameters), and it is not necessary.

Once again, we recommend that anyone interested in using
this feature read the documentation in the GCC manual. The
design of the ASM feature in Ada has been chosen to be a
very thin binding to the corresponding C feature, so that
documentation and examples apply without any confusion.

Robert Dewar
Ada Core Technologies


-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




  reply	other threads:[~1999-01-24  0:00 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-01-13  0:00 Assembler in Ada? Thomas Larsson
1999-01-13  0:00 ` Matthew Heaney
1999-01-14  0:00   ` Bill Ghrist
     [not found]     ` <369ED5E0.DB29E68C@usc.edu>
1999-01-15  0:00       ` Will this help? (Re: " Bill Ghrist
1999-01-22  0:00 ` news.oxy.com
1999-01-24  0:00   ` dewar [this message]
1999-01-25  0:00     ` news.oxy.com
1999-01-25  0:00       ` robert_dewar
1999-01-26  0:00         ` news.oxy.com
1999-01-26  0:00           ` Larry Kilgallen
1999-01-27  0:00             ` dewar
1999-01-27  0:00           ` robert_dewar
1999-01-25  0:00       ` robert_dewar
1999-01-24  0:00   ` dewar
1999-01-25  0:00     ` news.oxy.com
1999-01-25  0:00       ` Richard Kenner
1999-01-25  0:00         ` news.oxy.com
1999-01-25  0:00       ` robert_dewar
1999-01-26  0:00         ` news.oxy.com
1999-01-27  0:00           ` Samuel Tardieu
1999-01-27  0:00             ` news.oxy.com
1999-01-27  0:00               ` Marin David Condic
1999-01-28  0:00                 ` news.oxy.com
1999-01-27  0:00           ` dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox