In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Jon Williams wrote: The RANDOM function is SX/B is very simple, yet has good distribution only repeats after 256 iterations. ; seed = seed * 5 + 123 Random MOV W, seed ADD seed, W ADD seed, W ADD seed, W ADD seed, W ADD seed, #123 RETP ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=90112#m90144 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)