Computer Instructions: Storage Order
In most computer architectures, every byte stored in main memory has its own address.
- This means that the CPU can easily retrieve any byte from RAM, instantly.
Many data structures, even integers, store more than 1 byte of data.
- For example, an int data type in C/C++ usually consists of 2 or 4 bytes.
The question is, in what order should we store the bytes: left-to-right, or right-to-left?
This kind of storage order is called Endianess (based on the word 'end'):
- On a big endian device, the bytes of a data type are stored left-to-right (or top to bottom.)
- On a little endian device, the bytes of a data type are stored right-to-left (or bottom to top.)