#ifndef BITMASK_H 
#define BITMASK_H 

  // defs for masks to select diff sized bit fields 
#define  _1b   0x1 
#define  _2b   0x3 
#define  _3b   0x7 
#define  _4b   0xf 
#define  _5b   0x1f 
#define  _6b   0x3f 
#define  _7b   0x7f 
#define  _8b   0xff 
#define  _9b   0x1ff 
#define  _10b  0x3ff 
#define  _11b  0x7ff 
#define  _12b  0xfff 
#define  _13b  0x1fff 
#define  _14b  0x3fff 
#define  _15b  0x7fff 
#define  _16b  0xffff 
#define  _17b  0x1ffff 
#define  _18b  0x3ffff 
#define  _19b  0x7ffff 
#define  _20b  0xfffff 
#define  _21b  0x1fffff 
#define  _22b  0x3fffff 
#define  _23b  0x7fffff 
#define  _24b  0xffffff 
#define  _25b  0x1ffffff 
#define  _26b  0x3ffffff 
#define  _27b  0x7ffffff 
#define  _28b  0xfffffff 
#define  _29b  0x1fffffff 
#define  _30b  0x3fffffff 
#define  _31b  0x7fffffff 
#define  _32b  0xffffffff 

  // defs for masks to select diff bits in a long word 
#define  _bit0    0x1 
#define  _bit1    0x2 
#define  _bit2    0x4 
#define  _bit3    0x8 
#define  _bit4    0x10  
#define  _bit5    0x20 
#define  _bit6    0x40 
#define  _bit7    0x80 
#define  _bit8    0x100 
#define  _bit9    0x200 
#define  _bit10   0x400 
#define  _bit11   0x800 
#define  _bit12   0x1000 
#define  _bit13   0x2000 
#define  _bit14   0x4000 
#define  _bit15   0x8000 
#define  _bit16   0x10000 
#define  _bit17   0x20000 
#define  _bit18   0x40000 
#define  _bit19   0x80000 
#define  _bit20   0x100000 
#define  _bit21   0x200000 
#define  _bit22   0x400000 
#define  _bit23   0x800000 
#define  _bit24   0x1000000 
#define  _bit25   0x2000000 
#define  _bit26   0x4000000 
#define  _bit27   0x8000000 
#define  _bit28   0x10000000 
#define  _bit29   0x20000000 
#define  _bit30   0x40000000 
#define  _bit31   0x80000000 

#endif // BITMASK_H 

