This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Relocate Stack Start Address

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

Parents
  • 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.

Reply
  • 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.

Children