[comp.sys.ibm.pc.misc] Random number generation

djb@bbt.UUCP (beauvais) (09/07/90)

In article <20092@orstcs.CS.ORST.EDU> densond@prism.CS.ORST.EDU (Dave Denson) writes:
>I need a way to generate suitably random numbers in an assembly language 
>program.


If it's non-critical, just try reading the time of day.  It is updated 18.2
times per second.  This is fine for a game, but surely isn't a true
randomly distributed set.


-- 
Dan Beauvais                        UUCP:      ...!mcnc!rti!bbt!djb
BroadBand Technologies, Inc.        Internet:  djb%bbt@rti.rti.org
Box 13737                           BITNET:    djb%bbt%rti.rti.org@CUNYVM
Research Triangle Park, NC  27709   +1 (919)-544-6850 ext. 295

hughes@volcano.Berkeley.EDU (Eric Hughes) (09/29/90)

In article <20092@orstcs.CS.ORST.EDU> densond@prism.CS.ORST.EDU (Dave
Denson) writes:
>I need a way to generate suitably random numbers in an assembly language 
>program.  Is there a routine somewhere out there that exist to accomplish
>this.  I could create your standard MOD-type generator, but I was hoping
>for a more elegant solution.

Assuming "suitable" in for case does not mean "random," but just
"evenly distributed," check the January 1990 issue of Communications
of the ACM for the article "Two Fast Implementations of the 'Minimal
Standard' Random Number Generator."  This is a mod-type generator.

And if it suffices, then, by virtue of its simplicity, it _is_ an
elegant solution.

Eric Hughes
hughes@ocf.berkeley.edu