C51: CREATING A FIXED STACK SEGMENT
Information in this article applies to:
Is it possible to define a fixed stack location for the 8051's hardware stack?
Yes. The easiest way to do this is to modify the STARTUP code so the stack is an absolute segment at a fixed location. For example:
In the STARTUP code, change the following:
?STACK SEGMENT IDATA RSEG ?STACK DS 100h-080h
ISEG AT 0xA0 ?STACK: DS 0x100 - ?STACK
This creates an absolute segment for the stack. Then, you can change the 0xA0 to the address where you want the stack to reside. This has the advantage that if your C program variables overlap with the stack, the linker emits a warning.
The following Discussion Forum threads may provide information related to this topic.
Last Reviewed: Saturday, May 1, 2004
of your data.