       .TITLE DMOD   REMAINDERING FOR DOUBLE ARGUMENTS  ARG1( MOD ARG2)
/ 
/ 
/                   FIRST PRINTING, FEBRUARY 1974
/ 
/ THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO 
/ CHANGE WITHOUT NOTICE AND SHOULD NOT BE CONSTRUED
/ AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
/ DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPON-
/ SIBILITY FOR ANY ERRORS THAT MAY APPEAR IN THIS
/ DOCUMENT.
/ 
/ THE SOFTWARE DESCRIBED IN THIS DOCUMENT IS FUR-
/ NISHED TO THE PURCHASER UNDER A LICENSE FOR USE ON
/ A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH
/ INCLUSION OF DIGITAL'S COPYRIGHT NOTICE) ONLY FOR 
/ USE IN SUCH SYSTEM, EXCEPT AS MAY OTHERWISE BE PRO-
/ VIDED IN WRITING BY DIGITAL.
/ 
/ DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY
/ FOR THE USE OR RELIABILITY OF ITS SOFTWARE ON EQUIP-
/ MENT THAT IS NOT SUPPLIED BY DIGITAL.
/ 
/ COPYRIGHT (C) 1974, BY DIGITAL EQUIPMENT CORPORATION
/ 
/ 
        .EJECT
/COPYRIGHT 1970,1971, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
/EDIT 4  6-24-71
/FOR HARDWARE FLOATING POINT PROCESSOR (FPP), DEFINE %FPP,
	.GLOBL DMOD,.DA,.AW,.AX
	.IFUND %FPP
	.GLOBL .AO,.AS,.AT,.AU,.AV
	.ENDC
	.IFUND %FPP
	.DEFIN DLD%,A
	JMS* A			/DOUBLE LOAD (.AO)
	.ENDM
	.ENDC
	.IFDEF %FPP
DLD=713150
	.DEFIN DLD%
	DLD
	.ENDM
	.ENDC
	.IFUND %FPP
	.DEFIN DMP%,A
	JMS* A			/DOUBLE MULTIPLY (.AS)
	.ENDM
	.ENDC
	.IFDEF %FPP
DMP=711540
	.DEFIN DMP%
	DMP
	.ENDM
	.ENDC
	.IFUND %FPP
	.DEFIN DRS%,A		/DOUBLE REVERSE SUBTRACT
	JMS* A			/(.AV)
	.ENDM
	.ENDC
	.IFDEF %FPP
DRS=711140
	.DEFIN DRS%
	DRS
	.ENDM
	.ENDC
	.IFUND %FPP
	.DEFIN DRD%,A		/DOUBLE REVERSE DIVIDE
	JMS* A			/(.AV)
	.ENDM
	.ENDC
	.IFDEF %FPP
DRD=712540
	.DEFIN DRD%
	DRD
	.ENDM
	.ENDC
	.IFUND %FPP
	.DEFIN DDV%,A		/DOUBLE DIVIDE (.AT)
	JMS* A
	.ENDM
	.ENDC
	.IFDEF %FPP
DDV=712140
	.DEFIN DDV%
	DDV
	.ENDM
	.ENDC
/             CALLING SEQUENCE
/      JMS*   (DMOD)          SUBR CALL
/      JMP    .+3             SUBR RETURN
/      CAL/XCTADDR            ADDR OF ARG 1
/      CAL/XCTADDR            ADDR OF ARG 2  (XCT IF INDIRECT)
/
DMOD   CAL    0              /ENTRY-EXIT
       JMS*   .DA            /GET ARGUMENT (.DA)
       JMP    DMOD03
DMOD01 CAL    0              /ARG1
DMOD02 CAL    0              /ARG2
DMOD03 DLD%   .AO            /LOAD DOUBLE (.AO)
       .DSA   DMOD01+400000  / (ARG1)
       DDV%   .AT            /DIVIDE DOUBLE (.AT)
       .DSA   DMOD02+400000  /  (ARG1/ARG2)
       JMS*   .AX            /FIX TO INTEGER (.AX)
       JMS*   .AW            /FLOAT TO ACC (.AW)
       DMP%   .AS
       .DSA   DMOD02+400000
       DRS%   .AU            /REVERSE SUBTRACT DOUBLE
       .DSA   DMOD01+400000
       JMP*   DMOD           /EXIT
       .END
