User Tools

Site Tools


base:16bit_pseudo_random_generator

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

base:16bit_pseudo_random_generator [2015-04-17 04:30] (current)
Line 1: Line 1:
 +====== 16 bit Pseudo Random Generator ======
  
 +The original creator of this routine is unknown.
 +
 +<​code>​
 +;​---------------------------------------------------------------------------
 +;​pseudo-random routine, value in random+1 (akku also) and random
 +;​---------------------------------------------------------------------------
 +getrandom:
 +
 +         lda random+1
 +         sta temp1
 +         lda random
 +         asl a
 +         rol temp1
 +         asl a
 +         rol temp1
 +         clc
 +         adc random
 +         pha
 +         lda temp1
 +         adc random+1
 +         sta random+1
 +         pla
 +         adc #$11
 +         sta random
 +         lda random+1
 +         adc #$36
 +         sta random+1
 +
 +         rts
 +
 +temp1: ​  .byte $5a
 +random: ​ .byte %10011101,​%01011011
 +</​code>​
base/16bit_pseudo_random_generator.txt ยท Last modified: 2015-04-17 04:30 (external edit)