![NEC V850/SC1 Скачать руководство пользователя страница 246](http://html.mh-extra.com/html/nec/v850-sc1/v850-sc1_user-manual_248178246.webp)
CHAPTER 7 INTERRUPT/EXCEPTION PROCESSING FUNCTION
User’s Manual U15109EJ3V0UD
244
7.5 Exception Trap
The exception trap is an interrupt that is requested when the illegal execution of an instruction takes place. In the
V850/SC1, V850/SC2, and V850/SC3, 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.
7.5.1 Illegal op code definition
An illegal op code is defined to be a 32-bit word with bits 5 to 10 = 111111B and bits 23 to 26 = 0011B to 1111B.
Figure 7-13. 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
7.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 the PSW.
(5) Loads the handler address (00000060H) for the exception trap routine to the PC, and transfers control.
How the exception trap is processed is shown below.
Figure 7-14. Exception Trap Processing
Exception trap (ILGOP) occurs
EIPC
EIPSW
ECR.EICC
PSW.EP
PSW.ID
PC
restored PC
PSW
exception code
1
1
00000060H
CPU processing
Exception processing