         SYSTEM   SIG5                                                          
         SYSTEM   OPTIONS                                                       
*                                                                               
*                                                                               
*        *****************************                                          
*        *                           *                                          
*        *                           *                                          
*        * SIGMA 5/7 OVERLAY LOADER  *                                          
*        *                           *                                          
*        *                           *                                          
*        *        RBM 2              *                                          
*        *                           *                                          
*        *                           *                                          
*        *****************************                                          
*                                                                               
*                                                                               
*                                                                               
*                                                                               
*        ****************************                                           
*        *                          *                                           
*        *                          *                                           
*        *  MAP                     *                                           
*        *                          *                                           
*        ****************************                                           
*                                                                               
*                                                                               
*                                                                               
*                                                                               
*                                                                               
*                                                                               
*                                                                               
*                                                                               
*                                                                               
*                                                                               
*                                                                               
*                                                                               
         DEF      MAP                                                           
         DEF      OLAYMAP                                                       
         REF      BOUNDRDW                                                      
         REF      F:PUBL                                                        
         REF      FBA:COMN                                                      
         REF      FBA:DCBT                                                      
         REF      FBA:INTT                                                      
         REF      FBA:LIM                                                       
         REF      FBA:OVLO                                                      
         REF      FBA:ROO2                                                      
         REF      FBA:RTMP                                                      
         REF      FBA:TEMP                                                      
         REF      FL:BACK                                                       
         REF      FL:BOUND                                                      
         REF      FL:ERROR                                                      
         REF      FL:MAP                                                        
         REF      FL:OFLOW                                                      
         REF      FL:PRIM                                                       
         REF      FL:PUBL                                                       
         REF      FL:RTMP                                                       
         REF      FL:SORT                                                       
         REF      FL:TEMP                                                       
         REF      FPT:PRLO                                                      
         REF      LBA:COMN                                                      
         REF      LBA:LIM                                                       
         REF      LBA:PATH                                                      
         REF      LBA:ROO2                                                      
         REF      MOVBYTS                                                       
         REF      M:LL                                                          
         REF      M:LO                                                          
         REF      M:X1                                                          
         REF      M:X2                                                          
         REF      M:X3                                                          
         REF      M:X4                                                          
         REF      M:X5                                                          
         REF      M:X6                                                          
         REF      M:OV                                                          
         REF      P:POOL                                                        
         REF      PUBMEM                                                        
         REF      RABORT                                                        
         REF      RDIAG                                                         
         REF      READXN                                                        
         REF      T:BDP                                                         
         REF      T:FBA                                                         
         REF      T:LBA                                                         
         REF      T:NBE                                                         
         REF      T:PL                                                          
         REF      V:LIBSIZ                                                      
         REF      V:NPLSG                                                       
         REF      V:NUSG                                                        
         REF      V:TOTSIZ                                                      
         REF      X:FFFF,X:1FFFF,X:3,X:7F,X:7FFFF,X:TY                     101  
         REF      GIOOBIT,GIODBIT,GIOFBIT,GIOABIT,GIOFA,GIOBITS                 
         REF      X:FFF                                                         
         REF      FPT:ASN,FPT:GASN,FPT:COR,FPT:REW,FPT:PACK                     
         REF      FPT:OPEN,FPT:CLS                                              
         REF      PT:OPEN,PT:CLS                                                
         REF      B:OPLBNM,B:DEVNM,B:DEVX,B:DEVCON,B:ERRCC                      
         REF      NXTROM,GIOCT                                                  
         REF      FPT:ROM1                                                      
*                                                                               
*                                                                               
*        PUSH,PULL  PROCEDURE                                                   
*                                                                               
*                                                                               
PUSH     CNAME    1                                                             
PULL     CNAME    0                                                             
         PROC                                                                   
         DO       NUM(AF)=1                                                     
LF       GEN,8,4,3,17  X'88'+NAME,AF(1),0,PCBPOINT SINGLE FIELD IN AF(1)        
         ELSE                                                                   
         DO       AF(2)>AF(1)       EG PUSH 9,11                                
LF       LCFI     (AF(2)-AF(1)+1)&X'F'                                          
         ELSE                       EG PUSH 11,7  (IE 11-15,0-7)                
LF       LCFI     (16-AF(1)+AF(2)+1)&X'F'         WRAPAROUND                    
         FIN                                                                    
         GEN,8,4,3,17  X'8A'+NAME,AF(1),0,PCBPOINT                              
         FIN                                                                    
         PEND                                                                   
         TITLE    '       **** EQUATES ****'                                    
*                                                                               
*        ****************************                                           
*        *                          *                                           
*        *                          *                                           
*        *  EQUS                    *                                           
*        *                          *                                           
*        *                          *                                           
*        ****************************                                           
*                                                                               
*                                                                               
SAVE%    SET      %                                                             
         ASECT                                                                  
R0       EQU      %                                                             
R1       EQU      %+1                                                           
R2       EQU      %+2                                                           
R3       EQU      %+3                                                           
R4       EQU      %+4                                                           
R5       EQU      %+5                                                           
R6       EQU      %+6                                                           
R7       EQU      %+7                                                           
R8       EQU      %+8                                                           
R9       EQU      %+9                                                           
R10      EQU      %+10                                                          
R11      EQU      %+11                                                          
R12      EQU      %+12                                                          
R13      EQU      %+13                                                          
R14      EQU      %+14                                                          
R15      EQU      %+15                                                          
         USECT    SAVE%                                                         
*        T:SEG FIELD INDICES                                                    
S:ENTRY  EQU      7                 WD OF ROOT ENTRY POINT                      
S:LL     EQU      9                 WD OF LM LENGHT OF SEG                      
S:MA     EQU      12                HWD OF SEG START ADDRESS                    
*        SPECIAL SEGMENT ID NUMBERS                                             
ROOT1ID  EQU      X'9000'           ROOT PART ONE                               
ROOT2ID  EQU      X'9001'           ROOT PART TWO                               
COMNID   EQU      X'9004'           BLANK COMMON                                
PLCXTID  EQU      X'A001'           PUBLIB CONTEXT                              
*                                                                               
*                 SHIFT CONSTANTS                                               
*                                                                               
RIGHT    EQU      -1                                                            
LEFT     EQU      1                                                             
*                                                                               
*                 DATA                                                          
         BOUND    4                                                             
OLAYMAP  EQU      %                                                             
D:10     DATA     10                                                            
X:3FFFF  DATA     X'3FFFF'                                                      
X:FFFFFF DATA     X'FFFFFF'                                                     
Y:11     DATA     X'11000000'                                                   
E:UDCB   TEXT     'UDCB'                                                        
E:SDCB   TEXT     'SDCB'                                                        
E:CTYP   TEXT     ' ROM'            MUST BE THREE CONTIGUOUS WORDS      9       
         TEXT     'SLIB'            IN THIS ORDER                       9       
         TEXT     'ULIB'                                                9       
         BOUND    8                                                             
E:SEC    TEXT     'SECNDARY'                                                    
E:PRI    TEXT     'PRIMARY '                                                    
E:PROG   TEXT     'PROGRAM '                                                    
E:PUBL   TEXT     'PUBLIB  '                                                    
E:UNAM   TEXT     'UNNAMED '                                             12     
E:NONE   TEXT     'NONE'                                                        
E:BLANKS TEXT     '    '                                                        
D        EQU      X'20'            *SYMBOL HAS/HASNOT BEEN DEFINED,             
*                                   ALLOCATED, OR SATISFIED FLAG MASK           
V        EQU      X'10'            *SYMBOL HAS BEEN DEFINED/ALLOCATED/          
*                                   SATISFIED WITH EITHER A VALUE               
*                                   OR AN EXPRESSION FLAG MASK                  
C        EQU      X'08'            *SYMBOL VALUE IS EITHER A CONSTANT OR        
*                                   AN ADDRESS FLAG MASK                        
F        EQU      X'04'            *SYMBOL IS/ISNOT A DUPLICATE FLAG            
*                                   MASK                                        
TY       EQU      X'C0'                                                    101  
G        EQU      X'00040000'       G FLAG FROM T:MODULE                        
DCBSIZE  EQU      11                SIZE OF T:DCBF ENTRY                        
PREF     EQU      X'C0'                                                         
DEF      EQU      X'00'                                                    101  
DSCT     EQU      X'40'                                                    101  
SREF     EQU      X'80'                                                    101  
PLESIZE  EQU      16                T:PL ENTRY SIZE                             
PLSIZE   EQU      5*PLESIZE+1       T:PL SIZE IN WORDS:                         
*                                   ENTRY SIZE TIMES MAX NR ENTRIES             
*                                   PLUS ONE WORD TO ALLOW ZERO                 
*                                   WORD AT END OF TABLE                        
*        T:PL ENTRY ITEM INDICES                                                
PLSYMBL  EQU      12                WORD INDEX TO T:SYMBOL BL                   
PLSYMGO  EQU      13                WORD INDEX TO T:SYMBOL GRAN ORIGIN          
PLVALBL  EQU      14                WORD INDEX TO T:VALUE BL                    
PLVALGO  EQU      15                WORD INDEX TO T:VALUE GRAN ORIGIN           
PRIMARY  EQU      2                 FL:PRIM BIT FOR PRIMARY LOAD                
SECNDARY EQU      1                 FL:PRIM BIT FOR SEC LOAD                    
DSECT    EQU      1                                                             
*                        *MONITOR CELLS                                         
PCBPOINT EQU      X'4E'             FWA OF BACKGROUND PROGRAM'S PCB             
K:BACKBG EQU      X'140'            FWA OF BACKGROUND                           
K:BCKEND EQU      X'141'            LWA OF BACKGROUND                           
K:FGDEND EQU      X'143'            LWA OF FOREGROUND                           
K:CCBUF  EQU      X'144'            FWA OF CONTROL COMMAND BUFFER               
K:FGDBG2 EQU      X'146'            DEFAULT FWA OF FOREGROUND                   
K:FMBOX  EQU      X'147'            MONITOR FOREGROUND PRGMS MAILBOX            
K:BPEND  EQU      X'153'            LWA+1 OF LOADED BACKGROUND PROGRAM          
K:DCT1   EQU      X'176'            POINTER TO HW WITH # OF DCT ENTRIES         
K:DCT16  EQU      X'177'            POINTER TO DW WITH DEVICE EBCDIC            
K:MDNAME EQU      X'212'            POINTER TO MASTER DIRECTORY NAMES           
*                        *FLAG VALUES FOR FL:NXTCC                              
         TITLE    ' **** DYNAMIC TABLE AREA POINTERS ****'                      
*                                                                               
*                       *THE FOLLOWING TABLES AREAS ARE DYNAMICALLY             
*                        ALLOCATED (DURING PASSONE) AND ARE LOCATED             
*                        BETWEEN THE END OF THE LOGEST OVERLAY                  
*                        (K:PEND) AND THE END OF BACKGROUND (K:BACKEND).        
*                       *THE EQUATED VALUES ARE INDICES INTO T:FBA,             
*                        T:LBA,T:NBE,AND T:BZA.                                 
*                                                                               
T:PUBVAL EQU      1      PUBLIC LIBRARY DEF VALUE TABLE                         
*                            *5 BYTES PER ENTRY                                 
*                            *ENTRIES PARALLEL TO T:PUBSYM ENTRIES              
*                                                                               
*                                                                               
T:PUBSYM EQU      2      PUBLIC LIBRARY DEF EBCDIC NAME TABLE                   
*                            *VARIABLE SIZED ENTRIES                            
*                            *ENTRIES PARALLEL TO T:PUBVAL ENTRIES              
*                                                                               
*                                                                               
*                                                                               
T:VALUE  EQU      3     *PROGRAM SYMBOL TABLE VALUES (ADDR,CONSTANT,OR E        
*                        (SYMBOL TABLE HAS DEFS,DSECTS,AND FORWARD REFS)        
*                            *5 BYTES PER ENTRY                                 
*                            *ENTRIES PARALLEL TO T:SYMBOL                      
*                                                                               
*                                                                               
T:SEG    EQU      4      SEGMENT INFORMATION TABLE                              
*                            *9 WORDS PER ENTRY                                 
*                            *ONE ENTRY PER SEGMENT                             
*                                                                               
T:DCBV   EQU      5      TABLE OF VARIABLE DCB'S                                
*                            *7 WORDS PER ENTRY                                 
*                            *ONE DCB FOR EACH DISTINCT RAD FILE                
*                             SPECIFIED FOR ROM INPUT                           
*                                                                               
T:DCB    EQU      6     *TABLE OF SYSTEM (M:) AND USER (F:) DCB                 
*                        DEF'S AND  REF'S                                       
*                            *3 WORDS PER ENTRY                                 
*                                                                               
T:ROMI   EQU      7     *ROM INPUT INFORMATION TABLE;CONTAINS THE               
*                        NUMBER OF ROM'S TO INPUT AND THE INPUT SOURCE.         
*                        (TABLE ONLY EXIST DURING PASSONE)                      
*                            *1 WORD PER ENTRY                                  
*                                                                               
T:MODIFY EQU      8     *TABLE OF CORE IMAGE MODIFICATIONS FOR THE              
*                        SEGMENT                                                
*                            *VARIABLE SIZED ENTRIES                            
*                                                                               
T:MODULE EQU      9      MODULE INFORMATION TABLE                               
*                            *5 WORDS PER ENTRY                                 
*                            *ONE ENTRY PER MODULE                              
*                                                                               
B:MT     EQU      10    *MODULE TABLES BUFFER FOR T:DECL,T:CSECT,T:FWD          
*                        AND T:FWDX; BUFFER OUTPUT EITHER AT THE END            
*                        OF THE SEGMENT OR WHEN THE BUFFER IS FULL.             
*                                                                               
T:DECL   EQU      11    *MODULE DECLARATION TABLE; EACH DECLARATION             
*                        ENTRY POINTS TO AN ENTRY IN (1) T:DCB,                 
*                        (2) T:SYMBOL/T:VALUE,(3) T:CSECT, OR                   
*                        (4) T:PUBSYM/T:PUBVAL                                  
*                            *2 BYTES PER ENTRY                                 
*                                                                               
T:CSECT  EQU      12    *CONTROL SECTION TABLE; EACH ENTRY CONTAINS             
*                        SIZE AND ALLOCATED ADDRESS.                            
*                            *2 WORDS PER ENTRY                                 
*                                                                               
T:FWD    EQU      13    *FORWARD TABLE; EACH ENTRY CONTAINS A FORWARD           
*                        NUMBER AND IT'S CORRESPONDING VALUE. A VALUE           
*                        CAN BE AN ADDR, CONSTANT, OR AN EXPRESSION.            
*                            *2 WORDS PER ENTRY                                 
T:FWDX   EQU      14     FORWARD EXPRESSION TABLE                               
*                            *VARIABLE SIZED ENTRIES                            
*                                                                               
T:SYMBOL EQU      15    *PROGRAM SYMBOL TABLE EBCDIC NAMES AND DSECT            
*                        SIZES; ENTRIES PARALLEL TO T:VALUE ENTRIES             
*                            *VARIABLE SIZED ENTRIES                            
*                                                                               
T:VALX   EQU      16    *T:VALUE EXPRESSION TABLE; BACKWARD TABLE               
*                        WITH FORWARD ENTRIES,BUILT FROM K:BACKEND              
*                            *VARIABLE SIZED ENTRIES                            
FBA:PUBV EQU      T:FBA+T:PUBVAL                                                
FBA:PUBS EQU      T:FBA+T:PUBSYM                                                
FBA:VALU EQU      T:FBA+T:VALUE                                                 
FBA:SEG  EQU      T:FBA+T:SEG                                                   
FBA:DCBV EQU      T:FBA+T:DCBV                                                  
FBA:DCB  EQU      T:FBA+T:DCB                                                   
FBA:ROMI EQU      T:FBA+T:ROMI                                                  
FBA:MODF EQU      T:FBA+T:MODIFY                                                
FBA:MODL EQU      T:FBA+T:MODULE                                                
FBA:MTB  EQU      T:FBA+B:MT                                                    
FBA:DECL EQU      T:FBA+T:DECL                                                  
FBA:CSEC EQU      T:FBA+T:CSECT                                                 
FBA:FWD  EQU      T:FBA+T:FWD                                                   
FBA:FWDX EQU      T:FBA+T:FWDX                                                  
FBA:SYM  EQU      T:FBA+T:SYMBOL                                                
FBA:VALX EQU      T:FBA+T:VALX                                                  
BDP:PUBV EQU      T:BDP+T:PUBVAL                                                
BDP:PUBS EQU      T:BDP+T:PUBSYM                                                
BDP:VALU EQU      T:BDP+T:VALUE                                                 
BDP:SEG  EQU      T:BDP+T:SEG                                                   
BDP:DCBV EQU      T:BDP+T:DCBV                                                  
BDP:DCB  EQU      T:BDP+T:DCB                                                   
BDP:ROMI EQU      T:BDP+T:ROMI                                                  
BDP:MODF EQU      T:BDP+T:MODIFY                                                
BDP:MODL EQU      T:BDP+T:MODULE                                                
BDP:MTB  EQU      T:BDP+B:MT                                                    
BDP:DECL EQU      T:BDP+T:DECL                                                  
BDP:CSEC EQU      T:BDP+T:CSECT                                                 
BDP:FWD  EQU      T:BDP+T:FWD                                                   
BDP:FWDX EQU      T:BDP+T:FWDX                                                  
BDP:SYM  EQU      T:BDP+T:SYMBOL                                                
BAP:VALX EQU      T:BDP+T:VALX                                                  
LBA:PUBV EQU      T:LBA+T:PUBVAL                                                
LBA:PUBS EQU      T:LBA+T:PUBSYM                                                
LBA:VALU EQU      T:LBA+T:VALUE                                                 
LBA:SEG  EQU      T:LBA+T:SEG                                                   
LBA:DCBV EQU      T:LBA+T:DCBV                                                  
LBA:DCB  EQU      T:LBA+T:DCB                                                   
LBA:ROMI EQU      T:LBA+T:ROMI                                                  
LBA:MODF EQU      T:LBA+T:MODIFY                                                
LBA:MODL EQU      T:LBA+T:MODULE                                                
LBA:MTB  EQU      T:LBA+B:MT                                                    
LBA:DECL EQU      T:LBA+T:DECL                                                  
LBA:CSEC EQU      T:LBA+T:CSECT                                                 
LBA:FWD  EQU      T:LBA+T:FWD                                                   
LBA:FWDX EQU      T:LBA+T:FWDX                                                  
LBA:SYM  EQU      T:LBA+T:SYMBOL                                                
LBA:VALX EQU      T:LBA+T:VALX                                                  
NBE:PUBV EQU      T:NBE+T:PUBVAL                                                
NBE:PUBS EQU      T:NBE+T:PUBSYM                                                
NBE:VALU EQU      T:NBE+T:VALUE                                                 
NBE:SEG  EQU      T:NBE+T:SEG                                                   
NBE:DCBV EQU      T:NBE+T:DCBV                                                  
NBE:DCB  EQU      T:NBE+T:DCB                                                   
NBE:ROMI EQU      T:NBE+T:ROMI                                                  
NBE:MODF EQU      T:NBE+T:MODIFY                                                
NBE:MODL EQU      T:NBE+T:MODULE                                                
NBE:MTB  EQU      T:NBE+B:MT                                                    
NBE:DECL EQU      T:NBE+T:DECL                                                  
NBE:CSEC EQU      T:NBE+T:CSECT                                                 
NBE:FWD  EQU      T:NBE+T:FWD                                                   
NBE:FWDX EQU      T:NBE+T:FWDX                                                  
NBE:SYM  EQU      T:NBE+T:SYMBOL                                                
NBE:VALX EQU      T:NBE+T:VALX                                                  
         TITLE    '       **** SUBROUTINE CALLS ****'                           
*                                                                               
*                                                                               
*        ****************************                                           
*        *                          *                                           
*        *                          *                                           
*        *  SUBROUTINE CALLS        *                                           
*        *                          *                                           
*        *                          *                                           
*        ****************************                                           
*                                                                               
*                                                                               
*                 A SET OF COM STATEMENTS DESIGNED TO FACILITATE CALLS          
*                 OF THE FORM                                                   
*                                                                               
*        BAL,RN   SUBR                                                          
*                                                                               
*                 IN ADDITION, BAL REGISTER ASSIGNMENTS ARE CENTRALIZED         
*                                                                               
*                                                                               
*                 THE CALL IS GENERATED BY USING THE NAME OF THE                
*                 SUBROUTINE TO BE CALLED (I.E. ITS LABEL) IN THE               
*                 OPERATIONS FIELD.                                             
*                                                                               
*                 E.G.                                                          
*                                                                               
*        BAL,RN   SUBR                                                          
*                                                                               
*                                                                               
*                 WILL BE REPLACED BY                                           
*                                                                               
*SUBR    COM,8,4,3,17  BAL,BAL REGISTER,0,SUBR ADDRESS                          
*         .                                                                     
*         .                                                                     
*         .                                                                     
*        SUBR                                                                   
*                                                                               
*                                                                               
BAL      EQU      X'6A'             BAL OPERATION CODE                          
*                                                                               
INBYTS   COM,8,4,3,17  BAL,14,0,INBYTS                                          
SETUPSEG COM,8,4,3,17 BAL,14,0,SETUPSEG                                         
GETHW    COM,8,4,3,17  BAL,15,0,GETHW                                           
GETDL    COM,8,4,3,17  BAL,15,0,GETDL                                           
LOADSEG  COM,8,4,3,17  BAL,15,0,LOADSEG                                         
RABORT   COM,8,4,3,17  BAL,14,0,RABORT                                          
MAPCSECT COM,8,4,3,17 BAL,13,0,MAPCSECT                                         
MAPDCBS  COM,8,4,3,17  BAL,12,0,MAPDCBS                                         
MAPSYM   COM,8,4,3,17  BAL,12,0,MAPSYM                                          
MOVBYTS  COM,8,4,3,17  BAL,15,0,MOVBYTS                                         
PRINTSYM COM,8,4,3,17 BAL,13,0,PRINTSYM                                         
PROFLOW  COM,8,4,3,17  BAL,12,0,PROFLOW                                         
RDIAG    COM,8,4,3,17  BAL,15,0,RDIAG                                           
HEXTOEBD COM,8,4,3,17  BAL,14,0,HEXTOEBD                                        
DECHEX   COM,8,4,3,17  BAL,14,0,DECHEX                                          
BOUNDRDW COM,8,4,3,17  BAL,15,0,BOUNDRDW                                        
HEADER   COM,8,4,20,8,4,3,17 X'22',R3,WA(AF(1)),BAL,15,0,HEADER                 
PRINTLO  COM,8,4,3,17  BAL,14,0,PRINTLO                                         
PREPFLD  COM,8,4,3,17  BAL,15,0,PREPFLD                                         
PUBMEM   COM,8,4,3,17 BAL,10,0,PUBMEM                                           
READXN   COM,8,4,3,17     BAL,15,0,READXN                                       
INFID    COM,8,4,3,17  BAL,13,0,INFID                                           
         TITLE    '    ****  OVERLAY DATA POOL  ****'                           
TEMP1    EQU      P:POOL+1                                                      
TEMP2    EQU      P:POOL+2                                                      
BAPLINE  EQU      P:POOL+3                                                      
BAPVALU  EQU      P:POOL+4                                                      
BAPSYM   EQU      P:POOL+5                                                      
MODNUM   EQU      P:POOL+7                                                      
UNREFMSG EQU      P:POOL+8                                              10      
DDEFMSG  EQU      P:POOL+9                                              10      
UNDEFMSG EQU      P:POOL+10                                                     
DREFMSG  EQU      P:POOL+11                                                     
*                                                                               
*                 P: MUST BE  LAST ENTRY ON P:POOL + LIST                       
*                 SEE SETUPSEG FOR SIZE  OF P:                                  
*                                                                               
P:       EQU      P:POOL+12                                                     
*                                                                               
*                 REGISTER CONVENTIONS  R1 - R4                                 
*                                                                               
*                 R1 BAP FOR CURRENT LINE TO BE PRINTED                         
*                 R2  -85+BDP FOR CURRNET BYTE IN LINE                          
*                 R3  BAP TO FIELD CONTROL BYTE                                 
*                 R4  WA OF CURRENT T:SEG ENTRY                                 
*                                                                               
         TITLE    '****  DIAGNOSTICS  ****'                                     
*                        *DIAGNOSTICS                                           
CCITEM   EQU      1           CC ERR:ITEM XX                                    
OCCITEM  EQU      2           CC ERR:ITEM XX  (OLOAD)                           
OCCFITEM EQU      4           CC ERR:FOLLOWING ITEM XX (OLOAD)                  
CCFITEM  EQU      3           CC ERR:FOLLOWING ITEM XX                          
CCORDER  EQU      5           CC ERR:ILLEGAL ORDER                              
CCIDENT  EQU      6           CC ERR:SEG IDENT NOT 1ST OPTION                   
CCDUPNAM EQU      7           CC ERR:DUP NAME IN ITEM XX                        
CCSEGORD EQU      8           CC ERR:SEG'S ORDERED INCORRECTLY                  
CCDUPSEG EQU      9           CC ERR:DUP SEG IDENT                              
CCUNDSEG EQU      10          CC ERR:SEG IDENT UNRECOGNIZED                     
CCUNDSYM EQU      11          CC ERR:UNDEFINED SYMBOL IN ITEM XX                
OCCFORE  EQU      12          CC ERR:NEED (FORE,FWA,LWA) OPT FOR PUBLIB         
OCCTEMP  EQU      13          CC ERR:ILLEGAL OPT FOR PUBLIB (TEMP,VAL)          
OCCLINKS EQU      14          CC ERR:ILLEGAL OPT FOR PUBLIB (GO,LINKS)          
OCCTASKS EQU      15          CC ERR:ILLEGAL OPT FOR PUBLIB (TASKS,VAL)         
OCCPUBL  EQU      16          CC ERR:ILLEGAL OPT FOR PUBLIB (PUBL,NAME)         
CHKSUM   EQU      17          ROM ERR:CHKSUM                                    
SEQERR   EQU      18          ROM ERR:BAD SEQ                                   
LOADITEM EQU      19          ROM ERR:ILL LOAD ITEM                             
OBJFORMT EQU      20          ROM ERR:NOT OBJ LANGUAGE                          
NOTSTBIN EQU      21          ROM ERR:NOT STANDARD BIN                          
NOMODEND EQU      22          ROM ERR:NO MODULE END                             
TEXOFLO  EQU      23          ROM ERR:EXPRESSION SIZE EXCEEDS MAX               
RFUND    EQU      24          CC ERR:UNDEFINED FILE                             
RFUND2   EQU      25          CC ERR:UNDEFINED FILE                             
EOFONCC  EQU      26          UNEXPECTED MONITOR CC ON TTYDD                    
ILLEOD   EQU      27          UNEXPECTED EOD ON DEVICE/FILE                     
ILLEOD2  EQU      28          UNEXPECTED EOD ON DEVICE/FILE                     
BOTERR   EQU      29          BOT ON DEVICE/FILE                                
EOTERR   EQU      30          EOT ON DEVICE/FILE                                
EOTERR2  EQU      31          EOT ON DEVICE/FILE                                
IRRECRD  EQU      32          UNRECOVERABLE RD ERR ON DEVICE/FILE               
IRRECWR  EQU      33          UNRECOVERABLE WR ERR ON DEVICE/FILE               
TINYBUFF EQU      34          BUF SMALLAR THAN DATA RECD                        
RONGDCB  EQU      35          DCB HAS BAD PARAMETERS                            
NORADFIL EQU      36          UNDEFINED FILE AA,XXXXXXXX (IN DCB)               
DCBNODEV EQU      37          DCB NOT ASSIGNED                                  
READOUTP EQU      38          READING AN OUTPUT DEVICE                          
WRITEINP EQU      39          WRITING ON INPUT DEVICE                           
NOOPDCBW EQU      40          DCB HAS INSUFFICIENT INFO                         
NOOPDCBR EQU      41          DCB HAS INSUFFICIENT INFO                         
PROGERR  EQU      42          PROGRAM ERROR,OLAY,ADDR XXXXX                     
DCBCLOSE EQU      43          PROGRAM ERROR,OLAY,SB=XX,ADDR XXXXX               
DCBOPEN  EQU      44          PROGRAM ERROR,OLAY,SB=XX,ADDR XXXXX               
NONREAL  EQU      45          PROGRAM ERROR,OLAY,SB=XX,ADDR XXXXX               
INVBUFF  EQU      46          PROGRAM ERROR,OLAY,SB=XX,ADDR XXXXX               
REREADCC EQU      47          PROGRAM ERROR,OLAY,SB=XX,ADDR XXXXX               
ILLDCB   EQU      48          WARNING:ILL DCB NAME                              
ILLDCB2  EQU      49          WARNING:DCB IN OVERLAY SEG                        
LCOMSIZE EQU      50          LCOM XXX OF SIZE XX GR. THAN ALLOCATED            
DCBADR   EQU      51          WARNING:ILL DCB ADDR                              
PUBLIB5  EQU      52          DSECT'S IN PUBLIB LOAD                            
PLENGTH  EQU      53          BIAS TOO LARGE                                    
BACKSIZE EQU      54          BACKGROUND TOO SMALL                              
TABOFLO  EQU      55          BACKGROUND TOO SMALL                              
MOUNTPT  EQU      56          MOUNT PAPER TAPE ROM                              
FULLRFT  EQU      57          RAD FILE TABLE FULL                               
RADWP    EQU      58          TTYDD WRT PROT                                    
UPREF    EQU      59          WARNING:UNSATISFIED REF'S                         
DUPLDEFS EQU      60          WARNING:DUPLICATE DEF'S                           
UNDEFDEF EQU      61          WARNING:UNDEFINED DEF'S                           
UNDEFORG EQU      62          UNDEFINED ORIGIN                                  
ILLORG   EQU      63          ILLEGAL ORIGIN XXXXX                              
FLDOFLO  EQU      64          WARNING:FIELD OVERFLOW AT ADDR XXXXX              
NOSTART  EQU      65          WARNING:NO START ADDR FOR ROOT                    
SEGGT8K  EQU      66          WARNING:OVERLAY SEG GREATER THAN 8K               
ABORT    EQU      67          FILE DESTROYED AA,FFFFFFFF                        
ABORT2   EQU      68          FILE UNCHANGED AA,FFFFFFFF                        
EXCLIM   EQU      69          WARNING:PROGRAM EXCEEDS SPEC ADDR LIMITS          
UNDEFRLC EQU      70          PROGRAM ERROR:UNALLOCATED CONTROL SECT            
UNDEFDCB EQU      71          WARNING:UNALLOCATED DEFID DCB                     
OCCAREA  EQU      72          CC ERR:SPECIFIED AREA FOR PUBLIB NOT 'FP'         
UNDEFST  EQU      73          WARNING:UNDEFINED START ADDR                      
ILLSTRT  EQU      74          WARNING:START ADDR XXXXX OUTSIDE SEGMENT          
DUPREF   EQU      86          SAME REF IN MORE THAN ONE PATH                    
         TITLE    '    ****  MAP  ****'                                         
*                                                                        0008100
*                                                                        0008300
*                                                                        0011000
MAP      RES      0                                                      0012000
*                                                                        0013000
*                                                                               
*                 ESTABLISH WORK AREA FOR READING SYMBOL AND                    
*                 VALUE TABLES IN FOR MAPPING                                   
*                                                                               
*                 MOVE T:SEG, T:DCB TO END OF PUBV.                             
*                                                                               
         LI,R8    0                                                             
         STW,R8   UNDEFMSG          INITIALIZE COUNTS FOR                       
         STW,R8   UNREFMSG          DIAGNOSTICS                                 
         STW,R8   DDEFMSG                                                       
         STW,R8   DREFMSG                                                       
         LW,R8    FBA:PUBV                                                 101  
         BOUNDRDW                                                               
         STW,R8   FBA:PUBS                                                      
         STW,R8   LBA:PUBS                                                      
         BOUNDRDW                                                               
         STW,R8   R6                MOVE TO                                     
         LW,R5    FBA:SEG           MOVE FROM                                   
         LW,R8    LBA:SEG                                                       
         SW,R8    FBA:SEG           NO BYTES                                    
         MOVBYTS                                                                
         STW,R6   FBA:SEG                                                       
         AW,R8    R6                                                            
         STW,R8   LBA:SEG                                                       
         BOUNDRDW                                                               
*                                   MOVE DCB TABLE                              
         STW,R8   R6                                                            
         LW,R5    FBA:DCB                                                       
         LW,R8    LBA:DCB                                                       
         SW,R8    FBA:DCB                                                       
         MOVBYTS                                                                
         STW,R6   FBA:DCB                                                       
         AW,R8    R6                                                            
         STW,R8   LBA:DCB                                                       
*                                                                        0014000
         MTW,0    FL:MAP                                                        
         BLZ      SEGMAP                                                        
MAP2     RES      0                                                             
         HEADER   MAPTYPE                                                       
         LD,R10   E:SEC             SECONDARY                                   
         LW,R0    FL:PRIM                                                       
         CI,R0    1                                                             
         BE       %+2               B IF SECONDARY                              
         LD,R10   E:PRI             PRIMARY                                     
         PREPFLD                                                                
         INBYTS                                                                 
         LD,R10   E:PROG                                                        
         LW,R0    FL:PUBL                                                       
         BEZ      %+2               B IF PROGRAM LOAD                           
         LD,R10   E:PUBL            PUBLIB                                      
         PREPFLD                                                                
         INBYTS                                                                 
         PRINTLO                                                                
*                                                                        0020000
*                 FILE                                                   0021000
*                                                                        0022000
MAP21    HEADER   PFILE                                                  12     
         LI,R7    M:OV              DCB ASSIGNED TO LD MODULE                   
         INFID                      INSERT FILE ID                              
         PRINTLO                                                         0035000
*                                                                        0036000
*                                                                        0037000
*                                                                        0038000
*                 NUMBER OF OVERLAY SEGMENTS                             0039000
         MTW,0    FL:PUBL                                                12     
         BGZ      MAP22                                                  12     
         HEADER   PNUM                                                          
         PREPFLD                    READY FOR NUMBER OF SEGMENTS         0041000
         LW,R10   V:NUSG            NUMBER OF USER SEGS                         
         CI,R10   2                                                             
         BLE      %+2               BRANCH IF ROOT SEGS ONLY                    
         LI,R10   2                 TWO ROOT SEGS                               
         DECHEX                                                                 
         PREPFLD                                                                
         PRINTLO                    PRINT NR OF ROOT SEGS                       
         HEADER   PNUM1                                                         
         PREPFLD                                                                
         LI,R10   1                                                             
         LW,R9    LBA:COMN                                                      
         CW,R9    FBA:COMN                                                      
         BNE      %+2               BRANCH IF COMMON SEG                        
         LI,R10   0                 NO COMMON SEG                               
         DECHEX                                                                 
         PREPFLD                                                                
         PRINTLO                    PRINT NR OF COMMON SEGS                     
         HEADER   PNUM2                                                         
         PREPFLD                                                                
         LW,R10   V:NUSG            NR OF USER SEGS                             
         AI,R10   -2                DISCOUNT ROOT SEGS                          
         LW,R9    LBA:COMN                                                      
         CW,R9    FBA:COMN                                                      
         BE       %+2               BRANCH IF NO COMMON SEG                     
         AI,R10   -1                DISCOUNT COMMON SEG                         
         CI,R10   0                                                             
         BGE      %+2                                                           
         LI,R10   0                 NO NON-ROOT SEGS, ROOT1 ONLY                
         DECHEX                                                                 
         PREPFLD                                                                
         PRINTLO                    PRINT NR OF OVERLAY SEGS                    
         HEADER   PNUM3                                                         
         PREPFLD                                                                
         LW,R10   V:NPLSG           NR OF PUBLIB SEGS                           
         DECHEX                                                                 
         PREPFLD                                                                
         PRINTLO                                                         0049000
*                                                                        0050000
*                 LIMITS                                                 0051000
*                                                                        0052000
MAP22    HEADER   PLIM                                                   12     
         PREPFLD                    FWA                                  0054000
         LW,R10   FBA:LIM                                                       
         SLS,R10  RIGHT*2           BA TO WA                                    
         HEXTOEBD                   TASK LOWER LIMIT                            
         PREPFLD                                                                
         LW,R10   LBA:PATH                                                      
         SLS,R10  RIGHT*2           BA TO WA                                    
         AI,R10   -1                LBA:PATH IS REALLY LBA+1                    
MAP24    HEXTOEBD                                                        12     
         PRINTLO                                                         0061000
         MTW,0    FL:PUBL                                                12     
         BGZ      MAP25                                                  12     
*                                                                        0062000
*                 BOUND                                                  0063000
*                                                                        0064000
         HEADER   PBOUND                                                        
         PREPFLD                                                         0067000
         LW,R10   FL:BOUND                                               0068000
         AI,R10   1                                                      0069000
         SLS,R10  RIGHT*2                                                       
         HEXTOEBD                   VALUE OF BOUND                       0070000
         PRINTLO                                                         0071000
*                                                                        0072000
*                 BLANK COMMON                                           0073000
*                                                                        0074000
         HEADER   PBLCOM                                                        
         PREPFLD                                                         0076000
         LW,R10   FBA:COMN                                                      
         SLS,R10  RIGHT*2           WA                                          
         HEXTOEBD                                                               
         PREPFLD                                                                
         LW,R10   LBA:COMN                                                      
         SW,R10   FBA:COMN          COMMON SIZE                                 
         SLS,R10  RIGHT*2           IN WORDS - DECIMAL                          
         DECHEX                                                          0081000
         PRINTLO                                                         0082000
         B        PUBS                                                   0098000
*                                                                        0099000
*                 PUBLIC LIBRARIES                                       0116000
*                                                                        0117000
PUBS     HEADER   PPUB                                                          
         PREPFLD                                                         0119000
         LI,R4    T:PL                                                          
         LW,R10   0,R4                                                          
         BNEZ     PUB2                                                          
         LW,R10   E:NONE                                                        
         LW,R11   E:BLANKS                                                      
         PREPFLD                                                                
         INBYTS                                                                 
         B        PUB3                                                          
PUB2     LW,R10   0,R4                                                          
         BEZ      PUB3                                                          
         LW,R11   1,R4                                                          
         PREPFLD                                                                
         INBYTS                                                                 
         AI,R4    PLESIZE                                                       
         B        PUB2                                                          
PUB3     PRINTLO                                                                
*                                                                        0129000
*                 TOTAL PROGRAM SIZE                                     0130000
*                                                                        0131000
MAP25    HEADER   PTOTM             MEMORY OCCUPANCY                            
         PREPFLD                                                                
         LW,R10   V:TOTSIZ          SUM OF SEGMENT LENGTHS                      
         HEXTOEBD                   IN HEX                                      
         PREPFLD                                                                
         LW,R10   V:TOTSIZ                                                      
         DECHEX                     AND DEC                                     
         PREPFLD                                                                
         PRINTLO                                                                
         HEADER   PTOTF             FILE SIZE                                   
         PREPFLD                                                                
         LW,R10   M:OV+4            NUMBER OF GRANULES                          
         SLS,R10  RIGHT*17                                                      
         HEXTOEBD                                                        0145000
         PREPFLD                                                         0146000
         LW,R10   M:OV+4                                                        
         SLS,R10  RIGHT*17                                                      
         DECHEX                     IN DECIMAL                           0148000
         PREPFLD                    PASS OVER 'WORDS'                    0150000
         PRINTLO                                                         0151000
*                                                                        0152000
*                 SIZE OF LIBRARY LOADED                                 0153000
*                                                                        0154000
         HEADER   PLIB                                                          
         PREPFLD                                                         0156000
         LW,R10   V:LIBSIZ          TOTAL SIZE OF LIBRARY LOADEN                
         HEXTOEBD                                                        0158000
         PREPFLD                                                         0159000
         LW,R10   V:LIBSIZ                                                      
         DECHEX                                                          0161000
         PREPFLD                    'WORDS'                              0162000
         PRINTLO                                                         0163000
*                                                                        0164000
*                 PROGRAM ERROR SEVERITY                                 0165000
*                                                                        0166000
         HEADER   PERR                                                          
         PREPFLD                                                         0168000
         LI,R10   0                                                      0169000
         MTW,0    FL:ERROR                                                      
         BEZ      %+2                                                    0171000
         LI,R10   1                 <0 MEANS ERROR SEVERITYOF 1          0172000
         HEXTOEBD                                                        0174000
         PRINTLO                                                         0175000
         MTW,0    FL:PUBL                                                       
         BNEZ     MAP26             BRANCH IF PUBLIB LOAD                       
         HEADER   PLSSH             LOADER-SUPPLIED STRUCTURES                  
         PREPFLD                                                                
         PRINTLO                    PRINT HEADER                                
         HEADER   PLSSV             LOADER-SUPPLIED STRUCTURES                  
         PREPFLD                    VALUES                                      
         LW,R10   FBA:OVLO          OVLOAD TABLE ORIGIN                         
         SLS,R10  RIGHT*2           BA TO WA                                    
         HEXTOEBD                                                               
         PREPFLD                                                                
         LW,R6    FBA:SEG                                                       
         SLS,R6   RIGHT*2           BA TO WA                                    
         LI,R7    S:MA                                                          
         LH,R10   *R6,R7            ORIGIN OF ROOT1 (PCB)                       
         SLS,R10  LEFT*1            DA TO WA                                    
         AND,R10  X:1FFFF                                                       
         HEXTOEBD                                                               
         PREPFLD                                                                
         LW,R10   S:ENTRY,R6        PROGRAM ENTRY POINT                         
         AND,R10  X:1FFFF                                                       
         HEXTOEBD                                                               
         PREPFLD                                                                
         LW,R10   FBA:TEMP          USERTEMP STACK ORIGIN                       
         SLS,R10  RIGHT*2           BA TO WA                                    
         HEXTOEBD                                                               
         PREPFLD                                                                
         LW,R10   FL:TEMP           USER TEMP STACK SIZE                        
         HEXTOEBD                                                               
         PREPFLD                                                                
         LW,R10   FBA:RTMP          RBM TEMP STACK ORIGIN                       
         SLS,R10  RIGHT*2           BA TO WA                                    
         HEXTOEBD                                                               
         PREPFLD                                                                
         LW,R10   FL:RTMP           RBM TEMP STACK SIZE                         
         HEXTOEBD                                                               
         PREPFLD                                                                
         LW,R10   FBA:DCBT          DCBTAB ORIGIN                               
         SLS,R10  RIGHT*2           BA TO WA                                    
         HEXTOEBD                                                               
         PRINTLO                    PRINT LOADER-SUPPLIED                       
*                                                                               
         LW,R0    FL:PUBL                                                       
         BNEZ     MAP26             B IF PUBLIB                                 
         MAPDCBS                                                                
*                                   STRUCTURES VALUES                           
MAP26    RES      0                                                             
*                                                                        0185000
*                 DONE PROGRAM HEADER                                    0186000
*                                                                        0187000
         PAGE                                                            0223000
*                                                                               
*                                                                               
SEGMAP   RES      0                                                             
         LI,R4    0                                                             
         STW,R4   BDP:SEG                                                       
*                                                                        0350000
SEG2     LW,R4    FBA:SEG                                                       
         AW,R4    BDP:SEG                                                       
         CW,R4    LBA:SEG                                                       
         BGE      ENDMAP                                                        
         SLS,R4   RIGHT*2           WA CURRENT SEG ENTRY                        
         SETUPSEG                                                               
         MTW,0    FL:MAP                                                        
         BLZ      SEG3              NO MAP- CHECK SYMBOLS FOR U OR D.           
         LW,R10   SEGID             SPECIAL SEGMENT HEADERS                     
         LI,R3    PSEGCX                                                        
         CI,R10   PLCXTID                                                       
         BE       SEG25             BRANCH IF PUBLIB CONTEXT SEG                
         LI,R3    PSEGCM                                                        
         CI,R10   COMNID                                                        
         BE       SEG25             BRANCH IF COMMON SEG                        
         LI,R3    PSEGR2                                                        
         CI,R10   ROOT2ID                                                       
         BE       SEG25             BRANCH IF ROOT2                             
         LI,R3    PSEGR1                                                        
         CI,R10   ROOT1ID                                                       
         BE       SEG25             BRANCH IF ROOT1                             
         MTW,0    FL:PUBL                                                       
         BEZ      SEG26             BRANCH IF NOT PUBLIB CODE                   
         LI,R3    PSEGPL                                                        
SEG25    BAL,R15  HEADER                                                        
         PREPFLD                                                                
         B        SEG27                                                         
SEG26    RES      0                 OVERLAY SEGMENT                             
         HEADER   PSEG                                                          
         PREPFLD                                                                
         LW,R10   SEGID             SEGMENT ID                                  
         DECHEX                                                                 
         PREPFLD                                                                
         LW,R10   LINKID            LINKED TO                                   
         DECHEX                                                                 
SEG27    RES      0                                                             
         LI,R0    'C'               FORMAT CONTROL BYTE FOR SHORT MAP           
         LW,R3    BAPLINE           BYTE ADDR OF START OF LINE                  
         MTW,0    FL:MAP                                                        
         BNEZ     %+2               B IF NOT A SHORT MAP                        
         STB,R0   0,R3              SET FORMAT CONTROL FOR SHORT MAP            
         PRINTLO                    PRINT LINE                                  
         HEADER   PSHDR                                                         
         PREPFLD                                                         0365000
         PRINTLO                                                         0366000
*                                                                        0367000
*                                   OUTPUT SEGMENT HEADER VALUES         0368000
*                                                                        0369000
         HEADER   PVFSEGFL                                                      
         PREPFLD                                                         0372000
         LW,R10   INPWLSEG          WRDS OF INPUT                               
         HEXTOEBD                                                        0375000
         PREPFLD                                                         0375500
         LW,R10   LIBWLSEG          WORDS OF LIBRARY                            
         HEXTOEBD                                                        0378000
         PREPFLD                                                         0379000
         LW,R10   TOTWLSEG          TOTAL NO OF WORDS ON SEGMENT                
         HEXTOEBD                                                        0384000
         LW,R10   RADBLSEG          LM SIZE OF SEGMENT                          
         PREPFLD                                                                
         HEXTOEBD                                                               
         LW,R10   FWASEG            FWA OF CORE IMAGE                           
         PREPFLD                                                         0390000
         HEXTOEBD                                                        0391000
         LW,R10   LWASEG            LWA+1 OF CORE IMAGE                         
         PREPFLD                                                         0398000
         HEXTOEBD                                                        0399000
         LI,R6    7                                                             
         LW,R10   *R4,R6            START ADDRESS IN 15-31 (WA)                 
         AND,R10  X:1FFFF                                                       
         PREPFLD                                                         0403000
         HEXTOEBD                                                        0404000
*                                                                        0405000
         LI,R6    28                                                            
         LB,R5    *R4,R6            BYTE CONTAINING SEVERITY                    
         LI,R10   0                                                             
         CI,R5    X'80'             INPUT SEVERITY BIT                          
         BAZ      %+2                                                           
         LI,R10   1                 SET SEVERITY TO 1                    0411000
         PREPFLD                                                         0412000
         HEXTOEBD                                                        0413000
*                                                                        0414000
         LI,R10   0                 LOAD SEVERITY                        0415000
         CI,R5    X'40'             LOAD SEVERITY BIT                           
         BAZ      %+2                                                           
         LI,R10   1                                                      0418000
         PREPFLD                                                         0419000
         HEXTOEBD                                                        0420000
         LW,R10   GRANOV            GRANULE DISP ON OV THIS SEG                 
         PREPFLD                                                                
         DECHEX                     IN DECIMAL                                  
         PRINTLO                                                         0421000
         MTW,0    FL:MAP                                                 0422000
         BEZ      SEG3              SHORT MAP                            12     
         MAPCSECT                                                               
SEG3     MAPSYM                                                         10      
         LW,R5    NBE:SEG                                                       
         AWM,R5   BDP:SEG           POINT TO NEXT T:SEG ENTRY                   
         LW,R8    FWASEG                                                        
         LW,R9    LWASEG                                                        
         PUBMEM                     CHECK FOR MEMORY CONFLICTS                  
*                                   WITH PUBLIBS USED                           
         B        SEG2                                                   0425000
*                                                                        0426000
*                 END OF MAP                                             0427000
*                                                                        0428000
ENDMAP   RES      0                                                      0429000
         MTW,0    FL:OFLOW                                                      
         BNEZ     EMP5                                                          
         MTW,0    FL:PUBL                                                       
         BEZ      ENDM3                                                         
         MTW,0    FL:ERROR                                                      
         BGZ      EMP5              DONT COMPLETE LOADING OF PUBL ON ERR        
ENDM3    HEADER   PLDC              LOAD COMPLETE                               
         PREPFLD                                                                
         PRINTLO                                                                
         B        EMP55                                                         
*                                                                               
*                 OUTPUT LOADING NOT COMPLETE                                   
*                 AND NAMES OF OVERFLOWED FILES.                                
*                                                                               
EMP5     HEADER   PLDNC             LOAD NOT COMPLETE                           
         PREPFLD                                                                
         PRINTLO                                                                
EMP55    LI,R6    M:OV                                                          
EMP6     CI,R6    M:X6              RANGE OF FILES TO OVERFLOW                  
         BG       EMP8                                                          
         MTW,0    FL:OFLOW          FOR OVERFLOW,ALWAYS                         
         BGZ      EMP66             LIST ALL FILE SIZES                         
         MTW,0    FL:MAP                                                        
         BLEZ     EMP7              DONT LIST ON SHORT OR NULL MAP              
EMP66    PROFLOW                    LIST  FILE SIZES                            
EMP7     AI,R6    DCBSIZE                                               9       
         B        EMP6                                                          
*                                                                               
*                 PROFLOW PRINTS FILE NAME AND GRANULES NEEDED/USED             
*                                                                               
PROFLOW  RES      0                                                             
         LI,R5    8                                                             
         MTB,0    *R6,R5            OVERFLOW BYTE IN DCB                        
         BEZ      PRO2                                                          
         HEADER   PVOFLOW                                                       
         B        PRO23                                                         
PRO2     HEADER   PVFILTEX          NO OVERFLOW                                 
PRO23    RES      0                                                             
         LW,R7    R6                                                            
         INFID                      INSERT FILE ID                              
         LI,R5    8                                                             
         LH,R10   *R6,R5            NUMBER OF RECORDS/GRANULES NEEDED           
         AND,R10  X:FFFF                                                        
         SLS,R10  RIGHT*1           ONLY 15 BITS                                
         CI,R6    M:X1              M:X1  IS IN RECORDS,OTHERS IN GRAN          
         BNE      PRO3                                                          
         CI,R10   7                                                             
         BAZ      %+2                                                           
         AI,R10   8                 PARTIAL GRANULE                             
         SLS,R10  RIGHT*3           8 BIN RECS PER GRAN                         
PRO3     PREPFLD                                                                
         DECHEX                                                                 
         PREPFLD                    TRAILER                                     
         PRINTLO                                                                
         B        *12               RETURN                                      
*                                                                        0434000
*                                   END MAP - TERMINATE                  0435000
*                                                                        0436000
EMP8     MTW,0    UNDEFMSG                                                      
         BLEZ     EMP83                                                         
         LI,R9    UNDEFDEF          DEFS WITH NO  VALUE                         
         RDIAG                      DIAGNOSTIC                                  
EMP83    MTW,0    UNREFMSG                                                      
         BLEZ     EMP84                                                         
         LI,R9    UPREF             UNDEFINED PRIMARY REFS                      
         RDIAG                                                                  
EMP84    MTW,0    DDEFMSG                                                       
         BLEZ     EMP86                                                         
         LI,R9    DUPLDEFS          DUPLICATE DEFS                              
         RDIAG                                                                  
EMP86    MTW,0    DREFMSG           DUPLICATE REF                               
         BLEZ     EMP89                                                         
         LI,R9    DUPREF                                                        
         RDIAG                                                                  
EMP89    MTW,0    FL:MAP                                                        
         BLZ      MAP9              NO MAP                                      
EMP9     HEADER   PEMAP                                                 10      
         PREPFLD                                                        9       
         PRINTLO                                                        9       
         HEADER   PTOF                                                          
         PREPFLD                                                                
         PRINTLO                                                                
MAP9     MTW,0    FL:OFLOW                                              9       
         BEZ      %+2                                                   9       
         RABORT                     ABORT                               9       
         MTW,0    FL:PUBL           ABORT ON ERROR SEV IN PUBLIC LIB            
         BEZ      MAP99                                                         
         MTW,0    FL:ERROR                                                      
         BEZ      %+2                                                           
         RABORT                                                                 
MAP99    CAL1,9   1                 NORMAL EXIT                                 
         PAGE                                                            0438000
*                                                                        0439000
*                                                                        0440000
*                                                                        0441000
*                                                                        0442000
*                                   SUBROUTINES                          0443000
*                                                                        0444000
*                                                                        0445000
*                                                                        0446000
*                                                                        0447000
         TITLE    '****  MAPCSECT  ****'                                9       
*                                                                       9       
*                                                                       9       
*        ****************************                                   9       
*        *                          *                                   9       
*        *                          *                                   9       
*        *  MAPCSECT                *                                   9       
*        *                          *                                   9       
*        *                          *                                   9       
*        ****************************                                   9       
*                                                                       9       
*                                                                       9       
*                 MAP ALL CONTROL SECTIONS FOR THE CURRENT  SEGMENT     9       
*                                                                       9       
*                                                                       9       
*        ENTRY    R13 IS BAL REGISTER                                           
*                                                                        12     
*                 BDP:SEG POINTS TO RELEVANT SEGMENT TABLE ENTRY         12     
*                                                                        12     
*                 R4 POINTS TO CURRENT SEG ENTRY                         12     
*                                                                       9       
*                                                                       9       
*                                                                       9       
*                          ROM    NUMBER  WADDR   HSIZE                 9       
*                          ULIB   RECORD                                9       
*                          SLIB   RECORD                                9       
*                                                                       9       
*                                                                       9       
MAPCSECT RES      0                                                     9       
         MTW,0    FL:OFLOW          IF EOT OCCURRED                             
         BNEZ     *R13              DO NOT MAP CSECTS, BECAUSE                  
*        READING X4 OR X5 MIGHT CAUSE EOT ABORT BEFORE MAPPING                  
*        FILE SIZES NEEDED                                                      
         LI,R8    0                                                     9       
         STW,R8   BDP:MODL                                              9       
         STW,R8   MODNUM                                                9       
MPC2     LW,R8    LBA:DCB                                                12     
         BOUNDRDW                                                       9       
         STW,R8   FBA:MODL                                              9       
         STW,R8   R6                ADDRESS OF TABLES                   9       
         LI,R7    10                BL OF MODIFY IN SEG TABLE           9       
         LH,R8    *R4,R7                                                9       
         BOUNDRDW                                                       9       
         STW,R8   R9                                                    9       
         AWM,R8   FBA:MODL                                              9       
         LI,R7    11                                                    9       
         LH,R8    *R4,R7            BL  OF MODL                         9       
         AND,R8   X:FFFF                                   /SIG7-3273/*C5733    
         AW,R9    R8                BYTE CNT IN 9                       9       
         AW,R8    FBA:MODL                                              9       
         STW,R8   LBA:MODL                                              9       
         LI,R7    3                                                     9       
         LH,R12   *R4,R7            GRANULE DISPL                               
         AND,R12  X:FFFF                                   /SIG7-3273/*C5733    
         LI,R5    M:X3                                                  9       
         READXN                     READS T:MODIFY,T:MODL               9       
         LW,R0    LBA:MODL                                                      
         CW,R0    FBA:MODL                                                      
         BLE      *R13              RETURN IF NO ROMS TO LIST                   
         HEADER   PCSECTH                                                       
         PREPFLD                                                                
         PRINTLO                                                                
*                                                                       9       
MPC4     LW,R0    FBA:MODL          PROCESS  MODULE  TABLE              9       
         AW,R0    BDP:MODL                                              9       
         CW,R0    LBA:MODL                                              9       
         BGE      *R13              DONE ALL MODULES,RETURN                     
         SLS,R0   RIGHT*2           WA  CURRENT TMODULE ENTRY           9       
         MTW,1    MODNUM            MODULE NUMBER                       9       
*                                                                       9       
         LW,R8    *R0               GET FIRST WORD OF T:MODULE ENTRY            
         CI,R8    G                 GLOB BIT                            9       
*                                   SEE EXTENDED COMMENT IN PASS 2      9       
         BAZ      MPC47             G= 0  ADJUST POINTERS               9       
*                                   G= 1  READ NEW GLOB.                9       
         LW,R3    R0                LOOK AHEAD TO GET LAST G=0 ENTRY    9       
         LW,R10   NBE:MODL                                              9       
         SLS,R10  RIGHT*2           NO WORDS IN T:MODL ENTRY            9       
         LW,R11   LBA:MODL                                              9       
         SLS,R11  RIGHT*2                                               9       
MPC45    AW,R3    R10                                                   9       
         CW,R3    R11                                                   9       
         BGE      MPC46             END OF TABLE                        9       
         LW,R4    0,R3              GET FIRST WORD OF T:MODULE ENTRY            
         CI,R4    G                                                     9       
         BAZ      MPC45             =0 CHECK NEXT ENTRY                 9       
*                                                                       9       
*                 LAST WORD OF PRECEDING ENTRY CONTAINS BDP AND BL      9       
*                 OF LAST TABLE IN GLOB.                                9       
*                                                                       9       
MPC46    AI,R3    -1                                                    9       
         LH,R8    *R3               BDP  OF LAST TABLE                  9       
         AND,R8   X:FFFF                                   /SIG7-3273/*C5733    
         BEZ      MPC85             ZERO BYTES                                  
         LI,R4    1                 +                                   9       
         AH,R8    *R3,R4            BL OF LAST TABLE                    9       
         STW,R8   R9                BYTES TO READ                       9       
         LW,R8    LBA:MODL                                              9       
         PUSH     0                                                      12     
         BOUNDRDW                                                        12     
         PULL     0                                                      12     
         STW,R8   FBA:MTB           FBA GLOB                            9       
         STW,R8   R6                                                    9       
         LI,R5    M:X2                                                  9       
         LI,R7    2                                                     9       
         LH,R12   *R0,R7            GRANULE DISPL.                      9       
         AND,R12  X:FFFF                                   /SIG7-3273/*C5733    
         PUSH     0                 READXN CLOBBERS R0                          
         READXN                                                         9       
         PULL     0                                                             
MPC47    LW,R8    FBA:MTB                                               9       
         LI,R7    4                                                     9       
         AH,R8    *R0,R7            FBD T:CSECT                         9       
         STW,R8   FBA:CSEC                                              9       
         LI,R7    5                                                     9       
         AH,R8    *R0,R7            BL  T:CSECT                         9       
         STW,R8   LBA:CSEC                                              9       
*                                                                       9       
*                 OUTPUT CSECTS THIS MODULE                             9       
*                                                                       9       
         LI,R8    0                                                     9       
         STW,R8   BDP:CSEC                                              9       
         LI,R8    'A'               DOUBLE SPACE                                
         STB,R8   SYM                                                           
         PUSH     R4                                                    9       
MPC5     LW,R4    FBA:CSEC                                              9       
         AW,R4    BDP:CSEC                                              9       
         CW,R4    LBA:CSEC                                              9       
         BGE      MPC8                                                  9       
         SLS,R4   RIGHT*2           4 PTS TO CSEC ENTRY                 9       
         HEADER   PVCSEC                                                9       
         LH,R7    *R0                                                   9       
         AND,R7   X:3               00=ROM,1=SLIB,2=ULIB.               9       
         CI,R7    3                                                             
         BAZ      MPC56                                                         
         LI,R11   1                                                             
         CW,R11   FL:MAP                                                        
         BE       MPC75             PROG MAP DONT OUTPUT LIB SYM                
MPC56    LW,R10   E:CTYP,R7                                                     
         PREPFLD                                                        9       
         INBYTS                                                         9       
         PREPFLD                                                        9       
         LH,R8    *R0                                                   9       
         CI,R8    3                                                     9       
         BANZ     MPC6              LIB                                 9       
         LW,R10   MODNUM            ROM NUMBER                                  
         B        MPC7                                                  9       
MPC6     LI,R7    1                                                     9       
         LH,R10   *R0,R7            FOR LIB, ROM NO IN MODULE FILE              
MPC7     DECHEX                     OUTPUT IN DECIMAL                   9       
         LW,R10   0,R4              ADDRESS (BA)                                
         SLS,R10  RIGHT*2           WA                                          
         AND,R10  X:1FFFF                                                12     
         PREPFLD                                                        9       
         HEXTOEBD                                                       9       
         LW,R10   1,R4              SIZE IN BYTES                               
         BOUNDRDW                   BOUND TO DW SIZE                    9       
         SLS,R10  RIGHT*2                                                       
         PREPFLD                                                        9       
         DECHEX                     OUTPUT IN DECIMAL                   9       
         PRINTLO                    PRINT                               9       
MPC75    LI,R8    X'C0'             SINGLE SPACE                                
         STB,R8   SYM                                                           
         LW,R8    NBE:CSEC                                              9       
         AWM,R8   BDP:CSEC                                              9       
         B        MPC5                                                  9       
*                                                                       9       
*                 PREPARE FOR NEXT MODULE                               9       
*                                                                       9       
MPC8     PULL     R4                SEG TABLE  ENTRY ADDR               9       
MPC85    LW,R8    NBE:MODL                                                      
         AWM,R8   BDP:MODL                                              9       
         B        MPC4                                                  9       
         TITLE       '**** MAPSYM ****'                                         
*        MAPSYM READS TO CORE AND MAPS THE CURRENT                              
*                                   SYMBOL TABLE POINTED TO BY           0450000
*                                   BDP:SEG.                             0451000
*                                                                        0452000
*                                   ALL REGS EXCEPT 1 VOLATILE           0453000
*                                                                        0454000
*CALL                                                                    0455000
*                                                                        0457000
*        MAPSYM                                                                 
*                                                                        0458000
MAPSYM   RES      0                                                             
         MTW,0    FL:OFLOW          IF EOT OCCURRED                             
         BNEZ     *R12              DO NOT MAP SYMS, BECAUSE                    
*        READING X2 MIGHT CAUSE EOT ABORT BEFORE MAPPING                        
*        FILE SIZES NEEDED                                                      
         PUSH     12                                                            
*                                                                               
         LW,R8    LBA:DCB           BEGINNING OF  T:SYM ON DW BDRY              
         BOUNDRDW                                                               
         STW,R8   FBA:SYM                                                       
         STW,R8   LBA:SYM                                                       
         MTW,0    BDP:SEG                                                       
         BGZ      MAPSY3            SEGMENT,NOT ROOT                            
         LI,R3    T:PL              MAP PUBLIC LIB SYMBOL TABLES FOR ROO        
MAPSY1   LW,R4    0,R3              NEXT ENTRY                                  
         BEZ      MAPSY3            LAST ENTRY                                  
         LW,R6    LBA:SYM           ALL EXCEPT FIRST READ AT NEXT BYTE          
*                                   TO FORM CONTINUOUS BYTE STRING              
*                                   FOR T:SYM                                   
         LW,R5    1,R3              STORE PUBLIB FILE NAME IN F:PUBL DCB        
         STW,R4   F:PUBL+5                                                      
         STW,R5   F:PUBL+6                                                      
         LI,R5    WA(F:PUBL)                                                    
         LW,R9    PLSYMBL,R3        BL OF SYMBOL TABLE                          
         AWM,R9   LBA:SYM           CUMULATIVE FOR ALL PUBLIBS                  
         LW,R12   PLSYMGO,R3        GRAN NR OF SYMBOL TABLE                     
         READXN                                                                 
         AI,R3    PLESIZE                                                       
         B        MAPSY1                                                        
MAPSY3   LI,R5    WA(M:X5)          T:SYM FROM X5                               
*                                   LBA SYM PTS TO LBA+1 OF PUBLIC              
*                                   LIB SYMBOL TABLES.                          
         LW,R9    TSYMBL            BYTE LENGTH                                 
         BLEZ     MAPSY35           B IF NO SYMBOLS IN SEG                      
         LW,R12   TSYMGRAN          GRANULE DISPLACEMENT                        
         LW,R6    LBA:SYM           INPUT ON BYTE BDRY                          
         AWM,R9   LBA:SYM                                                       
         READXN                                                                 
*                                                                               
MAPSY35  LW,R8    LBA:SYM                                                       
         BOUNDRDW                                                               
         STW,R8   FBA:VALU                                                      
         STW,R8   LBA:VALU                                                      
         MTW,0    BDP:SEG                                                       
         BGZ      MAPSY5                                                        
         LI,R3    T:PL              PUBLIB VALUE TABLES FOR ROOT ONLY           
MAPSY4   LW,R4    0,R3                                                          
         BEZ      MAPSY5            LAST ENTRY                                  
         LW,R5    1,R3              STORE PUBLIB FILE NAME IN F:PUBL DCB        
         STW,R4   F:PUBL+5          FILE NAME                                   
         STW,R5   F:PUBL+6                                                      
         LI,R5    WA(F:PUBL)                                                    
         LW,R6    LBA:VALU                                                      
         LW,R9    PLVALBL,R3        BL OF VALUE TABLE                           
         AWM,R9   LBA:VALU                                                      
         LW,R12   PLVALGO,R3        GRAN NR OF VALUE TABLE                      
         READXN                                                                 
         AI,R3    PLESIZE                                                       
         B        MAPSY4                                                        
MAPSY5   LI,R5    WA(M:X4)          VALU TABLE FILE                             
         LW,R6    LBA:VALU                                                      
         LW,R9    TVALBL                                                        
         BLEZ     MAPSY55           B IF NO SYMBOLS IN SEG                      
         AWM,R9   LBA:VALU                                                      
         LW,R12   TVALGRAN          GRANULE                                     
         READXN                                                                 
*                                                                               
MAPSY55  RES      0                                                             
         LW,R6    LBA:SYM                                                       
         CW,R6    FBA:SYM                                                       
         BLE      MAPSY90           B IF NO SYMBOLS TO MAP                      
         MTW,0    FL:MAP                                                        
         BLEZ     MAPSY6            SKIP HEADER IF ONLY SYMBOLS                 
*                                   LISTED ARE DEFINITION PROBLEMS              
         HEADER   PEXTSYMH                                                      
         PREPFLD                                                                
         PRINTLO                    PRINT HEADER FOR SYMBOL MAP                 
MAPSY6   RES      0                                                             
         LW,R6    FL:SORT                                                       
         BGEZ     SORTMAP           BRANCH TO OUTPUT SORTED MAP                 
         LI,R6    0                                                             
         STW,R6   BDP:VALU                                                      
         STW,R6   BDP:SYM                                                       
         LI,R8    'A'                                                           
         STB,R8   SYM               DOUBLE SPACE FIRST SYMBOL                   
         LI,R8    0                                                             
RDM3     LW,R5    BDP:SYM                                                       
         AW,R5    FBA:SYM                                                       
         CW,R5    LBA:SYM                                                       
         BL       RDM4              STILL INSIDE TABLE                          
         B        MAPSY90                                                       
*                                                                        0488000
RDM4     PRINTSYM                   PRINT NEXT SYMBOL                    0489000
         AI,R8    1                                                      0490000
         LI,R9    X'C0'                                                         
         STB,R9   SYM               SINGLE SPACE  OTHER SYMBOLS.                
         LB,R9    0,R5              T:SYM ENTRY                          0491000
         AWM,R9   BDP:SYM                                                       
         AW,R5    R9                                                            
         LB,R9    0,R5                                                   0493000
         CI,R9    X'80'             IS IT CONTINUATION                   0494000
         BAZ      RDM3                                                          
         AND,R9   X:7F              CONTINUATION                                
         AWM,R9   BDP:SYM                                                       
         B        RDM3                                                   0498000
*                                                                        0499000
*                                                                        0500000
MAPSY90  RES      0                                                             
         PULL     R12                                                           
         B        *R12              RETURN                                      
*                                                                        0501000
*                                   END MAPSYM                                  
*                                                                        0503000
*                                                                        0504000
*                                                                        0505000
         TITLE    '****  MAPDCBS  ****'                                         
*                                                                               
*                                                                               
*        ****************************                                           
*        *                          *                                           
*        *                          *                                           
*        *  MAPDCBS                 *                                           
*        *                          *                                           
*        *                          *                                           
*        ****************************                                           
*                                                                               
*                                                                               
*                 MAPS DCBS IN  T:DCB                                           
*                                                                               
*                                                                               
*                                                                               
*                                                                               
*        ENTRY    12 IS BAL REG.                                                
*                                                                               
*                                                                               
*                                                                               
*                                                                               
*                                                                               
*                                                                               
*                                                                               
MAPDCBS  RES      0                                                             
         LW,R8    LBA:DCB                                                       
         CW,R8    FBA:DCB                                                       
         BLE      *R12              RETURN IF NO DCBS TO MAP                    
         HEADER   PDCBH                                                         
         PREPFLD                                                                
         PRINTLO                    PRINT HEADER FOR DCB MAP                    
         LI,R8    'A'               DOUBLE SPACE FIRST LINE                     
         STB,R8   SYM                                                           
         LI,R4    0                                                             
         STW,R4   BDP:DCB                                                       
MPD2     LW,R4    FBA:DCB                                                       
         AW,R4    BDP:DCB                                                       
         CW,R4    LBA:DCB                                                       
         BGE      *12               END OF DCB TABLE.                           
         HEADER   PVFDCB                                                        
         SLS,R4   RIGHT*2                                                       
         LB,R8    *R4               DCB CONTROL BYTE                            
         LI,R10   ' '                                                    12     
         CI,R8    D                                                             
         BANZ     %+2               USER OR LOADER  DEFINED                     
         LI,R10   'U'               DEF-NO VALUE, OR PREF - NO DEFAULT.         
         SCS,R10  RIGHT*8           LEFT JUST                                   
         LI,R5    1                                                             
         PREPFLD                                                                
         INBYTS                     INSERT  D,U                                 
         PREPFLD                                                                
         LW,R10   E:UDCB            USER DCB                                    
         LB,R8    *R4                                                           
         CI,R8    PREF                                                          
         BAZ      %+2                                                           
         LW,R10   E:SDCB            SYSTEM OR ASSIGNED                          
         LI,R5    4                                                             
         INBYTS                                                                 
         PREPFLD                                                                
         LW,R10   1,R4                                                          
         LW,R11   2,R4                                                          
         CW,R10   E:BLANKS                                                      
         BNE      %+2               NAMED                                       
         LD,R10   E:UNAM            UNNAMED PCB                          12     
         LI,R5    8                                                             
         INBYTS                                                                 
         PREPFLD                                                                
         LB,R8    *R4                                                           
         LI,R10   0                                                             
         CI,R8    PREF                                                          
         BANZ     MPD44                                                         
         CI,R8    D                                                             
         BAZ      MPD6                                                          
MPD44    CI,R8    V                                                             
         BAZ      MPD6                                                          
         LW,R10   0,R4                                                          
         AND,R10  X:7FFFF                                                       
         CI,R8    C                                                             
         BANZ     %+2               CONSTANT                                    
         SLS,R10  RIGHT*2           WA                                          
MPD6     HEXTOEBD                                                               
         PRINTLO                                                                
*                                                                               
*                                   NEXT ENTRY                                  
*                                                                               
         LW,R4    NBE:DCB                                                       
         AWM,R4   BDP:DCB                                               10      
         LI,R8    X'C0'             SINGLE SPACE                                
         STB,R8   SYM                                                           
         B        MPD2                                                          
         TITLE       '****  PRINTSYM  ****'                                     
*                                                                        0507000
*                                                                        0508000
*                                                                        0509000
*        PRINTSYM PRINTS A SYMBOL LINE ON THE MAP                        0510000
*                                                                        0511000
*                                                                        0512000
*                                                                        0513000
*        CALL                                                                   
*        PRINTSYM                                                        0515000
*                 USES DECHEX,HEADER,PREPFLD,INBYTS,PRINTLO              0516000
*                                                                        0517000
*                                                                        0518000
*PARAMETERS       R8 CONTAINS THE ENTRY NUMBER                           0519000
*                 R5 CONTAINS BAP TO SYMBOL IN T:SYM ON ENTRY            0520000
*                 VFSYM IS FIELD KEY                                     0521000
*                                                                        0522000
*                                                                        0523000
*RETURN           R5,R8 UNCHANGED                                        0524000
*                                                                        0525000
*                                                                        0526000
*BUFFERS          USES RHDR1  OVERWRITING                                0527000
*                 FIRST CHAR OF BUFFER IS VFC                            0528000
*                                                                        0529000
*                                                                        0530000
*                                                                        0531000
*                                                                        0532000
PRINTSYM RES      0                                                      0533000
         PUSH     3,8                                                           
         HEADER   PVFSYM                                                        
         STW,R5   BAPSYM                                                        
         LW,R7    R8                                                            
*                                                                        0540000
         MW,R7    NBE:VALU                                                      
         AW,R7    FBA:VALU          BAP TO CURRENT VALUE                 0547000
         STW,R7   BAPVALU                                                       
         LB,R9    0,R7              KEY TO VALUE ENTRY                   0548000
         CI,R9    F                                                     9       
         BAZ      PRI3              NOT A DUPLICATE                     9       
         LI,R10   'D'                                                   9       
         B        PRI5                                                  9       
PRI3     CI,R9    D                                                     9       
         BAZ      PRI4              UNDEFINED                           9       
         CI,R9    V                                                             
         BAZ      PRI4              UNDEFINED DEF                               
         LI,R10   X'40'             BLANK OUT  D,UFIELD                 9       
         B        PRI5                                                  9       
PRI4     LI,R10   'U'               UNDEFINED                           9       
PRI5     SCS,R10  RIGHT*8                                                       
         PREPFLD                                                                
         INBYTS                                                          0558000
*                                   D,U FIELD SET UP                     0559000
         LW,R7    BAPVALU                                                       
*                                                                        0560000
*                                                                        0561000
         PREPFLD                    SET PREF,SREF,ETC                    0562000
         LB,R6    0,R7              VALUE  KEY                                  
         CI,R6    F                                                             
         BAZ      PRI52             NOT DOUBLE DEF                              
         AND,R6   X:TY                                                     101  
         CI,R6    DEF                                                      101  
         BE       PRI51                 DUPLICATE DEF                      101  
         MTW,1    DREFMSG           DUPLICATE PREF                              
         B        PRI6                                                          
PRI51    MTW,1    DDEFMSG                                                       
         B        PRI6              OUTPUT DOUBLE DEF REGARDLESS                
PRI52    AND,R6   X:TY              IS THE SYMBOL A PREF OR SREF           101  
*                                   OR DSECT                                    
         CI,R6    DEF                                                      101  
         BE       PRI53                 NO                                 101  
         CI,R6    SREF              IS IT AN SREF          /SIG7-2087/*C015732  
         BE       PRI99             YES.  DONT MAP                              
         LB,R6    0,R7                  YES,IS THE REF  SATISFIED          101  
         CI,R6    D                                                        101  
         BAZ      PRI52A                        NO                         101  
         CI,R6    V                                                        101  
         BAZ      PRI52A            NO.  MAP IT.                                
         AND,R6   X:TY                                                          
         CI,R6    DSCT              IS IT A REF                                 
         BNE      PRI99             YES.  DONT MAP IT                           
         B        PRI59             DSECT.  CONTINUE TO MAP                     
PRI52A   MTW,1    UNREFMSG                      NO,MAP THE REF             101  
         B        PRI6                                                          
PRI53    LB,R6    0,R7              REPLACE VALUE KEY                           
         CI,R6    D                                                             
         BAZ      PRI55             UNDEFINED DEF                               
         CI,R6    V                 DEFINED                                     
         BANZ     PRI59             VALUE                                       
PRI55    MTW,1    UNDEFMSG          UNDEFINED DEF  OUTPUT REGARDLESS            
         B        PRI6                                                          
PRI59    MTW,0    FL:MAP                                                        
         BLEZ     PRI99             SHORT OR NO MAP                             
PRI6     LB,R6    0,R7              VALUE KEY                                   
         SCS,R6   RIGHT*6                                                       
         LW,R10   PRTYP,R6          GET MNEMONIC                         0565000
         INBYTS                                                          0567000
*                                   TYPE INSERTED                        0568000
*                                                                        0569000
*                                                                        0570000
         PREPFLD                    PL,UL,SL,IM,LC,BLANK                 0571000
         LB,R6    0,R7                                                          
         AND,R6   X:3                                                           
         LH,R10   PRINP,R6          S/B PL,UL,SL,OR IM                   0574000
         AND,R10  X:FFFF                                                        
         CI,R10   'IM'                                                          
         BE       PRI7                                                          
         LI,R11   1                 LIB SYMBOL.  DONT PRINT                     
         CW,R11   FL:MAP            EXCEPT IN SPECIAL CASES:                    
         BNE      PRI7              B TO PRINT IF MAP,ALL                       
         LB,R9    0,R7                                                          
         CI,R9    F                                                             
         BANZ     PRI7              B TO PRINT IF DUP DEF                       
         CI,R9    D                                                             
         BAZ      PRI7              B TO PRINT IF UNDEF                         
         CI,R9    V                                                             
         BANZ     PRI99             B TO SKIP PRINT IF UNRESOLVED               
PRI7     SLS,R10  LEFT*16                                                       
         INBYTS                     INSERT INPUT CODE                    0576000
         B        PRI8                                                          
*                                                                        0577000
*                 SYMBOL NAME                                            0578000
*                                                                        0579000
PRI71    RES      0                                                             
         PREPFLD                                                         0580000
         LW,R5    BAPSYM                                                        
         LB,R8    0,R5              NUMBER OF CHARACTERS                 0582000
         CI,R8    1                                                      12     
         BE       PRI99             DONT MAP PSEUDO-FWD ITEM             12     
         AI,R8    -1                                                            
         AI,R5    1                                                      0586000
         LW,R6    R1                MOVE SYMBOL TO PRINT LINE                   
         MOVBYTS                                                         0588000
         AW,R1    R8                SPACE TO END OF SYMBOL                      
         AW,R2    R8                DECREMENT LINE COUNT                        
         B        PRI9                                                          
PRI8     PREPFLD                    GET READY FOR VALUE                  0598000
         LW,R7    BAPVALU                                                       
         LB,R10   0,R7              VALUE KEY                                   
         CI,R10   D                 D BIT                                0600000
         BAZ      PRI86                                                         
         CI,R10   V                 V BIT                                0602000
         BAZ      PRI86                                                         
         AI,R7    1                                                      0604000
         LW,R5    R7                                                            
         LI,R6    BA(R10)                                                0606000
         LI,R8    4                                                             
         MOVBYTS                    GET VALUE                                   
         LW,R7    BAPVALU                                                       
         LB,R7    0,R7                                                          
         LI,R0    X'C'                                                          
         CI,R7    C                                                             
         BANZ     PRI85             DONT SHIFT CONSTANT                         
         STW,R10  R0                BYTE OFFSET                                 
         AND,R0   X:3                                                           
         SAS,R10  RIGHT*2           CONVERT TO WA RESTOLUTION                   
PRI85    RES      0                                                             
         LW,R7    R3                                                            
         AI,R7    -1                                                            
         LB,R5    0,R7              RESET FIELD SIZE                            
         HEXTOEBD                   HEX ADDRESS                          0610000
         PREPFLD                                                                
         STW,R0   R10                                                           
         LI,R5    1                                                             
         HEXTOEBD                   OFFSET FOR ADDR,'C' FOR CONSTANT            
         LW,R7    BAPVALU                                                       
         LB,R10   0,R7                                                          
         SLS,R10  RIGHT*6                                                       
         CI,R10   DSECT                                                         
         BNE      PRI87             NO  DSECT                                   
         LW,R5    BAPSYM                                                        
         LB,R10   0,R5                                                   0617000
         AW,R5    R10                                                           
         LB,R8    0,R5                                                   0619000
         CI,R8    X'80'             IS CONTINUATION BIT SET                     
         BAZ      %                 LOGIC / NO SIZE GIVEN                       
         AI,R5    1                                                             
         LI,R10   0                                                             
         LI,R8    3                                                             
         LI,R6    BA(R10)+1                                                     
         MOVBYTS                                                                
         LW,R5    BAPVALU                                                       
         LB,R5    0,R5                                                          
         CI,R5    F                                                             
         BANZ     %+3               B IF DUPLICATE.  MUST MAP.                  
         CW,R10   X:FFFFFF                                                      
         BE       PRI99             B IF DSECT REFERENCE. DONT MAP.             
         CI,R10   3                                                             
         BAZ      %+2                                                           
         AI,R10   4                                                             
         SLS,R10  RIGHT*2                                                       
         LW,R5    R8                                                            
         PREPFLD                                                         0626000
         DECHEX                     OUTPUT SIZE IN DECIMAL               0627000
         B        PRI71                                                         
*                                                                               
PRI86    LW,R10   E:BLANKS                                                      
         LW,R11   E:BLANKS                                                      
         INBYTS                     BLANK VALUE FIELD                           
         PREPFLD                                                                
         INBYTS                     BLANK BYTE OFFSET FIELD                     
PRI87    LW,R10   E:BLANKS                                                      
         LW,R11   E:BLANKS                                                      
         PREPFLD                                                                
         INBYTS                     BLANK DSECT SIZE FIELD                      
         B        PRI71             INSERT SYMBOL                               
*                                                                               
PRI9     PRINTLO                    PRINT SYMBOL LINE                    0629000
PRI99    PULL     3,8                                                           
         B        *13                                                           
*                                                                        0631000
PRTYP    TEXT     ' DEF'            WORD TABLE OF SYMBOL TYPES                  
         TEXT     'DSCT'                                                        
         TEXT     'SREF'                                                        
         TEXT     ' REF'                                                        
PRINP    TEXT     'IMSLULPL'        HALF WORD TABLE OF MODULE TYPE              
*                                                                        0632000
*                                   END PRINTSYM                         0633000
*                                                                        0634000
*                                                                        0635000
         TITLE       '****  MAP HDRS  ****'                                     
*                                                                               
*        HEADERS                    AF(1) = FBA TEXT FOR HEADER                 
*                                   AF(2) = BDA FIELD TRIPLE FROM FBAFLD        
*                                                                               
*                                                                               
         BOUND    4                                                             
*                                                                               
HDR      COM,13,19 BA(AF(2))-BA(FBAFLDS),BA(AF(1))                              
*                                                                               
MAPTYPE  HDR      MAPTP,MAPTPF      TYPE OF LOAD MODULE                         
PFILE    HDR      FIL,FILF          FILE                                        
PNUM     HDR      NUM,NUMF          NUMBER OF SEGMENTS                          
PNUM1    HDR      NUM1,NUM1F        NR OF COMMON SEGS                           
PNUM2    HDR      NUM2,NUM2F        NR OF OVERLAY SEGS                          
PNUM3    HDR      NUM3,NUM3F        NR OF PUBLIB SEGS                           
PLIM     HDR      LIM,LIMF          LIMIT                                       
PBOUND   HDR      BOU,BOUF          BOUND                                       
PBLCOM   HDR      BLCOM,BLCOMF      BLANK COMMON                                
PPUB     HDR      PUB,PUBF          PUBLIC LIBRARIES                            
PTOTM    HDR      TOTM,TOTMF        TOTAL MEMORY OCCUPANCY                      
PTOTF    HDR      TOTF,TOTFF        TOTAL LM FILE OCCUPANCY                     
PLIB     HDR      LIB,LIBF          LIBRARY SIZE                                
PERR     HDR      ERR,ERRF          ERROR SEVERITY                              
PLDC     HDR      LDC,LDCF          LOAD COMPLETED                              
PLDNC    HDR      LDNC,LDNCF        LOAD NOT COMPLETED                          
PLSSH    HDR      LSSH,LSSHF        LOADER-SUPPLIED STRUCTURES HEADER           
PLSSV    HDR      LSSV,LSSVF        LOADER-SUPPLIED STRUCTURES VALUES           
PSEGR1   HDR      SEGR1,SEGR1F      ROOT PART ONE HEADER                        
PSEGR2   HDR      SEGR2,SEGR2F      ROOT PART TWO HEADER                        
PSEGCM   HDR      SEGCM,SEGCMF      BLANK COMMON SEG HEADER                     
PSEGPL   HDR      SEGPL,SEGPLF      PUBLIB CODE SEG HEADER                      
PSEGCX   HDR      SEGCX,SEGCXF      PUBLIB CONTEXT SEG HEADER                   
PSEG     HDR      SEG,SEGF          SEGMENT...LINKED TO                         
PSHDR    HDR      SHDR,SHDRF        SEGMENT HEADER                              
PEMAP    HDR      EMAP,EMAPF        END MAP                                     
PTOF     HDR      TOF,TOFF          TOP OF FORM ONLY                            
PVFSEGFL HDR      VSEG,VFSEG        SEG STRUCTURE VALUES                        
PVFSYM   HDR      SYM,VFSYM         VALUE FORMATS SYMBOLS                       
PVFDCB   HDR      SYM,VFDCB                                                     
PVOFLOW  HDR      OFLOW,VOFLOW      LIST OF OVERFLOWED FILES.                   
PVFILTEX HDR      FILETEX,VOFLOW                                                
PVCSEC   HDR      SYM,VCSEC                                             9       
PCSECTH  HDR      PCSEC,VCSECH                                          9       
PEXTSYMH HDR      EXTSYMH,EXTSYMHF                                              
PDCBH    HDR      DCBH,DCBHF                                                    
*                                                                               
         TITLE    '****  HEADER TEXT AND FIELD FORMAT TRIPLES ****'             
*                                                                               
*                                                                               
*        HEADER TEXT  CHARACTER 1 IS FORMAT CONTROL BYTE                        
*                                                                               
*                 ALL TEXT LINES <=85 CHARACTERS  INCL FORMAT                   
*                                                                               
*                                                                               
*        FIELDS   3 BYTES PER FIELD - DETERMINE INSERTION OF CHARACTER          
*                 STRINGS INTO TEXT LINE (SEE HEADER AND PREPFLD)               
*                 BYTE1  IS NUMBER OF CHARACTERS TO SKIP- 1E                    
*                 PASS OVER AND LEAVE  UNALTERED.                               
*                 BYTE2  IS NUMBER  OF NUMBER OF BLANKS TO INSERT               
*                 BYTE3  IS SIZE OF FIELD FOR INSERTION OF A                    
*                 CHARACTER   STRING (SEE INBYTS,DECHEX,HEXTOEBD).              
*                                                                               
FBAFLDS  EQU      BA(%)             FIELD CONTROL TRIPLES ARE                   
*                                   EXPRESSED AS BYTE OFFSET FROM               
*                                   HERE                                        
         SPACE    2                                                             
MAPTPF   DATA,1   8,0,8                                                         
         DATA,1   1,0,8                                                         
         SPACE    2                                                             
         BOUND    4                                                             
MAPTP    TEXT     '1MAP OF XXXXXXXX XXXXXXXX'                                   
         SPACE    2                                                             
PUBF     DATA,1   19,2,0            LOCATED HERE TO ALLOW EXPANSION             
         DO1      5                                                             
         DATA,1   0,2,8                                                         
*                                   OVER ALREADY USED TEXT.                     
         SPACE    2                                                             
         BOUND    4                                                             
PUB      TEXT     '  PUBLIC LIBRARIES'                                          
FILF     DATA,1   14,0,8            FILE NAME                                   
         DATA,1   1,0,2             DISK AREA NAME                              
         DO1      #DFACNT                                                       
         DATA,1   1,0,8             FILE ACCOUNT                                
         SPACE    2                                                             
         BOUND    4                                                             
         DO       #DFACNT                                                       
FIL      TEXT     ' LOAD MODULE  XXXXXXXX.XX.XXXXXXXX'                          
         ELSE                       #DFACNT                                     
FIL      TEXT     'ALOAD MODULE  XXXXXXXX.XX'                                   
         FIN                        #DFACNT                                     
NUMF     DATA,1   23,3,1                                                        
         DATA,1   6,0,0                                                         
         BOUND    4                                                             
NUM      TEXT     'B NUMBER OF SEGMENTS:        ROOT'                           
*                                                                               
NUM1F    DATA,1   23,3,1                                                        
         DATA,1   8,0,0                                                         
         BOUND    4                                                             
NUM1     TEXT     '                             COMMON'                         
*                                                                               
NUM2F    DATA,1   23,0,4                                                        
         DATA,1   9,0,0                                                         
         BOUND    4                                                             
NUM2     TEXT     '                             OVERLAY'                        
*                                                                               
NUM3F    DATA,1   23,2,2                                                        
         DATA,1   16,0,0                                                        
         BOUND    4                                                             
NUM3     TEXT     '                             PUBLIC LIBRARY'                 
*                                                                               
LIMF     DATA,1   16,0,5                                                        
         DATA,1   7,0,5                                                         
         BOUND    4                                                             
LIM      TEXT     '  LIMITS:  FWA:        LWA:      '                           
*                                                                               
BOUF     DATA,1   7,2,5             BOUND VALUE                                 
         SPACE    2                                                             
         BOUND    4                                                             
BOU      TEXT      '  BOUND       '                                             
BLCOMF   DATA,1   20,2,5            BASE                                        
         DATA,1   6,2,5             HEX SIZE                                    
         DATA,1   1,0,6             1DEC SIZE                                   
         SPACE    2                                                             
         BOUND    4                                                             
BLCOM    TEXT      '  BLANK COMMON  BASE         SIZE       /      '            
TOTMF    DATA,1   22,0,5                                                        
         DATA,1   1,0,6                                                         
         DATA,1   7,0,0                                                         
         BOUND    4                                                             
TOTM     TEXT     '  TOTAL MEMORY SIZE:       /        WORDS'                   
*                                                                               
TOTFF    DATA,1   20,0,4                                                        
         DATA,1   1,0,5                                                         
         DATA,1   10,0,0                                                        
         BOUND    4                                                             
TOTF     TEXT     '  TOTAL FILE SIZE:      /       GRANULES'                    
*                                                                               
LIBF     DATA,1   14,2,5            HEX SIZE                                    
         DATA,1   1,0,6             1 DEC SIZE                                  
         DATA,1   8,0,0             'WORDS'                                     
         SPACE    2                                                             
         BOUND    4                                                             
LIB      TEXT      '  LIBRARY SIZE       /        WORDS'                        
ERRF     DATA,1   24,2,1            ERROR SEVERITY                              
         SPACE    2                                                             
         BOUND    4                                                             
ERR      TEXT      '  PROGRAM ERROR SEVERITY   '                                
LDCF     DATA,1   22,0,0                                                        
         SPACE    2                                                             
         BOUND    4                                                             
LDC      TEXT     '1LOADING WAS COMPLETED'                                      
LDNCF    DATA,1   26,0,0                                                        
         SPACE    2                                                             
         BOUND    4                                                             
LDNC     TEXT     '1LOADING WAS NOT COMPLETED'                                  
         SPACE    2                                                             
VOFLOW   DATA,1   9,0,8             FILE NAME                                   
         DATA,1   1,0,2             DISK AREA NAME                              
         DO1      #DFACNT                                                       
         DATA,1   1,0,8             DISK FILE ACCOUNT NAME                      
         DATA,1   9,0,4             NR OF GRANULES                              
         DATA,1   10,0,0                                                        
         SPACE    2                                                             
         BOUND    4                                                             
         DO       #DFACNT                                                       
OFLOW    TEXT     'A  FILE  XXXXXXXX.XX.XXXXXXXX  NEEDS  XXXX  GRANULES'        
FILETEX  TEXT     'A  FILE  XXXXXXXX.XX.XXXXXXXX   USED  XXXX  GRANULES'        
         ELSE                       #DFACNT                                     
OFLOW    TEXT     'A  FILE  XXXXXXXX.XX  NEEDS  XXXX  GRANULES'                 
FILETEX  TEXT     'A  FILE  XXXXXXXX.XX   USED  XXXX  GRANULES'                 
         FIN                        #DFACNT                                     
LSSHF    DATA,1   60,0,0                                                        
         BOUND    4                                                             
LSSH     TEXT     'C OVLOAD  PCB    ENTRY  UTSFWA  SIZE   ',;                   
                  'RTSFWA  SIZE   DCBTAB'                                       
*                                                                               
LSSVF    DATA,1   0,2,5                                                         
         DATA,1   0,3,5                                                         
         DATA,1   0,2,5                                                         
         DATA,1   0,2,5                                                         
         DATA,1   0,3,5                                                         
         DATA,1   0,2,5                                                         
         DATA,1   0,3,5                                                         
         DATA,1   0,2,5                                                         
         BOUND    4                                                             
LSSV     RES      15                                                            
*                                                                               
SEGR1F   DATA,1   14,0,0                                                        
         BOUND    4                                                             
SEGR1    TEXT     '1ROOT PART ONE'                                              
*                                                                               
SEGR2F   DATA,1   14,0,0                                                        
         BOUND    4                                                             
SEGR2    TEXT     '1ROOT PART TWO'                                              
*                                                                               
SEGCMF   DATA,1   13,0,0                                                        
         BOUND    4                                                             
SEGCM    TEXT     '1BLANK COMMON'                                               
*                                                                               
SEGPLF   DATA,1   15,0,0                                                        
         BOUND    4                                                             
SEGPL    TEXT     '1PUBLIC LIBRARY'                                             
*                                                                               
SEGCXF   DATA,1   23,0,0                                                        
         BOUND    4                                                             
SEGCX    TEXT     '1PUBLIC LIBRARY CONTEXT'                                     
*                                                                               
SEGF     DATA,1   8,2,5             SEG NO                                      
         DATA,1   11,2,5            LINKED TO                                   
         SPACE    2                                                             
         BOUND    4                                                             
SEG      TEXT     '1SEGMENT         LINKED TO       '                           
SHDRF    DATA,1   74,0,0                                                        
         BOUND    4                                                             
SHDR     TEXT     'B INPUT  LIBRARY  MEM WL  LM BL  FWA    ',;                  
                  'LWA    ENTRY  ROMERR  LDERR  GRAN '                          
*                                                                               
VFSEG    DATA,1   0,2,5                                                         
         DATA,1   0,2,5                                                         
         DATA,1   0,4,5                                                         
         DATA,1   0,3,5                                                         
         DATA,1   0,2,5                                                         
         DATA,1   0,2,5                                                         
         DATA,1   0,2,5                                                         
         DATA,1   0,6,1                                                         
         DATA,1   0,7,1                                                         
         DATA,1   0,2,5                                                         
         BOUND    4                                                             
VSEG     RES      20                                                            
*                                                                               
EMAPF    DATA,1   11,0,0                                                        
         SPACE    2                                                             
         BOUND    4                                                             
EMAP     TEXT     'BEND OF MAP'                                                 
TOFF     DATA,1   1,0,0                                                         
         SPACE    2                                                             
         BOUND    4                                                             
TOF      TEXT     '1'                                                           
VFDCB    DATA,1   1,2,1             U,D                                         
         DATA,1   0,1,4             U,S DCB                                     
         DATA,1   0,8,8             DCB NAME                                    
         DATA,1   0,7,5                                                         
         DATA,1   0,2,1             BYTE OFFSET                                 
VFSYM    DATA,1   1,1,1             U,D                                         
         DATA,1   0,1,4             DEF,REF,SREF,DSECT                          
         DATA,1   0,1,2             PL,UL,SL,IM                                 
         DATA,1   0,1,8             VALUE                                       
         DATA,1   0,1,1             BYTE OFFSET                                 
         DATA,1   0,1,5             DSECT SIZE                                  
         DATA,1   0,1,64            SYMBOL TEXT                                 
         BOUND    4                                                             
SYM      DO1      24                                                            
         DATA     '    '                                                        
VCSEC    DATA,1   1,3,4             ROM,ULIB,SLIB                       9       
         DATA,1   0,3,5             NUMBER                              9       
         DATA,1   0,4,6             ADDR                                9       
         DATA,1   0,4,5             SIZE                                9       
VCSECH   DATA,1   20,0,0                                                9       
         BOUND    4                                                             
PCSEC    TEXT     'A  CONTROL SECTIONS  '                               9       
EXTSYMHF DATA,1   19,0,0                                                        
         BOUND    4                                                             
EXTSYMH  TEXT     'A  EXTERNAL SYMBOLS'                                         
*                                                                               
DCBHF    DATA,1   21,0,0                                                        
         BOUND    4                                                             
DCBH     TEXT     'A DATA CONTROL BLOCKS'                                       
         TITLE    '****  HEADER  ****'                                  9       
*                                                                               
*                                                                               
*        ***************************                                            
*        *                                                                      
*        *                                                                      
*        *  HEADER                  *                                           
*        *                          *                                           
*        *                          *                                           
*        ***************************                                            
*                                                                               
*                                                                               
*                 SETS PARAMETERS AND POINTERS FOR LINE FORMAT ROUTINE          
*                                                                               
*        ENTRY    R3  WA OF HEADER CONTROL WORD                                 
*                                                                               
*        EXIT     BAPLINE  =  FBA CURRENT PRINT LINE                            
*                 R1  =  DITTO                                                  
*                 R2  =  -85                                                    
*                 R3  =  BAP TO FIRST FIELD CONTROL BYTE                        
HEADER   RES      0                                                             
         LW,R10   0,R3                                                          
         AND,R10  X:7FFFF                                                       
         STW,R10  BAPLINE                                                       
         STW,R10  R1                                                            
         LI,R2    -95                                                           
         LW,R10   0,R3                                                          
         SLS,R10  RIGHT*19          LEFT 13 BITS CONTAIN DISP                   
*                                   OF FIELD CONTROL BYTE FROM FBAFLDS          
         AI,R10   BA(FBAFLDS)                                                   
         STW,R10  R3                                                            
         B        *R15                                                          
         TITLE    '****  SETUPSEG  ****'                                        
*                                                                               
*                                                                               
*        ***************************                                            
*        *                          *                                           
*        *                          *                                           
*        *  SETUPSEG                *                                           
*        *                          *                                           
*        *                          *                                           
*        ***************************                                            
*                                                                               
*                                                                               
*                 SETS UP VALUES FOR CURRENT SEG TABLE                          
*                 IN PROPER FORMAT IN P:POOL                                    
*                                                                               
*        ENTER    R4 CONTAINS WA OF CURRENT T:SEG ENTRY                         
*                 R14 IS BAL REGISTER                                           
*                                                                               
*                                                                               
*                 CELLS SET UP ARE                                              
*                 P: IS OFFSET WITHIN P:POOL FOR THIS GROUP                     
SEGID    EQU      P:+0              SEGMENT ID NUMBER                           
LINKID   EQU      P:+1              LINK ID NUMBER                              
TVALGRAN EQU      P:+2              GRANULE NUMBER OF T:VALU TABLE IN M:X4      
TSYMGRAN EQU      P:+3              GRAN NUMBER OF T:SYM TABLE IN M:X5          
TVALBL   EQU      P:+4              BYTE LENGTH OF T:VALU                       
TSYMBL   EQU      P:+5              BYTE LENGTH OF T:SYMBOL                     
FWASEG   EQU      P:+6              FWA OF SEGMENT                              
LWASEG   EQU      P:+7              LWA OF SEGMENT                              
TOTWLSEG EQU      P:+8              TOTAL WORD LENGTH THIS SEGMENT              
INPWLSEG EQU      P:+9              WORDS OF INPUT MODULES                      
LIBWLSEG EQU      P:+10             WORDS OF LIBRARY MODULES                    
RADBLSEG EQU      P:+11             LM IMAGE LENGTH THIS SEG                    
GRANOV   EQU      P:+12             GRAN DISP THIS SEG                          
*                                                                               
SETUPSEG RES      0                                                             
         LI,R5    0                                                             
         LI,R6    3                                                             
SET2     GETHW                                                                  
         STW,R10  SEGID,R5                                                      
         AI,R5    1                                                             
         BDR,R6   SET2                                                          
         LI,R5    4                                                             
         GETHW                                                                  
         STW,R10  TSYMGRAN                                                      
         LI,R5    7                                                             
         GETHW                                                                  
         STW,R10  TVALBL                                                        
         LI,R5    9                                                             
         GETHW                                                                  
         STW,R10  TSYMBL                                                        
         LI,R5    12                                                            
         GETDL                                                                  
         STW,R10  FWASEG                                                        
         STW,R10  LWASEG                                                        
         LI,R5    13                                                            
         GETDL                                                                  
         STW,R10  TOTWLSEG                                                      
         AWM,R10  LWASEG                                                        
         MTW,-1   LWASEG                                                        
         LI,R5    8                                                             
         LW,R9    *R4,R5            BL OF LIBRARY AS BYTES                      
         SLS,R9   RIGHT*2                                                       
         AND,R9   X:1FFFF                                                       
         STW,R9   LIBWLSEG                                                      
         SW,R10   R9                TOT - LIB                                   
         STW,R10  INPWLSEG                                                      
         LI,R5    5                                                             
         GETHW                                                                  
         STW,R10  GRANOV                                                        
         LW,R10   S:LL,R4           LM SIZE OF SEGMENT                          
         STW,R10  RADBLSEG                                                      
         B        *R14                                                          
GETHW    LH,R10   *R4,R5                                                        
         AND,R10  X:FFFF                                                        
         B        *R15                                                          
GETDL    LH,R10   *R4,R5                                                        
         AND,R10  X:FFFF                                                        
         SLS,R10  LEFT*1                                                        
         B        *R15                                                          
         TITLE       '****  INBYTS  ****'                                       
*                                                                               
*                                                                               
************************************************************************        
*                                                                               
*                                                                               
*        INBYTS   INSERT A BYTE STRING INTO THE PRINT LINE                      
*                                                                               
*                                                                               
************************************************************************        
*                                                                               
*                                                                               
*                                                                               
*                                                                               
*PARAMETERS       R5 CONTAINS FIELD SIZE                                        
*                 R1 IS BAP TO FIELD                                            
*                 R2  -85+CURRENT BYTE DISPL IN LINE                            
*                 R10,R11 CONTAIN BYTE STRING, LJ.                              
*RETURN           TRUNCATION RESULTS IN CONDITION CODE 3 BEING SET              
*                                                                               
*                                                                               
*                                                                               
*                                                                               
*                                                                               
INBYTS   RES      0                                                             
         PUSH     5,8                                                           
         AW,R2    R5                                                            
         BGEZ     %                 BYTES IN LINE > 85                          
         STW,R5   R8                                                            
         LW,R6    R1                DESTINATION                                 
         LI,R5    BA(R10)           SOURCE                                      
         MOVBYTS                    INSERT IN LINE                              
         AW,R1    R8                UPDATE BAP LINE                             
         PULL     5,8                                                           
         B        *R14                                                          
         TITLE    '****  INFID  *****'                                          
*                                                                               
*        PURPOSE: PUT A FILE ID INTO A MAP LINE                                 
*                                                                               
*        CALL:    BAL,R13  INFID                                                
*        OR:      INFID                                                         
*                                                                               
*        INPUT:   R1=BAP TO FIELD IN LINE PROTOTYPE                             
*                 R2=-85+ BYTE DISPL CURRENT BYTE IN IMAGE                      
*                 R3=BAP TO FIELD CONTROL BYTE FOR NAME                         
*                 R7=ADDRESS OF DCB ASSIGNED TO FILE                            
*                                                                               
*        OUTPUT:  R1, R2, R3 REFLECT INSERTION                                  
*                                                                               
INFID    RES      0                                                             
         LI,R9    0                                                             
         CAL1,1   FPT:GASN          GET DCB ASSIGNMENT                          
         LI,R9    PT:CLS                                                        
         CAL1,1   FPT:CLS           CLOSE DCB                                   
         LCI      2                                                             
         LM,R10   GIOCT+2           GET FILE NAME                               
         LI,R7    7                                                             
         CB,R11   E:BLANKS          RT-ALIGN FILE NAME                          
         BNE      %+3               B IF ALIGNED                                
         SCD,R10  -8                SHIFT TO NEXT BYTE                          
         BDR,R7   %-3               (R7 LIMITS MAX SHIFT IF ALL-BLANK)          
         PREPFLD                                                                
         INBYTS                                                                 
         LW,R10   GIOCT+1                                                       
         SLS,R10  16                AREA NAME                                   
         PREPFLD                                                                
         INBYTS                                                                 
         DO       #DFACNT                                                       
         LCI      2                                                             
         LM,R10   GIOCT+4           GET ACCOUNT NAME                            
         PREPFLD                                                                
         INBYTS                                                                 
         FIN                        #DFACNT                                     
         B        *R13                                                          
         TITLE       '****  PREPFLD  ****'                                      
*                                                                               
************************************************************************        
*                                                                               
*                                                                               
*        PREPFLD  PREPARE A FIELD IN LINE IMAGE ACCORDING TO CURRENT            
*                 FIELD TABLE ENTRY                                             
*                                                                               
*                                                                               
************************************************************************        
*                                                                               
*                                                                               
*                                                                               
*                                                                               
*PARAMETERS       R1  BAP TO FIELD LOC IN LINE                                  
*                                                                               
*                 R2  -85 PLUS BYTE DISPL CURRENT BYTE                          
*                 R3  BAP TO FIELD CONTROL BYTE                                 
*                                                                               
*RETURN           R5 CONTAINS THE FIELD LENGTH RJ IN 28-31                      
*                                                                               
*METHOD           USING 3 ELEMENTS OF FIELD LIST (A,B,C)                        
*                 1.SPACES A BYTES                                              
*                 2.BLANKS B BYTES                                              
*                 3. SETS R5 TO C AND RETURNS                                   
*                                                                               
*                                                                               
PREPFLD  RES      0                                                             
         PUSH     6,7                                                           
         LB,R5    0,R3              SPACE COUNT                                 
         AWM,R5   R1                BAP LINE                                    
         AWM,R5   R2                LINE COUNT                                  
         BGEZ     %                 ERROR - EXCEEDED LINE                       
         AI,R3    1                 NEXT CONTROL BYTE                           
PRE3     LI,R7    X'40'                                                         
         LB,R5    0,R3              BLANK COUNT                                 
         BEZ      PRE4                                                          
PRE34    STB,R7   0,R1                                                          
         AI,R1    1                                                             
         AI,R2    1                                                             
         BGEZ     %                                                             
         BDR,R5   PRE34                                                         
PRE4     AI,R3    1                                                             
         LB,R5    0,R3              FIELD SIZE                                  
         PULL     6,7                                                           
         AI,R3    1                 SET TO NEXT FIELD                           
         B        *R15                                                          
*                                                                               
*                                                                               
************************************************************************        
         TITLE       '****  PRINTLO  ****'                                      
*                                                                               
*                                                                               
*        PRINTLO  PRINT ONE LINE OF MAP TO M:LO                                 
*                                                                               
*                                                                               
************************************************************************        
*                                                                               
*                                                                               
*                                                                               
*                                                                               
*PARAMETERS       R2 -85 PLUS BYTE DISPL                                        
*                 BAPLINE CONTAINS FBA OF LINE                                  
*                                                                               
*                 USES FPT:PRLO                                                 
*                      M:LO                                                     
*                                                                               
*RETURN           ALL ABNORMAL,ERROR EXITS ABORT                                
*                                                                               
*                                                                               
*                                                                               
*                                                                               
PRINTLO  RES      0                                                             
*                                                                               
*                 INSERT ADDR,BYTE CNT TO M:LO DCB                              
*                                                                               
         LI,R10   M:LL                                                          
         MTW,0    FL:MAP                                                        
         BLZ      %+2               NO-MAP OUTPUT ON M:LL                       
         LI,R10   M:LO              ELSE M:LO                                   
         AW,R10   Y:11              WRITE ORDER                                 
         STW,R10  FPT:PRLO                                                      
         LW,R10   BAPLINE           FBA OF PRINT LINE                           
         SLS,R10  RIGHT*2           WA                                          
         STW,R10  FPT:PRLO+4                                                    
         AI,R2    95                                                            
         STW,R2   FPT:PRLO+5        BYTE COUNT                                  
         LI,R9    0                 NO PARAMETER LIST                           
         CAL1,1   FPT:PRLO          PRINT                                       
         B        *R14                                                          
         TITLE       '****  DECHEX/HEXTOEBD  ****'                              
*                                                                               
*                                                                               
************************************************************************        
*                                                                               
*                                                                               
*        DECHEX   CHANGE A BINARY NUMBER TO BINARY DECIMAL                      
*                                                                               
*        HEXTOEBD CHANGE HEX TO EBCDIC AND INSERT RIGHT JUSTIFIED               
*                 IN A GIVEN FIELD.THE REMAINDER OF THE FIELD IS                
*                 SET TO BLANKS.                                                
*                                                                               
************************************************************************        
*                                                                               
*                                                                               
*CALL                                                                           
*        BAL,R15  DECHEX                                                        
*                 HEXTOEBD                                                      
*                                                                               
*                                                                               
*PARAMETERS       R10 CONTAINS THE VALUE ON ENTRY                               
*                 R5 CONTAINS FIELD LENGTH                                      
*                 R1 CONTAINS BAP FIELD FOR INSERTION                           
*                                                                               
*                                                                               
*                                                                               
*                                                                               
*                 IF TRUNCATION BECAUSE OF FIELD SIZE OCCURED                   
*                 CONDITION CODE 3 IS SET                                       
*                                                                               
*                                                                               
*                                                                               
*                                                                               
DECHEX   RES      0                                                             
         PUSH     4,13                                                          
         LI,R7    0                 DECIMAL ACCUMULATOR                         
         LI,R6    -8                                                            
         LW,R11   R10                                                           
         CI,R11   10                CHECK IF ORIGINAL <10                       
         BL       HEX2                                                          
*                                   > OR = 10                                   
*                                   INT PORTION IN 11 -LOW ORDER                
DE2      LI,R10   0                 HIGH ORDER = 0                              
DE3      DW,R10   D:10                                                          
         SCS,R10  RIGHT*4           RIGHT JUSTIFY                               
         SCS,R7   RIGHT*4           MAKE ROOM IN ACCUMULATOR                    
         AW,R7    R10               INSERT DIGIG                                
         AI,R6    1                                                             
         BEZ      DE5                                                           
         CI,R11   0                                                             
         BNE      DE2               NOT DONE                                    
DE4      SCS,R7   RIGHT*4           RIGHT JUST DECIMALIZED NUMBER               
         BIR,R6   %-1                                                           
DE5      LW,R11   R7                                                            
         B        HEX2                                                          
*                                                                               
HEXTOEBD RES      0                                                             
*                 R6,R7 WILL CONTAIN CUMULATIVE EBCDIC                          
*                 R8 IS TEST FOR LEADING ZEROS                                  
*                 R13 IS COUNT OF ACTIVE DIGITS                                 
*                 R4  IS COUNTER                                                
         PUSH     4,13                                                          
         LW,R11   R10                                                           
HEX2     LI,R6    0                                                             
         LI,R7    0                                                             
         LI,R8    0                                                             
         LI,R13   0                                                             
         LI,R4    -8                                                            
HE2      LI,R10   0                                                             
HE3      SCD,R10  LEFT*4                                                        
         AW,R8    R10                                                           
         BEZ      HE38              LEADING ZERO                                
         AI,R13   1                 ACTIVE DIGIT                                
         CI,R10   9                                                             
         BG       HE35              A-F                                         
         AI,R10   X'F0'             0-9                                         
         B        HE39                                                          
HE35     AI,R10   X'B7'             (A-F) + B7 = C1 - C6                        
         B        HE39                                                          
HE38     AI,R10   X'40'             LEADING ZERO                                
HE39     SCD,R6   LEFT*8                                                        
         AW,R7    R10                                                           
         BIR,R4   HE2                                                           
         STD,R6   R10                                                           
         CI,R13   0                                                             
         BNE      %+2                                                           
         AI,R11   X'B0'             LEAST SIGNIF BLANK TO X'F0'                 
         LW,R8    R5                FIELD SIZE                                  
         LW,R6    R1                DESTINATION                                 
         LI,R5    BA(R10)+8                                                     
         SW,R5    R8                MOVE NO OF DIGITS IN FIELD                  
         MOVBYTS                                                                
         PULL     4,13                                                          
         AW,R1    R5                                                            
         AW,R2    R5                                                            
         BGEZ     %                                                             
         B        *R14                                                          
*                                                                               
         TITLE    '**** SORTMAP ****'                                           
SORTMAP  RES      0                                                             
         LI,R8    'A'                                                           
         STB,R8   SYM                                                           
SORT10   RES      0                                                             
         LW,R8    LBA:VALU                                                      
         CW,R8    FBA:VALU                                                      
         BLE      SORT20            BRANCH IF ALL SYMBOLS OUT                   
         MTW,0    FL:SORT                                                       
         BEZ      ALPHA                                                         
         BAL,R14  GETLOVAL          GET NEXT SYMBOL (VALUE)                     
         B        %+2                                                           
ALPHA    BAL,R14  GETLOSYM                                                      
         LW,R8    R10                                                           
         PRINTSYM                                                               
         LI,R9    X'C0'             SINGLE-SPACE LISTING                        
         STB,R9   SYM                                                           
         LW,R10   R8                                                            
         BAL,R14  DLTNTRY           DELETE THE SYMBOL JUST LISTED               
         B        SORT10            BRANCH TO LIST NEXT SYMBOL                  
SORT20   PULL     12                                                            
         B        *12               RETURN (ENTERED THRU MAPSYM)                
         TITLE    '**** FBASYM ****'                                            
*        PURPOSE: GET FBA OF T:SYMBOL ENTRY GIVEN ENTRY #                       
*                                                                               
*        INPUT:   R10=ENTRY #                                                   
*        CALL:    BAL,R15     FBASYM                                            
*        OUTPUT:  R10 UNCHANGED                                                 
*                 R5=FBA OF T:SYMBOL ENTRY                                      
*                   =0 IF PAST END OF T:SYMBOL                                  
*                                                                               
FBASYM   RES      0                                                             
         LI,R8    0                 ENTRY # COUNTER                             
         LW,R5    FBA:SYM           T:SYMBOL FBA                                
         LW,R12   LBA:SYM           T:SYMBOL LBA+1                              
SYMF10   CW,R5    R12                                                           
         BGE      SYMF30            BRANCH IF END OF TABLE                      
         LB,R0    0,R5              ENTRY LENGTH                                
         CI,R0    X'80'                                                         
         BANZ     SYMF20            BRANCH IF CONTINUATION ENTRY                
         CW,R8    R10                                                           
         BE       *R15              RETURN IF CORRECT ENTRY FOUND               
         AI,R8    1                 INCREMENT ENTRY COUNTER                     
SYMF20   AND,R0   X:7F              EXTRACT ENTRY BL                            
         AW,R5    R0                                                            
         B        SYMF10            BRANCH FOR NEXT ENTRY                       
SYMF30   LI,R5    0                 END OF T:SYMBOL                             
         B        *R15              EXIT                                        
         TITLE    '**** CPBS ****'                                              
*                                                                               
*        PURPOSE: COMPARE BYTE STRINGS                                          
*        INPUT:   R4=FBA STRING 1                                               
*                 R5=FBA STRING 2                                               
*                 R6=BYTE COUNT                                                 
*        RETURN:  CC3 AND CC4 AS FROM SIG7 CBS INSTRUCTION                      
*        CALL:    BAL,R15  CPBS                                                 
*        USES:    R1-R3,R8                                                      
*                                                                               
CPBS     RES      0                                                             
         LCI      3                                                             
         LM,R1    R4                COPY PARAMETERS INTO SCRATCH REGS           
CPBS1    LB,R8    0,R1                                                          
         CB,R8    0,R2                                                          
         BNE      *R15                                                          
         BDR,R3   %+2                                                           
         B        *R15                                                          
         AI,R1    1                                                             
         AI,R2    1                                                             
         B        CPBS1                                                         
         TITLE    '**** GETLOSYM ****'                                          
*                                                                               
*        PURPOSE: SELECT THE ALPHANUMERICALLY LEAST SYMBOL IN T:SYMBOL          
*        CALL:    BAL,R14  GETLOSYM                                             
*        INPUT:   NONE                                                          
*        USES:    CPBS,R4-R7,R11,R12                                            
*        RETURN:  ENTRY NR OF LEAST SYMBOL IN R10                               
*                 BYTE ADDRESS OF LEAST SYMBOL IN R5                            
*                                                                               
GETLOSYM RES      0                                                             
         LW,R4    FBA:SYM           CURRENT SYM BA                              
         LW,R5    FBA:SYM           LEAST SYM BA                                
         LI,R10   0                 LEAST SYM NR                                
         LI,R11   0                 CURRENT SYM NR                              
         LB,R6    0,R5              FIRST SYM BL                                
         CI,R6    1                                                             
         BE       *R14              RETURN IF 1ST SYM IS PSEUDOENTRY            
GET10    AI,R11   1                 NEW CURRENT SYM NR                          
GET11    LB,R6    0,R4                                                          
         AND,R6   X:7F                                                          
         AW,R4    R6                NEW CURRENT SYM BA                          
         CW,R4    LBA:SYM                                                       
         BGE      *R14              RETURN IF END OF T:SYMBOL                   
         LB,R6    0,R4              NEW CURRENT SYM BL                          
         CI,R6    1                                                             
         BNE      GET12             BRANCH IF NOT PSEUDOENTRY                   
         LW,R5    R4                                                            
         LW,R10   R11                                                           
         B        *R14              RETURN WITH PSEUDOENTRY                     
GET12    CI,R6    X'80'                                                         
         BANZ     GET11             IF CONTINUATION ENTRY,                      
*        BRANCH TO IGNORE IT                                                    
         LI,R7    -1                FLAG: CRNT SYM BL .LT. LEAST SYM BL         
         CB,R6    0,R5                                                          
         BL       GET15             BRANCH IF CRNT SYM BL .LT.                  
*                                   LEAST SYM BL                                
         LI,R7    0                 FLAG: LEAST SYM BL .LE. CRNT                
         LB,R6    0,R5              USE SHORTER BL FOR COMPARISON               
GET15    AI,R4    1                 SKIP BYTE COUNT                             
         AI,R5    1                                                             
         AI,R6    -1                                                            
         BAL,R15  CPBS                                                          
         BG       GET18             FORMER LEAST SYMBOL STILL LEAST             
         BL       GET17             BRANCH IF CURRENT SYM LEAST                 
         LW,R7    R7                EQUAL.  SAVE THE SHORTER.                   
         BEZ      GET18             LEAST SYM SHORTER                           
GET17    LW,R10   R11               CURRENT SYMBOL NOW LEAST                    
         LW,R5    R4                                                            
GET18    AI,R4    -1                                                            
         AI,R5    -1                                                            
         B        GET10             BRANCH TO CHECK NEXT SYMBOL                 
         TITLE    '**** GETLOVAL ****'                                          
*                                                                               
*        PURPOSE: SELECT SYMBOL WITH LEAST VALUE                                
*        CALL:    BAL,R14  GETLOVAL                                             
*        INPUT:   NONE                                                          
*        USES:    FBASYM,CPBS,R4-R6,R10,R11                                     
*        RETURN:  ENTRY NR OF SYMBOL WITH LEAST VALUE IN R10                    
*                 BYTE ADDRESS OF SYMBOL WITH LEAST VALUE IN R5                 
*                                                                               
GETLOVAL EQU      %                                                             
         LI,R10   0                 ENTRY NR FOR SMALLEST VALUE                 
         LI,R11   0                 ENTRY NR FOR CURRENT ENTRY                  
GET20    AI,R11   1                 EXAMINE NEXT ENTRY                          
         LW,R5    R10                                                           
         MW,R5    NBE:VALU          BYTE INDEX TO LEAST VALUE                   
         LW,R4    R5                                                            
         AW,R4    FBA:VALU          BA OF LEAST VALUE                           
         LW,R5    R11                                                           
         MW,R5    NBE:VALU          BYTE INDEX TO CURRENT VALUE                 
         AW,R5    FBA:VALU          BA OF CURRENT VALUE                         
         CW,R5    LBA:VALU                                                      
         BGE      GET25             BRANCH IF END OF TABLE                      
         AI,R4    1                                                             
         AI,R5    1                 SKIP FLAG BYTE                              
         LI,R6    4                 COMPARE FOUR BYTES                          
         BAL,R15  CPBS                                                          
         BLE      GET20             BRANCH IF CURRENT VALUE GREATER             
         LW,R10   R11               SET LEAST VALUE POINTER TO                  
         LW,R5    R4                TO CURRENT ENTRY                            
         B        GET20                                                         
GET25    BAL,R15  FBASYM            GET SYMBOL BA                               
         B        *R14              RETURN                                      
         TITLE    '**** DLTNTRY ****'                                           
*                                                                               
*        PURPOSE: DELETE ENTRY FROM T:VALUE AND T:SYMBOL                        
*        CALL:    BAL,R14  DLTNTRY                                              
*        INPUT:   ENTRY NR IN R10 FOR ENTRY TO DELETE                           
*                 BYTE POINTER IN R5 TO T:SYMBOL ENTRY                          
*        USES:    FBASYM,R5-R8                                                  
*                                                                               
DLTNTRY  RES      0                                                             
         LW,R7    R10                                                           
         MW,R7    NBE:VALU                                                      
         LW,R6    R7                                                            
         LW,R7    R5                SAVE BAP TO T:SYMBOL ENTRY                  
         AW,R6    FBA:VALU          FBA OF T:VALUE ENTRY TO DELETE              
         LW,R5    R6                                                            
         AW,R5    NBE:VALU          LBA+1                                       
         LW,R8    LBA:VALU                                                      
         SW,R8    R5                BL TO MOVE                                  
         MOVBYTS                                                                
         LW,R8    LBA:VALU                                                      
         SW,R8    NBE:VALU                                                      
         STW,R8   LBA:VALU          UPDATE LBA:VALU                             
         LW,R6    R7                FBA OF T:SYMBOL ENTRY TO DELETE             
         LB,R5    0,R6                                                          
         LW,R7    R5                BL TO DELETE                                
         AW,R5    R6                LBA+1                                       
         LB,R8    0,R5              BYTE COUNT FOR NEXT ENTRY                   
         CI,R8    X'84'                                                         
         BNE      %+3               BRANCH IF NOT CONTINUATION ENTRY            
         AI,R5    4                 DELETE CONTINUATION ENTRY ALSO              
         AI,R7    4                                                             
         LW,R8    LBA:SYM                                                       
         SW,R8    R5                BL TO MOVE                                  
         MOVBYTS                                                                
         LW,R8    LBA:SYM                                                       
         SW,R8    R7                                                            
         STW,R8   LBA:SYM           UPDATE LBA:SYM                              
         B        *R14              RETURN                                      
         END                                                                    
