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?
If you are trying to make y equal to bits 0 through to 7 in turn you could do this: unsigned char x; unsigned char char1; bit y; for(x=0;x<8;x++) { y=(char1 >> x) & 0x01; } There is no particular advantage I can think of for using a bdata variable in this situation. Stefan
When I am done with my application in which I am trying to interface an EEPROM with C52, I shall send u the code for your remarks. Anyway Thanks again. Friendly Regards, Mansoor