Skip to main content
bleumers_j
Associate III
June 5, 2003
Question

Cosmic compiler problem

  • June 5, 2003
  • 3 replies
  • 699 views
Posted on June 05, 2003 at 11:59

Cosmic compiler problem

This topic has been closed for replies.

3 replies

bleumers_j
Associate III
June 4, 2003
Posted on June 04, 2003 at 10:33

Hello,

while compiling i often get this message:

#error clnk Ex6a.lkf:1 bad address (0x100) for zero page symbol _leesADC$L

This happens after i create more variables in my code.

The error disapears after rewriting the code using less variables.

Does anybody know what is going wrong.

Thanks in advance!!!

This is a part of my code:

int leesADC2(int adc, int waarde)

{

PADR = 0x02;

if (ValBit(PBDR,adc)) // after changing ''adc'' in ex. ''1'', the code works

waarde--;

PADR = 0x01;

if (ValBit(PBDR,adc))

waarde++;

return waarde;

}

[ This message was edited by: joble on 04-06-2003 15:31 ]
stephanie
Visitor II
June 5, 2003
Posted on June 05, 2003 at 07:37

It seems you try to put too many variables in your ram0 (zeropage from 80 to FF). Some are placed over this limit (from 100!), and the linker notes the problem.

--> Depending on your ST7, create a RAM section if possible (from 100) or use #define or EQU directives for constant, which do not use any space in memory.
shreya
Visitor II
June 5, 2003
Posted on June 05, 2003 at 11:59

Hello,

I think you are probably using the small/compact/short memory models. You could consider changing your memory model to medium/long which simulate stack in long range and force some functions onto that stack using the @nostack directive. The section on memory models in the ''C Cross Compiler User's Guide for ST MicroElectronics ST7'' manual in ....Cosmic\ST7\docs\ will help you understand memory models better.