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, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!sun-barr!rutgers!gatech!mcnc!rti!stdc01!walsh From: walsh@stdc01.UUCP (Mike Walsh) Newsgroups: comp.lang.ada Subject: Re: Memory Access Question Message-ID: <513@stdc01.UUCP> Date: 2 Aug 89 13:23:29 GMT References: <1372@crdgw1.crd.ge.com> <1706@unix.SRI.COM> <24171@gumby.mips.COM> Reply-To: walsh@stdc01.UUCP (Mike Walsh) Organization: Star Technologies, Graphicon Products Division (RTP, N.C) List-Id: >>Others have commented that you should write in assembler to >>do low-level memory accesses, but keep in mind that you don't >>really need to leave Ada to use assembly language: just use >>machine-code insertions! It's for this kind of application >>that Ada provides machine_code. Now if your compiler does not >>support machine code then you're out of luck, but a number of >>good Ada compilers do. >>-- >>-- Mike Murphy >>-- UUCP: sun!decwrl!mips!murphy >>-- AT&T: (408) 991-0438 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, since if the code needs to be protable, it is likely that the architecture of the machine that the porting is being done on is different from the original machine. Since the architecture is most likely different, the memory scheme is probably different. 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. BTW, machine code insertions are machine dependent anyway. ...Mike Mike Walsh, Electrical Engineer Star Technologies Graphicon Products Division P.O. Box 13951 Reserach Triangle Park, NC 27709 (919) 361-3800 walsh@stdc01.UUCP {...!uunet!mcnc!rti!stdc01!walsh}