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

Typecasting pointer to a bit field

Hi,
Is it possible to typecast a pointer to a variable in xdata to a bit field with 13-bits? I've tried this,

char xdata i _at_ 0x300;

struct {
unsigned short addr : 13;
unsigned char flag1 : 1;
unsigned char flag2 : 1;
unsigned char flag3 : 1;
} const code tbl = {&i, 0, 1, 1};

and the wrong address gets put into addr in the struct.

Andy

0