Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-01 - decus/20-0009/random.mac
There are 5 other files named random.mac in the archive. Click here to see a list.
TITLE RANDOM NUMBER GENERATOR
;CALLED BY    CALL RANDOM(R), WHERE R IS RETURNED, -1.0<R>1.0
;    OR BY    A=RANDOM(R), EQUIVALENT TO CALL RANDOM(R), A = R
;Calling convention changed by Paul T. Robinson, Wesleyan Univ.
;for DECUS conversion to DEC-20 library.
         ENTRY RANDOM
RANDOM:  MOVEM 01, SAVAC1
         MOVE 00, VAR
         MUL 00, CONST
         ASHC 00, 5
         MOVEM 00, SIGN      ;SAVE FOR SIGN BIT
         SETZ 00,
         ASHC 00, -5
         MOVEM 01, VAR
         ASHC 00, 40
         TLC 00, 200000      ;FLOAT
         MOVE 01, SIGN       ;GET A SIGN BIT
         TRNE 01, 1
         MOVNS 00
         FADR 00, NORM       ;NORMALIZE
         MOVEM 00, @0(16)
	popj	17,
VAR:     OCT 5343277245
CONST:   OCT 5343277245
NORM:    OCT 200000000000
SIGN:    BLOCK 1
SAVAC1:  BLOCK 1
         END