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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d2cba5965c7bfcd5 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-03-03 14:55:20 PST Message-ID: <3C82A90D.1040801@users.sf.net> From: Dave Poirier User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.8) Gecko/20020204 X-Accept-Language: en-us MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: 64bit access to an array of 8bit values References: <3C823A1A.6030006@users.sf.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 03 Mar 2002 17:51:57 -0500 NNTP-Posting-Host: 65.94.42.23 X-Complaints-To: abuse@sympatico.ca X-Trace: news20.bellglobal.com 1015195917 65.94.42.23 (Sun, 03 Mar 2002 17:51:57 EST) NNTP-Posting-Date: Sun, 03 Mar 2002 17:51:57 EST Organization: Bell Sympatico Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!newsswitch.lcs.mit.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!sunqbc.risq.qc.ca!torn!webster!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail Xref: archiver1.google.com comp.lang.ada:20739 Date: 2002-03-03T17:51:57-05:00 List-Id: David C. Hoos, Sr. wrote: > How about something like this? > > with Ada.Text_IO; > with Interfaces; > procedure Test is > > type Ram_Range is range 0 .. 2 ** 12 -1; > > Ram : array (Ram_Range) of Interfaces.Unsigned_8; > > function Value (Index : Ram_Range) return Interfaces.Unsigned_8 > is > Result : Interfaces.Unsigned_8; > for Result'Address use Ram (Index)'Address; > begin > return Result; > end Value; > > function Value (Index : Ram_Range) return Interfaces.Unsigned_64 > is > Result : Interfaces.Unsigned_64; > for Result'Address use Ram (Index)'Address; > begin > return Result; > end Value; considering the issues mentioned by John R. Strohm about 48 bits processors and other weirdies, would that code works under all of them? It sure does look like an interesting, just wonder about portability.. Thanks for the suggestion, EKS - Dave Poirier