AnsweredAssumed Answered

COSMIC Compiler structure initialisation

Question asked by Aaron Derbyshire on Jun 14, 2017
Latest reply on Oct 30, 2017 by Aaron Derbyshire

Currently I have an issue when trying to allocate a structure to RAM.

The issue I have is that my structure occupies a total of 373 bytes but the compiler/linker is insistent on trying to locate this structure in the zero page (first 256 bytes). To enable compilation I have reduced the size of the structure to allow for viewing of the map file to see where the compiler is allocating this data.

 

I have attempted to use the pragma directives to allocate this structure to the @near range, which would allow anywhere within the RAM space. This again gave me a section overflow of the zero page!
To go one step further I have defined my own section within the RAM space with the required size memory allocation. I have positioned this directly after the zero page and prior to the .data section. Using absolute addressing and the pragma directives I am still experiencing the same issues, or, now I have an error as the symbol has been defined for the zero page. I have e-mailed Cosmic but they don't seem to care for offering support.

 

Has anyone got any advice?

 

UPDATE: Just to add some further information.

- RAM size = 1024 bytes.

- Zero Page = 256 bytes.

- Max stack size 513 bytes (my thoughts are that this will be given the optimal size by the compiler/linker depending in the .data and .bss usage).

- Default linker file is being used, with the exception of the test section described above.

Outcomes