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-Thread: 103376,9dec3ff1604723d9 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!feed.news.tiscali.de!newsfeed01.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail From: Alfred Hilscher Newsgroups: comp.lang.ada Subject: Re: Bitordering? was Re: Bitmanipulation in Ada Date: Mon, 23 Aug 2004 20:36:47 +0200 Organization: T-Online Message-ID: <412A393F.FF0CB5ED@alfred-hilscher.de> References: <412665C4.E52A7590@alfred-hilscher.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.t-online.com 1093286585 00 4455 R9OYXt8lSgfbSDiW 040823 18:43:05 X-Complaints-To: usenet-abuse@t-online.de X-ID: Eq-VnBZJZeq5p1jB8-zcY15fN7-6mUc6NcR6rucZdcyYdUch8ZItsQ X-Mailer: Mozilla 4.75 [de] (WinNT; U) X-Accept-Language: de Xref: g2news1.google.com comp.lang.ada:2937 Date: 2004-08-23T20:36:47+02:00 List-Id: Georg Bauhaus schrieb: > > Nick Roberts wrote: > : On Fri, 20 Aug 2004 22:57:40 +0200, Alfred Hilscher > : wrote: > : > :> When I declare an boolean array with eight elements 1..8 (e.g. to > :> address a hardware port with eight status bits), how are they > :> ordered is X(1) the msb or the lsb of the byte? > : > : It is undefined. > : > : The typical way to deal with this kind of situation is to use a > : record type with a record representation clause. For example: > > [...] > > You might also be interested in the Bit Order paper by Norman Cohen > available in the grab bag at http://www.ada-auth.org > > -- Georg Very interessting. Thanks. I worked in the range of telecommunication (with CHILL) and our compiler had directives (pragmas) to tell him which variable should be treated as big-endian, bzw little endian. In the case of mixed expressions, the compiler generated code to change the representation. This siplyfied the code in some situations. ----------------------------------------------------- To send me mail, please replace "Spam" by "Jedermann" -----------------------------------------------------