/
/
/
/	A  M  O  D
/	-  -  -  -
/
/SUBROUTINE	AMOD(X,Y)
/
/ VERSION 5A 4-27-77  PT
/
	SECT	AMOD
	ENTRY	MOD
	JA	#AMOD
	TEXT	+AMOD  +
AMODXR,	SETX	XRAMOD
	SETB	BPAMOD
BPAMOD,	F 0.0
XRAMOD,	F 0.0
AMODX,	F 0.0
	ORG	10*3+BPAMOD
	FNOP
	JA	AMODXR
	0
	AMDRTN,	JA	.
	EXTERN	#ARGER
AMODER,	TRAP4	#ARGER
	FCLA
	JA	AMDRTN
	BASE	0
MOD,
#AMOD,	STARTD
	FLDA	10*3
	FSTA	AMDRTN
	FLDA	0
	SETX	XRAMOD
	SETB	BPAMOD
	BASE	BPAMOD
	LDX	1,1	
	FSTA	BPAMOD
	FLDA%	BPAMOD,1   /ADDR OF X
	FSTA	AMODX
	FLDA%	BPAMOD,1+  /ADDR OF Y
	FSTA	BPAMOD
	STARTF
	FLDA%	BPAMOD		/GET Y
	JEQ	AMODER		/Y=0 IS ERROR
	JGT	.+3
	FNEG		/ABS VALUE
	FSTA	BPAMOD
	FLDA%	AMODX	/GET X
	JGT	.+5
	FNEG		/ABS VALUE
	LDX	0,1		/NOTE SIGN
	FSTA	AMODX	/SAV IN A TEMPORARY
	FDIV	BPAMOD	/DIVIDE BY Y
	JAL	AMODER		/TOO BIG.
	ALN	0		/FIX IT UP NOW.
	FNORM
	FMUL	BPAMOD		/MULITPLY IT.
	FNEG			/NEGATE IT.
	FADD	AMODX		/AND ADD IN X.
	JXN	AM,1		/CHECK SIGN
	FNEG
AM,	JA	AMDRTN
