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: Tucker Taft Subject: Re: Representation Clause Bit Ordering Date: 1999/07/09 Message-ID: <37860BA1.CF7E58B2@averstar.com>#1/1 X-Deja-AN: 499115256 Content-Transfer-Encoding: 7bit Sender: news@inmet.camb.inmet.com (USENET news) X-Nntp-Posting-Host: houdini.burl.averstar.com References: Content-Type: text/plain; charset=us-ascii Organization: AverStar (formerly Intermetrics) Burlington, MA USA Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-07-09T00:00:00+00:00 List-Id: 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