Re: Bit assign in xdata
Couple of ways:
1. use a struct bitfield - watch bitfield order.
typedef struct tagBit {
unsigned char b0:1;
unsigned char b1:1;
unsigned char b2:1;
unsigned char b3:1;
unsigned char b4:1;
unsigned char b5:1;
unsigned char b6:1;
unsigned char b7:1;
}Bit;
xdata Bit test;
test.b0 = 1;
2. Defind simple access functions on a data byte, eg.
#define SetBit(var,place) (var |= (1<<place))
#define ClrBit(var,place) (var &= ~(1<<place))
#define ValBit(var,place) (var & (1<<place))
#define TEST 0
unsigned chat var1;
SetBit( var1,TEST)
Hope this helps.
Regards
NTFreak