This might help
http://www.picbasic.co.uk/forum/cont...153-N-Bit_MATH