flat assembler
Message board for the users of flat assembler.

Index > DOS > Random numbers...

Author
Thread Post new topic Reply to topic
peter_rk



Joined: 17 Apr 2005
Posts: 13
Location: somewhere in the world?
peter_rk 12 Dec 2005, 15:47
In QBasic, there is a rand function which returns a number from 0 to 1. How would I get a function that works a little like that for Assembly Language? I need not one but four independent random numbers at the same time.
Post 12 Dec 2005, 15:47
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7103
Location: Slovakia
vid 12 Dec 2005, 15:52
then look for some rand() function for one number and call it 4 times Smile No really, you can find good asm rand somewhere in this forum i think, generate 4 positive numbers with it, use floating point 1/generated value to get 0..1.

sorry, i'm too lazy to do the work for you
Post 12 Dec 2005, 15:52
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1164
Location: Overflow
Matrix 13 Dec 2005, 02:39
hello,

once i wrote random number generator routine too (for pentium and above), its better than the one was included in sphinX c-- for example,
i whould recommend you this thread, i remember i put it in the dos faq ...
i found this thread in 1 minutes searching for random number generator , and choosing search for all terms.

Random Numbers
Post 13 Dec 2005, 02:39
View user's profile Send private message Visit poster's website Reply with quote
peter_rk



Joined: 17 Apr 2005
Posts: 13
Location: somewhere in the world?
peter_rk 13 Dec 2005, 13:36
If I stop being a n00b soon it will be a miracle. I will read FAQ. I will read FAQ.

_________________
[insert witty remark here]
Post 13 Dec 2005, 13:36
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.