; testLFSR : a simple example of a 16-bit LFSR ; version Sat, 17 Mar 2012 14:43:58 GMT .name testLFSR .profile YASEP16 ; R2 : POLY ; R5 : LFSR ; A3 : loop ; LFSR : mov 1234h R5 ; seed of the LFSR mov FFEDh R2 ; polynomial ; (it's just one of the 2048 polynomials ; with maximum length for 16-bits LFSRs) ADD 4 PC A3 ; loop entry ; generate 1 pseudo-random bit : ADD R5 R5 ; shift left with carry xor R2 R5 CARRY ; endless loop mov A3 PC