2014-10-21 01:46:42 +00:00
|
|
|
; unsigned long __cdecl _lrotl(unsigned long val, int rotate_count)
|
2014-11-05 17:20:02 +00:00
|
|
|
__lrotl proc
|
2014-10-21 01:46:42 +00:00
|
|
|
@@val = dword ptr (cPtrSize + 2)
|
|
|
|
@@rotate_count = word ptr (cPtrSize + 2 + 4)
|
|
|
|
|
|
|
|
push bp
|
|
|
|
mov bp, sp
|
|
|
|
push si
|
|
|
|
push di
|
|
|
|
mov ax, word ptr [bp+@@val]
|
|
|
|
mov dx, word ptr [bp+@@val+2]
|
|
|
|
mov cx, [bp+@@rotate_count]
|
|
|
|
and cx, 1Fh
|
|
|
|
jz short @@Rotated
|
|
|
|
|
|
|
|
@@Rotating:
|
|
|
|
rcl ax, 1
|
|
|
|
rcl dx, 1
|
|
|
|
adc ax, 0
|
|
|
|
loop @@Rotating
|
|
|
|
|
|
|
|
@@Rotated:
|
|
|
|
pop di
|
|
|
|
pop si
|
|
|
|
pop bp
|
|
|
|
ret
|
|
|
|
__lrotl endp
|