![](http://datasheet.mmic.net.cn/330000/MB90F562_datasheet_16437954/MB90F562_182.png)
158
CHAPTER 6 INTERRUPTS
MB90560 series
6.8
Exception Processing Interrupt
In the F
2
MC-16LX, the execution of an undefined instruction results in exception
processing.
Exception processing is basically the same as an interrupt. When the generation of an
exception processing is detected on the instruction boundary, ordinary processing is
interrupted and exception processing is executed.
Generally, exception processing occurs as the result of an unexpected operation.
Exception processing should be used only to activate recovery software required for
debugging or an emergency.
I
Exception processing
G
Exception processing operation
The F
2
MC-16LX handles all codes that are not defined in the instruction map as undefined
instructions. When an undefined instruction is executed, processing equivalent to the INT #10
software interrupt instruction is executed.
The following processing is executed before exception processing branches to the interrupt
routine:
The A, DPR, ADB, DTB, PCB, PC, and PS registers are saved to the system stack.
The I flag of the condition code register (CCR) is cleared to 0, and hardware interrupts are
masked.
The S flag of the condition code register (CCR) is set to 1, and the system stack is activated.
The program counter (PC) value saved to the stack is the exact address where the undefined
instruction is stored. For 2-byte or longer instruction codes, the code identified as undefined is
stored at this address. When the exception factor type must be determined within the exception
processing routine, use this PC value.
G
Return from exception processing
When the RETI instruction returns control from exception processing, exception processing
restarts because the PC is pointing to the undefined instruction. Provide a solution such as
resetting the software.