Endianness
When reading or writing data to memory, we use the registers or memory to process them as BYTE, WORD, DWORD, or even QWORD. Depending on the platform or program, data is read in little-endian or big-endian form.
In little-endian, a chunk of data read into a DWORD is reversed. Let's take the following piece of data as an example:
AA BB CC DD
When the data on a file or memory looks like this, in little-endian format, it will be read as DDCCBBAAh in a DWORD value. This endianness is common to Windows applications.
In the big-endian system, the same chunk of data will be read as AABBCCDDh. The advantage of using the big-endian form arises when reading streaming data such as file, serial, and network streams.
The advantage of reading ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access