         PAGE
R0       EQU      0
R1       EQU      1
R2       EQU      2
R3       EQU      3
R4       EQU      4
R5       EQU      5
R6       EQU      6
R7       EQU      7
SR1      EQU      8
SR2      EQU      9
SR3      EQU      10
SR4      EQU      11
D1       EQU       12
D2       EQU      13
D3       EQU      14
D4       EQU      15
         PAGE
INTARG   DSECT    1
         TITLE    'INTARG'
         SYSTEM   SIG7
* INTARG          INTEGER ARGUMENT
*
* 12-08-67
*
* INPUT
*
*        R1       MINIMUM INTEGER VALUE
*        R2       MAXIMUM INTEGER VALUE
*        ARGBUFF  ARGUMENT BUFFER
*        NCHAR    LENGTH OF CURRENT ARGUMENT
*
* OUTPUT
*
*        R1       INTEGER IN BINARY
*        R2       TYPE OF RETURN (0-NORMAL,1-INVALID,2-RANGE)
*
         REF      NCHAR,ARGBUF4
         REF      BCD2BIN
*
         LCI      7                 SAVE REGISTERS
         PSM,R5   *R7
*
         STW,R1   R6                SAVE RANGE VALUES
         STW,R2   R5
*
         LI,R1    ARGBUF4+1         CONVERT INTEGER TO BINARY
         LW,R2    NCHAR,R7
         BAL,SR4  BCD2BIN
*
         CI,R4    0                 TEST FOR VALID CONVERSION
         BE       RANGE
         LI,R2    1                 FLAG INVALID INTEGER
         B        RETURN+1
*
RANGE    LW,R4    R6                EDIT RANGE OF INTEGER
         CLR,R4   R3
         BCR,6    RETURN
         LI,R2    2                 FLAG RANGE ERROR
         B        RETURN+1
*
RETURN   LI,R2    0                 RETURN TO CALLING PROGRAM
         LW,R1    R3
         LCI      7                 RESTORE REGISTERS
         PLM,R5   *R7
         B        *SR4
         END

