home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_08_12
/
8n12035b
< prev
next >
Wrap
Text File
|
1990-10-17
|
745b
|
24 lines
/* file mfp_macs.h */
/* M A C R O D E F I N I T I O N S */
/* cast operation for register references */
#define REGVAL(x) (*(unsigned char *)(x))
/* create bit mask for one bit on/off */
#define BITON_MASK(bitnum) (1 << (bitnum))
#define BITOFF_MASK(bitnum) (~(1 << (bitnum)))
/* use given mask to set/clear bits in given byte */
#define SET_BITS(byte,mask) REGVAL(byte) |= (mask)
#define CLR_BITS(byte,mask) REGVAL(byte) &= (mask)
/* set/clear given bit number in byte */
#define BIT_SET(byte,bitnum) REGVAL(byte) |= (BITON_MASK(bitnum))
#define BIT_CLR(byte,bitnum) REGVAL(byte) &= (BITOFF_MASK(bitnum))