Keil Logo

L166: ACCESSING THE USER STACK VIA DPP2


Information in this article applies to:

  • C166 Version 4.02 or later

SYMPTOMS

I have reassigned the DPP registers using the DPPUSE directive so that my memory is arranged as follows:

  DPP   VALUE   C166 GROUP
  ========================
   0    0000H   NCONST
   1    0001H   NDATA
   2    0002H   NDATA
   3    0003H   NDATA

  C166 GROUP   START     STOP
  ==============================
  NCONST       000000H   003FFFH
  NDATA        004000H   00FDFFH

When I examine the memory map of my module in the m66 file I see the following:

007D94H   007F93H   000200H   DATA  REL   WORD   ---    5  PUBL  NDATA ?C_USERSTACK

The User Stack is now accessed by DPP1 rather than DPP2. Why is this, how do I tell the compiler that DPP1 accesses the User Stack and how do I force the linker to use DPP2 for User Stack accesses?

CAUSE

The linker is free to place the User Stack anywhere in the NDATA area. Because you have changed the boundries of the NDATA area by reassigning the DPP registers, NDATA can now be accessed by DPP1, DPP2 and DPP3. Therefore, the User Stack can be located so it may be accessed via DPP1, DPP2 or DPP3.

RESOLUTION

When you use the DPPUSE linker directive to reassign the DPP registers, you must also use the NOFIXDPP compiler directive. This ensures that the compiler no longer assumes the User Stack is accessed via DPP2.

You may use the SECTIONS linker directive to force the linker to place the User Stack in a section of memory accessed by DPP2. For example:

SECTIONS(?C_USERSTACK%NDATA(0x8000))

MORE INFORMATION

  • Refer to NOFIXDPP in the C166 User's Guide.
  • Refer to DPPUSE in the L166 User's Guide.
  • Refer to SECTIONS in the L166 User's Guide.

Last Reviewed: Friday, July 15, 2005


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.