From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,770531b96951ef54 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!z35g2000cwz.googlegroups.com!not-for-mail From: "Gene" Newsgroups: comp.lang.ada Subject: Re: Linking Ada with large Assembler libs? Date: 25 Feb 2007 14:47:46 -0800 Organization: http://groups.google.com Message-ID: <1172443666.325188.312920@z35g2000cwz.googlegroups.com> References: <1172093396.490201.203630@a75g2000cwd.googlegroups.com> NNTP-Posting-Host: 70.101.174.178 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1172443680 18607 127.0.0.1 (25 Feb 2007 22:48:00 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 25 Feb 2007 22:48:00 +0000 (UTC) In-Reply-To: <1172093396.490201.203630@a75g2000cwd.googlegroups.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: z35g2000cwz.googlegroups.com; posting-host=70.101.174.178; posting-account=ZFTPUQ0AAABW8AYEou9RtrBd-zTxz0_y Xref: g2news2.google.com comp.lang.ada:9535 Date: 2007-02-25T14:47:46-08:00 List-Id: On Feb 21, 4:29 pm, "freejack" wrote: > The Machine Code Insertions sections of the relevant reference manuals > have been informative. > > However, I'm linking my Ada code with pre-existing libs written in > Assembler. The GNAT manuals are a little sketchy on how to do this > properly. I'm using NASM and FASM Assembler code. Most of the > Assembler code deals primarily with I/O. I'm using Pragma No_Run_Time > and writing my own Binder files, with a good bit of success. > It's not such a big problem, as I can do it by fiddling with the > linker and manipulating the object code. But the result is messy and > error prone. > > What are the best methods you guys have come up with for doing this > sort of manipulation? > > freejack > Chris Add a C-call compliant shim layer to your existing lib code. Writing this in C + embedded assembly is a good idea of possible. Compile and link to make C-callable static or dynamic libs. In Ada, Import and link the shims just as any C function.