#define BIT(addr,bit) bit #define ADDR(addr,bit) addr #define MASK(addr,bit) 1<<(bit) Then: #define myflag somereg,5 movlw BIT(myflag) movf ADDR(myflag),w andlw MASK(myflag) etc...
Techniques for exploiting the parallelism of bitwise operations [incl bit reversals, counting, and Morton keys] by Ron Gutman
Archive:
See:
Code:
Shift by 4 bits at a time