Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- random:
- pusha
- mov ah, 0x00
- int 0x1A
- ror dx,2 ; Copied from os-dev because time
- shr dx, 14
- xchg dl,dh
- mov word [r_X], dx
- ; a * X
- mov word ax, [r_a]
- mov bx, dx
- xor dx, dx
- mul bx
- ; + c
- add ax, [r_c]
- mov word [r_X], ax
- ; mod m
- xor dx, dx
- mov word bx, [r_m]
- mov ax, [r_X]
- div ax
- ; X =
- mov [r_X], ax
- popa
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement