
/DEC-08-FMGB-PA
/DOUBLE PRECISION COSINE SUBROUTINE
/CALLS DEC-08-FMFA
/POINTERS TO DEC-08-FMFA FOLLOW
ARG=741
DSIN=400

*1000
DCOS,	0
	TAD I DCOS	/FETCH ADDRESS OF
	DCA ADDRSS	/ARGUMENT
	TAD I ADDRSS	/FETCH HIGH ORDER
	DCA EX		/ARGUMENT
	ISZ ADDRSS	/INCREMENT ADDRESS POINTER
	TAD I ADDRSS	/FETCH LOW ORDER
	DCA EX+1	/ARGUMENT
	TAD EX		/IS ARGUMENT EQUAL
	SZA CLA		/TO ZERO
	JMP TSIGNN	/NO: TEST THE SIGN
	TAD EX+1	/TEST LOW ORDER BITS
	SZA CLA		/FOR ZERO
	JMP TSIGNN	/NOT EQUAL TO ZERO
	CMA
	RAR
	DCA I ARGPNT
	CMA
	DCA I ARGPNT+1	/SET ANSWER TO 1
	JMP EXIT
TSIGNN,	TAD EX		/SEE IF X>0
	SMA CLA
	JMP ARGPOS	/ARGUMENT IS >0
	TAD EX+1	/ARGUMENT IS <0
	CLL CMA IAC	/NEGATE IT
	DCA EX+1
	TAD EX
	CMA
	SZL
	IAC
	DCA EX


/PAGE 2

ARGPOS,	CLL CLA
	TAD EX+1
	CMA IAC
	TAD PIOT+1	/SUBTRACT X FROM
	DCA EX+1	/PI/2
	TAD EX
	CMA
	SZL
	IAC
	TAD PIOT
	DCA EX
	JMS I DSINPT	/CALL SINE SUBROUTINE
	EX		/ARGUMENT ADDRESS
EXIT,	ISZ DCOS	/RETURN TO CALL+1
	JMP I DCOS	/ANSWER IN ARG,ARG+1
EX,	0
	0
ARGPNT,	ARG
	ARG+1
ADDRSS,	0
DSINPT,	DSIN
PIOT,	1444
	1767



PAUSE





/