Vitaly Vidmirov
Newcomer
Order of what? And why does it change?Eh? Big endian order typically reverses bytes within a word for the "convenience" of making them appear the same to a human reader but the memory order _does_ change as a result.
+00 11
+01 22
+02 33
+03 44
are placed in register as is
bit 0 ... 31
[11 22 33 44]
Imagine a bitfield data. With BE I can process it with big chunks of any width regardless of source data width.
MEM (4 consecutive bytes)
10110101 01010100 10110111 11110000
BE:
10110101 01010100 10110111 11110000
10110101 01010100 10110111 11110000 << 1
-------------------------------------------------------------------
01101010 10101001 01101111 11100001
LE:
11110000 10110111 01010100 10110101
11110000 10110111 01010100 10110101 << 1
--------
FAIL
You can't peek up a byte from the same address as word, but the order is still the same.What's worse is that memory order changes depending on the word size used.
Why should you do it anyway?
further little endian allows you to optimise by using wider word shifts if they're available without worring about the effect that word width has on memory order.
Look at the example above.
I don't actually care about bit ordering but I prefer BE =)