User’s Manual
C166S V1 SubSystem
Memory Organization
User’s Manual
4-10
V 1.6, 2001-08
4.6
System Stack
The system stack must be defined within the DPRAM. The size of the system stack is
controlled by bitfield STKSZ in register SYSCON (see table below).
For all system stack operations, the stack memory is accessed via the Stack Pointer
(SP). The system stack implementation in the C166S is from high to low memory. The
system stack grows downward as it is filled. The SP register is decremented first each
time data is pushed on the system stack, and incremented after each time the data is
pulled from the system stack. Only word accesses are supported to the system stack.
The SP points to the address of the latest system stack entry, rather than to the next
available system stack address.
A STacK OVerflow (STKOV) register and a STacK UNderflow (STKUN) register are
provided to control the lower and upper limits of the selected stack area. These two stack
boundary registers can be used not only for protection against data destruction, but also
to implement a circular stack with hardware-supported system stack flushing and filling
(except for option STKSZ=111).
4.6.1
Data Organization in General Purpose Registers
The memory-mapped GPRs use a block of 16 consecutive words within the DPRAM
Segment 0. The Context Pointer (CP) register determines the base address of the
currently active register bank. This register bank may consist of up to 16 word GPRs (R0,
R1,
…
, R15), and/or up to 16 byte GPRs (RL0, RH0,
…
, RL7, RH7). The 16-byte GPRs
are mapped onto the first 8 word GPRs (see table below).
In contrast to the system stack, a register bank grows from lower towards higher address
locations and occupies a maximum space of 32 bytes. The GPRs are accessed via short
2-, 4- or 8-bit addressing modes using the CP register as base address (independent of
Table 4-1
System stack size
<STKSZ>
Stack Size (Words) DPRAM Addresses (Words)
0 0 0
B
256
00’FBFE
H
-00’FA00
H
(Default after Reset)
0 0 1
B
128
00’FBFE
H
-00’FB00
H
0 1 0
B
64
00’FBFE
H
-00’FB80
H
0 1 1
B
32
00’FBFE
H
-00’FBC0
H
1 0 0
B
512
00’FBFE
H
-00’F800
H
1 0 1
B
---
Reserved. Do not use this combination.
1 1 0
B
---
Reserved. Do not use this combination.
1 1 1
B
1536
00’FDFE
H
-00’F200
H
(Note: No circular stack)
Содержание C166S V1 SubSystem
Страница 10: ...User s Manual C166S V1 SubSystem User s Manual I 6 V 1 6 2001 08...
Страница 16: ...User s Manual C166S V1 SubSystem Introduction User s Manual 1 6 V 1 6 2001 08...
Страница 126: ...User s Manual C166S V1 SubSystem Central Processing Unit User s Manual 3 96 V 1 6 2001 08...
Страница 178: ...User s Manual C166S V1 SubSystem Memory Organization User s Manual 4 52 V 1 6 2001 08...
Страница 206: ...User s Manual C166S V1 SubSystem Instruction Set User s Manual 5 28 V 1 6 2001 08...
Страница 306: ...User s Manual C166S V1 SubSystem Detailed Instruction Set User s Manual 6 100 V 1 6 2001 08...
Страница 362: ...User s Manual C166S V1 SubSystem The External Bus Interface User s Manual 8 40 V 1 6 2001 08...
Страница 452: ...User s Manual C166S V1 SubSystem General Purpose Timer Unit User s Manual 12 44 V 1 6 2001 08...
Страница 454: ...User s Manual C166S V1 SubSystem Instruction Index User s Manual 13 2 V 1 6 2001 08...
Страница 459: ......