I want to rotate a byte (very important that it's 8 bits). I know that Windows provides a function, _rotr8
to complete this task. I want to know how I can do this in Linux because I am porting a program there. I ask this because I need to mask bits to 0. An example is this:
#define set_bit(byte,index,value) value ? \ //masking bit to 0 and one require different operators The index is used like so: 01234567 where each number is one bit
byte |= _rotr8(0x80, index) : \ //mask bit to 1
byte &= _rotr8(0x7F, index) //mask bit to 0
The second assignment should illustrate the importance of the 8 bit carry rotate (01111111 ror index)