ST10R272L - INTERRUPT AND TRAP FUNCTIONS
96/320
6.5
Saving the status during interrupt service
Before an arbitrated interrupt request is serviced, the status of the current task is
automatically saved on the system stack. The CPU status (PSW) and the return location for
the current instruction are saved. The return location is specified by the Instruction Pointer
(IP) and, for a segmented memory model, the Code Segment Pointer (CSP). Bit SGTDIS in
the SYSCON register controls how the return location is stored.
The system stack receives the PSW first, followed by the IP (unsegmented) or followed by
CSP and then IP (segmented mode). This optimizes system stack use, if segmentation is
disabled.
The CPU priority field (ILVL in PSW) is updated with the priority of the interrupt request that
is to be serviced, so the CPU executes on the new level. If a multiplication or division is in
progress when the interrupt request is acknowledged, bit MULIP in the PSW register is set to
‘1’. In this case, the return location that is saved on the stack is not the next instruction in the
instruction flow, but rather the multiply or divide instruction itself, as this instruction has been
interrupted and will be completed after returning from the service routine.
The interrupt request flag of the source that is being serviced is cleared. The IP is loaded
with a vector associated to the requesting source (the CSP is cleared in case of
segmentation) and the first instruction of the service routine is fetched from the respective
vector location, which is expected to branch to the service routine itself. The data page
pointers and the context pointer are not affected.
8
X
X
X
X
Interrupt class-2: 10 sources on 3 levels
7
X
X
X
X
6
X
X
5
X
X
X
X
Interrupt class-3: 6 sources on 2 levels
4
X
X
3
2
1
0
No service!
ILVL
(Priority)
GLVL
Interpretation
3
2
1
0
Table 17 Software controlled interrupt classes (example)