1// U can change the type by changing char to int
2unsigned char rol(unsigned char value, unsigned char roll)
3{
4 roll = roll % sizeof(char) * 8;
5 unsigned char mask_rolld = ~(0xFF >> roll);
6 unsigned char lmb = (mask_rolld & value) >> (sizeof(char) * 8 - roll);
7 return (value << roll) | lmb;
8}
9