AnsweredAssumed Answered

PRM problems for 908QB8

Question asked by bigmac on Nov 25, 2006
Latest reply on Nov 26, 2006 by CompilerGuru
Hello all,
 
I have recently been using CW08 V5.0 to test and debug some functions written in C.  I used the wizard to create a new project, and chose the 908QB8 as the target device, and tested the functions using full chip simulation.
 
At one point, after re-arranging some code from main() into a separate function, a previously operational function became erroneous.  This was subsequently found to be caused by the stack over-writing some of my global variables.  The stack size in the default PRM file that was generated by the wizard was then increased from 48 bytes to 80 bytes, with a resulting link error.
 
The 908QB8 device has 256 bytes of RAM, with the top 64 bytes in page 1, and the remainder in page 0.  However, the default PRM file allocates both global variables and stack to the top 64 bytes only.  The page 0 RAM remains unused.
 
I have now altered the PRM file so that global variables are allocated from the start of RAM in page 0, and the allocated stack still commences at the top of RAM, but its size may be any value within the RAM capacity.  This seems much more appropriate for this device.
 
NAMES END
SEGMENTS 
   ROM    =  READ_ONLY    0xDE00 TO 0xFDFF;
   Z_RAM  =  READ_WRITE   0x0040 TO 0x00FF;
   RAM    =  READ_WRITE   0x0040 TO 0x013F;
   ROM1   =  READ_ONLY    0xFFB0 TO 0xFFBD;
   ROM2   =  READ_ONLY    0xFFC2 TO 0xFFCF;
END

PLACEMENT
   DEFAULT_RAM                   INTO  Z_RAM;
   DEFAULT_ROM, ROM_VAR, STRINGS INTO  ROM;
   _DATA_ZEROPAGE, MY_ZEROPAGE   INTO  Z_RAM;
   SSTACK                        INTO  RAM;
END

STACKSIZE 0x50

VECTOR 0 _Startup
 
I realise that it will often be necessary to alter the PRM file to meet particular circumstances, however, the 908QB8 default file generated by the wizard appears quite inappropriate, in view of the type of problem encountered with a very simple program.  Does anyone know if it is possible to alter the file that the wizard automatically generates for the 'QB8?
 
Thank you.
 
Regards,
Mac

Outcomes