views:

404

answers:

1

Compiler, TASM 5

Architecture x86.

For a random number generator algorithm, take tha clock as the seed.


I found that solution:

AcquireSeed PROC

    PUSH AX
    PUSH CX
    PUSH DX

    MOV Ah, 00h ; Int
    INT 1AH  ; return the clock in CX:DX

    MOV seed, DL ; save the less significant byte of the clock at seed (declared at .data)

    POP DX
    POP CX
    POP DX

AcquireSeed endp
+2  A: 

Not sure what you mean by the question, but are you possibly looking for RDTSC?

If so, it's not directly supported by TASM but you can insert the opcode for it with

db 0Fh, 31h