ST10R272L - SYSTEM PROGRAMMING
306/320
The following example demonstrates the circular stack mechanism
Register R1 is pushed onto the lowest physical stack location according to the selected
maximum stack size. With the following instruction, register R2 is pushed onto the highest
physical stack location although the SP is decremented by 2 as for the previous push
operation.
0 1 0 b
64
00’FBFEh...00’FB80h
SP.6...SP.0
0 1 1 b
32
00’FBFEh...00’FBC0h
SP.5...SP.0
1 0 0 b
---
Reserved. Do not use this combination.
---
1 0 1 b
---
Reserved. Do not use this combination.
---
1 1 0 b
---
Reserved. Do not use this combination.
---
1 1 1 b
1024
00’FDFEh...00’F600h (Note: No circular
stack)
SP.11...SP.0
Figure 120 Physical stack address generation
MOV SP, #0F802h
;Set SP before last entry of physical stack of 256 words
...
;(SP) =
F802h: Physical stack address = FA02h
<STKSZ>
Stack Size
(Words)
Internal RAM Addresses (Words)
of Physical Stack
Significant Bits of
Stack Pointer SP
1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 0
1 1 1 1 1 0 1 1 1 0 0 0 0 0 0 0
1 1 1 1 1 0 1 1 1 0 0 0 0 0 0 0
1 1 1 1 1 0 1 0 0 0 0 0 0 0 0 0
1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 0
1 1 1 1 1 0 1 1 0 1 1 1 1 1 1 0
1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 0
FBFEh
FB80h
FB80h
FBFEh
FB7Eh
FBFEh
FBFEh
F800h 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0
FA00h
1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 0
1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 0
FBFEh
F7FEh
FBFEh
1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 0
1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 0
<SP>
<SP>
Phys.A.
Phys.A.
After PUSH
After PUSH