SHUFFLE2 We're talking conglamorates here, folks. First SHUFFLE.C (from SIMTEL20's SHUFFLE.ZIP), written by: David Wesson, PhD. Newcastle Business School MKU2@UK.AC.NEWCASTLE-POLY.VAXA (More glory to the good Doctor for the idea.) Then a handy random number generator cribbed from a FIDO 8086 Echo msg. (The Lou Ciriello msg in the source) Then a clean way to seed our random number generator from the real-time clock (the Nick Downing msg in the source). Then a chunk of ItoA from one place, and an AtoI from somewhere else (since the AtoI from the first package was horrible and only 8-bit). Mix thoroughly; add some specific stuff (like the STDOUT output w/linewrap while we're doing our ItoA conversion); optimize here and there; put as much as possible on silicon (e.g. in registers rather than in memory). Bake at 350 degrees for 45 minutes, serve warm. Additions to the basic concept: - Check to see exactly how much room we have for our array numbers (rather than an arbitrary "10000" limit as in SHUFFLE.C). - Increase the padding for each number up to 6 spaces (so we can now display numbers bigger than 9999). - Display "Press any key to abort" to STDERR so it doesn't end up being redirected to a file or device or something. (I'd imagine output would be redirected to a file, since you can't do much with a stream of numbers on the screen. In that case, *all* you'd want in that output would be numbers, right?) - The .ASM source is now smaller than the C executable! Timing Results (in seconds) running SHUFFLE.EXE and SHUFFLE2.COM (hadda call it *something* different, eh?) with "1 9999" parameters. STDOUT NUL SHUFFLE.EXE 55.81 17.08 SHUFFLE2.COM 50.21 8.95 You can see how screen output significantly slowed them both down. But when you redirect to NUL .. hoo boy! No more feelthy output, and the benefits of hand-coded assembly language show clearly. Seems to work just fine. Get back to me if you find a bug. Released to the public domain. David Kirschbaum Toad Hall kirsch@sesi.com