home *** CD-ROM | disk | FTP | other *** search
/ Aminet 6 / Aminet 6 - June 1995.iso / Aminet / dev / gcc / libnixV0_8.lha / gnu / libnix-sources.lha / sources / amiga / misc / FastRand.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-12  |  253 b   |  22 lines

  1. #include <exec/types.h>
  2.  
  3. ULONG FastRand(ULONG seed)
  4. { ULONG a=seed<<1;
  5.   if((LONG)seed<=0)
  6.     a^=0x1d872b41;
  7.   return a;
  8. }
  9. /*
  10. asm("
  11.         .text
  12.  
  13.         .globl    _FastRand
  14.  
  15. _FastRand:    movel    sp@(4:W),d0
  16.         addl    d0,d0
  17.         bhis    L1
  18.         eoril    #0x1D872B41,d0
  19. L1:        rts
  20. ");
  21. */
  22.