sinsi - my understanding is that a word gets "doubled" into a dword
some kind of exponentiation, actually
i can't think of when or why, but i have had need to do something like this in the past - lol
i think it can be done much faster, though :P
a 256-byte LUT would be some improvement
but, i think the "Sexy Stir-Fry" technique could be employed
similar to how this bit-reversing algo works
;------------------------------------------------------------
OPTION PROLOGUE:None
OPTION EPILOGUE:None
BitReverse PROC dwVal:DWORD
;Dword Bit-Swap Algorithm
;Sexy Stir-Fry Technique
;
;The original concept was developed by BitRake and Nexo.
;This version was updated by Drizz and Lingo.
pop ecx
mov edx,0F0F0F0Fh
pop eax
and edx,eax
and eax,0F0F0F0F0h
shl edx,4
shr eax,4
or eax,edx
mov edx,33333333h
and edx,eax
and eax,0CCCCCCCCh
shr eax,2
lea eax,[edx*4+eax]
mov edx,55555555h
and edx,eax
and eax,0AAAAAAAAh
shr eax,1
lea eax,[edx*2+eax]
bswap eax
jmp ecx
BitReverse ENDP
OPTION PROLOGUE:PrologueDef
OPTION EPILOGUE:EpilogueDef
;------------------------------------------------------------