GMS81C5108
System clock
Instruction Fetch
Address Bus
SP-2
PSW
V.L.
V.H.
New PC
OP code
SP
SP-1
PC
Not used
PCH
PCL
V.L.
ADL
ADH
Data Bus
Internal Read
Internal Write
Interrupt Processing Step
Interrupt Service Routine
V.L. and V.H. are vector addresses.
ADL and ADH are start addresses of interrupt service routine as vector contents.
Figure 17-3 Timing chart of Interrupt Acceptance and Interrupt Return Instruction
The following method is used to save/restore the general-
Basic Interval Timer
Vector Table Address
purpose registers.
Entry Address
Example: Register saving
012
0FFFA
0FFFB
H
H
H
0E
2E
0E312
0E313
H
H
0E3
H
INTxx: PUSH
PUSH
A
X
Y
;SAVE ACC.
;SAVE X REG.
;SAVE Y REG.
H
H
PUSH
interrupt processing
Correspondence between vector table address for BIT interrupt
and the entry address of the interrupt service program.
POP
POP
POP
RETI
Y
X
A
;RESTORE Y REG.
;RESTORE X REG.
;RESTORE ACC.
;RETURN
An interrupt request is not accepted until the I-flag is set to
“1” even if a requested interrupt has higher priority than
that of the current interrupt being serviced.
General-purpose registers are saved or restored by using
push and pop instructions.
When nested interrupt service is required, the I-flag should
be set to “1” by “EI” instruction in the interrupt service
program. In this case, acceptable interrupt sources are se-
lectively enabled by the individual interrupt enable flags.
main routine
acceptance of
interrupt
interrupt
service routine
Saving/Restoring General-purpose Register
saving
registers
During interrupt acceptance processing, the program
counter and the program status word are automatically
saved on the stack, but accumulator and other registers are
not saved itself. If necessary, these registers should be
saved by the software. Also, when multiple interrupt ser-
vices are nested, it is necessary to avoid using the same
data memory area for saving registers.
restoring
registers
interrupt return
JUNE 2001 Ver 1.0
67