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
  • bit y;
    for(x=0; x<7; x++)
       y = Char1^x;
    In this context, the caret ^ has its normal 'C' operator meaning; ie, bitwise XOR.
    It only has its Keil-specific bit-specifier meaning in a definition.
    Seems unnecessarily confusing to me, but there you are - that's what Keil have done. :-(

Reply
  • bit y;
    for(x=0; x<7; x++)
       y = Char1^x;
    In this context, the caret ^ has its normal 'C' operator meaning; ie, bitwise XOR.
    It only has its Keil-specific bit-specifier meaning in a definition.
    Seems unnecessarily confusing to me, but there you are - that's what Keil have done. :-(

Children
No data