We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi all,
I wonder if anyone could help me with moving the start address of my stack for a test. I have added STARTUP.A51 from the kiel library to my local project and have it in the build tree.
I have changed
; MOV SP,#?STACK-1 MOV SP,#0060H
as I want the stack to start at 0060 not the autogenerated start address. However, when I compile I always get the auto start address. No errors or warnings. The compiler appears to call the STARTUP.A51 file so does anyone know why this might not work?
Cheers,
Dirk
I suspect you're looking at the map file to determine the location of the stack.
The compiler never calls the STARTUP.A51. The code in STARTUP.A51 is executed when the processor exits it's reset and (normally) at the end it calls code produced by the compiler (e.g., 'main').
I suggest you use the simulator or an emulator to determine what the stack is really being set to.
But be careful ... Placing the stack at an absolute location as you are doing might cause an overlap with located by the linker.
"But be careful ... Placing the stack at an absolute location as you are doing might cause an overlap with located by the linker."
That should have been:
But be careful ... Placing the stack at an absolute location as you are doing might cause an overlap with data located by the linker.