ST10R272L - CENTRAL PROCESSING UNIT
62/320
six additional stack word locations are required to push IP, PSW, and CSP for both the
interrupt-service routine and the hardware-trap service routine.
STKOV (FE14h / 0Ah)
SFR
Reset Value: FA00h
The stack underflow pointer STKUN
This non-bit addressable register is compared against the SP register after each data-pop
operation from the system stack (e.g. POP and RET instructions) and after each addition to
the SP register. If the content of the SP register is greater than the content of the STKUN
register, a stack underflow hardware-trap will occur.
Since the least -significant-bit of the STKUN register is tied to ’0’ and bits 15 through 12 are
tied to ’1’ by hardware, the STKUN register can only contain values from F000h to FFFEh.
The Stack Underflow Trap (entered when (SP) > (STKUN)) may be used in two different
ways:
Fatal error indication treats the stack underflow as a system error through the associated
trap service routine.
Automatic system stack refilling allows to use the system stack as a ’Stack Cache’ for a
bigger external user stack. In this case register STKUN should be initialized to a value, which
represents the desired highest Bottom of Stack address.
Scope of stack limit control
STKOV and STKUN detects when the stack pointer SP is moved outside the defined stack
area either by ADD or SUB instructions, or by PUSH or POP operations (explicit or implicit,
i.e. CALL or RET instructions).
This control mechanism is not triggered, i.e. no stack trap is generated, when:
•
the stack pointer SP is directly updated via MOV instructions,
Bit
Function
stkov
Modifiable portion of register STKOV
Specifies the lower limit of the internal system stack.
1
0
1
5
4
3
2
1
0
11
10
9
8
7
6
15
14
13
12
r
rw
r
r
r
1
1
r
stkov