Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. ;-----------------------------------------------------------------------------+
  2. ; ”ã­ªæ¨ï £¥­¥à æ¨¨ á«ãç ©­®£® ç¨á«  ¢ ¤¨ ¯®§®­¥ 0..99999                     |
  3. ;-----------------------------------------------------------------------------+
  4. ;   ¢ë室¥  : eax - á«ãç ©­®¥ ç¨á«®                                          |
  5. ;-----------------------------------------------------------------------------+
  6. _random:
  7.     push    edx ecx ebx
  8.     mov     eax,ebx
  9.     or      eax,eax
  10.     jnz     @f
  11.     rdtsc
  12.     xor     eax,edx
  13.     mov     ebx,eax
  14. @@:
  15.     xor     edx,edx
  16.     mov     ecx,127773
  17.     div     ecx
  18.     mov     ecx,eax
  19.     mov     eax,16807
  20.     mul     edx
  21.     mov     edx,ecx
  22.     mov     ecx,eax
  23.     mov     eax,2836
  24.     mul     edx
  25.     sub     ecx,eax
  26.     xor     edx,edx
  27.     mov     eax,ecx
  28.     mov     ebx,ecx
  29.     mov     ecx,100000
  30.     div     ecx
  31.     mov     eax,edx
  32.     pop     ebx ecx edx
  33.     ret
  34. ;->
  35.