4 * [Generated from rand, 25 September 1996]
7 #if !defined(__CC_NORCROFT) || !defined(__arm)
8 #error You must use the Norcroft ARM Compiler for Sapphire programs
11 #pragma include_only_once
12 #pragma force_top_level
21 /*----- Overview ----------------------------------------------------------*
35 * On exit: R0 == a pseudorandom number between 0 and &7FFFFFFF
37 * Use: Returns a pseudorandom number. The algorithm used is the
38 * additive generator found in Knuth. The table is generated
39 * from the current monotonic time using a linear congruential
40 * generator. Randomness is fairly good, and it's very quick.
45 /* --- rand_setSeed --- *
47 * On entry: R0 == a pseudorandom seed
51 * Use: Sets up the random number generator (rand) to the given start
52 * position. The table of values is initialised from the seed
53 * in a psuedorandom manner, using a linear congruential
57 extern routine rand_setSeed;
61 * On entry: R0 == start value (inclusive)
62 * R1 == end value (inclusive)
64 * On exit: R0 == random number between the boundaries given
66 * Use: Returns a random integer between the boundaries given.
67 * The distribution is slightly skewed towards lower numbers,
68 * but there's not a lot I can do about this, folks.
73 /* --- rand_init --- *
79 * Use: Initialise the random number table.
82 extern routine rand_init;
84 /*----- That's all, folks -------------------------------------------------*/