CHAPTER 5 INTERRUPT/EXCEPTION PROCESSING FUNCTION
122
5.4 Software Exception
A software exception is generated when the CPU executes the TRAP instruction, and can be always accepted.
• TRAP instruction format: TRAP vector (where vector is 0 to 1FH)
For details of the instruction function, refer to the V850 Family User’s Manual-Architecture.
5.4.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 PSW.
(5) Loads the handler address (00000040H or 00000050H) of the software exception routine in the PC, and trans-
fers control.
Figure 5-13 illustrates how a software exception is processed.
Figure 5-13. Software Exception Processing
TRAP instruction
EIPC
EIPSW
ECR.EICC
PSW.EP
PSW.ID
PC
restored PC
PSW
exception code
1
1
handler address
CPU processing
Exception processing
Handler address:
00000040H (Vector = 0nH)
00000050H (Vector = 1nH)
Summary of Contents for V850/SA1 mPD703015
Page 2: ...2 MEMO ...
Page 100: ...100 MEMO ...
Page 144: ...144 MEMO ...
Page 200: ...200 MEMO ...
Page 328: ...328 MEMO ...
Page 356: ...356 MEMO ...
Page 358: ...358 MEMO ...
Page 368: ...368 MEMO ...
Page 374: ...374 MEMO ...
Page 382: ...382 MEMO ...