ARM Technical Support Knowledge Articles

SETTING THE LOCATION OF THE REENTRANT STACK POINTER

Applies to: C51 C Compiler

Answer


Information in this article applies to:


QUESTION

How can I set the address of the reentrant stack pointer? It is easy to set the size of the stack, but I can't figure out how to specify the location of the actual pointer.

ANSWER

You must modify the startup code as follows (to put the IDATA reentrant stack pointer at address 40h):

IF IBPSTACK <> 0
        DSEG    AT      0x40
?C_IBP:         DS      1
PUBLIC          ?C_IBP

                RSEG    ?C_C51STARTUP
                MOV     ?C_IBP,#LOW IBPSTACKTOP
ENDIF

Note that you may change DSEG at 40 to whatever address (in DATA space) you want the point to "live" at. Other reentrant stack pointers may be located similarly.

SEE ALSO

Article last edited on: 2004-06-17 14:53:15

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential