| ??? 05/31/03 11:06 Read: times |
#47103 - RE: Grabbing a bit from a byte? Responding to: ???'s previous message |
You could also use macro's to implement the masking approach...
#define TST_BIT_X(addrx,mask) (*addrx & mask) #define SET_BIT_X(addrx,mask) (*addrx = (*addrx | mask)) #define CLR_BIT_X(addrx,mask) (*addrx = (*addrx & ~mask)) or by using a union.. or by using bdata Aliasing ie... bdata U8 General_flags; sbit check_menu=General_flags^0; sbit sound_alarm=General_flags^1; sbit sound_alarm_ack=General_flags^2; sbit al_ack=General_flags^3; sbit UpdateDisplaywithError=General_flags^4; so you have access at the byte or bit level Rob. |
| Topic | Author | Date |
| Grabbing a bit from a byte? | 01/01/70 00:00 | |
| RE: Grabbing a bit from a byte? | 01/01/70 00:00 | |
| RE: Grabbing a bit from a byte? | 01/01/70 00:00 | |
| RE: Grabbing a bit from a byte? | 01/01/70 00:00 | |
| RE: Grabbing a bit from a byte? | 01/01/70 00:00 | |
| RE: Grabbing a bit from a byte? | 01/01/70 00:00 | |
| RE: Grabbing a bit from a byte? | 01/01/70 00:00 | |
| RE: Grabbing a bit from a byte? | 01/01/70 00:00 | |
RE: Grabbing a bit from a byte? | 01/01/70 00:00 | |
| RE: Grabbing a bit from a byte? | 01/01/70 00:00 |



