
Chapter 5
Interrupt Controller
V - 36
Interrupt Controller Operation
5.3.2
Interrupt Controller Operation
When the CPU accepts an interrupt, first the sequence automatically processed by hardware is executed; then, the
interrupt handler processing is processed by software, and the interrupt processing program starts up. The inter-
rupt processing sequence is described below.
■ Interrupt Sequence (Interrupt Processing by Hardware)
When an interrupt (except a reset interrupt) is accepted, a program branches to the address corresponding to the
interrupt factor or the address comprised of the interrupt vector address register. The processing listed below is
performed at the branch destination in order to judge the interrupt factor in further details.
■ Interrupt Sequence (Interrupt Processing by Interrupt Handler)
Step
Process
1
PC (return address) is saved onto the stack. (SP-4)
2
The contents of PSW are saved onto the stack. (SP-8)
3
The contents of PSW are updated. IE is cleared and the accepted interrupt level is set in IM2 to
IM0. (IM2 to IM0 are undefined during NMI.)
4
The contents of a stack pointer is updated. (SP-8
→SP)
5
A program branches to the address corresponding to the accepted interrupt factor or the
address comprised of the interrupt vector address register (IVARn).
Step
Process
Pre-processing
1
The contents of registers are saved. The registers are those used by the interrupt handler.
2
The interrupt group analysis is executed.
2-1
The interrupt acknowledge sequence is executed. Interrupt acknowledge is to read out the interrupt
accept group register (IAGR) in order to obtain the group number of the interrupt group with the
highest priority among the specified interrupt levels.
2-2
The leading address of the interrupt processing program for each level is created.
2-3
A program branches to the interrupt processing program for each level.
3
When there are multiple factors within the same group, the interrupt control register (GnICR) is read
out to specify the factor. During NMI, the factor is specified by accessing the G0ICR (NMICR)
directly without accessing the IAGR.
4
A program branches to the interrupt processing program for each factor. In addition, the store buffer
is used when writing data by the bus controller; therefore, when releasing the interrupt factor, read
the corresponding register immediately after the factor of the GnICR is cleared to wait the factor
cleared.
Interrupt processing
Interrupt processing program is executed.
Post-processing
5
The contents of the registers are restored. The restored registers are those saved by the pre-pro-
cessing.
6
The RTI instruction is executed and a program returns to the program before the interrupt.