Erom, Storage specification for pointers – Zilog ZUSBOPTS User Manual
Page 187

UM017105-0511
Language Extensions
Zilog Developer Studio II – ZNEO™
User Manual
159
For example:
_Rom int ri; /* ri is placed in ROM address space */
_Erom
The variable with the
_Erom
storage specifier is allocated in 32-bit addressed internal or
external nonvolatile memory. This space corresponds to the EROM assembler address
space defined in the linker address space project settings. These variables lie within the
range extending from
00_8000
to the highest nonvolatile memory address.
For example:
_Erom int eri; /* eri is placed in EROM address space */
_Far
The variable with the
_Far
storage specifier is allocated in 32-bit addressed external vola-
tile (random access) memory. This space corresponds to the ERAM assembler address
space defined in the linker address space project settings. These variables lie within the
32-bit addressed range above the highest EROM address and below
FF_8000
.
For example:
_Far int fi; /* fi is placed in ERAM address space */
Storage Specification for Pointers
To properly access
_Near
,
_Far
,
_Rom
, and
_Erom
objects using a pointer, the compiler
provides the ability to associate the storage specifier with the pointer type.
•
_Near pointer
The _Near pointer points to
_Near
data.
•
_Far pointer
The _Far pointer points to
_Far
data.
•
_Rom pointer
The _Rom pointer points to
_Rom
data.
•
_Erom pointer
The _Erom pointer points to
_Erom
data.
For example:
char _Near * _Far npf;
// npf is a pointer to a _Near char, npf itself is stored in _Far
memory.