home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Beijing Paradise BBS Backup
/
PARADISE.ISO
/
software
/
BBSDOORW
/
EZY110-1.ARJ
/
STRUCT.ARJ
/
CLIB.ARJ
/
SETBIT.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-28
|
463b
|
26 lines
#include <ezycom.h>
void SetBitWord(byte Position,int Value,word &ChangeWord)
{
word wd = 0x01 << Position;
if (Value)
ChangeWord = ChangeWord | wd;
else {
wd = wd ^ 0xffff;
ChangeWord = ChangeWord & wd;
}
}
void SetBitByte(byte Position,int Value,byte &ChangeByte)
{
byte wd = 0x01 << Position;
if (Value)
ChangeByte = ChangeByte | wd;
else {
wd = wd ^ 0xff;
ChangeByte = ChangeByte & wd;
}
}