Connections To Little Endian Devices - Hitachi SH7095 Hardware User Manual

Table of Contents

Advertisement

Figure 7.4 8-Bit External Devices and Their Access Units (Ordinary)
7.3.2

Connections to Little Endian Devices

The SH7095 provides a conversion function in CS2 space for connection to and to maintain
program compatibility with devices that use little Endian (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 is shown in
figures 7.5 and 7.6. When sharing memory or the like with a little Endian bus master, the SH7095
connects D31–D24 to the least significant bytes of the other bus master and D7–D0 to the most
significant bytes, when the bus width is 32 bits. When the width is 16 bits, the SH7095 connects
D15–D8 to the least significant bytes of the other bus master and D7–D0 to the most significant
bytes.
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
programming or constants in the CS2 space. When instructions or data in other CS spaces are used
by transferring it to CS2 space with the SH7095, there is no problem because the SH7095 converts
the Endian. Programs that are designed for use with little Endian 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 and at address 0 in big Endian. It is possible to correctly execute a program written
for little Endian by allocating the program and constants to an area other than CS2 space and the
data area to CS2 space. Note that the SH7095 does not support little Endian mode for devices with
an 8-bit data bus width.
138 Hitachi

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents