At the risk of starting a flame war, which choice have people really made with regard to Little-Endian vs. Big-Endian for those processors where it's a design choice (ARM, PowerPC,...)? I'm asking in the context of using such processors in embedded applications where compatibility with anything in the outside world is not a factor.
In this situation, why bother with it, since it is hard to imagine situations in which this really matters. In the unlikely situation that the order might be important in a special situation, I would suggest using the endianess in which your team has worked previously. This may help to avoid one or two errors during a large project.
Although the current specifications do not require any binary interfacing to the outside world, there is always a risk that in a future version such connections are needed. In these situations, remember to write the actual code that work with any endianess (e.g. explicitly using shifts, ORs and masks) to assemble and/or disassemble a string of bytes.
There is a slight advantage in little-endian: you can address the least significant part of a longer item with the same address as the original item.
In Intel 80x86 family, the lowest byte of a longword is in the same address as the longword, which most often is intuitively clear. This does not work in big-endian architectures.
Hex dumps are things of the 80s. However, I prefer little endian because of reasons previous stated except in communication applications where data normally comes over the wire in big endian format AND the CPU has a word length greater than 8 bits. Using big endian in communication applications avoids having to swap all the data.
Exactly! I recently switched from a long line of little-endian processors to the big-endian Coldfire. I spent too many years reading byte-oriented hex dumps and trying to reorder the bytes in my head.
OTOH big-endian has the advantage of immediate access to the sign bit, and the penalty of requiring an initial address calculation for most arithmetic operations.
--
A: Because it fouls the order in which people normally read text.
Q: Why is top-posting such a bad thing?
I do it all of the time, but I don't see having it at the same address as the longword as being any intuitively clearer. In fact, I find the opposite to be slightly more intuitive.
How about 4-bit processors? I am sure that I am not the only one here who like them... Any opinions about Big-Endian vs. Little-Endian when using multiple nybbles to make bytes?
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.