home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Trees / V6 / usr / source / s3 / rand.s < prev    next >
Encoding:
Text File  |  1975-05-13  |  290 b   |  28 lines

  1. / random fixed point number generator
  2.  
  3. .globl    rand, srand
  4. .globl    _rand, _srand
  5.  
  6. _srand:
  7.     mov    2(sp),ranx
  8.     rts    pc
  9.  
  10. srand:
  11.     mov    r0,ranx
  12.     rts    pc
  13.  
  14. _rand:
  15. rand:
  16.     mov    r1,-(sp)
  17.     mov    ranx,r1
  18.     mpy    $13077.,r1
  19.     add    $6925.,r1
  20.     mov    r1,r0
  21.     mov    r0,ranx
  22.     bic    $100000,r0
  23.     mov    (sp)+,r1
  24.     rts    pc
  25.  
  26. .data
  27. ranx:    1
  28.