Byte Order

Byte Order


All data is memorized in the computer. The way to be memorized by the byte unit is called byte order. It depends on the type of the computer (strictly speaking, CPU).

There are two types of byte orders as follows:

  1. Big Endian - Data is stored in the order from the highest to the lowest as follows.

    integer 4 bytes data 12345678
    highestlowest
    12 34 56 78

    Data is stored in this way in SUN, HP, SGI and IBM Workstations.


  2. Little Endian - Data is stored in the order from the lowest to the highest as follows.

    integer 4 bytes data 12345678
    highestlowest
    78 56 34 12

    Data is stored in 80X86 type computers which are major in PC's.

You do not have to consider this difference when you use the same types of computers, but you have to take care of it when you use both two types of computers above.
When you use ASCII data, no problem occurs. But you have to consider byte order when you use binary data.


Swap Bytes


MicroAVS adopts XDR(External Data Representation) format (Big Endian in fact) which is standardized by IEEE in the reading of binary data.

Unfortunately byte order of data cannot be judged automatically by only reading the data. But if byte order is known, it can be converted.

Because byte swap parameter of MicroAVS is XDR (Big Endian) as default, MicroAVS tries to read as XDR format. If you turn XDR toggle off, it tries to read as native byte order. If you turn byte swap toggle on, it tries to read swapping byte order.



UP © 1998-2008 KGT Inc. All rights reserved.