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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b77305e4038ca5a X-Google-Attributes: gid103376,public From: "Joe Wisniewski" Subject: Re: Representation Clause Bit Ordering Date: 1999/09/08 Message-ID: #1/1 X-Deja-AN: 522406781 References: <37860BA1.CF7E58B2@averstar.com> Organization: Posted via Supernews, http://www.supernews.com X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Newsgroups: comp.lang.ada X-Complaints-To: newsabuse@supernews.com Date: 1999-09-08T00:00:00+00:00 List-Id: OK, those of good long-term memories.... was it in Ada Letters about 4-5 years ago, there was a paper written about something very close to this issue; or an endian-ness independent approach for rep-specs, or something like this??????? Joe Tucker Taft wrote in message <37860BA1.CF7E58B2@averstar.com>... >Jeff Susanj wrote: >> >> We are trying to define records for an external device that is defined in >> fractional binary with 16 bit storage units (the leftmost bit is bit 0 and >> the rightmost bit is 15) and our processor is an integer binary machine with >> 32 bit storage units (the leftmost bit is bit 32 and the rightmost bit is >> 0). I believe there must be some way in Ada to define this and still be >> portable. > >The Bit_Order attribute is not designed for "flipping" >bits or bytes. It simply changes the numbering of bits >in a record rep clause. > >> ... We have tried using the 'Bit_Order attribute but with the >> High_Order_First our Green Hills compiler generates 32 bit data which seems >> consistant with the LRM but doesn't work for our application. Does anyone >> have any ideas? > >If you need to flip bits or bytes, you will need to do that yourself >manually. You can minimize mistakes by making the flipped-bit type >private, with operations for fetching/storing "normal" values into it. > >> Jeff Susanj > >-- >-Tucker Taft stt@averstar.com http://www.averstar.com/~stt/ >Technical Director, Distributed IT Solutions (www.averstar.com/tools) >AverStar (formerly Intermetrics, Inc.) Burlington, MA USA