]> git.sur5r.net Git - cc65/commitdiff
Merge pull request #438 from bbbradsmith/ca65_rand_comment
authorOliver Schmidt <ol.sc@web.de>
Fri, 26 May 2017 13:16:42 +0000 (15:16 +0200)
committerGitHub <noreply@github.com>
Fri, 26 May 2017 13:16:42 +0000 (15:16 +0200)
rand.s comment update

libsrc/common/rand.s

index 8ad7bcdb48bd575539948fdc6852b3dfdd992f46..102dd5be2fa9c5a34123b91b4d2cef8583ddcc95 100644 (file)
@@ -2,6 +2,7 @@
 ; Randum number generator
 ;
 ; Written and donated by Sidney Cadot - sidney@ch.twi.tudelft.nl
+; 2016-11-07, modified by Brad Smith
 ;
 ; May be distributed with the cc65 runtime using the same license.
 ;
 ;  Multiplier must be 1 (mod 4)
 ;  Added value must be 1 (mod 2)
 ;  This guarantees max. period (2**32)
-;  Bits 8-22 are returned (positive 2-byte int)
-;  where 0 is LSB, 31 is MSB.
-;  This is better as lower bits exhibit easily
-;  detectable patterns.
+;  The lowest bits have poor entropy and
+;  exhibit easily detectable patterns, so
+;  only the upper bits 16-22 and 24-31 of the
+;  4-byte state are returned.
+;
+;  The best 8 bits, 24-31 are returned in the
+;  low byte A to provide the best entropy in the
+;  most commonly used part of the return value.
 ;
 
         .export         _rand, _srand