cancel
Showing results for 
Search instead for 
Did you mean: 

cosmic c function - variable limit

vividmusic
Associate II
Posted on May 13, 2004 at 22:38

cosmic c function - variable limit

3 REPLIES 3
vividmusic
Associate II
Posted on May 12, 2004 at 01:24

Hi there good people!

It seems that a cosmic c function can only have 256 bytes of (locals)ram allocated to it. Is there any way around this? Say i want to have an -int array[127], char i,j,k,blahblahblah; in the one function cosmic is giving me errors ''value too large'' until the total is <= 256. Im using the long stack.

thanks for your time

chris
sjo
Associate II
Posted on May 12, 2004 at 07:15

Remember the ST7 is only an 8bit micro with a small stack, max 256bytes on some devices.

Cosmic will allocate all locals on the stack, as most c compilers - but this is not an infinite resource.

As a possible you could have a look a using a software stack, possibly modmm, this might give you more memory to use.

Regards

sjo

[ This message was edited by: sjo on 12-05-2004 10:49 ]
vividmusic
Associate II
Posted on May 13, 2004 at 22:38

thanks sjo,

i found out that it was because they were local variables - duhh. I had tried to make them global and that didnt work, which made me think something was wierd but i found that problem was in my linker file -not declaring proper segments.

thanks again

chris