GRAN

Synopsis:

Generate random number.

Operation:

Random = Random #

Description:

This instruction generates a random number and places the result in the RANDOM special purpose register. The RANDOM register may be transferred to a general purpose register using the MFSPR instruction. The GRAN instruction will not cause any exceptions. The random number may be seeded by moving values to the SRAND1 and SRAND2 registers. Uses George Marsaglia's multiply method.
 

Format:

Opcode7 Reserved18 Func7
0   ---- 80