Data Format In Registers; Data Format In Memory - Hitachi SH7095 Hardware User Manual

Table of Contents

Advertisement

2.2.2

Data Format in Memory

Memory data formats are classified into bytes, words, and longwords. Byte data can be accessed
from any address, but an address error will occur if you try to access word data starting from an
address other than 2n or longword data starting from an address other than 4n. In such cases, the
data accessed cannot be guaranteed (figure 2.5). The hardware stack area, referred to by the
hardware stack pointer (SP, R15), uses only longword data starting from address 4n because this
area holds the program counter and status register. See the SH 7032/34 Hardware User Manual
for more information on address errors.
This microprocessor has a function that allows access of CSZ space (area 2) in little endian
format, which enables the microprocessor to share memory with processors that access memory in
little endian format. The microprocessor arranges byte data differently for little endian and the
more usual big endian format.
2.2.3
Immediate Data Format
Byte immediate data resides in an instruction code. Immediate data accessed by the MOV, ADD,
and CMP/EQ instructions is sign-extended and handled in registers as longword data. Immediate
data accessed by the TST, AND, OR, and XOR instructions is zero-extended and handled as
longword data. Consequently, AND instructions with immediate data always clear the upper 24
bits of the destination register.
Word or longword immediate data is not located in the instruction code: it is stored in a memory
table. An immediate data transfer instruction (MOV) accesses the memory table using the PC
Hitachi 16
Figure 2.4 Longword Operand
Figure 2.5 Byte, Word, and Longword Alignment

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents