Oct 11, 2005 #1 C CM600 Member level 3 Joined Jan 26, 2004 Messages 63 Helped 3 Reputation 6 Reaction score 1 Trophy points 1,288 Location BG Activity points 556 bit rotation in c Hello, I am using IAR ARM C compiler, is there a library function for rol or ror ?
Oct 11, 2005 #2 A asahin11 Member level 3 Joined Jun 20, 2005 Messages 57 Helped 3 Reputation 6 Reaction score 0 Trophy points 1,286 Activity points 1,767 c bit rotation Hi CM600, You can try << for rol and >> for ror. regrads,
Oct 11, 2005 #3 R rag_perfect Banned Joined Sep 1, 2005 Messages 124 Helped 14 Reputation 28 Reaction score 7 Trophy points 1,298 Location India Activity points 0 c bit rotate hi! u caneasily do it by using of bitwise operators. rag_perfect
Oct 11, 2005 #4 C CM600 Member level 3 Joined Jan 26, 2004 Messages 63 Helped 3 Reputation 6 Reaction score 1 Trophy points 1,288 Location BG Activity points 556 bitwise rotate c The >> and << operators are for shifting not for rotation
Oct 11, 2005 #5 J jonw0224 Full Member level 4 Joined Nov 22, 2004 Messages 211 Helped 45 Reputation 90 Reaction score 14 Trophy points 1,298 Location USA Activity points 2,528 bitwise rotation in c to rotate a byte by n bits to the right: a = (a >> n) || (a << (8-n)) you probably want to make your code more general (don't hardcode '8').
bitwise rotation in c to rotate a byte by n bits to the right: a = (a >> n) || (a << (8-n)) you probably want to make your code more general (don't hardcode '8').