11
CHAPTER 2 MEMORY ARCHITECTURE
2.3 Word Alignment
In the FR family, the type of data length used determines restrictions on the
designation of memory addresses (word alignment).
■ Program Restrictions on Word Alignment
When using half-word instruction length, memory addresses must be accessed in multiples of two. With
branching instructions and other instructions that may result in attempting to store odd numbered values to
the "PC", the lowest value in the "PC" will be read as "0". Thus an even numbered address will always be
generated by fetching a branching instruction.
■ Data Restrictions on Word Alignment
● Word data
Data must be assigned to addresses that are multiples of 4. Even if the operand value is not a multiple of 4,
the lower two bits of the memory address will explicitly be read as "0".
● Half-word data
Data must be assigned to addresses that are multiples of 2. Even if the operand value is not a multiple of 2,
the lowest bit of the memory address will explicitly be read as "0".
● Byte data
There are no restrictions on addresses.
The forced setting of some bits to "0" during memory access for word data and half-word data is applied
after the computation of the execution address, not at the source of the address information.
Figure 2.3-1 shows an example of the program-word boundary and data-word boundary.
Figure 2.3-1 Example of Program-word Boundary and Data-word Boundary
CDEFH
89ABH
CDEFH
ST R13,@(R14,4)
STH R13,@R2
STB R13,@R1
EF
H
0000 0000H
1234 5678H
12345678H
1234 567AH
43215679H
1234 567CH
4321 567AH
4321 567CH
4321 567EH
4321 5678H
4321567BH
FFFF FFFFH
R10
12345679
H
JMP @R10 : Bit 0 = 0
as it is
Bit 0 = 0
PC
R1
R2
4321567B
H
89ABCDEFH
R14
R13
4321567B
H
00000004H
4321567FH
4321567CH
Bits 1, 0 = 0
+
Memory space