Advertisement
EddyCZ

Untitled

Oct 12th, 2023
1,141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .model small
  2. .data
  3. seed dw 0
  4.  
  5. .code
  6. org 100h  ; Set the program entry point to 100h
  7.  
  8. main:
  9.     mov ax, 40h     ; Function to get system time
  10.     int 21h         ; Call DOS interrupt
  11.     mov bx, dx      ; Store the time in bx (a 16-bit register)
  12.  
  13.     mov ax, bx      ; Use bx as the seed
  14.     imul ax, 25173  ; Multiply by a constant
  15.     add ax, 13849  ; Add another constant
  16.     xor dx, dx      ; Clear dx
  17.     div word ptr [seed]  ; Divide by the seed (word_87CA in your original code)
  18.     mov [seed], ax  ; Store the new seed
  19.  
  20.     ; Now, ax contains a pseudo-random number between 0 and 65535
  21.  
  22.     ; Your code here to use the random number as needed
  23.  
  24.     int 20h         ; Terminate the program
  25.  
  26. end main
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement