bitwise shift operators, where does the bit go?

el_supremo:

How are either of those examples any different in efficiency than the first example I gave?

They have two great advantages over your example.
(a) you can't access the overflow bit from C even if you use a left shift.
(b) they work.

In assembler you to a test under mask and then branch on a condition

If you are so desperate for speed you will have to use assembler, one way or another.

Pete

I was referring to the first code snippet from my first post...

for(byte i=0;i<8;i++)
{   if (data & (1<<i))
       do blah;
}

Anyway...

Thanks for the clarification that one cannot access the overflow/carry/comparator bit in C. I was not sure if there is a definition in the libraries that could get me to it.

Is it simple to drop into asm inline in the Adruino IDE? If so, do you know how to check that bit that way?