Everything
2.8 Usage of PIC/PID Function

The PIC/PID function enables the code and data in the ROM to be reallocated to desired addresses without re-linkage even when the allocation addresses have been determined through previously completed linkage.

This section describes debugging of a program (load module) whose code or data has been converted into PIC or PID and reallocated to different addresses.

 

-

PIC

When the pic option is specified for compilation, the PIC function is enabled and the code in the code area becomes PIC. The PIC always uses PC relative mode to acquire branch destination addresses or function addresses, so it can be reallocated to any desired addresses even after linkage.

-

PIROD

When the pirod option is specified for compilation, the PIROD function is enabled and the data in constant data areas becomes PIROD. The PIROD always uses PC relative mode to acquire constant data accesses or addresses, so it can be reallocated to any desired addresses even after linkage.

-

PID

When the pid option is specified for compilation, the PID function is enabled and the data in data areas becomes PID.

The PID always uses GP or EP relative mode to acquire data accesses or addresses, so it can be reallocated to any desired addresses even after linkage.

 

Remark 1.

For details on the PIC/PID function, see "CC-RH Compiler User's Manual".

Remark 2.

For setting of the PIC/PID function by the build tool, see the description of the corresponding properties in "A. WINDOW REFERENCE" in "CS+ CC-RH Build Tool Operation".

 

To start debugging after changing the allocation of a load module whose code or data has been converted into PIC or PID, take the following steps.

(1)

Set conditions for downloading of the load module file

Specify the offset values ([PIC Offset], [PIROD Offset], or [PID Offset]) from the address of the load module when the load module is created in the code, constant data, or data areas.

(2)

Set a value for the load module file

When the address or offset value is read from memory while the load module is being executed from the reset vector or startup routine, set the value to be read in the target memory.

(3)

Download

Download the load-module file (see "2.6.1 Execute downloading").

Debugging of the code and data allocated to new addresses is now possible.