PIC JAL Math Routine

Get bit N (0=LSB, 7=MSB) from a byte B

by Wouter van Ooijen

To get bit N (0=LSB, 7=MSB) from a byte B you could use (typed from my head, so errors are included for free):

function bit_n_from_b( byte in n, byte in b ) return bit is
   var byte x 
   var bit r at x : 0
   x = b >> n
   return r
end function

See: