Forums

Big-Endian vs. Little-Endian

Started by Everett M. Greene August 20, 2004
Paul Black <nospam@nospam.oxsemi.com> writes:
> David Brown wrote: > > "Paul Black" <nospam@nospam.oxsemi.com> wrote > > > Rene Tschaggelar wrote: > > > > > > > Usually the processor manufacturer made the choice for you > > > > by implementing the instruction set. Even for 8bit machines. > > > > > > You've missed the point that some processors can be used in > > > either big or little endian mode. > > > > Yes, but many of these have a prefererance for one mode. The PPC > > architecture, for example, perfers big-endian - some implementations (like > > the MPC56x) don't support little-endian at all, while those that do have > > certain restrictions - I believe the string instructions only function in > > big-endian mode, for example. > > The one I'm most familar with is the ARM where the endianness is set by > an external line.
Now that you're talking about the question I raised, which choice do people make when they have a free choice?
Bryan Hackney wrote:
> Everett M. Greene wrote: > > I say natural order - maybe that should be anthropic order. We read > numbers LtoR, MSD to LSD. >
Do you have troubles reading a UART stream from a scope then ? A minimum of flexibility is expectable from people working embedded... Rene -- Ing.Buero R.Tschaggelar - http://www.ibrtses.com & commercial newsgroups - http://www.talkto.net
On Mon, 23 Aug 2004 08:09:25 PST, mojaveg@mojaveg.iwvisp.com (Everett
M. Greene) wrote:

>Now that you're talking about the question I raised, which >choice do people make when they have a free choice?
The issue is so low down in the priority list that I can't imagine a situation where the endianness of the processor would make the difference, unless there was something in the application itself that made one choice or the other preferable for compatibility with other components of the system. -Robert Scott Ypsilanti, Michigan (Reply through this forum, not by direct e-mail to me, as automatic reply address is fake.)
Rene Tschaggelar wrote:
> Bryan Hackney wrote: > >> Everett M. Greene wrote: >> >> I say natural order - maybe that should be anthropic order. We read >> numbers LtoR, MSD to LSD. >> > > Do you have troubles reading a UART stream from a scope then ? > A minimum of flexibility is expectable from people working > embedded... > > Rene
Can you say "non sequitur"? -- ------------------------------------------------------------ Creepy, Soulless Gigolo for President ? NOT ! --------------------------------------------- THK is one weird, weird something.
Everett M. Greene wrote:

> Now that you're talking about the question I raised, which > choice do people make when they have a free choice?
Do processors with high end at the lower address tend to have a more regular instruction set than the reverse persuasion? I'm thinking of the Motorola mindset (6800, 6803, 6809 of blessed memory, 68000) v the nightmares of 8085/Z80/80x86. In the days when I used to write a lot of assembler, I know which ones I preferred! Paul Burke
On Mon, 23 Aug 2004 08:09:25 PST, mojaveg@mojaveg.iwvisp.com (Everett
M. Greene) wrote:

>Now that you're talking about the question I raised, which >choice do people make when they have a free choice?
The only application we've found where endianness might matter is for a comms stack where the protocol defines data to be in a particular (usually big-endian) format. In practice, this has very little impact on performance. For example, in a TCP/IP stack, checksum generation is far more important than the impact of endianness. Stephen -- Stephen Pelc, stephenXXX@INVALID.mpeltd.demon.co.uk MicroProcessor Engineering Ltd - More Real, Less Time 133 Hill Lane, Southampton SO15 5AF, England tel: +44 (0)23 8063 1441, fax: +44 (0)23 8033 9691 web: http://www.mpeltd.demon.co.uk - free VFX Forth downloads
On Mon, 23 Aug 2004 15:18:03 GMT, Bryan Hackney
<bh.remove@bhconsult.com> wrote:

>I say natural order - maybe that should be anthropic order. We read >numbers LtoR, MSD to LSD.
These numbers are from Arabic which is a right to left language. :-) Stephen -- Stephen Pelc, stephenXXX@INVALID.mpeltd.demon.co.uk MicroProcessor Engineering Ltd - More Real, Less Time 133 Hill Lane, Southampton SO15 5AF, England tel: +44 (0)23 8063 1441, fax: +44 (0)23 8033 9691 web: http://www.mpeltd.demon.co.uk - free VFX Forth downloads
Stephen Pelc wrote:
> On Mon, 23 Aug 2004 08:09:25 PST, mojaveg@mojaveg.iwvisp.com (Everett > M. Greene) wrote: > > >>Now that you're talking about the question I raised, which >>choice do people make when they have a free choice? > > > The only application we've found where endianness might matter > is for a comms stack where the protocol defines data to be in > a particular (usually big-endian) format.
And then there is the USB, which is little-endian. IIRC, at least one of the descriptors has unaligned members as well. -- Michael N. Moran (h) 770 516 7918 5009 Old Field Ct. (c) 678 521 5460 Kennesaw, GA, USA 30144 http://mnmoran.org "... abstractions save us time working, but they don't save us time learning." Joel Spolsky, The Law of Leaky Abstractions The Beatles were wrong: 1 & 1 & 1 is 1
"Everett M. Greene" wrote:

> Now that you're talking about the question I raised, which > choice do people make when they have a free choice?
The one that matches the byte-order of I/O devices, for example. -- Wil
On Tue, 24 Aug 2004 08:32:07 +0100, Paul Burke <paul@scazon.com>
wrote:

[...]
>Do processors with high end at the lower address tend to have a more >regular instruction set than the reverse persuasion? I'm thinking of the >Motorola mindset (6800, 6803, 6809 of blessed memory, 68000) v the >nightmares of 8085/Z80/80x86. In the days when I used to write a lot of >assembler, I know which ones I preferred!
The VAX was _very_ regular (too regular for its own good), and was little-endian. The AVR is little-endian. Regards, -=Dave -- Change is inevitable, progress is not.