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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,edb329885d962c1d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-09-05 19:20:10 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!sn-xit-03!sn-xit-01!sn-post-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: Jerry van Dijk Newsgroups: comp.lang.ada Subject: Re: Ada and ASM Date: 06 Sep 2003 04:18:17 +0200 Organization: JerryWare Message-ID: References: Reply-To: somename@nospam.demon.nl User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.93 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@supernews.com Xref: archiver1.google.com comp.lang.ada:42200 Date: 2003-09-06T04:18:17+02:00 List-Id: Freejack writes: > As far as I can tell the GNAT system expects everything to be in GAS (Gnu > Assembler) syntax and it expects the Assembler to be GAS. To be precise, GAS is only a front-end for the real assembler 'as'. The idea of GAS was to make it a little easier to write assembler by hand, as 'as' is really meant to assemble machine generated code. For the GNU system (which includes gcc and thus GNAT) 'as' is the standard assembler on all platforms. > I've not found any documentation anywhere explaining how to use something > like Nasm(Netwide Assembler), Tasm(Turbo Assembler), Fasm, ect... or > anything besides Gas with GNAT You are reversing reality :-) You can link any assembled object code with gcc (and thus GNAT) that you like, provided that the assembler you use generates object code in the correct format. Which format that is depends on the platform you are using. Of the x86 specific assemblers you mention I think that only NASM is capable (under linux and win32) to generate correct object code (as is BTW 32-bit MASM, under Win32). If you want to use TASM, ask Borland to have it create the correct object code for your pupose. As for FASM, well... But why is this a problem ? Simply convert your NASM code to AT&T syntax, and assemble it with GAS. For the x86 this conversion is fairly trival, and there are some tools out there to help. > Dont misunderstand me. GNAT is awsome. But it seems a little Amish in > this respect. I could direct the backend GCC to link in my Nasm code, but > then that means usually dicking with C calling conventions in tedium. Yes, of course, what else would you expect ? NASM does not provide you with an gcc compatible Ada calling convention (or a COBOL convention, or a FORTRAN convention, or a...). If you want this, ask the NASM people to provide this for you :-) The same goes for any other assembler I am aware of. An alternative is to use GNAT's inline assembler facility, which makes interfacing to Ada a breeze. If you do not want to do this for some reason, simple write the subprogram definition (and any variable you need) in Ada with a null body, and have it generate assembler for it (see my tutorial on how to do this). Then either fill in the body with you own code converted to AT&T syntax, or use the generated assembler code as an template on how to interface to Ada directly from NASM. Hope this helps, Jerry. -- -- Jerry van Dijk, Leiden, Holland -- Note that email address is invalid