Category : Files from Magazines
Archive   : SCBENCH.ZIP
Filename : SCRAND.C
** 8088/8086 version
** rand(seed) - Generate a random number using a linear
** congruence generator. Seed is the initial seed for
** the generator. On subsequent calls to rand() seed should
** be set to the value of the previeous random number. i.e.:
** newrand = rand(oldrand);
*/
rand(seed) int seed; {
#asm
MOV BP,SP
MOV AX,2[BP] ;Get seed
MOV BX,58653
MUL BX
ADD AX,13849
MOV BX,AX
XOR CX,CX ;For Small-C
#endasm
}
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/