All The Endian You Need To Know

All The Endian You Need To Know

Am I the only one who thinks of the Warner Brother’s cartoon Oily American when I hear big/little endian? You know, the cartoon with Moe Hican and his butler (“Your arrow, sir.”, “Your Thomas Hawk, sir.”) Maybe it’s just me.

Anyway, endian and Indian are two different things. I’m going to give the quick-and-dirty, all-you-need-to-know-in-2-minutes spiel here. For more than you ever wanted to know about endians, check out the wikipedia page.

It all has to do with ordering. Big endian is read left to right. Little endian is right to left. Let’s revisit our earlier disk image.

fat-first-36-hex-bytes.png

Consider the first 3 bytes, EB 58 90. In big endian, that’s it. EB 58 90. In little endian, it’s reversed so that we have 90 58 EB. Like I said, it all has to do with ordering.

Intel (x86, etc.), VAX and a few others use little endian. So for the most part, when you’re dealing with Microsoft disk images, you’re reversing stuff. Usually Motorola, which includes many Apple systems such as the PowerPC and 68000, uses big endian, so it’s straight left-to-right. However, be aware that Apple recently made the switch to Intel, so more recent Apple hardware is little endian.

It’s a pain in the butt and no one likes it, but it is what it is. What can I say? It’s one of the reasons we make the big bucks.

And for now, that’s all the endian you need to know.