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

How to move the 167 stack?

Hi!

For various reasons, I want to position the internal 167 stack so that it starts at the bottom of internal RAM (F600 on the C167CR), and extends 512 bytes up (i.e. to F7FF). This of course requires modification to the START167.ASM startup code. However, L166 still locates the stack at the default location of FA00..FBFF (as can be seen in the .map file). Looking at the linker SSKDEF directive definition, it implies that the linker indeed automatically puts the stack at these addresses when a 512 byte stack is selected. However, in the 167 chip manual, I can see no reason for not placing the stack anywhere in the internal RAM, as long as the appropriate registers are properly initialized (SP, STKUN, STKOV).

So my question is ... how do you get the linker to allocate the stack where I want it? (I'm still using the old 3.xx tool series, perhaps this has been fixed in the 4.xx versions?)

regards,

/Ricard W


Parents
  • I don't know if there is an option to move the system stack in the Keil tools, but you can find a way around the problem. Reserve the area you want to use for the system stack and set the stack size setting to 32 words (so you waste as little memory space as possible in the default stack area). The rest can be fixed in Start167.asm

    Regards,
    Mike

Reply
  • I don't know if there is an option to move the system stack in the Keil tools, but you can find a way around the problem. Reserve the area you want to use for the system stack and set the stack size setting to 32 words (so you waste as little memory space as possible in the default stack area). The rest can be fixed in Start167.asm

    Regards,
    Mike

Children