I want to fix (in C langage if possible) in bdata memory a word (u16). At the same address I want to use 2 bytes (u08) and always in the same area (0x20 and 0x21 addresses for example) to declare bits with sbit structure. --------------------------------------- u16 bdata myByte; sbit myBit15 = myWord ^ 15; sbit myBit3 = myWord ^ 3; // it does affect the right bit. Why ? --------------------------------------- union u{ u08 bdata msb; u08 bdata lsb; } myWord; union { u16 bdata word _at_ 0x20; union u myWord; } MYword; sbit myBit15 = myWord.msb ^ 7; sbit myBit3 = myWord.lsb ^ 3; ... // use { MYword.word; myWord.msb; myWord.lsb; myBit15; // not known by compiler ? myBit3; // not known by compiler ? }
http://www.keil.com/support/docs/928.htm http://www.keil.com/support/docs/1279.htm And, of course, the C51 User's Guide, C51.pdf