Results 1 to 4 of 4

Thread: Random Integers

  1. #1
    sql_lall
    Guest

    Question Random Integers

    How do you get a random integer???
    (in Assembly)

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    You'll either have to write your own random number algorithm or link to the CRT.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3
    Junior Member
    Join Date
    Jun 2000
    Posts
    28
    Code:
    rand:
    mov eax,last_random
    mov edx,<CONST1>
    mul edx
    add eax,<CONST2>
    mov last_random,eax
    ret
    
    last_random dd <SEED>
    good enough for me

  4. #4
    sql_lall
    Guest

    TY

    OK, i will try to use it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width