Page 1 of 1

Problem compiling V2.890 using CodeWarrior

Posted: Wed Apr 27, 2011 7:09 pm
by MotoDan
I'm just getting started with trying to build MS-II V2.890 using CodeWarrior V5.9.0 and am getting the following error:

Error : C12087: Not a valid operand
main_v2.890.c line 2371
Error : C10000: Nothing more expected

Here's the section of code that contains the error:

Code: Select all

tmp2 = inpram.tpsmax - inpram.tps0;
   asm {
 			    ldy  tmp1
 			    ldd  #1000
 			    EMULS
 			    ldx  tmp2  <--- ERROR (line 2371)
 			    EDIVS
 			    sty tmp1
   }
I've made sure I have the correct supporting files: hcs12def.h, maffactor.inc, and flash.h. My CW is an evaluation version, but I don't think I'm exceeding the code limit (yet).

Any help would be appreciated.
Dan

Re: Problem compiling V2.890 using CodeWarrior

Posted: Fri Apr 29, 2011 8:18 am
by grippo
You are probably using a newer version of CW than the original code. The newer versions don't like variables named tmpn (don't ask me why), so all the tmpn variables need to be replaced with tmpxn.

Re: Problem compiling V2.890 using CodeWarrior

Posted: Fri Apr 29, 2011 11:46 am
by MotoDan
Thanks for the reply Al. My compiler errors went away once I renamed all of the tmpx vars. Might be a good idea to change them in the current source code. FYI - my CodeWarrior version is 5.9.0.

I think I'm almost there, but am now getting a linker error:

Link Error : L1822: Symbol SpSub in file main_v2.890.c.o is undefined.

When I commented out this external reference the error just moved to the next external reference. I'm wondering if I'm exceeding the code limits of CW which I believe might be 32K?

Re: Problem compiling V2.890 using CodeWarrior

Posted: Sun May 01, 2011 12:48 pm
by grippo
I don't think you are exceeding the limit, I think you need the Flash.asm file attached. You should also put it in the CW project directory.

Re: Problem compiling V2.890 using CodeWarrior

Posted: Sun May 01, 2011 2:09 pm
by MotoDan
I checked my CW project and I already have flash.asm and flash.h in my sources folder. Not quite sure why CW can't locate the four external functions (reboot,monitor,SpSub, and NoOp). Maybe I should be working with a later version of MS code? I could not find the source files for v2.900 and above. All I could find were the S19 hex files.

Re: Problem compiling V2.890 using CodeWarrior

Posted: Sun May 01, 2011 2:17 pm
by MotoDan
Al,

I went ahead and replaced my flash.asm and flash.h files with the ones you attached and got a little farther down the linking process. The error I'm getting now is:

Link Error : L1102: Out of allocation space in segment ROM_C000 at address 0xF48E
Link Error : Link failed

Could this be due to the 32K limitation that my version of CW has?

Re: Problem compiling V2.890 using CodeWarrior

Posted: Mon May 02, 2011 4:33 pm
by grippo
It might be - I know the code + data is well over 32K, but I don't know how CW figures out the limit, whether it code only or code + data. If you need to cut code, the first place I would try is get rid of CAN.