2.1 CPU
36
Chapter 2: Hardware
Table 2.1.12 Interrupt Numbers and Interrupt Vectors
(3) Operation
Each internal resource with a hardware interrupt function has both an ‘interrupt request flag’ that
indicates whether an interrupt request has been made, and an ‘interrupt enable flag’ used to select
whether that circuit will send its interrupt signal to the CPU or not. Each interrupt request flag is set by
the occurrence of a particular event specific for internal resource, and if the interrupt enable flag has an
‘enable’ setting, the resulting interrupt request will then be set from the internal resource to the interrupt
controller.
The interrupt controller simultaneously compares each interrupt received with the interrupt level bit
(IL) in the interrupt control register (ICR), selects the highest-level interrupt (the one with the lowest IL
value) and notifies the CPU. If more than one interrupt with the same level is received, the lowest
interrupt number is given priority. For the relation between interrupt requests and ICR values, see
section 2.2.3 “Interrupt Vector Assignments.”
The CPU compares the level of the received interrupt with the ILM field in the processor status (PS)
register, and if the value of the interrupt level is less than the ILM setting and also the I flag in the PS
register has the value ‘1,’ then microcoding for interrupt processing will begin as soon as the currently
executing instruction is ended.
The top of the interrupt processing microcode references the ISE bit in the interrupt controller’s ICR
register, verifies that the value of that bit is ‘0’ (0=interrupt), and then starts the body of the interrupt
processing routine.
In interrupt processing, the 12 bytes in the A, DPR, ADB, DTB, PCB, PC and PS registers are saved to
the area of memory designated by the SSB and SSP registers, the contents of the 3-byte interrupt vector
is read and loaded into the PC and PCB register, the contents of the ILM field in the PS register are
updated to the level of the current interrupt request, the S flag is set to ‘1’ and CPU processing branches
to the interrupt routine.
The next instruction executed will be the interrupt processing program defined by the user.
Software
interrupt
instruction
Vector
address L
Vector
address M
Vector
address H
Mode
register
Interrupt
no.
Hardware interrupt
INT 0
FFFFFCH
FFFFFDH
FFFFFEH
Unused
#0
None
…
INT 7
FFFFE0H
FFFFE1H
FFFFE2H
Unused
#7
None
INT 8
FFFFDCH
FFFFDDH
FFFFDEH
FFFFDF
#8
(RESET vector)
INT 9
FFFFD8H
FFFFD9H
FFFFDAH
Unused
#9
None
INT 10
FFFFD4H
FFFFD5H
FFFFD6H
Unused
#10
<Exception>
INT 11
FFFFD0H
FFFFD1H
FFFFD2H
Unused
#11
Hardware interrupt #0
INT 12
FFFFCCH
FFFFCDH
FFFFCEH
Unused
#12
Hardware interrupt #1
INT 13
FFFFC8H
FFFFC9H
FFFFCAH
Unused
#13
Hardware interrupt #2
INT 14
FFFFC4H
FFFFC5H
FFFFC6H
Unused
#14
Hardware interrupt #3
…
INT 254
FFFC04H
FFFC05H
FFFC06H
Unused
#254
Unused
INT 255
FFFC00H
FFFC01H
FFFC02H
Unused
#255
<Stack fault>