Trailing-Edge
-
PDP-10 Archives
-
decuslib10-01
-
43,50053/getran.mac
There are 2 other files named getran.mac in the archive. Click here to see a list.
TITLE GETRAN GET BOTH HALVES OF RANDOM NUMBER
SUBTTL V.001 R.S.TOMLINSON 19 AUG 68
ENTRY GETRAN
INTERN GETRAN
EXTERN RAND
; GET BOTH HALVES OF RANDOM NUMBER
; THIS ROUTINE GETS THE ORIGIN OF THE RANDOM NUMBER SEQUENCE AND
; IS USED IN CONJUNCTION WITH SETRAN TO ALLOW A "RANDOM" NUMBER
; SEQUENCE TO BE REPEATED.
; THE FIRST RANDOM NUMBER GENERATED AFTER A CALL TO GETRAN WILL BE
; THE SAME AS THE FIRST RANDOM NUMBER GENERATED AFTER A CALL TO SETRAN
; WITH THE SAME ARGUMENTS. THUS IN THE FOLLOWING PROGRAM:
; CALL GETRAN(I,J)
; X=RANDOM(1.0,2.0)
; CALL SETRAN(I,J)
; Y=RANDOM(1.0,2.0)
; X AND Y WILL BE SET TO THE SAME NUMBER.
; CALL: JSA 16,GETRAN
; ARG 00,<WHERE TO PUT HIGH PART OF RANDOM NUMBER>
; ARG 00,<WHERE TO PUT LOW PART OF RANDOM NUMBER>
; . . .
GETRAN: 0
JSA 16,RAND ; GET A RANDOM NUMBER
MOVEM 0,@0(16) ; STORE IT IN THE ARGUMENTS
MOVEM 1,@1(16)
JRA 16,2(16)
END