| ARM Technical Support Knowledge Articles | |
Applies to: C166 C Compiler
Information in this article applies to:
What does the USERSTACKDPP3 directive do?
The USERSTACKDPP3 directive, abbreviated U3, changes the assumptions made by the C166 Compiler regarding accesses to the user stack area.
By default, the user stack is located in the NDATA memory area and is accessed with DPP2. To locate the user stack in the IDATA or SDATA memory classes (which is accessed using DPP3), you must use the USERSTACKDPP3 directive and you must make the following changes to the definition of the user stack and the initialization of the user stack pointer (R0) in the startup code:
The changes are highlighted and shown with 'SDATA'. 'IDATA' works the same way.
STARTUP.A66 or START167.A66
?C_USERSTACK SECTION DATA PUBLIC 'NDATA'
to:
?C_USERSTACK SECTION DATA PUBLIC 'SDATA'
NDATA DGROUP ?C_USERSTACK
to:
SDATA DGROUP ?C_USERSTACK
In addition, you must change the following line:
MOV R0,#DPP2:?C_USERSTKTOP
to:
MOV R0,#DPP3:?C_USERSTKTOP
START_V2.A66
?C_USERSTACK SECTION DATA PUBLIC 'NDATA'
:
?C_USERSTACK1 SECTION DATA PUBLIC 'NDATA'
:
?C_USERSTACK2 SECTION DATA PUBLIC 'NDATA'
to:
?C_USERSTACK SECTION DATA PUBLIC 'SDATA'
:
?C_USERSTACK1 SECTION DATA PUBLIC 'SDATA'
:
?C_USERSTACK2 SECTION DATA PUBLIC 'SDATA'
NDATA DGROUP ?C_USERSTACK, ?C_USERSTACK1, ?C_USERSTACK2
:
NDATA DGROUP ?C_USERSTACK, ?C_USERSTACK1
:
NDATA DGROUP ?C_USERSTACK, ?C_USERSTACK2
:
NDATA DGROUP ?C_USERSTACK
to:
SDATA DGROUP ?C_USERSTACK, ?C_USERSTACK1, ?C_USERSTACK2
:
SDATA DGROUP ?C_USERSTACK, ?C_USERSTACK1
:
SDATA DGROUP ?C_USERSTACK, ?C_USERSTACK2
:
SDATA DGROUP ?C_USERSTACK
In addition, you must change the following line:
MOV R0,#?C_USERSTKTOP1
:
MOV R0,#?C_USERSTKTOP2
:
MOV R0,#?C_USERSTKTOP
to:
MOV R0,#DPP3:?C_USERSTKTOP1
:
MOV R0,#DPP3:?C_USERSTKTOP2
:
MOV R0,#DPP3:?C_USERSTKTOP
Article last edited on: 2006-03-13 10:49:13
Did you find this article helpful? Yes No
How can we improve this article?