Bitshift help.

Thank you, you have been most helpfull and i understand now.

I'm almost certain there is a better way to do this than using a loop or a lookup table though.

If anyone knows then that would be great.