comp.lang.ada
 help / color / mirror / Atom feed
From: "Warren W. Gay VE3WWG" <ve3wwg@home.com>
Subject: Re: Hi byte and Lo Byte Question
Date: Mon, 27 Aug 2001 16:33:36 GMT
Date: 2001-08-27T16:33:36+00:00	[thread overview]
Message-ID: <3B8A765E.3080702@home.com> (raw)
In-Reply-To: x7velq0k3ts.fsf@smaug.pushface.org

Simon Wright wrote:

> "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.


So this confirms my suspicion. It does not change the external
representation in any way, just gives you the facility to renumber
the bits, presumably for convenience or to specifically state what
bit ordering is assumed in the source code.

>   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.


Given that this is a "language mandated thing" (ARM 13.5.3), I
would not expect it to change.
-- 
Warren W. Gay VE3WWG
http://members.home.net/ve3wwg




  reply	other threads:[~2001-08-27 16:33 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
2001-08-27 16:33               ` Warren W. Gay VE3WWG [this message]
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