I am using the CC-RL compiler for RL78 devices. Can I create an interrupt vector table in the way I describe below?
- The vector table address allocation is to be managed in a single file.
- The allocation is to be declared obviously.
In CC-RL V1.04.00 or later, use the .VECTOR directive.
_func1 .VECTOR 0x10
_func2 .VECTOR 0x12
_func3 .VECTOR 0x14
In CC-RL V1.03.00 or earlier, for the .VECTOR directive the symbol name must be defined in the same file.
Yes, you can create an interrupt vector table in the way you describe. Refer to the following instructions.
For the .VECTOR directive, the symbol names must be defined in the same file. For this reason, if you wish to define all of the interrupt vectors in one file and the interrupt processing in another file, you need to use the .DB2 directive.
Note that you need to make some of the settings by hand. The following is an example.
.SECTION .vect, AT 0x00XX ←Vector address
The items below are to be set by hand.
If you use the .VECTOR directive even once, you need to use it to define the vector area (0x00000 to 0x0007F) for interrupts.
In the startup routine cstart.asm, the interrupt vector area is defined by the .VECTOR directive relative to the reset vector. Delete (comment-out) this definition and define the area without using .VECTOR directive for the position where the vectors are initially gathered.
(Statement to be deleted)
If you specify the vector table with #pragma interrupt or the -DEBUG_MONITOR option of the linker, the output code will be a .VECTOR directive or equivalent. Do not use #pragma interrupt to specify the vector table.
Also, you need to arrange the code for 0xff relative to the address range of the monitor area instead of -DEBUG_MONITOR option.
Debug monitor areas: 0x0002 to 0x0003 and 0x00ce to 0x00d7
.SECTION ocdarea, AT 0x0002
.SECTION ocdarea, AT 0x00ce
|CS+ (formerly CubeSuite+)|
|C Compiler Package for RL78 Family|