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
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
I just tried the following using C166 V4.20. I'm CERTAIN this will work OK with version 3 as well. http://www.keil.com/support/docs/1706.htm It located the stack exactly where I placed it. Jon
>I just tried the following using C166 V4.20. I'm CERTAIN this will work OK with version 3 as well. >http://www.keil.com/support/docs/1706.htm I tried doing this, but in the version I'm using (3.50c, yeah it's old) changing _BOS or _TOS did not have any effect. After thinking about it, I decided to do it "manually" and skip the SSKDEF definition altogether, by allocating a separate section for the stack. That seems to work well. /Ricard /Ricard
Did you set STKSZ to a 7. If this is not set to 7, the stack is in a fixed location (from what I recall). Jon