View Single Post
Old 1st September 2013, 06:43 AM   #10
Gotta fill something here.
Miksy91's Avatar
Join Date: Jul 2013
Location: Northern Europe
Age: 27
Posts: 117

Originally Posted by karatekid552 View Post
Hmmm, it seems I had it backwards. So big endian is normal, and little endian is reversed. Either way, in the reversed format, the bits go from 15 to 0. That should make things easier.

In ARM, as far as I have seen, everything is stored in little endian. I haven't seen any numbers stored in big endian.

Thanks for you help!
You're welcome!
Though I won't let you go so easily with it just yet :P (since according to this comment, you possibly haven't caught the little-endian format just yet).

In big endian, bytes are in normal order. In little-endian bytes are in reversed order.
Bytes consists of 8 bits. In other words, bytes are 8-bit queues/sequences (don't know the right word in english so I picked up two that an internet wordbook gave me).

Now if we again think about a hexadecimal value xA7DF.

In big endian, it is represented as A7 DF.
1010 0111|1101 1111

In little-endian, it is represented as DF A7.
1101 1111|1010 0111

As you can see, bit 0 won't go to the place of bit 15 - it goes to the place of bit 8. That's because the order of the bytes (or 8-bit queues!) change - not the order of bits.
Miksy91 is offline