Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/07/03 07:04
Read: times


 
#42996 - RE: how to swap the bit,,,urgent
Responding to: ???'s previous message
If speed is not so important (or when memory usage is) the following should work as well:

unsigned char FlipBits(unsigned char InVal)
{
unsigned char BitMask1=0x01;
unsigned char BitMask2=0x80;
unsigned char Result=0;

while(BitMask2>=1)
{
Result+=(((InVal&BitMask1)>0)*BitMask2);
BitMask1<<=1;
BitMask2>>=1;
}
return(Result);
}


List of 24 messages in thread
TopicAuthorDate
how to swap the bit,,,urgent            01/01/70 00:00      
   RE: how to swap the bit,,,urgent            01/01/70 00:00      
      RE:8051 how to swap the bit,,,urgent            01/01/70 00:00      
         RE: RE:8051 how to swap the bit,,,urgent            01/01/70 00:00      
         RE: 8051 how to swap the bits...            01/01/70 00:00      
            RE: 8051 how to swap the bits...            01/01/70 00:00      
   RE: how to swap the bit,,,urgent            01/01/70 00:00      
      RE: how to swap the bit,,,urgent            01/01/70 00:00      
         RE: how to swap the bit,,,urgent - Hans            01/01/70 00:00      
            RE: how to swap the bit,,,urgent - Hans            01/01/70 00:00      
               RE: how to swap the bit,,,urgent - Hans            01/01/70 00:00      
                  RE: how to swap the bit,,,urgent - Hans            01/01/70 00:00      
   RE: how to swap the bit,,,urgent            01/01/70 00:00      
      RE: how to swap the bit,,,Menno            01/01/70 00:00      
         RE: how to swap the bit,,,Michael            01/01/70 00:00      
         RE: how to swap the bit in C            01/01/70 00:00      
            RE: how to swap the bit in C            01/01/70 00:00      
   RE: how to swap the bit if 64 bits            01/01/70 00:00      
      RE: how to swap the bit if 64 bits            01/01/70 00:00      
         RE: how to swap the bit if 64 bits            01/01/70 00:00      
         RE: how to swap the bit if 64 bits            01/01/70 00:00      
   RE: how to swap the bit,,,urgent            01/01/70 00:00      
      RE: how to swap the bit,,,/...Vivek            01/01/70 00:00      
      RE: how to swap the bit,,,urgent            01/01/70 00:00      

Back to Subject List