Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- prng24:
- ;expects ADL mode
- ;collab with Runer112
- ;;Output:
- ;; HL is a pseudo-random int
- ;; A and BC are pseudo-random, but much weaker and smaller cycles
- ;; Preserves DE
- ;;41cc, super fast
- ;;30 bytes
- ;;period length: 281,474,959,933,440
- seed1=$+1
- ld hl,9999
- ld b,h
- ld c,l
- add hl,hl
- add hl,hl
- inc l
- add hl,bc
- ld (seed1),hl
- seed2=$+1
- ld hl,987
- add hl,hl
- sbc a,a
- and %00101101
- xor l
- ld l,a
- ld (seed2),hl
- add hl,bc
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement