123
CPU System Functions
Chapter 3
Preliminary User’s Manual U17566EE1V2UM00
3.5.2
Recommended use of data address space
When accessing operand data in the data space, one register has to be used
for address generation. This register is called pointer register. With relative
addressing, an instruction can access operand data at all addresses that lie in
the range of ±32 KB relative to the address in the pointer register.
By this offset addressing method load/store instructions can be
accommodated in a single 32-bit instruction word, resulting in faster program
execution and smaller code size.
To enhance the efficiency of using the pointer in consideration of the memory
map, the following is recommended:
For efficient use of the relative addressing feature, the data segments should
be located in the address range FFFF F800
H
to 0000 0000
H
and 0000 0000
H
to 0000 7FFF
H
. The peripheral I/O registers and the internal RAM is aligned to
the upper bound, thus the registers and a part of the RAM can be addressed
via relative addressing, with base address 0 (r0).
It is recommended to locate flash memory data segments in the area up to
0000 7FFF
H
, so access to these constant data can utilize also relative
addressing.
Use the r0 register as pointer register for operand addressing. Since the r0
register is fixed to zero by hardware, it can be used as a pointer register and, at
the same time, for any other purposes, where a zero register is required. Thus,
no other general purpose register has to be reserved as pointer register.
Figure 3-7
Example application of wrap-around
0000 7FFFH
(r0=)0000 0000H
Intern
a
l fl
as
h
a
re
a
Fixed
peripher
a
l I/O
a
re
a
FFFF F000H
FFFF EFFFH
FFFF 8000H
Intern
a
l RAM
a
re
a
(4 KB)
(2
8
KB)
(1 MB)
Intern
a
l RAM
a
re
a
(
3
2 KB)
FFFF 0000H
FFFF 7FFFH
-
3
2 KB
+
3
2 KB
electronic components distributor