% Contributed by anonymous user % This file may be distributed freely, with or without modification. This notice does not need to be preserved. % Linear Feedback Shift Register % (Pseudorandom Number Generator) % Optionally load register A before starting % If not loaded, hexadecimal 42 will be used % Watch register A or flipdisc display for output % This thing could use some tuning, as bit 1 of the output seems to be stuck high. DECa SBRNS again LDL->a h42 :again LDL->b b01000000 ANDab->c SRc->b SRb->c SRc->b SRb->c SRc->b SRb->c PUSHc LDL->b b00010000 ANDab->c SRc->b SRb->c SRc->b SRb->c POP->b PUSHa XORbc->a MOVa->b POP->a ADDab->c ADDaa->b ADDbc->a DECxy WRxy<-a SBR again