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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,cd3914726ae2d923 X-Google-Attributes: gid103376,public From: steve quinlan Subject: Re: How to use Assembly in Ada Date: 1999/02/19 Message-ID: <36CDF839.553D09BB@lmco.com>#1/1 X-Deja-AN: 446244653 Content-Transfer-Encoding: 7bit References: <36cd773b.0@silver.truman.edu> Content-Type: text/plain; charset=us-ascii Organization: Lockheed-Martin Air Traffic Management Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-02-19T00:00:00+00:00 List-Id: 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'.