Trailing-Edge
-
PDP-10 Archives
-
decus_20tap1_198111
-
decus/20-0013/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>
; . . .
; Modified to PUSHJ/POPJ calling convention 11 Oct 1980
; by Paul T. Robinson, Wesleyan Univ. for DECUS conversion to DEC-20
; Calling sequence is
; movei 16,[exp <where to put high part>
; exp <where to put low part>]
; pushj 17,getran
GETRAN: pushj 17,rand ;get random number
MOVEM 0,@0(16) ; STORE IT IN THE ARGUMENTS
MOVEM 1,@1(16)
popj 17,
END