A.2.4 Executing a specific routine from RAM

If you wish to have specific routines in your program be executed from RAM, use the -rom option of the optimizing linker as in the procedure described below.

(1)

Allocate sections to addresses in ROM where you wish to place the routines and the corresponding addresses in RAM, respectively.

(2)

Prepare a separate routine for transfer that will lead to the following actions and include it in your program.

(2-1) Copy the target routines from the ROM sections to the corresponding RAM sections.

(2-2) Call the target routines from RAM.

(3)

In the process of building your program, run the optimizing linker with the following settings for such code.

(3-1) As parameter ROMsection of the -rom option, specify the name of the ROM section where the target

routine for copying is to be allocated.

(3-2) As parameter RAMsection of the -rom option, specify the name of the RAM section from which you wish

the target routine to be run.