comp.lang.ada
 help / color / mirror / Atom feed
From: Gautier <gautier.demontmollin@maths.unine.ch>
Subject: Re: Bit operators & asm in Ada (novice question)
Date: 2000/02/13
Date: 2000-02-13T00:00:00+00:00	[thread overview]
Message-ID: <38A6CA94.4DA3C716@maths.unine.ch> (raw)
In-Reply-To: 38A624B3.5709A464@interact.net.au

So - in Borland C++ I may actually write asm directly into code (not that I can yet),
but - is this possible in Ada ?

Yes. But you won't need it. Borland's compiler translates the operations into
unefficient, redundant machine code that actually need asm rewrite.
If you take an optimizing Ada compiler (say GNAT) and compile with "-O2 -gnatp",
the code generator will do an impressive optimisation effort, in particular with
bitfield manipulations. You can see it in action for drawing 3D polygon scanlines
(link below)...

> Does the Ada programmer have to construct their programs with a preconceived
> notion that it will have to be rewritten in parts in Assembly ?

So, fortunately not. Would it be true, they should consider changing their compiler...
In addition asm insertions break portability and security (run with range check).
Should be used only for 1-asm-instruction procedure to communicate with hardware (IMHO).

-- 
Gautier

_____\\________________\_______\_______
http://members.xoom.com/gdemont/e3d.htm




  reply	other threads:[~2000-02-13  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-02-12  0:00 Bit operators Joshua Grant
2000-02-13  0:00 ` Robert Dewar
2000-02-13  0:00   ` Gautier
2000-02-13  0:00 ` Gautier
2000-02-13  0:00 ` Matthew Heaney
2000-02-13  0:00   ` Bit operators & asm in Ada (novice question) G
2000-02-13  0:00     ` Gautier [this message]
2000-02-13  0:00     ` Vladimir Olensky
replies disabled

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