

The result is all the numbers from 0-255 rearranged ' This program uses a linear-feedback shift register (LFSR) to generate However, there is a link to how you would write the program using 8-bit 6502 assembly. As it is written, it actually uses 16-bit integers, but, that's only because FreeBASIC doesn't have native access to the CPUs registers. However, it was very popular with 8-bit computers because it uses very little memory, takes only around a dozen clock cycles, and random enough for non-secure use.īelow is the source and beyond that a compiled Windows binary. This method of generating pseudorandom numbers was developed in 1965 and is no longer used in modern programming because the random sequence has various problems. 8-bit LFSR Randomizer is a program I wrote in FreeBASIC which demonstrates one of the ways programmers used a linear-feedback shift register to generate pseudorandom numbers.
