LWN.net Logo

Endian consistency

Endian consistency

Posted Mar 3, 2007 5:41 UTC (Sat) by ldo (subscriber, #40946)
In reply to: How an Accident of Hardware Design Encouraged Open Source (O'ReillyNet) by brouhaha
Parent article: How an Accident of Hardware Design Encouraged Open Source (O'ReillyNet)

IBM, on the other hand, uses consisten[t]ly big-endian numbering for both bits and bytes.

Actually, there is no completely consistent big-endian system. There are three different decisions to be made as far as endianness goes:

  • The ordering of bits in a byte.
  • The ordering of bytes in a multi-byte object.
  • The place value of binary digits making up an integer.

The IBM convention gets consistency among the first two, but not the third. The only way to get consistency among all three is to go little-endian.

Another point is that, even on big-endian architectures, registers tend to effectively be treated as little-endian--when you load/store quantities less than the full register size, you get the least-significant end of the register, not the most-significant end. Again, the only way to be completely consistent is to go little-endian.


(Log in to post comments)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds