How do you produce an arbitrary number in assembly language using the FASM compiler?

Hey guys, I'm really new to the assembly, and I'm trying to create a simple program. To do this, I need to create a random number.

Does anyone know how I can do this with a FASM compiler?

Thanks Sam

+3
source share
4 answers

You can use a linear congruent algorithm. Its most common pseudo random number algorithm.

Basically, you have an initial value. And then, as soon as you start generating random numbers, each number becomes the seed for a new request.

Numbers are generated

x = (a * s + b) MOD m

m, a b . . , m 2, 2 ^ 32 32- . .

, a, b M .

(, )

+5

, .

: . OS C rand.

+1

.

, , ; , - - , , , . ( ). "" , .

" " (, ..). . . (Netscape , Netscape Navigator HTTPS-: Debian , SSH HTTPS/SSL).

0

Source: https://habr.com/ru/post/1702237/


All Articles