mul r9 r1 r7 ; r7 = x mod q
mul r8 r4 r6
sub r8 r9 r8
addq r5 r5 0 ; x = r9+m if r9 > 0
brpq next
add r5 r5 r2
stq r5 r0 x ; save new seed in mem[x]
next : div r5 r5 r10 ; r5 = r5/scale
stq r5 r0 result ; save random result in mem[result]
;
;------- End of generator algorithm
;
st r5 r9 list ; numbers stored starting from end of list
brq again
;
;------- All 100 numbers generated, so quit
;
done : stq r5 r0 donetrigger ; monitor address bus for "donetrigger" to stop timing
idle : brq idle ; busy loop
end |