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

moving returned character to string

always getting an syntax error 213: leftside of asn-op not an lvalue

void scherm (void)
{
char s [10];
char i,y;
printf("volgende string stond weggeschreven: ");
for (i=0;i < 10;i++)
{
DPTR = i;
sel = 0;
ACC = 0x03;
shiftout (ACC);
ACC = DPH;
shiftout (ACC);
ACC = DPL;
shiftout (ACC);
y = shiftin ();
s [i] = y;//error line
sel = 1;
printf("%s",s);
}
}

Parents
  • Please read the instructions about posting code!

    "always getting an syntax error 213: leftside of asn-op not an lvalue"

    Where?

    Note that it is very dodgy to fiddle directly with DPTR, ACC, etc in 'C' source code!

    You have absolutely no guarantee whatsoever that the compiler won't also be using these registers for its own purposes.

    It looks like you are just trying to re-write assembly code in 'C' - a pointelss excercise!

Reply
  • Please read the instructions about posting code!

    "always getting an syntax error 213: leftside of asn-op not an lvalue"

    Where?

    Note that it is very dodgy to fiddle directly with DPTR, ACC, etc in 'C' source code!

    You have absolutely no guarantee whatsoever that the compiler won't also be using these registers for its own purposes.

    It looks like you are just trying to re-write assembly code in 'C' - a pointelss excercise!

Children
No data