CHAPTER 4 SETTING METHODS
4.2 Vector
Table
Setting
In the vector table area, the program start address, which is used when branching occurs due to the generation of
resets and various interrupt requests, is stored.
In this sample program, interrupt servicing is not performed, so only the reset vector which is used during reset
start is set. This setting is required when coding in assembly language. When coding in C language, this setting is not
required, since the reset vector is automatically set in the startup routine.
For how to set the vector table and interrupts as well as setting examples, refer to “
External Interrupt Generated by Switch Input
”.
<R>
[Example 1]
Setting only the reset vector to be used during reset start (same as in the sample program setting)
XVCT CSEG AT
0000H
DW
RESET_START
;(00) RESET
DW
RESET_START
;(02)
--
DW
RESET_START
;(04)
--
DW
RESET_START
;(06)
INTLVI
DW
RESET_START
;(08)
INTP0
DW
RESET_START
;(0A)
INTP1
DW
RESET_START
;(0C)
INTTMH1
DW
RESET_START
;(0E)
INTTM000
DW
RESET_START
;(10)
INTTM010
DW
RESET_START
;(12)
INTAD
DW
RESET_START
;(14)
--
DW
RESET_START
;(16)
INTP2
DW
RESET_START
;(18)
INTP3
DW
RESET_START
;(1A)
INTTM80
DW
RESET_START
;(1C)
INTSRE6
DW
RESET_START
;(1E)
INTSR6
DW
RESET_START
;(20)
INTST6
After reset release, the program starts from the address (RESET_START at <1>, above) specified with the
reset vector.
In this sample program, vector table addresses except 0000H are not used. RESET_START is set to all
remaining vector table addresses, as with 0000H. By setting in this way, branching to RESET_START occurs,
even if an interrupt occurs, and the same processing as after reset release is performed.
<1>
Address
Function
name
[Column]
What are #pragma directives?
#pragma directives are preprocessing instructions which are used in the C language and are coded at the
beginning of source programs.
The following are major #pragma directives.
•
#pragma sfr:
Operations related to the SFR area can be described at the C source level.
•
#pragma ei:
The EI instruction can be described at the C source level.
•
#pragma di:
The DI instruction can be described at the C source level.
•
#pragma nop:
The NOP instruction can be described at the C source level. (The clock can be
advanced without operating the CPU.)
•
#pragma interrupt: Interrupt functions can be described at the C source level.
For details of the #pragma directives, refer to the chapter regarding expansion functions, in the
Application Note U18752EJ2V0AN
12