mirror of
https://github.com/PDP-10/its.git
synced 2026-03-25 01:47:08 +00:00
31 lines
444 B
Plaintext
31 lines
444 B
Plaintext
;
|
|
; random - random number generator (stolen from muddle)
|
|
;
|
|
; this file is pdp-10 dependent, system-independent.
|
|
;
|
|
|
|
title random
|
|
.insrt c:minsrt
|
|
|
|
centry srand,[seed]
|
|
move a,seed
|
|
rot a,-1
|
|
movem a,rlow
|
|
return
|
|
|
|
centry rand
|
|
move a,rhi
|
|
move b,rlow
|
|
movem a,rlow ;update low seed
|
|
lshc a,-1 ;shift both right one bit
|
|
xorb b,rhi ;generate output and update high seed
|
|
move a,b
|
|
return
|
|
|
|
.idata
|
|
rhi: 267762113337
|
|
rlow: 155256071112
|
|
.code
|
|
|
|
end
|