CPU16
REFERENCE MANUAL
EXCEPTION PROCESSING
MOTOROLA
9-15
9.7.2.2 Division By Zero
This exception is a part of the instruction definition for division instructions EDIV and
EDIVS. If the divisor is zero when either is executing, the exception is taken. In both
cases, exception processing follows the normal sequence, except that the PK : PC val-
ue is adjusted before it is stacked.
9.7.2.3 BGND Instruction
Execution of the BGND instruction differs depending upon whether background de-
bugging mode has been enabled. See
9.7.1.3 Breakpoint Exception (BKPT)
for in-
formation concerning enabling BDM.
1. If BDM has been enabled, BDM is entered. See
SECTION 10 DEVELOPMENT
SUPPORT
for more information concerning BDM.
2. If BDM is not enabled, an illegal instruction exception occurs. In this case, ex-
ception processing follows the normal sequence, except that the PK : PC value
is adjusted before it is stacked.
9.7.2.4 SWI Instruction
The software interrupt instruction initiates synchronous exception processing. Excep-
tion processing for SWI follows the normal sequence, except that the PK : PC value is
adjusted before it is stacked.
9.8 Return from Interrupt (RTI)
RTI must be the last instruction in all exception handlers except for the RESET han-
dler. RTI pulls the exception stack frame and restores processor state. Normal pro-
gram flow resumes at the address of the instruction that follows the last instruction
executed before exception processing began. RTI is not used in the RESET handler
because RESET initializes the stack pointer and does not create a stack frame.
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.