From -3562947501313318533
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,738ae3371beb3408
X-Google-Attributes: gidf78e5,public
From: Steve Clamage <stephen.clamage@sun.com>
Subject: Re: portable method of determining endianness byte order.
Date: 1999/12/01
Message-ID: <38455F22.F7244F42@sun.com>#1/1
X-Deja-AN: 555406361
X-NNTP-Posting-Host: taumet.eng.sun.com
Content-Transfer-Encoding: 7bit
Approved: stephen.clamage@sun.com (comp.std.c++)
References: <38329967.470B6CED@hqs.mid.gmeds.com> <38359FF5.AB0B77E9@zetec.com> <t73dtnacpa.fsf@calumny.jyacc.com> <g1pNRNAk6GR4Ew21@robinton.demon.co.uk> <t7ln7e8spx.fsf@calumny.jyacc.com>
X-Accept-Language: en
X-UID: 0000000001
X-Status: $$$T
Content-Type: text/plain; charset=us-ascii
Organization: Sun Microsystems
Mime-Version: 1.0
Newsgroups: comp.std.c++
Originator: clamage@taumet


Hyman Rosen wrote:
> 
> Francis Glassborow <francis@robinton.demon.co.uk> writes:
> > Because no such method exists.  And why do you assume that it is a
> > simple two way choice?
> 
> If I recall correctly, the VAX had a mixed model for its 32-bit
> integers. I think the order for 0x12345678 was 34 12 78 56.
> 

No, integers on the VAX were strictly little-endian, but
floating-point numbers were neither big- nor little-endian.
The most significant byte was in the middle of the storage
area in memory. When you tranferred a floating-point value
between memory and a register, the bytes were arranged into
the appropriate order.

I did work on an ideosyncratic 16-bit system where 16-bit
values were little-endian and 32-bit values were stored
in the order you show above.

-- 
Steve Clamage, stephen.clamage@sun.com


[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]




