Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .model small
- .data
- seed dw 0
- .code
- org 100h ; Set the program entry point to 100h
- main:
- mov ax, 40h ; Function to get system time
- int 21h ; Call DOS interrupt
- mov bx, dx ; Store the time in bx (a 16-bit register)
- mov ax, bx ; Use bx as the seed
- imul ax, 25173 ; Multiply by a constant
- add ax, 13849 ; Add another constant
- xor dx, dx ; Clear dx
- div word ptr [seed] ; Divide by the seed (word_87CA in your original code)
- mov [seed], ax ; Store the new seed
- ; Now, ax contains a pseudo-random number between 0 and 65535
- ; Your code here to use the random number as needed
- int 20h ; Terminate the program
- end main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement