comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <robert_dewar@my-deja.com>
Subject: Re: asm in ada
Date: Wed, 06 Sep 2000 12:41:25 GMT
Date: 2000-09-06T12:41:25+00:00	[thread overview]
Message-ID: <8p5e1h$ai5$1@nnrp1.deja.com> (raw)
In-Reply-To: fTit5.192$N13.24942@eagle.america.net

In article <fTit5.192$N13.24942@eagle.america.net>,
  "William J. Thomas" <wjthomas@wcvt.com> wrote:
> If its the intel version, look for Machine_Operations_386. Its
a real piece
> of work, a real gem.
>
> "Etienne" <etienne.baudin@wanadoo.fr> wrote in message
> news:Ihps5.149$xr6.264251@nnrp6.proxad.net...
> > Hello,
> > I'd like to know if inserting asm code is possible in
objectAda (how?)
> > Thanks
> > Etienne


Well that's a nice note (the design of the Object Ada facility
comes from my original design for Alsys Ada, back in the old
days when I worked for Alsys). I agree it's a nice design :-)

Note that nearly all compilers will provide a facility for
either machine code insertions, or package machine code, since
this is required by the systems programming annex which most
Ada 95 compilers implement. However, the facility is in general
VERY target dependent (except on the Motorola 88000 where
interestingly the official system ABI dictated what package
Machined_Code must look like for any Ada compiler for that
system, at least so I am told :-) That means you have to look
into the specific compiler documentation from the vendor.

In the case of GNAT, for example, both package machine code
and intrinsics are available, and they are based on interfacing
directly with the internal register transfer language used
by the compiler. This is a little complex, but has the advantage
that the optimizer can fully deal with insertions, they can
be inlined etc. Anyway, you have to go to the particular
compiler in question for this information, and the resulting
program is likely to be highly non-portable.

It is often better to either try to avoid the use of ASM
completely (it would be interesting to know why you are using
it, so often there are ways to do what you want in Ada after
all), or to write a small assembler routine (which surprisingly
is likely to be more portable than writing asm inserts).

Robert Dewar


Sent via Deja.com http://www.deja.com/
Before you buy.



  reply	other threads:[~2000-09-06 12:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Ihps5.149$xr6.264251@nnrp6.proxad.net>
2000-09-06  3:35 ` asm in ada William J. Thomas
2000-09-06 12:41   ` Robert Dewar [this message]
2000-09-06 13:51     ` Gautier de Montmollin
2000-09-06 22:03       ` Samuel T. Harris
replies disabled

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