MOTOROLA
9-2
EXCEPTION PROCESSING
CPU16
REFERENCE MANUAL
9.3 Types of Exceptions
Exceptions can be either internally or externally generated. External exceptions, which
are defined as asynchronous, include interrupts, bus errors (BERR), breakpoints
(BKPT), and resets (RESET). Internal exceptions, which are defined as synchronous,
include the software interrupt (SWI) instruction, the background (BGND) instruction,
illegal instruction exceptions, and the divide-by-zero exception.
9.4 Exception Stack Frame
During exception processing, a subset of the current processor state is saved on the
current stack. Specifically, the contents of the program counter and condition code
register at the time exception processing begins are stacked at the location pointed to
by SK: SP. Unless specifically altered during exception processing, the stacked PK:
PC value is the address of the next instruction in the current instruction stream, plus
$0006.
Figure 9-1
shows the exception stack frame.
Figure 9-1 Exception Stack Frame Format
Table 9-1 Exception Vector Table
Vector
Number
0
Vector
Address
0000
0002
0004
0006
0008
000A
000C
000E
0010
0012 – 001C
001E
0020
0022
0024
0026
0028
002A
002C
002E
0030
0032 – 006E
0070 – 01FE
Address
Space
P
P
P
P
D
D
D
D
D
D
D
D
D
D
D
D
D
D
D
D
D
D
Type of
Exception
RESET — Initial ZK, SK, and PK
RESET — Initial PC
RESET — Initial SP
RESET — Initial IZ (Direct Page)
BKPT (Breakpoint)
BERR (Bus Error)
SWI (Software Interrupt)
Illegal Instruction
Division by Zero
Unassigned, Reserved
Uninitialized Interrupt
Unassigned, Reserved
Level 1 Interrupt Autovector
Level 2 Interrupt Autovector
Level 3 Interrupt Autovector
Level 4 Interrupt Autovector
Level 5 Interrupt Autovector
Level 6 Interrupt Autovector
Level 7 Interrupt Autovector
Spurious Interrupt
Unassigned, Reserved
User-defined Interrupts
4
5
6
7
8
9 – E
F
10
11
12
13
14
15
16
17
18
19 – 37
38 – FF
Low Address
SP After Exception Stacking
Condition Code Register
Program Counter
High Address
SP Before Exception Stacking
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.