daily pastebin goal
89%
SHARE
TWEET

LFSR24 (eZ80)

Zeda Apr 27th, 2015 189 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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top