Created
August 10, 2023 14:15
-
-
Save GabrielDevCpp/018e3c7a22153a81e78746a1c5db7ced to your computer and use it in GitHub Desktop.
Assembly ROR and ROL op in C
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unsigned long long ROR(unsigned long long var, unsigned short shift) | |
{ | |
return (var >> shift | var << (sizeof(var) * CHAR_BIT - shift)); | |
} | |
unsigned long long ROL(unsigned long long var, unsigned short shift) | |
{ | |
return (var << shift) | (var >> (sizeof(var) * CHAR_BIT - shift)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
These ops rotates the bits to the right or to the left.