/COPYRIGHT 1970, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
/EDIT 03P  10-14-70
       .TITLE RMNMX  MINUMUM-MAXIMUM FOR REAL ARGUMENTS
       .GLOBL AMAX1,AMIN1,MAX1,MIN1,.AX,.AH,.AG,.AM,.AB
	.GLOBL RMNMX
RMNMX=.
/             CALLING SEQUENCE
/      JMS*   (AMAX1,AMIN1,MAX1,MIN1)  SUBR CALL
/      JMP    .+(N+1)                  SUBR RETURN
/      /      CAL/XCTADDR(1)           ADDR OF ARG1
/      CAL/XCTADDR(2)                  ADDR OF ARG2
/
/
/      CAL/XCTADDT(N)                  ADDR OF ARG(N) (XCT IF INDIRECT)
/
/      .TITLE AMAX1  MAXIMUM WITH REAL ANSWER
AMAX1  CAL    0              /ENTRY-EXIT
       LAW    0              /SET FOR SMA(MAX)
       JMS    MNXR           /DETERMINE MIN-MAX
       JMP*   AMAX1          /EXIT
/      .TITLE AMIN1  MINIMUM WITH REAL ANSWER
AMIN1  CAL    0              /ENTRY-EXIT
       LAW    1000           /SET FOR SPA(MIN)
       JMS    MNXR           /DETERMINE MIN-MAX
       JMP*   AMIN1          /EXIT
/      .TITLE MAX1   MAXIMUM WITH INTEGER ANSWER
MAX1   CAL    0              /ENTRY-EXIT
       LAW    0              /SET FOR SMA(MAX)
       JMS    MNXR           /DETERMINE MIN-MAX
       JMS*   .AX            /FIX ANSWER TO INTEGER(.AX)
       JMP*   MAX1           /EXIT
/      .TITLE MIN1   MINIMUM WITH INTEGER ANSWER
MIN1   CAL    0              /ENTRY-EXIT
       LAW    1000           /SET FOR SPA (MIN)
       JMS    MNXR           /DETERMINE MIN-MAX
       JMS*   .AX            /FIX ANSWER TO INTEGER (.AX)
       JMP*   MIN1           /EXIT
       .EJECT
MNXR   CAL    0              /ENTRY-EXIT-
       TAD    MNXR15         /CONSTRUCT SMA(MAX) OR SPA(MIN) INSTRUCTIO
       DAC    MNXR01         /STORE SWITCH
       LAC    MNXR           /MASK OFF POSSIBLE
       AND    MNXR07         /SIGN BIT SET FROM
       DAC    MNXR           /LINK DURING JMS
       LAW    -3             /GET SUBR RETURN ADDR
       TAD    MNXR
       DAC    MNXR02
       LAC*   MNXR02
       AND    MNXR07         /CLEAR LINK
       DAC    MNXR02
       AND     MNXR03       /SAVE BANK BIT
       XOR*     MNXR02       /PICK UP -JUMP AROUND ARGS-INSTRUCTIONS
       AND     MNXR07       /KEEP ADDR ONLY
       CMA                   /GET TWO@S COMP +1
       TAD    MNXR04         /(ADD 2)
       TAD    MNXR02         /ADD START ADDR OF ARGS FOR -N
       DAC    MNXR05         /STORE -N
       ISZ    MNXR02         /SET POINTER TO FIRST ARG
       JMS    MNXR06         /GET ARG
MNXR16 JMS*   .AH            /STORE REAL (.AH)
       .DSA   MNXR08         / AS ANSWER
MNXR09 ISZ    MNXR05         /SET N=N+1
       JMP    MNXR10         /MORE ARGS-CONTINUE
       JMS*   .AG            /LOAD REAL (.AG)
       .DSA   MNXR08         / (ANSWER)
       JMP*   MNXR           /EXIT
MNXR10 JMS    MNXR06         /GET NEXT ARG
       JMS*   .AM            /REVERSE SUBTRACT REAL (.AM)
       .DSA   MNXR08         / (ANS-ARG(N))
       LAC*   .AB            /GET SIGN WORD (.AB)
MNXR01 CAL    0              /OPERATE SWITCH (SMA IF MAX,SPA IF MIN)
       JMP    MNXR09         /NOT MIN OR MAX, CYCLE
       JMS*   .AG            /LOAD REAL (.AG)
       .DSA   MNXR62+400000  / (ARG(N))
       JMP    MNXR16         /GO TO STORE AS ANSWER
MNXR06 CAL    0              /ENTRY-EXIT
       LAC*   MNXR02         /GET ARG ADDR
       SMA                   /IF NEG (XCT) GET ADDR INDIRECT
       JMP    MNXR61
       DAC    MNXR62
       LAC*   MNXR62
MNXR61 DAC    MNXR62         /STORE ARG ADDR
       JMS*   .AG            /LOAD REAL (.AG)
       .DSA   MNXR62+400000  / (ARG)
       ISZ    MNXR02         /BUMP POINTER
       JMP*   MNXR06         /EXIT
MNXR02 CAL    0              /POINTER
MNXR03	70000		/MASK FOR PDP15 BK AND PG BITS
MNXR04        2
MNXR05 CAL    0              /N
MNXR07        77777          /ADDRESS MASK
MNXR08 CAL    0              /ANSWER STORAGE 1
       CAL                   /               2
MNXR15        760100
MNXR62 CAL    0              /ADDR OF ARG(N)
       .END
