< Compile Options / Microcontroller Options >
The constant area sections C, C_2, and C_1, the literal section L, and the switch statement branch table sections W, W_2, and W_1 are not handled as PID (position independent data).
The constant area sections C, C_2, and C_1, the literal section L, and the switch statement branch table sections W, W_2, and W_1 are handled as PID (position independent data). |
PID can be accessed through a relative address from the PID register. This allows PID to be located at a desired address after linkage. |
Based on the rules in the following table, one register from among R9 to R13 is selected according to the specification of the fint_register option. If the fint_register option is not specified, R13 is selected. |
The parameter selects the maximum bit width of the offset when accessing the constant area section from the PID register as 16 bits or 32 bits. |
The default for this option when the offset width is omitted is pid=16. When pid=16 is specified, the size of the constant area section that can be accessed by the PID register is limited to 64 Kbytes to 256 Kbytes (varies depending on the access width). When pid=32 is specified, there is no limitation of the size of the constant area section that can be accessed by the PID register, but the size of the code accessing PID is increased. |
Note that when pid=32 and the map option with valid external symbol-allocation information are specified at the same time, the allocation information causes code the same as if pid=16 was specified to be generated if access by the PID register is possible. |
[Without -pid] _func2: MOV.L #_ptr,R4 MOV.L #_pid,[R4] RTS [With -pid] (only when the PID register is R13) _func2: ADD #(_pid-__PID_TOP),R13,R5 MOV.L #_ptr,R4 MOV.L R5,[R4] RTS .glb __PID_TOP |
The address of an area which is PID should not be used in the initialization expression used for static initialization. If used, error E0523027 will occur. |
When creating a code for startup of the application program using the PID function, refer to Application Startup, instead of Startup. |
When the pid option is selected, the same external variables in different files all have to be const qualified. This is because the pid option is used to specify const qualified variables as PID. The pid option (PID function) should not be used when there may be an external variable that is not const qualified. |
If the map=<file name> option is enabled while the pid option is selected, warning W0530809 may be output when there is an externally referenced variable that is not const qualified but used in different files as the same external variable. In the case, the displayed variable is handled as PID. |
In C++ or EC++ compilation, the pid option cannot be selected. If selected, message W0511171 is output as a warning and the selection of the pid option is disabled. |
When the pid option is selected, base=rom=<register> cannot be selected. If selected, message W0551149 is output as a warning and the selection of base=rom=<register> is disabled. |
If a PID register selected by the pid option is also specified by the base option, warning W0511149 will occur. |
If the pid option and nouse_pid_register option are selected simultaneously, error E0511150 will occur. |