ST20-GP1
Trap groups encoding is shown in Table 4.4 below. These codes are used to identify trap groups to
various instructions.
Trap group
Breakpoint
CPU Errors
System operations
Scheduler
Code
0
1
2
3
Table 4.3 Trap group codes
In addition to the trap groups mentioned above, the CauseError flag in the Status register is used
to signal when a trap condition has been activated by the causeerror instruction. It can be used to
indicate when trap conditions have occurred due to the user setting them, rather than by the
system.
4.6.2 Events that can cause traps
Table 4.4 summarizes the events that can cause traps and gives the encoding of bits in the trap
Status and Enable words.
Trap cause
Status/Enable Trap Comments
codes
group
Breakpoint
0
0
When a process executes the breakpoint instruction (j0) then it traps
to its trap handler.
IntegerError
1
1
Integer error other than integer overflow – e.g. explicitly checked or
explicitly set error.
Overflow
2
1
Integer overflow or integer division by zero.
IllegalOpcode
3
2
Attempt to execute an illegal instruction. This is signalled when opr
(operate) is executed with an invalid operand.
LoadTrap
4
2
When the trap descriptor is read with the ldtraph (load trap handler)
instruction or when the trapped process status is read with the
ldtrapped (load trapped) instruction.
StoreTrap
5
2
When the trap descriptor is written with the sttraph (store trap handler)
instruction or when the trapped process status is written with the
sttrapped (store trapped) instruction.
InternalChannel
6
3
Scheduler trap from internal channel.
ExternalChannel
7
3
Scheduler trap from external channel.
Timer
8
3
Scheduler trap from timer alarm.
Timeslice
9
3
Scheduler trap from timeslice.
Run
10
3
Scheduler trap from runp (run process) or startp (start process).
Signal
11
3
Scheduler trap from signal.
ProcessInterrupt
12
3
Start executing a process at a new priority level.
QueueEmpty
13
3
Caused by no process active at a priority level.
CauseError
15 (Status only) Any, Signals that the causeerror instruction set the trap flag.
encoded
0-3
Table 4.4 Trap causes and Status/Enable codes
25/116
®