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.7 required=5.0 tests=BAYES_00,MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ac78eacbae7081a6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-09-06 05:50:40 PST Path: supernews.google.com!sn-xit-02!sn-east!sn-xit-03!supernews.com!newsfeed.axxsys.net!news.idt.net!xfer10.netnews.com!netnews.com!news.maxwell.syr.edu!nntp2.deja.com!nnrp1.deja.com!not-for-mail From: Robert Dewar Newsgroups: comp.lang.ada Subject: Re: asm in ada Date: Wed, 06 Sep 2000 12:41:25 GMT Organization: Deja.com - Before you buy. Message-ID: <8p5e1h$ai5$1@nnrp1.deja.com> References: NNTP-Posting-Host: 205.232.38.240 X-Article-Creation-Date: Wed Sep 06 12:41:25 2000 GMT X-Http-User-Agent: Mozilla/4.61 [en] (OS/2; I) X-Http-Proxy: 1.0 x55.deja.com:80 (Squid/1.1.22) for client 205.232.38.240 X-MyDeja-Info: XMYDJUIDrobert_dewar Xref: supernews.google.com comp.lang.ada:521 Date: 2000-09-06T12:41:25+00:00 List-Id: In article , "William J. Thomas" wrote: > If its the intel version, look for Machine_Operations_386. Its a real piece > of work, a real gem. > > "Etienne" wrote in message > news:Ihps5.149$xr6.264251@nnrp6.proxad.net... > > Hello, > > I'd like to know if inserting asm code is possible in objectAda (how?) > > Thanks > > Etienne Well that's a nice note (the design of the Object Ada facility comes from my original design for Alsys Ada, back in the old days when I worked for Alsys). I agree it's a nice design :-) Note that nearly all compilers will provide a facility for either machine code insertions, or package machine code, since this is required by the systems programming annex which most Ada 95 compilers implement. However, the facility is in general VERY target dependent (except on the Motorola 88000 where interestingly the official system ABI dictated what package Machined_Code must look like for any Ada compiler for that system, at least so I am told :-) That means you have to look into the specific compiler documentation from the vendor. In the case of GNAT, for example, both package machine code and intrinsics are available, and they are based on interfacing directly with the internal register transfer language used by the compiler. This is a little complex, but has the advantage that the optimizer can fully deal with insertions, they can be inlined etc. Anyway, you have to go to the particular compiler in question for this information, and the resulting program is likely to be highly non-portable. It is often better to either try to avoid the use of ASM completely (it would be interesting to know why you are using it, so often there are ways to do what you want in Ada after all), or to write a small assembler routine (which surprisingly is likely to be more portable than writing asm inserts). Robert Dewar Sent via Deja.com http://www.deja.com/ Before you buy.