CHAPTER 5 INTERRUPT/EXCEPTION PROCESSING FUNCTION
User’s Manual U13850EJ4V0UM
148
5.4.3 EP flag
The EP flag in PSW is a status flag used to indicate that exception processing is in progress. It is set when on
exception occurs, and the interrupt is disabled.
Figure 5-18. EP Flag (EP)
After reset: 00000020H
Symbol
31
8
7
6
5
4
3
2
1
0
PSW
0
NP
EP
ID SAT CY OV S
Z
EP
Exception processing
0
Exception processing is not in progress
1
Exception processing is in progress
5.5 Exception Trap
The exception trap is an interrupt that is requested when illegal execution of an instruction takes place. In the
V850/SB1 or V850/SB2, an illegal op code exception (ILGOP: ILeGal OPcode trap) is considered as an exception
trap.
• Illegal op code exception: Occurs if the sub op code field of an instruction to be executed next is not a valid op
code.
5.5.1 Illegal op code definition
An illegal op code is defined to be a 32-bit word with bits 5 to 10 being 111111B and bits 23 to 26 being 0011B to
1111B.
Figure 5-19. Illegal Op Code
15
16
17
23 22
x
21
x
20
x x x x x
x
x
x
x
x
x
x
x
x
x
1
1
1
1
1
1
x
x
x
x
x
27 26
31
0
4
5
10
11
12
13
1
1
1
1
0
to
1
0
1
x: don’t care
5.5.2 Operation
If an exception trap occurs, the CPU performs the following processing, and transfers control to the handler
routine:
(1) Saves the restored PC to EIPC.
(2) Saves the current PSW to EIPSW.
(3) Writes an exception code (0060H) to the lower 16 bits (EICC) of ECR.
(4) Sets the EP and ID bits of PSW.
(5) Loads the handler address (00000060H) for the exception trap routine to the PC, and transfers control.