CPU16
REFERENCE MANUAL
EXCEPTION PROCESSING
MOTOROLA
9-9
Note
If interrupt latency is a concern, it is best to lead interrupt service rou-
tines with a NOP instruction, rather than with an instruction that re-
quires considerable cycle time to execute, such as PSHM.
RESET, BERR, and BKPT exceptions that occur during exception processing of a pre-
vious exception will be processed before the first instruction of that exception's handler
routine. The converse is not true — if an interrupt occurs during BERR exception pro-
cessing, for example, the first instruction of the BERR handler will be executed before
interrupts are sensed. This permits the exception handler to mask interrupts during ex-
ecution.
9.7 Processing of Specific Exceptions
The following detailed discussion of exceptions is organized by type and priority. Prox-
imate causes of each exception are discussed, as are variations from the standard
processing sequence described above.
9.7.1 Asynchronous Exceptions
Asynchronous exceptions occur without reference to CPU16 or IMB clocks, but excep-
tion processing is synchronized. For all asynchronous exceptions besides RESET, ex-
ception processing begins at the first instruction boundary following detection of an
exception.
Because of pipelining, the stacked return PK : PC value for all asynchronous excep-
tions, other than RESET, is equal to the address of the next instruction in the current
instruction stream plus $0006. The RTI instruction, which must terminate all exception
handler routines, subtracts $0006 from the stacked value in order to resume execution
of the interrupted instruction stream.
9.7.1.1 Processor Reset (RESET)
RESET is the highest-priority exception. It provides for system initialization and for re-
covery from catastrophic failure. The RESET vector contains information necessary
for basic CPU16 initialization.
Figure 9-3
shows the RESET vector.
Figure 9-3 RESET Vector
RESET is caused by assertion of the IMB MSTRST signal. Conditions for assertion of
MSTRST may vary among members of the modular microcontroller family. Refer to
the appropriate microcontroller user's manual for details.
Address
$0000
$0002
$0004
$0006
15
12
11
8
7
4
3
0
Reserved
Initial ZK
Initial SK
Initial PK
Initial PC
Initial SP
Initial IZ (Direct Page Pointer)
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.