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 not?

How come I can do this:
char LCDstring[] = "ABC";
ACC = LCDstring[0]; Print an A to LCD

But I cannot do this:
int z = 0;
ACC = LCD[z]; Print an A to LCD

Parents
  • "ACC = LCDstring[0]; Print an A to LCD"

    No, that just copies the 1st character of LCDstring into the Accumulator.

    If that did just happen to result in it apppearing on your LCD then you were extremely lucky!!

    You have absolutely no guarantee whatsoever that the compiler won't be using ACC for its own internal purposes - in fact, it is extremely likely that the compiler will be using ACC for its own internal purposes!!

Reply
  • "ACC = LCDstring[0]; Print an A to LCD"

    No, that just copies the 1st character of LCDstring into the Accumulator.

    If that did just happen to result in it apppearing on your LCD then you were extremely lucky!!

    You have absolutely no guarantee whatsoever that the compiler won't be using ACC for its own internal purposes - in fact, it is extremely likely that the compiler will be using ACC for its own internal purposes!!

Children