' Signed shift right Function shrs(bin As Byte, bits As uByte) 'Shift "bin" right by "bits" bits, preserving the sign While bits > 0 bsf STATUS_c rrcf bin,f bits = bits - 1 End While End Function bin Function shrs(bin As Integer, bits As uByte) 'Shift "bin" right by "bits" bits, preserving the sign While bits > 0 bsf STATUS_c rrcf bin+1,f rrcf bin,f bits = bits - 1 End While End Function bin Function shrs(bin As Short, bits As uByte) 'Shift "bin" right by "bits" bits, preserving the sign While bits > 0 bsf STATUS_c rrcf bin+2,f rrcf bin+1,f rrcf bin,f bits = bits - 1 End While End Function bin Function shrs(bin As Long, bits As uByte) 'Shift "bin" right by "bits" bits, preserving the sign While bits > 0 bsf STATUS_c rrcf bin+3,f rrcf bin+2,f rrcf bin+1,f rrcf bin,f bits = bits - 1 End While End Function bin