This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Why is this code not working?

Why are those warnings comming?

Build target 'Target 1'
Compiling step.c...
assembling step.src...
linking...
***WARNING L1: UNRESOLVED EXTERNAL SYMBOL
SYMBOL: ?C?SLCMP
MODULE: Step.obj(STEP)
***WARNING L1: UNRESOLVED EXTERNAL SYMBOL
SYMBOL: ?C_STARTUP
MODULE: Step.obj(STEP)
***WARNING L2: REFERANCE MADE TO UNRESOLVED EXTERNAL
SYMBOL: ?C_SLCMP
MODULE: Step.obj(STEP)
ADDRESS: 023EH
"step" - 0 Error(s), 3 Warning(s).

CASE I
When I am putting the inline assembly code (I am doubtful about the
technic.) HEXtoASCII(Count), the above warnings are coming.
Also the main code is not starting from the origin (Means it is not
even giving any jump to the starting address of Main code) It is
directly starting one of the subroutine from 0000h location.

CASE II
When I am removing the HEXtoASCII(Count) subroutine, everything is
going fine.

What could be wrong?

The hex code is...
HEXtoASCII(Count)
{
/*#pragma asm
MOV R6, #00H;
MOV A, Count;
MOV B, A;
ANL A, #0FH;
DA A;
MOV R7, A;
MOV A, B;
ANL A, #0F0H;
SWAP A;
JZ TO;
MOV B, A;
CLR A;
HERE: ADD A, #16H;
DA A;
JNC HI
INC R6;
HI: DJNZ B, HERE;
TO: ADD A, R7;
DA A;
JNC NET
INC R6;
NET: MOV B, A;
ANL A, #0FH;
ADD A, #30H;
MOV i, A;
MOV A, B;
SWAP A;
ANL A, #0FH;
ADD A, #30H;
MOV j, A;
MOV A, R6;
ADD A, #30H;
MOV k, A;
MOV A, B;
MOV B, R6;

#pragma endasm*/
}

And this is the C code from where I am calling the function HEXtoASCII.

void Function(void)
{
idata char C[] = {"Count = "}, D[] = {"Final Count ="},i;
//BACKLIGHT = 1;
ClearDisplay();
for(a=0;a<8;a++)
{
WriteLCDData(C[a],a);
}
while(1)
{
if(INR == 0)
{
Count++;
a = 8;
for(i=0;i<255;i++);
WriteLCDData(Count,a);
}
if(DCR == 0)
{
Count--;
a = 8;
for(i=0;i<255;i++);
WriteLCDData(Count,a);
}
if(ENTER == 0)
{
if(Count<200)
{
Count = Count % 200;
}
for(a=0;a<13;a++)
{
WriteLCDData(D[a],a);
}
a = 13;
WriteLCDData(Count,a);
Rotate();
break;
}
}
}