Google
 

Trailing-Edge - PDP-10 Archives - decus_20tap1_198111 - decus/20-0013/grand.mac
There are 2 other files named grand.mac in the archive. Click here to see a list.
	TITLE	GRAND GAUSSIAN RANDOM NUMBER GENERATOR
	SUBTTL	V.001  R.S.TOMLINSON  20 AUG 68
	ENTRY	GRAND
	INTERN	GRAND
	EXTERN	RANDOM,ALOG,SIN,SQRT

; CALL:	JSA 16,GRAND
;	ARG 02,<MEAN>
;	ARG 02,<VARIANCE>
;	RESULTS IN AC0

; Modified to PUSHJ/POPJ calling convention 11 Oct 1980
; by Paul T. Robinson, Wesleyan Univ. for DECUS conversion to DEC-20
; call:	movei	16,[exp	<mean>
;		    exp	<variance>]
;	pushj	17,grand
;	results in ac0

;GRAND:	JSA 16,RANDOM
;	JUMP 2,[0]
;	JUMP 2,[1.0]
grand:	push	17,16	;save arg pointer
	movei	16,[exp	0, 1.0]
	pushj	17,random
	MOVEM 0,T1#
;	JSA 16,RANDOM
;	JUMP 2,[0]
;	JUMP 2,[6.28318531]
	movei	16,[exp 0, 6.28318531]
	pushj	17,random
	MOVEM 0,T2#
;	JSA 16,ALOG
;	JUMP 2,T1
	movei	16,[exp t1]
	pushj	17,alog
	FSC 0,1
	MOVNM 0,T1
;	JSA 16,SQRT
;	JUMP 2,T1
	movei	16,[exp t1]
	pushj	17,sqrt
	MOVEM 0,T1
;	JSA 16,SIN
;	JUMP 2,T2
	movei	16,[exp t2]
	pushj	17,sin
	pop	17,16	;restore original pointer
	FMPR 0,T1
	FMPR 0,@1(16)
	FADR 0,@0(16)
	popj	17,

	END