Small byte order: (for example, x86 System) Low bytes of data are placed at a low address, for example, an integer of 0x12345678, in the memory
Distribution:
-----------
| 78 | xxxx_0000
-----------
| 56 | xxxx_0001
-----------
| 34 | xxxx_0002
-----------
| 12 | xxxx_0003
-----------
Little endian
Large byte order: (such as the PowerPC System) the low bytes of data are placed at the high address. For example, if an integer is 0x12345678
Distribution:
-----------
| 12 | xxxx_0000
-----------
| 34 | xxxx_0001
-----------
| 56 | xxxx_0002
-----------
| 78 | xxxx_0003
-----------
Big endian
For example, the following struct definition is available:
Typedef struct
{
Unsigned short rsvd: 4;/* rsvd0 .*/
Unsigned short tgid: 6;/* this is the group number .*/
Unsigned short index: 6;/* This is index for this COM use .*/
} My_struct;
1234 value = 0 X;
My_struct * P;
P = (my_struct *) & value;
(1) In a system with a small byte order, its distribution is as follows:
15 10 | 9 4 | 3 0
---------------------------------
| Index | tgid | rsvd |
---------------------------------
If the value is 0x1234, then:
0001 0010 0011 0100
Rsvd: 0x04
Tgid: 0x23
Index: 0x04
(2) In a large byte ordering system, its distribution is as follows:
15 12 | 11 6 | 5 0
--------------------------------
| Rsvd | tgid | index |
--------------------------------
If the value is 0x1234, then:
0001 0010 0011 0100
Rsvd: 0x01
Tgid: 0x08
Index: 0x34