05-23-2005, 06:27 AM
Quote:Code:x = x and hex3FFF 'Remove 2 high-order bits from x (just in case)
x = x * 2^2 'Shift x left 2 bits
i don't know why you "remove" your 2 high order bits hehe. but it would definetly fit as a new thedailywtf.com post hehe... let's see...
i'm lazy so i use a 4 bit nibble
1100 shl 2
0000
hm.... seems like that shl removed(!) the leading two 11 magically, nah you are right from an assembler point of view one can never be sure what that vodoo cpu does, let's better remove the uppermost 2 bits by hand...
oh and even your solution is actually a one liner... but i guess this way it's easier to "understand" the complicated matter of "rotating to bits left" (sounds like a good movie title to me)