Advertisement
Zeda

LFSR24 (eZ80)

Apr 27th, 2015
664
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. LFSR24:
  2. ;;ADL mode expected
  3. ;;Input: (seed1) is non-zero
  4. ;;Output: (seed1) updated, HL is the result
  5. ;;Destroys: A
  6. ;;30cc (-3cc if using SMC)
  7. #IF smc == 0
  8.     ld hl,(seed1)
  9. #ELSE
  10. seed1 = $+1
  11.     ld hl,1
  12. #ENDIF
  13.     ld a,l
  14.     add hl,hl
  15.     rla
  16.     and %00010111
  17.     jp po,$+5
  18.     inc l
  19.     ld (seed1),hl
  20.     ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement