43
2.5 Word Alignment
2.5 Word Alignment

Since instructions and data are accessed in bytes, mapping addresses va ry depending

on instruction length or data width.

■Program Access
A program running in the FR series must be placed at an address consisting of a multip le of
two.
Bit 0 of the program counter (PC) is set to 0 when the PC is updated acc ording to instruction
execution. Bit 0 may be set to 1 only when an odd-numbered address is specified for the
branch destination address. Even at this event, bit 0 is invalid an d an instruction must be
placed at an address consisting of a multiple of two.
No odd-numbered address exception occurs.
■Data Access
When data access is made in the FR series, address alignment is performed forcibly in
accordance with access width as follows:
• Word acc ess: Addresses are aligned in multiples of four (the two least significant bits are
forcibly set to 00).
• Half-word ac cess: Addresses are aligned in multiples of two (on least significant bit is
forcibly set to 0).
• Byte ac cess: -
As explained above, some bits are forcibly set to 0 when a word or half-word data access is
made, but this is applicable only to the calculation result of an effectiv e address. For inst ance,
in @(R13, Ri) addressing mode, the register be fore ad dit ion i s us ed a s is for ca lc ula tio n (e ve n if
the least significant bit is 1), and the least significant bit of the result of addition is masked.
Thus, the register before calculation is not masked.
[Example] LD @(R13, R2), R0
R13
R2
00002222H
00000003H
00002225H
00002224H
Result of addition
Address pin
Forced masking of two LSBs