![](http://datasheet.mmic.net.cn/380000/-PD98501_datasheet_16745028/-PD98501_262.png)
CHAPTER 3 SYSTEM CONTROLLER
262
Preliminary User’s Manual S14767EJ1V0UM00
Figure 3-1. Bit and Byte Order of Endian Modes
BYTE0
MSB
BYTE1
BYTE2
BYTE3
LSB
BYTE4
BYTE5
BYTE6
BYTE7
4
0
31
0
MSB = Most Significant Byte
LSB = Least Significant Byte
Big-Endian
Big End
Little End
BYTE3
MSB
BYTE2
BYTE1
BYTE0
LSB
BYTE7
BYTE6
BYTE5
BYTE4
4
0
31
0
Little-Endian
Big End
Little End
If the access type matches the data item type, no swapping of data sub-items is necessary. Thus, when making
half-word accesses into a data array consisting of halfword data, no byte-swapping takes place. In this case, data item
bit order is retained between the two endian modes. The code that sequentially accesses the half-word data array
would be identical, regardless of the endianness of its CPU. The code would be endian-independent.
Figure 3-2. Halfword Data-Array Example
A
HW3
Halfword
Data Array
Big-Endian
Data extraction using sequential halfword access
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
HW2
HW1
HW0
LSHW
MSHW
LSHW
MSHW
A
HW3
Little-Endian
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
HW2
HW1
HW0
LSHW
MSHW
LSHW
MSHW
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Order Retained
Data extraction using sequential halfword access
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Order Lost
However, when making half-word accesses into a data array consisting of word data, access to the more-
significant halfword requires the address corresponding to the less significant half word (and vice versa). Such code is
not endian-independent. A supergroup access (for example, accessing two half words simultaneously as a word from