int imm2
Function
Software exception
Standard)
Extension 1) Unusable
Extension 2) Unusable
15
Code
0
0
0
|
|
IE
C
V
Flag
|
|
0
–
–
Mode
Immediate data (unsigned)
CLK
Seven cycles
Description
Generates a software exception.
The int instruction saves the address of the next instruction and the contents of the PSR into the
stack, then reads the software exception vector from the trap table and sets it to the PC. By this
processing, the program flow branches to the specified software exception handler routine.
The C33 PE supports four types of software exceptions and the software exception number (0 to 3)
is specified by the 2-bit immediate imm2.
Software exception 0: 0
Software exception 1: 1
Software exception 2: 2
Software exception 3: 3
The Base is the trap table beginning address set in the TTBR register (default: 0xC00000).
The reti instruction should be used for return from the handler routine.
Example
int
2
S1C33 FAMILY C33 PE CORE MANUAL
sp ← sp - 4, W[sp] ← pc + 2, sp ← sp - 4, W[sp] ← psr,
pc ← Software exception vector
12 11
8
7
|
|
0
0
1
0
0
1
0
|
|
|
|
|
Z
N
|
|
–
–
imm2
Vector address
Base + 48
Base + 52
Base + 56
Base + 60
; Executes the software exception 2 handler routine.
4
3
2
1
0
|
|
0
0
0
0 imm2
|
|
|
|
EPSON
7 DETAILS OF INSTRUCTIONS
0x048_
79