Good morning,
I have a doubt about my platform setup.
I'm using a MC9S08QG8 device, and I have some problem running my program.
In fact it seems that I have some stack related problem, since after running a subroutine some global (.common section) variable change value. So I tried increasing the stack size but the linker tells me that it don't have enough space.
However looking at the .map file it seems to me that I still have some space:
So I'm using 0x160 bytes in RAM, but QG8 device has 0x200 bytes of RAM. Why I can't increase my stack size at 0xF0? (at present time 0xD0).
If I try, I get the following error:
Out of allocation space in segment RAM at address 0x18A
Is there some one that can clarify this point?
I provide also my .map file (renamed with txt extension)
Giovanni
Solved! Go to Solution.
Hello,
You are correct - the default RAM does not make use of zero page RAM. You will therfore need to explicitly allocate some of your variables to zero page, using the appropriate pragma. According to the map file, you are currently using six bytes within page zero (apparently required by the startup code), and 138 bytes within page 1 (it appears you are consuming 128 bytes within three array variables).
Since total RAM usage for all variables is 144 bytes, and 160 bytes is available within zero page, all static ahd global variables could actually be placed within zero page RAM.
Alternatively, you could alter the PRM file so that default RAM lists the zero-page RAM section prior to the other RAM.
Regards,
Mac
Helo everybody,
I think I understood by myself, I have to use the zero page section, can you confirm that?
Giox
Hello,
You are correct - the default RAM does not make use of zero page RAM. You will therfore need to explicitly allocate some of your variables to zero page, using the appropriate pragma. According to the map file, you are currently using six bytes within page zero (apparently required by the startup code), and 138 bytes within page 1 (it appears you are consuming 128 bytes within three array variables).
Since total RAM usage for all variables is 144 bytes, and 160 bytes is available within zero page, all static ahd global variables could actually be placed within zero page RAM.
Alternatively, you could alter the PRM file so that default RAM lists the zero-page RAM section prior to the other RAM.
Regards,
Mac
Hello BigMac.
Many thanks for your reply.
It confirms that I was on the right direction :-D.
Many thanks also for the analysis of my .prm file, you have been very kind.
Have a nice day
Giovanni