comp.lang.ada
 help / color / mirror / Atom feed
From: Tucker Taft <stt@averstar.com>
Subject: Re: Representation Clause Bit Ordering
Date: 1999/07/09
Date: 1999-07-09T00:00:00+00:00	[thread overview]
Message-ID: <37860BA1.CF7E58B2@averstar.com> (raw)
In-Reply-To: FEI5r9.Iy7@news.boeing.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




       reply	other threads:[~1999-07-09  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <FEI5r9.Iy7@news.boeing.com>
1999-07-09  0:00 ` Tucker Taft [this message]
1999-07-09  0:00   ` Representation Clause Bit Ordering Samuel T. Harris
1999-09-08  0:00   ` Joe Wisniewski
1999-09-08  0:00     ` Peter Hermann
1999-09-08  0:00       ` Pat Rogers
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox