Exception Handling Interrupt - Fujitsu MB90420/5 (A) Series Hardware Manual

F2mc-16lx family 16-bit microcontrollers
Table of Contents

Advertisement

6.7 Exception Handling Interrupt

2
In the F
MC-16LX, an exception is handled by execution of undefined instruction. The exception handling is
basically the same as the interrupt processing.
instructions, exception is handled suspending normal processing. In general, exception handling occurs as a
result of an unexpected operation and is recommended to be used only at debugging and starting recovery
software.
n Exception handling interrupt
• Operation of exception handling
2
The F
MC-16XL treats all codes undefined in the instruction map as undefined instructions. When an
undefined instruction is executed, processing equivalent to the software interrupt "instruction "INT# 10" is
performed. At exception handling, the following processing is performed before branching the control to
the interrupt-processing routine:
– The A, DPR, ADB, DTB, PCB, PC and PS registers are saved in the system stack.
– The I flag of the condition code register (CCR) is cleared to 0 and mask the hardware interrupt.
– The S flag of the condition code register (CCR) is set to 1 and validate the system stack.
The value of the program counter (PC) saved in the stack is the address itself where the undefined
instructions are stored. For instruction codes of 2 bytes or more, the address is where codes that could
be identified as undefined are stored. When the type of exception factor needs to be determined in the
exception-handling routine, use this PC value.
• Return from exception handling
When returning from exception handling by the RETI instruction, the exception handling occurs again
because PC indicates an undefined instruction. Take measures such as performing software reset.
INTERRUPT
When an exception is detected at the boundary of
6-33

Advertisement

Table of Contents
loading

Table of Contents