English
Language : 

SH7604 Datasheet, PDF (166/633 Pages) Hitachi Semiconductor – Hardware Manual
7.3.2 Connection to Little-Endian Devices
The SH7604 provides a conversion function in CS2 space for connection to and to maintain
program compatibility with devices that use little-endian format (in which the LSB is the 0
position in the byte data lineup). When the endian specification bit of BCR1 is set to 1, CS2 space
is little-endian. The relationship between device data width and access unit for little-endian format
is shown in figures 7.5 and 7.6. When sharing memory or the like with a little-endian bus master,
the SH7604 connects D31–D24 to the least significant byte of the other bus master and D7–D0 to
the most significant byte, when the bus width is 32 bits. When the width is 16 bits, the SH7604
connects D15–D8 to the least significant byte of the other bus master and D7–D0 to the most
significant byte.
When support software like the compiler or linker does not support switching, the instruction code
and constants in the program do not become little-endian. For this reason, be careful not to place
program code or constants in the CS2 space. When instructions or data in other CS spaces are used
by transferring them to CS2 space with the SH7604, there is no problem because the SH7604
converts the endian format. Programs that are designed for use with little-endian format assume
that the LSB is stored in the lowest address. Even when a program written in a high-level language
like C is recompiled as is, it may not execute properly. The sign bit of signed 16-bit data at address
0 is stored at address 1 in little-endian format and at address 0 in big-endian format. It is possible
to correctly execute a program written for little-endian format by allocating the program and
constants to an area other than CS2 space and the data area to CS2 space. Note that the SH7604
does not support little-endian mode for devices with an 8-bit data bus width.
A26–A0 D31
000000 7
000001
000002
000003
000000 7
000002
000000 7
D23
0
7
0 15
0 15
D15
D7
0
7
8
7
8 23
0
7
0 15
16 31
D0 32-bit device data input/output pin
Byte read/write of address 0
Byte read/write of address 1
Byte read/write of address 2
0 Byte read/write of address 3
Word read/write of address 0
8 Word read/write of address 2
24 Longword read/write of address 0
Figure 7.5 32-Bit External Devices and Their Access Units (Little-Endian Format)
150