Big endian and little endian
Big endian and little endian are different ways for CPUs to process the number of multi-word segments. For example, the Unicode code of the Chinese character is 6c49. When I write a file, do I write 6C in front or 49 in front? If you write 6C in front, it is big endian. Write 49 in front, that is, little endian.
The word "endian" comes from Gulliver Travel Notes. The civil war in the minor people's country originated from the fact that the big-Endian attack or the little-Endian attack were initiated when the eggs were eaten. As a result, there were six rebels, one of the emperors gave life and the other lost the throne.
We generally translate endian into byte order, and call Big endian and little endian "Big tail" and "Small Tail ".
Big-Endian: a wordHighByte is placed at the lowest address of the word in the memory segment.
Little-Endian: a wordLow LevelByte is placed in the lowest address of the word in the memory segment)
The so-called Big-end mode stores low data points in the high address of the memory, while the high data points are stored in the low address of the memory. The so-called small-end Mode, is the low position of the index data stored in the low address of the memory, and the high position of the data is stored in the high address of the memory
Short int X;
Char x0, x1;
X = 0x1122;
X0 = (char *) & X) [0]; // low address Unit
X1 = (char *) & X) [1]; // high address Unit
If X0 = 0x11, it is a large end. If X0 = 0x22, it is a small end ......