nbit = nbit + Bit.And(Bit.UnsignedShiftRight(b, 0), 1)
nbit = nbit + Bit.And(Bit.UnsignedShiftRight(b, 1), 1)
nbit = nbit + Bit.And(Bit.UnsignedShiftRight(b, 2), 1)
nbit = nbit + Bit.And(Bit.UnsignedShiftRight(b, 3), 1)
nbit = nbit + Bit.And(Bit.UnsignedShiftRight(b, 4), 1)
nbit = nbit + Bit.And(Bit.UnsignedShiftRight(b, 5), 1)
nbit = nbit + Bit.And(Bit.UnsignedShiftRight(b, 6), 1)
If Bit.And(nbit, 1) Then
If paritytype = 0 Then ' pari
Return retbyt+128
Else
Return retbyt
End If
Else
If paritytype = 0 Then ' pari
Return retbyt
Else
Return retbyt+128
End If
End If