I need a random number generator function written in nasm. I'm sorry for asking, but I couldn't find any!
A:
I don't know NASM, and I'm not in the habit of writing code on demand, unless they pay me.
But, here are algorithms you could investigate:
Merlyn Morgan-Graham
2010-10-15 11:36:46
+1
A:
In many cases a call to rdtsc
is enough. Anyway, it depends on your needs. It's perfect when you need a small random number rarely: rdtsc % N
, or as seed for more complicate algorithms for other cases.
ruslik
2010-10-15 11:49:44