         TITLE    '       **** OVERLAY LOADER ****'                             
         SYSTEM   SIG5                                                          
         SYSTEM   OPTIONS                                                       
*                                                                               
*                                                                               
*        *****************************                                          
*        *                           *                                          
*        *                           *                                          
*        * SIGMA 5/7 OVERLAY LOADER  *                                          
*        *                           *                                          
*        *                           *                                          
*        *        RBM 2              *                                          
*        *                           *                                          
*        *                           *                                          
*        *****************************                                          
*                                                                               
*                                                                               
*                 J.MACINTYRE,J.MACAULEY,SDS                                    
*                                                                               
*                                                                               
*                                                                               
*                                                                               
*                                                                               
*                                                                               
*                                                                               
*                                                                               
*                                                                               
*                                                                               
         DEF      ADDNXT,ADDX,B:C,B:ROM,B:X,BAP:ROM,BAP:ROO2,BEPROMI            
         DEF      BL:ROO2,BOUNDCS,BOUNDRDW,CCDCBV                               
         DEF      CCSTACK,CCVALUE,CHKBLANK,CMPZ,COMPBS,CONVROMX,DCBTYPE         
         DEF      DWBOUND,EXTEND,F:DEFREF,F:DEVICE,F:EBCDIC,F:MODIR             
         DEF      F:MODULE,F:PUBL,FBA:COMN,FBA:DCBT,FBA:INTT,FBA:LIM            
         DEF      FBA:OVLO,FBA:ROO2,FBA:TABS,FBA:TEMP,FL:BACK,FL:BOUND          
         DEF      FL:COMN,FL:ERROR,FL:GO,FL:LBLD,FL:LBPAS,FL:LIB,FL:MAP         
         DEF      FL:MODF,FL:NXTCC,FL:OFLOW,FL:OUTOV,FL:PAS2,FL:PUBL            
         DEF      FL:RTYPE,FL:STEP,FL:TASKS,FL:TEMP,FL:UDCB,FL:UNNAM            
         DEF      FLTMPTSK,FPT:CCI6,FPT:CCI7,FPT:CC1,FPT:CC2,FPT:CC3            
         DEF      FPT:CC4,FPT:CC5,FPT:CC8,FPT:DIAG,FPT:LB1,FPT:LB11             
         DEF      FPT:LB10,FPT:LB13,FPT:LB2,FPT:LB3,FPT:LB4,FPT:LB5             
         DEF      FPT:LB6,FPT:LB7,FPT:LB8,FPT:LB9,FPT:ONE1,FPT:ONE2             
         DEF      FPT:ONE4,FPT:ONE3,FPT:PRLO,FPT:RDG,FPT:RD2,FPT:RD3            
         DEF      FPT:WTG,FPT:XN1,FWA:ASSN,GETDECL,LBA:COMN,LBA:DCBT            
         DEF      LBA:LIM,LBA:OVLO,LBA:PATH,LBA:ROM,LBA:ROO2,LOADERR            
         DEF      LOADSEG,LWA:ASSN,M:C,M:GO,M:LL,M:LO,M:OC,M:OV,M:X1            
         DEF      M:X2,M:X3,M:X4,M:X5,M:X6,MOVBYTS,MOVEDW,NBA:SECT              
         DEF      NUM1,NUM2,NXTSEG,OLOADPCB,P:GRAN,P:POOL,PATHEND               
         DEF      PT:CC6,PT:CC7,PT:DIAG1,PT:LB12,PT:RD1,PT:SCAN,PT:WTGR         
         DEF      RABORT,RAREABC,RAX,RDIAG,RDIAGX,READXN,ROMBYTE                
         DEF      ROMBYTES,ROMERR,SATREF,SCANEXIT,SCANFLAG,SCANITEM             
         DEF      SCAN80,SCAN82,SCAN83,SCAN84,SCAN85,SCAN88,SCAN89              
         DEF      SCAN89A,SCAN90,SCAN91,SCAN92,SCAN93,SCAN94,SCAN95             
         DEF      SCAN96,SCAN97,SCAN98,SCAN99                                   
         DEF      SERCHDCB,SERCHFWD,SERCHPUB                                    
         DEF      SERCHSEG,SERCHSYM,SERCHVAL,SKIPX,SOLVEX,STORCBV               
         DEF      SYMFBA,T:BDP,T:BZA,T:FBA,T:LBA,T:LDADDR                       
         DEF      T:LDINST,T:NBE,T:PL,TBENTRY,V:CCDCB,V:CCTYPE                  
         DEF      V:COLAY,V:DECLNO,V:LIBSIZ,V:LINKID,V:MASK,V:MODLOC            
         DEF      V:ROMRNO,V:SEGID,V:TOTSIZ,VMODMTB,WDP:ASSN,WORD               
         DEF      WRITEXN,XBC,ZERONXT,ZEROX,4BYTES                              
         DEF      X:0,X:3,X:7,X:C,X:F,X:7F,X:FF,X:3FFF,X:FFFF,X:1FFFF      101  
         DEF      X:7FFFF,X:TY,X:TYDV,X:TYFLB,X:DVC,X:LB,X:DUP,Y:DV        101  
         DEF      Y:01,Y:002,Y:2,Y:4,Y:8,Y:42,Y:FF,Y:FFFE                  101  
         DEF      Y:FFF8                                   /SIG7-3806/C015732   
         DEF      V:MSECB,V:MRECB,V:MENQ,V:NUSG,V:NPLSG                         
         DEF      FBA:RTMP,LBA:ROO1                                             
         DEF      FL:STM,FL:CRIT,FL:PRIM,FL:RTMP                                
         DEF      S:FMSK,S:IMSK,S:MMSK,S:SMSK,S:PMSK                            
         DEF      BOUNDRP,PUBMEM                                                
         DEF      V:MODBD,V:REL                                                 
         DEF      FL:SORT,FL:SMM                                                
         DEF      WDP:PL                                                        
         DEF      X:1FF,X:7FF                                                   
         DEF      GIOOBIT,GIODBIT,GIOFBIT,GIOABIT,GIOFA,GIOBITS                 
         DEF      X:FFF                                                         
         DEF      FPT:ASN,FPT:GASN,FPT:COR,FPT:REW,FPT:PACK                     
         DEF      FPT:OPEN,FPT:CLS                                              
         DEF      PT:OPEN,PT:CLS                                                
         DEF      B:OPLBNM,B:DEVNM,B:DEVX,B:DEVCON,B:ERRCC                      
         DEF      NXTROM,GIOCT                                                  
         DEF      FPT:ROM1                                                      
         DEF      GRN:ROO2                                                      
         DEF      EBL:ROO2                                                      
         DEF      LML:ROO2                                                      
         DEF      FLG:ROO2                                                      
         REF      CCI,CC95,DIAG,ERRFUND,LIB,MAP,OERFUND,OVOFLOW                 
         REF      PASSONE,PASSTWO,PR90,RDCONT,WR40                              
         TITLE    '       **** EQUATES ****'                                    
*                                                                               
*                       *GOTO  CONSTANT      1=NON-OVERLAYED VERSION            
*                                            0=OVERLAYED VERSION                
NOV      EQU      0                                                             
*                                                                               
*                                                                               
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%                                                         
*                       *V:CCTYPE INDICES                                       
:OLOAD   EQU      1                                                             
:PUBLIB  EQU      2                                                             
:ROOT    EQU      3                                                             
:SEG     EQU      4                                                             
:COMMON  EQU      5                                                             
:LCOMMON EQU      6                                                             
:INCLUDE EQU      7                                                             
:EXCLUDE EQU      8                                                             
:RES     EQU      9                                                             
:LIB     EQU      10                                                            
:MODIFY  EQU      11                                                            
:ASSIGN  EQU      12                                                            
:BINARY  EQU      13                (BINARY ROM RECORD)                         
*                       *FPT CONSTANTS                                          
OPEN     EQU      X'14'                                                         
CLOSE    EQU      X'15'                                                         
READ     EQU      X'10'                                                         
WRITE    EQU      X'11'                                                         
TYPE     EQU      X'02'                                                         
REWIND   EQU      X'01'                                                         
SKIPREC  EQU      X'1D'                                                         
FILEMODE EQU      X'22'                                                         
ASN      EQU      X'08'                                                         
GASN     EQU      X'09'                                                         
CORRES   EQU      X'2B'                                                         
BLOCKED  EQU      X'01'                                                         
FPTRSZ   EQU      X'80000000'                                                   
FPTORG   EQU      X'40000000'                                                   
RECORDNO EQU      X'80000000'                                                   
ERA      EQU      X'80000000'                                                   
ABA      EQU      X'40000000'                                                   
BUF      EQU      X'20000000'                                                   
RSZ      EQU      X'10000000'                                                   
BTD      EQU      X'04000000'                                                   
KEY      EQU      X'01000000'                                                   
REALTIME EQU      X'00400000'                                                   
WAIT     EQU      X'10'                                                         
*                       *DCB CONSTANTS (BYTE ITEMS)                             
IN       EQU      1                                                             
OUT      EQU      2                                                             
INOUT    EQU      3                                                             
RETRY    EQU      3                                                             
RAD      EQU      1                                                             
DEVICE   EQU      3                                                             
DEVF     EQU      1                                                             
OPLB     EQU      3                                                             
VFC      EQU      1                                                             
*                       *RAD AREAS                                              
FP       EQU      1                 FOREGROUND PROGRAMS                         
SP       EQU      0                 SYSTEM PROGRAMS                             
BT       EQU      3                 BACKGROUND TEMP                             
*                       *DEVICE TYPES                                           
PR       EQU      2                 PAPER-TAPE READER                           
*                       *ABNORMAL I/O CONDITION CODES                           
IL       EQU      7                 BUFFER SMALLAR THAN DATA READ               
EOD      EQU      5                 TAPE MARK OR 'EOD'                          
EOF      EQU      6                 CONTROL COMMAND ON 'C' DEVICE               
EOT      EQU      X'1C'             END-OF-TAPE                                 
NOFILE   EQU      3                 RAD FILE DOES NOT EXIST                     
*                        *SIZES                                                 
PCBSIZE  EQU      13*4              PCB SIZE IN BYTES                           
TEMPSIZE EQU      200               USER TEMP STACK DEFAULT SIZE                
RTMPSIZE EQU      150+#SYMB*75      DEFAULT  RBM TSTACK SIZE                    
*                                                                               
DCBSIZE  EQU      11                DCB SIZE IN WORDS (MAXIMUM)                 
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      10                WORD INDEX TO T:SYMBOL BL                   
PLSYMGO  EQU      11                WORD INDEX TO T:SYMBOL GRAN ORIGIN          
PLVALBL  EQU      12                WORD INDEX TO T:VALUE BL                    
PLVALGO  EQU      13                WORD INDEX TO T:VALUE GRAN ORIGIN           
PLNSEGS  EQU      24                BYTE INDEX TO NR OF SEGS IN PUBLIB          
PLPLWO   EQU      6                 WORD INDEX TO PUBLIB ORIGIN                 
PLPLML   EQU      5                 WORD INDEX TO PUBLIB BL                     
PLCXWO   EQU      9                 WORD INDEX TO CONTEXT ORIGIN                
PLCXML   EQU      8                 WORD INDEX TO CONTEXT BL                    
*                        *CONTROL BYTE MASKS AND VALUES                         
TY       EQU      X'C0'             SYMBOL TYPE (DEF,DSECT,PREF,SREF)           
DEF      EQU      0                     EXTERNAL DEFINITION                     
DSECT    EQU      X'40'                 DUMMY SECTION                           
SREF     EQU      X'80'                 SECONDARY REFERENCE                     
PREF     EQU      X'C0'                 PRIMARY REFERENCE                       
D        EQU      X'20'            *SYMBOL HAS/HASNOT BEEN DEFINED,             
*                                   ALLOCATED, OR SATISFIED FLAG MASK           
DEFINED  EQU      X'20'                 DEFINED DEF                             
UNDEFINE EQU      0                     DEF UNDEFINED                           
SATISFYD EQU      X'20'                 SATISFIED REF                           
UNSAT    EQU      0                     REF UNSATISFIED                         
ALLOCATD EQU      X'20'                 ALLOCATED DSECT                         
UNALLOCT EQU      0                     DSECT NOT ALLOCATED                     
V        EQU      X'10'            *SYMBOL HAS BEEN DEFINED/ALLOCATED/          
*                                   SATISFIED WITH EITHER A VALUE               
*                                   OR AN EXPRESSION FLAG MASK                  
VALUE    EQU      X'10'                 VALUE                                   
EXP      EQU      0                     EXPRESSION                              
C        EQU      X'08'            *SYMBOL VALUE IS EITHER A CONSTANT OR        
*                                   AN ADDRESS FLAG MASK                        
CONSTANT EQU      X'08'                *SYMBOL VALUE IS A CONSTANT              
*                                       WITH NO RESOLUTION                      
ADDRESS  EQU      0                    *SYMBOL VALUE IS AN ADDRESS              
*                                       WITH BYTE RESOLUTION                    
F        EQU      X'04'            *SYMBOL IS/ISNOT A DUPLICATE FLAG            
*                                   MASK                                        
DUPLICAT EQU      X'04'                 DUPLICATE SYMBOL                        
NOTDUP   EQU      0                     NOT DUPLICATE SYMBOL                    
*                                                                               
LB       EQU      X'03'             SYMBOL FROM ROM OR LIBRARY                  
ROM      EQU      0                     SYMBOL FROM ROM                         
USER     EQU      X'02'                 SYMBOL FROM USER LIBRARY                
SYSTEM   EQU      X'01'                 SYMBOL FROM SYSTEM LIBRARY              
PUBLIC   EQU      X'03'                 PUBLIC LIBRARY SYMBOL                   
*                                                                               
RES      EQU      DSECT+ALLOCATD+; *RES SYMBOL CONTROL BYTE                     
                  EXP+NOTDUP+ROM    (TO BE ALLOCATED AT SEGMENT END)            
EXCLPREF EQU      PREF+UNSAT+VALUE; EXCLUDED PREF SYMBOL CONTROL BYTE           
                  +NOTDUP+ROM                                                   
ADSECT   EQU      DSECT+ALLOCATD+VALUE+ADDRESS+NOTDUP+ROM                       
*                 ALLOCATED DSECT TYPE CODE FOR T:VALUE                         
UADSECT  EQU      DSECT+UNALLOCT+VALUE+ADDRESS+NOTDUP+ROM                       
*                 UNALLOCATED DSECT TYPE CODE FOR T:VALUE                       
*                        *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:OPLBS3 EQU      X'179'            POINTER TO OPLB'S CURRENT ASSIGNMENT        
K:RFT4   EQU      X'17A'            RAD FILE TABLE GRANULE SIZE POINTER         
*                        *FLAG VALUES FOR FL:NXTCC                              
NOOLOAD  EQU      X'30000000'                                                   
NOPUB    EQU      X'0C000000'                                                   
NOROOT   EQU      X'03000000'                                                   
NOSEG    EQU      X'00C00000'                                                   
NOCOM    EQU      X'00300000'                                                   
NOLCOM   EQU      X'000C0000'                                                   
NOINC    EQU      X'00030000'                                                   
NOEXC    EQU      X'0000C000'                                                   
NORES    EQU      X'00003000'                                                   
NOLIB    EQU      X'00000C00'                                                   
NOMOD    EQU      X'00000300'                                                   
NOASS    EQU      X'000000C0'                                                   
NOBIN    EQU      X'00000030'                                                   
NOEOF    EQU      X'00000003'                                                   
MODEND   EQU      X'00000100'                                                   
ASSEND   EQU      X'00000040'                                                   
BINEND   EQU      X'00000010'                                                   
EOFEND   EQU      X'00000001'                                                   
SEGEND   EQU      X'00400000'                                                   
*                        *OPLBS                                                 
OPLB:C   EQU      1                                                             
OPLB:OC  EQU      2                                                             
OPLB:LO  EQU      3                                                             
OPLB:LL  EQU      4                                                             
*                        *OVERLAY LOADER SEGMENT IDENTS                         
SEG:CCI  EQU      1                 CONTROL COMMAND INTERPRETER                 
SEG:PAS1 EQU      2                 PASS ONE                                    
SEG:PAS2 EQU      3                 PASS TWO                                    
SEG:MAP  EQU      4                 MAP                                         
SEG:DIAG EQU      5                 DIAGNOSTICS                                 
SEG:LIB  EQU      6                 LIBRARY SEARCH                              
CC1      EQU      8                 CONDITION CODE 1                            
CC2      EQU      4                 CONDITION CODE 2                            
CC3      EQU      2                 CONDITION CODE 3                            
CC4      EQU      1                 CONDITION CODE 4                            
RIGHT    EQU      -1                RIGHT SHIFT SIGN FACTOR                     
LEFT     EQU      1                 LEFT SHIFT SIGN  FACTOR                     
ROOT1ID  EQU      X'9000'           ROOT1 SEG ID NR                             
*                        *ALARMS                                                
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               
BADDIRE  EQU      43                PROGRAM ERROR,OLAY,SB=XX,ADDR XXXXX         
UNKNOWN  EQU      43                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          
MAXLROM  EQU      75          LIB ROM'S EXCEED MAX                              
DEFALTST EQU      76          DEFAULT START ADDR XXXXX SUPPLIED FOR ROOT        
DCBCHGED EQU      77          PROGRAM ERROR: OLAY,SB=59,ADDR XXXXX              
SHAREDIN EQU      78          PROGRAM ERROR: OLAY,SB=60,ADDR XXXXX              
ILLMCC   EQU      79          MONITOR CC ENCOUNTERED INSTEAD OF :ROOT...        
NOATTEND EQU      80          CC ERR: STEP OPTION ILLEGAL WITHOUT ATTEND        
DCBSMALL EQU      89                WARNING:  DCB XXXXXXXX TOO SMALL ...        
PUBMEMER EQU      90                MEM CONFLICT INVOLVING PUBLIBS              
         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                              
*                                   *10 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                            
         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                          
*                                                                               
ADDNXT   COM,8,4,3,17     BAL,14,0,ADDNXT                                       
ADDX     COM,8,4,3,17     BAL,14,0,ADDX                                         
ALLOCOMN COM,8,4,3,17     BAL,14,0,ALLOCOMN                                     
BLDCSECT COM,8,4,3,17    BAL,13,0,BLDCSECT                                      
BLNKSUPR COM,8,4,3,17  BAL,13,0,BLNKSUPR                                        
BOUNDCS  COM,8,4,3,17    BAL,15,0,BOUNDCS                                       
BOUNDRDW COM,8,4,3,17     BAL,15,0,BOUNDRDW                                     
         DO       #MAP~=0                                                       
BOUNDRP  COM,8,4,3,17  X'6A',15,0,BOUNDRP                                       
         FIN      #MAP                                                          
CHGRR    COM,8,4,3,17     BAL,15,0,CHGRR                                        
CHKBLANK COM,8,4,3,17  BAL,15,0,CHKBLANK                                        
COMPBS   COM,8,4,3,17     BAL,15,0,COMPBS                                       
COMPSIZE COM,8,4,3,17    BAL,14,0,COMPSIZE                                      
CONVROMX COM,8,4,3,17     BAL,13,0,CONVROMX                                     
DCBTYPE  COM,8,4,3,17     BAL,15,0,DCBTYPE                                      
DECHEX   COM,8,4,3,17  BAL,13,0,DECHEX                                          
DWBOUND  COM,8,4,3,17     BAL,15,0,DWBOUND                                      
EXTEND   COM,8,4,3,17     BAL,15,0,EXTEND                                       
GETDECL  COM,8,4,3,17     BAL,14,0,GETDECL                                      
HEADER   COM,8,4,3,17  BAL,15,0,HEADER                                          
HEXTOEBD COM,8,4,3,17  BAL,13,0,HEXTOEBD                                        
INBYTS   COM,8,4,3,17  BAL,14,0,INBYTS                                          
INCLFWDX COM,8,4,3,17     BAL,13,0,INCLFWDX                                     
LBOPTION COM,8,4,3,17     BAL,13,0,LBOPTION                                     
LOADERR  COM,8,4,3,17     BAL,15,0,LOADERR                                      
LOADSEG  COM,8,4,3,17  BAL,15,0,LOADSEG                                         
MAPSYM   COM,8,4,3,17  BAL,12,0,MAPSYM                                          
MOVBYTS  COM,8,4,3,17  BAL,15,0,MOVBYTS                                         
MOVEMT   COM,8,4,3,17     BAL,14,0,MOVEMT                                       
NXTSEG   COM,8,4,3,17     BAL,13,0,NXTSEG                                       
PATHEND  COM,8,4,3,17     BAL,12,0,PATHEND                                      
PREPFLD  COM,8,4,3,17  BAL,15,0,PREPFLD                                         
PRINTLO  COM,8,4,3,17  BAL,14,0,PRINTLO                                         
PRINTSYM COM,8,4,3,17  BAL,15,0,PRINTSYM                                        
PUBMEM   COM,8,4,3,17 BAL,10,0,PUBMEM                                           
RABORT   COM,8,4,3,17    BAL,14,0,RABORT                                        
RAX      COM,8,4,3,17     BAL,12,0,RAX                                          
RDCC     COM,8,4,3,17    BAL,14,0,RDCC                                          
RDIAG    COM,8,4,3,17  BAL,15,0,RDIAG                                           
READXN   COM,8,4,3,17     BAL,15,0,READXN                                       
RESETMTA COM,8,4,3,17     BAL,14,0,RESETMTA                                     
ROMBYTE  COM,8,4,3,17     BAL,15,0,ROMBYTE                                      
ROMBYTES COM,8,4,3,17     BAL,14,0,ROMBYTES                                     
ROMERR   COM,8,4,3,17     BAL,15,0,ROMERR                                       
SATREF   COM,8,4,3,17     BAL,13,0,SATREF                                       
SCAN     COM,8,4,3,17     BAL,15,0,SCAN                                         
SCAN1ST  COM,8,4,3,17    BAL,14,0,SCAN1ST                                       
SCANDE   COM,8,4,3,17    BAL,14,0,SCANDE                                        
SCANDEC  COM,8,4,3,17    BAL,14,0,SCANDEC                                       
SCANEBC  COM,8,4,3,17    BAL,14,0,SCANEBC                                       
SCANFILE COM,8,4,3,17     BAL,13,0,SCANFILE                                     
SCANHE   COM,8,4,3,17    BAL,14,0,SCANHE                                        
SCANHEX  COM,8,4,3,17    BAL,14,0,SCANHEX                                       
SCANSYM  COM,8,4,3,17     BAL,13,0,SCANSYM                                      
SERCHDCB COM,8,4,3,17     BAL,14,0,SERCHDCB                                     
SERCHFWD COM,8,4,3,17     BAL,14,0,SERCHFWD                                     
SERCHPUB COM,8,4,3,17     BAL,14,0,SERCHPUB                                     
SERCHSEG COM,8,4,3,17     BAL,15,0,SERCHSEG                                     
SERCHSYM COM,8,4,3,17     BAL,14,0,SERCHSYM                                     
SERCHVAL COM,8,4,3,17     BAL,15,0,SERCHVAL                                     
SERCHX   COM,8,4,3,17     BAL,14,0,SERCHX                                       
SIZECS   COM,8,4,3,17     BAL,14,0,SIZECS                                       
SKIPX    COM,8,4,3,17     BAL,13,0,SKIPX                                        
SOLVEX   COM,8,4,3,17     BAL,13,0,SOLVEX                                       
STORCBV  COM,8,4,3,17     BAL,14,0,STORCBV                                      
SYMFBA   COM,8,4,3,17     BAL,15,0,SYMFBA                                       
TBENTRY  COM,8,4,3,17     BAL,15,0,TBENTRY                                      
WORD     COM,8,4,3,17     BAL,15,0,WORD                                         
WRITEMT  COM,8,4,3,17     BAL,14,0,WRITEMT                                      
WRITEXN  COM,8,4,3,17     BAL,15,0,WRITEXN                                      
XBC      COM,8,4,3,17    BAL,15,0,XBC                                           
ZERONXT  COM,8,4,3,17     BAL,14,0,ZERONXT                                      
ZEROX    COM,8,4,3,17     BAL,14,0,ZEROX                                        
4BYTES   COM,8,4,3,17     BAL,15,0,4BYTES                                       
RAREABC  COM,8,4,3,17    BAL,15,0,RAREABC                                       
MOVEDW   COM,8,4,3,17    BAL,14,0,MOVEDW                                        
SETBL    COM,8,4,3,17    BAL,15,0,SETBL                                         
RESETBL  COM,8,4,3,17    BAL,15,0,RESETBL                                       
         TITLE     '      **** PROCEDURES ****'                                 
*                                                                               
*        ****************************                                           
*        *                          *                                           
*        *                          *                                           
*        *  PUSH,PULL PROCEDURES    *                                           
*        *                          *                                           
*        *                          *                                           
*        ****************************                                           
*                                                                               
*                 FORMAT            PUSH    R1(,R2)                             
*                                   PULL    R1(,R2)                             
*                 USES TEMP STACK DEFINED IN WDS 0-1 OF PCB.                    
PUSH     CNAME    1                                                             
PULL     CNAME    0                                                             
         PROC                                                                   
         DO       (AF(2)=0)|(AF(2)=AF(1))                                       
LF       GEN,8,4,3,17  X'88'+NAME,AF(1),0,PCBPOINT  SINGLE REG IN AF(1)         
         ELSE                                                                   
         DO       AF(2)>AF(1)       E.G.  PUSH   9,11                           
LF       LCFI     (AF(2)-AF(1)+1)&X'F'                                          
         ELSE                       E.G.  PUSH   11,7 (1E 11-16,0-7)            
LF       LCFI     (16-AF(1)+AF(2)+1)&X'F'                                       
         FIN                                                                    
         GEN,8,4,3,17  X'8A'+NAME,AF(1),0,PCBPOINT                              
         FIN                                                                    
         PEND                                                                   
         TITLE    '  **** PCB AND TEMP STACK ****'                              
OLOADPCB DATA     TSTACK-1                                                      
         DATA,2   TSTACK%-TSTACK,0                                              
         DATA     0                 OVLOAD                                      
         DATA     0                 INTTAB                                      
         DATA     0                 TRAPADD                                     
         DATA     0                 MSLADD                                      
         DATA     0                                                             
         DATA     0                                                             
         DATA     0                                                             
         DATA     0                                                             
         DATA     0                 DCBTAB                                      
         DATA     0                                                             
         DATA     0                 SSW                                         
TSTACK   RES      125              *TEMP STACK                                  
TSTACK%  EQU      %                                                             
         TITLE    '       **** FLAGS ****'                                      
*                                                                               
         BOUND    4                                                             
FL:GO    DATA     1      0=LOAD ROMS FROM DEVICES/FILES SPECIFIED ON            
*                          :ROOT,:SEG, AND :PUBLIB CONTROL COMMANDS             
*                        1=LOAD ROM'S FROM 'GO' UNTIL 'EOD' AND CREATE          
*                          PROGRAM WITH ONLY A ROOT                             
*                       -1=LOAD ROM'S FROM 'GO' UNTIL 'EOD' AND CREATE          
*                          A SIMPLE OVERLAY PROGRAM WHERE EACH SEGMENT          
*                          EQUALS ONE ROM                                       
*                                                                               
FL:PUBL  DATA     0      1=PUBLIC LIBRARY IS BEING CREATED                      
*                        0=FOREGROUND OR BACKGROUND PROGRAM IS                  
*                          BEING CREATED                                        
*                                                                               
FL:LIB   DATA,1   0,0,SP+1,0   BYTES 0,1=LIBRARY SEARCH ORDER FOR SEG           
*                              BYTES 2,3=DEFAULT LIBRARY SEARCH ORDER           
*                                        FOR PROGRAM,IF NONE SPECIFIED          
*                                        FOR SEGMENT                            
*                              BYTE N=SP+1,SEARCH SYSTEM LIBRARY                
*                                    =FP+1,SEARCH USER LIBRARY                  
*                                    =0,DONT SEARCH LIBRARY                     
*                                                                               
FL:BACK  DATA     1      1=BACKGROUND PROGRAM                                   
*                        0=FOREGROUND PROGRAM (INCLUDING PUBLIB)                
*                                                                               
FL:TASKS DATA     0      N=NUMBER OF TASKS IN PROGRAM                           
*                                                                               
FL:STM   DATA     0                 :LMHDR OPTION 'STM'                         
*                                   (RESTRICT TO SECONDARY TASK MEM)            
*                                   =0 IF NO RESTRICTION                        
*                                   =1 IF RESTRICTION                           
FL:SMM   DATA     0                 :LMHDR OPTION 'SMM'                         
*                                   (SIMPLIFIED MEMORY MANAGEMENT)              
*                                   =0 IF NOT REQUIRED                          
*                                   =1 IF REQUIRED                              
FL:PRIM  DATA     1           OLOAD PRI/SEC                                     
*                                   =01 FOR SEC                                 
*                                   =10 FOR PRI                                 
*                                   =11 FOR BOTH (PUBLIBS ONLY)                 
FL:CRIT  DATA     0                 :LMHDR OPTION 'CRIT'                        
*                                   (TASK CRITICAL TO JOB)                      
*                                   =0 IF NOT CRITICAL                          
*                                   =1 IF CRITICAL                              
FL:RTMP  DATA     RTMPSIZE          WORD LENGTH OF RBM TEMP STACK               
*                                                                               
FL:LWA   DATA     0                 'PROG LWA SPECIFIED' FLAG:                  
*                                   =0 IF LWA NOT SPECIFIED,                    
*                                   =1 IF SPECIFIED                             
*                                                                               
FL:SORT  DATA     -1                'SORT THE MAP' FLAG:                        
*                                   =-1 FOR NO SORT                             
*                                   =0 FOR SORT BY NAME                         
*                                   =1 FOR SORT BY VALUE                        
FL:TEMP  DATA     TEMPSIZE    TEMP STACK SIZE (IN WORDS)                        
*                                                                               
FL:MAP   DATA     -1     0=SHORT MAP                                            
*                        1=PROGRAM MAP                                          
*                        2=MAP ALL                                              
*                       -1=NO MAP                                               
*                                                                               
FL:BOUND DATA     2*4-1  N=BOUND MASK FOR ROM LOAD ORIGINS (BYTE ADDR)          
*                          (N=BOUND*4-1); DEFAULT IS DOUBLEWORD BOUND           
*                          NOTE: BOUND MUST BE A POWER OF TWO                   
*                                                                               
FL:UDCB  DATA     0      N=NUMBER OF UNNAMED DCB'S TO BE ALLOCATED              
*                          BY THE LOADER                                        
*                                                                               
FL:STEP  DATA     0      1=ENTER WAIT AFTER EACH ROM INPUT ON PAPERTAPE         
*                          READER                                               
*                        0=DONT WAIT                                            
*                                                                               
FL:COMN  DATA     -1     0=ALLOCATE COMMON AT THE END OF THE ROOT               
*                        N=ALLOCATE COMMON AT THE END OF SEGMENT N              
*                       -1=ALLOCATE COMMON AT THE END OF THE LONGEST            
*                          PATH                                                 
*                                                                               
FL:NXTCC DATA     NOPUB+NOROOT+NOSEG+NOCOM+NOLCOM+NOINC+NOEXC+;                 
                  NORES+NOLIB+NOMOD+NOASS+NOBIN+NOEOF                           
*                                  *SET OF 2-BIT FLAGS USED TO CHECK THE        
*                                   SEQUENCE OF THE NEXT CONTROL COMMAND        
*                                       FLAG=00,LEGAL SEQUENCE                  
*                                           =01,END OF A SUBSTACK               
*                                           =11,ILLEGAL SEQUENCE                
*                                       ORDER OF FLAGS (FROM BIT 0)             
*                                           NOCC,OLOAD,PUBLIB,ROOT,SEG,         
*                                           COMMON,LCOM,INCLUDE,EXCLUDE,        
*                                           RES,LIB,MODIFY,ASSIGN,UNUSED,       
*                                           (OR-WITH-LAST-FLAG),EOF             
*                                                                               
FL:LBLD  DATA     0      SP+1=SYSTEM LIBRARY ROM                                
*                        FP+1=USER  LIBRARY ROM                                 
*                           0=NOT LIBRARY ROM                                   
*                                                                               
*                                                                               
FL:LBPAS DATA     0      0=NO LIB HAS BEEN SEARCHED                             
*                        1=FIRST LIB HAS BEEN SEARCHED                          
*                        2=SECOND LIB HAS BEEN SEARCHED                         
*                                                                               
FL:MODF  DATA     0      1=CCI HAS BEEN CALLED TO PROCESS :MODIFY CC            
*                        0=CCI HAS BEEN CALLED TO PROCESS :SEG CC               
*                                                                               
FL:RTYPE DATA     -1     0=ROM RECORD TYPE IS 'LAST'                            
*                        1=ROM RECORD TYPE IS 'NOT LAST'                        
*                       -1=ROM RECORD NOT IN B:ROM                              
*                                                                               
FL:ERROR DATA     0      N=ERROR IN LOADING ROM,FILE OVERFLOW,ETC.              
*                        0=NO ERRORS                                            
*                                                                               
*                                                                               
FL:OFLOW DATA     0      1=FILE OVERFLOWED ON X1,X2,X3,X4,X5,X6,OR M:OV         
*                        0=NO FILE OVERFLOW                                     
*                                                                               
FL:OUTOV DATA     0                 0=DATA HAS NOT BEEN OUTPUT ON 'OV'          
*                                   1=DATA HAS BEEN OUTPUT ON 'OV'              
FL:UNNAM DATA     0      1=UNNAMED DCB USED DURING PROCESSING OF THIS           
*                          ASSIGN CC                                            
*                        0=UNNAMED DCB NOT USED                                 
*                                                                               
FL:PAS2  DATA     0      1=PASSTWO IS BEING CALLED TO PROCESS :ASSIGN           
*                          CONTROL COMMANDS                                     
*                        0=PASSTWO IS BEING CALLED TO PROCESS ROM'S             
*                                                                               
         TITLE       '    **** ADDRESSES ****'                                  
NBA:SECT DATA     0     *NEXT BYTE ADDR OF PROGRAM SECTION; SET TO              
*                        FBA OF SEGMENT BY 'CCI' AND BUMPED BY                  
*                        'PASSONE' WHENEVER DSECT(EXCEPT COMMON),               
*                        NON-STANDARD CSECT, OR STANDARD CSECT ALLOCATED        
*                                                                               
LBA:PATH DATA     0     *LAST BYTE ADDR OF THE LONGEST PATH IN THE              
*                        OVERLAY PROGRAM (SET BY PASSONE)                       
*                                                                               
         BOUND    8                                                             
FBA:LIM  DATA     -1                FBA OF PROGRAM AREA(-1 FOR DEFAULT)         
*                            (ON A DOUBLEWORD BOUNDARY)                         
LBA:LIM  DATA     -1                LBA   OF PROGRAM AREA (-1 FOR DEFAULT)      
*                                                                               
FBA:COMN DATA     0      FBA OF COMMON,IF ALLOCATED BY PASSONE;OR ZERO          
*                                                                               
LBA:COMN DATA     0      LBA+1 OF COMMON OR ZERO                                
*                                                                               
FBA:TABS DATA     0      FBA OF DYNAMIC TABLE AREAS (ON A DW BOUND)             
*                                                                               
BAP:ROM  DATA     0      BA OF ROM BYTE IN B:ROM                                
*                                                                               
LBA:ROM  DATA     0      LBA+1 OF ROM RECORD IN B:ROM                           
*                                                                               
FBA:INTT DATA     0      FBA OF INTTAB                                          
*                                                                               
LBA:ROO1 DATA     0                 LAST BYTE+1 OF ROOT1 BEFORE                 
*                                   PAGE-BOUNDING OPERATION                     
*                                                                               
         BOUND    8                                                             
FBA:ROO2 DATA     0      FBA OF 2ND PART OF ROOT                                
*                                                                               
LBA:ROO2 DATA     0      LBA+1 OF 2ND PART OF ROOT                              
*                                                                               
BL:ROO2  DATA     0      TOTAL NO. OF BYTES IN 2ND PART OF THE ROOT             
*                                                                               
BAP:ROO2 DATA     0      BYTE ADDR POINTER FOR 2ND PART OF ROOT                 
*                                                                               
FBA:OVLO DATA     0      FBA OF OVLOAD TABLE                                    
*                                                                               
LBA:OVLO DATA     0      LBA+1 OF OVLOAD TABLE                                  
*                                                                               
FBA:DCBT DATA     0      FBA OF DCBTAB                                          
*                                                                               
LBA:DCBT DATA     0      LBA+1 OF DCBTAB                                        
*                                                                               
FBA:TEMP DATA     0      FBA OF TEMP STACK                                      
*                                                                               
FBA:RTMP DATA     0                 FBA OF RBM TEMP STACK                       
*                                                                               
*                                                                               
P:GRAN   DATA     0     *POINTER TO CURRENT GRANULE DISPLACEMENT IN             
*                        PROGRAM FILE; AT END OF PASS2, EQUALS PROGRAM          
*                        FILE GRANULE LENGTH                                    
FWA:ASSN DATA     0                 FWA OF ASSIGN TABLE (T:ASSN)                
*                                   SET BY PASS 2, USED BY CCI                  
LWA:ASSN DATA     0                                                             
*                                                                               
WDP:ASSN DATA     0                 DISPLACEMENT OF CURRENT ASSN ENTRY          
GRN:ROO2 DATA     0                 FIRST GRAN ROOT2                            
*                                   WHEN EXLOCED BEHIND ROOT1                   
EBL:ROO2 DATA     0                 ESTIMATED BYTE LENGTH : ROOT2               
LML:ROO2 DATA     256               LOAD MODULE LENGTH:ROOT2 (DEF=256)          
*                                   USED WHEN EXLOCED COMBINED                  
FLG:ROO2 DATA     0                 FLAG: ROOT2 POSITION                        
*                                   =-1, (EXLOC,R1END) POSITION                 
*+                                                                              
         TITLE    '       **** VARIABLES ****'                                  
V:MSECB  DATA     X'FF'             MAX SOLICITED ECBS ALLOWED                  
V:MRECB  DATA     X'FF'             MAX RESPONSIBLE ECBS ALLOWED                
V:MENQ   DATA     X'FF'             MAX ENQUEUES ALLOWED                        
V:NUSG   DATA     0                 NR OF USER SEGMENTS (INCLUDES ROOT2         
*                                   BUT NOT PUBLIBS)                            
V:NPLSG  DATA     0                 NR OF SEGMENTS IN PUBLIBS REQUESTED         
V:CCTYPE DATA     :OLOAD            IDENTIFIES THE TYPE OF CC IN B:C            
*                                       0=NONE         7=:INCLUDE               
*                                       1=:OLOAD       8=:EXCLUDE               
*                                       2=:PUBLIB      9=:RES                   
*                                       3=:ROOT       10=:LIB                   
*                                       4=:SEG        11=:MODIFY                
*                                       5=:COMMON     12=:ASSIGN                
*                                       6=:LCOMMON    -1='EOF'                  
*                                                                               
V:SEGID  DATA     0                 IDENT OF THE CURRENT SEGMENT                
*                                                                               
V:LINKID DATA     0                 IDENT OF THE CURRENT SEGMENT'S LINK         
*                                                                               
V:CCDCB  DATA     WA(M:C)          *WA OF THE DCB TO BE USED TO READ            
*                                   THE NEXT CC AFTER A CONTROL COMMAND         
*                                   DIAGNOSTIC                                  
*                                                                               
V:ROMRNO DATA     0                 ROM RECORD SEQUENCE NUMBER                  
*                                       (IN BYTE ZERO)                          
*                                                                               
V:DECLNO DATA     0                *COUNT OF THE NO. OF ROM DECLARATIONS        
*                                   ENCOUNTERED (NOT COUNTING DECL.0)           
*                                                                               
V:COLAY  DATA     0                *IDENTIFIES THE OVERLAY SEGMENT              
*                                   CURRENTLY IN CORE                           
*                                                                               
V:TOTSIZ DATA     0                 TOTAL SIZE OF PROGRAM LOADED                
*                                                                               
V:LIBSIZ DATA     0                 SIZE OF TOTAL LIBRARY LOADED                
*                                                                               
V:MASK   DATA     -1                VARIABLE MASK FOR STORAGE IN PASSTWO        
*                                                                               
V:MODLOC DATA     0                *NUMBER OF LOCATIONS LEFT IN THE             
*                                   SEGMENT THAT CAN BE MODIFIED                
V:MODBD  DATA     0                 BD IN SEGMENT OF FIRST BYTE PAST            
*                                   RANGE OF A MODIFY COMMAND                   
V:REL    DATA     0                 LOCATION TO SAVE RELOCATION                 
*                                   BIAS FOR 'EXLOC,REL...' OPTION              
*                                                                               
         TITLE    '       **** HEX CONSTANTS ****'                              
X:0      DATA     0                                                             
X:3      DATA     3                                                             
X:7      DATA     7                                                             
X:C      DATA     X'C'                                                          
X:F      DATA     X'F'                                                          
X:7F     DATA     X'7F'                                                         
X:FF     DATA     X'FF'                                                         
X:1FF    DATA     X'1FF'                                                        
X:7FF    DATA     X'7FF'                                                        
X:FFF    DATA     X'FFF'                                                        
X:3FFF   DATA     X'3FFF'                                                       
X:FFFF   DATA     X'FFFF'                                                       
X:1FFFF  DATA     X'1FFFF'                                                      
X:7FFFF  DATA     X'7FFFF'                                                      
X:TY     DATA     TY                                                            
X:TYDV   DATA     TY+D+V                                                        
X:TYFLB  DATA     TY+F+LB                                                       
X:DVC    DATA     D+V+C                                                         
X:LB     DATA     LB                                                            
Y:DV     GEN,8,24 D+V,0                                                         
X:DUP    DATA     DUPLICAT                                                      
Y:01     DATA     X'01000000'                                                   
Y:002    DATA     X'00200000'                                                   
Y:2      DATA     X'20000000'                                                   
Y:4      DATA     X'40000000'                                                   
Y:8      DATA     X'80000000'                                                   
Y:42     DATA     X'42000000'                                                   
Y:FF     DATA     X'FF000000'                                                   
Y:FFF8   DATA     X'FFF80000'                              /SIG7-3806/C015732   
Y:FFFE   DATA     X'FFFE0000'                                                   
E:BLANKS DATA     X'40404040'                                                   
E:OLOAD  TEXTC    '!!OLOAD'                                                     
GIOOBIT  EQU      Y:4                                                           
GIODBIT  EQU      Y:2                                                           
GIOFBIT  DATA     X'10000000'                                                   
GIOABIT  DATA     X'00040000'                                                   
GIOFA    DATA     X'10040000'                                                   
GIOBITS  DATA     X'70040000'                                                   
         TITLE    '       **** PARAMETER TABLES ****'                           
         BOUND    4                                                             
FPT:ROM1 DATA     0                *ROMBYTE FPT TO READ ROM FROM                
         DATA     ERA+ABA+;         SPECIFIED DCB IN T:MODULE INTO B:ROM        
                  REALTIME+WAIT                                                 
         DATA     ERRIO                                                         
         DATA     ABNIO                                                         
         DATA     0                     (COMPLETION CODE)                       
         BOUND    4                                                             
PT:ROM2  DATA     1                *ROMBYTE PT FOR ABNIO                        
         DATA     0                 (IF 'EOD' ENCOUNTERED INSTEAD OF            
*                                   NEXT ROM,RETURN TO SPECIFIED ADDR)          
*                                                                               
         BOUND    4                                                             
FPT:ROM3 DATA,1   WRITE            *ROMBYTE FPT TO WRITE ROM'S INPUT VIA        
         DATA,3   M:X1              F:DEVICE ON X1                              
         DATA     ERA+ABA+REALTIME+WAIT                                         
         DATA     ERRIO                                                         
         DATA     ABNIO                                                         
         DATA     0                     (COMPLETION CODE)                       
*                                                                               
         BOUND    4                                                             
PT:ROM4  DATA     1                *ROMBYTE PT FOR ABNIO                        
         DATA,1   EOT               (RETURN TO 'ROM70' AFTER OUTPUTTING         
         DATA,3   X'20000'+ROM70     ALARM IF 'EOT' ENCOUNTERED ON X1)          
*                                                                               
         BOUND    4                                                             
FPT:ROM6 GEN,8,24 REWIND,F:MODULE   *ROMBYTE FPT TO REWIND LIBRARY              
         DATA     0                 'MODULE' FILE                               
*                                                                               
         BOUND    4                                                             
FPT:ROM7 DATA,1   SKIPREC          *ROMBYTE FPT TO POSITION LIBRARY             
         DATA,3   F:MODULE          'MODULE' FILE AT RECORD 'N'                 
         DATA     RECORDNO+ABA                                                  
         DATA     0                     (RECORD NO.)                            
         DATA     ABNIO                                                         
*                                                                               
         BOUND    4                                                             
FPT:XN1  DATA     0                *READXN/WRITEXN FPT TO READ/WRITE            
         DATA     ERA+ABA+BUF+;     ON XN                                       
                  RSZ+BTD+KEY+;                                                 
                  REALTIME+WAIT                                                 
         DATA     ERRIO                                                         
         DATA     ABNIO                                                         
         DATA     0                     (BUFFER ADDR)                           
         DATA     0                     (BYTE COUNT)                            
         DATA     0                     (BYTE DISPLACEMENT IN BUFFER)           
         DATA     0                     (GRANULE NUMBER)                        
         DATA     0                     (COMPLETION CODE)                       
*                                                                               
         BOUND    4                                                             
PT:XN2   DATA     1                *READXN/WRITEXN PT FOR ABNIO                 
         DATA,1   EOT               (RETURN TO 'XN30' AFTER ALARM,IF            
         DATA,3   X'20000'+XN30      'EOT' ENCOUNTERED WHEN WRITING             
*                                     ON XN)                                    
         BOUND    4                                                             
FPT:XN3  DATA     0                *READXN/WRITEXN FPT TO OPEN/CLOSE            
         DATA     0                 M:XN DCB                                    
*                                                                               
         BOUND    4                                                             
FPT:ONE1 DATA     0                *PASSONE FPT TO CLOSE OPEN DCB IN            
         DATA     0                 T:DCBV AFTER ALL ROM'S INPUT FOR            
*                                   SEGMENT                                     
*                                                                               
         BOUND    4                                                             
FPT:ONE2 DATA,1   CLOSE            *PASSONE FPT TO CLOSE F:DEVICE DCB           
         DATA,3   F:DEVICE          BEFORE CHANGING DEVICE TYPE                 
         DATA     0                                                             
*                                                                               
         BOUND    4                                                             
FPT:ONE3 DATA,1   CLOSE            *FPT TO CLOSE M:X1 AT THE END OF             
         DATA,3   M:X1              PASSONE (IF M:X1 HAS BEEN OPENED)           
         DATA     0                                                             
*                                                                               
         BOUND    4                                                             
FPT:ONE4 DATA,1   CLOSE            *FPT TO CLOSE M:GO AT THE END OF             
         DATA,3   M:GO              PASSONE                                     
         DATA     0                                                             
*                                                                               
         BOUND    4                                                             
FPT:CCI6 DATA,1   OPEN             *FPT TO OPEN M:X2 TO GET RFT INDEX           
         DATA,3   M:X2              TO GET GRANULE SIZE                         
         DATA     0                                                             
         BOUND    4                                                             
FPT:CCI7 DATA,1   CLOSE            *FPT TO CLOSE M:X2                           
         DATA,3   M:X2                                                          
         DATA     0                                                             
         BOUND    4                                                             
FPT:TYP  DATA     0                *DCBTYPE FPT TO CLOSE DCB BEFORE             
         DATA     0                 CHANGING RAD AREA AND FILE NAME             
*                                                                               
         BOUND    4                                                             
FPT:CC1  DATA,1   OPEN             *CCI FPT TO OPEN NAMED PROGRAM               
         DATA,3   M:OV              OUTPUT FILE TO DETERMINE IF THE             
         DATA     0                 FILE EXISTS                                 
*                                                                               
         BOUND    4                                                             
FPT:CC2  DATA,1   CLOSE            *CCI FPT TO CLOSE NAMED PROGRAM              
         DATA,3   M:OV              OUTPUT FILE                                 
         DATA     0                                                             
*                                                                               
         BOUND    4                                                             
FPT:CC3  DATA,1   OPEN             *CCI FPT TO OPEN NAMED PUBLIB                
         DATA,3   F:PUBL            FILE TO DETERMINE IF THE FILE EXISTS        
         DATA     0                                                             
*                                                                               
         BOUND    4                                                             
FPT:CC4  DATA,1   OPEN             *CCI FPT TO OPEN NAMED ROM INPUT             
         DATA,3   CCDCBV            FILE TO DETERMINE IF THE FILE EXISTS        
         DATA     0                                                             
*                                                                               
         BOUND    4                                                             
FPT:CC5  DATA,1   CLOSE            *CCI FPT TO CLOSE NAMED ROM INPUT            
         DATA,3   CCDCBV            FILE                                        
         DATA     0                                                             
*                                                                               
         BOUND    4                                                             
PT:CC6   DATA     1                *CCI PT FOR ABNIO                            
         DATA,1   NOFILE            (RETURN TO 'OERFUND' IF PROGRAM OR          
         DATA,3   OERFUND           PUBLIB RAD FILE DOES NOT EXIST)             
*                                                                               
         BOUND    4                                                             
PT:CC7   DATA     1                *CCI PT FOR ABNIO                            
         DATA,1   NOFILE            (RETURN TO 'ERRFUND' IF INPUT RAD           
         DATA,3   ERRFUND            FILE DOES NOT EXIST)                       
*                                                                               
         BOUND    4                                                             
FPT:CC8  DATA,1   FILEMODE                                                      
         DATA,3   M:X1                                                          
         DATA     FPTRSZ+FPTORG                                                 
         DATA     120                                                           
         DATA     BLOCKED                                                       
*                                                                               
FPT:OPEN GEN,1,7,24  1,OPEN,R7                                                  
         DATA     X'C0000000'                                                   
         PZE      ERRIO                                                         
         PZE      ABNIO                                                         
*                                                                               
PT:OPEN  DATA     1                                                             
         GEN,8,7,17  X'2E',0,IGNORE                                             
*                                                                               
FPT:CLS  GEN,1,7,24  1,CLOSE,R7                                                 
         DATA     X'C0000000'                                                   
         PZE      ERRIO                                                         
         PZE      ABNIO                                                         
*                                                                               
PT:CLS   DATA     1                                                             
         GEN,8,7,17  X'0A',0,IGNORE                                             
*                                                                               
IGNORE   B        *R8                                                           
*                                                                               
FPT:COR  GEN,1,7,24  1,CORRES,R6                                                
         PZE      *R7                                                           
*                                                                               
FPT:PACK GEN,1,7,24  1,FILEMODE,R7                                              
         DATA     X'10'             BIN AND PACK                                
*                                                                               
FPT:ASN  GEN,1,7,1,23  1,ASN,1,R7                                               
         DATA     X'80000000'                                                   
         PZE      ERRIO                                                         
         PZE      GIOCT+1                                                       
         PZE      GIOCT+4                                                       
*                                                                               
FPT:GASN GEN,1,7,1,23  1,GASN,1,R7                                              
         DATA     X'F0150000'                                                   
         PZE      ERRIO                                                         
B:OPLBNM DATA     0                                                             
         PZE      B:DEVNM                                                       
         PZE      GIOCT+1                                                       
B:DEVX   DATA     0                                                             
         PZE      GIOCT+4                                                       
         PZE      B:DEVCON                                                      
*                                                                               
B:DEVNM  RES      2                                                             
B:DEVCON RES      3                                                             
*                                                                               
FPT:REW  GEN,1,7,24  1,REWIND,R7                                                
*                                                                               
         BOUND    4                                                             
FPT:WTG  DATA,1   WRITE             WRITE A GRANULE TO M:OV                     
         DATA,3   M:OV                                                          
         DATA     ERA+ABA+BUF+;                                                 
                  RSZ+BTD+KEY+;                                                 
                  REALTIME+WAIT                                                 
         DATA     ERRIO                                                         
         DATA     ABNIO                                                         
         DATA     0                 BUFFER ADDR                                 
         DATA     0                 BYTE CNT                                    
         DATA     0                 BYTE DISPLACEMENT IN BUFFER                 
         DATA     0                 GRANULE DISPLACEMENT                        
         DATA     0                 COMPLETION CODE                             
*                                                                               
         BOUND    4                                                             
FPT:RDG  DATA,1   READ              READ A GRANULE FROM M:OV                    
         DATA,3   M:OV                                                          
         DATA     ERA+ABA+BUF+;                                                 
                  RSZ+BTD+KEY+;                                                 
                  REALTIME+WAIT                                                 
         DATA     ERRIO                                                         
         DATA     ABNIO                                                         
         DATA     0                 BUFFER ADDR                                 
         DATA     0                 BYTE CNT                                    
         DATA     0                 BYTE DISPLACEMENT IN BUFFER                 
         DATA     0                 GRANULE DISPLACEMENT IN BUFFER              
         DATA     0                 COMPLETION CODE                             
*                                                                               
         BOUND    4                                                             
PT:WTGR  DATA     1                                                             
         DATA,1   EOT                                                           
         DATA,3   X'20000'+OVOFLOW                                              
         BOUND    4                                                             
PT:SCAN  DATA     B:C              *CCI PT FOR SCAN (WA OF CC BUFFER)           
         DATA     0                                 (FIELD TYPE)                
         DATA     0                                 (BEGIN/CONTINUE)            
         DATA     RDCONT                            (RD CONTINUED CC)           
*                                                                               
         BOUND    4                                                             
PT:RD1   DATA     1                *RDCC PT FOR ABNIO                           
         DATA,1   EOF               (RETURN TO 'CC95' IF 'EOF' ENCOUNTER        
         DATA,3   CC95               WHEN READING CONTROL COMMANDS,             
*                                    OTHER THAN CONTINUATION COMMANDS           
*                                                                               
         BOUND    4                                                             
FPT:RD2  DATA,1   READ             *RDCC FPT TO READ CC VIA M:C/M:OC            
         DATA,3   M:C               INTO B:C                                    
         DATA     ERA+ABA+BUF+RSZ;                                              
                  +REALTIME+WAIT                                                
         DATA     ERRIO                                                         
         DATA     ABNIO                                                         
         DATA     B:C                                                           
         DATA     120                                                           
         DATA     0                                                             
*                                                                               
         BOUND    4                                                             
FPT:RD3  DATA,1   WRITE            *RDCC FPT TO LOG CC IN B:C ONTO LL           
         DATA,3   M:LL              VIA M:LL                                    
         DATA     ERA+ABA+BUF+RSZ;                                              
                  +BTD+REALTIME+WAIT                                            
         DATA     ERRIO                                                         
         DATA     ABNIO                                                         
         DATA     B:C-1                 (WA OF BUFFER)                          
         DATA     81                    (BYTE COUNT)                            
         DATA     3                     (BYTE DISPLACEMENT IN BUFFER)           
         DATA     0                                                             
         BOUND    4                                                             
FPT:ABT  DATA,1   WRITE             *ZERO GRANULE 0 OF PROGRAM FILE             
         DATA,3   M:OV              *ON ABORT (RABORT)                          
         DATA     BUF+RSZ+KEY+REALTIME+WAIT                                     
         DATA     X:0               WORD OF ZEROS                               
         DATA     4                 4 BYTES                                     
         DATA     0                 GRANULE ZERO                                
         DATA     0                 COMPLETION CODE                             
FPT:PRLO DATA,1   WRITE                                                         
         DATA,3   M:LO                                                          
         DATA     ERA+ABA+BUF+RSZ+REALTIME+WAIT                                 
         DATA     ERRIO                                                         
         DATA     ABNIO                                                         
         DATA     0                 BUFFER LOC WILL BE INSERTED                 
         DATA     0                 BYTE LENGTH WILL BE INSERTED                
         DATA     0                 COMPLETION CODE                             
*                                                                               
FPT:LB1  GEN,8,24 OPEN,F:DEFREF    *LIB FPT TO OPEN F:DEFREF                    
         DATA     0                                                             
*                                                                               
FPT:LB2  GEN,8,24 CLOSE,F:DEFREF   *LIB FPT TO CLOSE F:DEFREF                   
         DATA     0                                                             
*                                                                               
FPT:LB3  GEN,8,24 OPEN,F:MODIR     *LIB FPT TO OPEN F:MODIR                     
         DATA     0                                                             
*                                                                               
FPT:LB4  GEN,8,24 CLOSE,F:MODIR    *LIB FPT TO CLOSE F:MODIR                    
         DATA     0                                                             
*                                                                               
FPT:LB5  GEN,8,24 OPEN,F:EBCDIC    *LIB FPT TO OPEN F:EBCDIC                    
         DATA     0                                                             
*                                                                               
FPT:LB6  GEN,8,24 CLOSE,F:EBCDIC   *LIB FPT TO CLOSE F:EBCDIC                   
         DATA     0                                                             
*                                                                               
FPT:LB7  GEN,8,24 READ,F:EBCDIC    *LIB FPT TO READ EBCDIC FILE                 
         DATA     ERA+ABA+BUF+RSZ+;                                             
                  REALTIME+WAIT                                                 
         DATA     ERRIO                                                         
         DATA     ABNIO                                                         
         GEN,1,31 1,FWA:BUF             BUFFER ADDR (INDIRECT)                  
         DATA     0                     BYTE COUNT                              
         DATA     0                     COMPLETION CODE                         
*                                                                               
FPT:LB8  GEN,8,24 READ,F:DEFREF    *LIB FPT TO READ DEFREF FILE                 
         DATA     ERA+ABA+BUF+RSZ+;                                             
                  REALTIME+WAIT                                                 
         DATA     ERRIO                                                         
         DATA     ABNIO                                                         
         GEN,1,31 1,FWA:BUF             BUFFER ADDR (INDIRECT)                  
         DATA     0                     BYTE COUNT                              
         DATA     0                     COMPLETION CODE                         
*                                                                               
FPT:LB9  GEN,8,24 READ,F:MODIR     *LIB FPT TO READ MODIR FILE                  
         DATA     ERA+ABA+BUF+RSZ+;                                             
                  REALTIME+WAIT                                                 
         DATA     ERRIO                                                         
         DATA     ABNIO                                                         
         GEN,1,31 1,FWA:BUF             BUFFER ADDR (INDIRECT)                  
         DATA     0                     BYTE COUNT                              
         DATA     0                     COMPLETION CODE                         
*                                                                               
FPT:LB10 GEN,8,24 FILEMODE,M:X6    *LIB FPT TO SET X6 RECORD SIZE               
         DATA     FPTRSZ            TO 4*8191 BYTES                             
         DATA     4*8191                                                        
*                                                                               
FPT:LB11 GEN,8,24 0,M:X6           *LIB FPT TO WRITE/READ PACKED TABLES         
         DATA     ERA+ABA+BUF+RSZ+; ON X6                                       
                  REALTIME+WAIT                                                 
         DATA     ERRIO                                                         
         DATA     ABNIO                                                         
         DATA     0                     BUFFER ADDR                             
         DATA     0                     BYTE COUNT                              
         DATA     0                     COMPLETION CODE                         
*                                                                               
PT:LB12  DATA     0                *LIB PT FOR ABNIO TO OUTPUT DIAG AND         
         DATA,1   EOT               RETURN TO 'WR40' IF EOT ENCOUNTERED         
         DATA,3   X'20000'+WR40     WHEN WRITING ON X6                          
*                                                                               
FPT:LB13 GEN,8,24 CLOSE,M:X6       *LIB FPT TO CLOSE M:X6                       
         DATA     0                                                             
FPT:DIAG DATA     0                *DIAG FPT TO WRITE DIAGNOSTICS ON            
         DATA     ERA+ABA+BUF+RSZ;  M:OC AND M:LL                               
                  +BTD+REALTIME+WAIT                                            
         DATA     ABNIO             (DIAG SHOULD NOT GO TO 'ERRIO')             
         DATA     ABNIO                                                         
         DATA     0                 (BUFFER ADDR)                               
         DATA     0                 (BYTE COUNT)                                
         DATA     0                 (BYTE DISPLACEMENT OF BUFFER)               
         DATA     0                 (COMPLETION CODE)                           
*                                                                               
PT:DIAG1 DATA     21               *DIAG PT FOR ABNIO                           
         GEN,8,24 X'01',PR90        (IGNORE ANY I/O ERRORS AND DONT             
         GEN,8,24 X'03',PR90         OUTPUT ANY ALARMS)                         
         GEN,8,24 X'05',PR90                                                    
         GEN,8,24 X'06',PR90                                                    
         GEN,8,24 X'07',PR90                                                    
         GEN,8,24 X'0A',PR90                                                    
         GEN,8,24 X'1C',PR90                                                    
         GEN,8,24 X'1D',PR90                                                    
         GEN,8,24 X'2E',PR90                                                    
         GEN,8,24 X'2F',PR90                                                    
         GEN,8,24 X'40',PR90                                                    
         GEN,8,24 X'41',PR90                                                    
         GEN,8,24 X'42',PR90                                                    
         GEN,8,24 X'44',PR90                                                    
         GEN,8,24 X'45',PR90                                                    
         GEN,8,24 X'46',PR90                                                    
         GEN,8,24 X'47',PR90                                                    
         GEN,8,24 X'48',PR90                                                    
         GEN,8,24 X'4A',PR90                                                    
         GEN,8,24 X'54',PR90                                                    
         GEN,8,24 X'58',PR90                                                    
         TITLE    '       **** TABLES ****'                                     
         BOUND    4                                                             
T:DCBF   RES      0                 TABLE OF FIXED DCB'S                        
*                 NOTE: DO NOT CHANGE ORDER                                     
*                                                                               
         BOUND    4                                                             
F:PUBL   GEN,8,20,4     DCBSIZE,0,RAD             *RAD DCB FOR NAMED            
         GEN,8,7,3,6,8  RETRY,IN,0,FP,0            PUBLIC LIBRARY(S) ON         
         GEN,32         0                          OLOAD CC                     
         GEN,15,17      0,ERRIO                                                 
         GEN,15,17      0,ABNIO                                                 
         TEXT     '        '                                                    
         DATA     0,0,0,0                                                       
         BOUND    4                                                             
F:DEVICE GEN,8,20,4     DCBSIZE,0,DEVICE          *DCB FOR ROM INPUT            
         GEN,8,7,1,1,15 RETRY,IN,0,DEVF,0          FROM NAMED DEVICES           
         GEN,15,17      0,B:ROM                    ON :ROOT,:SEG,AND            
         GEN,15,17      120,ERRIO                  :PUBLIB CC'S                 
         GEN,15,17      0,ABNIO                                                 
         DATA,8   0                                                             
         DATA     0,0,0,0                                                       
CCDCBV   EQU      F:DEVICE                                                      
         BOUND    4                                                             
M:GO     GEN,8,20,4     DCBSIZE,0,RAD             *DCB FOR ROM INPUT            
         GEN,8,7,3,6,8  RETRY,IN,0,BT,0            FROM GO FILE                 
         GEN,15,17      0,B:ROM                                                 
         GEN,15,17      120,ERRIO                                               
         GEN,15,17      0,ABNIO                                                 
         TEXT     'GO      '                                                    
         DATA     0,0,0,0                                                       
         BOUND    4                                                             
M:OV     GEN,8,20,4     DCBSIZE,0,RAD             *DCB FOR PROGRAM FILE         
         GEN,8,7,3,6,8  RETRY,INOUT,0,BT,0         (EITHER NAMED ON             
         GEN,32         0                          OLOAD CC OF 'OV'             
         GEN,15,17      0,ERRIO                    BY DEFAULT)                  
         GEN,15,17      0,ABNIO                                                 
         TEXT     'OV      '                                                    
         DATA     0,0,0,0                                                       
         BOUND    4                                                             
M:X1     GEN,8,20,4     DCBSIZE,0,RAD             *DCB FOR INTERMEDIATE         
         GEN,8,7,3,6,8  RETRY,INOUT,0,BT,0         ROM'S FILE                   
         GEN,15,17      0,B:ROM                                                 
         GEN,15,17      120,ERRIO                                               
         GEN,15,17      0,ABNIO                                                 
         TEXT     'X1      '                                                    
         DATA     0,0,0,0                                                       
         BOUND    4                                                             
M:X2     GEN,8,20,4     DCBSIZE,0,RAD             *DCB FOR MODULE               
         GEN,8,7,3,6,8  RETRY,INOUT,0,BT,0         TABLES FILE (T:DECL,         
         GEN,32         0                          T:CSECT,T:FWD,T:FWDX)        
         GEN,15,17      0,ERRIO                                                 
         GEN,15,17      0,ABNIO                                                 
         TEXT     'X2      '                                                    
         DATA     0,0,0,0                                                       
         BOUND    4                                                             
M:X3     GEN,8,20,4     DCBSIZE,0,RAD             *DCB FOR SEGMENT              
         GEN,8,7,3,6,8  RETRY,INOUT,0,BT,0         TABLES' FILE                 
         GEN,32         0                          (T:MODIFY,T:MODULE)          
         GEN,15,17      0,ERRIO                                                 
         GEN,15,17      0,ABNIO                                                 
         TEXT     'X3      '                                                    
         DATA     0,0,0,0                                                       
         BOUND    4                                                             
M:X4     GEN,8,20,4     DCBSIZE,0,RAD             *DCB FOR SEGMENTS'            
         GEN,8,7,3,6,8  RETRY,INOUT,0,BT,0         T:VALUE SUBTABLE             
         GEN,32         0                                                       
         GEN,15,17      0,ERRIO                                                 
         GEN,15,17      0,ABNIO                                                 
         TEXT     'X4      '                                                    
         DATA     0,0,0,0                                                       
         BOUND    4                                                             
M:X5     GEN,8,20,4     DCBSIZE,0,RAD             *DCB FOR SEGMENTS'            
         GEN,8,7,3,6,8  RETRY,INOUT,0,BT,0         T:SYMBOL SUBTABLE            
         GEN,32         0                                                       
         GEN,15,17      0,ERRIO                                                 
         GEN,15,17      0,ABNIO                                                 
         TEXT     'X5      '                                                    
         DATA     0,0,0,0                                                       
         BOUND    4                                                             
M:X6     GEN,8,20,4      DCBSIZE,0,RAD                *DCB FOR PACKED           
         GEN,8,7,3,6,8   RETRY,INOUT,0,BT,0            DYNAMIC TABLES'          
         GEN,32          0                             TEMPORARY STORAGE        
         GEN,15,17       0,ERRIO                       FILE DURING LIB          
         GEN,15,17       0,ABNIO                       PASS                     
         TEXT     'X6      '                                                    
         DATA     0,0,0,0                                                       
         BOUND    4                                                             
F:MODIR  GEN,8,20,4     DCBSIZE,0,RAD             *DCB FOR LIBRARY              
         GEN,8,7,17     RETRY,IN,0                 MODULE INDEX FILE            
         GEN,32         0                                                       
         GEN,15,17      0,ERRIO                                                 
         GEN,15,17      0,ABNIO                                                 
         TEXT     'MODIR   '                                                    
         DATA     0,0,0,0                                                       
         BOUND    4                                                             
F:EBCDIC GEN,8,20,4     DCBSIZE,0,RAD             *DCB FOR LIBRARY              
         GEN,8,7,17     RETRY,IN,0                 EBCDIC FILE                  
         GEN,32         0                                                       
         GEN,15,17      0,ERRIO                                                 
         GEN,15,17      0,ABNIO                                                 
         TEXT     'EBCDIC  '                                                    
         DATA     0,0,0,0                                                       
         BOUND    4                                                             
F:DEFREF GEN,8,20,4     DCBSIZE,0,RAD             *DCB FOR LIBRARY              
         GEN,8,7,17     RETRY,IN,0                 DEF/REF FILE                 
         GEN,32         0                                                       
         GEN,15,17      0,ERRIO                                                 
         GEN,15,17      0,ABNIO                                                 
         TEXT     'DEFREF  '                                                    
         DATA     0,0,0,0                                                       
         BOUND    4                                                             
F:MODULE GEN,8,20,4     DCBSIZE,0,RAD             *DCB FOR LIBRARY              
         GEN,8,7,17     RETRY,IN,0                 ROM FILE                     
         GEN,15,17      0,B:ROM                                                 
         GEN,15,17      120,ERRIO                                               
         GEN,15,17      0,ABNIO                                                 
         TEXT     'MODULE  '                                                    
         DATA     0,0,0,0                                                       
         BOUND    4                                                             
M:C      GEN,8,15,1,4,4  DCBSIZE,0,VFC,0,OPLB    *DCB FOR 'C' DEVICE            
         GEN,8,7,9,8    RETRY,IN,0,OPLB:C                                       
         GEN,15,17      0,B:C                                                   
         GEN,15,17      120,ERRIO                                               
         GEN,15,17      0,ABNIO                                                 
         DATA,8   0                                                             
         DATA     0,0,0,0                                                       
         BOUND    4                                                             
M:LL     GEN,8,15,1,4,4 DCBSIZE,0,VFC,0,OPLB      *DCB FOR 'LL'                 
         GEN,8,7,9,8    RETRY,OUT,0,OPLB:LL                                     
         GEN,32         0                                                       
         GEN,15,17      0,ERRIO                                                 
         GEN,15,17      0,ABNIO                                                 
         DATA,8   0                                                             
         DATA     0,0,0,0                                                       
         BOUND    4                                                             
M:OC     GEN,8,15,1,4,4  DCBSIZE,0,VFC,0,OPLB     *DCB FOR 'OC'                 
         GEN,8,7,9,8    RETRY,INOUT,0,OPLB:OC                                   
         GEN,32         0                                                       
         GEN,15,17      0,ERRIO                                                 
         GEN,15,17      0,ABNIO                                                 
         DATA,8   0                                                             
         DATA     0,0,0,0                                                       
         BOUND    4                                                             
M:LO     GEN,8,15,1,4,4 DCBSIZE,0,VFC,0,OPLB      *DCB FOR 'LO'                 
         GEN,8,7,9,8    RETRY,OUT,0,OPLB:LO                                     
         GEN,32         0                                                       
         GEN,15,17      0,ERRIO                                                 
         GEN,15,17      0,ABNIO                                                 
         DATA,8   0                                                             
         DATA     0,0,0,0                                                       
         TITLE    '       **** TABLES ****'                                     
         BOUND    4                                                             
T:PL     DATA     0      *TABLE OF PUBLIC LIBRARY FILE NAMES SPECIFIED          
         RES      PLSIZE-1          ON OLOAD CONTROL COMMAND                    
*                                                                               
WDP:PL   DATA     0                 WORD DISPLACEMENT OF FIRST                  
*                                   UNUSED T:PL ENTRY                           
T:LDINST EQU      %     *TEMPORARY TABLE OF LOAD ITEMS BUILT BY CCI             
*                        FROM AN INSTRUCTION OR DATA WORD SCANNED ON THE        
*                        :MODIFY CONTROL COMMAND                                
         DATA,1   0                 NO. OF BYTES IN THE TABLE                   
         DATA,2   0                 (UNUSED)                                    
         DATA,1   X'44'             LOAD ABSOLUTE (NEXT 4 BYTES)                
         DATA,4   0                 (INSTRUCTION WORD)                          
         DATA,1   X'07'             DEFINE FIELD                                
         DATA,1   255               (ADDRESS FIELD)                             
         DATA,1   0                 (FIELD LENGTH)                              
         DATA,9                     (ADDR EXPRESSION)                           
*                                                                               
         BOUND    4                                                             
T:LDADDR EQU      %     *TEMPORARY TABLE OF LOAD ITEMS BUILT BY CCI             
*                        FROM ADDRESSES SCANNED ON THE :MODIFY CC               
         DATA,1   0                *NO. OF BYTES IN THE TABLE                   
         DATA,2   0                *(UNUSED)                                    
         DATA,1   0                *LOAD THE FOLLOWING EXPRESSN (X'60')         
*                                   OR LOAD-LOC ORIGIN (X'04')                  
         DATA,1   0                *ADD VALUE OF TABLE                          
         DATA,2   0                 *'TB' IN BITS 0-1                           
*                                   'ENTRY IN BITS 2-15                         
         DATA,1   0                *ADD CONSTANT (X'01') OR                     
*                                   EXPRESSION END (X'02')                      
         DATA,4   0                *CONSTANT                                    
         DATA,1   X'02'            *EXPRESSION END                              
*                                                                               
         PAGE                                                                   
         BOUND    4                                                             
T:FBA    EQU      %-1  *DYNAMIC TABLE AREAS 'FIRST BYTE ADDR' POINTERS          
FBA:PUBV DATA     0                 T:PUBVAL                                    
FBA:PUBS DATA     0                 T:PUBSYM                                    
FBA:VALU DATA     0                 T:VALUE                                     
FBA:SEG  DATA     0                 T:SEG                                       
FBA:DCBV DATA     0                 T:DCBV                                      
FBA:DCB  DATA     0                 T:DCB                                       
FBA:ROMI DATA     0                 T:ROMI                                      
FBA:MODF DATA     0                 T:MODIFY                                    
FBA:MODL DATA     0                 T:MODULE                                    
FBA:MTB  DATA     0                 B:MT                                        
FBA:DECL DATA     0                 T:DECL                                      
FBA:CSEC DATA     0                 T:CSECT                                     
FBA:FWD  DATA     0                 T:FWD                                       
FBA:FWDX DATA     0                 T:FWDX                                      
FBA:SYM  DATA     0                 T:SYMBOL                                    
FBA:VALX DATA     0                 T:VALX                                      
         PAGE                                                                   
         BOUND    4                                                             
T:BDP    EQU      %-1  *DYNAMIC TABLE AREAS 'BYTE DISPLACEMENT POINTERS'        
BDP:PUBV DATA     0                 T:PUBVAL                                    
BDP:PUBS DATA     0                 T:PUBSYM                                    
BDP:VALU DATA     0                 T:VALUE                                     
BDP:SEG  DATA     0                 T:SEG                                       
BDP:DCBV DATA     0                 T:DCBV                                      
BDP:DCB  DATA     0                 T:DCB                                       
BDP:ROMI DATA     0                 T:ROMI                                      
BDP:MODF DATA     0                 T:MODIFY                                    
BDP:MODL DATA     0                 T:MODULE                                    
BDP:MTB  DATA     0                 B:MTB                                       
BDP:DECL DATA     0                 T:DECL                                      
BDP:CSEC DATA     0                 T:CSECT                                     
BDP:FWD  DATA     0                 T:FWD                                       
BDP:FWDX DATA     0                 T:FWDX                                      
BDP:SYM  DATA     0                 T:SYMBOL                                    
BAP:VALX DATA     0                 T:VALX (NOTE:THIS IS A 'BYTE ADDRESS        
*                                                POINTER')                      
         PAGE                                                                   
         BOUND    4                                                             
T:LBA    EQU      %-1  *DYNAMIC TABLE AREAS 'LAST BYTE ADDR+1' POINTERS         
LBA:PUBV DATA     0                 T:PUBVAL                                    
LBA:PUBS DATA     0                 T:PUBSYM                                    
LBA:VALU DATA     0                 T:VALUE                                     
LBA:SEG  DATA     0                 T:SEG                                       
LBA:DCBV DATA     0                 T:DCBV                                      
LBA:DCB  DATA     0                 T:DCB                                       
LBA:ROMI DATA     0                 T:ROMI                                      
LBA:MODF DATA     0                 T:MODIFY                                    
LBA:MODL DATA     0                 T:MODULE                                    
LBA:MTB  DATA     0                 B:MT                                        
LBA:DECL DATA     0                 T:DECL                                      
LBA:CSEC DATA     0                 T:CSECT                                     
LBA:FWD  DATA     0                 T:FWD                                       
LBA:FWDX DATA     0                 T:FWDX                                      
LBA:SYM  DATA     0                 T:SYMBOL                                    
LBA:VALX DATA     0                 T:VALX                                      
         PAGE                                                                   
         BOUND    4                                                             
T:NBE    EQU      %-1  *DYNAMIC TABLE AREAS 'NO. OF BYTES PER ENTRY'            
NBE:PUBV DATA     5                 T:PUBVAL                                    
NBE:PUBS DATA     0                 T:PUBSYM                                    
NBE:VALU DATA     5                 T:VALUE                                     
NBE:SEG  DATA     10*4              T:SEG                                       
NBE:DCBV DATA     24                T:DCBV                                      
NBE:DCB  DATA     3*4               T:DCB                                       
NBE:ROMI DATA     1*4               T:ROMI                                      
NBE:MODF DATA     0                 T:MODIFY                                    
NBE:MODL DATA     5*4               T:MODULE                                    
NBE:MTB  DATA     0                 B:MT                                        
NBE:DECL DATA     2                 T:DECL                                      
NBE:CSEC DATA     2*4               T:CSECT                                     
NBE:FWD  DATA     2*4               T:FWD                                       
NBE:FWDX DATA     0                 T:FWDX                                      
NBE:SYM  DATA     0                 T:SYMBOL                                    
NBE:VALX DATA     0                 T:VALX                                      
         BOUND    4                                                             
         PAGE                                                                   
*                         *AREA SIZES ARE ALLOCATED AFTER THE PUBLIC            
*                          LIBRARY SYMBOL AND VALUE TABLES ARE INPUT;           
*                          FROM THE LBA+1 OF T:PUBSYM TO THE END OF             
*                          BACKGROUND (K:BCKEND).                               
*                                                                               
T:BZA    EQU      %-1     *TABLE OF INITIAL 'BYTE SIZES FOR AREAS'              
BZA:PUBV DATA     0   ALREADY ALLOCATED                T:PUBVAL                 
BZA:PUBS DATA     0   ALREADY ALLOCATED                T:PUBSYM                 
BZA:VALU DATA     -5  ALLOCATE BY RATIO                T:VALUE                  
BZA:SEG  DATA     10  ALLOCATE THIS NO. OF ENTRIES     T:SEG                    
BZA:DCBV DATA     10  ALLOCATE THIS NO. OF ENTRIES     T:DCBV                   
BZA:DCB  DATA     21  ALLOCATE THIS NO. OF ENTRIES     T:DCB                    
BZA:ROMI DATA     150 ALLOCATE THIS NO. OF ENTRIES     T:ROMI                   
BZA:MODF DATA     -3  ALLOCATE BY RATIO                T:MODIFY                 
BZA:MODL DATA     150 ALLOCATE THIS NO. OF ENTRIES     T:MODULE                 
BZA:MTB  DATA     -7  ALLOCATE BY RATIO                B:MT                     
BZA:DECL DATA     256 ALLOCATE THIS NO. OF ENTRIES     T:DECL                   
BZA:CSEC DATA     2   ALLOCATE THIS NO. OF ENTRIES     T:CSECT                  
BZA:FWD  DATA     5   ALLOCATE THIS NO. OF ENTRIES     T:FWD                    
BZA:FWDX DATA     48  ALLOCATE THIS NO. OF BYTES       T:FWDX                   
BZA:SYM  DATA     -9  ALLOCATE BY RATIO                T:SYMBOL                 
BZA:VALX DATA     -1  ALLOCATE BY RATIO                T:VALX                   
         TITLE    '       **** BUFFERS ****'                                    
         BOUND    4                                                             
         DATA,1   0,0,0,X'C0'       (VFC CONTROL BYTE)                          
B:C      RES,1    120              *CONTROL COMMAND BUFFER                      
*                                                                               
         BOUND    4                                                             
B:ERRCC  RES,1    81                CURRENT CMND FOR ERROR LOGGING              
         BOUND    4                                                             
B:ROM    RES,1    120               ROM RECORD BUFFER                           
*                                                                               
         BOUND    4                                                             
B:X      RES,1    120               ROM EXPRESSION BUFFER                       
         TITLE    '       **** CELLS ****'                                      
*                                                                               
*                                                                               
         BOUND    4                                                             
P:POOL   RES      40                OVERLAY POOL OF CELLS USED BY SEG'S    101  
*                                                                               
FWA:BUF  EQU      P:POOL+18   (LIB) EBCDIC,DEFREF,AND MODIR FILES               
*                                   BUFFER POINTER                              
*                                                                               
*T:SEG FIELDS                                                                   
S:LL     EQU      9                 WD OF LOAD MODULE LENGTH OF SEG             
S:MA     EQU      12                HWD OF SEGMENT START ADDRESS                
S:ML     EQU      13                HWD OF SEGMENT MEMORY LENGTH                
S:ENTRY  EQU      7                 WD OF ROOT ENTRY                            
S:VALBL  EQU      7                 HWD OF BL OF T:VALUE                        
S:SYMBL  EQU      9                 HWD OF BL OF T:SYMBOL                       
S:LA     EQU      5                 HWD OF LM ADDRESS OF SEG                    
S:FLAGS  EQU      7                 W INDEX TO FLAG FIELD                       
*        SHIFTS FROM RJ TO NATURAL POSITION IN T:SEG FLAG WORD                  
S:FSHIFT EQU      28                FIXED REAL MEMORY FLAG SHIFT                
S:ISHIFT EQU      27                INITIAL LOAD FLAG SHIFT                     
S:MSHIFT EQU      25                MEM ACCESS PROT CODE SHIFT                  
S:SSHIFT EQU      23                SHARABILITY CODE SHIFT                      
S:PSHIFT EQU      22                PRELOADED SEG FLAG SHIFT                    
*        T:SEG FLAG FIELD:  MASKS IN NATURAL POSITIONS                          
S:IMSK   DATA     1**27             INITIAL LOAD                                
S:FMSK   DATA     1**28             FIXED REAL MEMORY                           
S:MMSK   DATA     3**25             MEMORY ACCESS                               
S:SMSK   DATA     3**23             SHARABILITY                                 
S:PMSK   DATA     1**22             PRELOADED SHARABLE SEG FLAG                 
VMODMTB  DATA     0      (PASSONE) *BDP IN T:MODULE OF ENTRY WITH FIRST         
*                                   SET OF MODULE TABLES IN B:MT                
*                                                                               
         BOUND    4                                                             
BEPROMI  DATA     0      (PASSONE)  BYTE ENTRY POINTER IN T:ROMI                
*                                                                               
FLTMPTSK DATA     0      (CCI)      0=NEITHER TEMP NOR TASK SPECIFIED           
*                                     ON OLOAD                                  
*                                                     -   -&&                   
*                                                                               
NUM1     DATA     0      (CCI)      TEMP CELL FOR NUMSCAN                       
*                                                                               
NUM2     DATA     0                 TEMP CELL FOR NUMSCAN                       
*                                                                               
CCSTACK  RES      15                (CCI)     *STACK WHERE FLAGS AND POINTERS   
*                                   SAVED AT THE BEGINNING OF EACH              
*                                   CONTROL COMMAND SCAN                        
*                                                                               
         BOUND    8                                                             
DCBNAME  RES      2      (DCBTYPE) *DCB NAME IN 8-EBCDIC CHAR,WITH              
*                                   TRAILING BLANKS                             
*                                                                               
SYMBAP   DATA     0      (SERCHSYM) LBA+1 OF MATCHING T:SYMBOL ENTRY            
*                                                                               
SYMENT   DATA     0      (SERCHSYM) MATCHING T:SYMBOL ENTRY NUMBER              
*                                                                               
SYM1     DATA     0      (SERCHSYM) TEMP CELL                                   
*                                                                               
SYM2     DATA     0      (SERCHSYM) TEMP CELL                                   
*                                                                               
ROMSCNT  DATA     0      (ROMBYTES)*COUNT OF THE NUMBER OF ROM BYTES            
*                                   (LEFT) TO SKIP                              
*                                                                               
DECLBYTE DATA     0      (GETDECL)  BYTE ONE OF DECLARATION NAME NO.            
*                                                                               
VALFBA   DATA     0      (SERCHVAL) FBA OF MATCHING T:VALUE ENTRY               
*                                                                               
CMPZ     DATA     0      (COMPSIZE) DSECT SIZE                                  
*                                                                               
SOLRR    DATA     0      (SOLVEX)   ADDRESS RESOLUTION COUNTERS:B,H,W,D         
*                                                                               
SOLVALU  DATA     0      (SOLVEX)   PARTIAL SUM ACCUMULATOR                     
*                                                                               
SOLX     DATA     0      (SOLVEX)   FBA OF EXPRESSION                           
*                                                                               
SOLBAP   DATA     0      (SOLVEX)  *BYTE ADDR POINTER TO EXPRESSION             
*                                   ITEM 'ADD/SUBT VALUE'                       
*                                                                               
RAXVALX  DATA     0      (RAX)      HW0=NO. OF EXP. RESOLVED IN T:VALX          
*                                   HW1=NO. OF UNRESOLVED EXP. IN T:VALX        
*                                                                               
RAXFWDX  DATA     0      (RAX)      HW0=NO. OF EXP. RESOLVED IN T:FWDX          
*                                   HW1=NO. OF UNRESOLVED EXP. IN T:FWDX        
*                                                                               
RAX1     DATA     0      (RAX)      TEMP CELL                                   
*                                                                               
RAX2     DATA     0      (RAX)      TEMP CELL                                   
*                                                                               
PATX     DATA     0      (PATHEND)  RETURN ADDRESS                              
*                                                                               
PATSEG   DATA     0      (PATHEND)  BA OF PREVIOUS T:SEG ENTRY                  
*                                                                               
PATSEGHA DATA     0      (PATHEND)  HA OF PREVIOUS T:SEG ENTRY                  
*                                                                               
PATFBDV  DATA     0      (PATHEND)  FBD OF PREVIOUS SEG'S T:VALUE TABLE         
*                                                                               
ROMX     DATA     0      (ROMBYTE)  ROMBYTE EXIT ADDR                           
*                                                                               
SAT1SYM  DATA     0      (SATREF)   FBA OF DEF'S T:SYMBOL ENTRY                 
*                                                                               
SAT1VAL  DATA     0      (SATREF)   FBA OF DEF'S T:VALUE ENTRY                  
*                                                                               
SAT2SYM  DATA     0                 (SATREF) FBA OF REF'S T:SYMBOL ENTRY        
*                                                                               
SAT2VAL  DATA     0      (SATREF)   FBA OF REF'S T:VALUE ENTRY                  
*                                                                               
EXTFWDS  DATA     0      (EXTEND)  *BZA:FWD AND BZA:FWDX HAVE BEEN              
*                                   INCREASED IN SIZE                           
*                                                                               
CONCNT   DATA     0      (CONVROMX) COUNTER                                     
*                                                                               
CONBAP   DATA     0      (CONVROMX) BYTE ADDR POINTER IN B:X                    
*                                                                               
CONDECL  RES      2      (CONVROMX) STORAGE FOR T:CSECT ENTRY                   
*                                                                               
SCANFLAG DATA     0      (CCI)      END OF SUBFIELD/FIELD/CC/ERROR FLAG         
*                                                                               
SCANITEM DATA     0      (CCI)      ITEM NO. IN EBCDIC (BITS 8-23)              
*                                                                               
SCANEXIT DATA     0      (CCI)      SCANXXX RETURN ADDRESS                      
*                                                                               
CCVALUE  DATA     0                *T:VALUE ENTRY FOR :LCOM,:RES,:EXC,          
         DATA     0                 AND :INC DSECT'S AND REF'S                  
*                                                                               
SCAN80   DATA     0                 -1=MINUS SIGN ENCOUNTERED                   
*                                    0=NEITHER                                  
*                                   +1=PLUS SIGN ENCOUNTERED                    
*                                                                               
SCAN82   DATA     0                 SET R5 TO THIS UPON EXIT                    
SCAN83   DATA     0                 FLAG FOR DEC. OR EBCDIC SCAN                
SCAN84   DATA     0                 CONTENTS OF SCAN91 AT START OF SCAN         
SCAN85   DATA     0                 SAVE SCAN98 HERE IN RESCAN CASE             
SCAN88   DATA     0                 SAVE R7 HERE                                
SCAN89   DATA     X'40000040'       BLANKS                                      
SCAN89A  DATA     X'40404040'       EBCDIC BLANKS                               
SCAN90   DATA     0                 FIELD FLAG                                  
SCAN91   DATA     0                 PARENTHESES FLAG                            
SCAN92   DATA     1                 CONT. CARD FLAG                             
SCAN93   DATA     0                 CHAR. COUNT                                 
SCAN94   DATA     0                 FIELD COUNT                                 
SCAN95   DATA     0                 COUNT OF HEX CHARS.                         
SCAN96   DATA     0                 ADD. OF CARD BUFFER                         
SCAN97   DATA     0                 =0 IF PERIOD MEANS END OF CMND              
*                                   =1 IF END OF FILE FIELD                     
SCAN98   DATA     0                 COL. INDEX AND EXIT PM. R6                  
SCAN99   DATA     0                 RETURN ADDRESS                              
*                                                                               
GIOCT    DATA     0,0,0,0,0,0       GETIOID CONTROL BLOCK                       
         TITLE    '****  EXEC  ****'                                            
*        ****************************                                           
*        *                          *                                           
*        *                          *                                           
*        *  EXEC                    *                                           
*        *                          *                                           
*        *                          *                                           
*        ****************************                                           
*                                                                               
*                                                                               
*                 INITIATES OPERATION OF OVERLAY LOADER                         
*                                                                               
*                                                                               
*                                                                               
EXEC     RES      0                                                             
         LW,R5    K:CCBUF                                                       
         SLS,R5   2                                                             
         LI,R6    BA(B:C)                                                       
         LI,R8    80                                                            
         MOVBYTS                    MOVE !OLOAD CMND INTO OUR BUFFER            
         LI,R11   SEG:CCI           LOAD CONTROL CARD INTERPRETER               
         B        LOADSEG                                                       
         TITLE    '****  ABNIO  ****'                                           
*                                                                               
*                                                                               
*        ****************************                                           
*        *                          *                                           
*        *                          *                                           
*        *  ABNIO                   *                                           
*        *                          *                                           
*        *                          *                                           
*        ****************************                                           
*                                                                               
*                                                                               
*                 ENTERED FROM MONITOR I/O ROUTINE WHEN AN ABNORMAL             
*                 I/O CONDITION OCCURS. ALSO USED BY ERRIO.                     
*                 SETS UP A CALL TO RDIAG,DIAG AND RABORT                       
*                                                                               
*        CALL     NONE. POINTER IN FPT,DCB                                      
*                                                                               
*                                                                               
*        ENTRY    R9 CONTAINS A POINTER TO AN ABNORMAL CODE                     
*                 COMPARISON AND SERVICE ROUTINE  TABLE.OF THE                  
*                 FOLLOWING FORM                                                
*                                                                               
*                 WORD 1 COUNT OF ENTRIES EXCL SELF.                            
*                                                                               
*                 WORD 2-N                                                      
*                   BIT 0-7         ABNORMAL IO CODE                            
*                   BIT 14    =1    OUTPUT A DIAGNOSTIC                         
*                             =0    DO NOT OUTPUT DIAGNOSTIC                    
*                   BIT 15-31       WA OF SERVICE ROUTINE                       
*                                                                               
*                 R8,R10 CONTAIN I/O INFORMATION                                
*                                                                               
*                                                                               
************************************************************************        
*                                                                               
ABNIO    RES      0                                                             
ERRIO    EQU      ABNIO                                                         
         PUSH     0,15                                                          
         LI,R5    RABORT            SET SERVICE EXIT TO ABORT INITIALLY         
         LW,R11   Y:FF                                                          
         CS,R10   Y:42              IS THIS A RAD WRITE PROTECTED STATUS        
         BNE      ABN0                  NO                                      
         LW,R5    R8                    YES,AFTER MESSAGE OUTPUT RETURN         
         AI,R5    -1                        TO ADDRESS OF CAL TO RETRY          
ABN0     STW,R5   IOSERVE                   THE I/O REQUEST                     
         CI,R9    0                                                             
         BE       ABN3              NO PARAMETER LIST                           
         LW,R7    *R9               CHECK FIRST WORD OF PARAMETER LIST          
         BEZ      ABN3              ZERO PARAMETERS IN LIST                     
ABN1     CS,R10   *R9,R7            CHECK BITS 0-7                              
         BE       ABN2              FOUND                                       
         BDR,R7   ABN1              KEEP STEPPING THROUGH TABLE                 
         B        ABN3              NOT FOUND IN PARAMETER TABLE                
ABN2     LW,R7    *R9,R7            TRANSFER TO SERVICE ROUTINE                 
         STW,R7   IOSERVE           OVERRIDES RABORT                            
         CI,R7    1**(31-14)        BIT 14                                      
         BANZ     ABN3              SET - OUTPUT  DIAGNOSTIC                    
         PULL     0,15                                                          
         B        *IOSERVE                                                      
ABN3     LB,R9    R10               IO ABNORMAL OR ERROR CODE                   
         LW,R7    TIODIAG           NUMBER OF ENTRIES                           
         LI,R6    WA(TIODIAG)+1     POINTER TO 1ST ITEM OF TABLE                
ABN34    CH,R9    *R6               LEFT HALF WORD                              
         BE       ABN4              MATCH                                       
         AI,R6    1                 NEXT  WORD                                  
         BDR,R7   ABN34                                                         
         LI,R9    UNKNOWN                                                       
         B        ABN5                                                          
ABN4     LI,R7    1                                                             
         LH,R9    *R6,R7            GETS RIGHT HALF WORD.                       
*                                   NUMBER OF DIAGNOSTIC                        
ABN5     RES      0                                                             
         RDIAG                      OUTPUT DIAGNOSTIC AND RETURN                
         PULL     0,15                                                          
         B        *IOSERVE                                                      
*                                                                               
*                                                                               
*        TABLES FOR ABNIO                                                       
*                                                                               
*                                                                               
*                 FORMAT            LEFT HALF WORD=IO ERR/ABN NUMBER            
*                                   RIGHT HALF WORD=LOADER DIAGNOSTIC NO        
*                                                                               
*                                                                               
         BOUND    4                                                             
TIODIAG  DATA,2   0,TIODIAGE-TIODIAG  NUMBER OF ENTRIES                         
         DATA,2   X'01',RONGDCB                                                 
         DATA,2   X'03',NORADFIL                                                
         DATA,2   X'05',ILLEOD2                                                 
         DATA,2   X'06',EOFONCC                                                 
         DATA,2   X'07',TINYBUFF                                                
         DATA,2   X'0A',DCBCLOSE                                                
         DATA,2   X'1C',EOTERR2                                                 
         DATA,2   X'1D',BOTERR                                                  
         DATA,2   X'2E',DCBOPEN                                                 
         DATA,2   X'2F',DCBNODEV                                                
         DATA,2   X'40',READOUTP                                                
         DATA,2   X'41',IRRECRD                                                 
         DATA,2   X'42',RADWP                                                   
         DATA,2   X'44',WRITEINP                                                
         DATA,2   X'45',IRRECWR                                                 
         DATA,2   X'46',NOOPDCBR                                                
         DATA,2   X'47',NOOPDCBW                                                
         DATA,2   X'48',NONREAL                                                 
         DATA,2   X'4A',INVBUFF                                                 
         DATA,2   X'54',REREADCC                                                
         DATA,2   X'55',FULLRFT                                                 
         DATA,2   X'59',DCBCHGED                                                
         DATA,2   X'60',SHAREDIN                                                
         DATA,2   X'75',BADDIRE                                                 
         DATA,2   X'7D',DCBSMALL                                                
TIODIAGE EQU      %-1                                                           
*                                                                               
IOSERVE  RES      1                 SERVICE ROUTINE ADDR                        
*                                                                               
*                                                                               
         TITLE    '****  CHKBLANK  ****'                                        
*                                                                               
*                                                                               
*        ****************************                                           
*        *                          *                                           
*        *  CHKBLANK                *                                           
*        *                          *                                           
*        *                          *                                           
*        ****************************                                           
*                                                                               
*                                                                               
*                 CHECK A RECORD TO SEE IF IT IS BLANK.                         
*                 CHECK FOR 80 BLANK  (X'40') BYTES                             
*                 OR  120  ZERO (X'00') BYTES                                   
*                                                                               
*                                                                               
*        CALL     CHKBLANK                                                      
*                                                                               
*        ENTRY    R5 CONTAINS BAP TO BUFFER                                     
*                                                                               
*        EXIT     R5 UNCHANGED                                                  
*                                                                               
*                 CC  BIT 1 SET (CC=8) BLANK BINARY RECORD  (ALL 0'S)           
*                     BIT 2 SET (CC=4)  BLANK EBCDIC RECORD (ALL X'40'S)        
*                                                                               
*                                                                               
*                                                                               
CHKBLANK RES      0                                                             
         PUSH     5,7                                                           
         LB,R7    0,R5              1ST BYTE OF IMAGE                           
         CI,R7    0                 IF BYTE 1 =0                                
         BE       CHK3              CHECK IF WHOLE IMAGE = 0                    
         CI,R7    X'40'             IS BYTE 1 BLANK                             
         BNE      CHK7                  NO                                      
*                                       YES,CHECK FOR EBCDIC BLANK RECD         
         LI,R6    80                EBCDIC BUFFER          /SIG7-2080/*C5732    
CHK2     CB,R7    0,R5              COMPARE BYTES 1--80    /SIG7-2080/*C5732    
         BNE      CHK7              NOT COMPLETELY BLANK   /SIG7-2080/*C5732    
         AI,R5    1                 INCREMENT BA           /SIG7-2080/*C5732    
         BDR,R6   CHK2                                                          
         PULL     5,7               BLANK RECORD                                
         LCFI     X'4'                                                          
         B        *R15              RETURN                                      
CHK3     LI,R6    120               BINARY BUFFER          /SIG7-2080/*C5732    
CHK4     MTB,0    0,R5                                     /SIG7-2080/*C5732    
         BNEZ     CHK7              NOT 0                                       
         AI,R5    1                 INCREMENT BA           /SIG7-2080/*C5732    
         BDR,R6   CHK4                                                          
         PULL     5,7               COMPLETELY ZERO                             
         LCFI     X'8'                                                          
         B        *R15                                                          
CHK7     PULL     5,7               NON-BLANK RECORD.                           
         LCFI     0                                                             
         B        *R15                                                          
         TITLE    '****  MOVBYTS  ****'                                         
*                                                                               
*                                                                               
*        ****************************                                           
*        *                          *                                           
*        *  MOVBYTS                 *                                           
*        *                          *                                           
*        *                          *                                           
*        ****************************                                           
*                                                                               
*                                                                               
*                 MOVE BYTE STRING WITHOUT LEADING COUNT                        
*                                                                               
*                                                                               
*        CALL     MOVBYTS                                                       
*                                                                               
*        ENTRY    R5 CONTAINS FBA OF OLD AREA                                   
*                 R6 CONTAINS FBA OF NEW AREA                                   
*                 R8 CONTAINS BYTE COUNT                                        
*                                                                               
*        EXIT     R5 -R8 RESTORED                                               
*                                                                               
*                                                                               
MOVBYTS  RES      0                                                             
         PUSH     5,8                                                           
         CI,R8    0                                                             
         BLE      MOV3                                                          
         CW,R5    R6                FROM:TO                                     
         BL       MOV1                                                          
MOV0     LB,R7    0,R5                  FROM > OR = TO,MOVE BYTE STRING         
         STB,R7   0,R6                                 STARTING WITH THE        
         AI,R5    1                                    FIRST BYTE               
         AI,R6    1                                                             
         BDR,R8   MOV0                                                          
         B        MOV3                                                          
MOV1     AW,R5    R8                    FROM < TO,MOVE BYTE STRING              
*                                                 STARTING WITH THE             
*                                                 LAST BYTE                     
         AW,R6    R8                                                            
MOV2     AI,R5    -1                                                            
         AI,R6    -1                                                            
         LB,R7    0,R5                                                          
         STB,R7   0,R6                                                          
         BDR,R8   MOV2                                                          
MOV3     PULL     5,8                                                           
         B        *R15                                                          
         TITLE    '****  RABORT  ****'                                          
*                                                                               
*                                                                               
*        ****************************                                           
*        *                          *                                           
*        *  RABORT                  *                                           
*        *                          *                                           
*        *                          *                                           
*        ****************************                                           
*                                                                               
*                                                                               
*                 IF PROGRAM FILE HAS BEEN WRITTEN, GRANULES 0,1                
*                 ARE ZEROED OUT.                                               
*                                                                               
*                 MONITOR ABORT EXIT IS TAKEN                                   
*                                                                               
*                                                                               
RABORT   RES      0                                                             
         PUSH     8,10                                                          
         LI,R9    ABORT2                                                        
         LW,R0    FL:OUTOV         *HAS ANY DATA BEEN WRITTEN ON THE            
*                                   PROGRAM FILE                                
         BEZ      RAB10                 NO                                      
         CAL1,1   FPT:ABT               YES,DESTROY FILE (WRITE ZERO)           
         LI,R9    ABORT                                                         
RAB10    RDIAG                      OUTPUT APPROPRIATE DIAGNOSTIC               
         PULL     8,10                                                          
         CAL1,9   9                 WAIT                                        
         CAL1,9   1                 EXIT                                        
         TITLE    '****  RDIAG  ****'                                           
*                                                                               
*                                                                               
*        ****************************                                           
*        *                          *                                           
*        *                          *                                           
*        *  RDIAG                   *                                           
*        *                          *                                           
*        *                          *                                           
*        ****************************                                           
*                                                                               
*                                                                               
*                 CAUSES DIAGNOSTIC OVERLAY TO BE LOADED                        
*                 AND DIAGNOSTIC TO BE OUTPUT                                   
*                 IF RETURN IS NOT TO RABORT, OVERLAY IN                        
*                 V:COLAY IS RELOADED.                                          
*                                                                               
*        '                                                                      
*        CALL     RDIAG                                                         
*                                                                               
*                                                                               
*        ENTRY                                                                  
*                 R9  CONTAINS THE DIAGNOSTIC NUMBER (BITS 24-31)               
*                                                                               
*                                                                               
*        EXIT     V:CCADR=WA OF M:C OR M:OC,ACCORDING TO WAIT KEYIN             
*                                                                               
RDIAG    RES      0                                                             
         PUSH     0,15                                                          
         LI,R11   SEG:DIAG         *LOAD DIAG OVERLAY,BUT DONT TRANSFER         
         AW,R11   Y:01                                                          
         GOTO,NOV RD1                                                           
         CAL1,8   R11                                                           
RD1      EQU      %                                                             
         B        DIAG              (BRANCH TO DIAG;RETURNS AT RDIAGX)          
RDIAGX   LW,R11   V:COLAY          *RELOAD CALLING OVERLAY SEGMENT,BUT          
         BEZ      RD10                                                          
         AW,R11   Y:01              DONT TRANSFER                               
         GOTO,NOV RD2                                                           
         CAL1,8   R11                                                           
RD2      EQU      %                                                             
RD10     PULL     0,15                                                          
         B        *15                                                           
         TITLE    '****  LOADSEG  ****'                                         
*                                                                               
*                                                                               
*        ****************************                                           
*        *                          *                                           
*        *                          *                                           
*        *  LOADSEG                 *                                           
*        *                          *                                           
*        *                          *                                           
*        ****************************                                           
*                                                                               
*                                                                               
*                 ON REQUEST LOADS THE NEXT OVERLAY                             
*                                                                               
*                 IS NOT USED TO  LOAD   DIAGNOSTIC  SEGMENT                    
*                                                                               
*                                                                               
*        CALL                                                                   
*                                                                               
*        LOADSEG                                                                
*                                                                               
*        ENTRY    R11 CONTAINS  THE  NUMBER OF THE SEGMENT  TO                  
*                 BE LOADED                                                     
*                 V:COLAY  CONTAINS   THE NUMBER OF THE SEGMENT                 
*                 CURRENTLY IN CORE                                             
*                                                                               
*                                                                               
*        EXIT     V:COLAY CONTAINS THE NUMBER OF THE SEGMENT                    
*                 LOADED                                                        
*                                                                               
*                                                                               
LOADSEG  CI,R11   SEG:CCI                                                       
         BL       LD30                  ILLEGAL SEGMENT NO.,ERROR               
         CI,R11   SEG:LIB                                                       
         BG       LD30                  ILLEGAL SEGMENT NO.,ERROR               
         STW,R11  V:COLAY                                                       
         AW,R11   Y:01              CREATE FPT IN R11                           
         GOTO,NOV LD10                                                          
         CAL1,8   R11               LOAD OVERLAY AND RETURN                     
LD10     EQU      %                                                             
         LW,R7    V:COLAY                                                       
         B        %,R7              BRANCH TO ENTRY POINT IN OVERLAY            
         B        CCI                   SEG:CCI                                 
         B        PASSONE               SEG:PAS1                                
         B        PASSTWO               SEG:PAS2                                
         B        MAP                   SEG:MAP                                 
         B        DIAG                  SEG:DIAG                                
         B        LIB                   SEG:LIB                                 
LD30     LI,R9    PROGERR                                                       
         RDIAG                                                                  
         TITLE    '       **** 4BYTES ****'                                     
*                                                                               
*        PURPOSE: TO LOAD 4 BYTES AND PACK INTO ONE WORD                        
*                                                                               
*        INPUT:   R5=BA-1 OF FIRST BYTE                                         
*                                                                               
*        CALL:    BAL,R15  4BYTES                                               
*                                                                               
*        OUTPUT:  R8=4 BYTE WORD                                                
*                 R5=BA OF LAST BYTE                                            
*                                                                               
*        CALLS:   NO SUBROUTINES                                                
*                                                                               
*        MSES:    R5,R7,R8,R0                                                   
*                                                                               
*                                                                               
4BYTES   EQU      %                                                             
         LI,R7    -4                                                            
4BY10    AI,R5    1                                                             
         LB,R0    0,R5                                                          
         STB,R0   R8+1,R7                                                       
         BIR,R7   4BY10                                                         
         B        *R15                                                          
         TITLE    '       **** ADDX ****'                                       
*                                                                               
*        PURPOSE: ADD ENTRY,TO AND INCLUDING EXPRESSION END BYTE,TO             
*                 DYNAMIC EXPRESSION TABLE T:VALX OR T:FWDX                     
*                                                                               
*        INPUT:   R1=TABLE AREA                                                 
*                 R5=FBA OF EXPRESSION                                          
*                                                                               
*        CALL:    BAL,R14  ADDX                                                 
*                                                                               
*        OUTPUT:  R1,R5=UNCHANGED                                               
*                 R6=BDP OF ENTRY IN T:FWDX OR BAP OF ENTRY IN T:VALX           
*                 BDP:FWDX/BAP:VALX=BDP:FWDX/BAP:VALX + BYTE COUNT OF X         
*                                                                               
*        CALLS:   XBC,EXTEND,MOVBYTS,ADD10(ADDNXT)                              
*                                                                               
*                                                                               
ADDX     EQU      %                                                             
         XBC                        COUNT NO. OF BYTES IN THE EXPRESSION        
         LW,R8    R6                                                            
         CI,R1    T:VALX                                                        
         BE       ADX50                                                         
         LW,R6    FBA:FWDX          ADD EXP. TO T:FWDX                          
         LW,R9    FBA:FWDX              R6=FBA OF TABLE                         
         AW,R9    BDP:FWDX              R9=LBA+1 OF TABLE                       
         STW,R6   R7                SEARCH FOR ZEROED ENTRY LARGE               
ADX30    CW,R7    R9                ENOUGH TO CONTAIN NEW ENTRY                 
         BGE      ADD10                 END OF TABLE,NONE FOUND                 
         LB,R0    0,R7                                                          
         AI,R7    1                                                             
         CI,R0    0                                                             
         BE       ADX40                                                         
         STW,R7   R6                                                            
         B        ADX30                                                         
ADX40    STW,R7   R0                                                            
         SW,R0    R6                                                            
         CW,R0    R8                                                            
         BL       ADX30                                                         
         MOVBYTS                        ENTRY FOUND,ADD EXPRESSION              
*                                                   TO TABLE                    
         SW,R6    FBA:FWDX                                                      
         B        *R14                                                          
ADX50    LW,R7    LBA:VALX          ADD EXPRESSION TO T:VALX                    
         LW,R9    BAP:VALX                                                      
         STW,R7   R6                                                            
ADX60    AI,R6    -1                SEARCH FOR ZEROED ENTRY FROM                
         CW,R6    R9                END OF BACKWARD TABLE T:VALX                
         BL       ADX80                 NONE FOUND                              
         LB,R0    0,R6                                                          
         CI,R0    0                                                             
         BE       ADX70                                                         
         STW,R6   R7                                                            
         B        ADX60                                                         
ADX70    LW,R0    R7                                                            
         SW,R0    R6                                                            
         CW,R0    R8                                                            
         BL       ADX60                                                         
         MOVBYTS                        INSERT ENTRY                            
         B        *R14                                                          
ADX80    LW,R6    BAP:VALX          ADD ENTRY AT END OF BACKWARD                
         SW,R6    R8                TABLE T:VALX AND RESET POINTER              
ADX90    CW,R6    FBA:VALX                                                      
         BGE      ADX95                                                         
         EXTEND                         EXTEND TABLE AREA                       
         B        ADX80                                                         
ADX95    MOVBYTS                                                                
         STW,R6   BAP:VALX                                                      
         B        *R14                                                          
         TITLE    '       **** ADDNXT ****'                                     
*                                                                               
*        PURPOSE: TO ADD NEXT ENTRY TO DYNAMIC TABLE WHERE EITHER               
*                 T:NBE ENTRY OR FIRST BYTE OF ENTRY CONTAINS THE               
*                 BYTE COUNT                                                    
*                                                                               
*        INPUT:   R1=TABLE AREA INDEX                                           
*                 R5=FBA OF ENTRY                                               
*                                                                               
*        CALL:    BAL,R14 ADDNXT                                                
*                                                                               
*        OUTPUT:  R6=BDP OF ENTRY WITHIN AREA                                   
*                 T:BDP(R1)=T:BDP(R1)+BYTE COUNT                                
*                 R1,R5=UNCHANGED                                               
*                 R9 'TB' IN BITS 16-17; 'ENTRY' IN BITS 18-31                  
*                    (IF R1=T:DCB,T:VALUE,ORT:CSECT)                            
*                                                                               
*        CALLS:   MOVBYTS,EXTEND                                                
*                                                                               
*                                                                               
ADDNXT   EQU      %                                                             
         LW,R8    T:NBE,R1          DOES TABLE HAVE FIXED ENTRY SIZE            
         BNEZ     ADD10                 YES                                     
         LB,R8    0,R5                  NO,GET BYTE COUNT FROM FIRST            
         AND,R8   X:7F                     BYTE IN BITS 1-7                     
ADD10    LW,R6    T:FBA,R1          CALCULATE FBA OF NEXT ENTRY                 
         AW,R6    T:BDP,R1                                                      
         LW,R0    R6                                                            
         AW,R0    R8                LBA+1 OF NEXT ENTRY                         
ADD20    CW,R0    T:LBA,R1          IS TABLE AREA FULL                          
         BLE      ADD30                                                         
         EXTEND                         YES,EXTEND TABLE AREA                   
         B        ADD10                                                         
ADD30    MOVBYTS                        NO,ADD ENTRY TO TABLE                   
         LI,R9    0                                                             
         LW,R6    T:BDP,R1          BD OF ENTRY WITHIN AREA                     
         AWM,R8   T:BDP,R1          INCREMENT TABLE POINTER                     
         CI,R1    T:CSECT                                                       
         BE       ADD40                                                         
         CI,R1    T:VALUE                                                       
         BE       ADD50                                                         
         CI,R1    T:DCB                                                         
         BE       ADD60                                                         
         B        *R14                                                          
ADD40    AI,R9    X'4000'           SET 'TB' AND 'ENTRY' FOR T:VALUE,           
ADD50    AI,R9    X'4000'           T:DCB,AND T:CSECT ENTRIES                   
ADD60    LW,R11   T:BDP,R1                                                      
         DW,R11   T:NBE,R1                                                      
         OR,R9    R11                                                           
         B        *R14                                                          
         TITLE  '*** BOUNDCS ***               *** DWBOUND ***'                 
*                                                                               
*        PURPOSE: BOUND NBA:SECT TO        BOUND NBA:SECT TO NEXT               
*                 VALUE IN FL:BOUND        DOUBLEWORD BOUNDARY                  
*                                                                               
*        CALL:    BAL,R15  BOUNDCS         BAL,R15  DWBOUND                     
*                                                                               
*        USES:    R8,R9                    R8,R9                                
*                                                                               
*        CALLS:   NO SUBROUTINES           NO SUBROUTINES                       
*                                                                               
*                                                                               
BOUNDCS  LW,R9    FL:BOUND                                                      
         B        DW10                                                          
DWBOUND  LI,R9    7                                                             
DW10     LW,R8    NBA:SECT          IS NBA:SECT ALREADY BOUNDED                 
         AND,R8   R9                                                            
         BEZ      *R15                  YES                                     
         EOR,R8   R9                    NO,ADD COMPLEMENT OF REMAINDER          
         AI,R8    1                        TO BOUND UP                          
         AWM,R8   NBA:SECT                                                      
         B        *R15                                                          
         TITLE    '       **** BOUNDRDW ****'                                   
*                                                                               
*        PURPOSE: TO BOUND CONTENTS OF R8 ON A DOUBLEWORD                       
*                                                                               
*        INPUT:   R8=DATA WORD TO BE BOUNDED                                    
*                                                                               
*        CALL:    BAL,R15  BOUNDRDW                                             
*                                                                               
*        OUTPUT:  R8=DATA WORD BOUNDED                                          
*                                                                               
*        CALLS:   NO SUBROUTINES                                                
*                                                                               
*        USES:    R0,R8                                                         
*                                                                               
*                                                                               
BOUNDRDW EQU      %                                                             
         LW,R0    R8                                                            
         AND,R0   X:7                                                           
         BEZ      *R15                                                          
         EOR,R0   X:7                                                           
         AI,R0    1                                                             
         AW,R8    R0                                                            
         B        *R15                                                          
         DO       #MAP~=0                                                       
         TITLE    '       **** BOUNDRP ****'                                    
*                                                                               
*         INTERPRETING (R8) AS A BYTE ADDRESS, EXTEND IT TO                     
*         THE NEXT GREATER OR EQUAL PAGE START                                  
*                                                                               
*         CALL:    BAL,R15  BOUNDRP                                             
*                                                                               
*         INPUT:   (R8)=BYTE ADDRESS TO BE EXTENDED                             
*                                                                               
*         OUTPUT:  (R8)=INPUT (R8) EXTENDED TO PAGE START                       
*                  (R15)=RETURN LINK                                            
*                  OTHER REGISTERS UNCHANGED                                    
*                                                                               
*         USES:    NO SUBROUTINES                                               
*                                                                               
BOUNDRP  RES      0                                                             
         CW,R8    X:7FF                                                         
         BAZ      *R15                                                          
         OR,R8    X:7FF                                                         
         AI,R8    1                                                             
         B        *R15                                                          
*                                                                               
         ELSE     #MAP                                                          
BOUNDRP  B        *R15                                                          
         FIN      #MAP                                                          
         TITLE    '       **** COMPBS ****'                                     
*                                                                               
*        PURPOSE: TO COMPARE BYTE STRINGS                                       
*                                                                               
*        INPUT:   R5=FBA OF STRING1 (WHERE BC IN FIRST BYTE)                    
*                 R6=FBA OF STRING2 (WHERE BC IN FIRST BYTE)                    
*                                                                               
*        CALL:    BAL,R15  COMPBS                                               
*                                                                               
*        OUTPUT:  R5,R6 CHANGED                                                 
*                 CONDITION CODES SET TO 'BNE' OR 'BE'                          
*                 R11=LBA+1 OF BYTE STRING 2                                    
*                                                                               
*        USES:    R5,R6,R8,R11                                                  
*                                                                               
*                                                                               
COMPBS   RES      0                                                             
         LB,R11   0,R6                                                          
         AW,R11   R6                                                            
COM10    LB,R8    0,R5                                                          
         CB,R8    0,R6                                                          
         BNE      *R15                                                          
         AI,R5    1                                                             
         AI,R6    1                                                             
         CW,R6    R11                                                           
         BNE      COM10                                                         
         BE       *R15                                                          
         TITLE    '       **** CONVROMX ****'                                   
*                                                                               
*        PURPOSE: TO CONVERT ROM EXPRESSION TO T:VALX/T:FWDX FORMAT AND         
*                 STORE IN B:X (ELIMINATING PADDING BYTES); TO ALLOCATE         
*                 STANDARD CONTROL SECTION,IF REFERENCED AND NOT                
*                 ALREADY ALLOCATED                                             
*                                                                               
*        INPUT:   BAP:ROM=BA OF LOAD ITEM PRECEEDING ROM EXPRESSION             
*                                                                               
*        CALL:    BAL,R13  CONVROMX                                             
*                                                                               
*        OUTPUT:  ROMBYTE=BA OF EXPRESSION END LOAD ITEM                        
*                 R5=FBA OF B:X                                                 
*                 R1=T:CSECT,IF STANDARD CONTROL SECTION ALLOCATED              
*                                                                               
*        CALLS:   ROMBYTE,ADDNXT,RDIAG,GETDECL,DWBOUND                          
*                                                                               
*                                                                               
CONVROMX EQU      %                                                             
         LI,R5    BA(B:X)                                                       
         STW,R5   CONBAP                                                        
CON10    LI,R0    1                                                             
CON15    STW,R0   CONCNT                                                        
CON20    ROMBYTE                    GET NEXT ROM BYTE                           
         LW,R5    CONBAP                                                        
         STB,R8   0,R5              STORE ROM BYTE IN B:X                       
         MTW,1    CONBAP                                                        
         MTW,-1   CONCNT                                                        
         BNEZ     CON20                                                         
         CI,R8    X'40'                                                         
         BGE      CON30             ILLEGAL EXPRESSION LOAD ITEM                
         CI,R8    X'30'                                                         
         BGE      CON10             ADDR RESOLUTION LOAD ITEM                   
         CI,R8    X'20'                                                         
         BGE      CON80             VALUE LOAD ITEM                             
         CI,R8    X'00'                                                         
         BE       CON40             PADDING BYTE                                
         CI,R8    X'01'                                                         
         BE       CON50             ADD CONSTANT LOAD ITEM                      
         CI,R8    X'02'                                                         
         BE       CON60             EXPRESSION END LOAD ITEM                    
CON30    LI,R9    LOADITEM          OUTPUT ALARM 'ILLEGAL LOAD ITEM'            
         RDIAG                      AND ABORT                                   
CON40    MTW,-1   CONBAP                                                        
         B        CON10                                                         
CON50    LI,R0    5                                                             
         B        CON15                                                         
CON60    LI,R0    BA(B:X)+120       DID B:X OVERFLOW                            
         CW,R0    CONBAP                                                        
         BL       CON70                                                         
         LI,R5    BA(B:X)               NO,EXIT                                 
         B        *R13                                                          
CON70    LI,R9    TEXOFLO               YES,OUTPUT ALARM AND ABORT              
         RDIAG                                                                  
CON80    CI,R8    X'4'              FORWARD OR DECL ARATION                     
         BAZ      CON90                                                         
         LI,R0    3                     FORWARD                                 
         B        CON15                                                         
CON90    GETDECL                        DECLARATION,GET NAME NUMBER AND         
CON95    LW,R6    CONBAP                            T:DECL ENTRY AND            
         STB,R8   0,R6                              STORE IN B:X                
         AI,R6    1                                                             
         STB,R9   0,R6                                                          
         MTW,2    CONBAP                                                        
         CW,R5    FBA:DECL              DECLARATION ZERO(STANDARD CS)           
         BNE      CON10                     NO                                  
         AW,R8    R9                        YES,HAS STANDARD CONTROL            
*                                              SECTION BEEN ALLOCATED           
         BNEZ     CON10                            YES                          
         DWBOUND                                   NO,ALLOCATE                  
         LI,R1    T:CSECT           CREATE T:CSECT ENTRY                        
         LW,R9    NBA:SECT                                                      
         OR,R9    Y:DV                                                          
         STW,R9   CONDECL                                                       
         LI,R9    0                                                             
         STW,R9   CONDECL+1                                                     
         LI,R5    BA(CONDECL)                                                   
         ADDNXT                                                                 
         LW,R5    FBA:DECL          STORE 'TB' AND 'ENTRY' IN T:DECL            
         SLS,R5   -1                ENTRY ZERO AND IN B:X                       
         STH,R9   0,R5                                                          
         LW,R8    R9                                                            
         SLS,R8   -8                                                            
         MTW,-2   CONBAP                                                        
         B        CON95                                                         
         TITLE    '       **** DCBTYPE ****'                                    
*                                                                               
*        PURPOSE: TO STORE RAD AREA IN DCB TYPE,IF DIFFERENT                    
*                                                                               
*        INPUT:   R7=WA OF DCB                                                  
*                 R8=RAD AREA IN BITS 18-23                                     
*                                                                               
*        CALL:    BAL,R15  DCBTYPE                                              
*                                                                               
*        OUTPUT:  R7,R8 UNCHANGED                                               
*                                                                               
*        CALLS:   CLOSE                                                         
*                                                                               
*        USES:    R9,R0                                                         
*                                                                               
*                                                                               
DCBTYPE  EQU      %                                                             
         LI,R9    X'3F00'                                                       
         CS,R8    1,R7              IS DCB TYPE EQUAL TO NEW TYPE               
         BE       *R15                  YES,EXIT                                
         LW,R0    0,R7                  NO                                      
         AND,R0   Y:002             IS DCB OPEN                                 
         BEZ      TYP10                 NO                                      
         STW,R7   FPT:TYP               YES,CLOSE FILE                          
         LI,R0    CLOSE                                                         
         STB,R0   FPT:TYP                                                       
         LI,R9    0                                                             
         CAL1,1   FPT:TYP                                                       
         LI,R9    X'3F00'                                                       
TYP10    STS,R8   1,R7                                                          
         B        *R15                                                          
         TITLE    '       **** EXTEND ****'                                     
*                                                                               
*        PURPOSE: TO EXTEND TABLE AREA (USED BY CCI,PASS1,AND LIB)              
*                                                                               
*        INPUT:   R1=TABLE AREA INDEX                                           
*                 R8=MINIMUM NO. OF BYTES TO EXTEND AREA BY, IF                 
*                    T:NBE ENTRY FOR TABLE AREA EQUALS ZERO                     
*                                                                               
*        CALL:    BAL,R15  EXTEND                                               
*                                                                               
*        OUTPUT:  SAVES AND RESTORES ALL REGISTERS (USES TEMP STACK)            
*                                                                               
*        CALLS:   RDIAG,RAREABC,MOVEDW,EXTEND,BOUNDRDW                          
*                                                                               
*        RETURN:  NORMAL UNLESS TABLE AREA CANNOT BE EXTENDED;                  
*                 IN WHICH CASE A DIAGNOSTIC IS OUTPUT AND                      
*                 THE LOAD ABORTED                                              
*                                                                               
*                                                                               
EXTEND   PUSH     0,15                                                          
         SETBL                     *SET BDP:SEG AND BDP:MODL TO ACTUAL          
*                                   BYTE LENGTH                                 
         LW,R0    EXTFWDS          *HAVE THE DEFAULT SIZES FOR THE              
*                                   FORWARD TABLES BEEN INCREASED               
         BNEZ     EXT5                 *YES                                     
         CI,R1    T:FWD                *NO,IS T:FWD BEING EXTENDED              
         BNE      EXT5                        *NO                               
         MTW,1    EXTFWDS                     *YES,IMPLIES ONE-PASS,            
         LI,R9    100                              INCREASE AREA BYTE           
         MW,R9    NBE:FWD                          SIZES                        
         STW,R9   BZA:FWD                                                       
         LI,R9    30*9                                                          
         STW,R9   BZA:FWDX                                                      
EXT5     MTW,0    T:NBE,R1          IS R8 SET                                   
         BEZ      EXT10                *YES                                     
         LW,R8    T:NBE,R1             *NO,GET NO-OF-BYTES-PER-ENTRY            
EXT10    BOUNDRDW                                                               
         LW,R3    R8                                                            
         CI,R1    T:SYMBOL                                                      
         BE       EXT60                 EXTEND T;SYMBOL (SPECIAL CASE)          
         CI,R1    T:VALX                                                        
         BE       EXT70                 EXTEND T:VALX (SPECIAL CASE)            
         LW,R2    R1                                                            
         RAREABC                   *GET NO.-OF-BYTES-REMAINING IN AREA          
         CW,R6    R3                AND EXTEND LBA IF NOT AT MAXIMUM            
         BGE      EXTX                                                          
         LW,R4    R6                    R4=ACCUMULATOR FOR REMAINING BC         
EXT20    AI,R2    1                *DETERMINE THE REMAINING BYTE COUNTS         
*                                   IN THE TABLE AREAS BELOW THE AREA           
*                                   TO BE EXTENDED UNTIL ENOUGH BYTES           
*                                   (ON A DW BOUNDARY) HAVE BEEN                
*                                   LOCATED                                     
         CI,R2    B:MT                                                          
         BE       EXT20                (MODULE TABLES BUFFER'S SIZE             
*                                       IS A CONSTANT)                          
         CI,R2    T:VALX                                                        
         BE       EXT65                 LAST TABLE AREA ENCOUNTERED             
         RAREABC                                                                
         SLS,R6   -4                   *WILL HALF OF THE REMAINING              
         SLS,R6   3                     BYTES (ON A DW BOUND) OF THIS           
         AW,R4    R6                    AREA ADDED TO THE SUM BE ENOUGH         
         CW,R4    R3                                                            
         BG       EXT30                *YES                                     
         SW,R4    R6                   *NO,WILL ALL OF THE REMAINING            
         RAREABC                           BYTES IN THIS AREA ADDED TO          
         AW,R4    R6                       THE SUM BE ENOUGH                    
         CW,R4    R3                                                            
         BL       EXT20                        NO,TRY NEXT AREA                 
EXT30    LW,R5    T:FBA,R2                     YES,PUSH THIS TABLE DOWN         
         AW,R6    T:FBA,R2                         WITHIN ITS AREA              
         STW,R6   T:FBA,R2                                                      
         LW,R0    T:FBA,R2             *WILL THE NEW AREA HOLD THE              
         AW,R0    T:BDP,R2              DATA IN THE TABLE                       
         CW,R0    T:LBA,R2                                                      
         BG       EXT100                   *NO,PROGRAM ERROR                    
         LW,R8    T:BDP,R2                 *YES,MOVE THE TABLE                  
EXT35    MOVEDW                                                                 
EXT38    AI,R2    -1                    MOVE THE NEXT TABLE DOWN                
         CI,R2    B:MT                                                          
         BE       EXT40                                                         
         RAREABC                                                                
         CW,R2    R1               *HAS THE REQUESTED TABLE AREA BEEN           
*                                   EXTENDED                                    
         BE       EXT50                *YES                                     
         BG       EXT30                *NO, CONTINUE                            
         BL       EXT100               *PAST TABLE AREA,PROGRAM ERROR           
EXT40    LW,R8    BDP:MTB          *MOVE MODULE TABLES BUFFER TO                
         BOUNDRDW                   (FBA OF FIRST T:MODULE TABLE) -             
         LW,R5    FBA:MTB            (BOUNDED BL OF DATA IN B:MT) SO            
         LW,R6    FBA:MTB+1         THAT B:MT OVERLAYS PART OR ALL OF           
         SW,R6    R8                THE MODULE TABLES:T:DECL,T:CSECT,           
         STW,R6   FBA:MTB           T:FWD,AND T:FWDX                            
         LW,R0    R6                                                            
         SW,R0    R5                                                            
         AWM,R0   LBA:MTB                                                       
         B        EXT35                                                         
EXT50    LW,R8    LBA:MTB          *HAS THE LENGTH OF THE MODULE TABLES         
         SW,R8    FBA:MTB+5         BUFFER BEEN CHANGED                         
         BLEZ     EXTX                 *NO                                      
*                                      *YES,B:MT NEEDS TO BE  EXTENDED          
         RESETBL                            (RESET T:MOD & T:SEG BL)            
         LI,R2    B:MT+4                   *CALCULATE REMAINING BYTES           
         RAREABC                            IN LAST TABLE OF B:MT AND           
         AW,R8    R6                        ADD TO BYTES NEEDED TO              
         LI,R1    B:MT+4                    EXTEND B:MT                         
         EXTEND                            *EXTEND B:MT BY EXTENDING THE        
         B        EXTXX                     LAST TABLE IN B:MT                  
EXT60    LW,R6    BAP:VALX          EXTEND T:SYMBOL                             
         SW,R6    LBA:SYM              *IS THERE ROOM IN T:VALX,WHICH           
         CW,R6    R3                    IS BUILT FROM THE END OF BACK-          
*                                       GROUND BACK,TO EXTEND T:SYMBOL          
         BL       EXT80                    *NO                                  
         AWM,R3   LBA:SYM                  *YES,CHANGE THE POINTERS             
         AWM,R3   FBA:VALX                                                      
         B        EXTX                                                          
EXT65    LW,R6    BAP:VALX         *DETERMINE THE NUMBER OF BYTES               
         SW,R6    FBA:VALX          REMAINING IN T:VALX (ROUNDED DOWN           
         SLS,R6   -4                TO A DW BOUNDARY)                           
         SLS,R6   3                                                             
         AW,R4    R6                   *WILL HALF OF THE REMAINING              
         CW,R4    R3                    AREA ADDED TO THE ACCUMULATED           
*                                       SUM BE ENOUGH                           
         BG       EXT68                                                         
         SW,R4    R6                        NO,WILL ALL OF THE AREA             
         LW,R6    BAP:VALX                     REMAINING BE ENOUGH              
         SW,R6    FBA:VALX                                                      
         SLS,R6   -3                                                            
         SLS,R6   3                                                             
         AW,R4    R6                                                            
         CW,R4    R3                                                            
         BL       EXT80                             NO                          
*                                                   YES                         
EXT68    AWM,R6   FBA:VALX                  YES,REDUCE T:VALX AREA              
         B        EXT38                                                         
EXT70    LW,R6    BAP:VALX          EXTEND T:VALX                               
         SW,R6    FBA:SYM              *CAN T:SYMBOL AREA BE REDUCED            
         SW,R6    BDP:SYM               ENOUGH TO EXTEND T:VALX                 
         CW,R6    R3                                                            
         BL       EXT75                                                         
         LW,R6    BAP:VALX                  YES,CHANGE THE  POINTERS            
         SW,R6    R3                            AND  EXIT                       
         STW,R6   FBA:VALX                                                      
         STW,R6   LBA:SYM                                                       
         B        EXTX                                                          
EXT75    LW,R6    BAP:VALX                  NO,DETERMINE IF T:VALX CAN          
         SW,R6    FBA:VALX                     BE EXTENDED BY PUSHING           
         LI,R2    T:VALX                       THE OTHER TABLES BACK            
         B        EXT82                                                         
EXT80    LW,R2    R1               *DETERMINE THE REMAINING  BYTE COUNTS        
         RAREABC                    IN THE TABLE AREAS ABOVE THE AREA           
*                                   TO BE EXTENDED UNTIL ENOUGH BYTES           
*                                   (ON A DW BOUNDARY) HAVE BEEN                
*                                   LOCATED                                     
EXT82    LW,R4    R6                                                            
EXT85    AI,R2    -1                                                            
         CI,R2    B:MT                                                          
         BE       EXT85                 (B:MT HAS A CONSTANT SIZE)              
         CI,R2    T:PUBSYM                                                      
         BNE      EXT87                                                         
         LI,R9    TABOFLO              *TABLE CANNOT BE EXTENDED                
         RDIAG                      OUTPUT ALARM AND ABORT                      
EXT87    RAREABC                                                                
         SLS,R6   -4                   *WILL HALF OF THE REMAINING              
         SLS,R6   3                     BYTES OF THIS AREA ADDED TO             
         AW,R4    R6                    THE SUM BE ENOUGH                       
         CW,R4    R3                                                            
         BG       EXT90                    *YES                                 
         SW,R4    R6                       *NO                                  
         RAREABC                       *WILL ALL OF THE REMAINING BYTES         
         AW,R4    R6                    OF THIS AREA ADDED TO THE SUM           
         CW,R4    R3                    BE ENOUGH                               
         BL       EXT85                     NO                                  
EXT90    LCW,R6   R6                        YES,REDUCE THE TABLE AREA           
         AW,R6    T:LBA,R2                      SIZE                            
         STW,R6   T:LBA,R2                                                      
         LW,R0    T:FBA,R2             *WILL THE NEW AREA HOLD THE              
         AW,R0    T:BDP,R2              DATA IN THE TABLE                       
         CW,R0    T:LBA,R2                                                      
         BG       EXT100                    NO,PROGRAM ERROR                    
EXT92    AI,R2    1                                                             
         LW,R5    T:FBA,R2              MOVE THE NEXT TABLE AREA BACK           
         STW,R6   T:FBA,R2                                                      
         CI,R2    T:VALX                LAST TABLE ENCOUNTERED                  
         BNE      EXT94                                                         
         CI,R1    T:VALX                    YES,WAS T:VALX EXTENDED             
         BNE      EXT100                           *NO,PROGRAM ERROR            
         BE       EXTX                             *YES,EXIT                    
EXT94    LW,R8    T:BDP,R2                  NO,MOVE DATA IN TABLE BACK          
         MOVEDW                                                                 
         CW,R2    R1                HAS TABLE AREA BEEN EXTENDED                
         BE       EXTX                 *YES,EXIT                                
         CI,R2    B:MT                 *NO,CONTINUE                             
         BNE      EXT95                                                         
         SW,R6    R5               *MOVE MODULE TABLES BUFFER POINTERS          
         AWM,R6   LBA:MTB                                                       
         LW,R6    FBA:MTB                                                       
         AW,R6    BDP:MTB                                                       
         B        EXT92                                                         
EXT95    RAREABC                   *DETERMINE THE NUMBER OF BYTES THAT          
         B        EXT90             THE TABLE AREA WAS REDUCED BY               
EXT100   LI,R9    PROGERR          *PROGRAM ERROR,OUTPUT ALARM AND              
         RDIAG                                     ABORT                        
EXTX     RESETBL                    RESET BDP:SEG,BDP:MODL,IF CHANGED           
EXTXX    PULL     0,15                                                          
         B        *R15                                                          
         TITLE    '       **** RAREABC ****'                                    
*                                                                               
*        PURPOSE: TO CALCULATE THE NUMBER OF BYTES REMAINING IN A               
*                 DYNAMIC TABLE (EXCEPT B:MT OR T:VALX) AND TO RESET            
*                 THE LBA+1 OF THE AREA IF IT DOES NOT EQUAL THE FBA            
*                 OF THE NEXT TABLE AREA                                        
*                                                                               
*        INPUT:   R2=TABLE AREA INDEX                                           
*                                                                               
*        CALL:    BAL,R15  RAREABC                                              
*                                                                               
*        OUTPUT:  R2=UNCHANGED                                                  
*                 R6=NO. OF BYTES REMAINING IN THE AREA                         
*                    (ROUNDED DOWN ON A DW BOUNDARY)                            
*                                                                               
RAREABC  CI,R2    B:MT                                                          
         BE       RBC20                                                         
         CI,R2    T:VALX                                                        
         BE       RBC20                                                         
         LW,R6    T:FBA+1,R2                                                    
         STW,R6   T:LBA,R2                                                      
RBC10    SW,R6    T:FBA,R2                                                      
         SW,R6    T:BDP,R2                                                      
         SLS,R6   -3                                                            
         SLS,R6   3                                                             
         B        *R15                                                          
RBC20    LI,R9    PROGERR           PROGRAM ERROR, OUTPUT ALARM AND             
         RDIAG                                     ABORT                        
         B        %                                                             
         TITLE    '       **** MOVEDW ****'                                     
*                                                                               
*        PURPOSE: TO MOVE DATA ON DOUBLEWORD BOUNDARIES FROM ONE                
*                 AREA OF CORE TO ANOTHER                                       
*                                                                               
*        INPUT:   R5=FBA OF OLD AREA (ON A DOUBLEWORD BOUNDARY)                 
*                 R6=FBA OF NEW AREA (ON A DOUBLEWORD BOUNDARY)                 
*                 R8=NUMBER OF BYTES TO MOVE (NOT NECESSARILY A  DW)            
*                                                                               
*        CALL:    BAL,R14  MOVEDW                                               
*                                                                               
*        OUTPUT:  R5,R6 UNCHANGED                                               
*                 R8=CHANGED                                                    
*                                                                               
*        CALLS:   BOUNDRDW                                                      
*                                                                               
*        USES:    R5,R6,R8,R10,R11                                              
*                                                                               
*                                                                               
MOVEDW   PUSH     5,6                                                           
         CI,R8    0                                                             
         BLE      MDW40                                                         
         BOUNDRDW                   BOUND NO.-OF-BYTES TO DW COUNT              
         SLS,R8   -3                                                            
         SLS,R5   -3                                                            
         SLS,R6   -3                                                            
         CW,R5    R6                OLD:NEW                                     
         BE       MDW40                                                         
         BL       MDW20                                                         
MDW10    LD,R10   0,R5                  OLD>NEW,MOVE FIRST DW FIRST             
         STD,R10  0,R6                                                          
         AI,R5    1                                                             
         AI,R6    1                                                             
         BDR,R8   MDW10                                                         
         B        MDW40                                                         
MDW20    AW,R5    R8                    OLD<NEW,MOVE LAST DW FIRST              
         AW,R6    R8                                                            
MDW30    AI,R5    -1                                                            
         AI,R6    -1                                                            
         LD,R10   0,R5                                                          
         STD,R10  0,R6                                                          
         BDR,R8   MDW30                                                         
MDW40    PULL     5,6                                                           
         B        *R14                                                          
         TITLE    '       **** SETBL ****'                                      
*                                                                               
*        PURPOSE: TO SET BDP:SEG AND BDP:MODL SO THAT THESE POINTERS            
*                 EQUAL THE BYTE LENGTHS OF THE DATA IN THESE TABLES            
*                 BEFORE EXTENDING ANY TABLE AREAS                              
*                                                                               
*        INPUT:   R1=AREA INDEX OF TABLE BEING EXTENDED                         
*                                                                               
*        CALL:    BAL,R15  SETBL                                                
*                                                                               
*        OUTPUT:  R1=UNCHANGED                                                  
*                 BDP:SEG,BDP:MODL SET TO BL OF TABLES                          
*                                                                               
*                                                                               
SETBL    LW,R9    NBE:SEG                                                       
         LW,R10   NBE:MODL                                                      
         B        RES10                                                         
         TITLE    '      **** RESETBL ****'                                     
*                                                                               
*        PURPOSE: TO RESET BDP:SEG AND BDP:MODL TO THEIR ORIGINAL               
*                 VALUES AFTER EXTENDING A TABLE AREA                           
*                                                                               
*        INPUT:   R1=AREA INDEX OF EXTENDED TABLE                               
*                                                                               
*        CALL:    BAL,R15  RESETBL                                              
*                                                                               
*        OUTPUT:  R1=UNCHANGED                                                  
*                 BDP:SEG,BDP:MODL RESET TO ORIGINAL VALUES                     
*                                                                               
*                                                                               
RESETBL  LCW,R9   NBE:SEG                                                       
         LCW,R10  NBE:MODL                                                      
RES10    CI,R1    T:SEG                                                         
         BE       *R15                                                          
         AWM,R9   BDP:SEG                                                       
         CI,R1    T:MODIFY                                                      
         BE       *R15                                                          
         CI,R1    T:MODULE                                                      
         BE       *R15                                                          
         AWM,R10  BDP:MODL                                                      
         B        *R15                                                          
         TITLE    '       **** GETDECL ****'                                    
*                                                                               
*        PURPOSE: TO GET T:DECL ENTRY,GIVEN ONE OR TWO BYTE NAME NO.,           
*                 FROM ROM LOAD ITEM                                            
*                                                                               
*        INPUT:   V:DECLNO=NO. OF DECLARATIONS ENCOUNTERED IN ROM               
*                 BAP:ROM= BA OF LOAD ITEM (BA-1 OF NAME NUMBER)                
*                                                                               
*        CALL:    BAL,R14 GETDECL                                               
*                                                                               
*        OUTPUT:  BAP:ROM=BA-1 OF NEXT LOAD ITEM                                
*                 R5=BA OF T:DECL ENTRY                                         
*                 R8=1ST BYTE OF T:DECL ENTRY                                   
*                 R9=2ND BYTE OF T:DECL ENTRY                                   
*                                                                               
*        CALLS:   ROMBYTE                                                       
*                                                                               
*                                                                               
GETDECL  EQU      %                                                             
         ROMBYTE                    GET FIRST BYTE OF NAME NUMBER               
         LW,R0    V:DECLNO          IS NAME NO. IN ONE OR TWO BYTES             
         CI,R0    256                                                           
         BL       DECL10                ONE                                     
         SLS,R8   8                     TWO,SAVE BYTE ONE AND GET BYTE          
         STW,R8   DECLBYTE                  TWO                                 
         ROMBYTE                                                                
         OR,R8    DECLBYTE                                                      
DECL10   LW,R5    R8                CALCULATE BA OF T:DECL ENTRY                
         MW,R5    NBE:DECL                                                      
         AW,R5    FBA:DECL                                                      
         LB,R8    0,R5              1ST BYTE OF T:DECL ENTRY                    
         AI,R5    1                                                             
         LB,R9    0,R5              2ND BYTE OF T:DECL ENTRY                    
         AI,R5    -1                                                            
         B        *R14                                                          
         TITLE '  ** LOADERR **           ** ROMERR **'                         
*                                                                               
*        PURPOSE: TO SET LOAD ERROR/ROM ERROR FLAG IN CURRENT                   
*                 T:SEG ENTRY                                                   
*                                                                               
*        INPUT:   BDP:SEG=BD OF CURRENT T:SEG ENTRY                             
*                                                                               
*        CALL:    BAL,R15  LOADERR/ROMERR                                       
*                                                                               
*        OUTPUT:  FL:ERROR=FL:ERROR+1                                           
*                                                                               
*                                                                               
LOADERR  LW,R9    Y:4               SET BIT 1                                   
         B        RME10                                                         
ROMERR   LW,R9    Y:8               SET BIT 0                                   
RME10    LW,R5    FBA:SEG           CALCULATE WORD ADDR OF ENTRY                
         AW,R5    BDP:SEG                                                       
         SLS,R5   -2                                                            
         STS,R9   7,R5                                                          
         MTW,1    FL:ERROR                                                      
         B        *R15                                                          
         TITLE    ' ** NXTROM ** '                                              
*                                                                               
*        CALL:    BAL,R15  NXTROM                                               
*                                                                               
*        PURPOSE: SET UP TO READ NEXT OBJECT MODULE                             
*                                                                               
*        INPUT:   BDP:MODL SET FOR CORRECT T:MODULE ENTRY                       
*                 R8= EOD PROCESSOR ADDRESS FOR ROMBYTE ROUTINE                 
*                                                                               
*        USES:    R0, R5-R10, DCBTYPE                                           
*                                                                               
NXTROM   RES      0                                                             
         PUSH     15                                                            
         STW,R8   PT:ROM2+1         SET EOD ERROR ROUTINE                       
         LI,R0    EOD                                                           
         STB,R0   PT:ROM2+1         SET EOD ERROR CODE                          
         LW,R5    FBA:MODL          START OF T:MODULE                           
         AW,R5    BDP:MODL          PLUS INDEX IS CURRENT ENTRY ADDR            
         SLS,R5   -2                CHANGE TO WORD ADDRESS                      
         LW,R5    0,R5              GET WORD 0 OF ENTRY                         
         CI,R5    X'30000'                                                      
         BAZ      NXR10             B IF NOT LIBRARY LOAD                       
         LH,R8    R5                                                            
         AND,R8   X:3               GET LIBRARY TYPE                            
         AI,R8    -1                CONVERT TO LIBRARY AREA INDEX               
         SLS,R8   8                                                             
         LI,R7    F:MODULE                                                      
         DCBTYPE                    PUT AREA INDEX IN F:MODULE                  
         LI,R9    0                                                             
         CAL1,1   FPT:ROM6          REWIND LIBRARY MODULE FILE                  
         LI,R7    1                                                             
         STH,R5   FPT:ROM7+2,R7     SET POSITION-RECORD COUNT                   
         CAL1,1   FPT:ROM7          POSITION TO CORRECT ROM IN LIBRARY          
         LI,R7    F:MODULE          PICK UP DCB NAME                            
         B        NXR30                                                         
*                                                                               
NXR10    RES      0                                                             
         LH,R7    R5                                                            
         SLS,R7   -3                                                            
         AND,R7   X:FFF             GET T:DCBV INDEX FOR ROM SOURCE             
         BEZ      NXR40             B IF SAME AS PREVIOUSLY                     
         AI,R7    -1                CHANGE INDEX BASE TO ZERO                   
         CW,R5    Y:8                                                           
         BAZ      NXR20             B IF SOURCE IS IN T:DCBF                    
         MW,R7    NBE:DCBV                                                      
         AW,R7    FBA:DCBV                                                      
         SLS,R7   -2                WORD ADDRESS OF T:DCBV ENTRY                
         LI,R6    5                                                             
         LW,R0    *R7,R6                                                        
         STW,R0   GIOCT,R6          MOVE ENTRY INTO BUFFER FOR CALS             
         BDR,R6   %-2                                                           
         LW,R6    0,R7              GET IO ID FLAG BITS                         
         LW,R7    GIOBITS                                                       
         STS,R6   FPT:ASN+1         SET FLAGS AS ASSIGN CAL P-BITS              
         STW,R6   GIOCT             SAVE FLAGS                                  
         SLS,R6   1                                                             
         LW,R7    Y:8                                                           
         STS,R6   FPT:ASN+3         SET INDIRECT BIT ON POINTER                 
*                                   TO IO MEDIUM NAME IF IT IS AN               
*                                   OPLABEL NAME                                
         LI,R7    F:DEVICE                                                      
         LI,R9    PT:CLS                                                        
         CAL1,1   FPT:CLS           CLOSE F:DEVICE                              
         LI,R9    0                                                             
         CAL1,1   FPT:ASN           ASSIGN F:DEVICE TO ROM INPUT MEDIUM         
         LW,R0    F:DEVICE                                                      
         AND,R0   X:3               GET ASN FIELD                               
         CI,R0    3                                                             
         BE       %+3               B IF ASSIGNED TO DEV OR OPLB                
         CAL1,1   FPT:REW           REWIND ROM FILE                             
         B        NXR30                                                         
*                                                                               
         LW,R0    NXR110                                                        
         LW,R6    FBA:MODL                                                      
         AW,R6    BDP:MODL                                                      
         SLS,R6   -2                WORD ADDRESS OF T:MODULE ENTRY              
         STW,R0   0,R6              CHANGE TO POINT TO M:X1,                    
*                                   FOR PASS2 USE, SINCE DEVICE AND             
*                                   OPLABEL INPUT IS COPIED TO X1               
*                                   FILE                                        
         CAL1,1   FPT:GASN          GET ASSIGNMENT OF F:DEVICE                  
         LH,R0    B:DEVNM                                                       
         AND,R0   X:FFFF            GET FIRST TWO BYTES OF NAME                 
         CI,R0    '7T'                                                          
         BE       %+3               B IF 7-TRACK TAPE                           
         CI,R5    X'4000'                                                       
         BAZ      NXR30             B IF PACK OPTION NOT REQUESTED              
         CAL1,1   FPT:PACK          SET F:DEVICE TO BIN AND PACK                
         B        NXR30                                                         
*                                                                               
NXR20    RES      0                                                             
         MI,R7    DCBSIZE                                                       
         AI,R7    T:DCBF            WORD ADDR OF ROM DCB IN T:DCBF              
*                                                                               
NXR30    RES      0                                                             
         LI,R0    READ                                                          
         STB,R0   R7                                                            
         STW,R7   FPT:ROM1          SET ROM-READ FPT                            
         LI,R9    PT:OPEN                                                       
         CAL1,1   FPT:OPEN          INSURE THAT ROM DCB IS OPEN                 
*                                                                               
NXR40    RES      0                                                             
         LI,R0    -1                                                            
         STW,R0   V:ROMRNO          INITIALIZE ROM RECORD NUMBER                
         STW,R0   BAP:ROM           INITIALIZE ROM RECORD BYTE INDEX            
         PULL     15                                                            
         B        *R15                                                          
*                                                                               
NXR110   DATA     5**19             T:MODULE ENTRY WORD ZERO FOR                
*                                   MODULES COPIED TO X1.BT FILE                
         TITLE    '       **** NXTSEG ****'                                     
*                                                                               
*        PURPOSE: TO BUILD THE NEXT SEGMENT'S ENTRY IN T:SEG AND                
*                 INITIALIZE FLAGS                                              
*                                                                               
*        INPUT:   NBA:SECT=FBA OF ROOT EXLOC,IF V:SEGID=0                       
*                 V:SEGID=IDENT OF THE SEGMENT                                  
*                                                                               
*        CALL:    BAL,R13 NXTSEG                                                
*                                                                               
*        OUTPUT:  FL:LBLD=0                                                     
*                 FL:LIB=X,Y,X,Y                                                
*                 R1=CHANGED                                                    
*                                   R5=WA OF T:SEG ENTRY INITIALIZED            
*                 V:LINKID=0                                                    
*                 FL:LBPAS=0                                                    
*                 ADDS F4:COM,P:END,FP:MBOX TO ROOT'S SYMBOL/VALUE TABS         
*                                                                               
*        CALLS:   ZERONXT,ADDNXT                                                
*                                                                               
*                                                                               
NXTSEG   EQU      %                                                             
         MTW,1    V:NUSG            INCREMENT NR OF USER SEGS                   
         LW,R0    FL:LIB                                                        
         STH,R0   FL:LIB                                                        
         LI,R0    0                                                             
         STW,R0   FL:LBLD                                                       
         STW,R0   FL:LBPAS                                                      
         STW,R0   V:LINKID                                                      
         LI,R1    T:SEG             ZERO NEXT T:SEG ENTRY                       
         ZERONXT                                                                
         SLS,R5   RIGHT*2                                                       
         LI,R9    0                                                             
         MTW,0    V:SEGID                                                       
         BEZ      NXT10             BRANCH IF NOT :SEG SEGMENT                  
         MTW,0    FL:PUBL                                                       
         BNEZ     NXT20             BRANCH IF PUBLIB CONTEXT                    
         STS,R9   S:FLAGS,R5        TASK SEGMENT:                               
         B        *R13              RETURN                                      
NXT10    MTW,0    FL:PUBL                                                       
         BEZ      NXT20             BRANCH IF NOT PUBLIB ROOT                   
         LI,R8    1                 MEMORY ACCESS: READ AND EXECUTE             
         SCS,R8   S:MSHIFT-S:SSHIFT                                             
         AI,R8    2                 SHARABILITY:  SYSTEM                        
         SCS,R8   S:SSHIFT                                                      
         OR,R9    R8                                                            
NXT20    OR,R9    S:IMSK            INITIAL LOAD                                
         STW,R9   S:FLAGS,R5                                                    
         LW,R9    NBA:SECT                                                      
         SLS,R9   RIGHT*3           BA TO DA                                    
         LI,R6    S:MA                                                          
         STH,R9   *R5,R6            DEFAULT SEG FWA:  CURRENT LOAD LOC          
         MTW,0    BDP:SEG                                                       
         BNEZ     *R13              RETURN IF NOT ROOT                          
         MTW,0    FL:PUBL                                                       
         BNEZ     *R13              RETURN IF PUBLIB ROOT                       
         LI,R1    T:SYMBOL                  *ADD F4:COM,P:END, AND              
         LI,R5    BA(COMMON)                 FP:MBOX TO ROOT'S SYMBOL           
         ADDNXT                              TABLES                             
         LI,R5    BA(COMCONT)                                                   
         ADDNXT                                                                 
         LI,R5    BA(PEND)                                                      
         ADDNXT                                                                 
         LI,R5    BA(UPCB)                                                      
         ADDNXT                                                                 
         LI,R1    T:VALUE                                                       
         LI,R4    0                                                             
         LI,R3    DSECT+UNDEFINE+NOTDUP+ROM                                     
         LI,R5    BA(R3)+3                                                      
         ADDNXT                                                                 
         LI,R3    DEF+UNDEFINE+NOTDUP+ROM                                       
         ADDNXT                                                                 
         LI,R3    DEF+DEFINED+VALUE+ADDRESS+ROM+NOTDUP                          
         LW,R4    NBA:SECT                                                      
         ADDNXT                                                                 
         LW,R0    FL:BACK                                                       
         BGZ      NXT50                                                         
         LW,R4    K:FMBOX                                                       
         BEZ      NXT50                                                         
         SLS,R4   2                                 (CONVERT TO BA)             
         LI,R3    DEF+DEFINED+VALUE+ADDRESS+ROM+NOTDUP                          
         ADDNXT                                                                 
         LI,R1    T:SYMBOL                                                      
         LI,R5    BA(FPMBOX)                                                    
         ADDNXT                                                                 
NXT50    LW,R5    FBA:SEG                                                       
         SLS,R5   RIGHT*2           T:SEG ENTRY BA IN R5                        
         B        *R13                                                          
*                                                                               
COMMON   DATA,1   7                 T:SYMBOL 'COMMON' DEF                       
         DATA,6   'F4:COM'                                                      
COMCONT  DATA,1   X'84',0,0,0                                                   
PEND     DATA,1   6                 T:SYMBOL 'END OF PROGRAM' DEF               
         DATA,5   'P:END'                                                       
UPCB     DATA,1   6                 SYMBOLIC ADDR FOR 1ST WD OF PCB             
         DATA,5   'U:PCB'                                                       
FPMBOX   DATA,1   8                 T:SYMBOL 'FP MAILBOX' DEF                   
         DATA,7   'FP:MBOX'                                                     
         BOUND    4                                                             
         TITLE    '       **** PATHEND ****'                                    
*                                                                               
*        PURPOSE: AT PATHEND (WHEN THE NEXT SEGMENT IS IN A DIFFERENT           
*                 PATH OR THE LAST SEGMENT HAS BEEN LOADED), WRITE OUT          
*                 T:SYMBOL,T:VALUE SUBTABLES FOR ANY SEGMENT(S) THAT            
*                 WILL BE OVERLAYED BY THE NEXT SEGMENT. SEARCH FOR ANY         
*                 DEF'S THAT ARE DEFINED WITH EXPRESSIONS (IN SEGMENT           
*                 TO BE OUTPUT) AND SATISFY CORRESPONDING REF'S.                
*                                                                               
*        INPUT:   V:LINKID=IDENT OF THE NEXT SEGMENT'S LINK,OR                  
*                         =-1,AT PROGRAM END                                    
*                 BDP:SEG=BYTE DISPLACEMENT OF NEXT SEGMENT                     
*                                                                               
*        CALL:    BAL,R12 PATHEND                                               
*                                                                               
*        OUTPUT:  NBA:SECT,BDP:SYM,BDP:VALU RESET                               
*                                                                               
*        CALLS:   SERCHVAL,SATREF,WRITEXN,BOUNDCS,RDIAG                         
*                                                                               
*                                                                               
PATHEND  STW,R12  PATX                                                          
         LW,R0    FBA:SEG                                                       
         AW,R0    BDP:SEG                                                       
         STW,R0   PATSEG                                                        
PAT10    LW,R5    PATSEG            CALCULATE FBA OF PREVIOUS T:SEG ENTR        
         SW,R5    NBE:SEG                                                       
         STW,R5   PATSEG                                                        
         CW,R5    FBA:SEG           PAST TABLE BEGINNING                        
         BGE      PAT20                 NO                                      
         LW,R0    V:LINKID              YES,PROGRAM END FLAG                    
         CI,R0    -1                                                            
         BE       *PATX                        YES,EXIT                         
         LI,R9    PROGERR                      NO,PROGRAM ERROR                 
         RDIAG                                                                  
PAT20    SLS,R5   -1                CONVERT BA TO HA                            
         STW,R5   PATSEGHA                                                      
         LH,R8    3,R5                  FBD OF SEGMENT'S T:VALUE TABLE          
         AND,R8   X:FFFF                                                        
         STW,R8   PATFBDV                                                       
         LH,R9    4,R5                  FBD OF SEGMENT'S T:SYMBOL TABLE         
         AND,R9   X:FFFF                                                        
         LH,R10   0,R5                  SEGMENT IDENT                           
         AND,R10  X:FFFF                                                        
         LH,R11   6,R5                  FDA OF CORE IMAGE                       
         AND,R11  X:FFFF                                                        
         CI,R10   ROOT1ID                                                       
         BNE      %+2               BRANCH IF NOT ROOT1 SEG NR                  
         LI,R10   0                 USE EXTERNAL ROOT1 SEG NR                   
         AI,R5    1                                                             
         AH,R8    3,R5                  BYTE LENGTH OF SEGMENT'S T:VALUE        
         AND,R8   X:FFFF                                                        
         AH,R9    4,R5                  BYTE LENGTH OF SEGMENT'S T:SYMBO        
         AND,R9   X:FFFF                                                        
         LH,R0    6,R5                                                          
         AND,R0   X:FFFF                                                        
         AW,R11   R0                                                            
         STW,R8   BDP:VALU                                                      
         STW,R9   BDP:SYM                                                       
         CW,R10   V:LINKID          DOES THE NEXT SEGMENT LINK ONTO             
*                                   THIS SEGMENT                                
         BNE      PAT25                                                         
         LW,R5    FBA:SEG               YES,STORE THE NEW STARTING              
         AW,R5    BDP:SEG                   T:VALUE AND T:SYMBOL BYTE           
         SLS,R5   -1                        DISPLACEMENTS IN THE NEXT           
         STH,R8   3,R5                      SEGMENT'S T:SEG ENTRY AND           
         STH,R9   4,R5                                                          
         SLS,R11  3                        *CALCULATE BA OF NEXT SEGMENT        
         DO       #MAP                                                          
         LW,R8    R11                                                           
         LW,R11   FL:PRIM                                                       
         CI,R11   1                                                             
         BAZ      %+4               B IF NOT SECONDARY                          
         LW,R11   FL:SMM                                                        
         BNEZ     %+2               B IF SMM                                    
         BOUNDRP                    PAGE-BOUND THE ADDRESS                      
         STW,R8   NBA:SECT                                                      
         ELSE     #MAP                                                          
         STW,R11  NBA:SECT                                                      
         FIN      #MAP                                                          
         BOUNDCS                             (DOES NOT USE R5)                  
         LW,R11   NBA:SECT                                                      
         SLS,R11  -3                                                            
         STH,R11  6,R5                                                          
         CI,R11   X'1FFFF'                                                      
         BLE      PAT24                                                         
         LI,R9    PLENGTH                                                       
         RDIAG                                                                  
PAT24    B        *PATX                                                         
PAT25    SLS,R5   -1                    NO,HAS THIS SEGMENT'S TABLES            
         LW,R7    Y:2                      ALREADY BEEN OUTPUT                  
         CS,R7    7,R5                                                          
         BE       PAT10                        YES                              
         CI,R10   0                            NO,OUTPUT SEGMENT'S TABLS        
         BE       PAT40             ROOT SEGMENT (DOES NOT HAVE ANY             
         LI,R6    0                 BACKWARD REF'S)                             
         B        PAT35                                                         
PAT30    LI,R6    1                          SEARCH FOR DEF'S WITH              
PAT35    LI,R10   DEF+DEFINED+EXP+NOTDUP     UNRESOLVED EXPRESSIONS             
         LI,R11   TY+D+V+F                                                      
         SERCHVAL                                                               
         CI,R6    0                                                             
         BE       PAT40             END OF TABLE                                
         LW,R11   R9                CALCULATE BDP OF DEF IN T:VALUE             
         AI,R11   -1                                                            
         MW,R11   NBE:VALU                                                      
         CW,R11   PATFBDV           IS DEF IN SEGMENT BEING OUTPUT              
         BL       PAT30                 NO,CONTINUE SEARCH                      
         SATREF                     SATISFY ALL (BACKWARD) REF'S THAT           
         B        PAT30             CORRESPOND TO DEF                           
PAT40    LW,R5    PATSEGHA                                                      
         LH,R6    3,R5              CALCULATE FBA OF SEGMENT'S T:VALUE          
         AND,R6   X:FFFF                                                        
         AW,R6    FBA:VALU          TABLE                                       
         AI,R5    1                                                             
         LH,R9    3,R5              BYTE LENGTH                                 
         AND,R9   X:FFFF                                                        
         LI,R5    M:X4              WA OF DCB                                   
         WRITEXN                    WRITE SEGMENT'S T:VALUE TABLE ON X5         
         LW,R5    PATSEGHA                                                      
         STH,R12  1,R5              SAVE GRANULE NO. IN T:SEG                   
         LH,R6    4,R5              CALCULATE FBA OF SEGMENT'S T:SYMBOL         
         AND,R6   X:FFFF                                                        
         AW,R6    FBA:SYM                                                       
         AI,R5    1                                                             
         LH,R9    4,R5              BYTE LENGTH                                 
         AND,R9   X:FFFF                                                        
         LI,R5    M:X5              WA OF DCB                                   
         WRITEXN                    WRITE SEGMENT'S T:SYMBOL TABLE ON X5        
         LW,R5    PATSEGHA                                                      
         STH,R12  2,R5              SAVE GRANULE NO. IN T:SEG                   
         SLS,R5   -1         *SET SEGMENT'S-TABLES-HAVE-BEEN-OUTPUT FLAG        
         LW,R7    Y:2                                                           
         STS,R7   7,R5                                                          
         B        PAT10                                                         
         TITLE    '      **** PUBMEM ****'                                      
*                                                                               
*        PURPOSE: TO ABORT A LOAD OPERATION WHICH WOULD RESULT                  
*                 IN MEMORY ALLOCATION CONFLICTS INVOLVING THE                  
*                 PUBLIBS REQUESTED FOR THE LOAD.                               
*                                                                               
*        INPUT:   (R8)=FWA OF THE REGION TO BE CHECKED FOR                      
*                      CONFLICTS WITH PUBLIB ALLOCATION                         
*                 (R9)=LWA OF REGION TO BE CHECKED                              
*                 (R10)=RETURN ADDRESS                                          
*                                                                               
*        OUTPUT:  RETURN WITH NO CHANGES IF NO CONFLICTS.                       
*                 BRANCH TO RABORT IF A CONFLICT IS DISCOVERED.                 
*                                                                               
PUBMEM   RES      0                                                             
         PUSH     4,7                                                           
         LI,R5    0                 T:PL DISPLACEMENT                           
PL10     CW,R5    WDP:PL                                                        
         BGE      PL100             BRANCH IF NO MORE PUBLIBS                   
         LI,R4    0                 FLAG:  CHECKING CODE SEG                    
         LW,R6    T:PL+PLPLWO,R5    PUBLIB CODE WORD ORIGIN                     
         LW,R7    T:PL+PLPLML,R5    PUBLIB CODE MEM BL                          
PL20     AND,R6   X:7FFFF                                                       
         AND,R7   X:7FFFF                                                       
         SLS,R7   RIGHT*2           BL TO WL                                    
         AW,R7    R6                                                            
         AI,R7    -1                LWA                                         
         CLM,R8   R6                                                            
         BCR,9    PL50              BRANCH IF REGION STARTS IN PUBLIB           
         CLM,R9   R6                                                            
         BCR,9    PL50              BRANCH IF REGION ENDS IN PUBLIB             
         CLM,R6   R8                                                            
         BCR,9    PL50              BRANCH IF REGION CONTAINS PUBLIB            
         CI,R4    0                                                             
         BNE      PL30              BRANCH IF CONTEXT WAS CHECKED               
         LI,R4    -1                FLAG: CHECKING CONTEXT SEG                  
         LW,R6    T:PL+PLCXWO,R5    PUBLIB CONTEXT WORD ORIGIN                  
         LW,R7    T:PL+PLCXML,R5    PUBLIB CONTEXT MEM BL                       
         B        PL20                                                          
*                                                                               
PL30     AI,R5    PLESIZE           POINT TO NEXT T:PL ENTRY                    
         B        PL10                                                          
*                                                                               
PL50     PULL     4,7               MEMORY CONFLICT                             
         LI,R9    PUBMEMER                                                      
         RDIAG                      OUTPUT DIAGNOSTIC MESSAGE                   
         RABORT                     ABORT THE LOAD                              
*                                                                               
PL100    PULL     4,7               NORMAL EXIT                                 
         B        *R10                                                          
*                                                                               
         TITLE    '       **** RAX ****'                                        
*                                                                               
*        PURPOSE: RESOLVE ALL POSSIBLE EXPRESSIONS IN T:VALX AND T:FWDX.        
*                 SEARCH T:VALUE TO RESOLVE ALL DEF'S AND REF'S WITH            
*                 EXPRESSIONS IN T:VALX;AND IF PASSONE,SATISFY ALL REF'S        
*                 THAT CORRESPOND TO A SATISFIED DEF. SEARCH T:DCB TO           
*                 RESOLVE ALL DEF'S WITH EXPRESSIONS IN T:VALX. SEARCH          
*                 T:FWD TO RESOLVE ALL EXPRESSIONS IN T:FWDX. IF ALL            
*                 EXPRESSIONS RESOLVED IN T:VALX/T:FWDX RESET BAP/BDP.          
*                                                                               
*        INPUT:   V:COLAY=SEG:PAS1 OR SEG:PAS2                                  
*                                                                               
*        CALL:    BAL,R12  RAX                                                  
*                                                                               
*        OUTPUT:  R10=NO. OF EXPRESSIONS UNRESOLVED IN T:VALX                   
*                 R11=NO. OF EXPRESSIONS UNRESOLVED IN T:FWDX                   
*                                                                               
*        CALLS:   SERCHVAL,SATREF,SOLVEX,4BYTES,STORCBV,RDIAG                   
*                                                                               
*                                                                               
RAX      EQU      %                                                             
RAX10    LI,R6    0                                                             
         STW,R6   RAXVALX           HW0=NO.RESOLVED; HW1=NO. UNRESOLVED         
         STW,R6   RAXFWDX                                                       
         B        RAX25                                                         
RAX20    LI,R6    1                 CONTINUE T:VALUE SEARCH                     
RAX25    LI,R10   DEFINED+EXP+NOTDUP    SEARCH FOR UNRESOLVED EXP.              
         LI,R11   D+V+F                                                         
         SERCHVAL                                                               
         CI,R6    0                 FINISHED SEARCH                             
         BE       RAX30                 YES                                     
         LB,R0    0,R6                  NO,IS TYPE A DSECT                      
         AND,R0   X:TY                                                          
         CI,R0    DSECT                                                         
         BE       RAX20                        YES,IGNORE                       
         STW,R6   RAX1              FBA OF T:VALUE ENTRY                        
         STW,R9   RAX2              T:VALUE ENTRY NO.                           
         LW,R5    RAX1                                                          
         4BYTES                     R8=ADDR OF EXPRESSION                       
         LW,R5    R8                                                            
         SOLVEX                     RESOLVE EXPRESSION                          
         MTH,1    RAXVALX,R6            R6=0,RESOLVED                           
*                                         =1,NOT RESOLVED                       
         CI,R6    1                 WAS THE EXPRESSION RESOLVED                 
         BE       RAX20                 NO,CONTINUE SEARCH                      
         LW,R5    RAX1                  YES,STORE RESULTS IN T:VALUE            
         STORCBV                            ENTRY                               
         LW,R0    V:COLAY           PASSONE                                     
         CI,R0    SEG:PAS1                                                      
         BNE      RAX20                 NO                                      
         LW,R6    RAX1                  YES,IS T:VALUE ENTRY A DEF              
         LB,R0    0,R6                                                          
         AND,R0   X:TY                                                          
         CI,R0    DEF                                                           
         BNE      RAX20                         NO,CONTINUE SEARCH              
         LW,R9    RAX2                          YES,SATISFY REF'S THAT          
         SATREF                                    CORRESPOND TO DEF            
         B        RAX20                                                         
RAX30    LW,R5    FBA:DCB          *SEARCH T:DCB FOR DEF WITH                   
         LW,R6    FBA:DCB           UNRESOLVED EXPRESSION                       
         AW,R6    BDP:DCB                                                       
         STW,R6   RAX2                  LBA+1 OF T:DCB                          
RAX32    STW,R5   RAX1                                                          
         CW,R5    RAX2                                                          
         BGE      RAX39                 END OF SEARCH                           
         LB,R0    0,R5                                                          
         AND,R0   X:TYDV               *IS THE DCB A DEFINED DEF WITH           
         CI,R0    DEF+DEFINED+EXP       A EXPRESSION                            
         BNE      RAX35                    *NO                                  
         SLS,R5   -2                       *YES,ATTEMPT TO RESOLVE              
         LW,R5    0,R5                                                          
         AND,R5   X:7FFFF                                                       
         SOLVEX                                                                 
         MTH,1    RAXVALX,R6                                                    
         CI,R6    1                     WAS THE EXPRESSION RESOLVED             
         BE       RAX35                    *NO                                  
         LW,R3    R9                       *YES,IS THE VALUE A POSITIVE         
         LW,R5    RAX1                          ADDRESS                         
         LB,R0    0,R5                                                          
         AND,R0   X:TYFLB                                                       
         OR,R0    R8                                                            
         CI,R0    CONSTANT                                                      
         BANZ     RAX33                            *NO,ERROR.                   
         AND,R9   Y:FFF8            CHECK IF ADDR. OVERFLOW/SIG7-3806/C015732   
         BEZ      RAX34                            *YES                         
         AI,R0    CONSTANT                         *NO,OUTPUT ALARM AND         
RAX33    LI,R9    DCBADR                               CONTINUE                 
         LW,R10   RAX1                                 (BA OF T:DCB ENT)        
         RDIAG                                                                  
RAX34    STB,R0   R3                   *STORE CONTROL BYTE AND VALUE            
         LW,R5    RAX1                  IN DCB ENTRY                            
         SLS,R5   -2                                                            
         STW,R3   0,R5                                                          
RAX35    LW,R5    RAX1                                                          
         AW,R5    NBE:DCB                                                       
         B        RAX32                                                         
RAX39    LW,R5    FBA:FWD          *SEARCH T:FWD FOR ENTRY WITH                 
         LW,R6    FBA:FWD           UNRESOLVED EXPRESSION                       
         AW,R6    BDP:FWD                                                       
         STW,R6   RAX2                  LBA+1 OF T:FWD                          
RAX40    STW,R5   RAX1                  BA OF CURRENT T:FWD ENTRY               
         CW,R5    RAX2                                                          
         BGE      RAX60                 END OF SEARCH                           
         SLS,R5   -2                                                            
         LW,R0    0,R5                                                          
         CI,R0    VALUE                 DOES T:FWD ENTRY HAVE A VALUE           
         BANZ     RAX50                     YES,CONTINUE SEARCH                 
         LW,R5    1,R5                      NO,CALCULATE BA OF EXPRESSIO        
         AW,R5    FBA:FWDX                     AND ATTEMPT TO RESOLVE           
         SOLVEX                                                                 
         MTH,1    RAXFWDX,R6                   SET RESOLVED/UNRES FLAG          
         CI,R6    1                     WAS EXPRESSION RESOLVED                 
         BE       RAX50                     NO,CONTINUE SEARCH                  
         LW,R5    RAX1                      YES,STORE RESULTS IN T:FWD          
         AI,R5    3                             ENTRY                           
         STORCBV                                                                
RAX50    LW,R5    RAX1                  ADDR OF NEXT T:FWD ENTRY                
         AW,R5    NBE:FWD                                                       
         B        RAX40                                                         
RAX60    LI,R6    1                                                             
         LH,R10   RAXVALX,R6        ARE THERE ANY EXPRESSIONS LEFT TO           
         AH,R10   RAXFWDX,R6        RESOLVE IN EITHER TABLE                     
*                                   FOR THIS PATH                               
         BEZ      RAX70                 NO,EXIT                                 
         LH,R10   RAXVALX           WERE ANY EXPRESSIONS RESOLVED IN            
         AH,R10   RAXFWDX           EITHER TABLE                                
         BNEZ     RAX10                 YES,TRY AGAIN                           
RAX70    LW,R5    BAP:VALX          DELETE ZEROED EXPRESSIONS                   
         LI,R10   0                 FROM LOWER END OF T:VALX                    
RAX75    CW,R5    LBA:VALX                                                      
         BGE      RAX80             BRANCH IF END OF TABLE                      
         CB,R10   0,R5                                                          
         BNE      RAX80             BRANCH IF NONZERO ENTRY                     
         AI,R5    1                                                             
         B        RAX75             BRANCH TO CHECK NEXT BYTE                   
RAX80    STW,R5   BAP:VALX                                                      
         LW,R11   RAXFWDX,R6        NR UNSOLVED EXPR IN T:FWDX                  
         CI,R11   0                 IS T:FWDX EMPTY                             
         BNE      *R12                  NO,EXIT                                 
         STW,R11  BDP:FWDX              YES,RESET POINTER AND EXIT              
         B        *R12                                                          
         TITLE    ' *** READXN ***    *** WRITEXN *** '                         
*                                                                               
*        PURPOSE: TO READ/WRITE ON TEMPORARY RAD FILE XN VIA M:X2,M:X3,         
*                 M:X4 OR M:X5 USING DIRECT ACCESS I/O.  SET 'FILE              
*                 OVERFLOW' FLAG IN DCB AND FL:OFLOW, IF EOT ENCOUNTERED        
*                 ON WRITE.  BUMP NO.-OF-GRANULES-OUTPUT COUNTER IN DCB,        
*                 IF WRITE.  CLOSE DCB.                                         
*                                                                               
*        INPUT:   R5=WA OF DCB                                                  
*                 R6=BA OF I/O BUFFER                                           
*                 R9=NUMBER OF BYTES TO READ/WRITE                              
*                 R12=GRANULE NO. (IF READ)                                     
*                                                                               
*        CALL:    BAL,R15  READXN/WRITEXN                                       
*                                                                               
*        OUTPUT:  R12=GRANULE NO,IF READ/WRITE OKAY                             
*                   =X'0000FFFF',IF FILE OVERFLOWED                             
*                                                                               
*        CALLS:   READ,WRITE,OPEN,CLOSE,ABNIO                                   
*                                                                               
*                                                                               
READXN   LI,R11   READ                                                          
         B        XN10                                                          
WRITEXN  LI,R11   WRITE                                                         
XN10     STW,R5   FPT:XN3           SET UP DCB FOR OPEN/CLOSE                   
         CI,R9    0                 IS THE BYTE COUNT ZERO                      
         BNEZ     XN12                  NO                                      
         LI,R12   0                     YES,EXIT                                
         B        *R15                                                          
XN12     EQU      %                                                             
         LI,R0    OPEN                                                          
         STB,R0   FPT:XN3                                                       
         STW,R5   FPT:XN1           SET UP DCB FOR READ/WRITE                   
         STB,R11  FPT:XN1                                                       
         LI,R7    3                                                             
         STS,R6   FPT:XN1+6             (BA DISPLACEMENT OF BUFFER)             
         SLS,R6   -2                                                            
         STW,R6   FPT:XN1+4             (WA OF BUFFER)                          
         STW,R9   FPT:XN1+5             (BYTE COUNT)                            
         LI,R9    0                                                             
         CI,R11   READ                                                          
         BE       XN20                                                          
XN15     CAL1,1   FPT:XN3           WRITE,OPEN DCB TO GET 'RFT' INDEX           
         LI,R7    7                                                             
         LB,R7    *FPT:XN1,R7           R7=RFT INDEX                            
         LW,R9    FPT:XN1+5                                                     
         LH,R0    *K:RFT4,R7                                                    
         AND,R0   X:FFFF            NR BYTES PER GRAN                           
         AW,R9    R0                                                            
         AI,R9    -1                                                            
         DW,R9    R0                                                            
         LW,R12   4,R5                 *GET THE NUMBER OF GRANULES              
         SLS,R12  -17                   OUTPUT ON FILE SO FAR                   
         AW,R9    R12                  *STORE NEW NUMBER OF GRANULES            
         STH,R9   R8                    OUTPUT IN DCB                           
         SLS,R8   1                                                             
         LW,R9    Y:FFFE                                                        
         STS,R8   4,R5                                                          
         SLS,R5   2                     (BA OF DCB)                             
         LB,R0    2,R5              IS 'FILE OVERFLOW' FLAG SET                 
         BNEZ     XN40                  YES                                     
         LI,R9    PT:XN2                NO,RETURN TO 'XN30' IF EOT              
XN20     STW,R12  FPT:XN1+7                ENCOUNTERED ON WRITE                 
         CAL1,1   FPT:XN1           READ/WRITE ON M:XN                          
XN25     LI,R0    CLOSE                                                         
         STB,R0   FPT:XN3                                                       
         CAL1,1   FPT:XN3           CLOSE M:XN                                  
         B        *R15                                                          
XN30     MTW,1    FL:ERROR          EOT ENCOUNTERED ON WRITE                    
         MTB,1    2,R5                  SET FILE-OVERFLOW FLAG                  
         LI,R12   1                                                             
         STW,R12  FL:OFLOW                                                      
XN40     LI,R12   X'0FFFF'                                                      
         B        XN25                                                          
         TITLE    '       **** ROMBYTE ****'                                    
*                                                                               
*        PURPOSE: TO GET FIRST/NEXT ROM BYTE,READING ROM RECORD INTO            
*                 B:ROM,IF NECESSARY.  IF THE ROM RECORD IS BEING INPUT         
*                 THROUGH F:DEVICE, OUTPUT ON M:X1.                             
*                                                                               
*        INPUT:   BAP:ROM=-1,INPUT FIRST RECORD OF ROM                     101  
*                        =BA OF LAST ROM BYTE REFERENCED IN B:ROM               
*                                                                               
*        CALL:    BAL,R15  ROMBYTE                                              
*                                                                               
*        OUTPUT:  BAP:ROM=BA OF FIRST/NEXT ROM BYTE IN B:ROM                    
*                 LBA:ROM=LBA+1 OF ROM RECORD IN B:ROM                          
*                 R5=(BAP:ROM)                                                  
*                 R8=ROM BYTE POINTED BY BAP:ROM                                
*                 FL:RTYPE=1,IF RECORD TYPE EQUALS 'LAST'                       
*                        ==0,IF RECORD TYPE DOES NOT EQUAL 'LAST'               
*                 FL:OFLOW=1,IF M:X1 EOT ENCOUNTERED                            
*                                                                               
*        CALLS:   DCBTYPE,CHKBLANK,READ,WRITE,RDIAG,ABNIO                       
*                                                                               
*                                                                               
ROMBYTE  EQU      %                                                             
         STW,R15  ROMX                                                          
         MTW,1    BAP:ROM           IS FIRST RECORD OF ROM TO BE INPUT     101  
         BNEZ     ROM50                 NO,RECORD ALREADY IN B:ROM              
         LI,R6    M:C                                                           
         LW,R7    FPT:ROM1          ROM DCB ADDRESS                             
         CAL1,1   FPT:COR                                                       
         CI,R8    0                                                             
         BE       ROM24             B IF ROMS NOT FROM 'C' OPLABEL              
         LW,R0    V:CCTYPE                                                      
         CI,R0    :BINARY                                                       
         BNE      ROM24             B IF THERE IS NO BINARY RECORD IN           
*                                   'C' BUFFER                                  
         LI,R5    BA(B:C)           MOVE ROM RECORD TO B:ROM                    
         LI,R6    BA(B:ROM)                                                     
         LI,R8    120                                                           
         MOVBYTS                                                                
         LI,R5    BA(B:ROM)                                                     
         LI,R0    0                                                             
         STW,R0   V:CCTYPE                                                      
         B        ROM35                                                         
ROM24    LI,R9    1                     (ABNIO RETURN IF 'EOD')                 
ROM25    STW,R9   PT:ROM2                                                       
ROM30    LI,R9    PT:ROM2          *POINTER FOR ABNIO                           
         CAL1,1   FPT:ROM1         *READ ROM RECORD INTO B:ROM                  
         LI,R5    BA(B:ROM)                                                     
         CHKBLANK                   BLANK RECORD                                
         BCS,CC1+CC2   ROM30            YES,SKIP                                
ROM35    LB,R8    0,R5                  GET RECORD TYPE                         
         SLS,R8   -5                                                            
         STW,R8   FL:RTYPE                                                      
         LW,R11   V:ROMRNO          SAVE PREVIOUS ROM SEQUENCE NO               
         MTB,1    V:ROMRNO                                                      
         LB,R8    0,R5                  GET FORMAT AND MODE                     
         LI,R7    X'18'                                                         
         CS,R7    R8                                                            
         BNE      ROM110                ERROR,NOT BINARY MODE                   
         AND,R8   X:7                                                           
         CI,R8    X'4'                                                          
         BNE      ROM80                 ERROR,NOT OBJECT LANGUAGE FORMAT        
         AI,R5    1                                                             
         LB,R8    0,R5                  GET RECORD SEQUENCE NO.                 
         CB,R8    V:ROMRNO                                                      
         BNE      ROM90                      SEQUENCE ERROR,ABORT               
         AI,R5    1                                                             
         LB,R8    0,R5                  GET CHECKSUM                            
         AI,R5    1                                                             
         LB,R9    0,R5                  GET RECORD SIZE                         
         AI,R9    BA(B:ROM)                                                     
         STW,R9   LBA:ROM                                                       
         AI,R5    1                                                        101  
         STW,R5   BAP:ROM                                                       
         LI,R5    BA(B:ROM)         VERIFY CHECKSUM                             
         LI,R9    0                                                             
ROM40    LB,R0    0,R5                                                          
         AW,R9    R0                                                            
         AI,R5    1                                                             
         CW,R5    LBA:ROM                                                       
         BL       ROM40                                                         
         SW,R9    R8                                                            
         AND,R9   X:FF                                                          
         CW,R9    R8                                                            
         BNE      ROM100                CHECKSUM ERROR                          
         LW,R0    *FPT:ROM1         GET DCB WORD 0                              
         AND,R0   X:3               ASN FIELD                                   
         CI,R0    3                 ASSIGNED TO DEV OR OPLB                     
         BNE      ROM50                 NO,DONT SAVE RECORD ON X1               
         LW,R9    Y:FFFE                YES,BUMP 'NIO' COUNTER                  
         LS,R8    M:X1+4                                                        
         AI,R8    X'20000'                                                      
         STS,R8   M:X1+4                                                        
         MTB,0    M:X1+2                                                        
         BNEZ     ROM50                 X1 HAS OVERFLOWED                       
*                                                                               
         LI,R9    PT:ROM4               (RETURN TO 'ROM70' IF EOT)              
         CAL1,1   FPT:ROM3              WRITE ROM ON X1                         
ROM50    LW,R5    BAP:ROM           GET NEXT BYTE IN RECORD                101  
         CW,R5    LBA:ROM               END OF RECORD                           
         BL       ROM60                     NO                                  
         LW,R0    FL:RTYPE                  YES,LAST RECORD OF ROM              
         BEZ      ROM55                             YES,ERROR                   
         LI,R9    0                                 NO,READ NEXT RECORD         
         B        ROM25                                                         
ROM55    LI,R9    NOMODEND          OUTPUT DIAG 'NO MODULE END ON LAST          
         RDIAG                          ROM RECORD' AND ABORT                   
ROM60    LB,R8    0,R5              GET ROM BYTE AND EXIT                       
         B        *ROMX                                                         
ROM70    LI,R0    1                 RETURN FROM ABNIO IF X1 OVERFLOWED          
         STB,R0   M:X1+2                (SET OVERFLOW FLAGS)                    
         STW,R0   FL:OFLOW                                                      
         B        ROM50                                                         
ROM80    LI,R9    OBJFORMT          NOT OBJECT LANGUAGE FORMAT                  
         B        ROM115                                                        
ROM90    LI,R9    SEQERR            ROM RECORD SEQUENCE ERROR                   
         B        ROM115                                                        
ROM100   LI,R9    CHKSUM            ROM RECORD CHECKSUM ERROR                   
         B        ROM115                                                        
ROM110   LI,R9    NOTSTBIN          NON-STANDARD BINARY RECORD                  
ROM115   RDIAG                                                                  
         STW,R11  V:ROMRNO          RESTORE PREVIOUS ROM SEQUENCE NO            
         B        ROM30                *REREAD BINARY RECORD,IF 'C'             
*                                       RESPONSE TO ALARM                       
         TITLE    '       **** ROMBYTES ****'                                   
*                                                                               
*        PURPOSE: TO SKIP 'N' BYTES IN ROM                                      
*                                                                               
*        INPUT:   R9=NUMBER OF BYTES TO SKIP (GREATER THAN ZERO)                
*                 BAP:ROM=BA OF FIRST ROM BYTE TO SKIP                          
*                                                                               
*        CALL:    BAL,R14  ROMBYTES                                             
*                                                                               
*        OUTPUT:  BAP:ROM=BA OF NTH ROM BYTE                                    
*                 R8=ROM BYTE POINTED BY BAP:ROM                                
*                                                                               
*        CALLS:   ROMBYTE                                                       
*                                                                               
*                                                                               
ROMBYTES EQU      %                                                             
ROMS10   AW,R9    BAP:ROM          *ARE THE BYTES TO BE SKIPPED ALL IN     101  
         STW,R9   BAP:ROM           THIS ROM RECORD                        101  
         SW,R9    LBA:ROM                                                  101  
         BGEZ     ROMS20                                                        
         LW,R5    BAP:ROM                                                       
         LB,R8    0,R5                                                          
         B        *R14                                                          
ROMS20   STW,R9   ROMSCNT                                                       
         LW,R9    LBA:ROM                                                  101  
         AI,R9    -1                                                       101  
         STW,R9   BAP:ROM                                                  101  
         ROMBYTE                                                           101  
         LW,R9    ROMSCNT                                                  101  
         B        ROMS10                                                   101  
         TITLE    '       **** SATREF ****'                                     
*                                                                               
*        PURPOSE: TO SATISFY ALL REF'S IN T:SYMBOL THAT MATCH GIVEN DEF,        
*                 WHERE DEF IS DEFINED WITH EITHER A VALUE OR AN                
*                 EXPRESSION.  IF LIBRARY DEF,EXCLUDED PREF WILL NOT            
*                 BE SATISFIED.  FLAGS DUPLICATE REF'S IF ANY FOUND.            
*                                                                               
*        INPUT:   R9=DEF T:SYMBOL/T:VALUE ENTRY NO.                             
*                                                                               
*        CALL:    BAL,R13  SATREF                                               
*                                                                               
*        OUTPUT:  R1=T:SYMBOL                                                   
*                                                                               
*        CALLS:   SYMFBA,SERCHSYM,ADDX,WORD,4BYTES,RDIAG                        
*                                                                               
*                                                                               
SATREF   EQU      %                                                             
         SYMFBA                     CALCULATE FBA OF T:SYMBOL ENTRY             
         STW,R5   SAT1SYM                                                       
         AI,R9    -1                CALCULATE FBA OF T:VALUE ENTRY              
         MW,R9    NBE:VALU                                                      
         AW,R9    FBA:VALU                                                      
         STW,R9   SAT1VAL                                                       
         LI,R6    0                                                             
SAT10    SERCHSYM                   SEARCH T:SYMBOL FOR ENTRY WITH              
         CI,R6    0                                                             
         BE       *R13              END OF T:SYMBOL. RETURN                     
         CW,R6    R5                HAS DEF ENTRY BEEN LOCATED                  
         BE       SAT10             YES. SKIP IT                                
         STW,R6   SAT2SYM                                                       
         STW,R7   SAT2VAL                                                       
         LW,R5    SAT1VAL               NO                                      
         LB,R0    0,R7                                                          
         AND,R0   X:TY                                                          
         CI,R0    DEF                                                           
         BE       SAT30             B IF DEF (DUPL LIB DEF)                     
*                                                                               
SAT20    LB,R8    0,R5              DEF CONTROL BYTE                            
         LB,R0    0,R7              REF CONTROL BYTE                            
         AND,R8   X:LB                                                          
         CI,R8    USER              LIBRARY DEF                                 
         BE       SAT40                 YES                                     
         CI,R8    SYSTEM                                                        
         BE       SAT40                 YES                                     
         CI,R0    SATISFYD              NO,HAS REF BEEN SATISFIED               
         BAZ      SAT50                        NO                               
         OR,R0    X:DUP                        YES,DUPLICATE REF                
         STB,R0   0,R7                                                          
SAT30    LI,R6    1                 CONTINUE SEARCH FOR MATCHING                
         LW,R5    SAT1SYM           T:SYMBOL ENTRY                              
         B        SAT10                                                         
SAT40    AND,R0   X:TYDV            LIBRARY DEF                                 
         CI,R0    EXCLPREF              IS REF AN EXCLUDED PREF                 
         BE       SAT30                     YES,DONT SATISFY WITH               
*                                               LIBRARY DEF                     
         CI,R0    SATISFYD              HAS REF ALREADY BEEN SATISFIED          
         BANZ     SAT30                     YES,NOT ERROR                       
SAT50    LB,R8    0,R5              DEF CONTROL BYTE                            
         AND,R8   X:DVC                                                         
         LB,R0    0,R7              REF CONTROL BYTE                            
         AND,R0   X:TYFLB                                                       
         OR,R0    R8                SATISFY REF                                 
         STB,R0   0,R7                                                          
         CI,R0    VALUE                 HAS REF BEEN SATISFIED WITH             
*                                   AN EXPRESSION OR A VALUE                    
         BAZ      SAT60                                                         
         4BYTES                              VALUE,STORE 32-BIT VALUE           
         LW,R9    R8                               IN REF T:VALUE ENTRY         
         LW,R5    SAT2VAL                                                       
         WORD                                                                   
         LW,R5    SAT2VAL                                                       
         LB,R8    0,R5                                                          
         CI,R8    ADSECT                                                        
         BNE      SAT30             B IF NOT SATREFFING A DSECT                 
         LW,R5    SAT2SYM           DSECT REF T:SYMBOL ENTRY                    
         LB,R8    0,R5                                                          
         AW,R5    R8                DSECT REF T:SYMBOL EXTENSION                
         AI,R5    -1                                                            
         LI,R9    -1                SIZE = -1 IS A DSECT REF                    
         LI,R8    X'84'                                                         
         STB,R8   R9                                                            
         WORD                                                                   
         B        SAT30                                                         
SAT60    4BYTES                              EXPRESSION,GET EXPRESSION          
         LW,R5    R8                                   AND STORE IN             
         LI,R1    T:VALX                               T:VALX AGAIN             
         ADDX                                                                   
         LW,R9    R6                                                            
         LW,R5    SAT2VAL                                                       
         WORD                                                                   
         B        SAT30                                                         
         TITLE    '       **** SERCHDCB ****'                                   
*                                                                               
*        PURPOSE: TO SEARCH T:DCB FOR MATCHING ENTRY                            
*                                                                               
*        INPUT:   R5=FBA OF DCB EBCDIC NAME(IN T:SYMBOL FORMAT) TO MATCH        
*                                                                               
*        CALL:    BAL,R14  SERCHDCB                                             
*                                                                               
*        OUTPUT:  R6=FBA OF MATCHING ENTRY,IF ONE FOUND                         
*                   =ZERO,IF MATCH NOT FOUND                                    
*                 R9='TB' IN BITS 16-17; 'ENTRY' IN BITS 18-31,IF R670          
*                   =ZERO,IF R6=0                                               
*                 R3=FIRST 4 EBCDIC BYTES OF DCB NAME                           
*                 R4=LAST  4 EBCDIC BYTES OF DCB NAME                           
*                 R5=CHANGED                                                    
*                                                                               
*        CALLS:   MOVBYTS                                                       
*                                                                               
*                                                                               
SERCHDCB EQU      %                                                             
         LW,R0    E:BLANKS          STORE DCB NAME AS 8-EBCDIC CHAR             
         STW,R0   DCBNAME           WITH TRAILING BLANKS                        
         STW,R0   DCBNAME+1                                                     
         LB,R8    0,R5                  BYTE COUNT                              
         AI,R8    -1                                                            
         AI,R5    1                     FBA FROM                                
         LI,R6    BA(DCBNAME)           FBA TO                                  
         MOVBYTS                                                                
         LW,R6    FBA:DCB           SEARCH T:DCB FOR MATCH                      
         LW,R7    FBA:DCB                                                       
         AW,R7    BDP:DCB               LBA+1 OF T:DCB                          
DCB30    CW,R6    R7                                                            
         BGE      DCB40                 END OF TABLE,NO MATCH                   
         SCS,R6   -2                    BA TO WA                                
         LW,R10   1,R6                                                          
         LW,R11   2,R6                                                          
         SCS,R6   2                     WA TO BA                                
         CD,R10   DCBNAME                                                       
         BNE      DCB50                                                         
         LW,R9    R6                MATCHING ENTRY FOUND                        
         SW,R9    FBA:DCB               CALCULATE ENTRY NO.                     
         DW,R9    NBE:DCB                                                       
         AI,R9    1                                                             
         B        DCB45                                                         
DCB40    LI,R6    0                 MATCHING ENTRY NOT FOUND                    
         LI,R9    0                                                             
DCB45    LW,R3    DCBNAME                                                       
         LW,R4    DCBNAME+1                                                     
         B        *R14                                                          
DCB50    AW,R6    NBE:DCB                                                       
         B        DCB30                                                         
         TITLE    '       **** SERCHFWD ****'                                   
*                                                                               
*        PURPOSE: TO SEARCH T:FWD FOR ENTRY WITH MATCHING FORWARD NO.           
*                                                                               
*        INPUT:   R8=FIRST BYTE OF FORWARD NO.                                  
*                 R9=SECOND BYTE OF FORWARD NO.                                 
*                                                                               
*        CALL:    BAL,R14 SERCHFWD                                              
*                                                                               
*        OUTPUT:  R5=FBA OF T:FWD ENTRY,IF MATCH FOUND                          
*                   =ZERO,IF MATCH NOT FOUND                                    
*                 R8,R9  UNCHANGED                                              
*                                                                               
SERCHFWD EQU      %                                                             
         LW,R5    FBA:FWD                                                       
         LW,R11   FBA:FWD           COMPUTE LBA+1 OF T:FWD                      
         AW,R11   BDP:FWD                                                       
FWD10    CW,R5    R11                                                           
         BGE      FWD30                                                         
         CB,R8    0,R5                                                          
         BNE      FWD20                                                         
         LW,R6    R5                                                            
         AI,R6    1                                                             
         CB,R9    0,R6                                                          
         BE       *R14              MATCHING ENTRY                              
FWD20    AW,R5    NBE:FWD                                                       
         B        FWD10                                                         
FWD30    LI,R5    0                                                             
         B        *R14              MATCH NOT FOUND                             
         TITLE    '      ***** SERCHSEG ****'                                   
*                                                                               
*        PURPOSE: TO SEARCH T:SEG FOR ENTRY WITH MATCHING IDENT                 
*                                                                               
*        INPUT:   R8=SEGMENT IDENT                                              
*                                                                               
*        CALL:    BAL,R15  SERCHSEG                                             
*                                                                               
*        OUTPUT:  R7=FBA OF T:SEG ENTRY,IF MATCH FOUND                          
*                   =ZERO,IF MATCH NOT FOUND                                    
*                 R8=UNCHANGED                                                  
*                                                                               
*        CALLS:   NO SUBROUTINES                                                
*                                                                               
*                                                                               
SERCHSEG EQU      %                                                             
         CI,R8    0                                                             
         BNE      %+2               BRANCH IF NOT ROOT                          
         LI,R8    ROOT1ID           CHANGE TO INTERNAL ROOT1 ID                 
         STH,R8   R8                                                            
         LH,R8    R8                EXTEND SIGN BIT                             
         LW,R7    FBA:SEG                                                       
         LW,R11   FBA:SEG                                                       
         AW,R11   BDP:SEG                                                       
SEG10    CW,R7    R11               END OF T:SEG                                
         BGE      SEG20                 YES                                     
         LW,R6    R7                    NO                                      
         SLS,R6   -1                CONVERT BA TO HA                            
         CH,R8    0,R6                                                          
         BE       *R15                                                          
         AW,R7    NBE:SEG                                                       
         B        SEG10                                                         
SEG20    LI,R7    0                                                             
         B        *R15                                                          
         TITLE    '       **** SERCHPUB ****'                                   
*                                                                               
*        PURPOSE: TO SEARCH T:PUBSYM FOR MATCHING ENTRY                         
*                                                                               
*        INPUT:   R5=FBA OF ENTRY TO MATCH                                      
*                                                                               
*        CALL:    BAL,R14  SERCHPUB                                             
*                                                                               
*        OUTPUT:  R5=UNCHANGED                                                  
*                 R6=FBA OF MATCHING ENTRY,IF FOUND                             
*                   =0,MATCH NOT FOUND                                          
*                 R9='TB' IN BITS 16-17;'ENTRY' IN BITS 18-31                   
*                 R1=T:PUBSYM                                                   
*                 R7=FBA OF MATCHING T:PUBVAL ENTRY,IF R670                     
*                                                                               
*        CALLS:   COMPBS                                                        
*                                                                               
*                                                                               
SERCHPUB LI,R1    T:PUBSYM                                                      
         LI,R9    X'C000'           TB=11,ENTRY=0                               
         LI,R7    T:PUBVAL                                                      
         B        SYM20                                                         
         TITLE    '       **** SERCHSYM ****'                                   
*                                                                               
*        PURPOSE: TO SEARCH T:SYMBOL FOR MATCHING EBCDIC ENTRY                  
*                                                                               
*        INPUT:   R5=FBA OF ENTRY TO MATCH                                      
*                 R6=0,START AT BEGINNING                                       
*                   =NONZERO,CONTINUE SEARCH                                    
*                                                                               
*        CALL:    BAL,R14  SERCHSYM                                             
*                                                                               
*        OUTPUT:  R5=UNCHANGED                                                  
*                 R6=FBA OF MATCHING ENTRY,IF FOUND                             
*                   =0,MATCH NOT FOUND                                          
*                 R7=FBA OF MATCHING T:VALUE ENTRY                              
*                 R9='TB' IN BITS 16-17; 'ENTRY' IN BITS 18-31                  
*                 R1=T:SYMBOL                                                   
*                                                                               
*        CALLS:   COMPBS                                                        
*                                                                               
*                                                                               
SERCHSYM LI,R1    T:SYMBOL                                                      
         LI,R9    X'4000'           TB=01,ENTRY=0                               
         LI,R7    T:VALUE                                                       
SYM10    CI,R6    0                                                             
         BE       SYM20                                                         
         LW,R6    SYMBAP            CONTINUE SEARCH                             
         LW,R9    SYMENT                                                        
         B        SYM30                                                         
SYM20    LW,R6    T:FBA,R1          START SEARCH AT BEGINNING                   
SYM30    LW,R10   T:FBA,R1                                                      
         AW,R10   T:BDP,R1              LBA+1 OF TABLE                          
SYM40    CW,R6    R10               END OF TABLE                                
         BGE      SYM100                YES                                     
         LB,R0    0,R6                  NO, CONTINUATION ENTRY                  
         CI,R0    X'80'                                                         
         BGE      SYM50                        YES                              
         AI,R9    1                            NO,ARE BYTE COUNTS EQUAL         
         CB,R0    0,R5                                                          
         BE       SYM60                               YES                       
SYM50    AND,R0   X:7F                                NO                        
         AW,R6    R0                                                            
         B        SYM40                                                         
SYM60    STW,R6   SYM2              ARE THE EBCDIC ENTRIES EQUAL                
         STW,R5   SYM1                                                          
         COMPBS                                                                 
         BE       SYM90                 YES                                     
SYM80    LW,R5    SYM1                  NO                                      
         LW,R6    SYM2                                                          
         B        SYM50                                                         
SYM90    STW,R9   R11                                                           
         AND,R11  X:3FFF            CALCULATE FBA OF T:VALUE ENTRY              
         AI,R11   -1                                                            
         MW,R11   T:NBE,R7                                                      
         AW,R11   T:FBA,R7                                                      
         LW,R7    R11                   FBA OF T:VALUE ENTRY                    
         LB,R11   0,R7                                                          
         AND,R11  X:TY              GET ENTRY TYPE                              
         CI,R1    T:PUBSYM                                                      
         BNE      SYM95             B IF NOT SEARCHING FOR PUBLIB DEF           
         CI,R11   DEF                                                           
         BE       SYM95             B IF DEF FOUND                              
         LI,R7    T:PUBVAL          RESTORE R7                                  
         B        SYM80             AND CONTINUE SEARCH                         
SYM95    RES      0                                                             
         STW,R6   SYMBAP                LBA+1 OF MATCHING ENTRY                 
         LW,R6    SYM2                  FBA OF MATCHING ENTRY                   
         LW,R5    SYM1                  FBA OF ORIGINAL ENTRY                   
         STW,R9   SYMENT                                                        
         B        *R14                                                          
SYM100   LI,R6    0                                                             
         B        *R14                                                          
         TITLE    '       **** SERCHVAL ***'                                    
*                                                                               
*        PURPOSE: TO SEARCH T:VALUE FOR ENTRY WITH A MATCHING CONTROL           
*                 BYTE,GIVEN MASK                                               
*                                                                               
*        INPUT:   R6=0,START AT THE BEGINNING                                   
*                   =NONZERO, CONTINUE SEARCH                                   
*                 R10=CONTROL BYTE (TY,D,V,C,F,LB) IN BITS 24-31                
*                 R11=CONTROL BYTE MASK IN BITS 24-31                           
*                                                                               
*        CALL:    BAL,R15  SERCHVAL                                             
*                                                                               
*        OUTPUT:  R6=FBA OF MATCHING T:VALUE ENTRY                              
*                   =ZERO,END OF TABLE                                          
*                 R9=T:VALUE/T:SYMBOL ENTRY NO.                                 
*                 R10,R11 UNCHANGED                                             
*                                                                               
*        CALLS:   NO SUBROUTINES                                                
*                                                                               
*                                                                               
SERCHVAL EQU      %                                                             
         LW,R7    FBA:VALU                                                      
         AW,R7    BDP:VALU                                                      
         CI,R6    0                                                             
         BNE      VAL10                                                         
         LW,R6    FBA:VALU          START SEARCH AT BEGINNING OF TABLE          
         B        VAL15                                                         
VAL10    LW,R6    VALFBA            CONTINUE SEARCH                             
         AW,R6    NBE:VALU                                                      
VAL15    CW,R6    R7                                                            
         BGE      VAL20             END OF TABLE                                
         LB,R9    0,R6                                                          
         CS,R10   R9                                                            
         BE       VAL25             MATCHING ENTRY                              
         AW,R6    NBE:VALU                                                      
         B        VAL15                                                         
VAL20    LI,R6    0                                                             
VAL25    STW,R6   VALFBA            SAVE FBA POINTER                            
         LW,R9    VALFBA            CALCULATE ENTRY NO.                         
         SW,R9    FBA:VALU                                                      
         AW,R9    NBE:VALU                                                      
         DW,R9    NBE:VALU                                                      
         B        *R15                                                          
         TITLE    '       **** SKIPX ****'                                      
*                                                                               
*        PURPOSE: TO SKIP EXPRESSION IN ROM RECORD                              
*                                                                               
*        INPUT:   V:DECLNO=NO. OF DECLARATIONS ENCOUNTERED IN ROM               
*                 BAP:ROM=BA OF LOAD ITEM PRECEEDING ROM EXPRESSION             
*                                                                               
*        CALL:    BAL,R13  SKIPX                                                
*                                                                               
*        OUTPUT:  BAP:ROM=BA OF EXPRESSION END LOAD ITEM                        
*                                                                               
*        CALLS:   ROMBYTES,RDIAG,                                               
*                                                                               
*                                                                               
SKIPX    EQU      %                                                             
SKP10    LI,R9    1                                                             
SKP15    ROMBYTES                   SKIP (R9) ROMBYTES                          
         CI,R8    X'40'                                                         
         BGE      SKP20             ILLEGAL EXPRESSION LOAD ITEM                
         CI,R8    X'30'                                                         
         BGE      SKP10             ADDRESS RESOLUTION LOAD ITEM                
         CI,R8    X'20'                                                         
         BGE      SKP40             VALUE LOAD ITEM                             
         CI,R8    X'01'                                                         
         BE       SKP30             ADD CONSTANT LOAD ITEM                      
         CI,R8    X'02'                                                         
         BE       *R13             *EXPRESSION END LOAD ITEM                    
SKP20    LI,R9    LOADITEM          OUTPUT ALARM 'ILLEGAL LOAD ITEM'            
         RDIAG                      AND ABORT                                   
SKP30    LI,R9    5                                                             
         B        SKP15                                                         
SKP40    CI,R8    X'4'              FORWARD OR DECLARATION                      
         BANZ     SKP50                                                         
         LW,R0    V:DECLNO              DECLARATION                             
         CI,R0    256                                                           
         BGE      SKP50                      IN TWO BYTES                       
         LI,R9    2                          IN ONE BYTE                        
         B        SKP15                                                         
SKP50    LI,R9    3                 FORWARD OR 2-BYTE DECLARATION               
         B        SKP15                                                         
         TITLE    '       **** SOLVEX ****'                                     
*                                                                               
*        PURPOSE: TO SOLVE EXPRESSIONS IN T:VALX/T:FWDX FORMAT                  
*                                                                               
*        INPUT:   R5=FBA OF EXPRESSION                                          
*                                                                               
*        CALL:    BAL,R13  SOLVEX                                               
*                                                                               
*        OUTPUT:  R5=UNCHANGED                                                  
*                 R8=T:VALUE CONTROL BYTE BITS D,V,AND C                        
*                    BIT 26=1 (D)                                               
*                    BIT 27=1,IF VALUE (V)                                      
*                          =0,IF EXPRESSION NOT RESOLVED                        
*                    BIT 28=1,IF CONSTANT OR MIXED RESOLUTION (C)               
*                          =0,IF ADDRESS,OR IF V=0                              
*                 R9=VALUE (WITH BYTE RESOLUTION IF ADDRESS),IF R6=0            
*                   =ZERO,IF  R6=1                                              
*                 R6=0,EXPRESSION RESOLVED                                      
*                    1,EXPRESSION NOT RESOLVED                                  
*                 R10=PREVIOUS RESOLUTION OF PARTIAL SUM                        
*                 IF THE EXPRESSION IS RESOLVED,THE ENTRY AT (R5)               
*                 IS ZEROED  OUT                                                
*                                                                               
*        CALLS:   ZEROX,TBENTRY,SERCHFWD,4BYTES,CHGRR,RDIAG                     
*                                                                               
*                                                                               
SOLVEX   EQU      %                                                             
         STW,R5   SOLX                                                          
         LI,R9    0                                                             
         STW,R9   SOLVALU           EXPRESSION ACCUMULATOR                      
         STW,R9   SOLRR             ADDRESS RESOLUTION COUNTERS:B,H,W,D         
SOL10    LB,R9    0,R5              GET FIRST/NEXT LOAD ITEM IN EXP.            
         CI,R9    X'40'                                                         
         BGE      SOL70                 ILLEGAL EXPRESSION ITEM                 
         CI,R9    X'30'                                                         
         BGE      SOL40                 ADDR RESOLUTION ITEM                    
         CI,R9    X'20'                                                         
         BGE      SOL90                 VALUE ITEM                              
         CI,R9    X'02'                                                         
         BE       SOL180                EXPRESSION END                          
         CI,R9    X'01'                                                         
         BNE      SOL70                 ILLEGAL EXP. ITEM                       
*                                                                               
         4BYTES                         ADD CONSTANT ITEM                       
         AWM,R8   SOLVALU                                                       
SOL30    AI,R5    1                 ADDR OF NEXT LOAD ITEM IN EXP.              
         B        SOL10                                                         
SOL40    LW,R7    R9                ADDR RESOLUTION                             
         AND,R7   X:3                   MASK RR (BITS 6,7)                      
         AND,R9   X:C                   MASK BITS 4,5                           
         BEZ      SOL60                                                         
SOL45    CI,R9    X'8'              ADD OR SUBTRACT BIT SET                     
         BAZ      SOL50                                                         
         MTB,-1   SOLRR,R7              SUBTRACT (DECREMENT RR)                 
         B        SOL30                                                         
SOL50    MTB,1    SOLRR,R7              ADD (INCREMENT RR)                      
         B        SOL30                                                         
SOL60    CHGRR                      CHANGE RESOLUTION                           
         B        SOL30                                                         
SOL70    LI,R9    LOADITEM          OUTPUT ALARM AND ABORT                      
         RDIAG                                                                  
SOL90    STW,R5   SOLBAP            VALUE ITEM                                  
         AI,R5    1                                                             
         CI,R9    4                                                             
         BAZ      SOL100                                                        
         LB,R8    0,R5              ADD/SUBT VALUE OF FORWARD                   
         AI,R5    1                                                             
         LB,R9    0,R5                                                          
         SERCHFWD                       SEARCH T:FWD FOR MATCHING NO.           
         CI,R5    0                                                             
         BE       SOL160                NO MATCH FOUND,EXP UNRESOLVED           
         AI,R5    3                     ADDR OF T:FWD ENTRY CONTROL BYTE        
         B        SOL110                                                        
SOL100   EQU      %                 ADD/SUBT VALUE OF TABLE ENTRY               
         TBENTRY                        GET ADDR OF TABLE ENTRY                 
         CI,R1    T:DCB                                                         
         BE       SOL130                                                        
         CI,R1    T:CSECT                                                       
         BE       SOL130                                                        
SOL110   LB,R10   0,R5                  T:VALUE,T:PUBVAL,T:FWD ENTRIES          
         4BYTES                              GET 32-BIT VALUE                   
         B        SOL140                                                        
SOL130   LB,R10   0,R5                  T:DCB,T:CSECT ENTRIES                   
         SLS,R5   -2                                                            
         LI,R9    X'7FFFF'                   GET BYTE ADDR VALUE                
         LI,R8    0                                                             
         LS,R8    0,R5                                                          
SOL140   LW,R5    SOLBAP                R10=CONTROL BYTE                        
         LB,R9    0,R5                  R8=VALUE                                
         LW,R7    R9                                                            
         AND,R7   X:3               MASK RR ON VALUE ITEM                       
         AI,R5    2                                                             
         LI,R11   DEFINED+VALUE                                                 
         CS,R11   R10               HAS THE TABLE ENTRY BEEN DEFINED            
*                                   WITH A RESOLVED EXPRESSION (VALUE)          
         BNE      SOL160                NO                                      
         CI,R9    X'8'                  YES,ADD OR SUBTRACT VALUE               
         BAZ      SOL145                       *ADD                             
         LCW,R8   R8                           *SUBTRACT                        
SOL145   CI,R10   CONSTANT          IS VALUE A CONSTANT OR AN ADDR              
         BAZ      SOL150                                                        
         AWM,R8   SOLVALU                   CONSTANT OR MIXED RESOLUTION        
         B        SOL30                         ADD TO PARTIAL SUM              
SOL150   LCW,R6   R7                        ADDRESS,SHIFT=BYTE-RR               
         SAS,R8   0,R6                              CHANGE ADDR RESOLUTN        
         AWM,R8   SOLVALU                           ADD TO PARTIAL SUM          
         B        SOL45                                                         
SOL160   LI,R6    1                 EXPRESSION NOT RESOLVED                     
         LI,R9    0                                                             
         LI,R8    DEFINED+EXP                                                   
         B        SOL190                                                        
SOL180   LW,R5    SOLX              EXPRESSION END                              
         ZEROX                          ZERO EXPRESSION                         
         LI,R7    0                                                             
         CHGRR                         *CONVERT VALUE (IF ADDR) TO              
         AI,R8    DEFINED+VALUE         (CONSTANT IS SET BY SOLRR)              
         LI,R6    0                     BYTE RESOLUTION                         
         LW,R9    SOLVALU                                                       
SOL190   LW,R5    SOLX                                                          
         B        *R13                                                          
         TITLE    '       **** CHGRR ****'                                      
*                                                                               
*        PURPOSE: SOLVEX SUBROUTINE TO CHANGE  PARTIAL SUM                      
*                 ADDRESS RESOLUTION (IF SIMPLE ADDRESS)                        
*                                                                               
*        INPUT:   R7=TO RR                                                      
*                 SOLRR=RESOLUTION COUNTERS FOR PARTIAL SUM (B,H,W,D)           
*                 SOLVALU=PARTIAL SUM (VALUE) TO BE RESOLVED BY  RR             
*                                                                               
*        CALL:    BAL,R15  CHGRR                                                
*                                                                               
*        OUTPUT:  R7=UNCHANGED                                                  
*                 R8=BIT 28 SET IF PARTIAL SUM IS CONSTANT OR MIXED RES.        
*                 R10=PREVIOUS RESOLUTION OF PARTIAL SUM                        
*                 SOLRR=NEW RESOLUTION                                          
*                 SOLVALU=PARTIAL SUM(VALUE) WITH NEW RESOLUTION                
*                                                                               
*                                                                               
CHGRR    RES      0                                                             
         LW,R9    SOLRR                                                         
         BEZ      SRR40             CONSTANT                                    
         LI,R6    0                     ADDR RESOLUTION INDEX                   
SRR10    LB,R10   SOLRR,R6          DOES RESOLUTION COUNTER EQUAL               
         BEZ      SRR30             A SIMPLE ADDRESS                            
         CI,R10   1                                                             
         BE       SRR20                 YES                                     
         CI,R10   X'FF'                                                         
         BNE      SRR40                 NO,MIXED RESOLUTION                     
SRR20    AND,R9   SRR50,R6              YES,ARE OTHER RESOLUTION                
*                                           COUNTERS ZERO                       
         BNEZ     SRR40                         NO,MIXED RESOLUTION             
         LW,R8    SOLVALU                       YES,IS PARTIAL SUM A            
         SAS,R8   -19,R6                            SIMPLE ADDRESS              
         CI,R8    0                                                             
         BE       SRR25                                                         
         CI,R8    -1                                                            
         BNE      SRR40                                 NO,DONT RESOLVE         
SRR25    STW,R9   SOLRR             CHANGE PARTIAL SUM TO NEW RESOLUTION        
         STB,R10  SOLRR,R7          AND SET COUNTER                             
         LW,R10   R6                                                            
         LW,R9    SOLVALU                                                       
         SW,R6    R7                    SHIFT=(FROM RR)-(TO RR)                 
         SAS,R9   0,R6                                                          
         STW,R9   SOLVALU                                                       
         LI,R8    ADDRESS           SIMPLE ADDRESS                              
         B        *R15                                                          
SRR30    AI,R6    1                                                             
         B        SRR10                                                         
SRR40    LI,R8    CONSTANT          CONSTANT OR MIXED RESOLUTION                
         B        *R15                                                          
*                                                                               
*                                                                               
SRR50    DATA     X'00FFFFFF'       MASK TO EXCLUDE BYTE RESOLUTION             
         DATA     X'FF00FFFF'                       HALF                        
         DATA     X'FFFF00FF'                       WORD                        
         DATA     X'FFFFFF00'                       DW                          
         TITLE    '       **** STORCBV ****'                                    
*                                                                               
*        PURPOSE: STORE RESULTS FROM SOLVEX IN T:VALUE FORMAT ENTRY             
*                                                                               
*        INPUTS:  R5=BA OF ENTRY                                                
*                 R8=D,V,C BITS                                                 
*                 R9=VALUE                                                      
*                                                                               
*        CALL:    BAL,R14  STORCBV                                              
*                                                                               
*        OUTPUT:  R5=BA OF 5TH BYTE IN ENTRY                                    
*                 R8,R9 UNCHANGED                                               
*                                                                               
*        CALLS:   WORD                                                          
*                                                                               
*                                                                               
STORCBV  EQU      %                                                             
         LB,R0    0,R5                                                          
         AND,R0   X:TYFLB                                                       
         OR,R0    R8                                                            
         STB,R0   0,R5                                                          
         WORD                                                                   
         B        *R14                                                          
         TITLE    '       **** SYMFBA ****'                                     
*                                                                               
*        PURPOSE: GET FBA OF T:SYMBOL ENTRY,GIVEN ENTRY NUMBER                  
*                                                                               
*        INPUT:   R9=ENTRY NO.                                                  
*                                                                               
*        CALL:    BAL,R15  SYMFBA                                               
*                                                                               
*        OUTPUT:  R9=UNCHANGED                                                  
*                 R5=FBA OF T:SYMBOL ENTRY                                      
*                                                                               
*        CALLS:   RDIAG                                                         
*                                                                               
*                                                                               
SYMFBA   EQU      %                                                             
         LI,R8    0                 ENTRY NO. COUNTER                           
         LW,R5    FBA:SYM                                                       
         LW,R10   FBA:SYM           COMPUTE LBA+1 OF TABLE                      
         AW,R10   BDP:SYM                                                       
SYMF10   CW,R5    R10               END OF TABLE                                
         BGE      SYMF30                YES                                     
         LB,R0    0,R5                                                          
         CI,R0    X'80'             CONTINUATION ENTRY                          
         BANZ     SYMF20                YES                                     
         AI,R8    1                     NO                                      
         CW,R8    R9                EQUAL ENTRIES                               
         BE       *R15                  YES,EXIT                                
SYMF20   AND,R0   X:7F              CONTINUATION ENTRY,MASK BYTE COUNT          
         AW,R5    R0                                                            
         B        SYMF10                                                        
SYMF30   LI,R9    PROGERR           OUTPUT ALARM AND ABORT                      
         LW,R7    R15                                                           
         RDIAG                                                                  
         TITLE    '       **** TBENTRY ****'                                    
*                                                                               
*        PURPOSE: TO COMPUTE BYTE ADDRESS OF TABLE ENTRY                        
*                                                                               
*        INPUT:   R5=FBA OF T:DECL ENTRY OR BA OF 2ND BYTE IN                   
*                    T:VALX/T:FWDX VALUE ENTRY                                  
*                                                                               
*        CALL:    BAL,R15  TBENTRY                                              
*                                                                               
*        OUTPUT:  R1=TABLE AREA INDEX                                           
*                 R5=FBA OF ENTRY IN T:DCB,T:VALUE,T:CSECT,OR T:PUBVAL          
*                 R9=ENTRY NUMBER                                               
*                                                                               
*        CALLS:   NO SUBROUTINES                                                
*                                                                               
*        USES:    R1,R5,R9                                                      
*                                                                               
*                                                                               
TBENTRY  EQU      %                                                             
         LB,R9    0,R5              GET TWO BYTE ENTRY                          
         SLS,R9   8                                                             
         AI,R5    1                                                             
         LB,R5    0,R5                                                          
         OR,R5    R9                                                            
         AND,R5   X:3FFF            MASK ENTRY NO.                              
         SLS,R9   -14                                                           
         LW,R1    R9                                                            
         LB,R1    TB20,R1                                                       
         LW,R9    R5                                                            
         AI,R5    -1                                                            
         MW,R5    T:NBE,R1                                                      
         AW,R5    T:FBA,R1                                                      
         B        *R15                                                          
*                                                                               
*                                                                               
TB20     DATA,1   T:DCB,T:VALUE,T:CSECT,T:PUBVAL                                
         TITLE    '       **** WORD ****'                                       
*                                                                               
*        PURPOSE: TO STORE REGISTER WORD INTO A 4-BYTE ENTRY                    
*                                                                               
*        INPUT:   R5=BA-1 OF 4-BYTE ENTRY                                       
*                 R9=DATA WORD                                                  
*                                                                               
*        CALL:    BAL,R15  WORD                                                 
*                                                                               
*        OUTPUT:  R5=BA OF LAST BYTE OF ENTRY                                   
*                 R9=UNCHANGED                                                  
*                                                                               
*        CALLS:   NO SUBROUTINES                                                
*                                                                               
*        USES:    R5,R7,R9                                                      
*                                                                               
*                                                                               
WORD     EQU      %                                                             
         LI,R7    4                                                             
WRD10    AI,R5    1                                                             
         SCS,R9   8                                                             
         STB,R9   0,R5                                                          
         BDR,R7   WRD10                                                         
         B        *R15                                                          
         TITLE    '       **** XBC ****'                                        
*                                                                               
*        PURPOSE: TO COUNT THE NUMBER OF BYTES IN A T:VALX/T:FWDX               
*                 EXPRESSION                                                    
*                                                                               
*        INPUT:   R5=FBA OF EXPRESSION                                          
*                                                                               
*        CALL:    BAL,R15   XBC                                                 
*                                                                               
*        OUTPUT:  R5=UNCHANGED                                                  
*                 R6=BYTE COUNT OF EXPRESSION                                   
*        CALLS:   RDIAG                                                         
*                                                                               
XBC      EQU      %                                                             
         LW,R6    R5                                                            
XBC10    LB,R0    0,R6                                                          
         CI,R0    X'40'                                                         
         BGE      XBC60             ILLEGAL LOAD ITEM FOR EXPRESSION            
         CI,R0    X'30'                                                         
         BGE      XBC50             ADDRESS RESOLUTION ITEM                     
         CI,R0    X'20'                                                         
         BGE      XBC30             VALUE ITEM                                  
         CI,R0    X'01'                                                         
         BE       XBC20             ADD CONSTANT                                
         CI,R0    X'02'                                                         
         BNE      XBC60             ILLEGAL LOAD ITEM FOR EXPRESSION            
         AI,R6    1                 EXPRESSION END ITEM                         
         SW,R6    R5                                                            
         B        *R15                                                          
XBC20    AI,R6    5                                                             
         B        XBC10                                                         
XBC30    AI,R6    3                                                             
         B        XBC10                                                         
XBC50    AI,R6    1                                                             
         B        XBC10                                                         
XBC60    LI,R9    LOADITEM          OUTPUT ALARM 'ILLEGAL LOAD ITEM'            
         LW,R7    R15                                                           
         RDIAG                      AND ABORT                                   
         TITLE    '       **** ZERONXT ****'                                    
*                                                                               
*        PURPOSE: ZERO NEXT ENTRY IN DYNAMIC TABLE AND EXTEND TABLE             
*                 AREA,IF NECESSARY                                             
*                                                                               
*        INPUT:   R1=TABLE AREA INDEX                                           
*                                                                               
*        CALL:    BAL,R14  ZERONXT                                              
*                                                                               
*        OUTPUT:  R5=FBA OF ENTRY                                               
*                 R1=UNCHANGED                                                  
*                                                                               
*        CALLS:   EXTEND                                                        
*                                                                               
*                                                                               
ZERONXT  EQU      %                                                             
ZN10     LW,R5    T:FBA,R1          CALCULATE FBA OF ENTRY                      
         AW,R5    T:BDP,R1                                                      
         LW,R6    R5                                                            
         LW,R7    R5                CALCULATE LBA+1 OF ENTRY                    
         AW,R7    T:NBE,R1                                                      
         LI,R0    0                                                             
         CW,R7    T:LBA,R1          WOULD TABLE EXCEED AREA                     
         BLE      ZN20                                                          
         EXTEND                         YES,EXTEND AREA                         
         B        ZN10                                                          
ZN20     CW,R6    R7                    NO,ZERO ENTRY                           
         BGE      *R14                                                          
         STB,R0   0,R6                                                          
         AI,R6    1                                                             
         B        ZN20                                                          
         TITLE    '       **** ZEROX ****'                                      
*                                                                               
*        PURPOSE: TO ZERO ENTRY TO AND INCLUDING EXPRESSION END BYTE            
*                                                                               
*        INPUT:   R5=FBA OF EXPRESSION                                          
*                                                                               
*        CALL:    BAL,R14 ZEROX                                                 
*                                                                               
*        OUTPUT:  R5=LBA+1 OF EXPRESSION                                        
*                                                                               
*        CALLS:   XBC                                                           
*                                                                               
*                                                                               
ZEROX    RES      0                                                             
         XBC                        COUNT THE NUMBER OF BYTES IN THE            
         AW,R6    R5                EXPRESSION                                  
         LI,R0    0                                                             
ZX10     CW,R5    R6                                                            
         BGE      *R14                                                          
         STB,R0   0,R5                                                          
         AI,R5    1                                                             
         B        ZX10                                                          
         PAGE                                                                   
         GOTO,NOV+1    HEXTALS%,HEXTALS                                         
HEXTALS  RES      100                                                           
HEXTALS% EQU      %                                                             
*                                                                               
*                                                                               
*        ****************************                                           
*        *                          *                                           
*        *  END   ROOT              *                                           
*        *                          *                                           
*        *                          *                                           
*        ****************************                                           
*                                                                               
         END      EXEC                                                          
