c++ - How I can get the random number from Intel's processor with assembler? -


I need to get a random number from Intel's random generator in the processor (Intel Core i3). I do not want to use any library I want to use coded paste in C ++, but I do not know which registers and instructions should be used.

Supported CPUs (currently only on Ivy Bridge and Haswell Intel CPU) RDRAND Calling the direction will place a random value in a specified register. For example, this will give you a random 64-bit value:

  RDRAND% rax   

On the success, the carrying bit will be set. See Intel for more details ("Bull Mountain" is the code name for Intel's hardware RNG.)

Comments