1: / fortran random number generator.
   2: / either single or double prec.
   3: 
   4: .globl  rand., srand.
   5: .globl  retrn
   6: 
   7: srand.:
   8:         value
   9:         .+2
  10:         mov     *2(r3),seed1
  11:         inc     first
  12:         jmp     retrn
  13: 
  14: rand.:
  15:         value
  16:         .+2
  17:         tst     first
  18:         bne     1f
  19:         sys     time
  20:         mov     r1,seed1
  21:         inc     first
  22: 1:
  23:         mov     seed1,r1
  24:         jsr     pc,ran
  25:         mov     r1,seed1
  26:         seti
  27:         setd
  28:         movif   r0,fr0
  29:         divf    $44000,fr0
  30:         movf    fr0,value
  31:         jmp     retrn
  32: 
  33: ran:
  34:         mpy     $13077.,r1
  35:         add     $6925.,r1
  36:         mov     r1,r0
  37:         bic     $100000,r0
  38:         rts     pc
  39: 
  40: .bss
  41: first:  .=.+2
  42: seed1:  .=.+2
  43: value:  .=.+8

Defined functions

ran defined in line 33; used 1 times
  • in line 24
rand. declared in line 4; defined in line 14; used 1 times
  • in line 4
srand. declared in line 4; defined in line 7; used 1 times
  • in line 4

Defined variables

first defined in line 41; used 3 times
seed1 defined in line 42; used 4 times
value defined in line 43; used 3 times
Last modified: 1975-07-17
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 349
Valid CSS Valid XHTML 1.0 Strict