Note 552464 - What is Big Endian / Little Endian? What Endian do I have?


Summary
Symptom
--additional information only--
Other terms
Unicode, UTF-16, 4102, 4103, MSB, LSB
Solution
Big Endian:
the most significant byte is stored in memory at the lowest address, and the least significant byte at the highest address. (The big end comes first.)  As an analogy, we say "twenty-four" in English; the more significant number, twenty, comes first.
This is also called most significant byte (MSB) ordering.
Little Endian:
the least significant byte of the number is stored in memory at the lowest address, and the most significant byte at the highest address. (The little end comes first.) As an analogy, we say "fourteen" in English; the less significant number, four, comes first.
This is also called least significant byte (LSB) ordering.

For example, 0xAABBCCDD would be stored as follows:

    +--------------------------------------+
    | Address | Big-Endian | Little-Endian |
    |--------------------------------------|
    |    3    |    DD      |      AA      |
    |    2    |    CC      |      BB      |
    |    1    |    BB      |      CC      |
    |    0    |    AA      |      DD      |
    +--------------------------------------+



When converting to Unicode, the export code page must correspond to
the endianness of the target system. More exactly speaking, the export code page should correspond to the endianess of the machine where the R3load import processes will run.

4103   Little Endian   Alpha, Intel X86 (and clones),
                      X86_64, Itanium (Windows+Linux),
                      Solaris_X86_64
4102   Big Endian      IBM 390, AS/400, PowerPC (AIX),
                      Linux on zSeries (S/390), Linux on Power,
                      Solaris_SPARC, HP PA-RISC, Itanium (HP-UX)

To determine the processor architecture on Unix systems the command uname gives information. Please match this with one of the endianness classes above. Note that:
  • some Operating Systems run on different architectures.
  • the uname options giving platform information differ between Unices.
  • different platforms may employ the same processor architecture with different endianness; Itanium is an example, cf the list above.
Here are some examples:
unameuname optionoutput
AIX-ppowerpc
HP-UX-m9000/... , i.e. PA-RISC
HP-UX-mia64
Linux-mi686
Linux-px86_64
Linux-pia64
Linux-pppc64
Linux-ps390x
OS/390
OSF/1-palpha
SunOS-psparc
SunOS-pi86pc

Nenhum comentário: