Skip to main content
Visitor II
May 13, 2004
Question

cosmic c function - variable limit

  • May 13, 2004
  • 3 replies
  • 972 views
Posted on May 13, 2004 at 22:38

cosmic c function - variable limit

    This topic has been closed for replies.

    3 replies

    Visitor II
    May 11, 2004
    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
    Visitor II
    May 12, 2004
    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 ]
    Visitor II
    May 13, 2004
    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