I ported the Voyagers' Pseudorandom Number Generator to the HP41CX. It could be useful when exactly the same sequence of random numbers is necessary for tests.
Warnings first
Indispensable prerequisite is an HP-41CX either as real machine or running under a so-called "emulator" (one of the CPU-simulating kind). Any former OS of 41C or 41CV will probably fail, highly likely to produce a MEMORY LOST or even worse, alter memory silently. There are no safety measures to prevent you to carry out this misuse.
Intended use
VORANOGE.zip contains one "4k ROM file" in two different formats. The .MOD file may be used with V41 and the .BINJFG may be used with Emu41. See the emulators' description for details how to "plug-in application packs".
What else?
This module comes with two commands only, SEED and RN. SEED stores a number in X to a buffer as sequence start for RN. In case there is no seed when executing RN time serves as seed (some fraction of seconds to be precise). RN computes with the seed a pseudorandom number, saves it as new seed and sets it to stack register X. Regarding stack lift RN acts like RCL.
Note: the seed buffer is volatile, PACKing or a power cycle (OFF-ON) will flush it.
Few more details
XROM: 18
FUNC: 3
VERS: FX20
IRVC: no interrupt vector
CKSM: 091 (145 dec) ok
FAT:
XROM 18,00 -VORANOGE . . B013 * NP
XROM 18,01 RN. . . . . . B11D
XROM 18,02 SEED. . . . . B10E
Buffer-ID: 9
The fine print
VORANOGE is published under QPL, the Q Public License V 1.0 -- find it also in VORANOGE.zip
Final remark: this is not a request for comments or suggestions. But feel free to report errors.
/M.
Edit: stack lift mentioned