If it were a true comparison I would expect x01234578 to be stored as x876543210 rather than x78452301. I guess that's because I read next thinking of each hex digit independently, rather than 1 byte (2 hex digits) at a time.
Frank ________________________________ From: IBM Mainframe Discussion List <[email protected]> on behalf of John McKown <[email protected]> Sent: Thursday, June 15, 2017 7:33 PM To: [email protected] Subject: Re: RFE? xlc compile option for C integers to be "Intel compat" or Little-Endian On Thu, Jun 15, 2017 at 5:05 PM, Frank Swarbrick < [email protected]> wrote: > The following link gives a few reasons why little-endian might be > preferred: https://softwareengineering.stackexchange.com/questions/ [https://cdn.sstatic.net/Sites/softwareengineering/img/[email protected]?v=1ef7363febba]<https://softwareengineering.stackexchange.com/questions/> Newest Questions - Software Engineering Stack Exchange<https://softwareengineering.stackexchange.com/questions/> softwareengineering.stackexchange.com Q&A for professionals, academics, and students working within the systems development life cycle > 95556/what-is-the-advantage-of-little-endian-format. As a human I still > prefer big-endian, regardless of any perceived advantages for little-endian! > I must disagree with the "as a human" portion of the above. It is more a "as a speaker of a Western European language using Arabic numering" ( in UNICODE these are called "European digits") . We got our writing direction, left to right, from the Romans (I'm not sure where they got it). But we got our positional numbering system from the Hindus via the Arabs (thus the "Arabic Numerals"). We write the most significant digit on the left because they Arabs did it that way. But the Arab languages are written right to left. So, from their view point, they are reading the least significant digit first. I.e. Arabic Numerals are written "little endian" in Arabic. Europeans just wrote it the same physical direction because that's how they learned it. Using "little endian" is actually easier. How we do it now: 100 + 10 = 110. In our minds we must "align" the trailing digits (or the decimal point). But if it were written 001 + 01, you could just add the digits in the order in which we write them without "aligning" them in your mind. In the example, add the first two 0s together. Then add the second 0 & second 1. Finally "add" the last 1 just by writing it out. In a totally logical universe, the least significant digit (or bit if we are speaking binary) should be the first digit (or bit) encountered as we read. So the number one in an octet (aka byte) , in hex, would be written 0x10 or in binary as b'10000000'. And just to round out this totally off topic weirdness, we can all be glad that we don't write in boustrophedon style (switch directions every line) ref: http://wordinfo.info/unit/3362/ip:21 boustro- - Word Information <http://wordinfo.info/unit/3362/ip:21%E2%80%8B> wordinfo.info Greek: turning like oxen in plowing; alternate lines in opposite directions; zig-zag procedure > > > > Frank > > [https://cdn.sstatic.net/Sites/softwareengineering/img/ > [email protected]?v=1ef7363febba]<https://softwareengineering. > stackexchange.com/questions/95556/what-is-the-advantage- > of-little-endian-format> > > architecture - What is the advantage of little endian ...<https:// > softwareengineering.stackexchange.com/questions/ > 95556/what-is-the-advantage-of-little-endian-format> > softwareengineering.stackexchange.com > There are arguments either way, but one point is that in a little-endian > system, the address of a given value in memory, taken as a 32, 16, or 8 bit > width, is the same. > > -- Veni, Vidi, VISA: I came, I saw, I did a little shopping. Maranatha! <>< John McKown ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
