code_junkie

How to take the seed for a random generator from the clock, programming in assembler

Nov 11th, 2011
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. AcquireSeed PROC
  2.  
  3. PUSH AX
  4. PUSH CX
  5. PUSH DX
  6.  
  7. MOV Ah, 00h ; Int
  8. INT 1AH ; return the clock in CX:DX
  9.  
  10. MOV seed, DL ; save the less significant byte of the clock at seed (declared at .data)
  11.  
  12. POP DX
  13. POP CX
  14. POP DX
  15.  
  16. AcquireSeed endp
  17.  
  18. db 0Fh, 31h
Add Comment
Please, Sign In to add comment