*                 CATALOG NO. 704741 - SIGMA 5/7 BPM M:TREER
       CSECT       1
         SYSTEM   SIG7FDP
*
*
*        TREE CONTROL COMMAND PROCESSOR
*
*
*
*
       PAGE
*                 SYMBOLIC REGISTER DEF'S.
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
*                 CHANGE STACK POINTER AMOUNT SPEC. BY 1ST ARGUMENT.
*                 SECOND ARGUMENT SPEC. AVAILABLE REGISTER.
BUMP     CNAME
         PROC
LF       LI,AF(2) AF(1)
         MSP,AF(2)  TSTACK
         PEND
         REF      ILSEGNCD
*                 PUSH OR PULL N WORDS SPECIFIED BY 1ST ARGUMENT INTO
*                 REG'S STARTING AT 2ND ARGUMENT.
PUSH     CNAME    X'9',X'B'
PULL     CNAME    X'8',X'A'
         PROC
         DO       NUM(AF)=1
LF       GEN,1,7,4,3,17 0,NAME(1),AF(1),0,TSTACK
         ELSE
         DO       AF(1)=1
LF       GEN,1,7,4,3,17  0,NAME(1),AF(2),0,TSTACK
         ELSE
         DO       AF(1)=16
LF       LCI      0
         ELSE
LF       LCI      AF(1)
         FIN
         GEN,1,7,4,3,17  0,NAME(2),AF(2),0,TSTACK
         FIN
         FIN
         PEND
         PAGE
         DEF      TREER
         DEF      PTREER                                                741
         REF      ALOCCT
         REF      CHARSCAN
         REF      BLNKERCD
         REF      SYNTXER
         REF      ILCHERCD
         REF      TSTACK
         REF      NAMSCAN
         REF      CSL
         REF      PLB
         REF      CHSTSHFT
         REF      NOPGERR
         REF      X1
         REF      X1FF
         REF      X1FFFF
         REF      ROMTADR
         REF      TREETADR
         REF      SEGNAME
         REF      LINK1STROM
         REF      LSTROMLINK
         REF      TTESIZE
         REF      LINKNEXTROM
         REF      ROMTESIZE
         REF      EOCCSCAN
         REF      CJOB
         REF      SCCLF
         REF      GETACCN                                               741
         REF      GETPASSW                                              741
         REF      M:X1                                                  741
         REF      CONTR,CCP,OUTR,CCRSZ                                  741
         REF      CREAD,CCLIST                                          741
         REF      ACCBUF                                                741
         REF      CBUF                                                  741
         REF      Y002,RUNFLAG                                          741
         REF      Y08
         REF      Y0C
         REF      CHTBL
         REF      INHYPHEN,EXHYPHEN
         REF      PCCP
         PAGE
K0            EQU X'0'
K1            EQU X'1'
K3            EQU X'3'
K8       EQU      X'8'
K10           EQU X'10'
KFF      EQU      X'FF'
KN1           EQU -X'1'
KN1F     EQU      -X'1F'
KASTRIK  EQU      '*'
KBLANK        EQU ' '
KCOMMA        EQU ','
KHYPEN        EQU '-'
KLPAREN       EQU '('
KRPAREN       EQU ')'
BACKLINK      EQU 3
SUBLINK       EQU 4
OVLYLINK      EQU 4
LASTROMLINK EQU   LSTROMLINK
ROMTSIZE EQU      ROMTADR
ARS      EQU      4                                                     741
         PAGE
**********************************************************************
*        TREER    PROCESS TREE CONTROL COMMAND                       *
*        ENTER WITH                                                  *
*                 (R5) =  JIT POINTER                                *
*                 (R7) =  ADR OF PARAM LIST                          *
*                 (SR1)= CUR CHAR OR ZERO                            *
*                                                                    *
*                                                                    *
*                                                                    *
**********************************************************************
TREER    EQU      %
         PUSH     SR4
         BAL,SR4  INHYPHEN          MAKE HYPHEN A DELIMITER
         CI,SR1   KBLANK            CHECK FOR BLANK FOLLOWING COMMAND
         BNE      TREER5            ERROR IF NO BLANK             WORD
         LI,R4    2
         BAL,SR4  SCCLF
         LW,R4    ALOCCT,R5
         LW,D1    ROMTADR,R4        (D1) = BASE ADR OF ROMT
         AND,D1   X1FFFF
         LW,D2    TREETADR,R4       (D2) = BASE ADR OF TREE TABLE
         LW,D3    ROMTSIZE,R4
         SLS,D3   -17
         AW,D3    D1                (D3) = END ADR OF ROMT
         LI,R1    K1
         STW,R1   *D2               SET TREE TABLE HEAD POINTER = 1
         AW,R1    D2                (R1) = ADR OF CUR TREE TABLE ENTRY
         LI,R3    K0                ZER OUT LAST WORD FOR
         LI,R2    R7                EACH ROM ENTRY IN THE
         AW,R2    D1                ROM TABLE. (8TH WORD)
ZERROMT  STW,R3   *R2
         AI,R2    K8
         CW,R2    D3
         BL       ZERROMT
         LI,R2    K0
         STW,R2   BACKLINK,R1       SET LINKS IN
         STW,R2   SUBLINK,R1                    CUR TREE
         STW,R2   LSTROMLINK,R1                        TABLE =0
TREER1   EQU      %
         BAL,SR4  GETROMNAME        GET ROM NAME FROM TREE CC
         B        TREER7            ILLEGAL ROM NAME
         PUSH     8,D1
         LI,SR2   KHYPEN
         BAL,SR4  CHARSCAN          CHECK FOR HYPEN FOLLOWING ROM NAME
         BCS,8    TREER6            ERROR IF NO HYPEN
         LI,SR2   KLPAREN
         BAL,SR4  CHARSCAN          CHECK FOR LEFT PAREN FOLLOWING
         BCR,8    TREER2                                    THE HYPEN
         PULL     8,D1
         B        TREER1            GET NEXT ROM NAME
*
TREER2   EQU      %
         PULL     8,D1
         LI,R0    K0                SET ENTRY COUNT = 0
         BAL,SR4  RTR               GO TO RECURSIVE TREE ROUTINE
         B        TREER7            TREE CC ERROR
TREER4   EQU      %
         LI,R2    TTESIZE
         AI,R2    -1
         AWM,R2   *D2
         LI,SR2   '.'
         BAL,SR4  CHARSCAN
         BCR,8    TREER4A
         CI,SR1   X'26'
         BE       TREER4A
         CI,SR1   X'15'
         BNE      TREER6A
TREER4A  EQU      %
         BAL,SR4  EOCCSCAN
         LW,R1    *D2
         CI,R1    11                SI TREE 1 SEG LONK;G
         BLE      NORMEX            I.E. !TREE A-B-C
         PUSH     2,R5
         AW,R1    D2
         AI,D2    1
         LW,R3    D2                R3=PTR TO ROOT NAME
         LW,D2    R1
         AI,D2    -10               D2=PTR TO LAST SEG
*                                   NAME IN TREE TABLE
NXSGNM1  LW,R4    R3                R3=PTR TO SEG NAME
*
         AI,R4    11                FIXED DURING SEARCH
NXSGNM2  LB,R5    *R3               R5=TEXTC OF FIX NAME
         CB,R5    *R4
         BNE      NXTRNAM           IF TECTX SIZES NOT=
*                                   SKIP TO NEXT SUBS. NAME
         AI,R5    -1                SKIP ZEROED BYTE
NXTCHAR  LB,R6    *R3,R5            IF SIZES=, CKH CAHR
         CB,R6    *R4,R5
         BNE      NXTRNAM           IF NOT = CONTINU
         BDR,R5   NXTCHAR
         PULL     2,R5
         LI,SR3   ILSEGNCD
         B        TREER7
NXTRNAM  AI,R4    11
         CW,R4    R1
         BLE      NXSGNM2
*
MORFNM   AI,R3    11
         CW,R3    D2
         BL       NXSGNM1
NMOREX   PULL     2,R5
NORMEX   EQU      %
         PULL     SR4
         AI,SR4   K1
         B        TREER7A           NORMAL EXIT
*
TREER5   EQU      %
         LI,SR3   BLNKERCD
         B        TREER7
TREER6   EQU      %
         PULL     8,D1
         CI,SR1   '.'
         BE       TREER4
         CI,SR1   X'26'
         BE       TREER4
         CI,SR1   X'15'
         BE       TREER4
TREER6A  EQU      %
         LI,SR3   SYNTXER
TREER7   EQU      %
         PULL     SR4
         LI,R4    2
TREER7A  EQU      %
         PUSH     SR4
         BAL,SR4  EXHYPHEN          MAKE HYPHEN A LEGAL ALPHANUM. CHAR.
         PULL     SR4
         B        *SR4              RETURN
         PAGE
**********************************************************************
*        RTR      RECURSIVE TREE  ROUTINE                            *
*                 BUILDS ALL ENTRIES IN TREE TABLE EXCEPT FOR        *
*                 ROOT SEGMENT.                                      *
*                 ROUTINE IS CALLED WHEN LEFT PAREN IS ENCOUNTERED.  *
*                 ROUTINE IS EXITED WHEN RIGHT PAREN OR ERROR        *
*                 IS ENCOUNTERED.                                    *
*        ENTER WITH                                                  *
*                 (R0) =  RTR IN COUNT                               *
*                 (R1) =  ADR OF CURRENT TREE TABLE ENTRY            *
*                 (R2) =  ADR OF CUR BACK LINK TREE TABLE ENTRY      *
*                 (R3) =  ADR OF CUR OVERLAY LINK TREE TABLE ENTRY   *
*                 (D1) =  BASE ADR  OF ROMT                          *
*                 (D2) =  BASE ADR OF TREE  TABLE                    *
*                 (D3)  =  END ADR OF ROMT                           *
*                                                                    *
**********************************************************************
RTR      EQU      %
         PUSH     SR4
         PUSH     8,D1
         LI,SR2   KLPAREN
         BAL,SR4  CHARSCAN          CHECK FOR REDUNDANT LEFT PAREN
         BCR,8    RTR5              BRANCH IF YES
         PULL     8,D1
         STW,R1   R2                (R2) = ADR OF CUR BACK LINK TTE
         LI,R4    TTESIZE
         AWM,R4   *D2
         LW,R1    *D2               (R1) = ADR OF CUR TREE TABLE ENTRY
         AW,R1    D2
         STW,R1   D4                                           (ACTTE)
         SW,D4    D2                STORE ACTTE
         AI,D4    KN1
         SLS,D4   K10                          INTO
         STS,D4   SUBLINK,R2                     SUBLINK OF BACK LINK
RTR1     EQU      %
         LI,R0    K0                SET
         STW,R0   BACKLINK,R1          LINKS
         STW,R0   SUBLINK,R1                IN
         STW,R0   LASTROMLINK,R1              CTTE(CUR TREE TABLE ENTRY)
         STW,R2   D4
         SW,D4    D2
         AI,D4    KN1
         STS,D4   BACKLINK,R1       SET BACK LINK IN  CTTE
*
RTR2     EQU      %
         BAL,SR4  GETROMNAME        GET ROM  NAME
         B        RTR10             ILLEGAL ROM NAME
         PUSH     8,D1
         LI,SR2   KHYPEN
         BAL,SR4  CHARSCAN          CHECK FOR HYPEN AFTER ROM NAME
         BCS,8    RTR6
         LI,SR2   KLPAREN
         BAL,SR4  CHARSCAN          CHECK FOR LEFT PAREN AFTER HYPEN
         BCR,8    RTR5
         PULL     8,D1
         B        RTR2              GET NEXT ROM NAME IN SEGMENT
*
RTR5     EQU      %
         PULL     8,D1
         PUSH     3,R1
         BAL,SR4  RTR               ENTER RECURSIVE TREE ROUTINE
         B        RTR9
         PULL     3,R1
         PUSH     8,D1
RTR6     EQU      %
         LI,SR2   KRPAREN
         BAL,SR4  CHARSCAN          CHECK FOR RIGHT PAREN
         BCR,8    RTR4              BRANCH IF RIGHT PAREN
         LI,SR2   KCOMMA
         BAL,SR4  CHARSCAN          CHECK FOR COMMA
         BCS,8    RTR8              BRANCH IF NOT COMMA
         PULL     8,D1
         STW,R1   R3                SET OVLAY LINK = ACTTE
         LI,R4    TTESIZE
         AWM,R4   *D2
         LW,R1    *D2
         STW,R1   D4
         AI,D4    KN1
         AW,R1    D2
         STS,D4   OVLYLINK,R3       STORE ACTTE INTO OVERLAY TTE
         B        RTR1
*
*
*
RTR4     EQU      %
         PULL     8,D1
         PULL     SR4
         AI,SR4   K1
         B        *SR4              EXIT
RTR8     EQU      %
         LI,SR3   ILCHERCD          (SR3) = ILLEGAL CHAR CODE
         PULL     8,D1
         B        RTR10
RTR9     EQU      %
         BUMP     -3,R1
RTR10    EQU      %
         PULL     SR4
         B        *SR4              ERROR EXIT
         PAGE
**********************************************************************
*        GETROMNAME - GETS ROM NAME FROM TREE CC, SEARCHS ROMT       *
*                 FOR THE NAME. IF FOUND, LINKS NAME TO OTHER        *
*                 ROM'S IN SEGMENT AND STORES NAME IN CTTE           *
*                 IF FIRST ROM IN SEGMENT                            *
*                                                                    *
*                                                                    *
*                                                                    *
**********************************************************************
GETROMNAME EQU    %
         PUSH     5,R2
         PUSH     7,SR4
         LI,SR2   KASTRIK
         BAL,SR4  CHARSCAN          CHECK FOR * PRECEEDING NAME
         STCF     R2
         SLS,R2   KN1F
         EOR,R2   X1                (R2) =  * FLAG
         PUSH     R2
         BAL,SR4  NAMSCAN           GET NAME FROM CC
         BCS,8    GETROMNAME6       BRANCH IF ILLEGAL ALPHANUMERIC
         LW,R1    CSL,R7
         CI,R1    K10               CHECK IF <=10 CHAR
         BG       GETROMNAME6
         LW,R0    R7
         AI,R0    PLB
         LI,R2    K1
         BAL,SR4  CHSTSHFT          INSERT BYTE COUNT
         PULL     R2
         PULL     7,SR4
*
         LW,R3    R1                CHECK IF ROOM FOR 2 ENTRIES IN PAGE
         AI,R3    22
         AND,R3   X1FF
         CI,R3    20                IS MORE CORE NEEDED FOR CTTE
         BG       GETRMNM0A         NO
         PUSH,2   SR1
         LI,R3    1                 YES, GET ANOTHER PAGE
         OR,R3    Y08
         CAL1,8   3
         BCS,8    GETROMNAME8       DID WE GET ONE
         PULL,2   SR1               YES
GETRMNM0A EQU     %
         LW,R3    D1
         LI,R4    PLB
         AW,R4    R7
*
GETROMNAME1 EQU   %
         LB,R5    *R3
         CB,R5    *R4               COMPARE LENGTHS
         BNE      GETROMNAME5
*
GETROMNAME2 EQU   %
         LB,R6    *R3,R5
         CB,R6    *R4,R5            COMPARE NAME'S
         BNE      GETROMNAME5
         BDR,R5   GETROMNAME2
         SW,R3    D1
         AI,R3    1
         STW,R3   R5
         XW,R3    LSTROMLINK,R1     UPDATE LINK TO LAST ROM IN CTTE
         BNEZ     GETROMNAME4       CHECK IF 1ST ROM IN SEG
         SLS,R5   K10
         STS,R5   LINK1STROM,R1
         LCI      K3
         LM,R4    PLB,R7
         STM,R4   SEGNAME,R1        STORE NAME IN CTTE
         LI,R3    KFF
         STS,R2   SEGNAME+2,R1      STORE * FLAG IN LAST BYTE OF SEGNAME
         LW,R4    R1
         AI,R4    SEGNAME
         MTB,1    *R4               INCREMENT SEGNAME BYTE COUNT
         LB,R5    *R4
         LI,R6    K0
         STB,R6   *R4,R5            SET LAST BYTE = 0
GETROMNAME3 EQU   %
         AI,SR4   K1
         PULL     5,R2
         B        *SR4
*
GETROMNAME4 EQU   %
         LI,R6    K1                R%=DISP+1 OF FOUND ROM
         LW,R2    R5                    IN ROM TABLE
         AI,R2    R6                D1=ADDRESS OF START OF ROM TABLE
         AW,R2    D1
         CH,R6    *R2               LOOK IN LEFT HALF FOR
         BLE      CHKON             THE POINTER-TO FLAG
*                                   FLAG=0 NEVER B4 PTD-TO
*                                       =1 PTD-TO 1-TIME B4
*                                       =2 PTD-TO AND MOVED
         STH,R6   *2
GETRMNM4A EQU     %
         AI,R3    -1
         AW,R3    D1
         OR,R5    LINKNEXTROM,R3
         STW,R5   LINKNEXTROM,R3
         B        GETROMNAME3
*
CHKON    AI,R6    K1
         CH,R6    *R2
         BG       MOVROMEN
         XW,R3    LSTROMLINK,R1
         AI,R3    KN1
         AW,R3    D1                CONTINUE ROMT SEARCH
GETROMNAME5 EQU   %
         AI,R3    ROMTESIZE
         CW,R3    D3                CHECK IF END OF ROMT
         BL       GETROMNAME1
         B        GETROMNAME7
MOVROMEN LW,R6    CJOB
         LW,R4    ALOCCT,R6
         AI,R4    K1
         PUSH     12,R0
         LW,R1    *R4               ARE WE OUT OF COMMON
         AND,R1   X1FF
         BNEZ     MOVROM5           NO
         LI,R1    1                 YES, GET ANOTHER PAGE
         OR,R1    Y0C
         CAL1,8   1
         BCS,8    GETROMNAME10      DID WE GET ONE
MOVROM5  EQU      %
         LW,R0    *R4
         SLD,R0   -17               ADDRESS IN RT 17 BITS
*
*                                   R5=CURRENT SIZE
         LW,R5    R0
         AI,R0    K8
*
         SLD,R0   17                SINCE ROM IN BUILT
         AI,R0    -8                FROM  UPPER CORE DOWN
*                                   ADJUST OLD ADDRESS IN
*                                   LOCCT TO ACCOMMODATE
*                                   ANOTHER ROM ENTER
         STW,R0   *R4               STORE NEW ROM INFO BACK
*                                   INTO LOCCT
         AND,R0   X1FFFF
         LW,R1    R0                R1=NEW ROMT START AD
MUVLOOP  LW,R4    *D1               MOVE OLD ROMTABLE DOWN
         STW,R4   *R1               BY 8 TO MAKE ROOM FOR
         AI,D1    K1                NEW 8-WORD ENTRY
         AI,R1    K1
         BDR,R5   MUVLOOP
         LW,D1    R0
         LW,R1    D3
         AI,R2    -8                ADJUST R2 SO IT STILL
*                                   PTS TO LAST WORD OF
*                                   FOUND ROM ENTRY
         AI,R1    -8                R1=ROMT END -8
         LI,R6    X'10000'
         AWM,R6   *2                STORE PTD-TO-FLAG INTO
*                                   LAST WORD OF FOUND ROM ENTRY
         AI,R2    -7                R2 PTS TO START
*                                   OF FOUND ROM ENTRY
         LCI      K8                PICK UP THE 8 WORDA OF
         LM,R4    *R2               FOUND ENRT
         LI,SR4   X'10000'          FLAG THE 8TH WORD, B4
         LCI      8
         STM,R4   *R1               STOREING ENTRY INTO THE
*                                   SLOT JUST MADE AVAILABLE
         PULL     12,R0
         LW,R5    D3                CALCULATE DISP+1 OF
         SW,R5    D1                THIS LAST STORE ENTRY
         AI,R5    -7
         STW,R5   LSTROMLINK,R1     LSTROMLINK WORD OF THE
*                                   SEGMENT'S TREE TABLE
          B        GETRMNM4A
GETROMNAME6 EQU   %
         PULL     R2
         PULL     7,SR4
GETROMNAME7 EQU   %
         PULL     5,R2
         MTW,-1   PCCP,R7
         LI,SR3   ILSEGNCD
         B        *SR4              ERROR EXIT
GETROMNAME8 EQU   %
         PULL     2,SR1
GETROMNAME9 EQU   %
         PULL     5,R2
         LI,SR3   NOPGERR           ERROR EXIT
         B        *SR4
GETROMNAME10 EQU  %
         PULL,12  R0
         B        GETROMNAME9
         PAGE                                                           741
*                                                                       741
*        PTREE   -  PROCESSES  PTREE  CONTROL COMMAND                   741
*                                                                       741
*        ENTER WITH  (R5) = JIT ADR                                     741
*                                                                       741
*                                                                       741
PTREER   EQU      %                                                     741
         PUSH     SR4               SAVE SR4                            741
         CI,SR1   ' '               CHECK FOR BLANK AFTER COMMAND FIELD 741
         BNE      PTREER41          NO BLANK, ERROR                     741
         LI,SR2   '('                                                   741
         BAL,SR4  CHARSCAN          CHECK FOR  (                        741
         BCS,8    PTREER41          CHECK IF FOUND                      741
         BAL,SR4  NAMSCAN           GET FILENAME                        741
         BCS,8    PTREER41                                              741
         LW,R0    R7                                                    741
         LW,R1    CSL,R7                                                741
         AI,R0    PLB                                                   741
         LI,R2    1                                                     741
         BAL,SR4  CHSTSHFT          SHIFT FILENAME AND INSERT BYTE COUNT741
         LW,R4    ALOCCT,R5                                             741
         LW,R4    TREETADR,R4                                           741
         LW,R2    CSL,R7                                                741
         AI,R2    4                                              741
         SLS,R2   -2                (R2) = NO. OF WORDS IN FILNAME      741
         STW,R2   D1                                                    741
         AW,D1    R4                                                    741
PTREER2  EQU      %                                                     741
         LW,R3    *R0,R2            MOVE FILE-NAME TO BUFFER            741
         STW,R3   *R4,R2                                                741
         AI,R2    -1                                                    741
         BGEZ     PTREER2                                               741
         PUSH     R4                                                    741
         PUSH     D1                                                    741
         LI,SR2   ','                                                   741
         BAL,SR4  CHARSCAN          CHECK FOR COMMA AFTER NAME          741
         BCS,8    PTREER30                                              741
         BAL,SR4  GETACCN           GET ACCOUNT NUMBER                  741
         BCS,8    PTREER45                                              741
         PULL     D1                                                    741
         LW,R2    PLB,R7            MOVE                                741
         STW,R2   *D1                    ACCOUNT                        741
         LW,R2    PLB+1,R7                       NUMBER                 741
         LI,R1     1                                                    741
         STW,R2   *D1,R1                                                741
         LW,D2    D1                                                    741
         AI,D2    2                                                     741
         PUSH     2,D1                                                  741
         LI,SR2   ','                                                   741
         BAL,SR4  CHARSCAN          CHECK FOR COMMA AFTER ACCN. NO.     741
         BCS,8    PTREER32                                              741
         BAL,SR4  GETPASSW          GET PASSWORD                        741
         BCS,8    PTREER44                                              741
         PULL     D2                                                    741
         LW,R2    PLB,R7            MOVE                                741
         STW,R2   *D2                    PASSWORD                       741
         LW,R2    PLB+1,R7                                              741
         LI,R1    1                                                     741
         STW,R2   *D2,R1                                                741
         PUSH     D2                                                    741
PTREER6  EQU      %                                                     741
         LI,SR2   ')'                                                   741
         BAL,SR4  CHARSCAN          CHECK FOR  )                        741
         BCS,8    PTREER40                                              741
         BAL,SR4  EOCCSCAN          SKIP TO END OF CC                   741
*                                                                       741
         LW,R3    Y002                                                  741
         STS,R3   RUNFLAG,R5        SET RUN FLAG TO PROCESSOR           741
         LI,R3    1                 (R3) = ORG = CONSEC = 1             741
         PULL     2,D1              (D1-D2)=ADR OF ACCN, PASSW OR 0     741
         PULL     R4                (R4) = ADR OF FILENAME              741
         LI,D3    RDTERR            (D3-D4) = ERR/ABN ADR'S             741
         BAL,SR4  OPNFM3            OPN FILE WITH TREE CC
         REF      OPNFM3
         LI,R2    0                                                     741
         LW,R3    Y002                                                  741
         STS,R2   RUNFLAG,R5        RESET RUN FLAG IN JIT               741
         CI,SR3   0                 CHECK IF FILE OPENED                741
         BNE      PTREE48                                               741
*                                                                       741
         LI,R2    RDTR              (R2) = ADR OF READ ROUTINE          741
         LI,R3    X'1FFFF'                                              741
         STS,R2   CONTR,R7          STORE ADR IN PLIST                  741
         LI,R2    1                                                     741
         STW,R2   CCP,R7            SET CUR CHAR POS. TO 1              741
*                                                                       741
         LI,R2    TSTACK+200                                            741
         STW,R2   CBUF,R7                                               741
         CAL1,1   RDTRPL            READ 1ST RECORD                     741
         LI,R2    ARS                                                   741
         LW,R2    M:X1,R2                                               741
         SLS,R2   -17               (R2) = NO. OF WORDS READ            741
         STW,R2   CCRSZ,R7          STORE RECORD SIZE IN PLIST          741
         LI,SR1   0                                                     741
         BAL,SR4  NAMSCAN           GET COMMAND FIELD                   741
         CAL1,1   SETERAB                                               741
         BAL,SR4  TREER             PROCESS TREE COMMAND                741
         B        RDTERR                                                741
         LI,R2    CREAD                                                 741
         LI,R3    X'1FFFF'                                              741
         STS,R2   CONTR,R7          RESTORE CONT. READ ROUT. ADR.       741
         LW,R2    R5                                                    741
         AI,R2    ACCBUF                                                741
         STW,R2   CBUF,R7                                               741
         LI,R2    CCLIST                                                741
         STS,R2   OUTR,R7           SET OUTPUT ROUT. ADR = CCLIST       741
         CAL1,1   CLSMX1                                                741
         PULL     SR4                                                   741
         AI,SR4   1                                                     741
         B        *SR4              EXIT                                741
*                                                                       741
PTREER30 EQU      %                                                     741
         SLD,D1   64                SET (01-D2) = 0                     741
         STW,D1   *TSTACK                                               741
         PUSH     D2                                                    741
         B        PTREER6                                               741
*                                                                       741
PTREER32 EQU      %                                                     741
         LI,D2    0                                                     741
         STW,D2   *TSTACK                                               741
         B        PTREER6                                               741
*                                                                       741
RDTERR   EQU      %                                                     741
         LI,R2    CCLIST                                                741
         STW,R2   OUTR,R7                                               741
         LI,R2    CREAD                                                 741
         LI,R3    X'1FFFF'
         STS,R2   CONTR,R7                                              741
         LW,R2    R5                                                    741
         AI,R2    ACCBUF                                                741
         STW,R2   CBUF,R7                                               741
         CAL1,1   CLSMX1            CLOSE MX1 DCB                       741
         LI,SR3   RDTERRM                                               741
         PULL     SR4                                                   741
         B        *SR4                                                  741
*                                                                       741
RDTERRM  TEXTC    'ERR OPENING, READING OR PROCESSING PTREE FILE'       741
*                                                                       741
PTREER40 EQU      %                                                     741
         BUMP     -3,R1                                                 741
PTREER41 EQU      %                                                     741
         LI,SR3   SYNTXER
PTREER42 EQU      %                                                     741
     B   TREER6A
*                                                                       741
PTREER44 EQU      %                                                     741
         PULL     R1                                                    741
PTREER45 EQU      %                                                     741
         PULL     2,R1                                                  741
         B        PTREER42                                              741
*                                                                       741
PTREE48  EQU      %                                                     741
         LI,SR3   RDTERRM                                               741
         B        PTREER42                                              741
*                                                                       741
*        READ TREE FILE ROUTINE                                         741
*                                                                       741
*                                                                       741
*                                                                       741
RDTR     EQU      %                                                     741
         LI,R2    TSTACK+200                                            741
         CAL1,1   RDTRPL1                                               741
RDTRERAB EQU      %                                                     741
         LI,R2    0                                                     741
         LB,SR3   SR3                                                   741
         BNEZ     %+2                                                   741
         LI,R2    6                                                     741
         STB,R2   SR3                                                   741
         B        *SR4                                                  741
*                                                                       741
*                                                                       741
*        READ TREE PLIST                                                741
*                                                                       741
*                                                                       741
RDTRPL   EQU      %                                                     741
         GEN,8,24 X'10',M:X1                                            741
         DATA     X'F0000010'                                           741
         DATA     RDTERR                                                741
         DATA     RDTERR                                                741
         GEN,8,24 X'80',R2                                              741
         DATA     80                                                    741
*                                                                       741
SETERAB  EQU      %                                                     741
         GEN,8,24 6,M:X1                                                741
         DATA     X'C0000000'                                           741
         DATA     RDTRERAB                                              741
         DATA     RDTRERAB                                              741
*                                                                       741
RDTRPL1  EQU      %                                                     741
         GEN,8,24 X'10',M:X1                                            741
         DATA     X'F0000010'                                           741
         DATA     RDTRERAB                                              741
         DATA     RDTRERAB                                              741
         GEN,8,24 X'80',R2                                              741
         DATA     80                                                    741
*                                                                       741
*        CLOSE   M:X1   PLIST                                           741
*                                                                       741
CLSMX1   EQU      %                                                     741
         GEN,8,24 X'15',M:X1                                            741
         DATA     X'80000000'                                           741
         DATA     2                                                     741
         END

