
C165H
Interrupt and Trap Functions
Data Sheet
120
2001-04-19
PRELMNARY
Class B traps
are
Undefined Opcode
Protection Fault
Illegal Word Operand Access
Illegal Instruction Access
Illegal External Bus Access Trap
These traps share the same trap priority, and the same vector address.
The bit-addressable Trap Flag Register (TFR) allows a trap service routine to identify the
kind of trap which caused the exception. Each trap function is indicated by a separate
-EXCERPT-
The interrupt service routine called by a TRAP instruction must be terminated with a
RETI (return from interrupt) instruction to ensure correct operation.
Note:
The CPU level in register PSW is not modified by the TRAP instruction, so the
service routine is executed on the same priority level from which it was invoked.
Therefore, the service routine entered by the TRAP instruction can be interrupted
hardware trap.
Hardware Traps
Hardware traps are issued by faults or specific system states that occur during runtime
of a program (not identified at assembly time). A hardware trap may also be triggered
intentionally, eg. to emulate additional instructions by generating an Illegal Opcode trap.
The C165H distinguishes eight different hardware trap functions. When a hardware trap
condition has been detected, the CPU branches to the trap vector location for the
respective trap condition. Depending on the trap condition, the instruction which caused
the trap is either completed or cancelled (ie. it has no effect on the system state) before
the trap handling routine is entered.
Hardware traps are non-maskable and always have priority over every other CPU
activity. If several hardware trap conditions are detected within the same instruction
cycle, the highest priority trap is serviced (see table in section “Interrupt System
Structure”).
PSW, CSP (in segmentation mode), and IP are pushed on the internal system stack and
the CPU level in register PSW is set to the highest possible priority level (ie. level 15),
disabling all interrupts. The CSP is set to code segment zero, if segmentation is enabled.
A trap service routine must be terminated with the RETI instruction.
The eight hardware trap functions of the C165H are divided into two classes:
Class A traps
are
external Non-Maskable Interrupt (NMI)
Stack Overflow
Stack Underflow trap
These traps share the same trap priority, but have an individual vector address.