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!news2.google.com!proxad.net!news.cs.univ-paris8.fr!news.zanker.org!news.clara.net!wagner.news.clara.net!194.159.246.34.MISMATCH!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Bitordering? was Re: Bitmanipulation in Ada Date: 21 Aug 2004 17:54:07 +0100 Organization: Pushface Sender: simon@smaug.pushface.org Message-ID: References: <412665C4.E52A7590@alfred-hilscher.de> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1093107582 26786 62.49.19.209 (21 Aug 2004 16:59:42 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Sat, 21 Aug 2004 16:59:42 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Xref: g2news1.google.com comp.lang.ada:2913 Date: 2004-08-21T17:54:07+01:00 List-Id: Jim Rogers writes: > >> 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. > > It is undefined in an array. It can be defined in a record. I think you have to use pragma Pack before the boolean elements are packed into bits? I don't have a big-endian machine here, but I'm pretty sure that GNAT orders a packed boolean array as you would expect from System.Default_Bit_Order (I used it as a demonstration to the unbelievers that bit ordering actually matters!) -- Simon Wright 100% Ada, no bugs.