comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Hi byte and Lo Byte Question
Date: 25 Aug 2001 08:15:43 +0100
Date: 2001-08-25T07:15:43+00:00	[thread overview]
Message-ID: <x7velq0k3ts.fsf@smaug.pushface.org> (raw)
In-Reply-To: 3B8692DE.9000206@home.com

"Warren W. Gay VE3WWG" <ve3wwg@home.com> writes:

> Marin David Condic wrote:

> > What's wrong with ARM 13.5.3 Bit Ordering and using "for X'Bit_Order use
> > High_Order_First ;" and similar (Low_Order_First )? I'm pretty sure that
> > should work and do what you want - never needed to mess with it myself -
> > yet. (Day ain't over, yet!)
> 
> I had forgotten about that (and not used it yet).  But I was under
> the impression that it only affects the numbering of the bits -- not
> the actual implementation of the "word". I'll have to review it again.

From the 3.13p GNAT RM:

  In the case where the non-standard value is specified, the effect is
  to renumber bits within each bit, but the ordering of bytes is not
  affected.

  [...]

  Components occuping an integral number of bytes These are components
  that exactly fit in two or more bytes.  Such component declarations
  are allowed, but have no effect, since it is important to realize that
  the Bit_Order specification does not affect the ordering of bytes. In
  particular, the following attempt at getting an endian-indepedent
  integer does not work:

     type R2 is record
	A : Integer;
     end record;

     for R2'Bit_Order use High_Order_First;

     for R1 use record
	A at 0 range 0 .. 31;
     end record;

  This declaration will result in a little-endian integer on a
  little-endian machine, and a big-endian integer on a big-endian
  machine. if byte flipping is required for interoperability between
  big- and little-endian machines, this must be explicitly
  programmed. This capability is not provided by Bit_Order.

This doesn't appear to have changed at 3.14a1.



  reply	other threads:[~2001-08-25  7:15 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-22 14:48 Hi byte and Lo Byte Question mop
2001-08-22 15:56 ` Larry Kilgallen
2001-08-22 16:21 ` Ted Dennison
2001-08-22 23:11 ` Mark Johnson
2001-08-23  0:23   ` Darren New
2001-08-23 14:13     ` Mark Johnson
2001-08-23 17:15       ` Darren New
2001-08-24  0:00       ` Robert Dewar
2001-08-24  7:52         ` Martin Dowie
2001-08-23 14:43   ` Marin David Condic
2001-08-24  8:09     ` Peter Dulimov
2001-08-24 16:20       ` Warren W. Gay VE3WWG
2001-08-24 17:05         ` Marin David Condic
2001-08-24 17:46           ` Warren W. Gay VE3WWG
2001-08-25  7:15             ` Simon Wright [this message]
2001-08-27 16:33               ` Warren W. Gay VE3WWG
2001-08-23  1:26 ` DuckE
replies disabled

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