Article View: comp.os.msdos.programmer
Article #300Random numbers in assembly language
From: Eric
Date: Fri, 07 Aug 1992 16:56
Date: Fri, 07 Aug 1992 16:56
15 lines
1233 bytes
1233 bytes
If this is the wrong newsgroup, please forgive me. Since I don't get to
read this group very often, could you please e-mail all answers ?
What I am trying to do is shuffle a standard 52-card deck in assembly
language (doing it in high level is just to easy). I have all the cards
stored in memory (they're one byte each) and I want to exchange the first
card with a randomnly picked one, and then the second with another randomnly
picked one, and etc. until all 52 cards are exchanged in this manner. To
get my random card, I'm using the DOS interrupt read-time, but this is only
updated 18.5 times a second. So, how do you generate random numbers faster
then that because my shuffler currently takes about 2.5 seconds. There has
got to be a clock updated more often then the system clock, but where is it ?
Oh, this is 80x86 assembly language. That might help.
Kevin Furrow (f13@psuvm.psu.edu)
Technical Details
Message-ID:
<92220.125612F13@psuvm.psu.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!destroyer!gatech!psuvax1!psuvm!f13Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!destroyer!gatech!psuvax1!psuvm!f13 Organization: Penn State University Date: Fri, 7 Aug 1992 12:56:12 EDT From: Eric <F13@psuvm.psu.edu> Message-ID: <92220.125612F13@psuvm.psu.edu> Newsgroups: comp.os.msdos.programmer Subject: Random numbers in assembly language Lines: 15