|Technical Note||: SLE0004|
|Author||: Scott Evans|
|Description||: An explanation of byte ordering|
|The term byte ordering refers to the order in which a computer stores
bytes in memory. This document
describes the little endian and big endian byte ordering methods. The R3000 (Yaroze CPU) uses the
little endian method.
The hexadecimal number 0x1234 will occupy two bytes of memory.
Each hexadecimal digit can be
A big endian computer would store the number 0x1234 in memory
as follows, where A is a pointer to a
Starting with the leftmost byte of the number and working towards the
right. 0x12 will be stored at A
The same applies for larger numbers. A 32 bit number (4 bytes) 0x12345678
will be stored at address
A A+1 A+2
Little endian computers on the other hand use the opposite method to
big endian computers. The
This time we start with the rightmost byte of the number 0x34
and place this at address A. The next
It has the same byte ordering as a big endian computer storing the number 0x3412.
The number 0x12345678 will be stored as the number 0x78563412
on a big endian computer. So the
A A+1 A+2 A+3