C can be pretty confusing at times... do { ... } while (condition) is, as you suspect, just a loop structure. blah = variable << 1 means shift "variable" left one bit and put the result in "blah". variable <<= 1 just means shift "variable" left one bit and put the result back in "variable". blah = variable & 1 means logical-and "variable" with "1" and put the result in "blah" variable &= 1 means logical-and "variable" with "1" and put the result back in "variable" variable &=~1 means logical-and "variable" with the compliment of 1 (or binary-not 1) and put the result back in "variable". this is a trick to clear the lowest bit of "variable" (the compliment of 1 is ...11111110, so when you logical-and this with "variable", the lowest bit always comes out to 0). variable |= 1 means logical-or "variable" with "1" and put the result back in "variable" there are "bitwise" operators in C: "<<" (shift left), ">>" (shift right), "|" (or), "&" (and), and "~" (not). these work just the way you might expect them to. however, C also makes "unary" operators out of them, but sticking "=" on the end (making "&=", "|=", etc), which just puts the result of the operation back into the first operand. wolf and grendel the '01 S3T ------ Remember to pay as much attention to your partner as you do your carburetor ----- Original Message ----- From: "Vasile Surducan" Sent: Wednesday, January 30, 2002 11:43 PM > Ok, I hate C ! Maybe you help me and translate this "ugly code": -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu