2008-01-30

简练的解释

What is low/high-endianess?

All CPUs are generally divided into several classes, depending on how they store data in memory. While there are some very peculiar specimens, most CPUs fall into one of two classes:
High-endian CPUs will store data so that higher bytes of a word always occur first in memory. For example, if you store 0x12345678 on such CPU, the memory will look like this:
                       0  1  2  3               
+--+--+--+--+
|12|34|56|78|
+--+--+--+--+
Low-endian CPUs will store data so that lower bytes of a word always occur first in memory. The example from above will look quite differently on such CPU:
                       0  1  2  3
+--+--+--+--+
|78|56|34|12|
+--+--+--+--+