comp.lang.ada
 help / color / mirror / Atom feed
From: steve quinlan <steven.quinlan@lmco.com>
Subject: Re: How to use Assembly in Ada
Date: 1999/02/19
Date: 1999-02-19T00:00:00+00:00	[thread overview]
Message-ID: <36CDF839.553D09BB@lmco.com> (raw)
In-Reply-To: 36cd773b.0@silver.truman.edu

I think something like this will work :

You define an Ada procedure or function with the parameters defined which
you want to pass to/from the assembler routine.

You would have a pragma import (Assembler, Ada_name, "link_name");
 link_name is optional if the assembler entry point name is the same as the
Ada name. But it might have to have a period or something. Sometimes pragma
import (C ..)  works just as well for assembler code.

You need to know the passing conventions of the compiler -- what registers
does it pass those parameters in? Vendors are supposed to document their
calling conventions, but I don't know where it would be in the GNAT
documentation. You can compile some sample calls with the option to get
assembler listings and check how they do it. Then, you write your assembler
routines to access/return values in the registers which the compiler has
used for the parameters of interest.

Now, assemble your assembler routine, compile the Ada,  passing the object
file generated by the assembler to the linker when you link the Ada program
and -- Voila'.







  reply	other threads:[~1999-02-19  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-19  0:00 How to use Assembly in Ada Josh Highley
1999-02-19  0:00 ` steve quinlan [this message]
1999-02-19  0:00 ` Josh Highley
1999-02-19  0:00 ` How do I use Assembly from Ada? Josh Highley
1999-02-20  0:00 ` How to use Assembly in Ada Jerry van Dijk
replies disabled

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