English
Language : 

M16C80 Datasheet, PDF (88/358 Pages) Renesas Technology Corp – RENESAS 16-BIT SINGLE-CHIP MICROCOMPUTER M16C FAMILY / M16C/80 SERIES
M16C/80 Group
9. Interrupt Outline
Example 5)
If rewriting the interrupt control register for interrupt B with the interrupt A routine and enabling multiple
interrupts with interrupt C, the above processing is required at the end of the interrupt A and interrupt
C routines.
Interrupt A routine
Interrupt_A:
pushm R0,R1,R2,R3,A0,A1
••••
bclr 3,TA0IC
••••
popm R0,R1,R2,R3,A0,A1
fclr U
pushm R0
mov.w 6[SP],R0
ldc R0,FLG
popm R0
nop
reit
; Store registers
; Rewrite interrupt control register of interrupt B
; Restore registers
; Select ISP (Unnecessary if the ISP has been selected)
; Store R0 register
; Read FLG on stack
; Set in FLG
; Restore R0 register
; Dummy
; Interrupt completed
Interrupt C routine
Interrupt_C:
pushm R0,R1,R2,R3,A0,A1
fset I
••••
••••
popm R0,R1,R2,R3,A0,A1
fclr U
pushm R0
mov.w 6[SP],R0
ldc R0,FLG
popm R0
nop
reit
; Store registers
; Multiple interrupt enabled
;Restore registers
; Select ISP (Unnecessary if the ISP has been selected)
; Store R0 register
; Read FLG on stack
; Set in FLG
; Restore R0 register
; Dummy
; Interrupt completed
Rev.1.00 Aug. 02, 2005 Page 77 of 329
REJ09B0187-0100