is there a facility to generate a random number in assembly 8086??
1 reply to this topic
#1
Posted 25 December 2011 - 09:51 AM
|
|
|
#2
Posted 25 December 2011 - 11:04 AM
You could call the C function rand from assembly which is probably the easiest way.
You could write your own in assembly a number of different ways depending on how random you need it to be.
From getting the current time and coming up with a simple math algorithm. From allocating data and then using the memory address or using the garbage that's in that memory. Or go research psuedo random number generating algorithms and implement it in assembly.
There's also RNGers in hardware form that you can play around with interfacing if you're into system programming. Other then that I'm sure there's a cryptlib or rng library for assembly somewhere on the web.
You could write your own in assembly a number of different ways depending on how random you need it to be.
From getting the current time and coming up with a simple math algorithm. From allocating data and then using the memory address or using the garbage that's in that memory. Or go research psuedo random number generating algorithms and implement it in assembly.
There's also RNGers in hardware form that you can play around with interfacing if you're into system programming. Other then that I'm sure there's a cryptlib or rng library for assembly somewhere on the web.
"The best optimizer is between your ears" - Michael Abrash
Saying you can optimize a program is like saying you understand how a program works on every level of every facet on a specific machines configuration.
Saying you can optimize a program is like saying you understand how a program works on every level of every facet on a specific machines configuration.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top










