213
Chapter 7
Interrupt/Exception Processing Function
Preliminary User’s Manual U14913EE1V0UM00
7.5 Software
Exception
A software exception is generated when the CPU executes the TRAP instruction, and can be always
acknowledged.
7.5.1 Operation
If a software exception 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 to the lower 16 bits (EICC) of ECR (interrupt source).
(4) Sets the EP and ID bits of the PSW.
(5) Sets the handler address (00000040H or 00000050H) corresponding to the software exception to
the PC, and transfers control.
Figure 7-20 illustrates the processing of a software exception.
Figure 7-20: Software Exception Processing
Note: TRAP Instruction Format: TRAP vector (the vector is a value from 0 to 1FH.)
The handler address is determined by the TRAP instruction’s operand (vector). If the vector is 0 to 0FH,
it becomes 00000040H, and if the vector is 10H to 1FH, it becomes 00000050H.
TRAP instruction
EIPC
EIPSW
ECR.EICC
PSW.EP
PSW.ID
PC
restored PC
PSW
exception code
1
1
handler address
CPU processing
Exception processing
Note
Summary of Contents for V850E/CA1 ATOMIC
Page 6: ...6 Preliminary User s Manual U14913EE1V0UM00 MEMO ...
Page 52: ...52 Preliminary User s Manual U14913EE1V0UM00 MEMO ...
Page 144: ...144 Preliminary User s Manual U14913EE1V0UM00 MEMO ...
Page 162: ...162 Preliminary User s Manual U14913EE1V0UM00 MEMO ...
Page 224: ...224 Preliminary User s Manual U14913EE1V0UM00 MEMO ...
Page 308: ...308 Preliminary User s Manual U14913EE1V0UM00 MEMO ...
Page 512: ...512 Preliminary User s Manual U14913EE1V0UM00 MEMO ...
Page 564: ...564 Preliminary User s Manual U14913EE1V0UM00 MEMO ...
Page 566: ...566 Preliminary User s Manual U14913EE1V0UM00 MEMO ...
Page 584: ...584 Preliminary User s Manual U14913EE1V0UM00 MEMO ...