Hi All, Am trying to re-write a code in PLM51 to embedded C. There is a statement in PLM51 as below.
DECLARE TASK(17) STRUCTURE(PNTR BYTE,STATUS BYTE,DELAY WORD); DECLARE DELAY_HEAD BYTE AT (.TASK(0).PNTR); //ERROR LINE//
What i have understood from this is-- DELAY_HEAD is a byte variable which resides at the same location as that of TASK(0).PNTR.(From the PLM51 manual)
I have rewritten the same into C as below.
struct tsk { unsigned char PNTR ; unsigned char STATUS; unsigned int DELAY; }TASK[17]; unsigned char DELAY_HEAD _at_ &TASK[0].PNTR ;
But its giving error 221:non-constant case/dim expression. Plss help..!!
Hi, Now i have a doubt .. Actually CONTROL1 is a variable used in one of the functions called in the main program called PMOB.c. When the linker say CANNOT FIND SEGMENT,does it mean that its searching for a .c file named CONTROL1???? So i need to create another .c file named CONTROL1.c and then add this variable in that?
and then give
?CO?CONTROL(07FFEh)
command in Options->BL51 locate CODE TAB?? I tried making a seperate .c file named CONTROL with the variable CONTROL1 initialised to a value 0xFFFF as below
unsigned int code CONTROL1 = 0xFFFF;
But the same variable is used in the function in main module PMOB.c and hence i need to declare it as
extern unsigned int code CONTROL1 = 0xFFFF;
in PMOB.c too?? Then it is giving Error L104 :Multiple Public Definitions and Error 110:Cannot find segment
Thanks
When the linker say CANNOT FIND SEGMENT,does it mean that its searching for a .c file named CONTROL1????
Of course not. It means exactly what it says: it's looking for a segment with that name. How that segment got to have that particular name is up to you to find out. It is spelled out in the documentation, including how you can change it.
hence i need to declare it
Yes.
as
No. That's a definition, not a declaration. If you don't know even that difference, you're in no position to be tinkering with the linker like you're trying to.