Just to make sure if I understand this correctly. Is this right that little endian processors read the memory addresses from highest to the lowest address and where as a big endian processors suppose to read them from lowest to the highest address?
The confusion came when I thought that is it true that little endian processors read the data itself in the reserve order and not just the memory or anyway both?
I have read enough about how the data is laid out in the memory and I just want to know how does the data is interpreted by both kinds of processors?
3
“Is this right that little endian processors read the memory addresses
from highest to the lowest address and where as a big endian
processors suppose to read them from lowest to the highest address?”
No, that would just be an implementation detail of the memory chip, which would not make any difference for how you use the system.
In the little endian notation a multi-byte value is stored with the smallest components at the lowest address:
The number 0x12345678 stored at address 0x10:
+--+--+--+--+
|78|56|34|12|
+--+--+--+--+
^ ^
| |
0x10 0x13
In the big endian notation a multi-byte value is stored with the largest components at the lowest address:
+--+--+--+--+
|12|34|56|78|
+--+--+--+--+
^ ^
| |
0x10 0x13
Note that endianess doesn’t only apply to how data is read natively by the system. A file format stores multi-byte values in either of those notations, and if you read a file with little-endian notation on a system that uses big-endian notation, you have to swap the bytes around when you put the multi-byte values together.
2