comp.lang.ada
 help / color / mirror / Atom feed
From: "Joe Wisniewski" <wisniew@acm.org>
Subject: Re: Representation Clause Bit Ordering
Date: 1999/09/08
Date: 1999-09-08T00:00:00+00:00	[thread overview]
Message-ID: <rtbpctsqht59@corp.supernews.com> (raw)
In-Reply-To: 37860BA1.CF7E58B2@averstar.com

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






  parent reply	other threads:[~1999-09-08  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 ` Representation Clause Bit Ordering Tucker Taft
1999-07-09  0:00   ` Samuel T. Harris
1999-09-08  0:00   ` Joe Wisniewski [this message]
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