Path: csiph.com!news.swapon.de!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: kegs@provalid.com (Kent Dickey) Newsgroups: comp.sys.apple2.programmer Subject: Re: Linear Feedback Shift Register Date: Thu, 12 Sep 2024 03:58:35 -0000 (UTC) Organization: provalid.com Lines: 23 Message-ID: References: Injection-Date: Thu, 12 Sep 2024 05:58:35 +0200 (CEST) Injection-Info: dont-email.me; posting-host="fc59d029c600858a4e8ebc8941e2cb3e"; logging-data="85447"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+o3EH0nh9Bw0HFSjouNu/x" Cancel-Lock: sha1:kfo5Y82Jl5Ge91gj3woHGp5nDoI= Originator: kegs@provalid.com (Kent Dickey) X-Newsreader: trn 4.0-test76 (Apr 2, 2001) Xref: csiph.com comp.sys.apple2.programmer:6319 In article , Duhast wrote: >On 9/5/2024 4:13 PM, Kent Dickey wrote: > >> You should use PEEK(8192+I). That may be the only problem. >> > >Ok, it was a brain fart of 4096 vs 8192, and that was corrected, but I >still get bad numbers. > >I was running Applewin, and it gives me one set of numbers, with missing >ones and duplicates. I ran it under GSplus, and it gave me different >numbers, but no missing and one duplicate(but I think I know >why(executing loop an extra round)), I then ran it on real //gs hardware >and it matches the GSplus output. > >Shouldn't it always generate the same sequence with the same seed? Does >the EOR function not work right on a 6502 vs 65816, or is Applewin not >right? Your original code didn't initialize RAND to anything. So it may vary between systems. My modified code initialized it to 1. Kent