How to Save On-Chip Memory by Placing RTS Off-Chip
4-11
Linking Issues
Refer to section 4.4.1 to learn about the linker error messages when calls go
beyond the PC relative boundary.
4.2.6
Header File Details
Look at the file linkage.h in the include directory of the release. Depending on
the value of the _FAR_RTS macro, the macro _CODE_ACCESS is set to force
calls to RTS functions to be either user default, near, or far. The _FAR_RTS
macro is set according to the use of the –mr
n switch.
Table 4–3. How _FAR_RTS is Defined in Linkage.h With –mr
Option
Internal RTS calls
Normal RTS calls
_FAR_RTS
Default
Same as user
Same as user
Undefined
–mr0
Near
Near
0
–mr1
Far
Far
1
The _DATA_ACCESS macro is set to always be far.
The _IDECL macro determines how inline functions are declared.
All of the RTS header files which define functions or data include linkage.h
header file. Functions are modified with _CODE_ACCESS:
extern _CODE_ACCESS void exit(int _status);
and data is modified with _DATA_ACCESS:
extern _DATA_ACCESS unsigned char _ctypes_[];
4.2.7
Changing RTS Data to near
If for some reason you do not want accesses of RTS data to use the far access
method, take these steps:
-
Go to the include directory of the release.
-
Edit linkage.h, and change the:
#define _DATA_ACCESS far
macro to
#define _DATA_ACCESS near
to force all access of RTS data to use near access, or
change it to
#define _DATA_ACCESS