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

Generalized approach for getting bits of varaibles declared As BDATA

Hello all,

I have been pondering upon getting each bit of a variable (e.g. declared as char) using a for loop

char bdata Char1;


bit y;
for(x=0; x<7; x++)
y = Char1^x;

My question is : Is it possible?

Parents
  • Is it possible?

    Nope.

    Your example assumes that bits can be accessed indirectly. The 8051 does not support pointers to bits or any other type of indirect bit access. Therefore, the compiler ALSO doesn't support pointers to bits. This is documented in the manual.

    Jon

Reply
  • Is it possible?

    Nope.

    Your example assumes that bits can be accessed indirectly. The 8051 does not support pointers to bits or any other type of indirect bit access. Therefore, the compiler ALSO doesn't support pointers to bits. This is documented in the manual.

    Jon

Children
No data