153
6.7 Exception Processing Interrupt
6.7
Exception Processing Interrupt
In the MB90560 and 565 series, exception processing occurs if an undefined
instruction is executed. Exception processing is basically the same as an interrupt.
When an exception occurs between instructions, program processing is interrupted
and the processing branches to the exception processing routine.
Exception processing, occurring due to an unexpected operation, can be used to
execute an undefined instruction and detect a CPU runaway status during debugging.
s Exception Processing
r Exception processing operation
In the MB90560 and 565 series, the processing branches to the exception processing routine if
an instruction undefined in the instruction map 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.
r Return from exception processing
If the RETI instruction is used to return control from exception processing, a branch to the
exception processing routine occurs again because the PC is pointing to an undefined
instruction. Use a software reset or input the "L" level from the RST pin (an external reset).