comp.lang.ada
 help / color / mirror / Atom feed
From: nickroberts@blueyonder.co.uk (Nick Roberts)
Subject: Re: Is this a GNAT bug???
Date: Wed, 01 May 2002 22:59:11 GMT
Date: 2002-05-01T22:59:11+00:00	[thread overview]
Message-ID: <3cd06b13.12244473@news.blueyonder.co.uk> (raw)
In-Reply-To: 3CCF12E9.6CA14A29@raytheon.com

On Tue, 30 Apr 2002 16:55:53 -0500, Mark Johnson
<mark_h_johnson@raytheon.com> wrote:

>Big endian (Bit_Order == System.High_Order_First)
>Byte 00000000 11111111 22222222 33333333 ...
>Bit  01234567 01234567 01234567 01234567 ...
>Ind  00000000 00111111 11112222 22222233
>-ex  01234567 89012345 67890123 45678901
>
>Little endian (Bit_Order == System.Low_Order_First)
>Byte 00000000 11111111 22222222 33333333 ...
>Bit  76543210 76543210 76543210 76543210 ...
>Ind  00000000 11111100 22221111 33222222
>-ex  76543210 54321098 32109876 10987654

My version of the above would be:

Big endian (Bit_Order == System.High_Order_First)
Byte   00000000 11111111 22222222 33333333 ...
Bit8V  76543210 76543210 76543210 76543210 ...
Bit8L  12345678 12345678 12345678 12345678 ...
Bit16H 00000000 01111111 00000000 01111111 ...
Bit16L 12345678 90123456 12345678 90123456 ...
Bit32H 00000000 01111111 11122222 22222233 ...
Bit32L 12345678 90123456 78901234 56789012 ...
Ind    00000000 00111111 11112222 22222233 ...
-ex    01234567 89012345 67890123 45678901 ...

Little endian (Bit_Order == System.Low_Order_First)
Byte   00000000 11111111 22222222 33333333 ...
Bit8V  76543210 76543210 76543210 76543210 ...
Bit8L  76543210 76543210 76543210 76543210 ...
Bit16H 00000000 11111100 00000000 11111100 ...
Bit16L 76543210 54321098 76543210 54321098 ...
Bit32H 00000000 11111100 22221111 33222222 ...
Bit32L 76543210 54321098 32109876 10987654 ...
Ind    00000000 11111100 22221111 33222222 ...
-ex    76543210 54321098 32109876 10987654 ...

where in both cases Bit8V n is defined as contributing 2^n to the
value of the byte as an unsigned integer (value 0 to 255).

I have added the rows Bit8L, Bit16H/L, and Bit32H/L to both cases,
which show what the conventional bit numbering would be on a machine
of the given endianness for a unsigned byte, 16-bit and 32-bit integer
in memory. (H is for the higher decimal digit, L for the lower.)

Am I actually correct?




  reply	other threads:[~2002-05-01 22:59 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-26 16:36 Is this a GNAT bug??? Robert Quinn
2002-04-26 17:48 ` Mark Johnson
2002-04-26 22:20   ` Robert Dewar
2002-04-29 15:45   ` Robert Quinn
2002-04-30  2:44     ` Robert Dewar
2002-04-30 14:15       ` Larry Kilgallen
2002-04-30 16:41       ` Robert Quinn
2002-04-30 18:20         ` tmoran
2002-05-01  1:31           ` Robert Quinn
2002-05-01 17:08             ` Ted Dennison
2002-05-02  1:55               ` Larry Kilgallen
2002-05-02 14:04                 ` Mark Johnson
2002-05-02 15:25                   ` Larry Kilgallen
2002-04-30 21:55         ` Mark Johnson
2002-05-01 22:59           ` Nick Roberts [this message]
2002-05-02 13:56             ` Mark Johnson
2002-05-02 20:19               ` Nick Roberts
2002-05-02 21:55                 ` Mark Johnson
  -- strict thread matches above, loose matches on Subject: below --
2003-09-20 22:50 Is this a gnat bug? Waldek Hebisch
2003-09-20 23:09 ` Ludovic Brenta
2003-09-21  2:37 ` Waldek Hebisch
replies disabled

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