       .TITLE MOD    REMAINDERING FOR INTEGER ARGUMENTS  ARG1(MOD ARG2)
/COPYRIGHT 1970, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
       .GLOBL MOD,.DA,.AE,.CO
/             CALLING SEQUENCE
/      JMS*   (MOD)           SUBR CALL
/      JMP    .+3             SUBR RETURN
/      CAL/XCTADDR            ADDR OF ARG1
/      CAL/XCTADDR            ADDR OF ARG2  (XCT IF INDIRECT)
/
MOD    CAL    0              /ENTRY-EXIT
       JMS*   .DA            /GET ARGUMENTS (.DA)
       JMP    MOD03
MOD01  CAL    0              /ARG1
MOD02  CAL    0              /ARG2
MOD03  LAC*   MOD01          /LOAD ARG1
       JMS*   .AE            /INTERGER DIVIDE (.AE)
       LAC*   MOD02          /  (ARG1/ARG2)
       LAC*   MOD01          /GET ARG1
       RCL                   /SHIFT SIGN TO LINK
       LAC*   .CO            /GET REMAINDER FROM INTEGER DIVIDE (.CO)
       SNL                   /IF NO LINK EXIT
       JMP*   MOD            /EXIT
       CMA                   /OR TWOS COMP
       TAD    MOD04          /(1)
       JMP*   MOD            /EXIT
MOD04         1
       .END
