Created
July 31, 2012 17:19
-
-
Save GeoffTidey/3218681 to your computer and use it in GitHub Desktop.
A ruby interpretation of the shrd (Double Precision Shift Right) Assembly instruction
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
#see https://en.wikibooks.org/wiki/X86_Assembly/Shift_and_Rotate#Extended_Shift_Instructions for more info on shrd | |
def shrd(rm16, r16, cl) | |
rm16 >>= cl | |
r16 <<= (16 - cl) | |
rm16 | (r16 & 0xFFFF) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
More here: http://blog.tidey.net/blog/2012/07/31/shrd-a-ruby-interpretation-of-the-double-precision-shift-right-assembly-instruction/