The ASL is used to clear the carry flag, so that the output function is bijective (invertible). The first part of the code
Code: Select all
CLC
LDA #1 ; any odd value
ADC s+0
STA s+0
ADC s+1
STA s+1
has a cycle length of 65536, going through each 16 bit value exactly once before repeating. However, the random quality is poor, so this is followed by an output function to make it more random. In order to keep the property that each value appears exactly once, this extra output function must be invertible. Now, an EOR operation is invertible, if you know one of the operands, however, an ADC is only invertible if you also know the carry state before the ADC. Since the code above leaves the carry in a random state, we need to define it. That's what the ASL does, in a tricky way.
ASL followed by ADC #0 performs an 8 bit rotate left of the accumulator, and clears the carry. The rotate left is invertible, and helps with the randomness. In the code, there's no ADC #0, but ADC s+0, which does the same thing as ADC #0, but also adds s+0 as a bonus.
If you remove the ASL, there will be 256 values that appear twice in the 65536 cycle period, and 256 other values that don't appear at all.