Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Moderated > Re: Big Endian,...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 7 of 14 Topic 9587 of 9971
Post > Topic >>

Re: Big Endian, Little Endian.

by "clemd@[EMAIL PROTECTED] " <clemd@[EMAIL PROTECTED] > May 13, 2008 at 11:57 AM

On May 10, 1:08 pm, Sohail Somani <soh...@[EMAIL PROTECTED]
> wrote:
> cl...@[EMAIL PROTECTED]
 wrote:
> > On May 9, 8:25 pm, Le Chaud Lapin <jaibudu...@[EMAIL PROTECTED]
> wrote:
> >> Hi All,
>
> >> What header or compile-time trick allows one to determine the byte-
> >> order of target CPU?
>
> > Not possible. Depending on the CPU and the memory system, the byte
> > order may be dynamic, or it may vary among sections of memory. Or it
> > may be "mixed endian" (not strictly big or little), or have no
> > endianness.
>
> Wow. Do you have an example?

Dynamic: HP PA/RISC can switch endianness dynamically.

Vary among sections of memory: in the Intel i960CA, the endianness of
16 memory sections were individually selectable. I don't remember
whether they were dynamic.

Mixed endian: other posters have already mentioned the beloved PDP-11.
In addition to floating point being mixed endian, I recall that long
(32-bit) was also. But that was by software convention; I don't
remember any hardware sup****t for 32-bit integers.

No endianness: I don't have an example, but if all primitive datatypes
have the same size there will be no endianness. In C99 that would mean
that CHAR_BIT == 64 or more, so that the minimum size long long fits
into a single character.

One item to keep in mind: endianness relies on the ability to treat
part of an data item as an array of smaller data items. Many
instruction sets permit this on memory but not on registers. For those
systems it is the memory system and not the processor which has an
endianness. The i960CA example mentioned above is one such case.

-- 
      [ See http://www.gotw.ca/resources/clcm.htm
for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
 




 14 Posts in Topic:
Big Endian, Little Endian.
Le Chaud Lapin <jaibud  2008-05-09 21:25:48 
Re: Big Endian, Little Endian.
Sohail Somani <sohail@  2008-05-10 06:14:24 
Re: Big Endian, Little Endian.
"clemd@[EMAIL PROTEC  2008-05-10 06:14:27 
Re: Big Endian, Little Endian.
Sohail Somani <sohail@  2008-05-10 14:08:50 
Re: Big Endian, Little Endian.
"Bo Persson" &l  2008-05-11 09:46:25 
Re: Big Endian, Little Endian.
"Jonathan Thornburg   2008-05-11 09:46:15 
Re: Big Endian, Little Endian.
"clemd@[EMAIL PROTEC  2008-05-13 11:57:27 
Re: Big Endian, Little Endian.
Ronald Natalie <ron@[E  2008-05-13 21:07:16 
Re: Big Endian, Little Endian.
Andy Champ <no.way@[EM  2008-05-13 21:09:23 
Re: Big Endian, Little Endian.
Carl Barron <cbarron41  2008-05-13 21:11:36 
Re: Big Endian, Little Endian.
Greg Herlihy <greghe@[  2008-05-14 08:34:46 
Re: Big Endian, Little Endian.
=?ISO-8859-1?Q?Daniel_Kr=  2008-05-14 08:34:37 
Re: Big Endian, Little Endian.
Martin Bonner <martinf  2008-05-14 11:39:46 
Re: Big Endian, Little Endian.
Alex Shulgin <alex.shu  2008-05-14 17:52:05 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Sep 4 23:49:02 CDT 2008.