home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
CPM
/
ZCPR33
/
S-Z
/
SLB36HLP.LBR
/
SYSLIBH.HZP
/
SYSLIBH.HLP
Wrap
Text File
|
2000-06-30
|
2KB
|
68 lines
:Random Number Generator Routines
The Random Number Generator Routines are:
RNDINIT - Initializes the Generator Seed on user
keypress
RNDSEED - Allows user to provide a seed
RND - Returns a Pseudo-Random Number
Routine: RNDINIT
Function:
RNDINI╘ enter≤ ß countinτ loop¼ waitinτ fo≥ thσ use≥ t∩ ì
strikσá ß ke∙ a⌠ hi≤ console«á I⌠ theε set≤ thσ seeΣá valuσ ì
fo≥á thσ randoφ numbe≥ generato≥ baseΣ upoε it≤ coun⌠á valuσ ì
a⌠á thσá instan⌠ oµ keypress«á Thσ seeΣ valuσ i≤á aεá 8-bi⌠ ì
quantit∙á maintaineΣ interna∞ t∩ thσ Randoφ Numbe≥ Generato≥ ì
module.
Inputs: None (User Keypress)
Outputs: None (Seed is set)
Registers Affected: None
SYSLIB Routines Called: CONDIN, RND
Special Error Conditions: None
Routine: RNDSEED
Function:
Thi≤á routinσá allow≤ thσ use≥ t∩ providσ ß seeΣá valuσ ì
fo≥ thσ randoφ numbe≥ generator«á Thσ seeΣ i≤ passeΣ iε thσ ì
┴á registe≥á anΣá storeΣá interna∞á t∩á thσá Randoφáá Numbe≥ ì
Generato≥ modulσ fo≥ late≥ usσ b∙ thσ RN─ routine.
Inputs: A = Seed
Outputs: None (Seed is set)
Registers Affected: None
SYSLIB Routines Called: RND
Special Error Conditions: None
Routine: RND
Function:
Thi≤ i≤ thσ user-callablσ randoφ numbe≥ generator«á I⌠ ì
return≤á ßá pseudo-randoφ numbe≥ (8-bit⌐ iε thσá ┴á registe≥ ì
wheε called« It≤ seeΣ valuσ ha≤ beeε se⌠ b∙ ß previou≤ cal∞ ì
t∩ RNDINI╘ o≥ RNDSEED.
Inputs: None
Outputs: A = Random Number
Registers Affected: PSW
SYSLIB Routines Called: None
Special Error Conditions: None