|ARM Technical Support Knowledge Articles|
Applies to: C51 C Compiler
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.
Article last edited on: 2004-05-01 10:40:29
Did you find this article helpful? Yes No
How can we improve this article?