From: Herbert Kleebauer on 27 Aug 2007 04:11 Betov wrote: > Frank Kotler <fbkotler(a)verizon.net> �crivait news:oJsAi.6811$yv3.5735 > > Work for you, Betov? > > :))))) > > shhhhhtttt. I am still trying to understand why Herbert > would not make use of an Assembly Random, that could be > initialized on RDTSC... Where is the problem? The problem is, that the 486 doesn't support the RDTSC instruction. And I only use the 486 instruction set (this principle saves me from adding new instructions to my assembler). Because I needed the RDTSC for some timing, it's already there, but in a readable form: move.l timestampcounter,r1|r0 But I still don't want to exclude the 486 (and Pentium I+II ??) users from such a nice little demo. When the original program was posted in 1994 by T.J.Clarke in rec.games.programmer I was fascinated by this 5 kbyte demo. Years later, when I again found it on my hard disk, I disassembled and completely rewrote it in assembler, reducing the size to 1077 bytes (ok, he used some unrolled loops which made it a little bit faster and maybe some parts were written in a HLL). > Then, a good and simple RND we have found, right here, > was the delphi one: There is a pseudo random generator include the erde source. > So... what? I need a true random value for the seed and this must work on a 486.
From: Betov on 27 Aug 2007 06:26 Herbert Kleebauer <klee(a)unibwm.de> �crivait news:46D28745.E9870DCE(a)unibwm.de: > this must work on a 486 OK. I am sure there still are some alive... but... Considering the expectable percentage of 486 around, and the expectable percentage of guys interrested with this inside this percentage... how do you evaluate the final percentage? Are you sure it is the right thing to consider? Betov. < http://rosasm.org >
From: rhyde on 27 Aug 2007 10:27 On Aug 27, 12:20 am, Betov <be...(a)free.fr> wrote: > Frank Kotler <fbkot...(a)verizon.net> écrivait news:oJsAi.6811$yv3.5735 > @trndny01: > > > Work for you, Betov? > > :))))) > > shhhhhtttt. I am still trying to understand why Herbert > would not make use of an Assembly Random, that could be > initialized on RDTSC... Where is the problem? Probably because *good* random number generators need to produce repeatable results (e.g., for debugging purposes). Probably because RDTSC, being a monotonically increasing counter, is not a particularly good choice for a seed of a "truly random" generator. Then again, we've seen *your* crappy RNG. It's been torn apart in this newsgroup before. Based on that, using RDTSC would probably produce wonderful results. Even if you called it for *every* number. hLater, Randy Hyde
From: Evenbit on 27 Aug 2007 21:21 On Aug 26, 11:14 am, Herbert Kleebauer <k...(a)unibwm.de> wrote: > > - Does Linux provide a random number? The Linux Developers recently let me in on a little-know secret. Just open a file-read the kernel source-code to supply the number series you want. The source is really just a bunch of random sillyness -- not the structured arrangement that everybody assumes it to be. Ssshhh! Don't tell anyone! ;-) Nathan.
From: Evenbit on 27 Aug 2007 21:31
On Aug 26, 11:14 am, Herbert Kleebauer <k...(a)unibwm.de> wrote: > > - Does Linux provide a random number? Had to use the time > as a workaround. On a more serious note: Because you are already making use of X functionality, why not just poll for the current mouse coordinates to provide you with an initial 'seed' value? I can't think of anything more random than user behaviour. > Then you should fix a bug (or download the latest version). > After 14 year of usage, I found that the generated code for > "rotate left byte" is wrong. If it was not a problem for 14 years, why change now? Microsoft's famous OS has been a bug that has plaqued the world's PCs for far longer than that -- and 'they' don't have any plans to 'fix' the issue. :) Nathan. |