English
Language : 

CC78K4 Datasheet, PDF (340/523 Pages) NEC – CC78K4 Ver.2.30 or Later, C Compiler Language
(10) Interrupt functions
Interrupt Functions
CHAPTER 11 EXTENDED FUNCTIONS
#pragma vect
#pragma interrupt
FUNCTION
• The address of a described function name is registered to an interrupt vector table corresponding to a
specified interrupt request name.
• An interrupt function outputs a code to save or restore the following data (except that used in the ASM
statement) to or from the stack at the beginning and end of the function (after the code if a register bank is
specified).
(1) Registers
(2) saddr area for register variables
(3) saddr2 area for arguments/auto variables of norec function (regardless of whether the arguments or
variables are used)
Note, however, that depending on the specification or status of the interrupt function, saving/restoring is
performed differently, as follows.
• If no change is specified, codes that change the register bank or save/restore register contents, and that
save/restore the contents of the saddr2 area are not output regardless of whether the codes are used or not.
• If a register bank is specified, a code to select the specified register bank is output at the beginning of the
interrupt function, therefore the contents of the registers are not saved or restored.
• If “no change” is not specified and if a function is called in the interrupt function, however, the entire register
area is saved or restored, regardless of whether use of registers is specified or not.
• If the -QR option is not specified during compilation, the saddr2 area for register variables and the saddr2
area for the arguments/auto variables of the norec function is not used; therefore, the saved/restored code is
not output.
• If the size of the saved code is smaller than that of the restored code, the restored code is output.
• Table 11-26 summarizes the above and shows the save/restore area.
340
User’s Manual U15556EJ1V0UM