LAPIS Semiconductor ML62Q1000 Series User Manual page 242

Table of Contents

Advertisement

B-2: When a subroutine is called in an interrupt routine
• When the script is written in the assembly language
• Processing immediately after the start of interrupt routine execution
Specify "PUSH ELR, EPSW, LR" to save the interrupt return address, the subroutine return address, and
EPSW status in the stack.
• Processing at the end of interrupt routine execution
Specify "POP PSW, PC, LR" to return the saved data of the interrupt return address to PC, the saved data of
EPSW to PSW, and the saved data of LR to LR.
• Description for C language
Define the interrupt routine by using INTERRUPT pragma and specify "2" in the category field. The C compiler
(CCU8) generates the proper codes.
Example of description:
Status B-2
For assembly language:
Intrpt_B-2;
PUSH ELR, EPSW, LR
:
:
BL Sub_1
:
POP PSW, PC, LR
For C language:
static void Intrpt_B_2(void);
#pragma interrupt Intrpt_B_2 0x08 2
static void Intrpt_B_2(void)
{
:
Sub_1();
:
}
FEUL62Q1000
; Start
; Save ELR, EPSW, and LR at
the beginning
; Call subroutine Sub_1
; Return PC from the stack
; Return PSW from the stack
; Return LR from the stack
; End
/* Call subroutine Sub_1 */
/* End of interrupt routine */
ML62Q1000 Series User's Manual
Chapter 5 Interrupts
Sub_1;
:
RT
; Return PC from LR
; End of subroutine
void Sub_1(void)
{
:
:
}
/* End of subroutine
*/
5-46

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents