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=2.1 required=5.0 tests=BAYES_05,INVALID_DATE, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!bionet!ames!vsi1!wyse!mips!murphy From: murphy@mips.COM (Mike Murphy) Newsgroups: comp.lang.ada Subject: Re: Memory Access Question Message-ID: <24570@gumby.mips.COM> Date: 2 Aug 89 20:20:44 GMT References: <1372@crdgw1.crd.ge.com> <1706@unix.SRI.COM> <24171@gumby.mips.COM> <513@stdc01.UUCP> Reply-To: murphy@mips.COM (Mike Murphy) Organization: MIPS Computer Systems, Sunnyvale, CA List-Id: In article <513@stdc01.UUCP> walsh@stdc01.UUCP (Mike Walsh) writes: > In my experience, writing machine code insertions is not as trivial as > this posting makes it out to be. The project I worked on was and ARMY > contract and they wanted everything done in Ada. We were using the > Softech Ada86 Compiler and an Intel 80186. Softech provided the Machine > Code Package, but it was incomplete or erroneous. Plus anyone writing > machine code insertions had better be better than just average assembly > language programmer. IMHO it is better to write the routine in Assembly, > and pass an Address to the routine from the Ada caller, or just invoke > an Assembly Language routine from Ada.... It sounds to me like your problem was not with machine code but that your compiler provided a weak implementation of machine code. Machine code lets you access the full range of assembly language, plus (at least in Verdix-based implementations) allows you to access Ada objects from within machine code. So anything you can do in pure assembly language you can also do in machine code, plus you have added functionality. The ability to access Ada objects (parameters and global variables) is a definite advantage of machine code (admittedly this functionality does not have to be supported and is not in all implementations of machine code). Plus you can enhance performance by inlining machine code procedures, unlike assembly language routines that are linked in. > .... I also feel that a good Assembly Language Routine that is > well documented is much more maintainable than a peice of code written > in machine code insertions. Why? What's the difference between the two? -- -- Mike Murphy -- UUCP: sun!decwrl!mips!murphy -- AT&T: (408) 991-0438