Ввел в заблуждение вот этот пример
Цитата
Bit-Addressable Objects
Bit-addressable objects are objects that may be addressed as words or as bits. Only data objects that occupy the bit-addressable area of the 8051 internal memory fall into this category.
The Cx51 Compiler places variables declared with the bdata memory type into the bit-addressable area. Furthermore, variables declared with the bdata memory type must be global (declared outside the scope of a function). You may declare these variables as shown below:
int bdata ibase; /* Bit-addressable int */
char bdata bary [4]; /* Bit-addressable array */
The variables ibase and bary are bit-addressable. Therefore, the individual bits of these variables may be directly accessed and modified. Use the sbit keyword to declare new variables that access the bits of bdata variables. For example:
sbit mybit0 = ibase ^ 0; /* bit 0 of ibase */
sbit mybit15 = ibase ^ 15; /* bit 15 of ibase */
sbit Ary07 = bary[0] ^ 7; /* bit 7 of bary[0] */
sbit Ary37 = bary[3] ^ 7; /* bit 7 of bary[3] */
Использую AT89S52, пишу в Keil uVision.
Цитата
Data_out = (Latchs[0] >> i) & 0x01;
В вашем примере при присваивании значения типа long переменной Data_out типа sbit старшие разряды отбрасываются, а присваивается только нулевой разряд. Так?