AnsweredAssumed Answered

CW10.2 Undefined Label

Question asked by Steven Bak on Feb 10, 2012
Latest reply on Feb 15, 2012 by Steven Bak

I am porting a  CW4 project to CW10.2. I created a new project from the project wizzard in 10.2 and have added all the source files and removed almost all of the errors. This one has me stumped.


In the CW4 project, there is a declaration in file.c:

volatile uint8 OS_Task = MAX_TASK_NUMBER


Then the file mcf5282_lo.s has the following:

.extern _OS_Task





move.b d1,_OS_Task



Now, in the CW10.2 project I have eliminated the mcf5282_lo.s in favor of the generated startcf.c.

file.c still has the same declaration noted above.

In startcf.c, the c_switch has been changed to:

asm __declspec(register_abi) void c_switch(void)




move.b d1,_OS_Task       // This line gives me error "illegal addressing mode"



} // This line gives me error "undefined label '_OS_Task'



So how and where can I tell the assembly routine c_switch that OS_Task is defined in file.c????

i.e. how can add .extern OS_Task in the c file???

Regretfully, i've randomly tried every thing I could thing of before coming here.