Re: RND Contest (3)




; eax:uint RND_Multiineare(void);
; risultato in eax numero pseudocasuale tra 0 e 0x7FFFFFFF
_RND_Multilinear_m:
push ebx
push ecx
push edx
push esi
mov eax, D$index1
lea ebx, D$base+ eax*4
lea ecx, D$seed+ eax*4
lea edx, D$seed0+eax*4
inc D$conta+eax*4 ; ogli xxx volte cambia il seed
mov esi, D$conta+eax*4
and esi, 0FFFh
cmp esi, 0FFFh
jne b0>
pushad
call 'KERNEL32.GetTickCount'
and eax, 0FFFFh
mov D$ora, eax
popad
mov eax, D$ecx
and eax, 0FFFF0000h
or eax, D$ora

mov D$ecx, eax

b0:
push edx
push ecx
push ebx
call _RND_MultiL
mov ebx, eax
mov cl, ah
shr ebx, 1
and ecx, 0Fh
and ebx, 0Fh
cmp ebx, D$index1
jne c0>
inc ebx
and ebx, 0Fh
c0: ; 0..7<->24..31, 8..15<->16..23
bswap eax
test eax, 080000000h
jz c2>
or ax, 080h
and eax, 07FFFFFFFh
c2:
xor eax, D$seed + ebx*4
mov D$index1, ecx
.c1:
and eax, 07FFFFFFFh
pop esi
pop edx
pop ecx
pop ebx
ret

.



Relevant Pages

  • Re: Macro2D
    ... õ1, eax", 0 ... db "push striIIi", NL ... db ".2: cmp edi, ebp", NL ... db ".4: mov eax, edi", NL ...
    (alt.lang.asm)
  • One RosAsm Pre-parser
    ... cmp eax 0 | ja L0<< ... mov ecx, D ...
    (alt.lang.asm)
  • Re: Macro2D
    ... mov, eax ... cmp eax, -1 ... push STD_INPUT_HANDLE ...
    (alt.lang.asm)
  • ascii to st0
    ... push IDC_ARROW ... cmp eax, 0 ... mov ebp, esp ... cmp dword @Message, WM_CLOSE ...
    (alt.lang.asm)
  • Re: Insert a byte
    ... push ebx ... mov ebx, dword ... cmp dword, 0 ... ..e0: xor eax, eax ...
    (alt.lang.asm)