Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- LFSR: ; outputs random value in a
- ;Input: HL = ptr to seed
- ;Output: A = Random 8bit Number
- ;Destroys AF , HL
- ;Has a period of 255
- ;Each number will only show up once
- ; ld hl,lfsrseed
- ld a,(hl)
- or a
- rra
- jp nc,_
- xor %10111000 ;Taps on bits 7,5,4,3
- _:
- ld (hl),a
- ret
Advertisement
Add Comment
Please, Sign In to add comment