***************************************************************
*M*      DELTA    CP-V USER ON-LINE DEBUGGER
***************************************************************
*P*
*P*      NAME:    DELTA, ON-LINE DEBUGGER
*P*
*P*      PURPOSE: DELTA IS A CP-V SHARED PROCESSOR WHICH MAY
*P*               BE ASSOCIATED WITH A USER PROGRAM WHILE
*P*               THAT PROGRAM EXECUTES.  DELTA PROVIDES AN
*P*               EXTENSIVE DEBUGGING CAPABILITY TO THE USER
*P*               INCLUDING MEMORY DISPLAY AND MODIFICATION,
*P*               SYMBOL TABLES, EXECUTION CONTROL, AND
*P*               BREAKPOINT CAPABILITY.
*P*
*P*      DESCRIPTION:  DELTA MAY BE ASSOCIATED WITH ANY USER
*P*               PROGRAM BY EITHER SPECIFYING THE 'UNDER'
*P*               KEYWORD TO TEL OR RETURNING TO TEL DURING
*P*               EXECUTION OF THE PROGRAM AND ENTERING A
*P*               !DELTA COMMAND.
*P*
*P*               CP-V/DELTA INTERFACE--
*P*
*P*               TWO BITS IN THE USER FLAG (UH:FLG) ARE USED
*P*               BY CP-V TO DETERMINE 1) IF DELTA IS ASSOCIATED
*P*               AND 2) IF DELTA IS IN CONTROL.  IF EITHER OF THESE
*P*               BITS IS SET, CP-V TRANSFERS CONTROL TO DELTA
*P*               WHENEVER A TRAP, ABORT, OR BREAK OCCURS.
*P*
*P*               IF THE 'DELTA IN CONTROL' BIT IS SET, MEMORY
*P*               PROTECTION TRAPS ARE MONITORED BY CP-V 40TRAP
*P*               PROCESSING SUCH THAT IF THE PROTECTED LOCATION
*P*               IS WITHIN THE USER PROGRAM'S PURE PROCEDURE,
*P*               THE INSTRUCTION IS RE-EXECUTED BY THE MONITOR
*P*               AND RETURN IS MADE TO DELTA AS IF NO TRAP HAD
*P*               OCCURRED.  THIS ALLOWS DELTA TO MODIFY PURE
*P*               PROCEDURE AND TO SET INSTRUCTION BREAKPOINTS.
*P*
*P*               ALL ENTRIES TO DELTA ARE MADE BY PUSHING THE
*P*               CURRENT ENVIRONMENT INTO DELTA'S STACK (LOCATED
*P*               AT THE MONITOR DEF 'SPDBASE'), AND ENTERING
*P*               DELTA AT A SPECIFIC BRANCH VECTOR (LOCATED AT
*P*               THE MONITOR DEF 'SPPBASE'+BRANCH OFFSET).
*P*
*P*                            TRAPENT  = SPPBASE+X'C'
*P*                            BREAKENT = SPPBASE+X'D'
*P*                            EXITENT  = SPPBASE+X'E'
*P*                            SEGLDENT = SPPBASE+X'F'
*P*
*P*               EXITS FROM DELTA TO THE USER LEVEL  (;G, ;P, ;Y,
*P*               ;X, AND STEPMODE) ARE MADE VIA AN M:TRTN CAL
*P*               TO ENSURE RE-ASSOCIATION OF ANY SHARED PUBLIC
*P*               LIBRARY AND TO FORCE THE CHANGE IN THE USER FLAG
*P*               FROM 'DELTA IN CONTROL' TO 'DELTA IS ASSOCIATED'.
*P*
*P*               THE COC ROUTINES OF CP-V RECOGNIZE CERTAIN
*P*               CHARACTERS AS 'ACTIVATION' CHARACTERS WHEN DELTA
*P*               IS IN CONTROL.  THESE CHARACTERS (EQUAL, SLASH,
*P*               UP-ARROW, RT-PAREN, AND TAB), AS WELL AS CR OR LF,
*P*               TERMINATE THE READ AND RETURN CONTROL TO DELTA.
*P*
*P*               DELTA/USER PROGRAM INTERFACE--
*P*
*P*               ONCE DELTA HAS BEEN ASSOCIATED WITH THE USER,
*P*               IT IS GIVEN CONTROL ON ANY BREAK, TRAP, OR
*P*               ABORT.  THE MONITOR PUSHES THE CURRENT ENVIRONMENT
*P*               INTO DELTA'S STACK, SETS UP ANY NECESSARY REG-
*P*               ISTERS, AND GIVES CONTROL TO DELTA AT THE
*P*               APPROPRIATE ENTRY.
*P*
*P*               WHENEVER DELTA IS ENTERED FROM THE USER, IT
*P*               RESTORES ALL I-BRKS, D-BRKS, AND TRANSFER BREAKS
*P*               TO THEIR ORIGINAL INSTRUCTIONS AND/OR ACCESS.
*P*               AFTER ALL THE COMMANDS HAVE BEEN ENTERED AND THE
*P*               USER SPECIFIES RETURN TO HIS PROGRAM, THE I-BRKS,
*P*               D-BRKS, ETC. ARE RE-SET IN THE USER'S PROGRAM
*P*               AND AN M:TRTN IS EXECUTED TO RESTORE REGISTERS
*P*               AND RETURN TO THE REQUESTED (OR INTERRUPTED)
*P*               LOCATION.
*P*
*P*               A NON-EXISTENT INSTRUCTION IS USED FOR I-BRKS AND
*P*               TRANSFER BREAKS SO THAT THE TRAP WILL RETURN
*P*               CONTROL TO DELTA.  ACCESS IS SET TO 'READ-AND-
*P*               EXECUTE' ON PAGES WHICH CONTAIN D-BRKS, SO THAT
*P*               A MEMORY PROTECTION TRAP WILL RETURN CONTROL TO
*P*               DELTA WHENEVER THE USER PROGRAM ATTEMPTS TO STORE
*P*               IN THE PROTECTED PAGE.
*P*
*P*      REFERENCE:  XEROX CP-V TIME SHARING REFERENCE MANUAL
*P*               (90 09 07) FOR DELTA LANGUAGE AND USER LEVEL
*P*               DESCRIPTION.
*P*
         PCC      0
         PAGE
************************************************************************
*                                                                      *
*                 INITIALIZATION                                       *
*                                                                      *
*                                                                      *
************************************************************************
         TITLE    'D00 USER DELTA:  8/01/75'
TEST     EQU      0                 DEBUG VERSION IF ONE
ALPHA    DSECT    0                 DECLARE CONTEST CONTROL SECTION.
*                                  THIS PREVENTS FPT'S FROM BEING
*                                  INSERTED BEFORE DELTAS TEMP STACK
*                                  IN THE CONTEXT AREA
CLOSE%XX COM,12,20 X'041',CLOSE%FPT
EXECUTE  COM,12,20 X'049',5         M:TRTN RETURN FROM TRAP
OPEN%CAL COM,12,20 X'041',OPEN%FPT
PRINT    COM,12,20 X'041',PRNTFPT
SET%ACCESS        ;
         COM,12,20 X'048',ACCESS%FPT    M:SMPRT SET MEMORY PROTECTION
WRITE%UC COM,12,20 X'041',UCWTFPT
*
WRT%UC  CNAME                      WRITES TEXTC MESSAGES
        PROC
        LI,1     AF(1)             BUFFER ADR
        LB,2     AF(1)             BYTE COUNT
        LI,3     1                 BYTE DISPLACEMENT
         WRITE%UC                   WRITE CAL
         PEND
*
         PAGE
DELTA%PROCEDURE   ;
         CSECT    1                 PROTECTION TYPE 1 FOR PROCEDURE
DELTA%BASE        ;
         EQU      %
DEL      EQU      DELTA%BASE
         DEF      T:DTRAP           TRAP ENTRY POINT
         DEF      DEL               BRANCH VECTOR ENTRY POINT
*,*                                 (PROCEDURE BEGINNING FOR GENMD)
         DEF      PCH               PURE PROCEDURE PATCH AREA
         DEF      PCHD              DATA PATCH AREA
         REF      J:JIT             USER JIT ADDRESS
         REF      J:INTENT          ANALZ/MONFIX ENTRY TABLE LOC
         REF      J:EXTENT          XCON ENTRY ADDRESS
         REF      J:EUP             USER PROCEDURE UPPER LIMIT
         REF      J:TCB             USER TEMP STACK ADDRESS
         REF      MXFPL             M:XX FPL AREA WHERE RUNNER STORES
*,*                                 LMN NAME, START LOC, AND ACCT.
         REF      J:PUL             END OF PROCEDURE, SYMBOLS ARE
*,*                                 RELOCATED HERE FOR LOADED LMNS
*,*                                 IF STARTED UNDER DELTA
         REF      J:DDLL            USED TO TEST IF STARTED UNDER
*,*                                 DELTA.
         REF      J:TREE            ADDRESS OF PGM TREE (IF PRESENT)
         REF      M:XX              DCB USED FOR ACCESSING ERRMSG
*,*                                 FILE, SYMBOL TABLES, AND FOR
*,*                                 PRINTER OUTPUT.
         REF      M:UC              DCB FOR USER TERMINAL I/O
         REF      FPMC              UNASSIGNED PAGE CONSTANT
*,*                                 USED FOR BACKSLASH COMMAND AND
*,*                                 ADDRESS VERIFICATION.
         REF      JX:CMAP           USER MAP - REAL PAGES (SEE ABOVE)
         REF      J:JAC             USER ACCESS CODES
         REF      J:ABC             ABORT CODE, FIRST BYTE
         REF      J:ASSIGN          LIMIT FLAGS IN BITS 23 THRU 31
         REF      ERO               ERROR OVERRIDE ADDRESS
         PAGE
         SYSTEM   SIG7FDP
UTSPROC  SET      0
S69PROC  SET      1
         SYSTEM   UTS
         SYSTEM   BPM
*                                                                       00002000
* GIVE EACH ALPHABETIC & NUMERIC CHARACTER ITS EBCDIC VALUE             00003000
*                                                                       00009000
A        EQU      'A'                                                   00010000
B        EQU      'B'                                                   00011000
C        EQU      'C'                                                   00012000
D        EQU      'D'                                                   00013000
E        EQU      'E'                                                   00014000
F        EQU      'F'                                                   00015000
G        EQU      'G'                                                   00016000
H        EQU      'H'                                                   00017000
I        EQU      'I'                                                   00018000
J        EQU      'J'                                                   00019000
K        EQU      'K'                                                   00020000
L        EQU      'L'                                                   00021000
M        EQU      'M'                                                   00022000
N        EQU      'N'                                                   00023000
O        EQU      'O'                                                   00024000
P        EQU      'P'                                                   00025000
Q        EQU      'Q'                                                   00026000
R        EQU      'R'                                                   00027000
S        EQU      'S'                                                   00028000
T        EQU      'T'                                                   00029000
U        EQU      'U'                                                   00030000
V        EQU      'V'                                                   00031000
W        EQU      'W'                                                   00032000
X        EQU      'X'                                                   00033000
Y        EQU      'Y'                                                   00034000
Z        EQU      'Z'                                                   00035000
*                                                                       00036000
*                                                                       00038000
#0       EQU      '0'                                                   00039000
#1       EQU      '1'                                                   00040000
#2       EQU      '2'                                                   00041000
#3       EQU      '3'                                                   00042000
#4       EQU      '4'                                                   00043000
#5       EQU      '5'                                                   00044000
#6       EQU      '6'                                                   00045000
#7       EQU      '7'                                                   00046000
#8       EQU      '8'                                                   00047000
#9       EQU      '9'                                                   00048000
#@       EQU      '%'                                                   00049000
*                                                                       00050000
* MISCELLANEOUS SYMBOLS FOR USE IN DATA, RES, AND BOUND PSEUDO-OPS      00051000
*                                                                       00052000
BT       EQU      1                                                     00053000
HW       EQU      2                                                     00054000
FW       EQU      4                                                     00055000
DW       EQU      8                                                     00056000
ONEPAGE  EQU      2048                                                  00057000
*                                                                       00058000
* SPECIAL SYMBOLS USED IN GENERATING THE SYMBOL TABLE                   00059000
*                                                                       00060000
#%       EQU      '%'                                                   00061000
#S:      EQU      ';'                                                   00062000
         M:PT     1                 FORCE FPTS TO PROCEDURE
         PAGE
*
*                 ENTRY POINTS FROM MONITOR
TRAPENT  B        T:DTRAP
BREAKENT B        T:DBRK
EXITENT  B        ABORTENT
SEGLDENT B        T:SEGLD
*                                                                       01955000
* DIFFERENT INITIALIZATION STEPS BEFORE STARTING THE SCANNER            01956000
*                                                                       01958000
* RESET EVERYTHING - USED FOR FRESH START                               01959000
*                                                                       01960000
DRINIT   LI,0     #CRLF             PUT TTY ON A NOW LINE               01961000
         BAL,1    DRPRTSML                                              01962000
         BAL,7    DUMPBUF           DUMP WAITING PUTPUT
         B        PMESS             GET A NEW COMMAND LINE
* RESET INTERNAL STATE - USED FOR CONTINUING A RELATED SET OF OPERATIONS01964000
*                                                                       01965000
DRINITA  LI,8     0                 RESET MASTER WORD                   01966000
         STW,8    DROPENSW          RESET OPEN REGISTER SWITCH          01966500
         STW,8    STRNGBUF
*                                                                       01967000
* RESET COUNTS AND FLAGS - USED FOR STARTING A NEW EXPRESSION           01968000
*                                                                       01969000
DRINITB  LI,5     0                 INITIALIZE FIELD NUMBER             01970000
         LI,9     0                 RESET FIELD FLAGS                   01971000
         LI,10    0                 ZERO ELEMENT COUNT                  01972000
         LI,11    0                 ZERO COMMA COUNT                    01973000
         STW,5    FLDREG            RESET FIELD PRESENCE FLAGS
         STW,11   DRLSTOPR          SET LAST ARITHMETIC OPERATOR TO PLUS01973100
         STD,11   DREXPRS           RESET EXPRESSION STORAGE            01973200
         STD,11   DREXPRS+2                                             01973300
*                                                                       01974000
* RESET ARGUMENT PARAMETERS - USED FOR STARTING A NEW TERM              01975000
*                                                                       01976000
DRINITC  LI,3     0                 ZERO VALUE STORAGE REGISTER         01977000
         STD,3    DRCHRBUF          INITIALIZE SYMBOL STORAGE LOCATION  01978000
         STW,3    DOTMODE           INITIALIZE DOTMODE TO 'OFF'
         STW,3    NOBREAKS          ENABLE BREAKS IN DELTA
         STW,3    GOTBREAK          TURN OFF PREVIOUS ONES
         LD,6     DRSCNSET          INITIALIZE THE SCANNER              01979000
         PAGE                                                           01983000
************************************************************************
*                                                                      *
*                                                                      *
*                 COMMAND PARSE                                        *
*                                                                      *
*                                                                      *
************************************************************************
*                                                                       01908000
* REGISTER ASSIGNMENTS DURING INPUT SCANNING PAASE                      01909000
*                                                                       01910000
*   R0  - INPUT CHARACTER                                               01911000
*   R1  - TEMPORARY STORAGE                                             01912000
*   R2  - TEMPORARY STORAGE                                             01913000
*   R3  - VALUE OF CURRENT TERM : IF NON-SYMBOLIC                       01914000
*   R4  - RETURN LINK FOR SUBROUTINE CALLS                              01915000
*   R5  - FIELD NUMBER BEING EVALUATED                                  01916000
*   R6  - COUNT OF CHARACTERS IN CURRENT TERM                           01917000
*   R7  - CONVERSION MODE OF CURRENT TERM                               01918000
*   R8  - FLAGS USED IN COMPUTING CURRENT EXPRESSION                    01919000
*   R9  - BITS SET TO TELL WHICH FIELDS WERE USED IN CURRENT EXPRESSION 01920000
*   R10 - COUNT OF ELEMENTS IN CURRENT EXPRESSION                       01921000
*   R11 - COUNT OF COMMA'S USED IN CURRENT EXPRESSION                   01922000
*   R12 - BIT WORD OF SYMBOL TO BE FOUND OR APPENDED TO TABLE           01923000
*   R13 - VALUE OF SYMBOL IF IT IS BEING ADDED TO TABLE                 01924000
*   R14 - SYMBOL NAME : MAY BE AS MANY AS 8 CHARACTERS LONG             01925000
*   R15 - NAME IS HERE ONLY DURING SEARCHES, OTHERWISE IT IS IN MEMORY  01926000
*                                                                       01927000
*                                                                       01984000
* MAIN SCANNING ROUTINE                                                 01985000
*                                                                       01986000
DRSCAN1  BAL,4    INPTCHAR          GET NEXT CHAR IN MESSAGE
         AI,7     0                 CHECK FOR BEING IN EBCDIC MODE      01988000
         BLEZ     DRINPEBD          YES, IT IS
         CI,0     X'B1'             SPECIAL CHECK FOR BACKSLASH
         BE       DRSCANP           YES, ITS PUNCTUATION
         CI,0     K80               CHECK CHARACTER TYPE                01991000
         BANZ     DRBUILD,7         IS IT A LETTER OR DIGIT
         CLM,0    DRALPHAS          NO - KEEP CHECKING                  01993000
         BCR,9    DRBUILD,7         CHECK FOR COLON, SHARP, AT SIGN
         CI,0     #DOLLAR           NOT ONE OF THOSE - CHECK DOLLAR SIGN01995000
         BE       DRBUILD,7         IS THAT WHAT IT IS?                 01996000
         CI,0     #UNDERL           CHECK UNDERLINE CHARACTER
         BE       DRBUILD,7         ITS A VALID SYMBOL CHARACTER TOO
         CI,8     DRDEFMOD          NO - CHECK FOR SYMBOL DEFINE MODE   01996200
         BANZ     DRDEFCHK          BRANCH IF WE ARE IN THAT MODE
         CI,0     X'4D'             CHECK FOR LEFT PAREN-MODE SET
         BE       CHNGMODE          YES, GO DO IT
DRSCANP  RES
         LI,2     K3F               MUST BE A PUNCTUATION CHARACTER     01997000
         AND,2    0                 SCRUB OFF ALL BUT LOW 6 BITS        01998000
         LB,1     DRKEY1,2          GET CORRESPONDING INDEX             01999000
         LH,4     DRPOINT1,1        GET RELATIVE ADR OF ROUTINE
         AI,4     DELTA%BASE        ADD BASE ADR
         CI,1     DRVAL1            CHECK INDEX                         02001000
         BL       DREVAL            SHOULD WE EVALUATE?                 02002000
         B        0,4               NO - GO PROCESS INPUT               02003000
         PAGE                                                           02005000
************************************************************************
*                                                                      *
*                                                                      *
*                 FORMATTING ROUTINES - INPUT & OUTPUT                 *
*                                                                      *
*                                                                      *
************************************************************************
*                                                                       02006000
* ROUTINE TO INPUT INTEGERS                                             02007000
*
* THIS ROUTINE HAS TWO ENTRY POINTS                                     02008000
*   DRINPNUM                                                            02009000
*     THIS IS THE INITIAL ENTRY WHEN SCANNING IS STARTED                02010000
*     IF THE INPUT IS A SYMBOL, THE MODE IS AUTOMATICALLY SWITCHED      02011000
*   DRINPINT                                                            02012000
*     THIS IS THE ENTRY FOR INTEGER INPUT                               02013000
*     ANY NON NUMERIC INPUT INDICATES AN ERROR                          02014000
*                                                                       02015000
DRINPNUM AI,6     0                 TEST CHARACTER COUNT                02016000
         BG       DRINPINT          TOO LARGE?                          02017000
         STB,0    DRCHRBFX,6        NO - STORE CHARACTER IN SYMBOL BUFFE02018000
         AI,6     1                 INCREMENT CHARACTER COUNT           02019000
DRINPINT AI,0     -KF0              SUBTRACT EBCDIC BASE VALUE          02020000
         BGEZ     DRCOMPIT          IS THIS CHARACTER A NUMBER?         02021000
         CI,7     #NUMTYPE          NO - CHECK FOR NUMBER TYPE          02022000
         BNE      DRVALERR          IS IT?                              02023000
DRINPSPC LI,7     #SYMTYPE          YES - SET TO SYMBOL TYPE            02024000
         B        DRSCAN1
DRCOMPIT MI,3     10                MULTIPLY CURRENT VALUE BY 10        02027000
         BOV      DRVALERR          DID AN OVERFLOW OCCUR
         AW,3     0                 NO                                  02029000
         BNOV     DRSCAN1           IS TOTAL VALUE CORRECT
         CW,3     DRBIT0            NO, MAX NEGATIVE NUMBER
         BNE      DRVALERR          NO - ERROR
         B        DRSCAN1           YES - OK
         PAGE                                                           02033000
*                                                                       02034000
* ROUTINE TO HANDLE SYMBOLIC INPUT                                      02035000
*                                                                       02036000
DRINPSYM AI,6     0                 HAVE WE FILLED THE BUFFER
         BGE      %+2               YES, DONT SAVE CHARS, ONLY COUNT
         STB,0    DRCHRBFX,6
         AI,6     1
         CI,6     31                HAVE WE GOT TOO MANY CHARS
         BL       DRSCAN1           NO
         B        DRVALERR          YES                                 02040000
*
* ROUTINE TO HANDLE HEXADECIMAL INPUT                                   02048000
*                                                                       02049000
DRINPHEX AI,0     -KF0              CONVERT TO HEXADECIMAL              02050000
         BGEZ     DRFIXIT           IS THIS A NUMBER?                   02051000
         CLM,0    DRHEXAS           NO!                                 02052000
         BCS,9    DRVALERR          IS IT A LETTER A-F?                 02053000
         AI,0     KF0-KC1+10        YES - CONVERT TO THE CORRECT VALUE  02054000
DRFIXIT  EQU      %
         CW,3     OVFLW%MASK        CHECK FOR OVERFLOW
         BCS,4    DRVALERR          IS THERE ANY?                       02056000
         SLS,3    4                 SHIFT ACCUMULATED VALUE
         AW,3     0                 ADD NEW CHARACTER                   02058000
         B        DRSCAN1           GO GET MORE                         02059000
*                                                                       02060000
* EBCDIC INPUT ROUTINE                                                  02063000
*                                                                       02064000
DRINPEBD CI,0     #SQUOTE           CHECK FOR SINGLE QUOTE              02065000
         BNE      DRINPEBM          WAS IT?                             02066000
         LI,7     #SPCTYPE          YES - SET MODE FOR SPECIAL INPUT    02067000
         B        DRSCAN1           SCAN FOR PUNCTUATION CHARACTER      02068000
DRINPEBM CW,3     DREBDMSK          CHECK NUMBER OF CHARACTERS INPUT    02069000
         BCS,4    DRVALERR          TOO MANY?                           02070000
         SCS,3    8                 NO - MOVE CURRENT VALUE OVER        02071000
         OR,3     0                 PUT NEW CHARACTER IN STRING         02072000
         B        DRSCAN1           CONTINUE BUILDING THE EBCDIC STRING 02073000
*                                                                       02074000
         PAGE
*                                                                       02266000
* HEXADECIMAL PRINT ROUTINE                                             02274000
*                                                                       02275000
DRPRTHXA LI,0      #PERIOD
         STW,4    TOUT
         BAL,4    TYPOUT
DRPRTHEX LI,1     -X'800'+4         SET UP HEXADECIMAL SHIFT PLUS COUNT 02278000
DRPRTHXM LI,2     0                 CLEAR UPPER REGISTER                02279000
         SLD,2    0,1               MOVE IN ONE CHARACTER               02280000
DRPRTHXO AI,2     0                 CHECK TO SEE IF ZEROES STILL COMING 02281000
         BNEZ     DRPRTHXR          ARE THEY?                           02282000
         AI,1     K100              YES - INCREMENT OUTPUT COUNTER      02282500
         AI,3     0                 CHECK PRINT ITEM                    02283000
         BNEZ     DRPRTHXM          IS ANYTHING LEFT?                   02284000
         LI,1     0                 SET END TEST SO THAT IT FAILS       02284500
         B        DRPRTHXR          NO - GO PRINT A ZERO                02285000
DRPRTHXN LI,2     0                 RESET UPPER REGISTER                02286000
         SLD,2    0,1               MOVE NEXT DIGIT INTO UPPER REGISTER 02287000
DRPRTHXR LB,0     DRDIGITS,2        GET EBCDIC EQUIVALENT               02288000
         BAL,4    TYPOUT
         AI,1     K100              ADVANCE OUTPUT COUNTER              02290000
         BLZ      DRPRTHXN          ARE THERE ANY DIGITS LEFT TO PRINT? 02291000
         B         *TOUT            NO, RETURN
*                                                                       02293000
*                                                                       02294000
* INTEGER PRINT ROUTINE                                                 02295000
*                                                                       02296000
DRPRTINT LI,1     0                 SET DIGIT COUNT=0                   02297000
         STW,4    TOUT
         AI,3     0                 CHECK PARITY OF NUMBER              02298000
         BGEZ     DRPRTINL          WAS IT NEGATIVE?                    02299000
         LI,0     #MINUS            YES - PRINT A MINUS SIGN            02300000
         BAL,4    TYPOUT
         LAW,3    3                 GET ABSOLUTE VALUE OF NUMBER        02302000
DRPRTINL LI,2     0                 ZERO UPPER PART OF NUMBER           02303000
         AI,1     1                 INCREMENT COUNT                     02304000
         DW,2     DRD10             DIVIDE VALUE BY 10                  02305000
         STB,2    DRVALSAV,1        SAVE REMAINDER                      02306000
         BNEZ     DRPRTINL          IF QUOTIENT NON-ZERO, GO SOME MORE  02307000
DRPRTIN1 LB,0     DRVALSAV,1        GET MOST SIGNIFICANT DIGIT LEFT     02308000
         AI,0     KF0               ADD OFFSET TO MAKE IT PROPER EBCDIC 02309000
         BAL,4    TYPOUT
         BDR,1    DRPRTIN1          ANY DIGITS LEFT TO PRINT?           02311000
         B        *TOUT             NO-RETURN
*                                                                       02313000
*                                                                       02314000
* EBCDIC PRINT ROUTINE                                                  02315000
*                                                                       02316000
DRPRTEBD LW,0     3                 MOVE VALUE TO REGISTER 0            02317000
         STW,4    TOUT              SAVE RETURN ADR
         LI,1     4                 SET UP INDEX FOR LOOP               02318000
         LI,15    0
PTEBD10  EQU      %
         CB,15    0                 IF BYTE GOING OUT IS 0 (END OF
         BNE      %+2               MESSAGE TO COC), SUB BLANK (.40)
         OR,0     Y4
*
         SCS,0    8                 PUT DESIRED CHARACTER IN LOWER 8 BIT02319000
         BAL,4    TYPOUT
         BDR,1    PTEBD10
         B        *TOUT             RETURN
*                                                                       02323000
*                                                                       02346000
         PAGE
* ROUTINE TO PRINT A FLOATING POINT NUMBER
*   INPUT
*     R3: SHORT F.P. VALUE; OR 1ST WORD OF LONG F.P. VALUE
*     FLOAT2ND: 2ND WORD OF LONG F.P. VALUE
*   LINK: R4
*   TEMPORARY REGISTERS: R0,R1.  (R3-R11 ARE USED, BUT RESTORED AFTER)
*
*   NOTE: SINCE THIS CODE WAS MOSTLY 'LIFTED' FROM TWO FORTRAN
*         PROCESSORS, THE PARAMETERIZATION OF REGISTERS, CHARACTER
*         VALUES, ETC., DOES NOT FOLLOW THAT TO BE FOUND ELSEWHERE
*         THROUGHOUT DELTA.
*
*
*     REGISTER  DEFS FOR F.P. OUTPUT ROUTINES
*
CHAR     EQU      0                 CHARACTER
1STFPREG EQU      3                 FIRST F.P. REG NO.
X3       EQU      3                 INDEX
LINK     EQU      4                 SUBR LINK (MUST BE 4: TYPOUT)
RL       EQU      5                 SUBR LINK
DPOS     EQU      6                 DIGIT POSITION (+ TO RT OF PT)
DCT      EQU      7                 DIGIT COUNT
XT       EQU      8                 FRACTION TEMP
         OPEN     R
R        EQU      8                 FRACTION TEMP (HI ORDER)
R1       EQU      9                 FRACTION TEMP (LO ORDER)
R2       EQU      10                BINARY EXPONENT
R3       EQU      11                DECIMAL EXPONENT
NTHFPREG EQU      11                LAST F.P. REG NO.
NFPREGS  EQU      NTHFPREG-1STFPREG+1   NUMBER OF F.P. REGS
*
*  FLOATING POINT OUTPUT CONVERSION ROUTINES
*
*
*     PRINT SHORT F.P. VALUE
*
DRPRTFS  LCI      NFPREGS           SAVE ALL F.P. REGS
         PSM,1STFPREG  DELSTK
         LI,CHAR  'E'               SET UP FOR FS PRINT: EXP CHAR = 'E',
         LI,DCT   6                     NUMBER OF DIGITS = 6,
         LI,R1    0                     2ND WORD OF VALUE = 0.
         B        REAL0
*
*     PRINT LONG F.P. VALUE
*
DRPRTFL  LCI      NFPREGS           SAVE ALL F.P. REGS
         PSM,1STFPREG  DELSTK
         LI,CHAR  'D'               SET UP FOR FL PRINT: EXP CHAR = 'D',
         LI,DCT   15                    NUMBER OF DIGITS = 15,
         LI,R1    999                   SET FLOAT DBL FLAG
         XW,R1    FLOAT2ND              WHILE RETRIEVING 2ND WORD
REAL0    STW,CHAR EXPCHAR           STORE EXPONENT CHAR ('D' OR 'E')
         STW,DCT  DCOUNT            STORE DIGIT COUNT (6 OR 15)
         STW,3    CENTRAL1          STORE 1ST WORD OF F.P. VALUE
         STW,R1   CENTRAL2          STORE 2ND WORD OF F.P. VALUE
*     SETUP DONE; TEST SIGN OF VALUE
         LCD,XT   CENTRAL1          IF THE NUMBER
         BNEZ     REALJ5              IS ZERO,
REALJ4   LW,CHAR  ='0.0'              OUTPUT '0.0'
         BAL,1    DRPRTSML
         B        REAL22
REALJ5   RES      0
         BLZ      REAL1             IF THE NUMBER IS NEGATIVE,
         STD,XT   CENTRAL1            SAVE THE COMPLEMENT,
         LI,CHAR  C'-'                AND OUTPUT
         BAL,LINK TYPOUT              A MINUS SIGN.
REAL1    CW,XT    =X'00FFFFFF'      IF VALUE IS DIRTY ZERO,
         BANZ     REALJ6
         AI,XT+1  0
         BEZ      REALJ4                TREAT IT LIKE HONEST ZERO.
REALJ6   BAL,LINK UNFLOAT           UNFLOAT AND ROUND THE REAL NUMBER
         LW,XT    PWR10             IF DECIMAL POINT WILL FIT
         BLZ      REAL4               WITHIN THE NUMBER, OUTPUT
         CW,XT    DCOUNT              AS 'F'; ELSE AS 'E'
         BLE      REAL2
*     HERE TO OUTPUT IN 'E' FORMAT
REAL4    MTW,-1   PWR10             ADJUST EXPONENT SO NUMBER
         LI,DPOS  -1                  WILL PRINT AS X.XXX IN 'E' FORMAT
         B        REAL3
*     HERE TO OUTPUT IN 'F' FORMAT.
REAL2    LI,LINK  0
         LCW,DPOS PWR10
         STW,LINK PWR10             CLEAR PWR10 TO INDICATE  'F' FORMAT
REAL3    LD,XT    CENTRAL1
         LW,DCT   DCOUNT
         B        REAL6
*     ELIMINATE LAST DIGIT PRINTED BY MPY BY 10
REAL5    LD,XT    CENTRAL1
         SLD,XT   2
         AD,XT    CENTRAL1
         SLD,XT   1
         AND,XT   =X'7FFFFFFF'
         STD,XT   CENTRAL1          NEW FRACTIONAL PART OF CENTRAL1,2
*     IF ALL OF INTEGRAL PORTION IS OUTPUT, OUTPUT DECIMAL POINT
REAL6    CI,DPOS  0
         BNE      REAL7             NOT CORRECT POSITION FOR DEC. PT.
         LI,CHAR  C'.'              OUTPUT
         BAL,LINK TYPOUT              A DECIMAL POINT.
REAL7    SLD,XT   -2                MPY CENTRAL1,2 BY 10 TO
         AD,XT    CENTRAL1            CONVERT NEXT FRACTIONAL
         SCS,XT   4                   DIGIT TO AN INTEGER
         OR,XT    =C'0'
         LW,CHAR  XT
         BAL,LINK TYPOUT            OUTPUT DIGIT
REAL8    AI,DPOS  1                 BUMP DIGIT POSITION
         BDR,DCT  REAL5             DECREASE COUNT AND RETURN IF MORE
         AI,DPOS  0                 DPOS >= 0.
         BGZ      REAL20            IF IT'S ZERO, WE HAVEN'T OUTPUT
         LI,CHAR  '.'                 THE DECIMAL POINT YET, AND IT'S
         BAL,LINK TYPOUT              TIME TO DO SO NOW.
REAL20   LW,CHAR  EXPCHAR           'D' OR 'E' CHAR FOR EXPONENT
         LW,XT    PWR10             DON'T PRINT 'E' IF 'F' FORMAT
         BEZ      REAL22              WAS USED.
REAL21   BAL,LINK TYPOUT            OUTPUT EXPONENT CHAR
         LCI      NFPREGS           RESTORE F.P. REGS
         PLM,1STFPREG  DELSTK
         LW,3     PWR10             OUTPUT EXPONENT VALUE AS AN
         B        DRPRTINT            INTEGER; THEN EXIT VIA DRPRTINT.
REAL22   LCI      NFPREGS           RESTORE F.P. REGS
         PLM,1STFPREG  DELSTK
         B        0,LINK            EXIT
*
*  UNFLOAT
*
*                 UNPACKS A FLOATING POINT (LONG) NUMBER IN CENTRAL1,2
*                 INTO A FRACTION (IN CENTRAL1,2) AND DECIMAL EXPONENT
*                 (IN PWR10) SUCH THAT
*
*                        X = F*(10**E)
*                        0.1 <= F < 1
*
*                 WHERE, F = (2**(-31))*CENTRAL1(BITS 1-31)
*                           +(2**(-62))*CENTRAL2(BITS 0-30) ,
*                 AND    E = PWR10
*
UNFLOAT  RES      0
         LB,R2    CENTRAL1          HEX EXPONENT, EXCESS X'40'
         SLS,R2   2
         AI,R2    -4*64             CONVERT TO BINARY EXPONENT
         LD,R     CENTRAL1
         SLD,R    8
5Z1      AI,R     0                 NORMALIZE MANTISSA BINARILY
         BLZ      5Z2
         SLD,R    1
         AI,R2    -1
         B        5Z1
5Z2      SLD,R    -1
         LI,R3    0
*
*                 HENCEFORTH, THE VALUE OF THE NUMBER
*                 BEING OPERATED UPON IS
*
*                        F*(10**E)
*
*                 WHERE, F = G*(2**B)
*                        .5 <= G < 1
*                        G = (2**(-31))*R + (2**(-62))*R1(BITS 0-30)
*                        B = R2
*                        E = R3
*
         LI,X3    NTENS             = NUMBER OF TEN POWERS PROVIDED
         BAL,RL   TESTFRAC          TEST RANGE OF FRACTION
         BL       FRACLOW           IF F<.1, FRACTION TOO LOW
*
FRACHIGH STW,R2   ETEMP             SAVE BINARY EXPONENT
         SW,R2    TENE,X3           F>=1, FRACTION TOO HIGH
         CI,R2    -4                SCALE DOWN BY POWER OF TEN,
         BL       5Z3               UNLESS POWER TOO BIG
         STD,R    CENTRAL1          SAVE CURRENT VALUE
         CW,R     TENF,X3           DIVIDE FRAC BY FRAC OF TEN PWR
         BL       5Z4
         SLD,R    -1
         AI,R2    1
5Z4      SLD,R    -1
         DW,R     TENF,X3
         STW,R1   TEMP
         LW,R1    TENF,X3
         SLD,R    -1
         DW,R     TENF,X3
         SLS,R1   1
         LW,R     TEMP
         AW,R3    TENP,X3           ADJUST DECIMAL EXPONENT ACCORDINGLY
         BAL,RL   TESTFRAC          TEST RANGE OF RESULTING FRAC
         BG       FRACHIGH          STILL TOO HIGH, TRY AGAIN
         LD,R     CENTRAL1          TOO LOW, RESTORE OLD VALUE,
         SW,R3    TENP,X3               RESTORE OLD DECIMAL EXPONENT
5Z3      LW,R2    ETEMP             RESTORE OLD BINARY EXPONENT
         BDR,X3   FRACHIGH          TRY SCALING WITH SMALLER TEN PWR
*
FRACLOW  STW,R2   ETEMP             F<.1, TRY SCALING UP
         AW,R2    TENE,X3
         CI,R2    1
         BG       5Z5               UNLESS POWER TOO BIG
         STD,R    CENTRAL1          SAVE CURRENT FRAC
         SLS,R1   -1                MULTIPLY FRAC BY FRAC OF TEN PWR
         MW,R     TENF,X3
         SLD,R    1
         STW,R    ADLOC+1
         LW,R1    CENTRAL1
         MW,R     TENF,X3
         AD,R     ADLOC
         CW,R     =X'20000000'
         BANZ     5Z6
         SLD,R    1
         AI,R2    -1
5Z6      SLD,R    1
         SW,R3    TENP,X3           ADJUST DECIMAL EXPONENT ACCORDINGLY
         BAL,RL   TESTFRAC          TEST RANGE OF FRACTION
         BL       FRACLOW           STILL TOO SMALL, TRY AGAIN
         LD,R     CENTRAL1          TOO BIG, RESTORE OLD FRACTION
         AW,R3    TENP,X3           RESTORE OLD DECIMAL EXPONENT
5Z5      LW,R2    ETEMP             RESTORE OLD BINARY EXPONENT
         BDR,X3   FRACLOW           TRY SCALING WITH SMALLER TEN PWR
*
TESTFRAC CI,R2    0                 IF F>=1,
         BG      *RL                    RETURN WIH LCC=10
         CI,R2    -3                IF F<.1,
         BL      *RL                    RETURN WITH LCC=01
         BG       FRACOK            IF .1<=F<1, GO TO FRACOK
         CD,R     8TENTHS
         BL      *RL
*
FRACOK   LW,X3    R2                AT THIS POINT,  -3<= R2 <=0
         SLD,R    0,X3              SHIFT FRACTION TO PROPER PLACE
         LW,X3    DCOUNT            ROUND BY .5*10**(-DCOUNT)
         CI,X3    6
         BE       5Z8
         AD,R     ROUND15             = .5*10**(-15)
         B        5Z9
5Z8      AD,R     ROUND6              = .5*10**(-6)
5Z9      EQU      %
         BNOV     5Z7               IF ROUND OVERFLOWS FRACTION,
         LD,R     1TENTH                SET F=.1,
         AI,R3    1                     E := E+1
5Z7      RES      0
         STD,R    CENTRAL1          STORE FRACTION
         STW,R3   PWR10                 AND DECIMAL EXPONENT
         B        0,LINK            EXIT
*
*  POWERS OF TEN
*
*        THE POWERS OF TEN USED FOR BUILDING THE DECIMAL EXPONENT
*        ARE DEFINED IN THE TABLES BELOW.  EACH POWER HAS THREE
*        NUMBERS ASSOCIATED WITH IT: THE NUMBER (P) OF THE POWER,
*        PLACED IN THE TENP TABLE; THE FRACTION (F) AND BINARY
*        EXPONENT (E) PLACED IN THE TENF AND TENE TABLES, RESPECTIVELY.
*        THESE QUANTITIES MUST HAVE THE FOLLOWING PROPERTIES:
*
*                 1 <= P <= 13
*                 F*(2**E) = (2**31)*(10**P)
*                 2**30 <= F < 2**31
*
*
*  CURRENTLY USED VALUES:  1, 4, 13.
*
*
TENP     EQU      %-1
         DATA     1,4,13
NTENS    EQU      %-TENP-1
*
TENE     EQU      %-1
         DATA     4,14,44
TENF     EQU      %-1
         DATA     X'50000000'       = 10      *  2**27
         DATA     X'4E200000'       = 10**4   *  2**17
         DATA     X'48C27395'       = 10**13  *  2**(-13)
*
*
         BOUND    8
1TENTH   DATA     X'0CCCCCCC',X'CCCCCCCE'
8TENTHS  DATA     X'66666666',X'66666666'
ROUND6   DATA     X'00000431',X'BDE82D7C'   = .5 * 10**(-6)
ROUND15  DATA     X'00000000',X'00001204'   = .5 * 10**(-15)
*
         CLOSE    R
         PAGE
* ROUTINE TO PRINT AN EXPRESSION                                        02347000
*   INPUT                                                               02348000
*     R2: TYPE OF PRINT OUT DESIRED                                     02349000
*     R3: INPUT                                                         02350000
*     R8: DEFINED SWITCH                                                02351000
*   LINK : R4                                                           02352000
*   TEMPORARY REGISTERS : R0,R1                                         02353000
*                                                                       02354000
DRPTEXP  STW,3    DR#SEMIQ          SAVE VALUE IN ;Q                    02355000
         CI,2     1                 IS SYMBOLIC PRINTOUT REQUESTED
         BG       DRPRTVEC-2,2      NO, GO PRINT IN SPECIFIED FORMAT
*
         STW,4    DRPTEXP#          SAVE RETURN ADDRESS
         STW,3    DRWRDVAL          SAVE VALUE FOR USE LATER            02363000
         STW,2    DRPRTSW           SAVE MODE TYPE FOR ADDRESS PRINTER  02363250
         LI,4     DRPTEXPS          SET UP RETURN ADDRESS FROM DRSYMPT  02363500
         CW,3     DROPBITS          CHECK FOR OPCODE OR REGISTER BITS   02364000
         BAZ      DRPTEXPI          ARE ANY OF THOSE BITS SET
         LB,1     DRWRDVAL          YES - GET OPCODE FIELD              02366000
         AND,1    M7                SCRUB OFF INDIRECT BIT              02367000
         LH,2     DRWRDVAL          GET REGISTER BITS                   02367100
         AND,2    XF0               SCRUB OFF EXTRA BITS                02367200
         SCS,2    -4                RIGHT JUSTIFY THE REGISTER FIELD    02367300
         LW,6     OPCODES,1         USE OP CODE AS AN INDEX
         CW,6     DROPBITS          CHECK FOR ADDRESS OR MNEMONIC
         BANZ     DRMNEMPT          MNEMONIC. PRINT IT
         B        0,6               ADDRESS.  GO THERE.
DRPTEXPS LI,0     #COMMA            PRINT A COMMA                       02374000
         BAL,4    TYPOUT
         LW,3     2                 MOVE REGISTER VALUE TO R3           02375000
         BAL,4    DRPRTINT          PRINT REGISTER VALUE                02376000
DRPTEXPI LI,0     #2SPACE           PRINT 2 SPACES BEFORE THE ADDRESS   02377000
         BAL,1    DRPRTSML                                              02378000
DRPTEXPA LW,3     DRWRDVAL          CHECK TO SEE IF INDIRECT BIT SET    02379000
         BGEZ     DRPTEXPN          IS IT?                              02380000
         LI,0     #ASTRISK          YES - SEND OUT AN ASTERISK          02381000
         BAL,4    TYPOUT
DRPTEXPN AND,3    DRADMSKL          EXTRACT 20 BIT ADDRESS FIELD        02383000
         LI,4     DRPTEXPD          RETURN ADDRESS FROM PRINT ROUTINE   02384000
         CI,8     DRSOPRBT          CHECK FOR SPECIAL ADDRESS - 20 BIT  02385000
         BE       %+5               YES
         LI,2     0                 NO - CLEAR OUT FOR SHIFTING         02387000
         SCD,2    15                MOVE TAG BITS INTO R2               02388000
         STW,2    DRTAGVAL          SAVE INDEX NUMBER                   02389000
         SCS,3    17                FORM WORD ADDRESS
         LW,2     DRPRTSW           GET CURRENT ADR PRINT MODE
         BAL,4    DRPRTADR          PRINT ADDRESS
         LI,0     -1
         STW,0    SYM%TYPE          RESET SYM%TYPE TO 'NOT SET'
DRPTEXPD LW,4     DRPTEXP#          RESTORE RETURN ADDRESS              02397000
         CI,8     DRSOPRBT          CHECK FOR SPECIAL ADDRESS - 20 BIT  02397100
         BAZ      DRPTEXPT          IS IT
         AI,8     -DRSOPRBT         RESET INDICATOR FLAG                02397300
         B        0,4               RETURN                              02397400
DRPTEXPT LW,3     DRTAGVAL          GET TAG VALUE                       02398000
         BEZ      0,4               IS IT ZERO?                         02399000
         LI,0     #COMMA            NO - SEND OUT A COMMA               02400000
         BAL,4    TYPOUT
         LW,4     DRPTEXP#          GET RETURN ADR AGAIN
         B        DRPRTINT          PRINT A DECIMAL NUMBER AND RETURN   02402000
         PAGE
*                                                                       02407000
* THIS CODE HANDLES THE SPECIAL CASES (BYTE,IMMEDIATE,BRANCH,SHIFT)     02408000
*                                        (MODIFY AND TEST)
*                                                                       02409000
ACLMIMED AI,1     -X'20'            FORM INDEX
         LW,6     IMDOP,1           GET MNEMONIC
         B        SPECFLAG
TBSINST  AI,1     -X'40'            FORM INDEX
         LW,6     TBSOP,1           GET MNEMONIC
         B        SPECFLAG
CMEBS    AI,1     -X'60'            FORM INDEX
         CI,1     3                 EBS OPCODE
         BL       %+2               NO
         AI,1     -1                ADJUST INDEX
         LW,6     BYTOP,1           GET MNEMONIC
SPECFLAG OR,8     DRSOPRFL          SPECIAL OP CODE FLAG
         B        DRMNEMPT          PRINT MNEMONIC
LCFIINST EQU      %
         LI,6     LCFIOP            BASE OF LCFI INSTRUCTIONS
         CI,2     3                 REAL LCFI OPCODE
         BLE      SPCINDX           YES, GET REAL MNEMONIC
         LW,6     NOLCFI            NOT A REAL OPCODE
         B        DRMNEMPT          PRINT IN ORDINARY FASHION
LCFINST  EQU      %
         LI,6     LCFOP             BASE OF LCF INSTRUCTIONS
         CI,2     3                 REAL LCF OPCODE
         BLE      SPCINDX           YES, GET MNEMONIC
         LW,6     NOLCF             NOT A REAL OPCODE
         B        DRMNEMPT          PRINT IN ORDINARY FASHION
BCRINST  LI,6     BCROP             BASE ADDRESS OF BCR INSTRUCTIONS
         B        %+2
BCSINST  LI,6     BCSOP             BASE OF BCS INSTRUCTIONS
         CI,2     4                 DO WE KNOW ABOUT THIS ONE
         BG       PRNTSYM           NO, GO PRINT BCR OR BCS
         AI,6     1                 ADJUST INDEX INTO BRANCH CODES
SPCINDX  EQU      %
         AW,6     2                 YES, ADD INDEX TO GET SPECIAL CODE
         LI,4     DRPTEXPI          RETURN ADR AVOIDS OUTPUT OF REG.
PRNTSYM  LW,6     0,6               GET MNEMONIC
         B        DRMNEMPT
SHFTINST LI,6     SHFTOP            BASE ADR OF SHIFT INSTRUCTIONS
         LW,0     DRWRDVAL          GET EXPRESSION
         BLZ      PRNTSYM           INDIRECT SET, PRINT 'S ADR'
         AND,0    DRADMSKS          CLEAR OUT ALL BUT ADDRESS PORTION
         CI,0     K600              LEGAL SHIFT TYPE
         BGE      PRNTSYM           NO, PRINT  AS ABOVE
         AI,6     1                 INCREMENT INTO SPECIAL CODES
         SLS,0    -8                GET TYPE OF SHIF
         AW,6     0                 POSITION ADDRESS
         LW,1     SHFTMSK
         LS,0     DRWRDVAL          GET INDEX AND COUNT
         STW,0    DRWRDVAL          SAVE THEM
         B        PRNTSYM           PRINT IT.
*                                                                       02446000
MTXINST  AI,1     -X'33'            FORM INDEX
         SLS,1    -5                FOR MNEMONIC
         LW,6     MTWOP,1           GET IT
         CI,2     8                 IS R FIELD NEGATIVE
         BAZ      DRMNEMPT          NO, GO PRINT IT
         AI,2     X'FFFF0'          SET VALUE NEGATIVE
         B        DRMNEMPT          AND PRINT
         PAGE
* ROUTINE TO PRINT AN ADDRESS FIELD                                     02447000
*   INPUT                                                               02448000
*     R3 : ADDRESS TO BE PRINTED (AS A BYTE ADDRESS)                    02449000
*   LINK : R4                                                           02450000
*   TEMPORARY REGISTERS : R0,R1,R2                                      02451000
*                                                                       02452000
DRPRTADR EQU      %
         CI,2     1                 SYMBOLIC OUTPUT MODE
         BGE      DRPRTHXA          NO, HEX OUTPUT
         CI,3     K100              YES. CHECK VALUE
         BL       DRPRTHXA          LESS THAN X100-YES, PRINT HEX
         STW,4    DRPRTSAV          SVE RETURN ADR
         LI,5     -1
         LW,2     3                 COMPUTE LIMIT FOR
         SW,2     HEX%OFFSET        SYMBOL SEARCH
         AI,2     -1                *
         STD,2    DRSRCHLM          SAVE LIMITS
         LI,0     FINDVAL           SET UP TO SEARCH ON VALUE
         STW,0    WHCHSRCH
         BAL,4    LOC%SRCH          SEARCH ALL BUT SPECIAL SYMBOLS
         LW,2     DRSRCHLM+1        GET ORIGINAL VALUE
         SW,2     DRSRCHLM          COMPUTE OFFSET
         LW,1     K%OUTMODE         IN CSECT MODE
         BGZ      PRTAG60           YES
         CW,2     HEX%OFFSET        NO, CHECK OFFSET
         BLE      PRTAG70
PRTAG50  EQU      %
         LW,3     DRSRCHLM+1        YES - GET ORIGINAL VALUE            02478000
         LI,0     -1
         STW,0    SYM%TYPE          RESET TO 'NOT SET'
         B        DRPRTAGH          GO PRINT AS CONSTANT
PRTAG60  EQU      %
         AI,5     0                 CHECK IF A CSECT TYPE WAS FOUND
         BLZ      PRTAG50           NONE FOUND, PRINT ABSOLUTE
PRTAG70  EQU      %
         LW,9     SYM%ADR           GET POINTER TO SYMBOL
         BAL,4    DRSYMPT           PRINT DESIRED SYMBOL                02483000
         LI,0     #PLUS             SEND OUT A PLUS SIGN                02484000
         BAL,4    TYPOUT
         LW,3     2                 PUT DELTA IN R3                     02486000
DRPRTAGH LW,4     DRPRTSAV          GET RETURN ADDRESS
         B        DRPRTHXA          PRINT AS HEX CONSTANT
*                                                                       02498000
************************************************************************
*                                                                      *
*        ROUTINE FOR OUTPUT OF A SYMBOL                                *
*        THERE ARE TWO ENTRY POINTS
*        DRMNEMPT    OUTPUTS UP TO 4 CHARACTER MNEMONIC OP CODE        *
*        DRSYMPT     OUTPUTS UP TO 8 CHARACTER SYMBOL                  *
*                                                                      *
************************************************************************
DRMNEMPT LI,7     0                 ENTRY FOR MNEMONIC OUTPUT
         B        MNSYM10           CONTINUE
DRSYMPT  EQU      %
         LCI      2
         LM,6     *9                SYMBOL TO R6-R7
         SLD,6    8                 SHIFT OFF CODE & BYTE COUNT
         LB,1     *9                GET TRUE CUNT
         AND,1    M6
         AI,1     -8                SAVE IT IF SITIVE
         BLZ      %+3
         STB,1    4
         AI,7     '*'               AND AD WITH *'S
MNSYM10  EQU      %
         STD,6    DRTEMPD1          SAVE SYMBOL
         STW,4    TOUT
         LI,1     -8                CHARACTER INDEX
DRSYMPTM LB,0     DRTEMPD1+2,1      GET A CHARACTER                     02338000
         BEZ      *TOUT             IF CHARACTER = 0, RETURN
DRSYMPTX BAL,4    TYPOUT
         BIR,1    DRSYMPTM          ANY CHARACTERS LEFT TO PRINT        02342000
         CB,1     *%+2              TERMINAL'S BRKE
         BL       %-3               DITT
         B        *TOUT
         PAGE
*                                                                       02344000
*                                                                       02640000
* SPECIAL PRINT ROUTINE                                                 02641000
* PRINTS UP TO 4 CHARACTERS STARTING FROM THE RIGHT MOST BYTE           02642000
*   INPUT                                                               02643000
*     R0 : EBCDIC STRING                                                02644000
*   LINK : R1                                                           02645000
*                                                                       02646000
DRPRTSML BAL,4    TYPOUT
         SLS,0    -8                MOVE NEXT CHARACTER INTO POSITION   02648000
         AI,0     0                 CHECK FOR REMAINS                   02649000
         BGZ      DRPRTSML          ANYTHING LEFT
         B        0,1               NO - RETURN                         02651000
*                                                                       02652000
*                                                                       02702000
*                                                                       02703000
* ROUTINE TO TYPE OUT A MESSAGE GENERATED BY A TEXTC                    02704000
*   INPUT (DLMSG)                                                       02704100
*     R1 : WA(MESSAGE)                                                  02704200
*   INPUT (DRPRTMSG)                                                    02705000
*     R1 : BA(MESSAGE)                                                  02706000
*   LINK : R4                                                           02707000
*   TEMPORARIES USED : R0,R2                                            02708000
*                                                                       02709000
DLMSG    SLS,1    2                 FORM BYTE ADDRESS                   02709500
DRPRTMSG LB,2     0,1               GET COUNT                           02710000
         STW,4    TOUT
DRPRTMSM AI,1     1                 ADVANCE THE BYTE INDEX              02711000
         LB,0     0,1               GET A CHARACTER                     02712000
         BAL,4    TYPOUT
         BDR,2    DRPRTMSM          IS COUNT ZERO?                      02714000
         B        *TOUT             YES - RETURN
         PAGE
************************************************************************
*                                                                      *
*                                                                      *
*                 EVALUATION AND SYMBOL TABLE SEARCH ROUTINES          *
*                                                                      *
*                                                                      *
************************************************************************
* EVALUATION ROUTINE                                                    02149000
*                                                                       02150000
*                                                                       02148000
DREVAL   LW,2     3                 GET ACCUMULATED VALUE
         STW,1    CURNOPR           SAVE CURRENT OPERATOR
         LW,15    DOTMODE           PERIOD IN LAST TERM?
         BNEZ     DOTPROC           YES
         CI,7     #SYMTYPE          NO, CHECK TYPE
         BE       DREVLSYM          IS IT A SYMBOL?                     02152000
         CI,6     -DRSYMMAX         CHECK CHARACTER COUNT               02152100
         BNE      DREVLDNE          HAVE ANY CHARACTERS BEEN INPUT?     02152200
         AI,3     0                 NO - CHECK FOR EBCDIC INPUT         02152300
         BNEZ     DREVLDNE          WAS THE EXPRESSION ZERO?            02152400
         STW,1    DRLSTOPR          YES - SAVE OPERATOR FOR NEXT TIME   02152500
         B        0,4               RETURN                              02152600
DOTPROC  LI,15    0                 TURN OFF DOTMODE
         STW,15   DOTMODE
         LW,15    CHARINDX          CHECK IF ANY INPUT BETWEEN DOT
         SW,15    DOTCHAR           AND PUNCTUATION. IF YES,
         CI,15    1                 DOT MEANT HEX, IF NO, IT
         BNE      DREVLDNE          MEANT %
         LW,2     DR#DSIGN          GET CURRENT VALUE OF '%'
DREVLDNE LW,1     CURNOPR           RESTORE CURRENT OPERATOR
         XW,1     DRLSTOPR          EXCHANGE NEW AND OLD OPERATORS
         EXU      DREXUTB1,1        PERFORM CORRECT OPERATION           02154000
DREVLXIT AWM,2    DREXPRS,5         UPDATE CURRENT EXPRESSION CELL
         AI,10    1                 ADVANCE ELEMENT COUNT               02155100
         B        0,4               GO BACK TO CORRECT PLACE            02156000
DREVLSYM EQU      %
         AI,6     DRSYMMAX          GET POSITIVE SYMBOL LENGTH
         STW,6    ERKEYM            AND SAVE
         LD,14    DRCHRBUF          GET SYMBOL IN R14-15
         STW,4    DREVLRTN          SAVE RETURN INDEX                   02158000
         LI,0     FINDSYM           SET TOT SEARCH
         STW,0    WHCHSRCH           ON SYMBOLS
         CI,6     4                 IS IT TOO BIG TO BE A MNEMONIC
         BG       EVL60             YES
         CI,5     0                 ARE WE TOO FAR TO BE MNEMONIC
         BNE      EVL60             YES
         BAL,4    SRCHCODE          SEARCH MNEMONICS
         CI,0     0                 FIND IT
         BNE      DREVLXX           YES.
EVL60    RES
         BAL,4    SRCH%SYM          START SEACRCH WITH SPEC SYMBOLS
         STW,0    SYM%CODE          SAVE DEF-UNDEF CODE
         CI,0     0                 CHECK RESULT
         BL       DRERR             NOT FOUND, ERROR
         BG       DREVLXX           FOUND-DEFINED, CONTUNUE
         OR,8     DRUDEFLG          SET UNDEFINED FLAG
         LI,2     0                 UNDEFINED, VALUE = 0
DREVLXX  LW,4     DREVLRTN          RESTORE RETURN INDEX                02162000
         B        DREVLDNE          GO FINISH UP                        02163000
         PAGE
*                                                                       02210000
* ROUTINE TO DO A FINAL EVALUATION AND CREATE A FULL WORD QUANTITY      02211000
*                                                                       02212000
DREVALIT LW,3     DREXPRS           VALUE OF FIELD 0                    02213000
         LI,0     0                 RESET TRUNCATION FLAG
         LW,2     DREXPRS+1         VALUE OF FIELD 1                    02214000
         AND,2    XF                EXTRACT LOW 4 BITS                  02215000
         SCS,2    -12               MOVE INTO PROPER POSITION           02216000
         OR,3     2                 MERGE INTO VALUE ACCUMULATOR        02217000
         CI,8     X'20'            DRBIT26 FOR MTW,MTH,MTB
         BAZ      DREVLT1
         LW,1     DREXPRS+1         GET MODIFY VALUE
         CI,1     -8                AND CHECK BETWEEN -8
         BL       DREVLT2
         CI,1     7                 AND +7
         BG       DREVLT2           FOR TRUNCATION
         B        DREVLT3           OK IF BETWEEN RANGE
DREVLT1  EQU      %
         LI,1     X'FFFF0'          4 BITS FOR R FIELD
         AND,1    DREXPRS+1
         BEZ      DREVLT3           OK
DREVLT2  AI,0     1                 SET TRUNCATION FLAG
DREVLT3  CI,5     1                 CHECK PRESENCE OF ADDRESS FIELD
         BLE      DREVEXIT          IS IT THERE
DREVLITN LI,2     KM3               MASK FOR EXTRACTING INDEX NUMBER
         AND,2    DREXPRS+3         EXTRACT INDEX : LOWER 3 BITS        02253000
         LI,1     X'FFFF8'          3 BITS FOR X FIELD
         AND,1    DREXPRS+3
         BEZ      %+2               OK
         AI,0     1                 SET TRUNCATION FLAG
         CW,8     DRBIT23
         BANZ     SPCHK4            LCI OR LCFI INSTRUCTION
         SLS,2    17                MOVE INTO PROPER POSITION           02254000
         OR,3     2                 MERGE INTO FINAL VALUE              02255000
SPCHK1   CI,8     DRSOPRBT          CHECK FOR 20 BIT ADDRESS
         BAZ      SPCHK2            NO
         LW,2     M20               YES. GET 20 BIT MASK
         B        DREVLITA          SKIP CHECK FOR INDIRECT
SPCHK2   CI,8     SHFTCODE          IS IT A SPECIAL SHIFT OP CODE
         BAZ      SPCHK3            NO
         LI,2     X'7F'             YES. GET SPECIAL MASK
         CI,8     1                 CHECK IF ONLY AN S SHIFT
         BAZ      DREVLITA          OTHER SHIFT, DONT DO INDIRECT
SPCHK3   LI,2     KADMSKM           MASK FOR 17 BIT ADDRESS FIELD
         CI,8     KASTBIT           IS INDIRECT FLAG SET
         BAZ      %+3               NO
         OR,3     DRBIT0            YES, SET INDIRECT BIT IN WORD
         LI,2     KADMSKM           MAKE SURE WE USE RIGHT MASK
DREVLITA AND,2    DREXPRS+2         EXTRACT DESIRED FIELD SIZE          02257000
         AW,3     2                 MERGE ADDRESS INTO FINAL VALUE
DREVEXIT EQU      %
         CI,0     0                 IS TRUNCATION FLAG SET
         BE       0,4               NO
         LW,0     3                 SAVE EXPRESSION
         WRT%UC   TRUNMSG           OUTPUT TRUNCATION ERROR
         LW,3     0
         B        0,4               AND CONTINUE
SPCHK4   OR,3     2                 MERGE FL VALUE
         LW,2     DREXPRS+2         GET C VALUE
         AND,2    XF
         LI,1     X'FFFF0'          4 BIT FIELD FOR LCFI,LFI,LCI
         AND,1    DREXPRS+2
         BEZ      %+2               OK
         AI,0     1                 SET TRUNCATION FLAG
         CW,8     DRBIT24           IS IT LFI
         BANZ     DREVLITA+1        YES - DON'T SHIFT
         SLS,2    4                 POSITION C VALUE
         B        DREVLITA+1        GO DO FINAL MERGE
         PAGE
*                                                                       02264000
*                                                                       02127000
* ROUTINE TO COMPUTE LIMITS                                             02128000
*   OUTPUT                                                              02129000
*     R2 : LOWER LIMIT                                                  02130000
*     R3 : UPPER LIMIT                                                  02131000
*                                                                       02132000
DRGETLIM EQU      %
         CI,11    1                 CHECK COMMA COUNT
         BG       DRERR             MORE THAN 1, ERROR
         LW,2     DREXPRS           NO - SET UP SKELETON OF LIMITS      02135000
         LW,3     DREXPRS+1         R2 = FIELD 0                        02136000
         AW,3     DREXPRS+3         R3 = FIELD1+FIELD3                  02137000
         LW,0     FLDREG            GET FIELD PRESENCE BITS
         CI,0     DRFD1BIT
         BANZ     DRGTLIMG          DOES FIELD 1 EXIST
         AW,2     DREXPRS+2         NO - ADD FIELD 2 TO LOWER LIMIT     02140000
DRGETLMX EQU      %
         STD,2    DUMP%LMTS         SAVE EM
         AND,2    DRADMSKA          SCRUB
         AND,3    DRADMSKA          BOTH
         CD,2     DUMP%LMTS         ARE THEY STILL THE SAME
         BNE      DRERR             NO, LOST SOME BITS
         CI,11    0                 MORE THAN ONE FIELD (ANY COMMAS)
         BE       0,4               NO,REUTRN
         CW,2     3                 LOWER LIMIT GREATER THAN UPPER
         BG       DRERR             YES
         B        0,4               RETURN                              02143000
*                                                                       02144000
DRGTLIMG AW,3     DREXPRS+2         ADD FIELD 2 TO UPPER LIMIT          02145000
         B        DRGETLMX          GO FINISH UP                        02146000
         PAGE
************************************************************************
*                                                                      *
*        THIS ROUTINE SEARCHES THE REGULAR AND SPECIAL OP CODE         *
*        MNEMONIC TABLES FOR THE INPUT SYMBOL.  IF IT FINDS IT,        *
*        THE NUMERIC OP CODE VALUE IS RETURNED, PROPERLY POSITIONED    *
*        IN R2.                                                        *
* INPUT                                                                *
*        R14      INPUT SYMBOL                                         *
* OUTPUT                                                               *
*        R2       OP CODE VALUE                                        *
*        R11      FOUND/NOT-FOUND FLAG                                 *
* TEMP                                                                 *
*        R1,R2                                                         *
*                                                                      *
************************************************************************
SRCHCODE LI,1     SPECNENT          # ENTRIES SPECIAL CODES
         CW,14    SPECODES-1,1      THIS IT?
         BE       FOUNDSPC          YES
         BDR,1    %-2               NO
         LI,1     CODENENT          # ENTRIES REGULAR CODES
         CW,14    OPCODES-1,1       THIS IT?
         BE       FOUNDREG          YES
         BDR,1    %-2               NO
         LI,0     0                 SET NOT FOUND FLAG
         B        0,4
FOUNDREG AI,1     -1                ADJUST INDEX
         LW,2     1                 OP CODE TO R2
         SLS,2    24                POSITION IT
         B        FNSHUP+1          SET FLAG AND EXIT
FOUNDSPC AI,1     -1
         LH,2     CODEVAL,1         GET OP CODE VALUE
         CI,1     NOTAGFLD          IMMEDIATE TYPE INSTRUCTION
         BGE      %+3               NO
         OR,8     DRSOPRFL          YES, SET FLAG
         B        FNSHUP
         CI,1     7
         BG       NOTLCINST
         CI,1     5                 TEST FOR LFI, LCI, OR LCFI
         BL       FNSHUP            NEITHER
         BG       %+2               LCI AND LCFI
         OR,8     DRBIT24           LFI IS SPECIAL
         OR,8     DRBIT23           SET FLAG
NOTLCINST EQU     %
         CI,1     MTINDX
         BL       SHTEST
         OR,8     DRBIT26           MTW, MTH, MTB
         B        FNSHUP
SHTEST   EQU      %
         CI,1     SHFTINDX-1        IS IT A SHIFT TYPE INSTRUCTION
         BL       BYTTEST           NO
         BG       %+2               IS IT AN S SHIFT
         OR,8     DRBIT31           YES, SET BIT ONE AS A FLAG
         LI,3     0
         SLD,2    -4                SHIFT TPYE INTO R3
         SLS,2    8                 POSITION OP CODE
         SLD,2    12                MOVE OP CODE AND TYPE INTO POSITION
         OR,8     DRBIT21           SET BIT TO INDICATE SPECIAL SHIFT OP
         B        FNSHUP+1
FNSHUP   SLS,2    16                POSITION OP CODE
         LI,0     4                 SET FOUND FLAG
         B        0,4
BYTTEST  CI,1     BYTINDX           TEST IF BYTE INSTR
         BL       FNSHUP            NO
         OR,8     DRSOPRFL          YES, SET BIT FOR 20-BIT DISP
         B        FNSHUP
         PAGE
************************************************************************
*                                                                      *
*        ROUTINE TO SEARCH SPECIAL, GLOBAL, AND INTERNAL
*        SYMBOL TABLES.  IT IS ENTERED AT SRCH%SYM TO
*        SEARCH ALL THE SYMBOL TABLES, AND AT LOC%SRCH
*        TO SEARCH ONLY THE GLOBAL AND INTERNAL SYMBOL TABLES.
*                                                                      *
************************************************************************
SRCH%SYM EQU      %
SPEC%SYM EQU      %
         LI,1     NENTSPEC          # WORDS SPEC SYM TABLE
         LI,9     SPECSYM           START ADR    "
         BAL,7    *WHCHSRCH         GO SEARCH
LOC%SRCH EQU      %
GLOBAL%SYMBOLS    ;
         EQU      %
         LI,0     -1                INITIALIZE FLAG TO NOT FOUND
         LW,1     NENTSYM           # WORDS GLOBAL SYMBOLS
         BEZ      INTERNAL%SYM      NONE, CHECK FOR INTERNAL SYMBOLS
         LW,9     SYMBEGIN          START ADR GLOBAL
         BAL,7    *WHCHSRCH         GO SEARCH
INTERNAL%SYM      ;
         EQU      %
         LW,1     NENTINTL          # WORDS INTERNAL SYMBOLS
         BEZ      *4                NONE, RETURN
         LW,9     INTL%SYM%BEGIN    START ADR
         BAL,7    *WHCHSRCH         SEARCH
         B        *4                RETURN
         PAGE
************************************************************************
*                                                                      *
*        FINDSYM SEARCHES THE SYMBOL TABLE GIVEN A SYMBOL.
*        IF IT FINDS THE SYMBOL, IT RETURNS THROUGH R4 WITH
*        THE VALUE (WORD RESOLUTION) IN R2.  IF IT DOES NOT
*        FIND THE SYMBOL, IT RETURNS THROUGH R7 WITH THE
*        NOT-FOUND FLAG SET.
*                                                                      *
************************************************************************
FINDSYM  EQU      %
         AW,1     9                 COMPUTE END OF TABLE ADR
         LD,14    DRCHRBUF          GET SYMBOL BEING SEARCHED ON
         SLD,14   -8                SHIFT SYMBOL RIGHT 1 BYTE
         LW,12    14                1ST 3 CHARS TO R12
         LW,13    SYM%MASK          MASK RIGHTMOST 3 BYTES
         LW,14    ERKEYM            GET SYMBOL LENGTH
         STB,14   12                AND ATTACH TO SYMBOL
         LI,2     0                 INITIALIZE VALUE WORD
FSYM10   EQU      %
         CS,12    *9                CHECK 1ST 3 CHARS
         BNE      FSYM30            NO MATCH
         LB,0     *9                YES, GET CODE FOR THIS SYM
         AI,9     1                 BUMP POINTER TO NEXT 4 CHARS
         CW,15    *9                CHECK EM
         BNE      FSYM30-1          NO MATCH
         SLS,0    -6                YES, POSITION CODE IN R0
         AI,9     1                 BUMP POINTER TO VALUE WORD
         LI,1     0                 INIT FOR ADDRESS SHIFT
         CI,0     1                 CHECK CODE
         BL       *4                UNDEFINED, EXIT
         BG       FSYM20            CONSTANT
         LW,3     M19               LOCATION TYPE,GET MASK
         LB,1     *9                GET SYMBOL TYPE
         SLS,1    -3
         LB,1     METATYPE,1        GET CORRESPONDING DELTA FORMAT CODE
         STW,1    SYM%TYPE          SAVE IT
         LB,1     *9                PICK UP RES AND 'T'
         AND,1    X7                SAVE ONLY RESOLUTION
         AI,1     -2                ADJUST FOR ADDRESS SHIFT
         B        FSYM20+1
FSYM20   EQU      %
         LI,3     -1                CONSTANT, GET 32 BIT MASK
         LS,2     *9                GET VALUE FROM VALUE WORD
         SLS,2    0,1               GET WORD RESOLUTION
         B        *4                RETURN TO CALLER
         AI,9     -1                DECREMENT
FSYM30   EQU      %
         AI,9     3                 BUMP POINTER TO NEXT ENTRY
         CW,9     1                 CHECK FOR DONE
         BL       FSYM10            NO
         LI,0     -1                YES, SET NOT FOUND FLAG
         B        *7                RETURN TO SEARCH ROUTINE
         PAGE
************************************************************************
*                                                                      *
*        FINDVAL SEARCHES THE SYMBOL TABLE GIVEN A VALUE.
*        IF IT FINDS A SYMBOL DEFINITION WITHIN X'50' LOCATIONS
*        PRIOR TO THE VALUE, IT USES THAT SYMBOL.
*                                                                      *
************************************************************************
FINDVAL  EQU      %
         AW,1     9                 COMPUTE END OF TABLE ADR
FVAL05   EQU      %
         LI,3     0                 INITIALIZE SHIFT VALUE
         LI,14    0                 CLEAR VALUE CHECKING WORD
         LB,0     *9                GET CODE FOR THIS ENTRY
         AI,9     2                 BUMP POINTER TO VALUE WORD
         CI,0     X'20'             CHECK IF 'KILL' BIT IS SET
         BANZ     FVAL30            YES, SKIP THIS SYMBOL
         SLS,0    -6
         CI,0     0                 CHECK FOR UNDEF
         BE       FVAL30            UDEF,SKIP IT
         CI,0     2                 IS THIS A LOCATION SYMBOL
         BL       FVAL10            YES, GET 17 BIT MASK
         CW,0     LOC%ONLY          NO, IN LOCATION ONLY MODE
         BE       FVAL30            YES, SKIP IT
         LI,15    -1                GET 32 BIT MASK
        B        FVAL15
FVAL10   EQU      %
         LW,15    M19               GET 19 BIT MASK
         LB,3     *9                GET IR FROM SYMBOL
         AND,3    X7
         AI,3     -2                SET SHIFT FOR WORD RESOLUTION
FVAL15   EQU      %
         LS,14    *9                GET VALUE FROM VALUE WORD
         SLS,14   0,3               SHIFT TO WORD ADDRESS
         CLM,14   DRSRCHLM          COMPARE WITH LIMITS
         BCS,9    FVAL30            NOT IN RANGE
         BCR,12   FVAL40            EQUAL
         CI,0     1                 CHECK IF LOCATION SYMBOL
         BNE      FVAL25            NO, DONT CHECK FOR CSECT TYPE
         LW,3     K%OUTMODE         IN CSECT OUTPUT MODE
         BEZ      FVAL20            NO, CONTINUE
         CI,0     1
         BNE      FVAL30            NO, SKIP IT
         LW,3     CSECT%TYPE        YES, CHECK IF THIS SYM IS CSECT TYPE
         LS,3     *9
         BEZ      FVAL30            NO, SKIP THIS SYMBOL
         LI,5     1                 SET CSECT FOUND FLAG
FVAL20   EQU      %
         CI,0     1                 LOCATION SYMBOL
         BNE      FVAL25            NO, DONT SAVE TYPE
         LB,3     *9                GET SYM TYPE FROM VALUE WORD
         SLS,3    -3
         LB,3     METATYPE,3        CONVERT TO DELTA CODE
         STW,3    SYM%TYPE          SAVE IT
FVAL25   EQU      %
         STW,9    SYM%ADR           SAVE ADR
         STW,14   DRSRCHLM          SAVE VALUE AS NEW UPPER LIMIT
         MTW,-2   SYM%ADR           POINT TO SYMBOL
FVAL30   EQU      %
         AI,9     1                 BUMP ADR POINTER
         CW,9     1                 CHECK FOR DONE
         BL       FVAL05            NOT YET
         B        *7                DONE
FVAL40   EQU      %
         LB,3     *9                GET SYMBOL TYPE FROM
         SLS,3    -3                VALUE WORD AND
         LB,3     METATYPE,3        CONVERT TO DELTA CODE
         STW,3    SYM%TYPE          SAVE IT
         LW,4     DRPRTSAV          GET RETURN ADR FROM DRPRTADR
         AI,9     -2                POINT TO SYMBOL
         B        DRSYMPT           GO PRINT IT
         PAGE
************************************************************************
*                                                                      *
*                                                                      *
*                 PUNCTUATION COMMANDS                                 *
*                                                                      *
*                                                                      *
************************************************************************
*                                                                       01698000
*                                                                       02654000
* ROUTINE TO HANDLE ASTERISK                                            02655000
*                                                                       02656000
DRASTISK CD,6     DRSCNSET          IS IT FIRST OF A FIELD
         BNE      DRMULT            NO, MUST BE MULTIPLICATION
         CI,5     2                 IS IT ADDRESS FIELD2
         BNE      DRERR             NO, NOT GOOD
         AI,10    0                 CHECK ELEMENT COUNT
         BEZ      DRERR             MUST BE NON-ZERO
         CI,8     DRSOPRBT          IS THIS IMMEDIATE
         BANZ     DRERR             YES, CANT BE INDIRECT
         OR,8     DRASTBIT          SET INDIRECT INDICATOR FLAG
         B        DRSCAN1           GO SCAN FOR MORE INPUT
DRMULT   STW,2    DRMULT#           SAVE MULTIPLICAND
         LCW,2    2
         AWM,2    DREXPRS,5         SUBTRACT IT FROM SUM
         BAL,4    INPTCHAR          CHECK IF SHIFT
         CI,0     '*'
         BNE      DRMULT1           NO
         MTW,1    DRLSTOPR          POS SHIFT
         BAL,4    INPTCHAR          CHECK FOR -
         CI,0     '-'
         BNE      DRMULT1           NO
         MTW,1    DRLSTOPR          NEG SHIFT
         B        DRINITC
DRMULT1  MTW,-1   CHARINDX          RESET
         B        DRINITC           SCAN FOR NEXT TERM
*
*  ROUTINE TO DO MULTIPLY (FROM DREVAL)
*
DRMULTR  LI,15    1                 RESET MULTIPLIER TO 1
         XW,15    DRMULT#           AND GET CURRENT ONE
         EXU      MVEC,1
         EXU      MVEC1,1
         LW,2     15                PUT RESULT IN 2
         B        *14               RETURN
MVEC     EQU      %-4
         MW,15    2
         NOP
         LCW,2    2
MVEC1    EQU      %-4
         BCS,4    DRERR
         SLS,15   0,2
         SLS,15   0,2
*                                                                       02790000
* ROUTINE TO HANDLE THE BACKSLASH CHARACTER                             02791000
*                                                                       02792000
DRBSLASH EQU      %
         CI,8     DRUDEFBT          CHECK FOR UNDEFINED INPUT
         BANZ     DRERR             YES, ERROR
         BAL,4    DREVALIT          FINAL EXVALUATION
         AND,3    DRADMSKA          MAKE ADDRESS
         STW,3    DR#DSIGN          SAVE ADDRESS
         LI,1     DRINITB           PROPER INITIALIZATION ENTRY
         STW,1    MESSEXIT
         LI,R1    0
         STW,R1   FLOAT2ND
         LI,1     -1                SHOW THAT WE ARE BACKSLASH
         STW,1    DROPENER                                              02794400
         MTW,0    DELENT            ANALYZ/MONFIX INTERFACE
         BGZ      DRSLASHE          YES
         STW,1    GTPGMODE
         EXU      SLASHYY           LOAD TO FORCE 'GET PAGE'
         B        DRSLASHE
*                                                                       02768000
* ROUTINE TO HANDLE COMMA                                               02769000
*                                                                       02770000
DRCOMMA  CI,5     3                 CHECK FIELD NUMBER                  02771000
         BGE      DRERROR           ARE WE IN THE LAST FIELD?           02772000
         AI,5     1                 NO - ADVANCE FIELD NUMBER           02773000
         AI,11    1                 INCREMENT COMMA COUNT               02774000
DRFLDFIX EQU      %
         LW,1     DRFLDBIT,5        SET PRESENCE BIT FOR THIS FIELD
         STS,1    FLDREG
         B        DRINITC           GO RESET AND SCAN FOR NEXT FIELD    02776000
*                                                                       02666000
* ROUTINE TO HANDLE CARRIAGE RETURN                                     02732000
*                                                                       02733000
DRCRTRN  LI,4     DRINITA
         STW,4    MESSEXIT
         LI,4     MESSAGE
         B        DRCLOSE           GO CLOSE UP THE OPEN REGISTER       02740000
         PAGE                                                           02804000
*                                                                       02847000
* ROUTINE TO CHECK FOR GREATER THAN SIGN WHEN IT IS EXPECTED            02848000
*                                                                       02849000
DRDEFCHK EQU      %
         CI,0     #GTRTHAN          CHECK FOR '>'
         BNE      DRERR             NO, ERROR
SYMDF10  EQU      %
         CI,7     #SYMTYPE          CHECK FOR SYMBOL INPUT
         BNE      DRERR             NO, ERROR
*
         LI,5     DRSYMMAX          GET POSITIVE SYMBOL LENGTH
         AW,5     6                 INTO REGISTER 5
         STW,5    ERKEYM            AND SAVE
*
         LW,0     MODINPUT          GET TYPE IF INPUT, -1 IF NOT
         CI,0     F%TYPE            CHECK IF F-MODE SPECIFIED
         BE       DRERR             YES, ERROR
         CI,0     K%CONST           CONSTANT TYPE SPECIFIED
         BL       SYMDF15           NO, LOCATION TYPE BY DEFAULT
         AI,5     CONSTYPE          USE CONSTANT SYMBOL CODE
         B        SYMDF30+1         CONTINUE PROCESSING
SYMDF15  EQU      %
         AI,5     LOCTYPE           LOCATION TYPE IS DEFAULT
         LI,1     2
         STB,1    DRVALSAV          SET CODE FOR WORD RESOLUTION
         LW,1     0                 WAS A TYPE SPECIFIED
         BLZ      SYMDF20           NO, CONTINUE
         LB,1     DELTATYP,1        OUTPUT FORMAT CODE
         SCS,1    -5                POSITION TYPE IN WORD
         STS,1    DRVALSAV          STORE IN VALUE WORD
SYMDF20  EQU      %
         BAL,4    INPTCHAR          GET TRAILING CHARACTER
         CI,0     'K'               IS IT 'K'
         BNE      SYMDF30           NO, CONTINUE
         LW,1     CSECT%TYPE        GET CSECT BIT
         STS,1    DRVALSAV          STORE IN CONTROL-VALUE WORD
         B        SYMDF30+1         CONTINUE
SYMDF30  EQU      %
         MTW,-1   CHARINDX          BACK CHAR INPUT INDEX UP BY 1
         LI,0     FINDSYM           SET TO SEARCH ON SYMBOLS
         STW,0    WHCHSRCH
         BAL,4    LOC%SRCH          SEARCH ALL BUT SPECIAL SYMBOLS
*
         LD,14    DRCHRBUF          CHECK IF SYMBOL CONFLICTS
         CI,0     0                 CHECK RESULT
         BL       SYMDF50           NOT FOUND
         BE       SYMDF60           UNDEFINED
SYMDF35  EQU      %
         LI,1     -8                INDEX FOR CODE BYTE
         STB,5    *9,1              STORE CODE
         LW,0     DRVALSAV          GET NEW VALUE
         STW,0    *9                STORE IN VALUE WORD IN TABLE
SYMDF40  EQU      %
         LI,0     DRINITB           INITIAL ENTRY LEAVES CURRENT CELL
*                                   OPEN (DISPLAY,SYM DEF ON ONE LINE)
         STW,0    MESSEXIT
         LI,8     0                 CLEAR FLAGS
         B        MESSAGE
SYMDF50  EQU      %
         LD,12    DRCHRBUF          GET SYMBOL
         SLD,12   -8                SHIFT FOR LEADING BYTE COUNT & CODE
         STB,5    12                STORE CODE IN 1ST SYMBOL WORD
         LW,14    DRVALSAV          GET VALUE WORD
         BAL,4    DRSYMAPD          ADD THIS ENTRY TO SYMBOL TABLE
         B        SYMDF40
*                 SATISFY REFERENCES TO THE UNDEFINED SYMBOL
SYMDF60  EQU      %
         CI,5     CONSTYPE          IF CONSTANT SYMBOL, DONT RUN
         BE       SYMDF35           LINK OF UNSATISFIED REFERENCES
         LI,4     0                 CLEAR R4
         LW,11    M17               17 BIT NASK FOR STORING VALUE
         LW,10    DRVALSAV          GET VALUE WORD
         LI,1     -8                INDEX FOR STORING CODE BYTE
         STB,5    *9,1              STORE CODE IN 1ST SYMBOL WORD
         LW,5     M17               ADR MASK FOR LINK ADDRESSES
SYMDF70  EQU      %
         LS,4     *9                LINK ADR TO R4
         STS,10   *9                STORE VALUE
         CI,4     0                 CHECK FOR END OF LINK
         BE       SYMDF40           YES, EXIT
         LW,9     4                 NO, MOVE LINK ADR TO ADR REG
         B        SYMDF70           CONTINUE
*                                                                       02869000
*                                                                       02741000
* ROUTINE TO HANDLE EQUAL                                               02742000
*                                                                       02743000
DREQUAL  AI,10    0                 CHECK FOR PRESENCE OF INPUT         02743100
         BNEZ     DREQUALM          WAS THERE ANY?                      02743200
         LW,3     DR#SEMIQ          NO - GET MOST RECENT QUANTITY TYPED 02743300
         B        DREQUALX          GO FINISH UP COMMAND ACTION         02743400
DREQUALM BAL,4    DREVALIT          FIND VALUE OF INPUT EXPRESSION      02744000
DREQUALX LW,2     MODINPUT   WAS OUTPUT MODE SPECIFIED
         BLZ      %+3        NO, GO TO
         LW,2     OUTMODE    YES, SET R2 TO SPECIFIED MODE
         B        %+2
         LW,2     DREQDFLT   SET R2 TO DEFAULT MODE
         LI,0     #2SPACE           PRINT 2 SPACES BEFORE THE VALUE     02746000
         BAL,1    DRPRTSML                                              02746500
         BAL,4    DRPTEXP           GO PRINT VALUE IN DESIRED MODE      02747000
         LI,0     -1
         STW,0    MODINPUT   TURN OFF MODE INPUT SWITCH
         LI,1     DRINITB           SET RETURN LINK TO RESET SCANNER
         STW,1    MESSEXIT
         LI,1     MESSAGE
         LI,0     #2SPACE           PRINT 2 SPACES AFTER THE VALUE      02747200
         LI,8     0                 CLEAR FLAGS IN REGISTER 8
         STW,8    FLOAT2ND
         B        DRPRTSML                                              02747300
*                                                                       02748000
*                                                                       02840000
* ROUTINE TO HANDLE EXCLAMATION POINT                                   02841000
*                                                                       02842000
DREXCLAM EQU      %
         OR,5     10                CHECK FIELD & ELEMENT COUNTS
         BNEZ     DRERR
         LW,0     DR#DSIGN          GET LOC COUNTER FOR SYMBOL VALUE
         STW,0    DRVALSAV          SAVE IT
         B        SYMDF10
*                                                                       02785000
* ROUTINE TO HANDLE  LINE  FEED                                         02786000
*                                                                       02787000
DRLFEED  BAL,4    DRCLOSE           CLOSE OPEN REGISTER
         LI,3     1                 INCREMENT LOCATION
         B        DRLFUARO          REST IS SAME AS IN UP ARROW         02789000
*                                                                       02104000
* ROUTINE TO HANDLE LEFT PARENTHESIS..PRINTOUT TYPE
*   GOES TO ERROR RECOVERY IF ILLEGAL TYPE REQUESTED                    02106000
*   INPUT                                                               02107000
*      DEFAULT TYPE IN R5                                               02108000
*   OUTPUT                                                              02109000
*      TYPE IN R2                                                       02110000
*                                                                       02111000
*   LINK : R4                                                           02112000
*   TEMPORARY REGISTERS : R0,R2                                         02113000
*                                                                       02114000
DRLPAR   EQU      %
CHNGMODE EQU      %
         BAL,4    INPTCHAR          GET OUTPUT MODE CHARACTER
         LI,2     DRTYPLST          INDEX FOR SEARCH
         MTW,2    DOTCHAR           ALLOWS '.(F/' TO EQUAL '%(F/'
DRGETMMO CB,0     DRTYPCHR,2        CHECK ONE ENTRY                     02118000
         BNE      DRGETAMO          IS IT THIS ONE?                     02119000
         AI,2     -1                COMPUTE CORRESPONDING VALUE
         STW,2    OUTMODE    SAVE SPECIFIED OUTPUT MODE
         STW,2    MODINPUT   SET OUTPUT MODE SWITCH
         B        DRSCAN1
DRGETAMO BDR,2    DRGETMMO          ARE ANY MORE ENTRIES LEFT?          02122000
         B        DRERR             NO - MUST BE A BAD TYPE REQUESTED   02124000
*                                                                       02125000
*                                                                       02668000
* ROUTINE TO HANDLE LESS THAN                                           02669000
*                                                                       02670000
DRLSTHAN CI,8     DRUDEFBT          TEST FOR UNDEFINED IN VALUE         02671000
         BCS,4    DRERR             WAS THERE ONE?                      02672000
         BAL,4    DREVALIT          NO - GO COMPUTE COMPLETE VALUE      02673000
         STW,3    DRVALSAV          SAVE RESULT FOR USE LATER           02674000
         OR,8     DRBIT22    SET FOR SYMBOL DEFINE MODE
         B        DRINITB           GO SCAN FOR SYMBOL NAME             02676000
*                                                                       02677000
*                                                                       02693000
* ROUTINE TO HANDLE PERCENT                                             02694000
*                                                                       02695000
DRPERCNT CI,7     #NUMTYPE          CHECK STATUS OF THE SCANNER         02696000
         BNE      DRERR             IS IT IN THE INITIALIZED STATE?     02697000
         CI,6     -DRSYMMAX         YES - CHECK FOR INPUT               02697100
         BNE      DRERR             IS THE COUNT INITIALIZED?           02697200
         LI,7     #SYMTYPE          YES - SET SCANNER TO SYMBOL MODE    02698000
         B        DRINPSYM          GO FINISH UP AS A SYMBOL TYPE       02699000
*                                                                       02731000
*                                                                       02796000
* ROUTINE TO HANDLE THE PERIOD (DOT)                                    02797000
*                                                                       02798000
DRPERIOD CI,6     -DRSYMMAX         CHECK CHARACTER COUNT
         BNE      DRERR             HAVE ANY CHARACTERS BEEN INPUT?     02801000
         CI,7     #NUMTYPE          NO - CHECK INPUT MODE               02801100
         BNE      DRERR             NOT CORRECT MODE
         LI,15    1                 TURN ON
         STW,15   DOTMODE                   DOTMODE
         LW,15    CHARINDX          SAVE INPUT BUFFER INDEX
         STW,15   DOTCHAR           FOR THE PERIOD
         LI,7     #HEXTYPE          SET INPUT MODE TO HEX
         B        DRSCAN1           CONTINUE SCAN
         PAGE                                                           02839000
************************************************************************
*                                                                      *
*                         STEP MODE ROUTINE                            *
*        THIS ROUTINE EXECUTES THE LAST VALUE TYPED, OPENS AND         *
*        DISPLAYS THE CONTENTS OF THE NEXT LOCATION MAKING IT A        *
*        CANDIDATE FO R EXECUTION.                                     *
*                                                                      *
************************************************************************
DRRPAR   EQU      %
STEPPER  EQU      %
         MTW,0    DELENT            ARE WE INTERFACING WITH MONFIX
         BGZ      DRERR             YES - ERROR
         OR,5     10                CHECK ELEMENT & FIELD COUNTS
         BNEZ     DRERR             NON-ZERO, ERROR
         CI,6     -DRSYMMAX         CHECK IF ANY CHARS INPUT
         BNE      DRERR             YES, ERROR
         LW,0     STEPMODE          ARE WE ALREADY IN STEP-MODE
         BGZ      STEP10            YES
         LW,0     DROPENSW          IS THERE AN OPEN REG
         BGEZ     DRERR             NO, ERROR
         MTW,1    STEPMODE          NO ERRORS, SET FLAG
STEP10   EQU      %
         LW,1     DR#DSIGN          GET ADR OF OPEN CELL
         STD,1    IAP               STORE IN IA & IAP
         STW,1    BADR              STORE BRANCH ADR
         LI,0     DRINITA           NEW COMMAND INITIALIZATION
         STW,0    MESSEXIT
         LI,0     -1                TURN OFF I-BRK MODE
         STW,0    IBRKMODE
         B        TRACEXEC          GO ANALYZE & EXECUTE AN INST
         PAGE
*
*        # COMMAND; NOT IMPLEMENTED IN USER DELTA
*                   BUT MAINTAINED FOR EXEC DELTA
*
DRSHARP  EQU      %
         AI,10    0                 CHECK ELEMENT COUNT
         BGZ      DRERR             MORE THAN 1, ERROR
         CI,6     -DRSYMMAX         ANY CHARS INPUT
         BE       DRERR             NO, ERROR
         CI,7     #SYMTYPE          INPUTTING A SYMBOL
         BNE      DRERR             NO, ERROR
         LD,12    DRCHRBUF          GET INPUT SYMBOL
         SLD,12   -8                SHIFT CLEARS CODE BYTE TO UNDEFINED
         LW,14    DR#DSIGN          VALUE LINKS UNDEFINED SYMBOLS
         LI,4     MESSAGE           RETURN ADR FROM DRSYMAPD
         B        DRSYMAPD          ADD SYMBOL TO SYM TAB
*
         PAGE                                                           02870000
************************************************************************
*                                                                      *
* ROUTINE TO HANDLE THE SLASH COMMAND                                   02872000
*                                                                      *
************************************************************************
DRSLASH  EQU      %
         CI,8     DRUDEFBT          CHECK FOR UNDEFINED INPUT
         BANZ     DRERR             YES,ERROR
         LI,4     DRINITB
         STW,4    MESSEXIT
         AI,10    0                 CHECK FOR INPUT
         BGZ      SLSH10            THERE WAS SOME
         LW,3     DRADMSKA
         AND,3    DR#SEMIQ          FIND ADDRESS POINTER IN ;Q          02879000
         LI,0     0
         STW,0    DRUPRLIM          SET UPPER LIMIT
         B        DRSLASHM+1        GO DO IT.
SLSH10   EQU      %
         LI,2     0                 INITIALIZE STRNGBUF
         STB,2    STRNGBUF
         LW,2     MODINPUT          NONE, WAS OUTPUT MODE SPECIFIED
         BLZ      %+3        NO, GO TO %+3
         LW,2     OUTMODE    YES, USE SPECIFIED MODE
         B        %+2
         LW,2     DRSLDFLT          USE DEFAULT OUTPUT MODE
         STW,2    DRSLSHMD   SAVE SPECIFIED MODE
         LI,2     -1                RESET OUTPUT MODE
         STW,2    MODINPUT
DRSLASHI BAL,4    DRGETLIM   GET LIMITS REQUESTED
         STW,2    DR#DSIGN          SAVE STARTING LOCATION              02888000
         STW,3    DRUPRLIM          SAVE FINAL LOCATION                 02889000
         STW,4    DROPENER          SHOW THAT WE ARE IN SLASH MODE      02889250
         LW,3     DELENT            MUST WE INTERFACE W/MONFIX ?
         BLEZ     DRSLASHM          NO
         BAL,4    COPYINP           YES, SAVE INPUT STRING
         B        DRSLASHM
DRSLSHM1 LW,3     DELENT            ARE WE DEALING W/MONFIX ?
         BLEZ     DRSLASHM          NO
         BAL,4    COPYOUTP          YES, SAVE ADDRESS STRING
DRSLASHM LW,3     DR#DSIGN          PUT STARTING LOCATION IN R3         02889500
         LI,0     0                 SET FLAG TO  ALLOW OUTPUT TO
         STW,0    PRINT%OK          THE PRINTER IF REQUESTED
         LI,0     #2SPACE           PRINT 2 SPACES BEFORE THE VALUE     02890000
         BAL,1    DRPRTSML                                              02891000
         LW,4     DELENT            SPECIAL 'GET' REQUIRED ?
         BLEZ     SLSH20            NO
         LW,4     0,4
         BAL,4    0,4               YES, CALL 'GET' SUBR; VALUE IN R3
         BCS,8    DRERR
         LI,4     0                 GET 2ND WORD (FOR 'L' OUTPUT)
         B        SLSH22
SLSH20   EQU      %
         CI,3     X'FFFF0'          CHECK FOR A REGISTER
         BANZ     SLSH21            NO
         LW,4     SAVREGS+1,3
         LW,3     SAVREGS,3         YES. GET REGISTER VALUE
         B        SLSH22
SLSH21   LI,4     0
         CI,3     X'E0000'          LEGAL ADDRESS
         BANZ     DRERR
         CI,3     1                 IS ADDRESS AN ODD LOC
         BANZ     %+2               YES - DONT GET 2ND WORD
SLASHXX  LW,4     1,3
SLASHYY  LW,3     0,3               GET CONTENTS OF ADDRESS REQUESTED
SLSH22   RES
         LW,2     DRSLSHMD          GET MOST RECENT PRINT MODE          02893500
         CI,2     F%TYPE            CHECK FOR SYM-TAB CONTROL MODE
         BNE      SLSH30            NO, CONTINUE
         LW,2     SYM%TYPE          YES, IS A SYMB ASSOCIATED WITH ADR
         BGEZ     %+2               YES, USE ITS TYPE FOR OUTPUT MODE
         LI,2     R%TYPE            NO, DEFAULT TO R-TYPE
SLSH30   EQU      %
         CI,2     3                 IF NOT (L FORMAT, RESET ITS FLAG
         BE       %+2
         LI,4     0
         STW,4    FLOAT2ND
         BAL,4    DRPTEXP           GO PRINT VALUE IN DESIRED MODE      02894000
         LW,3     DR#DSIGN          GET VALUE OF CURRENT LOCATION INDEX 02895000
         CW,3     DRUPRLIM          CHECK FOR END CONDITION             02896000
         BGE      DRSLASHD          ARE WE DONE?                        02897000
         AI,3     1                 NO - INCREMENT LOCATION INDEX       02898000
         MTW,0    FLOAT2ND          DID WE USE (L FORMAT
         BEZ      %+2               NO.
         AI,3     1                 YES, INCREMENT LOCATION.
         LI,0     #CRLF             GO TO A NEW LINE                    02898200
         BAL,4    TYPOUT
DRSLASHS EQU      %
         STW,3    DR#DSIGN          SAVE NEW LOCATION INDEX             02900000
         LI,0     2
         STW,0    LOC%ONLY          TURN ON LOC-ONLY MODE
         LW,2     DRADRMOD          GET CURRENT MODE OF LOCATION PRINT  02902750
         BAL,4    DRPRTADR          PRINT LOCATION VALUE IN DESIRED MODE02903000
         MTW,-2   LOC%ONLY          TURN OFF 'LOC-ONLY' MODE
         LI,0     #SLASH            SEND OUT A SLASH
         LI,4     DRSLSHM1          SET RETURN FROM TYPOUT
         LW,1     DROPENER          CHECK OPEN MODE SWITCH
         BGEZ     TYPOUT            PRINT A SLASH
         LI,0     #BSLASH           SEND OUT A SLASH TO THE USERS TTY   02906050
         BAL,4    TYPOUT
DRSLASHD LI,0     #2SPACE           SEND OUT 2 SPACES AFTER THE VALUE   02906200
         BAL,1    DRPRTSML                                              02906400
DRSLASHE RES
         LI,0     -1                FLAG TO SHOW A REGISTER IS OPEN     02907000
         STW,0    DROPENSW          SET OPEN SWITCH                     02908000
         B        *SLSHEXIT
*                                                                       02912000
*                                                                       02750000
* ROUTINE TO HANDLE SPACE                                               02751000
*                                                                       02752000
DRSPACE  CI,5     2                 CHECK FIELD NUMBER                  02753000
         BGE      DRINITC           IS IT AT LEAST IN THE ADDRESS FIELD?02754000
         LI,5     2                 NO - SET IT THAT WAY                02755000
         B        DRFLDFIX          GO SET PROPER BIT                   02756000
*                                                                       02810000
* ROUTINE TO HANDLE SINGLE QUOTE                                        02811000
*                                                                       02812000
DRSQUOTE LI,2     #EBDTYPE          SET UP DEFAULT CODE                 02813000
DRQUOTE  CI,7     #NUMTYPE          CHECK STATE OF SCANNER              02814000
         BNE      DRQUOTFD          IS IT IN THE INITIAL MODE?          02815000
         CI,6     -DRSYMMAX         YES - CHECK CHARACTER COUNT         02816000
         BNE      DRERROR           HAVE ANY CHARACTERS BEEN INPUT?     02817000
         LW,7     2                 NO - MUST BE THE DEFAULT CASE       02818000
         B        DRSCAN1           GO SCAN FOR INPUT TERM              02819000
DRQUOTFD CI,7     #SYMTYPE          CHECK TO SEE IF MODE IS SYMBOLIC    02820000
         BE       DRQUOTFR          IS IT?                              02821000
         LI,7     #SPCTYPE          NO - SET FOR SPECIAL INPUT          02821200
         B        DRSCAN1           GO SCAN FOR NEXT CHARACTER          02821400
DRQUOTFR CI,6     -DRSYMMAX+1       CHECK CHARACTER COUNT               02821600
         BNE      DRERROR           WAS ONLY ONE CHARACTER INPUT?       02821800
         LB,0     DRCHRBUF          YES - GET MODE CHARACTER            02822000
         LI,7     DRMODCNT          SET UP LOOP COUNTER                 02823000
DRQUOTFM CB,0     DRMODCHR,7        CHECK A CHARACTER                   02824000
         BNE      DRQUOTFX          ARE THEY THE SAME?                  02825000
         LI,6     0                 YES - RESET CHARACTER COUNTER       02826000
         STW,6    DRCHRBUF          RESET SYMBOL STORAGE                02827000
         LB,7     DRMODVAL,7        GET APPROPRIATE MODE INDEX          02828000
         B        DRSCAN1           GO SCAN SOME MORE                   02829000
DRQUOTFX BDR,7    DRQUOTFM          ANY MORE ENTRIES LEFT TO CHECK?     02830000
         B        DRVALERR          NO - ERROR                          02831000
*                                                                       02832000
*                                                                       02805000
* ROUTINE TO HANDLE DOUBLE QUOTE                                        02806000
*                                                                       02807000
DRDQUOTE EQU      %
         CI,6     -DRSYMMAX         ANY INPUT THIS TERM
         BNE      DRERR             YES, ERROR
         LI,7     #FLTYPE           SET TYPE TO FLOATING
         B        DRSCAN1
*
*        TAB ROUTINE: STORES IN AND CLOSES OPEN REGISTER, DISPLAYS
*                     AND OPENS THE CELL ADDRESSED IN PREVIOUSLY
*                     OPEN CELL.
*
DRTAB    EQU      %
         BAL,4    DRCLOSE           CLOSE PREVIOUSLY OPEN CELL
         LI,0     #CRETRN
         BAL,4    TYPOUT
         LW,3     DR#SEMIQ          GET LAST VALUE TYPED
         B        DRLFUPX
*                                                                       02777000
* ROUTINE TO HANDLE UP ARROW                                            02778000
*                                                                       02779000
DRUPAROW BAL,4    DRCLOSE           CLOSE REGISTER IF IT IS OPEN
         LI,0     #CRETRN           SEND OUT A  CR
         BAL,4    TYPOUT
         LI,3     -1                DECREMENT FOR LOCATION ADDRESS      02780000
DRLFUARO MTW,0    FLOAT2ND          IF LAST DISPLAYED WAS (L FORMAT
         BEZ      %+2
         SLS,3    1                 INCR/DECR BY TWO
         AW,3     DR#DSIGN
DRLFUPX  AND,3    DRADMSKA
         STW,3    DRUPRLIM          ONLY DO ONE LOC
         LI,8     0                 RE-RESET MASTER WORD
         LI,4     DRINITB
         STW,4    MESSEXIT
         B        DRSLASHS          GO FINISH AS A SLASH COMMAND        02784000
*                                                                       02912000
         PAGE
************************************************************************
*                                                                      *
*                                                                      *
*                 SEMI-COLON COMMANDS                                  *
*                                                                      *
*                                                                      *
************************************************************************
*                                                                       02914000
* SEMI-COLON DISPATCHER                                                 02915000
DRSCOLON BAL,4    INPTCHAR
         CI,0     K40               SEE IF IT WAS A CONTROL CHARACTER   02918000
         BL       DRERROR           WAS IT
         MTW,1    DOTCHAR           BUMP DOT CHAR POINTER
         CI,8     DRUDEFBT          CHECK FOR UNDEFINED INPUT
         BANZ     DRERR             YES, ERROR
         LI,1     DRINITA
         STW,1    MESSEXIT
         LI,2     KM6               NO - COLLAPSE THE INPUT TABLE       02920000
         AND,2    0                                                     02921000
         LB,2     DRKEY2,2          FIND COMMAND TYPE                   02922000
         LH,4     DRPOINT2,2        GET RELATIVE ADR OF ROUTINE
         BGEZ     %+4               COMMAND IS OK
         MTW,0    DELENT            ARE WE INTERFACING WITH MONFIX
         BGZ      DRERR             YES - ILLEGAL COMMAND
         AI,4     K8000             RESET FLAG BIT
         AI,4     DELTA%BASE        ADD BASE ADR
         CI,2     DRSLIMIT          CHECK TO SEE IF EVALUATION REQUIRED 02924000
         BL       DREVAL            GO EVALUATE IF APPROPRIATE          02925000
         B        0,4               GO TO CORRECT ROUTINE               02926000
*                                                                       02927000
         PAGE                                                           02928000
*                                                                       02929000
* CODE TO HANDLE ;C,;F,;I,;M,;Q,;1,;2                                   02930000
* R1 CONTAINS INDEX TO INDICATE WHICH SPECIAL VALUE IS INVOLVED         02931000
*                                                                       02932000
DRSPCHR  AI,2     -DRSLIMIT         ADJUST INDEX INTO DRPOINT2
         LH,1     DRSPCSYM,2        GET ADRESS OF APPROPRIATE SYMBOL
         AI,1     DELTA%BASE        ADD BASE ADR
         LI,4     DRSPCHRB          SET RETURN LINK AFTER EVALUATION    02934000
         CI,7     #NUMTYPE          YES - CHECK STATUS OF SCANNER       02937000
         BNE      DREVAL            IS IT IN THE INITIALIZED STATE?     02938000
         CI,6     -DRSYMMAX         YES - CHECK FOR INPUT               02938100
         BNE      DREVAL            IS THE COUNT INITIALIZED?           02938200
*                                                                       02939000
* ROUTINE TO CREATE A SYMBOL FOR THE SPECIAL VALUES                     02940000
*                                                                       02941000
DRSPCHRA AI,0     #SEMI:2           YES - FORM SPECIAL SYMBOL IN R0     02942000
DRSPCHR% STH,0    DRCHRBUF          SAVE IN SYMBOL STORAGE BUFFER       02943000
         LD,6     DRSCNFIX          FIX UP NECESSARY REGISTERS          02944000
         B        DRSCAN1           GO SCAN SOME MORE                   02945000
*
*
DRSPCHRB CI,8     DRUDEFBT          CHECK FOR UNDEFINED IN VALUE        02946000
         BCS,4    DRERR             WAS THERE ONE?                      02947000
         BAL,4    DREVALIT          NO - GO GET COMPLETE VALUE          02948000
         STW,3    *DRLSTOPR         UPDATE APPROPRIATE VALUE CELL       02949000
         LI,0     #2SPACE           PRINT A COUPLE OF SPACES            02950000
         BAL,1    DRPRTSML                                              02951000
         B        MESSAGE
*                                                                       02953000
         PAGE                                                           02954000
*                                                                       02955000
* ;A ROUTINE : CHANGES ADDRESS PRINT MODE TO ABSOLUTE                   02956000
*                                                                       02957000
DRSEMIA  LI,0     DRMODABS          MODE FOR ABSOLUTE ADDRESSES         02958000
         AI,10    0                 AND INPUT
         BEZ      SMR40             NO MUST BE NORMAL ;A
         BAL,4    DREVALIT          GET THE VALUE
         BAL,4    INPTCHAR          MUST BE V;AM
         CI,0     'M'
         BNE      DRERR
         STW,3    DRADMSKA
         B        MESSAGE
*                                                                       02960000
* ;R ROUTINE : CHANGES ADDRESS PRINT MODE TO RELATIVE                   02961000
*                                                                       02962000
DRSEMIR  EQU      %
         AI,10    0                 ANY INPUT
         BEZ      SMR10             NO, CHECK FOR TRAILING CHAR
         BAL,4    DREVALIT          YES, EVALUATE
         STW,3    HEX%OFFSET        SAVE NEW HEX OFFSET
SMR10    EQU      %
         BAL,4    INPTCHAR          GET TRAILING CHAR
         CI,0     'K'               IS IT A 'K'
         BE       SMR20             YES, SET K-MODE
         MTW,-1   CHARINDX          BACK UP INPUT POINTER
         LI,0     0                 TURN OFF
         STW,0    K%OUTMODE         CSECT OUTPUT MODE
         B        SMR30
SMR20    EQU      %
         MTW,1    K%OUTMODE         SET CSECT OUTPUT MODE
SMR30    EQU      %
         LI,0     DRMODREL          MODE FOR RELATIVE OUTPUT ADR
SMR40    EQU      %
         STW,0    DRADRMOD          SET NEW ADDRESS MODE
         STW,0    DRSLSHMD          STORE FOR SLASH-LIKE COMMANDS
         B        MESSAGE
*                                                                       02966000
         PAGE
************************************************************************
*                                                                      *
*        ;B       ROUTINE TO SET UP INSTRUCTION BREAKPOINTS            *
*                                                                      *
************************************************************************
DRSEMIB  LI,1     IBRKLOC           GET I BREAK ADDRESSES
         LI,7     2                 I BRK FLAG
         BAL,14   BRKSET            GO TO GENERAL DUMP SET-UP ROUTINE
         B        BDMP              CONTINUE DUMP SET UP
         PAGE
************************************************************************
*                                                                      *
*        ;D       ROUTINE TO HANDLE DATA BREAKPOINTS
*        THE FOLLOWING CODE WILL SET,RESET ,OR RELEASE DATA BREAKPOINTS*
*        OR DISPLAY THE ACTIVE DATA BREAKS
*                                                                      *
************************************************************************
DRSEMID  LI,1     DBRKLOC           DBREAK BASE ADDRESSES
         LI,7     1                 D BRK FLAG
         BAL,14   BRKSET            GO TO GENERAL DUMP SET-UP ROUTINE
         B        DUMPER            FINISH LINE OF D BREAK TABLE DUMP
*
*                                    OR IF IT ALREADY HAS PROTECTION
*                                    TYPE 01 OR HIGHER (I.E. NOT A DATA
*                                   PAGE), ERROR
         PAGE
*
*        ;E ROUTINE:  ENDS A PROGRAM RUNNING UNDER DELTA
*        WITHOUT HAVING TO DO THE CONTROL-Y AND QUIT
*
DREND    EQU      %
         M:XCON   0
         CAL1,9   1                 EXIT
         PAGE                                                           03035000
*                                                                       03036000
* ;G ROUTINE : STARTS A USER PROCESS AT DESIRED LOCATION                03037000
*                                                                       03038000
DRSEMIG  EQU      %
         LW,2     DELENT            ARE WE ABOUT TO ENTER ANALZ ?
         BLEZ     %+3               NO
         LW,2     2,2               YES, USE ANALZ'S SPECIAL ENTRY LOC
         B        DRSG2
         AI,10    0                 WAS AN ADDRESS INPUT
         BNEZ     DRSG1             YES
DRSG4    MTW,0    STEPMODE
         BEZ      DRSG0             NOT IN STEP MODE
         LI,2     0
         STW,2    STEPMODE          RESET STEP MODE FLAG
         LW,2     IA                GET INSTRUCTION ADDRESS
         B        DRSG2
DRSG0    EQU      %
         LW,2     DR#SEMII          GET ;I
         B        DRSG2
DRSG1    EQU      %
         LI,2     0                 ZERO STEPMODE
         STW,2    STEPMODE
         LI,2     -1                RESET I-BRK MODE HERE
         STW,2    IBRKMODE          SINCE ADDRESS GIVEN
         CI,8     DRUDEFBT          CHECHK FOR UNDEFINED ADR INPUT
         BCS,4    DRERR             YES, ERROR
         BAL,4    DREVALIT          EVALUATE ENTIRE EXPRESSION          03040000
         LW,2     3                 MOVE ADR
DRSG2    EQU      %
         MTW,0    INTPMODE          IN TRANSFER BREAK MODE
         BEZ      DRSG3             NO, NORMAL EXECUTION
         STW,2    IA                YES, STORE GO LOC IN IA
         B        INTEX             GO EXECUTE INTERPRETIVELY
DRSG3    EQU      %
         MTW,0    IBRKMODE          IF I-BRK MODE IS STILL ON,
         BGEZ     IBRKCONT+2        WE MUST HAVE COME FROM INTEX
DRSG5    EQU      %
         LW,3     DRADMSKM
         STS,2    OLDPSD            STORE IT IN PSD
DRSEMIGB MTW,1    NOBREAKS          DISALLOW BREAKS IN DELTA
         BAL,4    IBRKSET           SET I BREAKS
         BAL,11   DBRKSET           SET DATA BREAKS
USERGO   EQU      %                 START USER UP
         LW,6     DR#SEMIC          GET CONDITIONS
         LW,7     DR#SEMIF          GET FLOAT CONTROLS
         SLS,7    28                MERGE CC & FC
         SLD,6    4
         STB,6    OLDPSD            STORE IN GO PSD
USERGO5  EQU      %
         LI,0     -1
         STW,0    IBRKMODE          TURN OFF I BREAK MODE
         STW,0    DBRKMODE          TURN OFF I BREAK MODE
         LW,0     J:TCB             DONT CHANGE TRAPS
         DO1      TEST=0
         M:TRAP   (RESTORE,PTC)
         LI,6     0                 TURN OFF DELTA'S
         STW,6    DELTCNTL          DELTA-IN-CONTROL FLAG
         STW,6    NOBREAKS          ALLOW BREAKS
         MTW,0    GOTBREAK          IS ONE WAITING
         BNEZ     T:DBRK            YES, GO PROCESS IT; OTHERWISE
         BAL,11   TMODERES
         EXECUTE                    START USER UP
         PAGE                                                           03050000
*
*        ;H ROUTINE:  HALT OR ALLOW OVERLAY TRACE
*
DRSEMIH  OR,5     10                CHECK ELEMENT AND FIELD COUNT
         BNEZ     DRERR             NON-ZERO, ERROR
         CI,6     -DRSYMMAX         CHECK IF ANY CHARACTERS INPUT
         BNE      DRERR             YES, ERROR
         LCW,0    SEGFLAG           TOGGLE THE SWITCH
         STW,0    SEGFLAG           (MINUS-NO TRACE; PLUS-TRACE)
         B        MESSAGE           GET NEXT COMMAND
         SPACE    5
*
*        ;J ROUTINE - OUTPUT TRACES, ETC. TO PRINTER
*
DRSEMIJ  EQU      %
         OR,5     10                CHECK ELEMENT & FIELD COUNTS
         BNEZ     DRERR             NON-ZERO, ERROR
         CI,6     -DRSYMMAX         CHECK IF ANY CHARS INPUT
         BNE      DRERR             YES, ERROR
         LCW,0    SEMIJ             TOGGLE THE SWITCH
         STW,0    SEMIJ             SAVE IT
         B        MESSAGE           GET NEXT COMMAND
*                                                                       03051000
         PAGE
************************************************************************
*                                                                      *
*        ;K ROUTINE - DELETE A SYMBOL OR SYMBOL TABLE(S)               *
*        'SYMBOL NAME';K      REMOVE SPECIFIED SYMBOL FROM TABLE       *
*                     ;K      DELETE GLOBAL & INTERNAL SYMBOL TABLES   *
*                     ;KI     DELETE INTERNAL SYMBOL TABLE             *
*                     ;KG     DELETE GLOBAL SYMBOL TABLE               *
*        WHEN A SYMBOL TABLE IS DELETED, THE PAGES IT OCCUPIES ARE     *
*        RELEASED AND A FLAG IS SET INDICATING THE TABLE HAS BEEN      *
*        RELEASED                                                      *
*                                                                      *
************************************************************************
*                                                                       03053000
DRSEMIK  AI,5     0                 CHECK FIELD NUMBER                  03054000
         BNEZ     DRERR             IS IT ZERO?                         03055000
         AI,10    0                 YES - CHECK ELEMENT COUNT           03056000
         BNEZ     DRERR             IS IT ZERO?                         03057000
         CI,6     -DRSYMMAX         YES - CHECK FOR INPUT               03059500
         BE       DRSEMIKA          HAS ANYTHING BEEN INPUT - NO
         CI,7     #SYMTYPE          YES - IN SYMBOL MODE
         BNE      DRERR             NO, INPUT ERROR
         AI,6     DRSYMMAX          GET SYMBOL SIZE
         STW,6    ERKEYM            AND SAVE FOR SEARCH
         LI,0     FINDSYM           SET UP TO SEARCH ON SYMBOLS
         STW,0    WHCHSRCH
         BAL,4    LOC%SRCH          SEARCH ALL BUT SPECIAL SYMBOLS
         CI,0     0                 CHECK RESULT
         BL       DRERR             NOT FOUND, ERROR
         LW,1     KILL%BIT          GET KILL BIT
         AI,9     -2                POINT TO 1ST SYMBOL WORD
         STS,1    *9                STORE IN HIGH BIT OF BYTE COUNT
         BAL,4    INPTCHAR          ANYTHING FOLLOWING
         CI,0     #BLANK            BUT CR,SPACE, ETC.
         BLE      MESSAGE
         LW,4     KILL%BIT
         STW,4    *9                YES, CLOBBER THE NAME
         B        MESSAGE           GET NEXT MESSAGE
DRSEMIKA EQU      %
         BAL,4    INPTCHAR          GET TRAILING CHARACTER
*
         CI,0     #BLANK            CHECK FOR BLANK
         BG       KA25              OR LESS
KA10     EQU      %                 RELEASE GLOBAL & INTERNAL
         STW,0    GLBLFLAG          BE SURE TO RELEASE PAGES
         BAL,15   RELEASE%GLOBAL
KA15     EQU      %
         BAL,15   RELEASE%INTERNAL
         B        MESSAGE           GET NEXT COMMAND
*
KA25     EQU      %
         CI,0     'G'               CHECK FOR GLOBAL ONLY
         BNE      KA30              NO
*                                   RELEASE GLOBAL ONLY
         BAL,15   RELEASE%GLOBAL
         B        MESSAGE           GET NEXT COMMAND
*
KA30     EQU      %
         CI,0     'I'               CHECK FOR INTERNAL RELEASE
         BNE      DRERR             NO - ILLEGAL CHAR AFTER ;K
         B        KA15
*                                                                       03098000
         PAGE                                                           03099000
*                                                                       03100000
* ;L ROUTINE : SETS BOTH SEARCH LIMITS (LOWER AND UPPER)                03101000
*                                                                       03102000
DRSEMIL  EQU      %
         CI,8     DRUDEFBT          CHECK FOR UNDEFINED INPUT
         BANZ     DRERR             YES, ERROR
         CI,11    1                 CHECK COMMA COUNT
         BNE      DRERR             WERE 2 FIELDS GIVEN                 03107000
         BAL,4    DRGETLIM          YES - GET VALUES OF LIMITS          03108000
         STW,2    DR#SEMI1          SET LOWER LIMIT                     03109000
         STW,3    DR#SEMI2          SET UPPER  LIMIT                    03110000
         B        MESSAGE           GET NEXT COMMAND
*                                                                       03112000
         PAGE                                                           03113000
*                                                                       03114000
* ;N ROUTINE : HANDLES THE NOT WORD SEARCH                              03115000
*                                                                       03116000
DRSEMIN  LW,0     DRNEQTST          INSTRUCTION USED FOR ;N SEARCH      03117000
         B        DRSEMIWC          GO PERFORM SEARCH                   03118000
*                                                                       03119000
* ;W ROUTINE : HANDLES THE WORD SEARCH                                  03120000
*                                                                       03121000
DRSEMIW  LW,0     DREQTST           INSTRUCTION USED FOR ;W SEARCH      03122000
DRSEMIWC STW,0    DRTESTER          SAVE FOR USE IN SEARCH LOOP         03123000
         CI,8     DRUDEFBT          CHECK FOR UNDEFINED INPUT
         BANZ     DRERR             YES, ERROR
         LI,0     0                 INITIALIZE STORE FLAG
         STW,0    STORFLAG
         CI,5     1                 WERE THERE EXACTLY 2 INPUT FIELDS
         BNE      NOSTORE           NO, SEARCH MODE ONLY
         LW,1     DREXPRS+1         GET SUBSTITUTE VALUE
         STW,1    SUBSVAL           SAVE IT
         MTW,1    STORFLAG          SET STORE FLAG
         LW,3     DREXPRS           GET SEARCH VALUE
         B        %+2               CONTINUE
NOSTORE  EQU      %
         BAL,4    DREVALIT          EVALUATE ENTIRE EXPRESSION          03125000
         AND,3    DR#SEMIM          EXTRACT PART OF EXPRESSIN TO BE USED03126000
         STW,3    DRFNDVAL          SAVE VALUE TO BE FOUND              03127000
         LW,3     DR#SEMI1          GET BEGINNING LOC OF SEARCH
         STW,3    DRTEMPS1          SAVE VALUE FOR USE IN SCAN
DRSEMIWM LW,4     DELENT            ARE WE INTERFACING WITH MONFIX
         BLEZ     DRSEMIWZ          NO
         LW,4     0,4
         BAL,4    0,4               CALL 'GET' SUBR; VALUE IN R3
         BCS,8    DRERR
         B        DRSEMIWY
DRSEMIWZ CI,3     15                IS REGISTER SPECIFIED
         BG       DRSEMIWX          NO
         LW,3     SAVREGS,3         GET REGISTER VALUE
         B        DRSEMIWY          CONTINUE
DRSEMIWX LW,3     0,3               GET VALUE TO BE TESTED
DRSEMIWY STW,3    DRTEMPS2          SAVE VALUE FOR LATER USE IF NEEDED
         AND,3    DR#SEMIM          EXTRACT PORTION OF INTEREST         03135000
         CW,3     DRFNDVAL          COMPARE TO SEARCH VALUE             03136000
         EXU      DRTESTER          WAS THE DESIRED RESULT OBTAINED     03137000
         LI,0     0                 SET FLAG TO  ALLOW OUTPUT TO
         STW,0    PRINT%OK          THE PRINTER IF REQUESTED
         LW,3     DRTEMPS1          GET ADR WHICH PASSED TEST
         STW,3    DR#DSIGN          SET CURRENT VALUE OF %
         STW,0    FLOAT2ND          CLEAR DBL FLOAT FLAG
         LW,0     STORFLAG          ARE WE TO STORE VALUE
         BEZ      SRCH1             NO, SEARCH ONLY
         LW,0     SUBSVAL           YES, GET SUBSTITUTE VALUE
        LW,1     DR#SEMIM          AND
         STS,0    DRTEMPS2          SET TO PRINT SUBS VALUE
SRCH1    EQU      %
         LW,3     DRTEMPS1          GET CURRENT VALUE OF %
         LW,2     DRADRMOD          GET ADDRESS PRINT MODE
         LI,8     0                 FLUSH STATUS BITS                   03142000
         BAL,4    DRPRTADR          PRINT ADDRESS IN APPROPRIATE MODE   03143000
         LI,0     #SLASHSP
         BAL,1    DRPRTSML                                              03145000
         LW,3     DRTEMPS2          GET EXPRESSION WHICH PASSED TEST
         LW,2     DRSLDFLT          GET CURRENT SLASH DEFAULT MODE      03150500
         CI,2     F%TYPE            IN SYM TAB MODE
         BNE      SRCH10            BRANCH IF NO
         LW,2     SYM%TYPE          IS A SYMBOL ASSOCIATED WITH THIS ADR
         BGEZ     %+2               BRANCH IF YES
         LI,2     R%TYPE            DEFAULT TO SYMBOLIC MODE
SRCH10   EQU      %
         BAL,4    DRPTEXP           GO PRINT IN THE DESIRED MODE        03151000
         LI,0     #CRLF             PUT TTY ON A NEW LINE
         BAL,4    TYPOUT
         LW,0     STORFLAG          ARE WE TO STORE VALUE
         BEZ      DRSEMIWT          NO
         LW,0     SUBSVAL           YES, GET SUBSTITUTE VALUE
         LW,1     DR#SEMIM          AND MASK
         LW,3     DR#DSIGN          CURRENT ADDRESS
         LI,4     COPYOUTP          ADDR OF ROUTINE FOR ANLZ/GENMD
         BAL,11   STSWORD           STORE VALUE THROUGH MASK
DRSEMIWT BAL,7    DUMPBUF           OUTPUT THIS LINE
         MTW,1    DRTEMPS1          ADVANCE LOCATION COUNTER
         LW,3     DRTEMPS1          GET UPDATED LOCATION VALUE          03153000
DRSEMIWG CW,3     DR#SEMI2          COMPARE TO FINAL VALUE              03154000
         BLE      DRSEMIWM          ARE WE DONE YET?                    03155000
         B        MESSAGE
         PAGE
*
*        ;O ROUTINE: DUMPS TO LINE PRINTER
*
DRSEMIO  EQU      %
         LI,14    0                 CONSTANTS
         LI,15    1
         CI,8     DRUDEFBT          CHECK FOR UNDEFINED INPUT
         BANZ     DRERR             YES, ERROR
         BAL,4    DRGETLIM          GET LIMITS
         STD,2    DUMP%LMTS         SAVE THEM
         BAL,7    DUMPBUF           DUMP WAITING OUTPUT
         BAL,11   OPEN%PRNT         OPEN M:XX TO PRINTER
         BAL,11   GET%HEADER        GET TRAILING HEADER INF ANY
,PRNTFPT M:WRITE  M:XX,;            PAGE EJECT & PRINT HEADER
                  (BUF,VFCHAR),;
                  (BTD,3),;         BYTE DISPLACEMENT
                  (WAIT),;
                  (ERR,DRERR),;
                  (ABN,DRERR),;
                  (SIZE,132)
         STW,14   ENDOFDMP          INITIALIZE END INDICATOR
         BAL,4    BLANKBUF          BLANK PRINT BUFFER
         LW,0     FLDREG            ANY FIELDS ENTERED FOR OUTPUT
         BEZ      MESSAGE            NO, EXIT
         MTW,0    DELENT            ANALYZ/MONFIX INTERFACE
         BGZ      SMO20             YES - DONT DUMP REGS
         LI,0     'B'                YES, SET DOUBLE SPACE FORMAT CHAR
         STW,0    VFCHAR
*
         LI,3     SAVREGS           ADDRESSES FOR R0-R7
         LI,10     SAVREGS+7
         BAL,4    LINESET            SET UP BUFFER
         LI,7     0                 RESET OUTPUT ADR TO ZERO
         LI,1     0                 INDEX INTO BUFFER
         BAL,11   CONV
         BAL,4    ZEROUT
         PRINT
*
         LI,0     X'C0'             SINGLE SPACE NEXT LINE
         STW,0    VFCHAR
*
*        REPEAT ABOVE FOR R8 - R15
*
         LI,3     SAVREGS+8
         LI,10    SAVREGS+15
         BAL,4    LINESET
         LI,7     8
         LI,1     0                 INDEX IN BUFFER
         BAL,11   CONV
         BAL,4    ZEROUT
         PRINT
*
SMO20    EQU      %
         LI,0     'B'                SET DOUNBLE SPACE FORMAT CHAR
         STW,0    VFCHAR
*
SMO30    EQU      %
         LW,3     DUMP%LM1          GET START OF THIS LINE
         LW,10    3                 COMPUTE END OF
         AI,10    7                  LINE LOCATION
         CW,10    DUMP%LM2          CHECK FOR END
         BGE      SMO60             YES
         STW,10   DUMP%LM1          NO, COMPUTE START OF
         MTW,1    DUMP%LM1           NEXT LINE
SMO40    EQU      %
         BAL,4    LINESET           GO SET UP THIS LINE
         LW,0     SUM               CHECK LINE SUM
         BNEZ     SMO50             BRANCH IF NOT DUPLICATE LINE
         LI,0     'B'                DUP, SET DOUBLE SPACE
         STW,0    VFCHAR
         B        SMO55             SKIP OUTPUT OF THIS LINE
*
SMO50    EQU      %
         BAL,4    ZEROUT
         PRINT                       PRINT A LINE
         LI,0     X'C0'             SINGLE SPACE VFCHAR
         STW,0    VFCHAR
SMO55    EQU      %
         LW,0     ENDOFDMP          CHECK FOR END
         BEZ      SMO30             NO
         LW,0     VFCHAR             IF VFC CHAR IS 'B', WE HAVE
         CI,0     'B'               BEEN SKIPPING LLINES
         BNE      %+3
         BAL,4    ZEROUT
         PRINT                      YES, PRINT LAST LINE
         BAL,4    BLANKBUF          BLANK OUTPUT BUFFER
         B        MESSAGE           YES, NEXT COMMAND
SMO60    EQU      %
         LW,10    DUMP%LM2          GET LAST LOC REQUESTED
         STW,15   ENDOFDMP          SET END FLAG
         BAL,4    BLANKBUF          CLEAR BUF BEFORE LAST LINE
         LW,2     10                COMPUTE
         SW,2     3                 # BYTES
         SLS,2    2                 FOR THIS LINE
         AI,2     4
         B        SMO40             DO LAST LINE
ZEROUT   EQU      %
         LD,6     OUTBUF
         SLD,6    24
         OR,7     BLNK
         STD,6    OUTBUF
         B        0,4
         PAGE                                                           03158000
*
*        ;P ROUTINE - PROCEED AT CURRENT LOCATION.
*                     IF ;P FOLLOWS AN INSTRUCTION BREAKPOINT,
*                     EXECUTE BROKEN INSTRUCTION AND CONTINUE.
*
DRSEMIP  EQU      %
         CI,8     DRUDEFBT          CHECK FOR UNDEFINED INPUT
         BANZ     DRERR             YES, ERROR
         LI,3     0                 TURN OFF STEPMODE
         STW,3    STEPMODE
         MTW,0    DBRKMODE          IN DATA BREAK MODE
         BGEZ     DRSG0             YES, CONTINUE AT TRAP + 1
         MTW,0    IBRKMODE          NO, IN I BRK MODE
         BLZ      DRSG4             NO
         AI,10    0                 PROCEED COUNT INPUT
         BEZ      IBRKCONT          NO
         BAL,4    DREVALIT          YES
         LW,5     IBRKNUM           GET CURRENT BREAK NUMBER
         STW,3    IBRKPRCD,5        SAVE PROCEED COUNT
IBRKCONT EQU      %
         MTW,0    INTPMODE          IN TRANSFER BREAK MODE
         BGZ      INTEX             YES, CONTINUE THERE
         BAL,11   BRKINTPT          INTERPRET & SET UP TO EXECUTE BRK
         LI,0     IBRKEXEC          SET UP TO INITIATE USER AT BROKEN
         LW,1     DRADMSKM          INSTRUCTION
         STS,0    OLDPSD
         B        DRSEMIGB          GO OGGO
         PAGE
************************************************************************
*                                                                      *
*        ;S       ROUTINE TO ACQUIRE SYMBOL TABLES
*
*        THIS ROUTINE READS GLOBAL AND INTERNAL SYMBOL TABLES FROM     *
*        DISC.  IF NO INPUT PRECEDES ';S', THE GLOBAL SYMBOL TABLE IS  *
*        READ IN.  IF THERE IS INPUT, IT MUST BE A ROM NAME.  THE      *
*        INTERNAL SYMBOL TABLE FOR THAT ROM WILL BE READ IN.   TO GET  *
*        RID OF SYMBOL TABLES, SEE SECTION ';K'.                       *
*        ;S              LOADS GLOBAL SYMBOL TABLE                     *
*        'ROM NAME';S    LOADS SPECIFIED INTERNAL SYMBOL TABLE         *
*        SEQUENCE OF STEPS                                             *
*        1.) GET PAGES REQUIRED IF THEY ARE NOT ALREADY AVAILABLE      *
*        2.) OPEN DCB M:XX FOR FILE I/O IF NOT ALREADY OPEN ON FILE    *
*        3.) SET UP FPT FOR KEYED READ                                 *
*        4.) DO THE READ                                               *
*                                                                      *
************************************************************************
DRSEMIS  EQU      %
         AI,5     0                 CHECK FIELD COUNT
         BNEZ     DRERR             ERROR - MORE THAN 1 FIELD
         AI,10    0                 CHECK ELEMENT COUNT
         BNEZ     DRERR             ERROR - MORE THAN 1 NAME
         CI,6     -DRSYMMAX         ANY CHARACTERS INPUT
         BE       GLOBAL%SYM        NO - GET GLOBAL SYMBOLS
*        READ INTERNAL SYMBOL TABLE                                    *
*        SET UP KEY FOR DISC READ. KEY IS ROM NAME + ZERO BYTE         *
         LI,0     INTLFLAG          SET UP TO SET INTERNAL SYM FLAG IF
         STW,0    SYMBFLAG          OPEN & READ ARE SUCCESSFUL
         STW,5    NENTINTL          RESET # ENTRIES FOR INTL SYMB
         AI,6     DRSYMMAX          CONVERT TO POSITIVE BYTE COUNT
         CI,6     10                CHECK LENGTH OF NAME
         BLE      %+2
         LI,6     10                TRUNCATE IF TOO LONG
         LW,7     6                 SAVE COUNT IN R7 FOR SHIFTING BUF
         AI,6     1                 ADD 1 TO COUNT FOR TRAILING CODE KEY
         LW,15    6                 SAVE COUNT IN R15
         LI,0     X'10'             ADD TRAILING KEY CODE TO NAME
         B        SINT00+1
SINT00   EQU      %
         LB,0     DRCHRBUF,7        GET CHAR IN BUF
         STB,0    DRCHRBUF,6        MOVE IT OVER 1 BYTE
         AI,7     -1                DECREMENT INDICES
         BDR,6    SINT00            LOOP
         STB,15   DRCHRBUF          STORE BYTE COUNT
         BAL,4    CHK%SYM%CHANGE    IF LMN CHANGED, RELEASE OLD SYM
*                                     TABLES, SET UP NEW ONES.
         LW,6     IST               GET INT SYM TAB SIZE/LOC
         BEZ      DRERR             ERROR - NO IST
         LI,9     NENTINTL          # WORDS READ IS STORED *9
         LW,0     INTLFLAG          DO WE ALREADY HAVE INT SYM TAB PAGES
         BNEZ     SINT10            YES DON'T GET AGAIN.
         LH,7     IST
         SLS,7    -1
         AW,7     IST
         AI,7     -1                LAST IST ADDRESS.
         MTW,0    GLBLFLAG          IF WE HAVE GLOBALS,
         BEZ      %+2               BEGIN AT THE NEXT PAGE
         AI,6     X'1FF'            FOLLOWING THEM.
         BAL,11   GET%PAGES
         BCS,8    SINT101           CAN'T GET PAGES...
         LW,6     IST
         MTW,1    *SYMBFLAG         SET PAGES GOTTEN
SINT10   EQU      %
         STW,9    SYMBSIZE          SAVE NENT LOC FOR LATER BUMPING
         LH,7     6                 COUNT TO R7
         SLS,7    -1                SHIFT OFF LOW ORDER BIT
         AND,6    M17               CLEAR UPPER 15 BITS
         STW,6    SYM%BUF           SAVE BUFFER ADDRESS
         SLS,7    2                 FORM BYTE COUNT
         STW,7    SYM%SIZ           SAVE SIZE
         SLS,7    -2                FORM WORDCOUNT
         AW,7     6                 COMPUTE LAST ADDRESS
         AI,7     -1
         STD,6    DRSRCHLM          SAVE START & END ADRS
*
SINT20   EQU      %
         BAL,11   OPEN%FILE         OPEN FILE CURRENT LMN + PASSWORD
         MTW,0    DCB%STAT          DID DCB GET OPEN
         BEZ      DRERR             NO
*                                   READ THE SYMBOL TABLE
,FRDFPT  M:READ   M:XX,;
                  (BUF,*SYM%BUF),;
                  (SIZE,*SYM%SIZ),;
                  (ERR,DRERR),;
                  (ABN,DRERR),;
                  (BTD,0),;
                  (WAIT),;
                  (KEY,DRCHRBUF)
         LW,0     M:XX+13           GET # BYTES READ - RWS
         SLS,0    -2                FORM WORD ADDRESS
         AWM,0    *SYMBSIZE         BUMP APPROPRIATE NENT
         LD,6     DRSRCHLM
*        USED TO SET 01 ACCESS ON SYMBOL TABLE PAGES HERE
         B        MESSAGE           GET NEXT MESSAGE
GLOBAL%SYM        ;                 GET GLOBAL SYMBOL TABLE
         EQU      %
         BAL,4    CHK%SYM%CHANGE    IF LMN CHANGED, RELEASE OLD SYM
*                                     TABLES, SET UP NEW ONES.
         MTW,0    GST               DOES GLOBAL SYMTAB EXIST
         BEZ      DRERR             BRANCH IF NO
         LW,0     GLBLFLAG          GLOBAL SYM TAB READ & NOT RELEASED
         BNEZ     DRERR             YES - ERROR
         LI,0     GLBLFLAG          SET UP TO SET GLOBAL SYM FLAG IF
         STW,0    SYMBFLAG          OPEN & READ ARE SUCCESSFUL
         BAL,11   OPEN%FILE         OPEN FILE TO CURRENT LMN + PASSWORD
         MTW,0    DCB%STAT          DID DCB GET OPEN
         BEZ      DRERR             NO
*                                     THIS IS DONE NOW SO THAT THE
*                                     PROPER LMN WILL BE ESTABLISHED
*                                     IN FILE%NAME.  LMN MAY CHANGE.
*
* READ TREE RECORD TO GET ACTUAL LMN
         M:READ   M:XX,;
                  (BUF,TREEBUF),;
                  (SIZE,16),;
                  (ERR,DRERR),;
                  (ABN,TREEABN),;
                  (BTD,0),;
                  (WAIT),;
                  (KEY,TREE)
TREEABN  LB,1     10
         CI,1     7                 IGNORE EXPECTED LOST DATA ABN
         BNE      DRERR
         LCI      3
         LM,10    TREEBUF+1         MOVE LMN TO KEY BUFFER
         STM,10   DRCHRBUF          FOR THE KEYED FILE READ
         MTB,1    DRCHRBUF          INCREMENT BYTE COUNT
         LB,1     DRCHRBUF          GET NEW BYTE COUNT
         CI,1     11                CHECK LENGTH OF NAME
         BLE      %+2
         LI,1     11                TRUNCATE IF TOO LONG
         LI,0     9
         STB,0    DRCHRBUF,1        ADD MODIFIER BYTE TO KEY
         STB,1    DRCHRBUF          CORRECT BYTE COUNT IN BUFFER
         LI,9     NENTSYM           # WORDS READ IS STORED *9
         LW,6     GST               COUNT & START ADR GLOBAL SYM TAB
         MTW,0    NENTSYM
         BEZ      %+2               IF WE AVE ENTERED SYMBOLS
         AI,6     X'1FF'            DON'T GET THE FIRST GLOBAL
         LH,7     GST               PAGE...
         SLS,7    -1
         AW,7     GST
         MTW,0    INTLFLAG          IF WE HAVE INTERNAL SYMBS
         BEZ      %+4               DONT TRY TO GET THEIR
         MTW,0    IST               FIRST PAGE..
         BEZ      %+2
         AND,7    =X'1FE00'
         AI,7     -1
         BAL,11   GET%PAGES
         BCS,8    SINT101           CAN'T GET PAGES..
         LW,6     GST
         MTW,1    *SYMBFLAG         SET PAGES GOTTEN
         B        SINT10
*
*
*
CHK%SYM%CHANGE    ;
         EQU      %
         LW,5     DELENT            IF LMN HAS CHANGED (WHICH HAPPENS
         BLEZ     0,4
         LW,5     3,5
         CW,5     OLDELENT            IFF J:DELENT CHANGES),
         BE       0,4
         STW,5    OLDELENT
         BAL,15   RELEASE%GLOBAL    RELEASE OLD GLOBAL SYM TAB,
         BAL,15   RELEASE%INTERNAL  RELEASE OLD INTERNAL SYM TAB,
         B        INIT%SYM%TABS     SET UP ADRS OF NEW ONES, AND EXIT.
         PAGE
*                                                                      *
*        ;T       ROUTINE TO SET TRACE MODE
*
*        THIS ROUTINE CONVERTS THE CURRENT D OR I BREAK TO TRACE MODE  *
*                                                                      *
************************************************************************
DRSEMIT  LW,0     IBRKMODE          ARE WE IN I BREAK MODE
         BNEZ     DBRKTRAC          NO
         LW,1     IBRKNUM           YES. GET CURRENT BREAK ENTRY #
         LW,3     DRBIT0,1
         STS,3    ITRCTBL           SET I TRACE TABLE
         B        MESSAGE
DBRKTRAC LW,0     DBRKMODE          ARE WE IN D BREAK MODE
         BNEZ     SMT20             NO, CHECK TRANSFER BRK MODE
         LW,1     DBRKNUM           GET BREAK NUMBER
         LW,3     DRBIT0,1
         STS,3    TRACETBL          SET TRACE TABLE
         B        MESSAGE
SMT20    EQU      %
         MTW,0    INTPMODE          IN TRANSFER BREAK MODE
         BLEZ     DRERR             NO, ERROR
         LI,0     1                 YES
         STW,0    TRACMODE          TURN ON TRACE MODE
         B        MESSAGE
         PAGE                                                           03184000
*                                                                       03185000
* ;U COMMAND : PRINTS OUT ALL UNDEFINED SYMBOL NAMES                    03186000
*                                                                       03187000
************************************************************************
DRSEMIU  EQU      %
         OR,5     10                CHECK IF ANY INPUT
         BNEZ     DRERR             YES, ERROR
         LI,0     SMU10             SET TO SEARCH ON UNDEFINED SYMBOLS
         STW,0    WHCHSRCH
         BAL,4    LOC%SRCH          SEARCH ALL BUT SPECIAL SYMBOLS
         B        MESSAGE           RETURN
*
*
SMU10    EQU      %                 UNDEFINED SEARCH ROUTINE
         PSW,4    DELSTK
         PSW,7    DELSTK
         AW,1     9                 COMPUTE LAST ADR+1
         LW,8     1                 MOVE IT
SMU20    EQU      %
         LB,0     *9                GET CODE BYTE
         SLS,0    -6                POSITION CODE
         CI,0     0                 CHECK FOR UNDEFINED
         BNE      SMU30             NO
         STW,0    PRINT%OK          SET FLAG TO ALLOW PRINTER OUTPUT
         LI,0     #CRETRN           YES, SEND A CARRIAGE RETURN
         BAL,4    TYPOUT
         BAL,4    DRSYMPT           PRINT THE SYMBOL
SMU30    EQU      %
         AI,9     3                 BUMP POINTER
         CW,9     8                 CHECK FOR DONE
         BL       SMU20             NO
         LI,0     #CRETRN           YES, SEND A CR
         BAL,4    TYPOUT
         PLW,7    DELSTK
         PLW,4    DELSTK
         B        *7                RETURN
         PAGE
*
*  ;V COMMAND : CHANGE PROMPT CHARACTER
*
**************************************************************
DRSEMIV  EQU      %
         BAL,4    INPTCHAR
         CI,0     #CRETRN
         BE       SEMV10            NO PROMPT, MUST BE BREAK ENTRY
         AI,5     0                 ANY INPUT
         BNEZ     DRERR             BEFORE THE ;V
         AI,10    0                 IS INVALID
         BNEZ     DRERR
         CI,6     -DRSYMMAX
         BNE      DRERR
         STB,0    PROMPT
         B        MESSAGE           AND CONTINUE
*
SEMV10   BAL,4    DREVALIT
         STW,3    BRKPRCD           SET PROCEED COUNT
         LI,10    0                 CLEAR VALUE INPUT FLAG
         B        USERBRK
*                                                                       03200000
* ;X ROUTINE : EXECUTES THE INPUT EXPRESSION AS AN INSTRUCTION          03201000
*                                                                       03202000
DRSEMIX  EQU      %
         CI,8     DRUDEFBT          CHECK FOR UNDEFINED INPUT
         BANZ     DRERR             YES, ERROR
         BAL,4    DREVALIT          EVALUATE INPUT EXPRESSION
         AI,3     0
         BEZ      DRSEMIXCON
         STW,3    EXECINST          STORE INST IN EXECUTE AREA
         LI,0     EXECINST          SET GO LOCATION TO EXECUTE AREA
         LI,1     X'1FFFF'
         STS,0    OLDPSD
         LW,0     DR#SEMII
         STW,0    TEMP
         B        DRSEMIGB
DRSEMIXCON RES
         BAL,4    DRCLOSE           CLOSE ANY OPEN CELL
         LI,15    DRERR
         STW,15   CURNOPR           ERROR RETURN FROM DTS#USER
         LH,11    DTSTACK+1         CHECK FOR TWO ENVIRONMENTS
         CI,11    2
         BG       SEMIXCON1         ONLY ONE, OK
         LI,1     -20
         MSP,1    DTSTACK           THROW ONE AWAY
SEMIXCON1 RES
         LD,0     STKINIT           INITIALIZE DELTA'S STACK
         STD,0    DELSTK
         MTW,0    J:INTENT          CHECK FOR ANLZ INTERFACE
         BGZ      DRERR             B/ ANLZ INTERFACE
         LW,2     J:EXTENT          CHECK FOR XIT CONTROL
         AND,2    M17
         BEZ      DRERR
         BAL,15   DTS#USER          MOVE ENVIRONMENT TO USER TCB STACK
         LW,2     J:EXTENT          GET XIT CONTROL ADDRESS
         AND,2    M17
         LI,0     -1                RESET I-BRK MODE
         STW,0    IBRKMODE
         B        DRSG2             GO TO USER XCON ROUTINE
         PAGE
************************************************************************
*                                                                      *
*        ;Y ROUTINE - TRANSFER BREAKPOINTS AND INTERPRETIVE
*                     EXECUTION.
*
*                                                                      *
************************************************************************
SEMIY    EQU      %
         CI,8     DRUDEFBT          CHECK FOR UNDEFINED INPUT
         BANZ     DRERR             YES, ERROR
         LI,14    0                 CONSTANTS
         LI,15    1                     "
         BAL,4    INPTCHAR          GET FOLLOWING CHARACTER
         CI,0     'D'               DISPLAY SPECIAL ACTION TABLE
         BE       SEMIYD
         CI,0     'R'               RESET SPECIAL ACTION TABLE
         BE       SEMIYR
         CI,0     'S'               SET SPECIAL ACTION TABLE
         BE       SEMIYS
         CI,0     'T'
         BE       SY10              SET JUMP-TRACE MODE
         STW,14   TRACMODE          INITIALIZE FLAGS
         MTW,-1   CHARINDX          BACK UP INPUT POINTER BY 1
         B        SY10+1            SET JUMP-STOP MODE
SY10     EQU      %
         STW,15   TRACMODE          SET TRACE MODE FLAG
         STW,14   DO%DONT
         STW,14   TRACLOOP
         STW,14   STEPMODE          *
         STW,15   INTPMODE          *
         LW,1     DREXPRS           GET LOCATION FIELD
         CI,5     0                 WAS MORE THAN 1 FIELD INPUT
         BG       SY30              YES
         AI,10    0                 NO, ANY INPUT
         BGZ      SY20              YES
SY15     EQU      %                 BEGIN AT CURRENT LOC
         LW,1     DR#SEMII          NO, GET CURRENT ;I
         B        INTEX+1           START UP TRANSFER BREAK EXECUTION
SY20     EQU      %                 ONLY 1 FIELD INPUT
         CI,1     15                <THAN 15 TURNS OFF TRANSFER MODE
         BLE      SY25
SY21     LI,0     -1                >15 TURN OFF I-BRK MODE
         STW,0    IBRKMODE
         B        INTEX+1           AND START AT SPECIFIED LOC
SY25     EQU      %                 TURN OFF TRANSFER MODE
         STW,14   BADR              RESET BRK ADR
         STW,14   INTPMODE          TURN OFF TRANSFER MODE
         B        MESSAGE           GET NEXT COMMAND
SY30     EQU      %                 MORE THAN 1 FIELD INPUT
         LW,0     DREXPRS+1         GET DO-DONT FIELD
         STW,0    DO%DONT           STORE IT
         CI,5     2                 WAS 3RD FIELD INPUT
         BL       SY35              NO, GET LOCATION
         LW,0     DREXPRS+2         YES, GET BDR/BIR DO-DONT FLAG
         STW,0    TRACLOOP          STORE IT
SY35     EQU      %
         CI,1     15                CHECK LOCATION FIELD
         BLE      SY15              <15=NULL, GO FROM ;I
         B        SY21              >15, START TRANSFER MODE AT LOC
************************************************************************
*                                                                      *
*        ;YR      RESET SPECIAL ACTION TABLE
*                                                                      *
************************************************************************
SEMIYR   EQU      %                 RELEASE SPECIAL ACTION LOCATIONS
         CI,5     0                 MORE THAN 1 FIELD INPUT
         BG       SYR10             YES
         AI,10    0                 NO, ANY INPUT AT ALL
         BG       SYR10             YES, GO PROCESS
         LI,7     8                 NO, CLEAR ENTIRE TABLE
         STW,14   TRACSPEC-1,7      ZERO THE ENTRIES
         BDR,7    %-1
         STW,14   TRACNENT          NENT=0
         B        MESSAGE           GET NEXT COMMAND
SYR10    EQU      %                 RELEASE SPECIFIED LOCATIONS
         AI,5     1                 # OF LOCATIONS TO RELEASE
         LW,10    DREXPRS-1,5       GET AN INPUT LOCATION TO RELEASE
         BAL,4    CHKTABL           IS IT IN THE TABLE
         B        SYR20             YES, RELEASE IT
         LI,0     #CRETRN           PUT OUT CR
         BAL,4    TYPOUT
         LW,3     10                NO, OUTPUT ADDRESS
         BAL,4    DRPRTADR
         LI,0     NOTINTAB          OUTPUT 'NOT IN TABLE'
         BAL,4    DLMSG
         B        DRERR             ERROR EXIT
SYR20    EQU      %
         MTW,-1   TRACNENT          DECREMENT # OF ENTRIES
         STW,14   TRACSPEC,7        SET ENTRY TO ZENT
         BDR,5    SYR10+1           LOOP
         B        MESSAGE           DONE, GET NEXT COMMAND
************************************************************************
*                                                                      *
*        ;YS      SET SPECIAL ACTION TABLE
*                                                                      *
************************************************************************
SEMIYS   EQU      %                 SET SPECIAL ACTION TABLE
         CI,5     0                 MOVE THAN 1 FIELD INPUT
         BG       SYS10             YES
         AI,10    0                 NO, ANY INPUT AT ALL
         BE       DRERR             NO, ERROR
SYS10    EQU      %
         AI,5     1                 # OF LOCATIONS TO SET
         LI,10    0                 VALUE FOR FREE ENTRY IN TABLE
         BAL,4    CHKTABL           IS THERE A FREE ENTRY
         B        SYS20             YES
         LI,0     TABLFULL          NO, OUTPUT TABLE FULL
         BAL,4    DLMSG
         B        DRERR             ERROR EXIT
SYS20    EQU      %
         LW,0     DREXPRS-1,5       GET INPUT LOCATION
         STW,0    TRACSPEC,7        STORE IT IN TABLE
         MTW,1    TRACNENT          BUMP # OF ENTRIES
         BDR,5    SYS10+2           LOOP
         B        MESSAGE           DONE, GET NEXT COMMAND
************************************************************************
*                                                                      *
*        ;YD      DISPLAY SPECIAL ACTION TABLE
*                                                                      *
************************************************************************
SEMIYD   EQU      %                 SPECIAL ACTION TABLE DISPLAY
         LI,0     0                 SET FLAG TO  ALLOW OUTPUT TO
         STW,0    PRINT%OK          THE PRINTER IF REQUESTED
         LW,0     TRACNENT          ANYTHING IN TABLE
         BGZ      SYD10-2           YES
         LW,0     NOMESS            NO, OUTPUT 'NONE' AND
         LI,1     BCHK20            GET NEXT COMMAND
         B        DRPRTSML
         LW,2     DRADRMOD          GET ADDRESS OUTPUT FORMAT
         STW,14   DRTEMPS1          INITIALIZE INDEX
SYD10    EQU      %
         LW,7     DRTEMPS1          INDEX
         CI,7     8                 CHECK FOR DONE
         BGE      MESSAGE           YES
         LW,3     TRACSPEC,7        NO, GET NEXT ENTRY
         BEZ      SYD20             INACTIVE, GET NEXT
         LI,0     #CRETRN           PUT OUT CR
         BAL,4    TYPOUT
         LW,2     DRADRMOD          GET ADDRESS OUTPUT MODE
         BAL,4    DRPRTADR          OUTPUT LOCATION
         LI,0     #2SPACE           PUT OUT 2 SPACES
         BAL,1    DRPRTSML
SYD20    EQU      %
         MTW,1    DRTEMPS1          BUMP INDEX
         B        SYD10             LOOP
         PAGE                                                           03215000
*                                                                       03216000
* ;Z ROUTINE : CLEARS OUT DESIRED AREA OF CORE                          03217000
*                                                                       03218000
DRSEMIZ  AI,5     0                 CHECK FIELD NUMBER                  03219000
         BEZ      DRERR             1 OR NO FIELDS, ERROR
         CI,8     DRUDEFBT          CHECK FOR UNDEFINED SYMBOL
         BANZ     DRERR             YES, ERROR
         LW,2     DREXPRS           GET LOWER LIMIT
         LW,3     DREXPRS+1         GET UPPER LIMIT
         BAL,4    DRGETLMX          CHECK LOWER LIMIT LQ UPPER LIMIT
         STD,2    DRTEMPD1          SAVE LIMITS
DRSEMIZM EQU      %
         LW,0     DREXPRS+2         GET VALUE TO BE STORED
         LW,3     DRTEMPD1          GET ADDRESS TO STORE IT IN
         LI,4     COPYOUTP          ADDR FOR ANLZ/GENMD
         LI,1     -1                FULL WORD MASK
         BAL,11   STSWORD           STORE IN USER REG OR MEMORY
         MTW,1    DRTEMPD1          INCREMENT LOWER LIMIT               03241000
DRSEMIZG EQU      %
         LW,3     DRTEMPD1          GET ADDRESS
         CW,3     DRTEMPD1+1        COMPARE AGAINST UPPER LIMIT
         BLE      DRSEMIZM          IS ANY MORE LEFT TO BE RESET        03244000
         B        MESSAGE
*                                                                       03246000
         PAGE                                                           03247000
*                                                                       03248000
* ;/ ROUTINE : CHANGES THE DEFAULT TYPE OF THE "SLASH" COMMAND          03249000
*                                                                       03250000
DRSEMISL EQU      %
         LW,0     OUTMODE           GET SPECIFIED MODE
         STW,0    DRSLDFLT          STORE IN SLASH DEFAULT
         STW,0    DRSLSHMD          STORE IN CURRENT SLASH MODE
         B        MESSAGE
*                                                                       03253000
* ;= ROUTINE - CHANGES THE DEFAULT TYPE OF THE "EQUAL" COMMAND          03254000
*                                                                       03255000
DRSEMIEQ EQU      %
         LW,0      OUTMODE          GET NEW MODE
         STW,0    DREQDFLT           UPDATE '=' DEFAULT MODE
         B        MESSAGE
*                                                                       03261000
         PAGE
*D*
*D*      NAME:    T:DBRK, BREAK CONTROL ENTRY POINT
*D*
*D*      ENTRY:   ENTRY IS FROM CP-V IN THE SAME MANNER AS ENTRY
*D*               TO ANY M:INT ROUTINE, EXCEPT THAT THE MONITOR
*D*               HAS 'SPECIAL KNOWLEDGE' OF DELTA'S BREAK KEY
*D*               ENTRY POINT AND STACK ADDRESS; THEREFORE
*D*               DOES NOT OBTAIN THEM FROM THE JIT LOCATIONS
*D*               J:INTENT AND J:TCB.  THESE ENTRIES ARE RESERVED
*D*               FOR THE USER RUNNING UNDER DELTA.
*D*
*D*      ENVIRONMENT:  DELTA ALWAYS RUNS IN SLAVE, MAPPED MODE
*D*               REGARDLESS OF THE USER'S STATE.
*D*
*D*      DATA:    ONE PAGE OF DELTA CONTEXT CONTAINING DELTA'S
*D*               STACK, I-BRK TABLES, D-BRK TABLES, AND ALL
*D*               OTHER INFORMATION PERTAINING TO A SPECIFIC USER
*D*               IS ASSOCIATED WITH EACH PROGRAM RUNNING UNDER
*D*               DELTA.
*D*
*D*      INTERFACE:  THE NORMAL INTERFACE IS A 7-WORD TABLE BUILD
*D*               IN THE JIT AT J:CLM WHICH CONTAINS THE FOLLOWING:
*D*                           ACCOUNT NAME (2 WORDS)
*D*                           PASSWORD (2 WORDS)
*D*                           LMN NAME (3 WORDS, TEXTC)
*D*
*D*               THE INITIAL ENVIRONMENT WHICH HAS BEEN PUSHED
*D*               INTO DELTA'S STACK CONTAINS THE PROGRAM'S
*D*               STARTING ADDRESS AND REGISTERS.
*D*
*D*               NOTE THAT IF DELTA HAS BEEN ASSOCIATED BY BREAK-
*D*               ING TO TEL AND REQUESTING DELTA, THE INITIAL
*D*               ENVIRONMENT CONTAINS THE PSD AND REGISTERS
*D*               FROM THE POINT OF INTERRUPTION.
*D*
*D*               A SPECIAL INTERFACE IS SET UP WHEN DELTA IS
*D*               ASSOCIATED WITH ANLZ OR MONFIX.  THESE ROUTINES
*D*               SET UP A BRANCH VECTOR FOR DELTA AND PLACE ITS
*D*               ADDRESS IN J:INTENT IN THE JIT.  THE SIGN BIT
*D*               OF J:INTENT IS SET TO ZERO WHICH DISTINGUISHES
*D*               THIS VECTOR ADDRESS FROM AN M:INT ROUTINE ADDRESS,
*D*               AND DELTA USES THIS FACT TO DETERMINE IF IT IS
*D*               ASSOCIATED WITH ONE OF THESE SPECIAL PROGRAMS.
*D*
*D*               FOR THESE PROGRAMS J:INTENT POINTS TO A 4-WORD
*D*               TABLE WHICH CONTAINS THE FOLLOWING:
*D*                        WORD 0 - ADDRESS OF 'GET' SUBROUTINE
*D*                        WORD 1 - ADDRESS OF 'PUT' SUBROUTINE
*D*                        WORD 2 - ENTRY LOCATION FOR ;G COMMAND
*D*                        WORD 3 - ADDRESS OF THE CURRENT LMN TABLE
*D*                                 (SAME FORMAT AS 7-WORD TABLE
*D*                                 DESCRIBED ABOVE.)
*D*
*D*               THIS SPECIAL INTERFACE ENABLES ASSOCIATION WITH
*D*               MORE THAN ONE LMN DURING A SINGLE ANLZ OR
*D*               MONFIX SESSION, AND ALLOWS ACCESS TO VARIOUS
*D*               LOCATIONS (REGARDLESS OF THEIR 'CURRENT' ADDRESSES)
*D*               BY MEANS OF THE 'GET' AND 'PUT' SUBROUTINES.
*D*
*D*      DESCRIPTION:  ON THE INITIAL ENTRY TO DELTA, THE 'HEAD'
*D*               RECORD IS OBTAINED FROM THE CURRENT LMN.  THIS
*D*               RECORD CONTAINS THE SIZE AND ADDRESSES FOR THE
*D*               SYMBOL TABLES (GLOBAL AND INTERNAL) IF THEY
*D*               EXIST FOR THIS LMN, AND THIS INFORMATION IS
*D*               SAVED FOR SUBSEQUENT ;S AND ROM;S COMMANDS.
*D*                        HEAD+7 = GST SIZE/LOC
*D*                        HEAD+8 = IST SIZE/LOC
*D*
*D*               THESE SYMBOL TABLES HAVE BEEN BUILT BY LINK, LOAD,
*D*               AND/OR SYMCON AND ARE TRADITIONALLY LOCATED FROM
*D*               THE PROGRAM UPPER LIMIT (J:EUP) AND CONTINUING
*D*               AS REQUIRED THROUGH DESCENDING MEMORY LOCATIONS.
*D*
*D*               THE SPECIAL SYMBOLS ;I AND % ARE INITIALIZED FROM
*D*               THE PSD IN THE SAVED ENVIRONMENT; THE 'DELTA HERE'
*D*               MESSAGE IS TYPED; AND DELTA BEGINS ACCEPTING
*D*               COMMANDS.
*D*
*D*               ON SUBSEQUENT ENTRIES (VIA THE BREAK KEY), DELTA
*D*               REINITIALIZES ITSELF; RESTORES THE I-BRKS, D-BRKS,
*D*               AND TRANSFER BREAKS TO THEIR ORIGINAL INSTRUCTIONS
*D*               AND OR ACCESS; SETS UP THE SPECIAL SYMBOLS ;C, ;F,
*D*               ;I, AND %; TYPES THE 'BREAK AT LOC' MESSAGE; AND
*D*               BEGINS ACCEPTING COMMANDS.
*D*
*D*               IF DELTA WAS IN CONTROL WHEN THE BREAK WAS HIT,
*D*               IT MERELY REINITIALIZES ITSELF, TYPES THE
*D*               'BRK IN DELTA' MESSAGE, AND BEGINS ACCEPTING
*D*               COMMANDS.
*D*
*D*               NOTE:  WHEN ASSOCIATED WITH ANLZ OR MONFIX, DELTA
*D*               TREATS EACH BREAK AS AN INITIAL ENTRY SO THAT IT
*D*               CAN CHECK TO SEE IF THE LMN TABLE HAS CHANGED.
*D*               IF THE LMN WAS CHANGED, DELTA READS IN THE
*D*               NEW 'HEAD' RECORD AND CONTINUES AS DESCRIBED ABOVE.
*D*
         PAGE
************************************************************************
*                                                                      *
*                                                                      *
*                 SYSTEM CONTROL :                                     *
*                            BREAK KEY ENTRY & INITIALIZATION          *
*                            TRAPS                                     *
*                            ABORTS                                    *
*                            I & D BREAKPOINT CONTROL                  *
*                            TRANSFER BREAKPOINT CONTROL               *
*                                                                      *
*                                                                      *
************************************************************************
************************************************************************
*                                                                      *
*        THIS CODE HANDLES USER HITTING BREAK KEY                      *
*                                                                      *
************************************************************************
T:DBRK   EQU      %                 BREAK KEY ENTRY FROM SCHEDULER
         MTW,1    NOBREAKS          HOLD OFF BREAKS FOR NOW
         BAL,11   TMODECHK
         LW,15    DELTCNTL          GET DELTA-IN-CONTROL FLAG
         MTW,1    DELTCNTL          SET IT
         DO       TEST=0
         M:TRAP   (IGNORE,FX)
         ELSE
         LI,0     DTSTACK
         M:TRAP   T:DTRAP,(TRAP,DEC,FP,FX,NAO,PS,UI)
         M:XCON   ABORTENT
         M:INT    T:DBRK
         FIN
         CI,15    0                 DELTA IN CONTROL
         BG       %+2               YES, DON'T STORE PTC
         STD,8    PTC
         MTW,1    FIRSTIME          FIRST TIME INTO DELTA
         BGZ      BRKEYRTN          NO
BRK10    LI,4     BRK30
         MTW,0    DELENT            ANALYZ/MONFIX INTERFACE
         BGZ      CHK%SYM%CHANGE    YES
*
         MTW,0    PTC+1             HAS USER SET TRAP CONTROL
         BNEZ     %+3               YES, DON'T ADJUST PSD
         LW,11    =X'00300000'      OTHERWISE, INITIALIZE BASIC PSD
         STS,11   OLDPSD
*
INIT%SYM%TABS     ;                 SET UP SYM TBL ADDRESSES
         EQU      %
         STW,4    TEMP              YES:
         BAL,11   OPEN%FILE             OPEN FILE TO LMN,
         LW,4     TEMP
         LI,1     0                 SET IN CASE LMN DOESN'T OPEN
         MTW,0    DCB%STAT          DID DCB GET OPEN
         BEZ      BRK15             LMN NOT IN JIT
         M:READ   M:XX,(BUF,HEADBUF),;  READ HEAD RECORD,
                       (SIZE,48),;
                       (ERR,BRK15),;
                       (ABN,BRK15),;
                       (BTD,0),;
                       (WAIT),;
                       (KEY,HEADKEY)
         BAL,0    CLOSEXX               CLOSE FILE,
         LW,0     HEADBUF+7             AND GET GST AND IST WORDS
         LW,1     HEADBUF+8               FROM THE HEAD.
         MTW,0    DELENT            ANLZ/MONFIX INTERFACE
         BGZ      BRK11             YES, SYMBOLS AT J:EUP
         MTW,0    J:TREE            DOES LMN HAVE TREE (LOAD OR LINK)
         BEZ      BRK11             NO, SYMBOLS AT J:EUP
*
*        RELOCATE SYMBOL TABLES AT END OF PURE PROCEDURE
*        IF STEP HAS LEFT A HOLE THERE FOR THEM
*
         LW,2     J:DDLL            IF DDLL-1=PUL, THERE'S NO HOLE
         AI,2     -1
         CW,2     J:PUL
         BE       BRK11             SO USE THE NUMBERS IN THE HEAD
         SW,2     J:EUP             OTHERWISE CONVERT THEM
         SLS,2    9
         AI,0     0
         BE       %+2
         AW,0     2
         AI,1     0
         BE       %+2
         AW,1     2
BRK11    EQU      %
         STW,0    GST               SAVE GST SIZE/LOC
         STW,1    IST               SAVE IST SIZE/LOC
         AND,0    M17               IS THERE A GST ?
         BNEZ      BRK20            YES
BRK15    EQU      %
         MTW,0    DELENT            ANLZ/MONFIX INTERFACE
         BGZ      BRK15A            YES, SYMBOLS AT J:EUP
         LW,0     J:PUL             IF THERE'S A HOLE, USE IT
         AI,0     1
         CW,0     J:DDLL
         BE       BRK15A            ELSE USE END F COMMON
         LW,0     M17
         AND,0    1                 THERE MUST BE INTERNALS IF HOLE
         B        BRK20             FOR DEFINING SYMBOLS
*
BRK15A   LW,0     J:EUP             DEFINE SYMBOLS AT END OF USER PGM
         SLS,0    9                 FORM WORD ADR FROM PAGE #
         AI,0     512               START AT TOP OF PAGE
BRK20    EQU      %
         STW,0    SYMBEGIN          SET START ADR FOR DEFINING SYMBOLS
         AND,1    M17
         STW,1    INTL%SYM%BEGIN    SAVE START ADR OF INTL SYM TABLE
         B        0,4               EXIT
*
*
BRK30    EQU      %
         LI,1     X'1FFFF'
         LS,0     OLDPSD            GET USER'S ADDRESS
         STW,0    DR#SEMII          INITIALIZE ;I
         STW,0    DR#DSIGN            AND '%'.
         LB,0     OLDPSD            SET ;C AND ;F
         SLD,0    -4
         STW,0    DR#SEMIC          ;C
         LI,0     0
         SLD,0    4
         STW,0    DR#SEMIF          ;F
         LI,0     0
         STW,0    OUTCHAR
       LI,1     DELTMSG           PUT OUT 'DELTA HERE'
         LI,4     MESSAGE           EXIT TO MESSAGE
       B        DLMSG
BRKEYRTN LI,1     DRINITA           SET INITIALIZATION POINT
         STW,1    MESSEXIT
         CI,15    0
         BLE      BRK40             DELTA NOT IN CONTROL AT BREAK
         LI,11    BREAKCHK+2        SET UP TO STOP EVERYTHING & RESTART
         MTW,-1   NOBREAKS          DECREMENT BREAK COUNT
         B        PULLDELTX         TEST FOR PROCESS OF BRK IN DELTA
BRK40    EQU      %
         MTW,0    DELENT            ARE WE INTERFACING WITH MONFIX
         BGZ      BRK10             YES
         LH,11    DTSTACK+1         LOOK AT SPACE COUNT IN STACK
         CI,11    2                 TWO ENVIRONMENTS
         BGE      BRK40A            NO, CONTINUE NORMALLY
         DO       TEST=0
         LW,0     J:TCB             RESTORE USER TRAP INFO
         M:TRAP   (RESTORE,PTC)
         FIN
         BAL,11   PULLDELX0
*
BRK40A   EQU      %                 PROCESS USER BREAK
         BAL,11   RSTORD            OTHERWISE RESTORE EVERYTHING
         LI,4     0                 RESET ABORT FLAG
         STW,4    ABORTFLG
         MTW,-1   NOBREAKS          NOW WE CAN ALLOW BREAKS
BRK50    EQU      %
         MTW,-1   BRKPRCD
         BGZ      USERBRK           DO USER BREAK ENTRY IF STILL COUNTING
         LI,1     BRKAT             PUT OUT BREAK MESSAGE
         BAL,4    DLMSG
         LI,2     0                 SYMBOLIC ADDRESS MOFE
         LW,3     DR#SEMII          GET ADDRESS AT BREAK
         BAL,4    DRPRTADR
         B        DRINIT            GO TO CONSOLE
PULLDELT MTW,1    BREAKEY           SET BREAK FLAG
         LD,0     STKINIT           BRK IN DELTA, INITIALIZE
         STD,0    DELSTK            INTERNAL WORKING STACK
         LI,1     BRKDELT            BUFFER
         LB,2     BRKDELT            BYTE COUNT
         LI,3     1                 BYTE OFFSET
         WRITE%UC                   TYPE OUT MESSAGE
         LI,1     0
         STW,1    INTPMODE          STOP INTERPRETIVE MODE
DELTCONT LI,1     -20               DECREMENT STACK
         MSP,1    DTSTACK           POINTER DOUBLEWORD
         B        *11
PULLDELTX MTW,0   NOBREAKS          ARE BREAKS DISABLES
         BEZ      PULLDELT          NO, OUTPUT BRK IN DELTA
PULLDELX0 EQU     %
         MTW,-1   DELTCNTL          DECREMENT IN-CONTROL FLAG
         MTW,1    GOTBREAK          BREAK TO PROCESS LATER
*
*        FROM HERE ON ANOTHER BREAK WILL KILL US
*
PULLDELX1 LW,0    DELTPSD           GET BREAK LOCATION
         AND,0    M17
         CLM,0    PULLDELNO         DID BREAK COME FROM HERE
         BIL      PULLDELT          YES, DO THE BEST WE CAN
         LI,15    -20               CLEAR OFF STACK
         MSP,15   DTSTACK
         LCI      0                 RESTORE DELTA REGS
         LM,0     DELTREGS
         LCF      DELTPSD           COND. CODES
         B        *DELTPSD          GO BACK TO DELTA
PULLDELX2 EQU     %                 END LOC FOR CLM
         PAGE
*
*        CNTL-SHIFT-O SEQUENCE: SIMULATE USER BREAK IF USER
*                         HAS AN M:INT ROUTINE.
*
DRRBRKET RES
USERBRK  EQU      %
         BAL,4    DRCLOSE           CLOSE ANY OPEN CELL
         LI,15    USERBRK2          ERROR IF NO TCB IN J:TCB
         STW,15   CURNOPR           SO CAN'T MOVE STACK
         LH,11    DTSTACK+1         CHECK FOR TWO ENVIRONMENTS
         CI,11    2
         BG       USERBRK1          ONLY ONE, OK
         LI,1     -20
         MSP,1    DTSTACK           THROW ONE AWAY
USERBRK1 EQU      %
         LD,0     STKINIT           INITIALIZE DELTA STACK
         STD,0    DELSTK
         LW,11    J:INTENT          CHECK USER BREAK ADDR
         BGZ      USERBRK2          NON-DEBUG INTERFACE IS ERROR
         AND,11   M17               MASK OFF M:INT ADDRESS
         BEZ      USERBRK2          NO BREAK CONTROL
         BAL,15   DTS#USER          MOVE STACK TO  USER TCB
         LW,2     J:INTENT          GET USER BRK ADDR
         AND,2    M17
         LI,0     -1                RESET I-BRK MODE
         STW,0    IBRKMODE
         B        DRSG2             GO TO USERS BREAK ROUTINE
USERBRK2 LI,0     0                 RESET PROCEED COUNT
         STW,0    BRKPRCD
         B        DRERR
         PAGE
*DO*
*D*
*        NAME:    T:SEGLD, M:SEGLD CONTROL ENTRY POINT
*
*        ENTRY:   ENTRY IS FROM CP-V IN THE SAME MANNER AS ENTRY
*                 TO THE OTHER DELTA ROUTINES.  T:SEGLD IS
*                 CALLED BY THE MONITOR WHENEVER A NEW SEGMENT
*                 HAS BEEN LOADED.
*
*        DESCRIPTION:  SINCE THIS ROUTINE IS NEVER ENTERED UNLESS
*                 THE USER IS IN CONTROL, SOME OF THE INITIAL
*                 CHECKS DO NOT HAVE TO BE MADE.  T:SEGLD LOOKS
*                 UP THE HIGHEST SEGMENT LOADED IN THE J:TREE
*                 TABLES AND INFORMS THE USER THAT THE SEGMENT
*                 HAS BEEN LOADED.  DELTA THEN PROMPTS FOR
*                 COMMANDS.
*
*                 INSTRUCTION BREAKPOINTS MAY BE SET IN THE OVER-
*                 LAY WHICH HAS JUST BEEN LOADED, OR IN ANY OF THE
*                 IN-CORE OVERLAYS.  OVERLAY BREAKPOINTS MAY NOT
*                 BE SET EXCEPT IN THE PURE PROCEDURE AREA OF THE
*                 OVERLAY.  BREAKPOINTS WILL NOT BE PLACED IN
*                 SEGMENTS THAT ARE NOT IN-CORE.
*
*FIN*
T:SEGLD  EQU      %                 M:SEGLD ENTRY POINT
         MTW,1    NOBREAKS
         BAL,11   TMODECHK
         MTW,1    DELTCNTL
         DO1      TEST=0
         M:TRAP   (IGNORE,FX)
         STD,8    PTC               SAVE TRAP INFO
         MTW,0    DELENT            ANLZ/MONFIX
         BGZ      USERGO5           YES, GET OUT NOW
*
         BAL,11   RSTORD            RESTORE USER PGM
         MTW,0    SEGFLAG           DO WE WANT A MESSAGE
         BLZ      DRSEMIGB          NO, JUST SET BREAKS AND GO
         LI,1     SEGMSG
         BAL,4    DLMSG
*
*        FIND THE CURRENT SEGMENT
*
         LW,2     J:TREE
         LW,1     2
         AW,1     0,2               END OF TREE TABLES
         AI,1     -8                POSITION TO IN-CORE FLAG
SEGLO1   MTW,0    0,1               IS THIS SEGMENT IN CORE
         BLZ      SEGFND            YES
         AI,1     -11               NEXT LOWER SEGMENT
         CW,1     2                 ARE ALL SEGMENTS CHECKED
         BG       SEGLO1            NO, CONTINUE
         AI,1     11                NONE FOUND, USE ROOT
*
SEGFND   AI,1     -3                BACK UP TO START OF TABLE
         BAL,4    DLMSG             OUTPUT SEGMENT NAME
         LI,1     LDMESS
         BAL,4    DLMSG
         LI,1     DRINITA           INITIALIZE EVERYTHING
         STW,1    MESSEXIT
         B        DRINIT            AND PROMPT
*
         PAGE
*D*
*D*      NAME:    T:DTRAP, TRAP CONTROL ENTRY POINT
*D*
*D*      ENTRY:   ENTRY IS FROM CP-V IN THE SAME MANNER AS ENTRY
*D*               TO ANY M:TRAP ROUTINE, EXCEPT THAT THE MONITOR
*D*               HAS 'SPECIAL KNOWLEDGE' OF DELTA'S TRAP CONTROL
*D*               ENTRY POINT AND STACK ADDRESS; THEREFORE DOES NOT
*D*               OBTAIN THEM FROM THE JIT LOCATIONS J:USENT AND
*D*               J:TCB.  THESE ENTRIES ARE RESERVED FOR THE USER
*D*               RUNNING UNDER DELTA.
*D*
*D*      DESCRIPTION:  DELTA FIRST CHECKS WHAT KIND OF TRAP HAS
*D*               OCCURRED AND WHO WAS IN CONTROL.  IF THE USER WAS
*D*               IN CONTROL, DELTA RESTORES THE I-BRKS, D-BRKS, AND
*D*               TRANSFER BREAKS TO THEIR ORIGINAL INSTRUCTIONS
*D*               AND OR ACCESS; THEN DELTA SETS UP THE SPECIAL SYMBOLS
*D*               ;I, ;C, ;F, AND %.
*D*
*D*               FOR ANYTHING OTHER THAN A TRAP 40, THE FOLLOWING
*D*               SEQUENCE OCCURS:
*D*
*D*               1)  IF DELTA WAS IN CONTROL, THE MESSAGE 'TRAP
*D*                   NN IN DELTA AT LOC' IS TYPED, DELTA REINITIAL-
*D*                   IZES ITSELF AND BEGINS ACCEPTING COMMANDS.
*D*
*D*               2)  IF THE USER WAS IN CONTROL AND HAS ASKED TO
*D*                   PROCESS THIS TRAP (VIA AN M:TRAP REQUEST),
*D*                   THE USER'S ENVIRONMENT IS PUSHED INTO THE
*D*                   USER'S TCB, THE TRAP REGISTERS ARE SET UP, AND
*D*                   CONTROL IS PASSED TO THE USER'S TRAP ROUTINE.
*D*
*D*               3)  IF THE USER WAS IN CONTROL BUT HAS NOT ASKED TO
*D*                   PROCESS THIS TRAP, DELTA TYPES THE APPROPRIATE
*D*                   TRAP MESSAGE AND BEGINS ACCEPTING COMMANDS.
*D*
*D*               FOR A TRAP 40 WITH DELTA IN CONTROL, THE FOLLOWING
*D*               SEQUENCE OCCURS:
*D*
*D*               1)  IF THIS IS A MEMORY PROTECT AND THE BACKSLASH
*D*                   MODE IS IN EFFECT, DELTA TRIES TO GET THE
*D*                   REQUESTED PAGE.  IF SUCCESSFUL, DELTA GOES
*D*                   BACK TO THE POINT OF INTERRUPTION AND CONTINUES
*D*                   PROCESSING.  IF UNSUCCESSFUL, DELTA TYPES
*D*                   THE 'CANT GET PAGE' MESSAGE AND RETURNS TO
*D*                   ACCEPT COMMANDS.
*D*
*D*               2)  IF THIS IS A MEMORY PROTECT AND THE BACKSLASH
*D*                   MODE IS NOT IN EFFECT, DELTA CHECKS TO SEE
*D*                   IF THE TRAP WAS CAUSED BY A USER COMMAND TO
*D*                   ACCESS A PROTECTED OR UNASSIGNED PAGE.  IF
*D*                   THIS IS THE CASE, DELTA TYPES THE 'MEM PROTECT
*D*                   FAULT ACCESSING LOC' MESSAGE AND RETURNS TO
*D*                   ACCEPT COMMANDS.
*D*
*D*               3)  IF NONE OF THE ABOVE CONDITIONS EXIST, THE
*D*                   TRAP 40 IN DELTA IS PROCESSED EXACTLY AS ANY
*D*                   OTHER TRAP (SEE ABOVE).
*D*
*D*               FOR A TRAP 40 WITH THE USER IN CONTROL, DELTA
*D*               CHECKS FOR THE 'NON-EXISTENT INSTRUCTION' CONDITION.
*D*               THIS CONDITION IMPLIES THAT SOME TYPE OF
*D*               INSTRUCTION BREAKPOINT MAY HAVE OCCURRED, AND
*D*               FURTHER TESTS MUST BE MADE.  DELTA THEN CHECKS
*D*               FOR A 'MEMORY PROTECT' CONDITION WHICH IMPLIES
*D*               THAT A DATA BREAKPOINT MAY HAVE OCCURRED.  IF SO,
*D*               FURTHER TESTS MUST BE MADE.  IF NEITHER OF THE
*D*               ABOVE CONDITIONS EXIST, THE TRAP 40 IS PROCESSED
*D*               EXACTLY AS ANY OTHER TRAP (SEE ABOVE).
*D*
*D*      INSTRUCTION BREAKPOINT PROCESSING...
*D*
*D*               DELTA USES THE FOLLOWING NON-EXISTENT INSTRUCTIONS
*D*               TO MONITOR VARIOUS BREAKPOINTS:
*D*
*D*                    X'14000000' - RETURN AFTER A ;X COMMAND
*D*                    X'14000001' THRU
*D*                    X'14000008' - USER SPECIFIED I-BRK (;B)
*D*                    X'14000009' - RETURN AFTER STEPMODE EXECUTION
*D*                    X'1400000A' - RETURN AFTER SPECIAL D-BRK
*D*                    X'1400000B' - TRANSFER BREAK
*D*
*D*               IF DELTA FINDS THAT ONE OF THESE NON-EXISTENT
*D*               INSTRUCTIONS CAUSED THE TRAP, IT CHECKS THE
*D*               ADDRESS TO MAKE CERTAIN THAT IT WAS EXPECTED
*D*               (IF NOT THIS REALLY IS A TRAP 40).
*D*               DELTA THEN TYPES ANY BREAK MESSAGE AND
*D*               RETURNS TO ACCEPT COMMANDS.  NOTE THAT IF
*D*               TRACEMODE IS SET, DELTA MERELY TYPES THE
*D*               MESSAGE AND RETURNS TO THE USER PROGRAM.
*D*
*D*               ;X PROCESSING.
*D*
*D*               THE ;X INSTRUCTION IS MOVED TO A SPECIAL LOCATION
*D*               IN DELTA'S CONTEXT PAGE WHERE IT IS FOLLOWED
*D*               BY THREE NON-EXISTENT INSTRUCTIONS (X'14000000')
*D*               WHICH TRAP AND GIVE CONTROL BACK TO DELTA
*D*               AFTER THE EXECUTION OF THE INSTRUCTION.  THERE
*D*               ARE THREE SPECIAL BREAKPOINT VALUES FOLLOWING
*D*               THE INSTRUCTION TO PROVIDE FOR BAL INSTRUCTIONS
*D*               WHICH MIGHT RETURN TO A +1, +2, OR +3 LOCATION.
*D*               WHEN THE TRAP OCCURS, DELTA MERELY OUTPUTS THE
*D*               PROMPT AND CONTINUES TO ACCEPT COMMANDS.
*D*
*D*               ;B (USER SPECIFIED I-BRKS) PROCESSING.
*D*
*D*               DELTA MAINTAINS PARALLEL TABLES FOR EACH I-BRK
*D*               DEFINED BY THE USER WHICH INCLUDE THE LOCATION
*D*               OF THE BREAK, THE INSTRUCTION CONTAINED AT
*D*               THAT LOCATION, THE TRACE FLAG, THE DISPLAY
*D*               LOCATION (IF SPECIFIED), AND THE PROCEED COUNT
*D*               FOR THAT BREAK.  THESE TABLES ARE INDEXED BY
*D*               THE BREAK NUMBER (1-8).  WHEN ONE OF THESE
*D*               BREAKPOINTS (X'14000001'-X'14000008') IS
*D*               ENCOUNTERED, DELTA OUTPUTS ANY NECESSARY DATA
*D*               AND EITHER CONTINUES (TRACE OR PROCEED) THE USER
*D*               PROGRAM OR RETURNS TO ACCEPT COMMANDS.
*D*
*D*               SPECIAL D-BRK PROCESSING.
*D*
*D*               SPECIAL D-BRK PROCESSING IS INVOKED WHENEVER
*D*               DELTA CANNOT ACCESS THE INSTRUCTION WHICH
*D*               TRAPPED BECAUSE OF A MEMORY PROTECTION CAUSED
*D*               BY USER DEFINED D-BRKS.  DELTA EXECUTES THE
*D*               INSTRUCTION FROM A SPECIAL AREA IN ITS CONTEXT
*D*               PAGE WHICH IS FOLLOWED BY A BREAKPOINT INSTRUCTION
*D*               (X'1400000A').  D-BRKS ARE REEXECUTED WITH THE
*D*               PROTECTION RESTORED TO ALL ACCESS.  WHEN THE
*D*               SPECIAL BREAKPOINT TRAP OCCURS, DELTA MERELY
*D*               INCREMENTS THE LOCATION COUNTER, RESETS THE
*D*               BREAKPOINTS SPECIFIED BY THE USER AND CONTINUES
*D*               THE USER PROGRAM.
*D*
*D*               STEPMODE AND TRANSFER BREAKPOINT PROCESSING.
*D*               (INTERPRETIVE EXECUTION)
*D*
*D*               STEPMODE AND TRANSFER BREAKPOINTS ARE HANDLED
*D*               SIMILARLY.  IN BOTH CASES THE CURRENT (OR
*D*               SPECIFIED) LOCATION IS ANALYZED FOR A BRANCH
*D*               INSTRUCTION.  IF THE INSTRUCTION IS A BRANCH, IT
*D*               IS ANALYZED AND THE BRANCH EXECUTION IS SIMULATED.
*D*               THE LOCATION COUNTER IS EITHER INCREMENTED (NON-
*D*               BRANCHING) OR SET TO THE EFFECTIVE ADDRESS
*D*               (BRANCHING).  FOR STEPMODE THAT LOCATION IS
*D*               OPENED AND DISPLAYED, AND DELTA RETURNS TO
*D*               ACCEPT COMMANDS.  FOR TRANSFER BREAK MODE, DELTA
*D*               CHECKS THE SAT (SPECIAL ACTION TABLE) FOR
*D*               DISPLAY/DON'T DISPLAY SITUATIONS; OUTPUTS THE
*D*               'FROM --> TO' MESSAGE; AND PROCEEDS BASED ON
*D*               THE 'TRACE' CONDITION.
*D*
*D*               FOR STEPMODE IF THE INSTRUCTION IS NOT A BRANCH,
*D*               IT IS EXECUTED IN A SPECIAL AREA OF DELTA'S
*D*               CONTEXT PAGE WHERE IT IS FOLLOWED BY AN INSTRUCTION
*D*               BREAKPOINT (X'14000009').  WHEN THE SPECIAL
*D*               BREAKPOINT TRAP OCCURS, DELTA OBTAINS THE NEXT
*D*               INSTRUCTION IN-LINE, INCREMENTS THE LOCATION
*D*               COUNTER (;I), THEN OPENS AND DISPLAYS THAT LOCATION.
*D*
*D*               FOR TRANSFER BREAKPOINTS IF THE INSTRUCTION IS
*D*               NOT A BRANCH, EACH SUCCESSIVE INSTRUCTION IS
*D*               CHECKED UNTIL DELTA FINDS A BRANCH.  THE BRANCH
*D*               INSTRUCTION IS SAVED AND REPLACED WITH AN INSTRUCTION
*D*               BREAKPOINT (X'1400000B').  DELTA THEN RETURNS
*D*               TO THE USER PROGRAM BUT REGAINS CONTROL WHEN
*D*               THE BREAKPOINT TRAPS.  AT THIS POINT THE CURRENT
*D*               LOCATION IS A BRANCH, AND PROCESSING CONTINUES
*D*               AS DESCRIBED ABOVE.
*D*
*D*      DATA BREAKPOINT PROCESSING...
*D*
*D*               IF POSSIBLE DELTA ANALYZES THE INSTRUCTION
*D*               CAUSING THE TRAP TO OBTAIN THE EFFECTIVE ADDRESSES
*D*               OF THE STORE.  THE BEGINNING AND ENDING EFFECTIVE
*D*               ADDRESSES ARE COMPUTED, AS WELL AS EXTRA LOCATIONS
*D*               SUCH AS A STACK POINTER DOUBLEWORD, AND
*D*               CHECKED FOR DATA BREAKS.  (IF THERE ARE NO DATA
*D*               BREAKS IN ANY OF THE PAGES COMPUTED FOR THE
*D*               EFFECTIVE ADDRESSES, THE TRAP IS A REAL MEMORY
*D*               PROTECTION TRAP.) DELTA THEN RE-EXECUTES THE
*D*               INSTRUCTION WITH THE ORIGINAL ACCESS, AND TYPES
*D*               THE D-BRK MESSAGE IF THE DATA BREAK ADDRESS FELL
*D*               WITHIN THE LIMITS OF THE COMPUTED ADDRESSES.
*D*               THE D-BRK CELL IS OPENED, AND DELTA RETURNS TO
*D*               ACCEPT COMMANDS.
*D*
*D*               IF DELTA CANNOT ANALYZE THE INSTRUCTION (SUPPOSE
*D*               IT IS IN A PUBLIC LIBRARY), IT RE-EXECUTES THE
*D*               INSTRUCTION AS A SPECIAL D-BRK AND DOES NOT CHECK
*D*               FOR D-BRK CHANGES.  THIS METHOD IS ALSO USED FOR
*D*               CERTAIN CALS (M:KEYIN FOR EXAMPLE) WHICH DELTA
*D*               DOES NOT CHECK FOR D-BRK CHANGES.
*D*
         PAGE
*
*        DELTA TRAP PROCESSING
*
T:DTRAP  EQU      %
TRAPENTR STCF     TCOND             SAVE CONDITIONS
         BAL,11   TMODECHK
         MTW,1    NOBREAKS          DISABLE BREAKS
         LW,15    DELTCNTL          GET DELT-IN-CONTROL FLAG
         MTW,1    DELTCNTL          SET DELTA-IN-CONTROL FLAG
         DO1      TEST=0
         M:TRAP   (IGNORE,FX)
         STW,15   DIC               SAVE DELTA-IN-CNTL FLAG AT TRAP
         MTW,0    DIC               CHECK PREVIOUS FLAG
         BEZ      USERTRAP          USER WAS IN CONTROL
*
         MTW,-1   NOBREAKS          ALLOW BREAKS
         LI,1     -20               DECREMENT STACK
         MSP,1    DTSTACK
         LCF      TCOND             GET CONDITIONS
         BCR,1    DELTRAP           NOT MEM PROTCT, DELTA TRAPPED
*                                   CHECK IF GETTING A PAGE
         MTW,1    GTPGMODE          TEST & TURN OFF GET PAGE MODE
         BLEZ     TRAP10            YES, GET PAGE
         MTW,1    DBANLZFG          NO, TEST & TURN OFF D-BRK ANLZ FG
         BGZ      DELTRAP           OFF, IT'S A REAL DELTA TRAP
         B        MEMVIOL           ON, CAME FROM D-BRK ANLZ INST IN
*                                     USER TRAP ROUTINE, SO IT'S A
*                                     USER MEMORY VIOLATION.
TRAP10   EQU      %
         LW,7     DELTREGS+3        GET DELT REG R3: ADR REQUESTED
        LW,6     7                 ADR OF PAGE TO GET
         BAL,11   GET%PAGES         GET PAGE
         BCR,8    TRAP20            GOT IT
*                                  COULDNT GET IT
SINT101  LI,1     BA(PAGEASGN)
         BAL,4    DRPRTMSG
         LW,3     6
         LI,2     1                 PUTOUT ADDR TOO
         LD,0     STKINIT           INITIALIZE DELTAS INTERNAL
        STD,0    DELSTK            WORKING STACK
         B        GOTOMSG
*
TRAP20   EQU      %
         LCI      0                 RESTORE DELTAS REGS
         LM,0     DELTREGS
         B        *DELTPSD
*
USERTRAP EQU      %
         STD,8    PTC               SAVE USER TRAP INFO
         BAL,11   RESTORE
         LW,1     *DTSTACK          GET TRAP LOCATION
         AI,1     -X'40'            ADJUST TO FORM INDEX
         LC       TCOND             RESTORE TRAP CONDITIONS
         EXU      TRAPS,1           TRANSFER VECTOR TO RIGHT TRAP RTN
*
TRAP40   EQU      %
         BCS,6    ERRCOND           ERROR CONDITION
         BCS,8    IBRKRTRN          NON-EXISTENT, MAY BE I BREAK
*
*        DATA BREAKPOINT TRAP PROCESSING
*
         LW,4     DBRKNENT          ARE THERE ANY DATA BREAKS SET ?
         BLEZ     MEMVIOL           NO, DON'T BOTHER CHECKING EFF ADR
         MTW,1    DBANLZFG          IS THIS A REAL MEM VIOL
         BEZ      MEMVIOL           YES, IF ANLZ FLAG STILL ON
         LI,8     -1                YES, SET D-BRK ANLZ FLAG IN CASE
         STW,8    DBANLZFG            ANLZ TRAPS, GOES TO 'MEMVIOL'.
         STW,8    DBRK%YES          YES TO CHECK D-BRKS
         LI,8     0                 TURN OFF STACK INST
         STW,8    DBRKSPD           FLAG
         LI,10    K1FFFF            VERIFY THAT ADDRESS
         AND,10   OLDPSD            IS ACCESSABLE TO DELTA
         BAL,0    ADRCHK
         BCS,2    DBRKYY            NO-NOT IN USER LIMITS
         LCI      0                 RESTORE REGS FOR ANALYZE
         LM,0     SAVREGS
         ANLZ,6   *OLDPSD
         BAL,0    DBRKEXU           GO MAKE EXU CHECK
         BCR,13   BYTE
         BCR,5    WORD
         BCS,1    BYTE1             BYTE IMMEDIATE
         BCR,8    HALF
*
*        DOUBLEWORD ADDRESS FROM ANALYSIS
*
DOUBLE   SLS,6    1
         STW,6    DBEFADR           BEGINNING WORD ADDRESS
         LB,7     *DBRKADR          GET OP CODE
         AND,7    M7
         CI,7     X'09'             TEST IF PSW
         BE       DBRKPUSH          YES
         CI,7     X'0B'             TEST IF PSM
         BNE      WORD7             NO
DBRKPUSH EQU      %                 STACK INSTRUCTION
         STW,6    DBRKSPD           A(SPD) MUST BE CHECKED
         LW,6     0,6               GET STACK LOC
         AI,6     1
         STW,6    DBEFADR           SET BEGINNING ADDRESS
         CI,7     X'09'             PSW INSTRUCTION
         BE       WORD6             YES - ONE LOC TO CHECK
         B        WORD2             PSM - MORE THAN ONE TO CHECK
*
*        NORMAL DOUBLEWORD INSTRUCTION HAS TWO WORDS TO CHECK
*
WORD7    EQU      %
         AI,6     1
         B        WORD6
*
*        WORD ADDRESS FROM ANALYSIS
*
WORD     STW,6    DBEFADR           SAVE EFFECTIVE ADDRESS
         LB,7     *DBRKADR          GET OP CODE
         AND,7    M7
         CI,7     X'2B'             TEST IF STM
         BNE      WORD6             NO
WORD2    LB,7     OLDPSD            GET CC
         SLS,7    -4
         AI,7     -1                COMPUTE NO. OF REGS -1
         BGEZ     %+2
         AI,7     16
         AW,6     7
WORD6    STW,6    DBEFADRX          SET END ADDRESS
         MTW,1    DBANLZFG          RESET ANLZ TRAP FLAG.
         LW,7     PAGE%MASK         MASK FOR CHECKING IF PAGE HAS A BRK
         BAL,4    DBRK%CHK          IS THERE A D-BRK ON THIS PAGE
         B        %+2               NO
         B        WORD3             YES
         LW,6     DBEFADR           CHECK BEGINNING ADDRESS
         BAL,4    DBRK%CHK          IS THERE A D-BRK ON THIS PAGE
         B        %+2               NO
         B        WORD3             YES
         LW,6     DBRKSPD           STACK INSTRUCTION
         BEZ      MEMVIOL           NO, MEMORY VIOLATION
         BAL,4    DBRK%CHK          IS THERE A D-BRK ON SPD PAGE
         B        MEMVIOL           NO, MEM VIOL
WORD3    EQU      %
         LW,10    OLDPSD            ADDRESS OF INSTRUCTION
         AND,10   M17               FROM PSD
         B        DBRKXX            EXECUTE THE BROKEN INSTRUCTION
*
*        RETURN HERE FOLLOWING RE-EXECUTION OF D-BRK
*
WORD30   LW,10    EXCTRAC           RESTORE USER ADDRESS
         AI,10    1                 (INCREMENTED)
         LW,11    DRADMSKM
         STS,10   OLDPSD            TO THE PSD LOCATION
         MTW,1    ABORTFLG          ADJUST ABORTFLG
         MTW,1    DBRK%YES          ARE BREAKS TO BE CHECKED
         BGZ      DBRKEXIT          NO, GET OUT (GO BACK TO USER)
         MTW,0    ABORTFLG          PROCESSING AN ABORT (CAL1)
         BGZ      WORD31A           NO, CONTINUE
*
         LI,7     8                 HALF WORD DISPLACEMENT OF REC LENGTH
         LH,5     *ABORTDCB,7       GET RECORD LENGTH IN BYTES
         SLS,5    -1                ADJUST
         AI,5     3                 ROUND UP TO NEAREST WORD
         SLS,5    -2                AND MAKE IT A WORD COUNT
         AW,5     DBEFADR           REG 5 = LAST TRANSFER WORD ADR
         STW,5    DBEFADRX
WORD31A  LW,7     M17               GET MASK FOR FULL ADDRESS
         LI,5     7
WORD4    LW,6     DBEFADR           GET BEGINNING ADDRESS
         CS,6     DBRKLOC,5         CHECK BEG ADDRESS
         BG       WORD4A            NOT THIS ENTRY
         LW,6     DBEFADRX          GET END ADDRESS
         CS,6     DBRKLOC,5         IS D-BRK WITHIN INST RANGE
         BGE      FND               YES
WORD4A   EQU      %
         LW,6     DBRKSPD           STACK INSTRUCTION
         BEZ      WORD5             NO, CONTINUE LOOP
         CS,6     DBRKLOC,5         D-BRK ON SPD
         BE       FND               YES
         AI,6     1
         CS,6     DBRKLOC,5         D-BRK ON SPD
         BE       FND               YES
WORD5    AI,5     -1                BUMP INDEX
         BGEZ     WORD4             LOOP
         B        DBRKEXIT          NOT FOUND
*
*        BYTE ADDRESS FROM ANALYSIS
*
BYTE     LB,7     *DBRKADR          GET OP CODE
         AND,7    M7
         CI,7     X'77'             IS IT UNPK
         BNE      BYTE2             NO
         LW,7     6                 EFF ADR TO R7
         LH,6     *DBRKADR          GET LENGTH
         SLS,6    -4
         AND,6    M4
         SLS,6    1                 COMPUTE 2L-2
         AI,6     -2
         B        BYTE3
BYTE2    SLS,6    -2
         B        WORD
BYTE1    EQU      %
         LW,7     *DBRKADR          GET INSTRUCTION
         SLS,7    8
         SLS,7    -28               R FIELD
         OR,7     DRBIT31           RU1
         LW,7     SAVREGS,7         GET CONTENTS OF RU1
         LI,6     0
         SLD,6    8                 COUNT TO R6
         SLS,7    -8
BYTE3    AW,6     7                 END BYTE ADDRESS
         SLS,7    -2                BEG WORD ADDRESS
         SLS,6    -2                END WORD ADDRESS
         STW,7    DBEFADR           SAVE BEGINNING ADR
         B        WORD6
*
*        HALFWORD ADDRESS FROM ANALYSIS
*
HALF     SLS,6    -1
         B        WORD
*
*        FOUND THE DATA BREAKPOINT LOCATION
*
FND      LS,6     DBRKLOC,5         GET BREAK LOC
         STW,6    DBEFADR           SAVE EFFECTIVE ADDRESS
         STW,5    DBRKNUM           SAVE INDEX AS BRK #
         LB,6     DBRKCOND,5        GET BREAK TEST INDEX
         BEZ      DATABRK           NONE, STOP ALWAYS
         LI,4     DATABRK           SET YES RETURN
         LW,8     DBRKVAL,5         GET CONDITIONAL VALUE
         LW,9     DBRKMASK,5        GET CONDITIONAL MASK
         CS,8     *DBEFADR          COMPARE WITH CONTENTS OF BRK LOC
         EXU      BKCNDTN-1,6       TEST
DBRKEXIT EQU      %
         MTW,0    STEPMODE          IS STEPMODE SET
         BGZ      DRSEMIGB          YES, CONTINUE STEPPING
         B        DRSG0             ELSE GO
         PAGE
*
*        EXECUTE THE DATA BREAK AS A USER INSTRUCTION
*
DBRKYY   LI,4     0                 SET NOT TO CHECK D-BRKS
         STW,4    DBRK%YES          IF DELTA CAN'T SEE LOCATION
DBRKXX   STW,10   EXCTRAC           STORE ADDR THAT CAUSED D-BRK
         LI,2     EXCDBRK           WE'LL EXECUTE IT SPECIAL
         LW,3     DRADMSKM
         STS,2    OLDPSD            FROM DELTA'S DATA PAGE
         BAL,4    IBRKSET           SET I-BRKS BUT NOT D-BRKS
         B        USERGO            EXECUTE INST-BRK FOLLOWING
*
*        TEST THE BROKEN INSTRUCTION FOR AN EXU
*
DBRKEXU  STCF     0                 SAVE CONDITION CODES FROM ANLZ
         LI,10    K1FFFF            GET CURRENT INSTR ADDRESS
         AND,10   OLDPSD
         STW,10   DBRKADR           AND SAVE FOR LATER
         LB,7     *10               GET OP CODE
         AND,7    M7
         CI,7     X'67'             AND TEST FOR EXU
         BE       DBRKEXU1          YES, FURTHER ANLZ NEEDED
         LCF      0                 NO,RESTORE CONDITIONS
         B        *0                AND RETURN
DBRKEXU1 STW,6    DBRKADR           SAVE NEW INSTR ADDRESS
         STW,0    RSTRTRN           SAVE RETURN ADDRESS
         LCI      0                 RESTORE REGISTERS
         LM,0     SAVREGS
         ANLZ,6   *DBRKADR          ANLZ THE NEW INSTR ADDRESS
         B        *RSTRTRN          RTN WITH NEW COND CODES
*
         PAGE
*         DATA BREAKPOINT - CONTROL TO DEBG
*
DATABRK  LW,5     DBRKNUM           GET BREAK #
         LW,1     DRBIT0,5
         LS,1     TRACETBL
         BEZ      RSTOR
         LI,0     TRACEOFF
         STW,0    SLSHEXIT
         B        DMSG              DONT RESTORE I BREAKS,SET BREAK FLAG
RSTOR    LI,0     0                 TURN ON D BREAK MODE
         STW,0    DBRKMODE
         STW,7    DROPENER          SET OPEN SWITCH ON LOC
         LI,4     DRINITB
         STW,4    MESSEXIT
DMSG     BAL,7    DBRKMSG           D BREAK MESSAGE
         MTW,0    STEPMODE          STEPMODE SET
         BLEZ     %+3               NO, CONTINUE
         LW,3     DR#SEMII          IF YES, SET INSTRUCTION
         STW,3    IA                ADDRESS
         LW,3     DBEFADR
         B        BKOUT15           GO TYPE VALUE
TRACEOFF LI,0     MESSAGE
         STW,0    SLSHEXIT
         LI,0     0                 SET FLAG TO  ALLOW OUTPUT TO
         STW,0    PRINT%OK          THE PRINTER IF REQUESTED
         BAL,7    DUMPBUF           DUMP THE TRACE MESSAGE
         B        DRSG0             GO GO
*                                                                       03277000
         PAGE
*        TRAP TO 40 WAS TRULY ILLEGAL
*
MEMVIOL  EQU      %
ERRCOND  EQU      %
       BAL,15   TRAPCNTL          CHECK IF USER HAS TRAP CONTROL
         LB,10    TCOND             GET TRAP CONDITIONS
         SLS,10   -4                 SHIFT OFF FLOATING CONTROLS
         LI,3     4                  INDEX
GTRPTYP  EQU      %
         SCS,10   -1                TEST CC 4,3,2,1 IN THAT ORDER
         AI,10    0
         BGEZ     LOOPTEST           NOT SET
         LW,1     ERMSVEC-1,3        GET APPROPRIATE ERROR MSG ADR
         BAL,4    DRPRTMSG          PUT IT OUT
LOOPTEST BDR,3    GTRPTYP            CHECK NEXT
*
ERR20    EQU      %
         LW,3     DR#SEMII          OUTPUT ERROR ADDRESS
         LI,2     0                 SYMBOLIC PRINT MODE
GOTOMSG  EQU      %
         LI,4     0                 TURN OFF STEPMODE
         STW,4    STEPMODE
*
         LI,4     BCHK20            RETURN INITIALIZES EVERYTHING
         B        DRPRTADR          OUTPUT ADDRESS
         PAGE
*
*        TRAP OCCURRED WHILE DELTA WAS IN CONTROL.
*
DELTRAP  EQU      %
         LD,0     STKINIT           INITIALIZE DELTAS INTERNAL
        STD,0    DELSTK            WORKING STACK
*
*        TEST IF TRAP CAUSED BY THE USER
*
         LI,1     X'1FFFF'
         AND,1    DELTPSD           GET DELTA TRAP ADDRESS
         LCF      TCOND             OTHERWISE, CHECK MEM PROT
         BCR,1    DELTRAP1          REAL DELTA TRAP
         LW,3     DELTREGS+3        A(LOC) IF ONE AT FAULT
         LI,4     TTBLSZ            GET TRAP LOCS. TABLE SIZE
         CW,1     TRAPTBL,4         WAS TRAP CAUSED BY USER
         BE       SLSTRAP           YES
         BDR,4    %-2               CONTINUE TESTING
         CI,1     MBSTST
         BNE      DELTRAP1          REAL DELTA TRAP
         LW,3     DELTREGS+4        R4 HAS BYTE ADDRESS
         SLS,3    -2
         B        SLSTRAP
*
*        REAL DELTA TRAP
*
DELTRAP1 EQU      %
         LI,1     BA(DTRPMSG)       PUT OUT DELT TRAP MSG
         BAL,4    DRPRTMSG
        LW,3     DELTREGS+16       PUT OUT TRAP LOCATION
         BAL,4    DRPRTHXA
         LI,1     BA(DTRPMSG1)      PUT OUT 2ND PART OF TRAP MSG
         BAL,4    DRPRTMSG
         LI,3     X'1FFFF'          PUT OUT DELTA'S LOC
         AND,3    DELTPSD
         BAL,4    DRPRTHXA
        B        BCHK20
*
*        GIVE DELTA TRAP TO THE USER
*
SLSTRAP  EQU      %
         LI,1     BA(DRMEMPRX)      MEM PROTECT
         BAL,4    DRPRTMSG          ACCESSING LOC IN R3
         LI,2     0
         B        GOTOMSG
         PAGE
*
*        THIS ROUTINE CHECKS IF THE USER IS MONITORING THIS TRAP
*
TRAPCNTL EQU      %
         LW,1     *DTSTACK          GET TRAP LOC
         AI,1     -X'40'            COMPUTE TRAPFLAG INDEX
         CI,1     7
         BL       %+2
         LI,1     7
         LH,0     TRAPFLAG,1        GET CORRESPONDING TRAP FLAG BIT
         CH,0     PTC               DOES USER HAVE TRAP CONTROL
         DO       TEST=0
         BAZ      *15
         ELSE
         B        *15
         FIN
*                                  YES
        STW,15   CURNOPR           SAVE EXIT ADR
        BAL,15   DTS#USER          MOVE THE STACK TO USER IF POSSIBLE
        LD,0     OLDPSD            GET TRAP PSD
         LB,2     TCOND             STORE TRAP CONDITIONS IN PSD
        STB,2    0
         LW,14    PTC+1             GET USERS TRAP ENTRY POINT
        LI,15    X'1FFFF'
        STS,14   0                 STORE USERS TRAP ENTRY IN PSD
         BAL,11   DBRKRESET         RESET ACCESS CODE TO 00 FOR DATA PAG
         BAL,11   RSTOR20           SET UP
        B        DRSG0                  AND GO
         PAGE
************************************************************************
*                                                                      *
*        RETURN TO DELTA FROM AN INSTRUCTION BREAKPOINT                *
*                                                                      *
************************************************************************
IBRKRTRN EQU      %
         INT,4    TRAPINST          GET ADR PORTION OF TRAP INSTR
         LW,6     TRAPTEMP          GET TRAPPED INST ADDRESS
         CI,5     8                 WAS IT AN I BREAK
         BLE      IBRK10            MAYBE
*
         CI,5     X'A'              DID WE EXU A DATA BRK
         BNE      TBRKRTN           NO
         MTW,1    DBANLZFG          TURN OFF ANLZ FLAG
         CLM,6    EXCDRTN           CHECK FURTHER
         BCR,12   WORD30            YES, EXU OF D-BRK
*
TBRKRTN  EQU      %
         CLM,6    BADR              WAS IT A TRANSFER BREAK
         BCR,3    TRAC0             YES
         BCR,12   TRAC0             YES
         CI,6     TRTNINST          IS IT SIMULATION OF M:TRTN
         BNE      ERRCOND           NO, NON-EXISTENT INSTRUCTION
         MTW,0    TRTNFLG           THIS BETTER BE ZERO
         BNE      ERRCOND
         MTW,-1   TRTNFLG           TURN OFF FLAG
         LW,2     TRTNSV            GET NEW IA
         B        DRSG2             AND GO TO IT
*
IBRK10   EQU      %
         STW,6    IA                SET TRANSFER BREAK IA
         CI,5     0                 WAS IT AN EXECUTE
         BNE      IBRKTEST          NO CHECK LEGALITY
*
         CLM,6    XRETURN           IS IT REALLY AN EXECUTE
         BOL      ERRCOND           NO, ERROR
         LW,0     TEMP
         STW,0    DR#SEMII
         MTW,0    STEPMODE          STEPMODE IN EFFECT
         BEZ      MESSAGE           NO
         STW,0    IA                RESET IA
         B        MESSAGE           AND GET NEXT COMMAND
*
IBRKTEST EQU     %
         CW,6     IBRKLOC-1,5
         BNE      ERRCOND
IBRKFND  AI,5     -1                R5 = BREAKPOINT NUMBER
         STW,5    IBRKNUM
         STW,6    ACTBKLOC          SAVE ACTIVE BREAK LOCATION
         STW,6    IA                SET FOR TRANSFER MODE
         MTW,1    IBRKMODE          EXEC BREAK INSTR ON RETURN
         LB,6     IBRKCOND,5        CHECK FOR TEST
         BEZ      IBRKNT            NONE,ALWAYS STOP
         LI,4     IBRKNT            SET STOP RETURN FROM TEST
         LW,10    IBRKVAL,5         MAKE TEST
         LW,3     IBRKDPLY,5
         CI,3     16                IF REGISTER, GET IT
         BGE      %+2
         AI,3     SAVREGS
         CW,10    0,3
         EXU      BKCNDTN-1,6
         B        IBRKCONT          NOT THERE, CONTINUE
IBRKNT   RES
         MTW,-1   IBRKPRCD,5        DECREMENT PROCEED COUNT
         BGZ      IBRKCONT          NOT DONE YET, CONTINUE
         LI,11    IBRKCONT          CONTINUE POINT FOR TRACE BREAKS
         B        BRKOUTPT          OUTPUT I BREAK MESSAGE
         PAGE
************************************************************************
*                                                                      *
*        TRANSFER BREAKS AND STEPMODE.
*
*        THIS ROUTINE CHECKS THE USER PROGRAM FOR THE NEXT
*        IN-LINE BRANCH.  STEPMODE EXECUTES ONE INSTRUCTION
*        AT A TIME AND SIMULATES BRANCHES.  TRANSFER BREAK-
*        POINTS REPLACE EACH NEXT BRANCH WITH AN INSTRUCTION
*        BREAKPOINT.
*                                                                      *
************************************************************************
INTEX    EQU      %                 ENTRY FOR TRANSFER BREAK EXECUTION
         LW,1     IA                GET CURRRENT IA
         LW,3     IAP
         STD,1    IAP               SET FROM ADDRESS AND RESET TO
*                                   THE STD IS BECAUSE ;Y ENTERS AT
*                                   INTEX+1 WITH START LOC IN R1
         MTW,1    NOBREAKS          DISABLE BREAKS
         LW,0     STEPMODE          CHECK FOR STEP MODE
         BNEZ     TRACEXEC          YES, GO EXECUTE
*
         CI,1     X'1C200'          IS ADDRESS IN A SHARED LIBRARY?
         BL       INT10             B/ NO
         LW,10    TYPE              IS INSTRUCTION A BAL?
         CI,10    X'6A'
         BNE      INT10             B/ NO
         LW,1     3                 START SEARCHING FOR BRANCHES
         AI,1     1                 ... IN USER PROGRAM
         B        INT20
INT10    LW,3     1                 FOLLOW IT THROUGH THE SUBROUTINE
INT20    STD,1    IAP               SET FROM ADDRESS AND RESET TO
         STW,1    BADR              SAVE START ADR
*
         LI,0     0                 ZERO FORKINST HERE
         STW,0    FORKINST
         BAL,7    BRANCHK           GET NEXT BRANCH
         BCS,2    DRSG3             NONE,START NORMAL EXECUTION
         BCR,9    BRANCHK
         BCS,8    %+2
         MTW,-1   BADR
*
*        WE NOW HAVE NEXT BRANCH OR EXU-BRANCH IN LINE
*
         LW,2     3                 GET START LOC FOR ;G
         LW,1     BADR              GET ADR WHICH MAY CAUSE BRANCH
         STD,1    IAP               SET UP IA & IAP FOR RETURN
         LW,0     BRXPSD            GET SPECIAL RETURN XPSD
         LW,3     0,1               GET THE BRANCHING INST.
         STW,0    0,1               STORE THE BREAK
         STW,3    FORKINST          SAVE THE BRANCHING INST.
         B        DRSG3             NORMAL EXECUTION THERE
*
*
TRACEXEC EQU      %
         LW,10    IA                GET CURRENT INSTR ADR 'IA'
         STW,10   BADR              SAVE CURRENT ADR
*
         BAL,7    BRANCHK           ANALYZE THE INSTRUCTION
         BCS,9    INTPT30           BRANCH IF A BRANCH
         BCS,2    DRSG4             TO ;G IF DELTA CAN'T ACCESS
*
         LW,0     *IA               EXECUTE THE NON-BRANCHING
         STW,0    EXCTRAC           INSTRUCTION
         LI,2     EXCTRAC
         B        DRSG3
*
INTPT30  EQU      %
         STW,10   BADR              SAVE BRANCH POINT
*
         LW,3     IA                INSTRUCTION LOC PLUS 1 FOR BAL
         AI,3     1                 AND NO BRANCH CASES
         LW,2     BALREG            REGISTER FIELD FOR ALL CASES
*
         LW,1     TYPE              CONVERT OP CODE TO AN INDEX
         AI,1     -X'64'            FOR SPECIAL ACTION - TRANSFER VECTOR
         LCI      15                SET CC TO INDICATE BRANCH (FOR BAL)
         EXU      BACT,1            DO IT
         BNEZ     BRANCHER          IT WAS A BRANCH
*
NOBRANCH EQU      %
         LI,5     9                 NO BRANCH CODE
         LW,10    3                 INSTRUCTION LOC
NOBNCH10 EQU      %
         STW,10   DR#SEMII          SET INSTRUCTION COUNTER AND
         B        TRACRTRN          GO FINISH BRANCH PROCESSING
*
BDRBNCH  EQU      %
         MTW,-1   SAVREGS,2
         BGZ      BRANCHER
         B        NOBRANCH
*
BIRBNCH  EQU      %
         MTW,1    SAVREGS,2
         BLZ      BRANCHER
         B        NOBRANCH
*
BCRBNCH  EQU      %
         CW,2     DR#SEMIC          ARE BRANCH CONDITIONS SATISFIED
         BAZ      BRANCHER          YES
         B        NOBRANCH          NO
*
BCSBNCH  EQU      %
         CW,2     DR#SEMIC          ARE BRANCH CONDITIONS SATISFIED
         BAZ      NOBRANCH          NO
*                                   YES
BRANCHER EQU      %
         LI,5     10                BRANCH CODE
         B        NOBNCH10
*
*
         PAGE
************************************************************************
*        TRANSFER BREAKS AND STEPMODE.
*
*        THIS ROUTINE GETS CONTROL WHEN THE BREAKPOINT TRAP
*        OCCURS, AND ALSO FOLLOWING SIMULATION OF A BRANCH
*        INSTRUCTION.  IT SETS UP THE LOCATION COUNTER AND
*        OUTPUTS THE NECESSARY MESSAGES.
*                                                                      *
*                                                                      *
************************************************************************
TRAC0    EQU      %
         CI,5     11                CHECK RETURN TYPE
         BL       TRACRTRN          BRANCGH OR STEPMODE
         BE       TRAC00            RETURN TO EXECUTE A BRANCH
         B        ERRCOND           NON-EXISTENT INSTR TRAP
TRACRTRN EQU      %
         MTW,1    IA                BUMP CURRENT IA
TRAC00   EQU      %                 RETURN TO EXECUTE BRANCHES ENTRY
TRAC05   EQU      %
         LI,15    1                 SET GO FLAG
         STW,15   GO%FLAG
         AI,5     -9                5=0,NO JUMP; =1, JUMP
*                                   =2, RETURN TO EXECUTE BRANCH
         STW,5    RETRNTYP          SAVE RETURN CODE
         CI,5     2                 IS IT TO EXECUTE BRANCH
         BE       TRAC10            YES, CHECK FOR I BRK & EXIT
         LW,0     IA,5              GET NEW CURRENT INST ADR
*                                   EITHER IA OR BADR
         STW,0    IA                SET IA
         LW,0     STEPMODE          IN STEP MODE
         BNEZ     TRAC40            YES
         CI,5     1                 NO, WAS IT A BRANCHING BRANCH
         BE       TRAC20            YES, DO OUTPUT CHECK & PROCESS
TRAC10   EQU      %                 CHECK FOR I BRK AND EXIT LOGIC
         LI,5     8                 # ENTRIES IN I BRK TABLE
         LW,2     IA                GET CURRENT LOCATION
         CW,2     IBRKLOC-1,5       COMPARE WITH I BRK TABLE
         BE       TRAC15            IT IS AN I BRK
         BDR,5    %-2               NO, LOOP
         MTW,-2   RETRNTYP          NOT AN I BRK, IS IT A RETURN TO
*                                   EXECUTE A BRANCH INSTRUCTION
         BEZ      TRACEXEC          YES, GO DO IT
         BAL,7    DUMPBUF           DUMP TRACE MESSAGE ON SPECIFIED
*                                   DEVICE IN CASE I BRK IS ON
*                                   A DIFFERENT DEVICE
         LW,0     GO%FLAG           NO, CHECK 'GO' FLAG
         BEZ      MESSAGE           NO GO
         B        INTEX             GO EXECUTE NEXT INSTRUCTIONS
TRAC15   EQU      %                 AT AN I BRK
         LI,3     K1FFFF            SET IA AS TRAP LOCATION
         STS,2    OLDPSD
         AI,5     -1                COMPUTE BREAK #
         STW,5    IBRKNUM           SAVE IT
         LW,0     IBRKPRCD,5        GET THE PROCEED COUNT
         BLZ      %+3               OUTPUT BREAK IF OFF
         MTW,-1   IBRKPRCD,5        ELSE, DECREMENT PROCEED COUNT
         B        INTEX             AND CONTINUE
         STW,2    ACTBKLOC          SET ACTIVE BREAK LOC AND
         MTW,1    IBRKMODE          TURN ON I BREAK MODE
         LI,11    INTEX             CONTINUE POINT IF TRACE
         B        BRKOUTPT          OUTPUT BREAK MESSSAGE (I BRK)
TRAC20   EQU      %                 CHECK FOR SPECIAL ACTION THIS BRANCH
         LW,1     TRACNENT          # ENTRIES IN SPECIAL ACTION TABLE
         BEZ      TRAC30            NONE, AUTOMATIC PRINT ON ALL
         LW,10    IAP               GET BRANCHING LOCATION
         LW,0     DO%DONT           0=HONOR ALL BUT SPEC ACTION LOCS
*                                   1=HONOR ONLY SPECIAL ACTION LOCS
         BEZ      TRAC25            ALL
         BAL,4    CHKTABL           WAS THIS BRANCH SPECIFIED
         B        TRAC30            CONTINUE OUTPUT PROCESSING
         B        TRAC10            NO, DONT PRINT, CHECK I BRK & EXIT
TRAC25   EQU      %                 PRINT ALL BUT SPECIFIED LOCATIONS
         BAL,4    CHKTABL           WAS THIS BRANCH SPECIFIED
         B        TRAC10           YES, DONT PRINT, CHECK I BRK & EXIT
*                                   NO,  CONTINUE OUTPUT PROCESSING
TRAC30   EQU      %                 CHECK FOR BDR/BIR AND WHAT TO DO
         LW,0     TYPE              GET OP CODE OF BRANCH
         CI,0     X'66'             WAS IT BDR/BIR
         BG       TRAC35            NO, CONTINUE OUTPUT PROCESS
         LW,0     TRACLOOP          YES,CHECK BDR/BIR TRACE FLAG
         BEZ      TRAC10            DONT PRINT, CHECK FOR IOBRK
TRAC35   EQU      %                 PRINT JUMP MESSAGE
         LW,15    TRACMODE          GET MODE OF INTERPRETIVE EXECUTION
*                                   0=JUMP-STOP ; 1=JUMP-TRACE
         STW,15   GO%FLAG           SET 'GO' FLAG AFETER TRACE MODE
         BEZ      TRAC37            NO OUTPUT ON PRINTER IF
*                                     NOT IN TRACE MODE
         LI,0     0                 SET FLAG TO  ALLOW OUTPUT TO
         STW,0    PRINT%OK          THE PRINTER IF REQUESTED
TRAC37   EQU      %
         LW,3     IAP               GET 'FROM' ADDRESS
         LW,2     DRADRMOD          GET ADR OUTPUT MODE
         BAL,4    DRPRTADR          PRINT ADR
         LW,0     JUMPMESS          PUT OUT JUMP ARROW
         BAL,1    DRPRTSML
         LW,3     IA                GET 'TO' ADR=CURRENT IA
         LW,2     DRADRMOD          ADR OUTPUT MODE
         BAL,4    DRPRTADR          PRINT 'TO' ADDRESS
         LI,0     #CRETRN           OUTPUT   CR
         BAL,4    TYPOUT
         B        TRAC10            CHECK FOR I BRK AND EXIT
*
TRAC40   EQU      %                 STEPMODE
         LI,0     #CRETRN           CR IF STEPMODE
         BAL,4    TYPOUT
         LW,3     IA                GET CURRENT ADR
         STW,3    DR#SEMII          SET ;I ADDRESS
         B        BKOUT15
         PAGE
*
*        USER TRAP PROCESSING--FOR TRAPS 41 THROUGH 45
*        ENTERED BASED ON TRAP LOCATION PUSHED INTO STACK.
*
*        THIS CODE HANDLES TRAP 42                                     *
STAKOFLW LI,0     BA(STKOVFLW)
         B        TRAPMSG
*        THIS CODE HANDLES TRAPS 41,43,44,45.                          *
UNIMP    LI,0     BA(UNIMPTRP)      MESSAGE ADDRESS
         B        TRAPMSG
FIXARITH LI,0     BA(FIXTRP)
         B        TRAPMSG
FLTFLT   LI,0     BA(FLTTRP)
         B        TRAPMSG
DECFLT   LI,0     BA(DECTRP)
TRAPMSG  STW,0    TRAPMESS          SAVE LOCATION OF TRAP MESSAGE
         BAL,15   TRAPCNTL
         LW,1     TRAPMESS          GET MESSAGE ADDRESS
TRAPOUT  LI,4     ERR20             RETURN TO 40 TRAP PROCESSING
         B        DRPRTMSG          PRINT IT
         PAGE
************************************************************************
*                                                                      *
*D*      NAME:    ABORTENT, ABORT AND EXIT CONTROL ENTRY POINT
*D*
*D*      ENTRY:   ENTRY IS FROM CP-V IN THE SAME MANNER AS ENTRY TO
*D*               ANY M:XCON ROUTINE, EXCEPT THAT THE MONITOR
*D*               HAS 'SPECIAL KNOWLEDGE' OF DELTA'S ABORT CONTROL
*D*               ENTRY POINT AND STACK ADDRESS; THEREFORE DOES NOT
*D*               OBTAIN THEM FROM THE JIT LOCATIONS J:EXTENT AND
*D*               J:TCB.  THESE ENTRIES ARE RESERVED FOR THE USER
*D*               RUNNING UNDER DELTA.
*D*
*D*      DESCRIPTION:  IF THE ABORT OCCURRED WHILE DELTA WAS IN
*D*               CONTROL, DELTA REINITIALIZES ITSELF, TYPES THE
*D*               APPROPRIATE MESSAGE FROM THE ERRMSG FILE WITH
*D*               THE LOCATION CAUSING THE ABORT, AND RETURNS TO
*D*               ACCEPT COMMANDS.
*D*
*D*               IF THE ABORT OCCURRED WHILE THE USER WAS IN
*D*               CONTROL, DELTA RESTORES THE I-BRKS, D-BRKS, AND
*D*               TRANSFER BREAKS TO THEIR ORIGINAL INSTRUCTIONS
*D*               AND/OR ACCESS; CHECKS TO SEE IF A POSSIBLE DATA
*D*               BREAK CAUSED THE ABORT (IF SO, PROCESSING CONTINUES
*D*               AS DESCRIBED FOR DATA BREAK PROCESSING); TYPES
*D*               THE APPROPRIATE MESSAGE AND RETURNS TO ACCEPT
*D*               COMMANDS.
*D*
*                                                                      *
************************************************************************
ABORTENT EQU      %                 ALL EXITS FROM REAL-TIME COME HERE
         MTW,1    NOBREAKS          DISABLE BREAKS
         BAL,11   TMODECHK
         STB,8    CURNOPR           SAVE RUN STATUS
         LW,15    DELTCNTL          GET DELTA-IN-CONTROL FLAG
         DO1      TEST=1
         STD,10   DRTEMPD1          SAVE ABORT CODE AND SUBCODE
         MTW,1     DELTCNTL          SET         "     "     "
         DO1      TEST=0
         M:TRAP   (IGNORE,FX)
         CI,15    0                 WAS DELTA IN CONTROL
         BE       ABRT10            NO
          LI,1     -20              YES, BUMP STACK POINTER DOWN
         MSP,1     DTSTACK
         B        ABORT11
ABRT10   EQU      %
         STD,8    PTC               SAVE USER TRAP INFO
         BAL,11   RSTORD            RESTORE ALL BREAKS
         BAL,11   ABORT100          CHECK FOR DATA BREAK CUASED ABORT
ABORT11  EQU      %
         MTW,-1   NOBREAKS          ALLOW BREAKS
         LI,1     DRINITA           INITIALIZE TO HAVE FRESH START
         STW,1    MESSEXIT
         LW,2     ERKEY             ERROR MESSAGE KEY X'03000000'
         LI,4     0                 CHECK RUN STATUS BITS
         LW,5     CURNOPR
         SLD,4    2                 MOVE BITS 0 AND 1 TO REG 4
         AI,4     0                 IS EITHER BIT SET
         BEZ      ABRT20            NO, CHECK BIT 5
         OR,2     ERCODES-1,4       YES- PUT CODE AND SUBCODE INTO KEY
         B        ABRT40            GO TO GET ERROR MESSAGE
ABRT20   SLS,5    3                 SHIFT TO POSITION BIT 5 IN 1
         CI,5     0                 IF BIT 5 SET, R1 LESS THAN ZERO
         BGE      ABRT30            NO, BIT 5 NOT SET, GET J:ABC
         LW,1     J:ASSIGN          LIMIT FLAGS
         SLS,1    23                POSITION TO LEFT OF REG 1
         LI,3     9                 USE FOR COUNT AND SUBCODE
ABRT25   LI,0     0                 CHECK BITS 23 THROUGH 31 OF LIMIT
         SLD,0    1                 EXCEEDED FLAGS. IF A ONE BIT SET,
         CI,0     1                 REGISTER 3 WILL CONTAIN THE PROPER
         BE       ABRT27            SUBCODE.
         BDR,3    ABRT25            IF BIT 5 IS SET, ERROR CODE IS B3
ABRT27   OR,3     X'B300'           OR ERROR CODE INTO R3
         OR,2     3                 OR ERROR AND SUBCODES INTO KEY IN 2
         B        ABRT40            GO TO GET ERROR MESSAGE
ABRT30   EQU      %
         DO       TEST=0
         LB,4     J:ABC             GET ABORT CODE IN 4 IF J:RNST
         LW,5     J:JIT+ERO         NOT SET. GET SUBCODE IN 5
         ELSE
         LW,4     DRTEMPD1          ABORT CODE FROM R10
         LW,5     DRTEMPD1+1        AND SUBCODE FROM R11
         FIN
         SLS,5    24                POSITION SUBCODE LEFT JUSTIFIED
         SLD,4    8                 GET CODE AND SUBCODE IN 4
         OR,2     4                 OR ERROR AND SUBCODES INTO KEY IN 2
ABRT40   LW,1     OUTCHAR           ANY OUTPUT WAITING
         BLEZ     %+2               NO
         BAL,7    DUMPBUF           YES- GO DUMP IT
         CW,2     ERKEY             NORMAL EXIT
         BE       ABRT90            YES
         BAL,0    CLOSEXX           YES- GO CLOSE IT
         STW,2    ERKEYM            PUT KEY IN MEMORY
         LI,1     10                FOR NUMBER OF TRIES TO OPEN IF BUSY
ABRT50   EQU      %
         CAL1,1   FOPEN
         M:READ   M:XX,(BUF,OUTBUF),(SIZE,120),;
                  (KEY,ERKEYM),(BTD,1),(ABN,ABRT60)
         CAL1,1   FCLOSE            CLOSE DCB
         LI,0     #CRETRN           PUT CARRIAGE RETURN BEFORE MSG
         STB,0    OUTBUF
         LH,1     M:XX+4            GET ACTUAL RECORD SIZE TRANSMITTED
         SLS,1    -1                ADJUST VALUE IN REGISTER
         AI,1     1                 ADD ONE FOR LEADING CARRIAGE RETURN
         STW,1    OUTCHAR           SAVE COUNT FOR DUMP ROUTINE
         BAL,7    DUMPBUF           PRINT MESSAGE
         B        ABRT95            GO PRINT LOCATION
ABRT60   EQU      %                 ABNORMAL IN READING FILE
         CAL1,1   FCLOSE            CLOSE DCB
         B        ABRT80            OUTPUT CODE AND SUBCODE
ABRT70   EQU      %                 ABNORMAL OR ERROR IN OPENING FILE
         SLS,10   -17               CHECK IF FILE WAS BUSY
         CI,10    X'A01'
         BNE      ABRT80            NO, OTHER PROBLEM - PRINT CODES
         BDR,1    ABRT50            YES - TRY 10 TIMES
ABRT80   EQU      %
         LI,1     BA(ABRTCD)        PUT MESSAGE ABORT WITH CODE =
         BAL,4    DRPRTMSG          IN OUTBUF
         LI,1     2
         LB,3     ERKEYM,1          GET CODE FROM KEY
         BAL,4    DRPRTHXA          PUT IN HEX IN OUTBUF
         LI,1     BA(ABRTSC)        GET ADDRESS OF , SUBCODE =  MESSAGE
         BAL,4    DRPRTMSG          PUT IN OUTPUT BUFFER
         LI,1     3                 BYTE FOR SUBCODE
         LB,3     ERKEYM,1          GET SUBCODE
         BAL,4    DRPRTHXA          PUT IN HEX IN OUTBUF
         B        ABRT95            GO PRINT LOCATION
ABRT90   EQU      %
         LI,1     BA(EXIT)
         BAL,4    DRPRTMSG          PUT MESSAGE 'EXIT AT' IN BUFFER
         B        ABRT97
ABRT95   EQU      %
         LI,1     BA(LOCATION)
         BAL,4    DRPRTMSG          ENTER 'LOCATION=' IN BUFFER
ABRT97   LW,3     OLDPSD            GET USER'S PSD
         LI,4     KADMSKM
         AND,3    4                 ISOLATE IA
         MTW,0    STEPMODE          ARE WE IN STEP MODE
         BEZ      %+2               NO
         LW,3     DR#DSIGN          YES, GET CORRECT EXIT ADDRESS
         BAL,4    DRPRTADR          ADD ADDRESS TO BUFFER
         BAL,7    DUMPBUF           TYPE THE MESSAGE
         MTW,0    DELENT            IF UNABLE TO EXECUTE, EXIT
         BGZ      DREND
         B        DRINIT            START OVER AFTER OUTPUT
ABORT100 EQU      %
         STW,11   ABORTSV           SAVE RETURN LINK
         MTW,0    DBRKNENT          IS A DATA BREAK POINT SET
         BLEZ     *11               NO DATA BREAKPOINTS
         MTW,1    ABORTFLG          ALREADY PROCESSING AN ABORT
         BEZ      *11               YES, REALLY AN ERROR
         DO       TEST=0
         LB,1     J:ABC             GET ABORT CODE
         ELSE
         LW,1     DRTEMPD1
         FIN
         SLS,1    8                 SHIFT IT
         CI,1     X'A300'           CHK FOR A301
         BE       ABORT160
         LI,2     WA(ABRTCDT)       GET TABLE ADDRESS
ABORT110 EQU      %
         LW,3     0,2               GET TABLE ENTRY
         BEZ      *ABORTSV          RETURN IF END OF TABLE
         AI,2     1                 NEXT TABLE ENTRY
         CW,3     1                 IS THIS THE ONE
         BNE      ABORT110          NO, LOOK AT NEXT
         LB,7     CURNOPR           GET ABORT STATUS
         CI,7     2                 I/O ERROR
         BAZ      %+3               NO
         MTW,-1   DR#SEMII          STEP LOCATION COUNTER BACK TO CAL
         MTW,-1   OLDPSD            ELSE STEP PSD BACK TO INST.
         LI,4     -1                SET ANLZ AND DBRK FLAGS
         STW,4    DBANLZFG
         STW,4    DBRK%YES
         LI,10    K1FFFF            GET ABORT LOCATION
         AND,10   OLDPSD
         BAL,0    ADRCHK            AND TEST IF DELTA HAS ACCESS
         BCS,2    DBRKYY            NO, RETRY WITHOUT D-BRKS
         LH,7     *OLDPSD           GET OPERATION
         AND,7    =X'7FF0'
         CI,7     X'0410'           IS IT CAL1,1
         BNE      ABORT140          NO
         LCI      0                 RESTORE USER REGS
         LM,0     SAVREGS
         ANLZ,1   *OLDPSD           A(FPT)
         LW,1     *1                WORD 0 OF FPT
         BGZ      ABCONT            NOT INDIRECT IN FPT
         AND,1    M17
         CI,1     16                INDIRECT THROUGH A REGISTER
         BGE      %+2               NO
         AI,1     SAVREGS           POINT TO REGISTERS
         LW,1     *1                A(DCB)
ABCONT   EQU      %
         LI,6     0
         LI,7     X'1FFFF'
         LS,6     2,1               BUFFER
         LW,5     13,1              RWS
         AI,5     3                 ROUND UP A WORD
         SLS,5    -2                BUFFER LENGTH IN WORDS
         AW,5     6                 BUFFER END WORD ADDRESS
         STW,5    DBEFADRX          END ADR
         STW,6    DBEFADR           START ADR
         MTW,1    DBANLZFG          TURN ANLZ FLAG OFF
         LW,7     PAGE%MASK         MASK TO CHECK IF PAGE HAS A BREAK
         BAL,4    DBRK%CHK          CHECK FOR BREAK
         B        ABORT120          NO BREAK
         B        ABORT130          YES
ABORT120 EQU      %
         LW,6     DBEFADRX          CHECK BUFFER END
         BAL,4    DBRK%CHK          CHECK BUFFER END
         B        ABORT150          CHECK INTERMEDIATE PAGES
ABORT130 EQU      %
         STW,1    ABORTDCB          YES, SAVE DCB ADR
         LI,1     -1                TURN ABORT FLAG
         STW,1    ABORTFLG            NO
         B        WORD3
*
ABORT140 EQU      %
         SLS,7    -8                OP CODE ONLY
         CI,7     X'04'             IS IT A CAL,N
         BNE      *ABORTSV          NO
         LI,4     0                 RE-EXECUTE CAL1,N BUT
         STW,4    DBRK%YES          IGNORE DATA BREAKS
         MTW,1    DBANLZFG          TURN ANLZ FLAG OFF
         B        ABORT130
*
ABORT150 EQU      %                 TAKE ENDING ADDRESS
         AI,6     -512              DECREMENT TO PREVIOUS PAGE
         CS,6     DBEFADR           COMPARE WITH START LOCATION
         BLE      *ABORTSV          FINISHED
         B        ABORT120+1        ELSE CONTINUE D-BRK CHECK
ABORT160 EQU      %
         LW,2     J:JIT+ERO         GET ABORT SUBCODE
         AND,2    =X'7F'
         CI,2     1
         BNE      ABORT110-1
         MTW,1    TRTNFLG           HAVE WE ALREADY TRIED THIS?
         BNE      *11               YES, ABORT
         LW,1     *J:TCB            GET IA FROM PSD IN TCB STACK
         AI,1     -18
         LW,2     0,1
         STW,2    TRTNSV            AND SAVE IT FOR A WHILE
         LD,2     TRTNTRP           GET TRAP LOC FOR TRTN
         STS,2    0,1               AND MAKE IT IA TO TRTN TO
         B        USERGO
         PAGE
************************************************************************
*                                                                      *
*                                                                      *
*                 UTILITY ROUTINES                                     *
*                                                                      *
*                                                                      *
************************************************************************
*
*        THIS ROUTINE CHECKS TO SEE IF THE CURRENT USER HAS IN HIS
*        MAP THE PAGE CONTAINING THE ADDRESS IN R10. IF NOT
*        EXIT WITH CC = 2
*
ADRCHK   EQU      %
         LW,1     10                ADDRESS TO BE CHECKED
         AND,1    M17
         SLS,1    -9                PAGE NUMBER
         CW,1     J:EUP             IS PAGE IN USER LIMITS
         BG       ADRERR            NO
         LOAD,1   JX:CMAP,1         GET PHYSICAL PAGE #
*
         CI,1     FPMC              IS IT THE UNASSIGNED PAGE CODE
         BNE      ADR10             BRANCH IF NO
*
ADRERR   EQU      %
         LI,11    DELTA%DATA        IS ADDRESS IN DELTA DATA PAGE
         SLS,11   -9
         CW,1     11
         BE       ADR10             YES, IT'S OK
         LCI      2                 UNASSIGNED CODE
         B        *0
*
ADR10    EQU      %
         LCI      0                 ASSIGNED CODE
         B        *0
         PAGE
************************************************************************
*                                                                      *
*        IF A DUMP OF THE I BREAK TABLES WAS REQUESTED, THE GENERALIZED*
*        DUMP ROUTINE WILL COME HERE FOR EACH ACTIVE ENTRY FOR         *
*        SPECIAL PROCESSING APPROPRIATE TO THIS TYPE OF BREAK          *
*                                                                      *
************************************************************************
BDMP     EQU      %
         LI,0     #2SPACE           SPACE OVER
         BAL,1    DRPRTSML
         LB,3     IBRKOVL,5         GET OVERLAY NUMBER
         BEZ      %+2               NONE IGNORE
         BAL,4    DRPRTINT          PRINT THE OVERLAY
         LW,3     IBRKDPLY,5        DISPLAY REQUESTED FOR THIS ENTRY
         BLZ      TESTBD
         LI,0     18                SPACE OUT TO COLUMN 18
         BAL,4    SPACER
         LW,2     DRADRMOD          GET CURRENT ADDRESS MODE
         BAL,4    DRPRTADR          PRINT DISPLAY ADDRESS
         LW,5     DRTEMPS1          RESTORE BRK#
         LI,7     100               SET IRBK FLAG
         LB,3     IBRKCOND,5        IS THIS A TEST BRAREAK
         BNEZ     FNDCOND
         B        TESTBD
************************************************************************
*                                                                      *
*        THIS ROUTINE BLANKS THE OUTPUT BUFFER.
*                                                                      *
************************************************************************
BLANKTYP EQU      %
BLANKBUF EQU      %
         LI,1     OUTBUF%SIZE
         LW,2     BLANKS
         STW,2    OUTBUF-1,1
         BDR,1    %-1
         B        *4
         PAGE
************************************************************************
*                                                                      *
*        THIS ROUTINE CHECKS THE INSTRUCTION IN THE LOCATION
*        POINTED TO BY THE CONTENTS OF BADR. IF THE INSTRUCTION
*        IS A BRANCH, THE EFFECTIVE ADR IS RETURNED IN R10 AND CC = 8
*        IF IT IS NOT A BRANCH, BADR IS INCREMENTED AND CC = 4
*                                                                      *
************************************************************************
BRANCHK  EQU      %
         LW,10    BADR
         STW,10   EFADR
         STW,7    EXCTRAC
*
B10      EQU      %
         BAL,0    ADRCHK
         BCS,2    *EXCTRAC
         LI,11    0                 GET OP CODE AND REGISTER FIELDS
         LW,10    *10               IN R10 & R11 RESPECTIVELY
         SLS,10   -20
         SLD,10   -4
         AND,10   M7
*
         CLM,10   OPLMTS            COULD IT BE A BRANCH
         BOL      B50               BRANCH IF NO
*
         CB,10    AWM               IS IT AN AWM
         BE       B50               BRANCH IF YES
*
         CI,10    EXU               IS IT AN EXU
         BNE      B30               MUST BE BRANCH SO BRANCH
*
         LCI      0                 FOLLOW EXU AND SET UP TO
         STM,0    DELTREGS          SAVE DELTA REGS
         LM,0     SAVREGS           ANALYZE OBJECT INSTRUCTION
         ANLZ,10  *EFADR
         LCI      8                 RESTORE DELTA REGS
         LM,0     DELTREGS
         BAL,0    ADRCHK            VERIFY ADDRESS- DON'T FOLLOW
         BCS,2    B50               IF DELTA CAN'T ACCESS EFADR
         STW,10   EFADR
         B        B10
*                                   BRANCH INSTRUCTION FOUND
B30      EQU      %
         STW,10   TYPE              SAVE OP CODE
         SCS,11   4                 SAVE R-FIELD
         STW,11   BALREG
         LCI      0
         STM,0    DELTREGS          SAVE DELTA REGS
         LM,0     SAVREGS           GET EFFECTIVE ADR TO BE BRANCHED
         ANLZ,10  *EFADR            TO
         LCI      8
         LM,0     DELTREGS          RESTORE DELTA REGS
         BAL,0    ADRCHK            VERIFY ADDRESS- DON'T FOLLOW
         BCS,2    B70               IF DELTA CAN'T ACCESS EFADR
*
         LCI      8                 BRANCH FOUND EXIT
         B        *EXCTRAC
*
B50      EQU      %
         MTW,1    BADR              INCREMENT CURRENT INSTRUCTION LOC
*
B60      EQU      %
         LCI      4
         B        *EXCTRAC
*
B70      MTW,1    BADR              INCREMENT INSTRUCTION LOC
         LCI      1                 SET SPECIAL BRANCH
         B        *EXCTRAC          AND EXIT
         PAGE
************************************************************************
*                                                                      *
*        ROUTINE TO OUTPUT I & D BREAKPOINT MESSAGES                   *
*                                                                      *
************************************************************************
BREAK%MESSAGES    ;
         EQU      %
DBRKMSG  LW,13    DBPT              DATA BREAK ENTRY
         LW,3     DR#SEMII
         AI,3     -1                POINT TO TRAPPING INSTR
         B        %+3
IBRKMSG  LW,13    IBPT              I BREAK ENTRY
         LW,3     IBRKLOC,5
BKMS10   EQU      %
         AND,3    DRADMSKM
         STW,7    BRKMSGXT          SAVE RETURN LINK
         LI,0     #CRETRN
         BAL,4    TYPOUT
         LW,0     5                 GET BREAK NUMBER
         AI,0     1
         OR,0     XF0
         BAL,4    TYPOUT
         LW,0     13                GET BEAK MESSAGE
         BAL,1    DRPRTSML
*
         LW,2     DRADRMOD          PRINT INSTRUCTION ADDRESS WHERE
         BAL,4    DRPRTADR          REFERENCE OCCURS
         LI,0     #2SPACE
         BAL,1    DRPRTSML
         B        *BRKMSGXT
*
         PAGE
************************************************************************
*                                                                      *
*        THIS ROUTINE SEARCHES THE I OR D BREAK TABLES FOR ACTIVE      *
*        ENTRIES, SETS UP THE FIRST HALF OR THE OUTPUT LINE, AND DUMPS *
*        THE COMPLETED LINE.                                           *
*        R0,R2,R3 TEMPORARY                                            *
*        R4       LINK TO DRPRTINT, DRPRTADR                           *
*        R5       BREAKPOINT INDEX #                                   *
*        R7       LINK TO DUMPBUF                                      *
*        R10      TEMPORARY                                            *
*        R11      D OR I TRACE TABLE                                   *
*        R14      LINK TO SPECIAL PROCESSING FOR D OR I OPTIONAL SPECS *
*                                                                      *
************************************************************************
BRKDUMP  LW,3     *BRKNENT          CHECK NENT OF BREAK TABLE
         BNEZ     GOGETEM           RETURN IF NONE
         LW,0     NOMESS            PUT OUT NONE MESSAGE
         LI,1     BCHK20            #CRLF AND CONTINUE AFTER
         B        DRPRTSML          PRINTING MESSAFE
GOGETEM  EQU      %
         LI,5     0                 INDEX FOR SEARCH
         STW,5    DRTEMPS1
GETBKLOC LW,10    *BRKLOC,5         CHECK AN ENTRY
         BEZ      BDMP50          NULL ENTRY, BRANCH TO TEST
         LI,0     #CRETRN           SEND OUT A CARRIAGE RETURN
         BAL,4    TYPOUT
         LW,3     5                 ENTRY # TO R3 FOR PRINTING
         AI,3     1                  CONVERT ENTRY TO BREAK #
         BAL,4    DRPRTINT          PRINT BREAK NUMBER
         LW,11    DRBIT0,5
         LS,11    *TRCTBL
         BEZ      %+3               NOT A TRACE BREAK
         LW,0     TRACOUT           GET TRACE  MESSAGE
         B        %+2               GO TO GO TO PRINT ROUTINE
         LW,0     #3SPACE           PUT OUT 3 SPACES
         BAL,1    DRPRTSML
         LW,2     DRADRMOD          GET CURRENT ADDRESS MODE
         LW,3     10                LOCATION TO R3 FOR PRINTING
         BAL,4    DRPRTADR          PRINT LOCATION AS A SYMBOL
        LW,5     DRTEMPS1          GET BRK #
        B        *CURNOPR          DO SPECIAL PROCESSING
*
*       RETURN HERE AFTER I- OR D- BREAK SPECIAL PROCESSING
*
TESTBD   EQU      %
         LI,0     0                 SET FLAG TO  ALLOW OUTPUT TO
         STW,0    PRINT%OK          THE PRINTER IF REQUESTED
         LI,0     #BLANK            PUT OUT A SPACE
         BAL,1    DRPRTSML          TO END THE LINE
         BAL,7    DUMPBUF           DUMP THIS LINE
BDMP50   EQU      %
         MTW,1    DRTEMPS1          BUMP INDEX
         LW,5     DRTEMPS1          INDEX TO R5
         CI,5     7               DONE YET
         BLE      GETBKLOC          NO
         B        MESSAGE            YES
         PAGE
************************************************************************
*                                                                      *
*        THIS ROUTINE INTERPRETS AND SETS UP IN THE EXECUTE AREA       *
*        THE MOST RECENT INSTRUCTION BREAK.  IF THE INSTRUCTION IS     *
*        A 'BAL', IT IS CONVERTED TO A BRANCH TO THE EFFECTIVE         *
*        ADDRESS AND 'BREAK LOCATION + 1' IS STORED IN THE BAL-REGISTER*
*        IN THE USERS REGISTER TEMP STACK                              *
*                                                                      *
************************************************************************
BRKINTPT EQU      %
         PSW,4    DELSTK            SAVE REGS
         PSW,11   DELSTK
         LCI      0                 GET AND SAVE
         LM,0     SAVREGS            EFFECTIVE ADDRESS
         ANLZ,0   *ACTBKLOC          IN CASE INSTRUCTION
         STW,0    EFADR              IS A 'BAL'
         LW,0     *ACTBKLOC         GET BRK INSTR
         LW,3     OLDPSD            LOCATION OF BREAK
         AND,3    M17
         LI,1     0                 CLEAR R1 TO RECEICVE R-FIELD
         SLS,0    -20               SHIFT R-FIELD TO R1 AND RIGHT
         SLD,0    -4                JUSTIFY OPCODE IN R0
         CI,0     X'6A'             IS IT A BAL
         BNE      BKINT20           NO
         SCS,1    4                 YES, POSITION R-FIELD IN R1
         STW,3    SAVREGS,1         STORE BRK LOC+1 INTO BAL-REG
         MTW,1    SAVREGS,1         IN TEMP STACK
         LW,15    BALBRNCH          EXECUTE 'B *EFADR'
         B        %+2
BKINT20  EQU      %
         LW,15    *ACTBKLOC         GET BRK INTSTRUCTION
         STW,15   IBRKEXEC          SET UP TO EXECUTE BREAK INST
         LW,4     IBRKJUMP          AND CONTINUE
         AW,4     3                 EXECUTION.
         STW,4    IBRKEXEC+1
         STW,3    ACTBKLOC          NOW CURRENT ADR (FOR EXU)
         PLW,11   DELSTK            RESTORE REGS
         PLW,4    DELSTK
         B        *11               RETURN
         PAGE
*
*        THIS ROUTINE OUTPUTS THE I-BRK MESSAGES.
*
BRKOUTPT EQU      %
         PSW,11   DELSTK
         LI,0     BKOUT20           TRACE, SET EXIT FROM SLASH
         STW,0    SLSHEXIT          TO RETURN TO THIS ROUTINE
         LW,5     IBRKNUM            GET BRK #
         LW,1     DRBIT0,5          CHECK AND SAVE
         LS,1     ITRCTBL              TRACE BIT
         STW,1    TMP6
         BEZ      BKOUT10            BRANCH IF NOT TRACE
         LI,0     0                  SET FLAG TO ALLOW OUTPUT TO
         STW,0    PRINT%OK          PRINTER IF REQUESTED
BKOUT10  EQU      %
         BAL,7    IBRKMSG           OUTPUT 1ST PART OF MESSAGE
         LW,5     IBRKNUM           GET BRK #
         LW,3     IBRKDPLY,5        CHECK FOR DISPLAY REQUEST
         BLZ      BKOUT20            NO, EXIT
BKOUT15  RES                       ENTRY FOR DATABREAKS
         STW,3    DROPENER          SET SLASH MODE
         LW,0     DRSLDFLT          SET SLASH DEFAULT MODE
         STW,0    DRSLSHMD
         B        DRLFUPX           OUTPUT DISPLAY. IF NOT A TRACE,
*                                   SLASH ROUTINE EXITS TO MESSAGE
BKOUT20  EQU      %
         LI,0     MESSAGE           RESET SLASH EXIT
         STW,0    SLSHEXIT
         PLW,11   DELSTK
         MTW,0    TMP6               IS THIS A TRACE BRK
         BEZ      MESSAGE           BRANCH IF NOT
         BAL,7    DUMPBUF           DUMP TRACE OUTPUT
         B        *11
         PAGE
************************************************************************
*                                                                      *
*        THIS ROUTINE SETS UP THE I-BRK AND D-BRK TABLES
*        AND VERIFIES THE ADDRESS SPECIFIED FOR THE BREAKPOINT.
*                                                                      *
************************************************************************
BRKSET   EQU      %
         STW,14   CURNOPR           SAVE RETURN ADR IN SPARE CELL
         LI,2     ADRSNENT          # OF ADDRESSES
         STW,1    BASEADRS-1,2      MOVE POINTERS TO TABLE
         AH,1     BASEDISP,2        CALCULATE NEXT POINTER
         BDR,2    %-2
         LW,6     5                 WAS MORE THAN ONE FIELD INPUT
         BGZ      CHKNUMB           YES
         LW,15    DREXPRS           NO, CHECK THE INPUT VALUE
         CI,15    8                 WAS IT A BREAK NUMBER
         BLE      RELEASE           YES, GO RELEASE IT
         CI,15    15                DONT ALLOW BREAKS IN REGISTERS
         BLE      DRERR
         B        GETIT             NO, ADR INPUT,GO GET BRK NUMBER
CHKNUMB  LW,6     DREXPRS+1         CHECK INPUT BRK NUMB
         BLZ      DRERR             ERROR
         BEZ      GETIT             0 MEANS GET NEXT AVAILABLE NUMB
         CI,6     8                 CHECK FOR MAX VALUE
         BG       DRERR             BAD
         AI,6     -1                DECREMENT TO FORM ENTRY NUMB
         LW,2     *BRKLOC,6         IS THIS ENTRY ACTIVE
         BGZ      RESET             YESDONT BUMP NENT
         B        BKST41            COUNT ENTRIES
GETIT    LW,2     *BRKLOC,6         GET NEXT AVAIL ENTRY
         BLEZ     BKST41           GOT ONE
         CW,2     DREXPRS           IS IT REPLACEMENT BRAK
         BNE      BKST40            NO
         CI,7     1                 MUST BE SAME OVERLAY
         BE       BKST41            OK IF DATA BREAK
         LB,0     IBRKOVL,6
         BAL,4    OVLYCHK
         CB,0     IBRKOVL,6         IS IT THE SAME
         STB,0    IBRKOVL,6
         BE       BKST41            YES, THATS NICE
BKST40   AI,6     1                 NO GOOD, TRY THE NEXT ONE
         CI,6     8
         BL       GETIT
         B        BRKDUMP+2         PUTOUT NONE
BKST41   EQU      %
         MTW,1    *BRKNENT          BUMP NENT
RESET    LW,2     DREXPRS           GET BRK LOCATION
         AND,2    DRADMSKM
         LW,3     2                 TEST FOR VALID BRK LOC
         LW,0     0,3               LOAD AND STORE TO TEST ACCESS
TESTBRK  STW,0    0,3               OK-RESTORE THE INSTRUCTION
         STW,2    *BRKLOC,6         SAVE IN THIS ENTRY
INTLZ    LI,0     -1                INITIALIZE REMAINDER OF BRK TABLE
         STW,0    *WORD1,6
         LI,4     BKST42            SET RETURN FROM CHKOVLY
         CI,7     1                 IF INSTR BRK
         BE       %+3
         STW,0    IBRKPRCD,6        CLEAR PROCEED COUNT
         B        OVLYCHK           AND SET OVERLAY#
         LW,1     *BRKLOC,6
         BAL,11   PAGECHK           IF DATA BRK MUST BE DATA PAGE
         BCS,3    DRERR
BKST42   RES
         CI,5     2                 WAS THE 3RD FIELD INPUT
         BL       TRACER            NO, CHECK FOR TRACE
         LW,0     DREXPRS+2         YES, GET IT
         STW,0    *WORD1,6          SAVE IT
TRACER   LW,15    DRBIT0,6          GET THE BIT FOR THIS ENTRY
         BAL,4    INPTCHAR          GET NEXT COMMAND CHARACTER
         CI,0     'T'               WAS IT TRACE CODE
         BE       TRC               YES
         MTW,-1   CHARINDX          BACK UP INPUT POINTER
         LI,14    0                 NO, SET TRACE BIT TO FALSE
         STS,14   *TRCTBL
         B        %+2
TRC      STS,15   *TRCTBL           SET TRACE BIT TO TRUE
         STB,15   *BRKCOND,6        INITIALIZE CONDITION
         LI,1     -1
         CI,5     3                 IS THERE MASK/VALUE IN COMMAND
         BL       %+2               NO
         LW,1     DREXPRS+3         YES, USE IT
         STW,1    *WORD1A,6         AND MASK/VALUE
         BAL,4    INPTCHAR          CHECK NEXT CHAR
         CI,0     #SPACE
         BLE      MESSAGE           NONE, ALL DONE
         STH,0    2                 SAVE IT
         BAL,4    INPTCHAR
         CI,0     #CRETRN           ONE CHAR NUMMERS NEEDD BLANK
         BNE      %+2
         LI,0     #SPACE
         STB,0    2
         SAS,2    -16               MAKE BACKWARD PAIR
         LI,4     12
         CH,2     CONDTION,4        FIND THE CONDITION
         BE       %+3
         BDR,4    %-2
         B        DRERR             EHWHAT
         STB,4    *BRKCOND,6
         AI,4     -6
         BGZ      %-2               USE RIGHT SET
         B        MESSAGE
         PAGE
OVLYCHK  EQU      %                 CHECK FOR IN-CORE OVERLAYS
         LW,1     J:TREE            TREE ADDRESS
         BEZ      0,4               NONE, EXIT
         LW,2     0,1               TREE SIZE
         CI,2     12                TEST FRO ROOT ONLY
         BE       0,4               YES, EXIT
         AW,2     1                 END OF TREE TABLE
         AI,2     -1
         LW,3     DREXPRS           BRK LOCATION
         AND,3    DRADMSKM
         B        OVLYSIZE          ROOT IS ALWAYS IN CORE
OVLYNXT  EQU      %
         MTW,0    4,1               TEST IN-CORE FLAG
         BGE      NXTOVLY           NOT IN-CORE, CONTINUE
OVLYSIZE LW,14    8,1               GET SIZE/LOC OF PROCEDURE
         LI,7     CHKSEG00          SET RETURN FOR SIZE/LOC OF DATA
OVLYCONT EQU      %
         LH,15    14                SIZE TO 15
         AND,14   M16
         AW,15    14
         SLD,14   1                 BEGIN/END WORD ADDRESSES
         CLM,3    14                IN THIS SEGMENT
         BCR,12   *7                NO, CONTINUE
         BOL      *7
*
*        FOUND THE OVERLAY CONTAINING THIS I-BRK
*
         SW,1     J:TREE            BACK TO OFFSET
         AI,1     1                 ADJUST
         DW,1     =11               COMPUTE OVERLAY NUMBER
         STB,1    IBRKOVL,6         AND STORE
         B        0,4               EXIT
*
NXTOVLY  AI,1     11                STEP TO NEXT OVERLAY
         CW,1     2                 ARE WE AT THE END
         BGE      DRERR             BAD I-BRK BEING SET
         B        OVLYNXT           CHECK THE NEXT IN-CORE OVERLAY
*
CHKSEG00 LI,7     NXTOVLY           SET RETURN FOR NEXT OVERLAY
         LW,14    6,1               GET SIZE/LOC OF DATA
         B        OVLYCONT          CONTINUE
*
         PAGE
************************************************************************
*                                                                      *
*        THIS ROUTINE CONTROLS THE SAT (SPECIAL ACTION TABLE)
*                                                                      *
************************************************************************
CHKTABL  EQU      %                 CHECK FOR OCCURRENCE IN TABLE OF VAL
         LI,7     0                 INDEX
SYSR10   CW,10    TRACSPEC,7        IS CONTENTS OF R10 IN THIS ENTRY
         BE       0,4               YES, RETURN
         AI,7     1                 NO, BUMP INDEX
         CI,7     8                 DONE,
         BL       SYSR10            NO, CHECK NEXT
         B        1,4               YES, NOT FOUND EXIT
         PAGE
*
*        THIS ROUTINE CLOSES DCB M:XX, RESETS THE DCB STATUS
*
CLOSEXX  EQU      %
         LI,1     0                 RESET DCB STATUS FLAG TO
         STW,1    DCB%STAT          CLOSED
*
         LI,1     X'20'             CLOSE ONLY IF OPEN
         CH,1     M:XX
         BAZ      *0
         CLOSE%XX
         B        *0
         PAGE
*
*        THIS ROUTINE CONVERTS A HEXADECIMAL ADDRESS TO EBCDIC.
*
*        R7       CONTAINS WORD TO BE CONVERTED & STORED               *
*        R5 & 6   TEMPS                                                *
*        R11      LINK                                                 *
CONV     EQU      %
         LI,5     8                 MAX DIGITS
CONV10   EQU      %
         LI,6     0                 CLEAR R6 TO RECEIVE DIGITS
         SLD,6    4                 SHIFT HIGH ORDER DIGIT
         LB,0     DRDIGITS,6        GET EBCDIC VALUE
         CB,0     OUTBUF,1           IS THIS CHAR = TO SAME CHAR IN THE
         BE       %+2                PREVIOUS LINE. BRANCH IF YES
         MTW,1    SUM               NO, FLAG LINE AS NOT DUPLICATE
         STB,0    OUTBUF,1          STORE IN OUTPUT BUFFER
         AI,1     1                 BUMP OUTPUT INDEX
         BDR,5    CONV10            LOOP
         AI,1     2                 SKIP 2
         B        *11
         PAGE
*
*        THIS ROUTINE SETS OR RESETS DATA BREAKPOINTS.
*        INVOKED BY RESTORE (RESET) AND ;G (SET)
*
DBRKRESET EQU     %
         LI,10    0                 PROTECTION TYPE 00 - DATA
         B        DBK100
DBRKSET  EQU      %
         LI,10    1                 PROTECTION TYPE 01 - READ & EXECUTE
DBK100   EQU      %
         LI,2     8
DBK150   EQU      %
         LW,12    DBRKLOC-1,2       ACTIVE ENTRY
         BEZ      DBK200            BRANCH IF NO
*
         BAL,15   SET%PRTCT         SET ACCESS
DBK200   EQU      %
         BDR,2    DBK150            LOOP
*
         B        *11
         PAGE
*
*        THIS ROUTINE SAVES THE CURRENT BIN AND DRC FLAGS
*        IN M:UC AND MAKES SURE THEY ARE BOTH RESET.
*
TMODECHK EQU      %
         MTW,0    TMODESV           MAKE SURE THE WORD IS CLEAR
         BNE      *11               RETURN, THE CHECK HAS BEEN MADE
         LW,1     M:UC
         SLS,1    14                MOVE FLAGS TO COND. CODE
         STW,1    TMODESV
         LC       TMODESV
         BCR,8    %+2               B/ BIN NOT SET
         M:DEVICE M:UC,BCD
         BCR,2    %+2               B/ DRC NOT SET
         M:DEVICE M:UC,NODRC
         B        *11
*
*        THIS ROUTINE RESTORES BIN AND DRC FLAGS IN M:UC FROM
*        TMODESV.
*
TMODERES EQU      %
         MTW,0    TMODESV           CHECK FOR SOMETHING THERE
         BE       *11               NOTHING TO RESTORE
         LC       TMODESV
         BCR,8    %+2               DON'T SET BIN
         M:DEVICE M:UC,BIN
         BCR,2    %+2               DON'T SET DRC
         M:DEVICE M:UC,DRC
         LI,1     0
         STW,1    TMODESV
         B        *11
         PAGE
************************************************************************
*                                                                      *
* ROUTINE TO CLOSE AN OPEN REGISTER                                     02638030
*                                                                       02638040
DRCLOSE  LI,0     -1                TURN OFF OUTPUT-MODE-SPECIFIED
         STW,0    MODINPUT          FLAG.
         STW,0    SYM%TYPE          TURN OFF SYMBOL TABLE CONTROL MODE
         LW,0     STEPMODE
         BEZ      DRCL1             NOT IN STEP MODE
         LW,0     IA
         STW,0    DR#SEMII          SET CORRECT INSTRUCTION ADDRESS
         LI,0     0                 TURN OFF GET-A-PAGE MODE.
         STW,0    STEPMODE          TURN OFF STEP MODE
DRCL1    EQU      %
         XW,0     STRNGBUF          CLEAR STRING
         CI,8     DRUDEFBT          CHECK FOR UNDEFINED INPUT
         BANZ     DRERR             YES, ERROR
         AI,10    0                 ANY INPUT
         BEZ      0,4               IS ONE OPEN?                        02638060
         MTW,0    DROPENSW
         BEZ      DRERR             NONE OPEN
         STW,0    STRNGBUF          YES, RESTORE STRING
         STW,4    DRCLSRTN          YES - SAVE RETURN LINK              02638070
         BAL,4    DREVALIT          PERFORM FINAL EVALUATION            02638080
         STW,3    DR#SEMIQ          SAVE INPUT VALUE IN ;Q
         LW,0     DR#SEMIQ          GET VALUE TO STORE
         LW,3     DR#DSIGN          GET STORE ADDRESS
         BAL,11   STORWORD          STORE IN USER REG OR MEMORY
         B        *DRCLSRTN         RETURN                              02638230
************************************************************************
*                                                                      *
* ROUTINE TO HANDLE AN INPUT ERROR                                      01930000
*                                                                       01931000
DRERR    LD,0     STKINIT           INITIALIZE DELTA STACK
         STD,0    DELSTK
         LW,0     QUES              QUESTION MARK
         BAL,1    DRPRTSML          PRINT MESSAGE FOR THE USER          01933000
         LW,3     CHARINDX          OUTPUT CHARACTER NUMBER WHEN
         BAL,4    DRPRTINT          ERROR OCCURRED
         LI,0     DRINITA           SET FULL INITIALIZATION
         STW,0    MESSEXIT          ENTRY POINT
         LI,0     -1                TURN OFF OUTPUT-MODE-SPECIFIED
         STW,0    MODINPUT          FLAG
         STW,0    SYM%TYPE          CLEAR SYMBOL TABLE DEFINED MODE
         B        DRINIT
************************************************************************
*                                                                      *
*        THIS ROUTINE ADDS AN ENTRY TO THE TOP OF THE GLOBAL SYMBOL    *
*        TABLE.  IN USER DELTA THE STRUCTURE OF THE SYMBOL TABLES IS   *
*                 DEFINED   SYMBOLS                                    *
*                 GLOBAL    SYMBOLS                                    *
*                 INTERNAL  SYMBOLS                                    *
*        INPUT :  R13-R15  ENTRY TO BE PUT IN TABLE                    *
*        LINK  :  R4                                                   *
*        REG%STERS =                                                   *
*          SET :  R6,R7,R11                                            *
*          USED : R13-R15                                              *
*        IF THE ENTRY BEING ADDED EXTENDS INTO A NEW PAGE, THE PAGE    *
*        IS OBTAINED VIA MONITOR CAL  T:GVP                            *
*                                                                      *
************************************************************************
DRSYMAPD EQU      %
         LW,6     SYMBEGIN
         AI,6     -3
         MTW,0    NENTSYM           ARE WE STARTED
         BEZ      %+4               NO
         LI,7     X'1FF'
         CS,6     PAGE%BOUND
         BL       SYMAD20
         LW,7     6
         BAL,11   GET%PAGES
         BCS,8    SINT101           CANT GET EM
SYMAD20  EQU      %
         MTW,3    NENTSYM           CUOUNT UP
         MTW,-3   SYMBEGIN          AND DOWN
         LCI      3
         STM,12   *SYMBEGIN
         B        *4                RETURN
        PAGE
***********************************************************************
*       THIS ROUTINE MOVES THE USERS ENVIRONMENT FROM DELTAS          *
*        STACK TO THE USERS TCB.  IF THERE IS NO ROOM IN HIS STACK     *
*       OR THE USER DOES NOT HAVE THE PAGES CONTAINING THE STACK      *
*       OR ITS POINTER, TRAP CONTROL WILL REMAIN IN DELTA.            *
***********************************************************************
DTS#USER EQU     %
        LW,2     J:TCB             GET USERS TCB ADR
        BEZ      *CURNOPR          NONE, STAY IN DELTA
        AND,2    M17
       LW,1     2                 CHECK THE PAGE CONTAINING
       BAL,11   PAGECHK           THE STACK POINTER
         BCS,3    *CURNOPR          NOT A USER DATA PAGE, STAY IN DELTA
*
       LW,1     *2                GET LAST ADR IN STACK
        BAL,11   PAGECHK           CHECK IT
         BCS,3    *CURNOPR          NOT USER DATA PAGE
       AI,1     21                COMPUTE NEW LAST ADR
       BAL,11   PAGECHK           CHECK IT
         BCS,3    *CURNOPR          NOT USER DATA PAGE
        LW,0     1,2               GET COUNT OF REMAINING
       LH,0     0                   WORDS IN THE STACK
         AND,0    M15               MASK OFF CONTROL BIT
        CI,0     21                ROOM LEFT
       BL       *CURNOPR          NO, STAY IN DELTA
*
       AI,1     -20               NEXT AVAILABLE ADR IN STACK
       LI,0     0                 DUMMY VALUE FOR 1ST WORD
       LI,13    1                 COUNT OF # WORDS PUSHED
       STW,0    0,1               STORE DUMMY
        CI,1     1                 CHECK FOR EVEN/ODD 1ST ADR
         BCS,4    MOVESTAK          ODD, GO MOVE STACK
         AI,1     1                 BUMP POINTER
        AI,0     -1                EVEN, 2ND DUMMY VALUE
         STW,0    0,1               MAKE 21 WORD ENVIRONMENT
       AI,13    1                 BUMP COUNT
*
MOVESTAK EQU      %
         AI,1     1                 BUMP POINTER
         LCI      10                MOVE PSD & 1ST 8 REGS
        LM,3     OLDPSD
        STM,3    0,1
       LCI      9                 MOVE 2ND 8 REGS & TRAP LOCATION
        LM,3     OLDPSD+10
       STM,3    10,1
         STW,2    SAVREGS           PUT TCB ADDRESS IN R0
         STW,1    SAVREGS+1         POINTER TO PSD GOES IN USER R1
*
        AI,13    19                BUMP USERS STACK BY 20 OR 21
        MSP,13   *2
         LW,2     DR#SEMII          GET REAL USER ADDRESS
         LW,3     M17               (IN CASE OF STEPMODE, ETC)
         STS,2    0,1               TO STORE IN PSD LOCATION
*                                 DELTAS STACK WILL BE DECREMENTED
*                                 BY THE TRAP RETURN CAL
        B        *15               RETURN
         PAGE
*
*        THIS ROUTINE GETS THE CHARACTERS SPECIFIED AS THE HEADER
*        FOR A ;O (DUMP) COMMAND.  IF THE HEADER CONTAINS AN
*        ACTIVATION CHARACTER (E.G. / OR =), ANOTHER READ IS
*        PERFORMED SO THAT THE HEADER MAY CONTAIN ANY CHARACTER.
*
GET%HEADER        ;
         EQU      %
         BAL,4    BLANKBUF          BLANK PRINT BUFFER
         LI,0     '1'               PAGE EJECT FORMAT CHAR
         STW,0    VFCHAR
         LW,2     NUMBCHAR          COMPUTE # OF REMAINING CHARS
         SW,2     CHARINDX          IN INPUT BUFFER
         LI,6     1                 INDEX INTO PRINT BUFFER
GH10     EQU      %
         BAL,4    INPTCHAR          GET NEXT CHAR
         CI,0     X'0D'             TEST FOR CR
         BNE      %+3               NO
         MTW,-1   CHARINDX          DONT INCLUDE CR IN HEADER
         B        *11
         STB,0    OUTBUF+10,6       STORE IN MIDDLE OF PRINT BUFFER
         AI,6     1                 BUMP INDEX
         BDR,2    GH10              LOOP
         LI,2     0                 CR NOT ON INPUT
         STW,2    CHARINDX          INIT TO READ MORE INPUT
*THIS READ PERFORMED WHEN PREVIOUS INPUT WAS TERMINATED BY AN
*ACTIVATION CHAR (E.G. '/') INSTEAD OF A CR.
         M:READ   M:UC,;
                  (BUF,INBUF),;
                  (BTD,0),;
                  (WAIT),;
                  (COC,(OACS,3)),;  OVER-RIDING ACTIVATION CHAR SET 0; NORMAL
                  (SIZE,80)
         LH,2     M:UC+4
         SLS,2    -1                GET NUM OF CHARS READ
         STW,2    NUMBCHAR
         B        GH10              GO ADD TO PRINT BUFFER
************************************************************************
*                                                                      *
*        THIS ROUTINE GETS OR RELEASES (DEPENDING ON ENTRANCE USED)    *
*        ALL PAGES FROM WORD ADDRESS IN R6 TO THE ADDRESS IN R7        *
*        INCLUSIVE.                                                    *
*        INPUT    R6     ADDRESS IN 1ST PAGE REQUIRED                  *
*                 R7     ADDRESS IN LAST PAGE REQUIRED                 *
*        LINK     R11                                                  *
*                                                                      *
************************************************************************
FREE%PAGES        ;
         EQU      %
         LI,0     X'85'             RELEASE CODE & INDIRECT BIT
         B        GFVP10
GET%PAGES         ;
         EQU      %
         LI,0     X'84'             GET PAGE CODE & INDIRECT BIT
GFVP10   EQU      %
         AND,6    =X'1FE00'
         AND,7    =X'1FE00'
GFVP15   EQU      %
         CW,6     7                 CHECK FOR DONE
         BG       GVP30             YES
         STW,6    GTRLPAGE          * CAL3 DOESNT HANDLE *R6
         STB,0    PAGE%FPT
         CAL1,8   PAGE%FPT          GET OR RELEASE PAGE
        BCS,8    NOPAGE            CANT GET OR DONT HAVE PAGE
GVP20    EQU      %
         AI,6     512
         B        GFVP15            CHECK FOR DONE
NOPAGE   EQU      %
         MTB,-1   0                 SET FLAG
         BC       %+2               FIRST TIME IN
         OR,0     6                 SAVE PAGE ADDR
         B        GVP20             CONTINUE SETTING PAGE
*
GVP30    EQU      %
         LC       0                 IS ERROR FLAG SET
         BCR,8    *11               NO
         LI,6     X'1FE00'          YES, PUT FIRST BAD PAGE IN 6
         AND,6    0
         B        *11
        PAGE
*
*        THIS ROUTINE CHECKS FOR A DATA BREAK IN THE GIVEN PAGE.
*
DBRK%CHK EQU      %
         LI,5     7                 LARGEST ENTRY #
         CS,6     DBRKLOC,5         CHECK AGAINST ADR THRU MASK IN R7
         BE       1,4               FOUND EXIT
         AI,5     -1                BUMP INDEX
         BGEZ     %-3               LOOP
         B        0,4               NOT FOUND EXIT
         PAGE
************************************************************************
*                                                                      *
*        IF A DUMP OF THE BREAK TABLE WAS REQUESTED, THE GENERAL       *
*        DUMP ROUTINE WILL RETURN HERE FOR EACH ACTINE ENTRY FOR       *
*        SPECIAL PROCESSING APPROPRIATE TO THIS TYPE OF BREAK          *
*                                                                      *
************************************************************************
DUMPER   LB,3     DBRKCOND,5        IS THIS A CONDITIONAL BREAK
         BLZ      TESTBD            NO. RETURN TO BRKDUMP
         LI,0     18                SPACE TO COLUMN 18
         BAL,4    SPACER
         LI,7     -100              SET DATABRK FLAG
FNDCOND  LH,0     CONDTION,3        GET CONDITION MNEMONIC
         AND,0    BLNKUPER          SET UPPER HALF WORD TO BLANKS
         SCS,0    8                 POSITION MNEMONIC BETWEEN BLANKS
         BAL,1    DRPRTSML          STORE IN OUTBUF
         BDR,7    %+3               VALUE ALREADY OUT FOR IBRK
         LW,3     DBRKVAL,5         GET SPECIFIED VALUE
         BAL,4    DRPRTHXA          PUT IT OUT
         LW,3     *WORD1A,5         GET MASK VALUE
         BDR,7    %+5               ALWAYS PUT IT OUT IF IBRK
         CI,3     -1
         BE       TESTBD            DONT OUTPUT IF NOMINAL VALUE
         LI,0     31                SPACE TO COLUMN 31
         BAL,4    SPACER
         LI,4     TESTBD            RETURN FROM HEX PRINT
         B        DRPRTHXA          PUT OUT THE NASK
         PAGE
************************************************************************
*                                                                      *
*        ROUTINE TO SET AND RESTORE INSTRUCTION BREAKPOINTS            *
*                                                                      *
************************************************************************
IBRKSET  LI,13    -1                INITIALIZE TO SET BREAKS
         LI,1     7
         B        BKST5
IBRKRSTR LI,13    1                 SET UP TO RESTORE BREAK INSTR
         LI,1     0                 TABLE INDEX
BKST5    EQU      %
         LW,6     IBRKNENT          *
         BLEZ     0,4               RETURN IF NO I BREAKS
LOOPSTRT LW,3     IBRKLOC,1         *
         BEZ      BKST20            TEST FOR END
         LB,5     IBRKOVL,1         GET THE OVERLAY NO.
         BEZ      %+5               NONE, CONTINUE
         MI,5     11                OFFSET INTO TREE TABLE
         AW,5     J:TREE
         MTW,0    4,5               IN-CORE FLAG
         BGEZ     BKST20            NOT IN-CORE, IGNORE THIS TIME
         AI,13    0                 SET OR UNSET
         BLZ      %+3               SET
         LW,15    IBRKINST,1        RESTORE BROKEN INSTRUCTION
         B        BKST15            STORE IT
         MTW,0    INTPMODE          IN TRANSFER BREAK MODE
         BEZ      BKST12            NO, DONT CHECK FOR T BRK
         CW,3     BADR              CHECK FOR
         BNE      BKST12            TRANSFER BRK LOCATION
         LW,15    FORKINST          IF SO, FORKINST IS THE
         B        BKST12+1          INSTRUCTION TO SAVE AWAY
BKST12   EQU      %
         LW,15    0,3               GET INSTR
         STW,15   IBRKINST,1        SAVE IT
         LW,15    IBRKXPSD          SET I BREAK
         AW,15    1                 FLAG ADR FIELD WITH BREAK #
BKST15   EQU      %
         STW,15   0,3               *
BKST20   EQU      %
         AW,1     13                BUMP INDEX
         BLZ      0,4
         CI,1     8                 DONE
         BL       LOOPSTRT          NO
         B        0,4               RETURN
*
*******************************************************************
*        THIS ROUTINE SETS UP A PRINT LINE FOR THE ;O (DUMP)
*        COMMAND.  IF ANLZ/MONFIX IS ASSOCIATED, THE EBCDIC
*        REPRESENTATION OF THE LINE IS OMITTED.
*
*        R3       CONTAINS START LOC                                   *
*        R10      CONTAINS END LOC                                     *
*        R4       LINK                                                 *
*        R2       BYTE COUNT FOR LAST LINE TO DUMP
*
LINESET  EQU      %
         PSW,4    DELSTK
         LI,1     0                 INDEX INTO BUFFER
         STW,14   SUM               ZERO LINE SUM WORD
         LW,7     3                 OUTPUT START LOC FOR THIS LINE
         BAL,11   CONV
         STW,14   SUM               SET DUP LINE INDICATOR
         LW,4     DELENT            ANLZ/MONFIX INTERFACE
         BGZ      LINE10            YES, CANT PRINT EBCDIC
         LW,4     3
         SLS,4    2
         LW,5     MOVTRANS
         LW,11    ENDOFDMP          LAST LINE TO DUMP
         BEZ      %+2               NO
         STB,2    5                 ELSE USE # BYTES SUPPLIED
MBSTST   MBS,4    0
         LI,4     BA(OTT)
         LW,5     MOVTRANS
         TBS,4    0
LINE10   EQU      %
         LW,4     DELENT            ARE WE INTERFACING WITH MONFIX
         BLEZ     LINE11            NO
         LW,11    3                 SAVE LOCATION
         LW,4     0,4               LOCATION OF GET SUBR
         BAL,4    0,4               GET NEXT WORD - RETURNED IN R3
         BCS,8    DRERR
         LW,7     3
         LW,3     11                RESTORE LOCATION
         B        %+2
LINE11   EQU      %
         LW,7     0,3               GET NEXT WORD
         BAL,11   CONV              CONVERT & STORE IN OUTPUT BUFFER
         CI,1     50
         BNE      %+2
         AI,1     1
         AI,3     1                 BUMP LOC
         CW,3     10                CHECK FOR DONE ON LINE
         BLE      LINE10            NO
         PLW,4    DELSTK
         B        0,4               YES
************************************************************************
*                                                                      *
*        THIS ROUTINE OPENS M:XX TO THE PRINTER.
*                                                                      *
************************************************************************
OPEN%PRNT         ;
         EQU      %
         LW,1     M:XX
         CW,1     =X'00200000'      TEST IF OPEN
         BAZ      OPEN%PR           BRANCH IF NOT
         LI,1     X'600'            TEST IF OPEN TO PRINTER
         CS,1     M:XX+1
         BE       OPEN%PRT          YES
         BAL,0    CLOSEXX
OPEN%PR  EQU      %
         CAL1,1   LO%FPT
OPEN%PRT EQU      %
         M:DEVICE M:XX,(VFC)        SET VERTICAL FORMAT CONTROL - PRINTE
         LI,0     PRNT%TYPE
OPEN%OUT EQU      %
         STW,0    DCB%STAT
         CAL1,1   SET%XX            DRERR FOR ERR/ABN NOW
         CAL1,1   SET%XX1           SET NOFBCD
OPEN%ABN RES
         B        *11               RETURN
SET%XX   GEN,8,24 6,M:XX
         DATA     X'C0000000',DRERR,DRERR
SET%XX1  GEN,8,24  X'22',M:XX
         DATA     0
*
********************************************************************
*
*        THIS ROUTINE OPENS M:XX TO THE SPECIFIED LMN FILE.
*
********************************************************************
OPEN%FILE         ;
         EQU      %
         LW,0     DCB%STAT
         CI,0     FILE%TYPE         XX OPEN TO FILE
         BE       *11               BRANCH IF YES
*
         BL       %+2               BRANCH IF CLOSED
         BAL,0    CLOSEXX
*
         LW,2     DELENT            ARE WE INTERFACING WITH ANLZ
         BLEZ     OPEN60            NO, USER LMN
         LW,1     =X'02010202'      INITIALIZE ACCT OPT CONTROL WORD
         LW,7     3,2               YES-GET ADR OF ACCT, PASS, NAME
         LCI      7
         LM,2     0,7               FETCH ACCT TO REGS 2,3
*                                         PASSWORD TO REGS 4,5
*                                         NAME TO REGS 6,7,8
         LW,0     6
         BEZ      OPEN%OUT          NAME NOT PRESENT
         AI,4     0                 IS THERE A PASSWORD ?
         BEZ      OPEN70            NO
         STD,4    PASSWORD            PUT IT IN FPT,
         AI,1     -X'00010000'        AND SET UP TO USE IT.
OPEN70   LCI      3
         STM,1    FILE%ACCT         PUT ACCT OPT WORD, ACCT NAME,
         STM,6    FILE%NAME           AND FILE NAME INTO FPT
         B        OPEN75            OPEN THE DCB TO THIS LMN
*
OPEN60   MTW,0    FIRSTIME          DO WE HAVE LMN NAME, ACCT, PASS
         BGZ      OPEN75            YES, OPEN THE DCB
         MTW,1    FIRSTIME          DON'T STOP HERE AGAIN
         LCI      10                NO, GET THEM FROM M:XX DCB
         LM,0     MXFPL
         CW,1     DRBIT2            ARE THEY STILL GOOD (FROM RUNNER)
         DO1      TEST=0
         BAZ      *11               NO, CAN'T OPEN TO LMN
         AND,1    SYM%MASK          TURN OFF RUNNER FLAG
         LCI      10                AND STORE NAME, ACCT, PASS
         STM,0    FILE%OPT          IN THE OPEN FPT
*
OPEN75   OPEN%CAL                   OPEN THE DCB
*
         LI,0     FILE%TYPE         SET FLAG TO INDICATE FILE DCB M:XX
         B        OPEN%OUT
         PAGE
*        THIS ROUTINE EXAMINES THE USERS ACCESS IMAGE FOR THE PAGE
*        CONTAINING THE ADDRESS IN R1. IT RETURNS WITH TATT ACCESS
*        IN CC3 AND CC4.
PAGECHK  EQU      %
         LCI      3
         PSM,2    DELSTK
*
         LW,3     1                 FORM PAGE # OF
         SLS,3    -9                SPECIFIED ADDRESS
         LI,2     0
         DW,2     DRBIT27
         LW,4     J:JAC,3           GET WORD CONTAINING ACCESS FOR THE
*                                   PAGE SPECIFIED BY USER
         AW,2     2                 *
         AI,2     -26               * ISOLATE ACCESS CODE INTO POSITION
         SLS,4    0,2               *
         AND,4    =X'30'            CLEAR OTHER BITS
         STB,4    11                SAVE FOR LOADING CONDITIONS
*
         LCI      3
         PLM,2    DELSTK
*
         LC       11                LOAD ACCESS IN CC3-4
         B        *11               RETURN
         PAGE
************************************************************************
*                                                                      *
*        THIS ROUTINE RELEASES THE SPECIFIED BREAKPOINT.
*                                                                      *
************************************************************************
RELEASE  AI,10    0                 WAS ANYTHING INPUT
         BEZ      BRKDUMP           NO, DUMP THE BREAK TABLE
         LI,10    0                 ACCESS CODE 0 = DATA
         LW,3     DREXPRS           YES,WAS IT A BREAK NUMB
         BGZ      SPECRELS          YES, GO RELEASE THAT BREAK
         LI,4     -8
ALLOFF   RES
         CI,7     1                 R7 = 1-DBRK, 2-IBRK
         BNE      RLS10             DONT CHANGE ACCESS ON IBRK
         LW,12    *BRKLOC-1,4       GET BRK LOC
         BEZ      RLS20             NOT SET, SKIP
         BAL,15   SET%PRTCT         RESERT ACCESS TO 0
RLS10    EQU      %
         STW,3    *BRKLOC-1,4       ZERO OUT BREAK LOCATIONS
         CI,7     1                 DBRK RESET
         BE       %+2               YES, CONTINUE
         STB,3    IBRKOVL,4         ZERO OVERLAY NUMBER
RLS20    EQU      %
         BIR,4    ALLOFF
         STW,3    *BRKNENT          ETC.
         STW,3    *TRCTBL
         B        MESSAGE           RETURN
*
SPECRELS CI,3     8                 WAS IT A LEGAL BREAK NUMB
         BG       DRERR             NO
         AI,3     -1                FORM ENTRY NUMB
         LW,12    *BRKLOC,3       GET BRK LOC
         BEZ      DRERR           BRK NOT SET
         CI,7     1                 DBRK RELEASE
         BNE      RLS40             DONT CHANGE ACCESS ON IBRK
         BAL,15   SET%PRTCT         RESET ACCESS TO 0
RLS40    EQU      %
         LI,0     0
         STW,0    *BRKLOC,3         ZERO BREAK LOCATION
         CI,7     1                 DBRK RELEASE
         BE       %+2               YES, CONTINUE
         STB,0    IBRKOVL,3         ZERO OVERLAY NUMBER
         MTW,-1   *BRKNENT          DECREMENT NENT
         LW,1     DRBIT0,3          CLEAR TRACE BIT
         STS,0    *TRCTBL
         B        MESSAGE           RETURN
************************************************************************
*                                                                      *
*        THIS ROUTINE RELEASES GLOBAL SYMBOL TABLE PAGES AND RE-INITIAL*
*        -IZES THE GLOBAL SYMBOL TABLE                                 *
*                                                                      *
************************************************************************
RELEASE%GLOBAL    ;
         EQU      %
         MTW,0    GLBLFLAG          ALREADY RELEASED
         BEZ      *15               YES, EXIT
         LW,6     SYMBEGIN          GET START ADDRESS OF GLOBAL SYMBOLS
*                                                                      *
         LI,14    0
         STW,14   GLBLFLAG          SET PRESENCE FLAG TO FALSE FOR GLBL
         STW,14   NENTSYM           SET # WORDS FOR GLOBAL TO ZERO
         LW,8     GST               SYTART ADR GLOBAL SYM TAB
         LW,9     M17               GET ADR MASK
         STS,8    SYMBEGIN          RE-INITIALIZE START ADR GLOBAL SYMB
*                                                                      *
         LW,7     IST
         CW,14    INTLFLAG          CHECK IF INTERNAL STILL ACTIVE
         BE       %+2
         AI,7     -511              DON'T RELEASE PAGE WITH INT SYMBOLS
GLBL10   EQU      %
         AI,7     -1                COMPUTE CORRECT LAST ADR IN SYM TAB
         BAL,11   FREE%PAGES
         B        *15
        B        *15               IGNORE AN ERROR RETURN
************************************************************************
*                                                                      *
*        THIS ROUTINE RELEASES THE INTERNAL SYMBOL TABLE PAGES         *
*                                                                      *
************************************************************************
RELEASE%INTERNAL  ;
         EQU      %
         MTW,0    INTLFLAG          ALREADY RELEASED
         BEZ      *15               YES, EXIT
         LI,14    0
         STW,14   INTLFLAG          SET INT SYMB FLAG TO 'RELEASED'
         STW,14   NENTINTL          SET # WORDS INT SYMB TO ZERO
         LW,6     IST               COUNT & START ADR INTERNAL SYMB TAB
         LH,7     6                 COUNT TO R7
         SLS,7    -1                POSITION CORRECTLY
         AND,6    M17               CLEAR UPPER 15 BITS
         AW,7     6                 LAST SYM TAB ADR + 1
         CW,14    GLBLFLAG          CHECK IF GLOBAL STILL ACTIVE
         BE       %+2
         AI,6     511               DON'T RELEASE PAGE WITH GLBL SYMBOLS
*
         B        GLBL10
         PAGE                                                           03278000
*************************************************************
*
*        THIS ROUTINE RESTORES THE USERS BREAKS
*        AND SETS UP FOR PROCESSING IN DELTA.
*
*************************************************************
RESTORE  EQU      %
         LC       TCOND             GET TRAP STATUS
         BCS,7    RSTORD            NOT I BREAK, CONTINUE
         LW,0     *DTSTACK          GET TRAP TYPE
         CI,0     X'40'             IF NOT TRAP 40
         BNE      RSTORD            CONTINUE
         LW,0     *OLDPSD           SAVE TRAPPING INSTR FOR
         STW,0    TRAPINST          I BRK ANALYSIS
         LW,0     OLDPSD            ADDRESS OF TRAPPED INST
         AND,0    M17
         STW,0    TRAPTEMP          SAVE IT
         LB,0     TRAPINST          WHAT CAUSED TRAP
         AND,0    M7
         CI,0     X'67'             WAS IT AN EXECUTE INST
         BNE      RSTORD            NO
         LCI      0
         STM,0    DELTREGS          SAVE DELTAS REGS
         LM,0     SAVREGS           AND RESTORE USER REGS
         ANLZ,6   TRAPINST          GET THE ADDRESS
         LW,0     0,6               OF THE POSSIBLE BREAK
         STW,0    TRAPINST          TRAPPING INST
         STW,6    TRAPTEMP          TRAPPING ADDR
         LCI      0
         LM,0     DELTREGS          GET BACK DELTAS REGS
RSTORD   STW,11   RSTRTRN           SAVE RETURN ADDRESS
         BAL,11   DBRKRESET         RESET DATA BRKS FIRST
         LW,0     STEPMODE
         BNEZ     RSTOR1            BRANCH IF IN STEPMODE
*
         LW,0     INTPMODE          ARE WE IN INTERPRETIVE MODE
         BEZ      RSTOR1            NO
         LW,0     FORKINST          RESTORE TRANSFER BREAK INSTR
         BEZ      RSTOR1            NO BRANCH ON THIS INST
*                                   * COULD BE DATA BRK, ETC *
         LW,1     BADR              * THIS CODE SHOULD BE MADE         *
         STW,0    0,1               * CONSISTENT WITH T BREAK LOGIC    *
RSTOR1   EQU      %
         LW,11    RSTRTRN           GET RETURN LINK
         BAL,4    IBRKRSTR          RESTORE INSTRUCTION BREAKPOINTS
         LD,0     OLDPSD
RSTOR20  EQU      %
         LB,2     0
         SLD,2    -4                RIGHT JUSTIFY CC IN R2              03288000
         STW,2    DR#SEMIC          PUT VALUE OF CC IN PROPER PLACE     03289000
         LI,2     0                 CLEAR AGAIN                         03290000
         SLD,2    4                 MOVE FC INTO R2                     03291000
         STW,2    DR#SEMIF          PUT VALUE OF FC IN PROPER PLACE     03292000
         LI,2     KADMSKM           GET 17 BIT MASK                     03293000
         AND,2    0                 EXTRACT INSTRUCTION ADDRESS         03294000
         CI,2     IBRKEXEC          CHECK IF IBRK EXECUTION TRAPPED
         BNE      RST40             BRANCH IF NO
*
         LW,2     ACTBKLOC          USE IBRK LOC
         B        RST50
*
RST40    EQU      %
         CI,2     EXCTRAC           CHECK IF STEPMODE COUSED TRAP
         BNE      RST50             BRANCH IF NO
*
         LW,2     IA                USE STEPMODE LOCATION
*
RST50    EQU      %
         CLM,2    EXCDRTN           IS IT SPECIAL AREA
         BCR,3    RST51
         BOL      %+3               NO
         MTW,1    DR#SEMII          INCREMENT ;I IF YES
         B        RST51             AND DON'T RE-STORE IT
         STW,2    DR#SEMII          SAVE VALUE OF IA IN PROPER PLACE    03295000
RST51    EQU      %
         LB,2     1                 GET WRITE KEY BYTE
         STW,2    DR#SEMI4          SAVE IT
         LI,2     1                 BYTE OFFSET
         LB,2     0,2               GET MAP/MASTER BYTE
         SLS,2    -4                SHIFT OFF GARBAGE
         STW,2    DR#SEMI3          SAVE GOODIES
         B        *11               RETURN
*
*
SET%PRTCT         ;
         EQU      %
         LW,13    M17               ADR MASK
         STS,12   SET%PRTCT%ADR     STORE LOC IN FPT
         STB,10   SET%PRTCT%TYPE    STORE ACCESS TYPE IN FPT
         SET%ACCESS                 SET IT
         B        *15               RETURN
************************************************************************
*                                                                      *
*        THIS ROUTINE SPACES OUT TO THE COLUMN SPECIFIED IN R0         *
*                                                                      *
************************************************************************
SPACER   LI,2      #SPACE
         LW,1     OUTCHAR           GET CURRENT CHARACTER INDEX
         B        TESTSPC           TEST IT
INSERT   STB,2    OUTBUF,1          STORE A SPACE
         AI,1     1                 BUMP INDEX
TESTSPC  CW,1     0                 IS IT EQUAL TO SPECIFIED COLUMN
         BL       INSERT            NO
         STW,1    OUTCHAR           SAVE NEW CHARACTER INDEX
         B        0,4               RETURN
*                                                                       02638020
         PAGE
************************************************************************
*                                                                      *
*        THIS ROUTINE STORES INPUT VALUE INTO USERS REGISTER STACK     *
*        OR INTO SPECIFIED MEMORY LOCATION
*
*        R0   CONTAINS VALUE TO BE STORED
*        R1   CONTAINS STORE-MASK (ONLY USED WITH 'STSWORD' ENTRY)
*        R3   CONTAINS THE ADDRESS TO STORE INTO
*                                                                      *
************************************************************************
STORWORD EQU      %
         LI,1     -1                SET MASK = ALL 1'S
         LI,4     COPYINP           INPUT STRING ROUTINE
STSWORD  EQU      %                 STORE-SELECTIVE ENTRY (SEE ;W)
         LW,2     DELENT            ARE WE TO STORE VIA ANALZ/MONFIX ?
         BLEZ     DOSTSWRD          NO, STORE NORMALLY
         STD,0    STWSAVE           YES, SAVE VALUE AND MASK
         BAL,4    0,4               COPYINP/COPYOUTP ROUTINE
         MTB,0    STRNGBUF          ANYTHING FOR GENMD/ANLZ
         BEZ      %+2               NO, CONTINUE
         MTB,-1   STRNGBUF          KNOCK OFF TERMINATION CHARACTER
         LD,0     STWSAVE           R0=VALUE, R1=MASK
         LI,2     STRNGBUF          R2=STRING LOC, R3=ADDRESS
         LW,4     DELENT
         LW,4     1,4
         BAL,4    0,4               CALL 'PUT' SUBROUTINE
         BCS,8    DRERR
         LI,0     0                 WIPE OUT STRING
         STB,0    STRNGBUF
         B       *11                RETURN
DOSTSWRD EQU      %                 DO NORMAL STORE
         CI,3     15
         BG       %+3               IS IT A REGISTER ADR ?
         STS,0    SAVREGS,3         YES, STORE IN USER'S REG STACK
         B        *11                 AND EXIT.
         DO       TEST=0
         CI,3     DELTA%DATA        NO, IS IT IN DELTA'S AREA
         BGE      ILEGSTOR          IF SO, ILLEGAL
         FIN
STOREXX  STS,0    0,3               NO, STORE IN MEMORY
         B        *11                 AND EXIT
ILEGSTOR LI,1     BA(ILSTRMSG)      YES, PRINT ERROR MESSAGE
         BAL,4    DRPRTMSG
         BAL,4    DRPRTHXA
         B        DRINIT            GET NEXT INPUT
         PAGE
*        THIS ROUTINE SETS ACCESS OF 01 ON PAGES FROM ADR IN R6        *
*        TO THE ADDRESS IN R7                                          *
SYMPRTCT EQU      %
         LW,12    6                 START ADR TO R12
         LI,10    1                 ACCESS CODE 01
SYMP10   EQU      %
         CW,12    7                 CHECK FOR DONE
         BG       *11               YES
         BAL,15   SET%PRTCT         NO, SET IT
         BCS,12   *11               ERROR    ****
         AI,12    512               COMPUTE ADR FOR NEXT PAGE
         B        SYMP10            GO CHECK FOR DONE
         PAGE
************************************************************************
*                                                                      *
*                                                                      *
*                 I/O ROUTINES :                                       *
*                            INTERNAL - CHARACTER TO/FROM BUFFERS      *
*                            EXTERNAL - BUFFERS TO/FROM DEVICES        *
*                                                                      *
*                                                                      *
************************************************************************
         PAGE                                                           03306000
************************************************************************
*        THE FOLLOWING IS THE CODE FOR MESSAGE ORIENTED OUTPUT         *
*                                                                      *
************************************************************************
PMESS    EQU      %
         LI,1     PROMPT            BUFFER ADDRESS
         LI,2     1                 BYTE COUNT
         LI,3     0                 BYTE DISPLACEMENT
         WRITE%UC                   ISSUE PROMPT
*
         LI,6     0
         STW,6    CHARINDX          INITIALIZE SCAN POINTER
         M:READ   M:UC,;
                  (BUF,INBUF),;
                  (BTD,*6),;
                  (WAIT),;
                  (COC,(OACS,3)),;  OVER-RIDING ACTIVATION CHAR SET 3: DELTA
                  (SIZE,80)
         LH,4     M:UC+4            GET ARS
         SLS,4    -1
         AI,4     -1                PICK UP LAST CHARACTER IN BUFFER
         LB,0     INBUF,4
         CI,0     4                 WAS IN AN EOT?
         BE       %+2               B/ YES
         AI,4     1                 COUNT LAST CHARACTER
         STW,4    NUMBCHAR
MESSAGE  NOP      0                 SPACE FOR A BRANCH TO TIMER
         BAL,0    CLOSEXX           MAKE SURE XX IS CLOSED
         BAL,4    BREAKCHK          CHECK FOR A BREAK
CHKOUTPT LW,1     OUTCHAR           GET OUTPUT BUF INDEX
         BLEZ     %+2               NO
         BAL,7    DUMPBUF           YES. DUMP IT.
         LW,1     CHARINDX          ANY MORE COMMANDS IN THE
         CW,1     NUMBCHAR          CURRENT COMMAND LINE.
         BGE      PMESS             NO. GET NEXT LINE
         LI,4     -1
         STW,4    SYM%TYPE          TURN OFF SYMBOL TABLE CONTROL MODE
         BAL,4    INPTCHAR          YES. CHECK NEXT CHARACTER
         CI,0     #SPACE            IS IT A SPACE?
         BE       %-2               YES, KEEP CHECKING
         MTW,-1   CHARINDX          NO, BACK UP THE POINTER
         B        *MESSEXIT         EXIT FROM MESSAGE ROUTINE
************************************************************************
*                                                                      *
*        THIS CODE DUMPS THE OUTPUT BUFFER(IF THERE IS ANYTHING IN IT) *
*        ON THE SPECIFIED DEVICE                                       *
*                                                                      *
************************************************************************
DUMPBUF  EQU      %
         LCI      8                 SAVE REGS
         PSM,0    DELSTK
         PSW,11   DELSTK
         BAL,4    BREAKCHK          CHECK IF BREAK KEY HIT
         LI,0     1                 RESET NEXT OUTPUT TO TELETYPE.
         XW,0     PRINT%OK          TEST CURRENT OUTPUT SWITCHES.
         AW,0     SEMIJ
         BGEZ     DMP20             TELETYPE
         BAL,11   OPEN%PRNT         OPEN M:XX TO LO
         LI,0     X'C0'             FORMAT CHAR - SINGLE SPACE
         STW,0    VFCHAR
         PRINT                      DO IT
         B        DMP30
DMP20    EQU      %
         LI,1     OUTBUF            BUFFER
         LW,2     OUTCHAR           COUNT
         LI,3     0                 BYTE OFFSET
,UCWTFPT M:WRITE  M:UC,;
                  (BUF,*1),;
                  (SIZE,*2),;
                  (BTD,*3)
DMP30    EQU      %
         LI,0     0
         STW,0    OUTCHAR           RESET OUTPUT BUFFER POINTER
         BAL,4    BLANKBUF          BLANK OUTPUT BUFFER
         PLW,11   DELSTK            RESTORE REGS
         LCI      8
         PLM,0    DELSTK
         B        *7                RETURN
         PAGE
*
*        THIS ROUTINE CHECKS FOR AN OUTSTANDING BREAK, AND IF SO,
*        ERASES THE WAITING OUTPUT AND REINITIALIZES DELTA.
BREAKCHK EQU      %
         MTW,0    BREAKEY           TEST BREAK FLAG
         BEZ      *4                NO BREAK
BCHK10   EQU      %
         LI,0     0                 ERASE WAITING OUTPUT
         STW,0    OUTCHAR
         STW,0    BREAKEY           RESET BREAK FLAG
BCHK20  EQU      %
         LI,0     DRINITA           SET TO FULL INITIALIZE AFTER GETTING
         STW,0    MESSEXIT          NEXT COMMAND LINE
         B        DRINIT            SEND A CR AND GET NEXT COMMAND LINE
         PAGE
************************************************************************
*                                                                      *
*        THIS ROUTINE FORMATS THE OUTPUT LINE FOR EITHER THE
*        TELETYPE OR THE LINE PRINTER (BASED ON THE VALUE OF ;J).
*                                                                      *
************************************************************************
TYPOUT   EQU      %
         PSW,4    DELSTK            SAVE REGS
         PSW,7    DELSTK
         LW,4     SEMIJ             CHECK PRINTER/TELETYPE SWITCH
         AW,4     PRINT%OK
         BGEZ     TYP20             TELETYPE
         CI,0     #CRETRN           PRINTER, CHECK FOR  CR
         BNE      TYP20             NO, ADD TO BUFFER
         BAL,7    DUMPBUF           YES, DUMP THE LINE & IGNORE  CR
         LI,7     0                 RESET PRINTER SWITCH
         STW,7    PRINT%OK          AFTER THIS DUMPBUF CALL
         B        TYP40             EXIT
TYP20    EQU      %
         LW,4     OUTCHAR           GET POINTER
         STB,0    OUTBUF,4          ADD A CHARACTER TO OUTPUT BUFFER
         MTW,1    OUTCHAR           BUMP POINTER
TYPCHAR  CI,4     79                IS TYPEWRITER LINE FULL
         BL       TYP40
         BAL,7    DUMPBUF           YES. PUT OUT THE FULL LINE
TYP40    EQU      %
         PLW,7    DELSTK            RESTORE REGS
         PLW,4    DELSTK
         B        0,4
*        FETCH A CHARACTER FROM THE INPUT BUFFER
*
INPTCHAR LW,1     CHARINDX     INDEX INTO INBUF FOR NEXT CHARACTER
         LB,0     INBUF,1
         CW,1     NUMBCHAR     CHECK FOR LAST CHAR IN BUFFER
         BGE      DRERR      AT END OF MESSAGE
         MTW,1    CHARINDX   INCREMENT CHARACTER INDEX
         B        0,4          RETURN
*                                                                       01963000
         PAGE
*
*     STRING COLLECTION ROUTINES USED IN CONNECTION
*     WITH 'MONFIX' INTERFACE.
*
COPYINP  LI,1     0                 SOURCE INDEX
         LB,2     STRNGBUF          DEST INDEX
CPYINP10 CW,1     NUMBCHAR          ANY MORE CHARS ?
         BGE      CPYINP20          NO, STOP
         LB,0     INBUF,1           YES, GET NEXT CHAR
         AI,1     1                 BUMP SOURCE INDEX
         CI,2     79                IS THERE ROOM FOR IT IN STRING BUF?
         BGE      CPYINP20          NO, STOP
         AI,2     1                 YES, BUMP DEST INDEX,
         STB,0    STRNGBUF,2        PUT CHAR IN BUF
         B        CPYINP10          CONTINUE
CPYINP20 STB,2    STRNGBUF          DONE, SAVE NEW STRING LENGTH
         B        0,4               RETURN
*
*
COPYOUTP LW,1     OUTCHAR           LAST OUTPUT CHARACTER
         BEZ      CPYOUT10          NOTHING TO SEND
         AI,1     -2
         LB,0     OUTBUF,1          FIND START OF THIS TERM
         CI,0     X'0D'
         BE       CPYOUT10          CR IS TERMINATOR
         BDR,1    %-3
         B        %+2
*
*        AT THIS POINT R1 POINTS TO THE BEGINNING OF THE
*        MESSAGE FOR ANLZ/MONFIX/GENMD
*
CPYOUT10 AI,1     1                 SKIP CR
         LI,2     0                 INITIALIZE DESTINATION INDEX
CPYOUT20 CW,1     OUTCHAR           ANY MORE CHARACTERS
         BGE      CPYOUT30          NO, STOP
         LB,0     OUTBUF,1          GET THE CHARACTER
         AI,1     1                 BUMP INDEXES
         AI,2     1
         STB,0    STRNGBUF,2        COPY TO STRING BUFFER
         B        CPYOUT20          CONTINUE
CPYOUT30 STB,2    STRNGBUF          SAVE STRING LENGTH
         B        0,4               RETURN
         PAGE
************************************************************************
*                                                                      *
*                                                                      *
*                 CONSTANT DATA                                        *
*                                                                      *
*                                                                      *
************************************************************************
*                                                                       00065000
* COM DEFINITIONS USED IN GENERATING THE SYMBOL TABLE                   00066000
*                                                                       00067000
*                                                                       00071000
BIT1     COM,16,8,8  0,X'A4',0                                          00068000
OPCODE   COM,8,8,8,8 AF(1),AF(2),AF(3),AF(4)
COD      COM,4,4,4,4 AF(1),AF(2),AF(3),AF(4)
         BOUND    FW
************************************************************************
*        TABLE OF SPECIAL MNEMONICS                                    *
************************************************************************
SPECODES EQU      %
IMDOP    OPCODE   A,I
         OPCODE   C,I                                                   00225000
         OPCODE   L,I                                                   00228000
         OPCODE   M,I                                                   00231000
NOTAGFLD EQU      %-SPECODES
LCFIOP   EQU      %
         OPCODE   N,O,P
         OPCODE   L,F,I
         OPCODE   L,C,I
         OPCODE   L,C,F,I
LCFOP    EQU      %
         OPCODE   N,O,P
         OPCODE   L,F
         OPCODE   L,C
         OPCODE   L,C,F
BCROP    OPCODE   B,C,R
         OPCODE   B
         OPCODE   B,G,E                                                 00790000
         OPCODE   B,L,E                                                 00793000
         OPCODE   B,E                                                   00796000
         OPCODE   B,A,Z
BCSOP    OPCODE   B,C,S
         OPCODE   B,C,S
         OPCODE   B,L
         OPCODE   B,G                                                   00802000
         OPCODE   B,N,E                                                 00805000
         OPCODE   B,A,N,Z
         OPCODE   B,G,E,Z                                               00817000
         OPCODE   B,L,E,Z                                               00823000
         OPCODE   B,E,Z                                                 00808000
         OPCODE   B,L,Z                                                 00820000
         OPCODE   B,G,Z                                                 00814000
         OPCODE   B,N,E,Z                                               00811000
BYTINDX  EQU      %-SPECODES
TBSOP    OPCODE   T,T,B,S
         OPCODE   T,B,S
BYTOP    OPCODE   C,B,S
         OPCODE   M,B,S                                                 00441000
         OPCODE   E,B,S                                                 00447000
SHFTOP   OPCODE   S
SHFTINDX EQU      %-SPECODES
         OPCODE   S,L,S
         OPCODE   S,L,D                                                 00772000
         OPCODE   S,C,S                                                 00775000
         OPCODE   S,C,D                                                 00778000
         OPCODE   S,A,S                                                 00781000
         OPCODE   S,A,D                                                 00784000
MTINDX   EQU      %-SPECODES
MTWOP    OPCODE   M,T,W
         OPCODE   M,T,H
         OPCODE   M,T,B
SPECNENT EQU      %-SPECODES
*        THIS TABLE IS ONLY FOR GOING FROM SYMBOL TO VALUE AND
*        IS PARALLEL TO TABLE SPECODES
         BOUND    FW
CODEVAL  COD      2                  AI
         COD      2,1                CI
         COD      2,2                LI
         COD      2,3                MI
         COD      0,2               NOP
         COD      0,2,1             LFI
         COD      0,2,2             LCI
         COD      0,2,3             LCFI
         COD      7,0               NOP
         COD      7,0,1             LF
         COD      7,0,2             LC
         COD      7,0,3             LCF
         COD      6,8                BCR
         COD      6,8                B
         COD      6,8,1              BGE
         COD      6,8,2              BLE
         COD      6,8,3              BE
         COD      6,8,4             BAZ
         COD      6,9                BCS
         COD      6,9                BCS NOT USED
         COD      6,9,1              BL
         COD      6,9,2              BG
         COD      6,9,3              BNE
         COD      6,9,4             BANZ
         COD      6,8,1              BGEZ
         COD      6,8,2              BLEZ
         COD      6,8,3              BEZ
         COD      6,9,1              BLZ
         COD      6,9,2              BGZ
         COD      6,9,3              BNEZ
         COD      4                  TTBS
         COD      4,1                TBS
         COD      6                 CBS
         COD      6,1               MBS
         COD      6,3               EBS
         COD      2,5                S
         COD      2,5                SLS
         COD      2,5,0,1            SLD
         COD      2,5,0,2            SCS
         COD      2,5,0,3            SCD
         COD      2,5,0,4            SAS
         COD      2,5,0,5            SAD
         COD      3,3               MTW
         COD      5,3               MTH
         COD      7,3               MTB
*                                                                       00108000
* STANDARD OPERATION CODES                                              00109000
*                                                                       00110000
         BOUND    FW
OPCODES  EQU      %
         OPCODE   #@,#0,#0
         OPCODE   #@,#0,#1
         DATA     LCFIINST
         OPCODE   #@,#0,#3
         OPCODE   C,A,L,#1                                              00126000
         OPCODE   C,A,L,#2                                              00129000
         OPCODE   C,A,L,#3                                              00132000
         OPCODE   C,A,L,#4                                              00135000
         OPCODE   P,L,W
         OPCODE   P,S,W
         OPCODE   P,L,M                                                 00147000
         OPCODE   P,S,M                                                 00150000
         OPCODE   P,L,S
         OPCODE   P,S,S
         OPCODE   L,P,S,D                                               00550000
         OPCODE   X,P,S,D                                               00553000
         OPCODE   A,D                                                   00168000
         OPCODE   C,D                                                   00171000
         OPCODE   L,D                                                   00174000
         OPCODE   M,S,P                                                 00177000
         OPCODE   #@,#1,#4                                              00180000
         OPCODE   S,T,D                                                 00183000
         OPCODE   #@,#1,#6                                              00186000
         OPCODE   #@,#1,#7                                              00189000
         OPCODE   S,D                                                   00195000
         OPCODE   C,L,M                                                 00198000
         OPCODE   L,C,D                                                 00201000
         OPCODE   L,A,D                                                 00204000
         OPCODE   F,S,L                                                 00207000
         OPCODE   F,A,L                                                 00210000
         OPCODE   F,D,L                                                 00213000
         OPCODE   F,M,L                                                 00216000
         DATA,FW  ACLMIMED
         DATA,FW  ACLMIMED
         DATA,FW  ACLMIMED
         DATA,FW  ACLMIMED
         OPCODE   S,F                                                   00234000
         DATA,FW  SHFTINST
         OPCODE   L,A,S
         OPCODE   #@,#2,#7                                              00243000
         OPCODE   C,V,S                                                 00249000
         OPCODE   C,V,A                                                 00252000
         OPCODE   L,M                                                   00255000
         OPCODE   S,T,M                                                 00258000
         OPCODE   L,R,A
         OPCODE   L,M,S
         OPCODE   W,A,I,T                                               00556000
         OPCODE   L,R,P                                                 00559000
         OPCODE   A,W                                                   00276000
         OPCODE   C,W                                                   00279000
         OPCODE   L,W                                                   00282000
         DATA,FW  MTXINST
         OPCODE   L,V,A,W
         OPCODE   S,T,W                                                 00291000
         OPCODE   D,W                                                   00294000
         OPCODE   M,W                                                   00297000
         OPCODE   S,W                                                   00303000
         OPCODE   C,L,R                                                 00306000
         OPCODE   L,C,W                                                 00309000
         OPCODE   L,A,W                                                 00312000
         OPCODE   F,S,S                                                 00315000
         OPCODE   F,A,S                                                 00318000
         OPCODE   F,D,S                                                 00321000
         OPCODE   F,M,S                                                 00324000
         DATA,FW  TBSINST
         DATA,FW  TBSINST
         OPCODE   #@,#4,#2                                              00336000
         OPCODE   #@,#4,#3                                              00339000
         OPCODE   A,N,L,Z                                               00342000
         OPCODE   C,S                                                   00345000
         OPCODE   X,W                                                   00348000
         OPCODE   S,T,S                                                 00351000
         OPCODE   E,O,R                                                 00357000
         OPCODE   O,R                                                   00360000
         OPCODE   L,S                                                   00363000
         OPCODE   A,N,D                                                 00366000
         OPCODE   S,I,O                                                 00562000
         OPCODE   T,I,O                                                 00565000
         OPCODE   T,D,V                                                 00568000
         OPCODE   H,I,O                                                 00571000
         OPCODE   A,H                                                   00384000
         OPCODE   C,H                                                   00387000
         OPCODE   L,H                                                   00390000
         DATA,FW  MTXINST
         OPCODE   #@,#5,#4                                              00396000
         OPCODE   S,T,H                                                 00399000
         OPCODE   D,H                                                   00402000
         OPCODE   M,H                                                   00405000
         OPCODE   S,H                                                   00411000
         OPCODE   #@,#5,#9                                              00414000
         OPCODE   L,C,H                                                 00417000
         OPCODE   L,A,H                                                 00420000
         OPCODE   #@,#5,C                                               00423000
         OPCODE   #@,#5,D                                               00426000
         OPCODE   #@,#5,E                                               00429000
         OPCODE   #@,#5,F                                               00432000
         DATA,FW  CMEBS
         DATA,FW  CMEBS
         OPCODE   #@,#6,#2                                              00444000
         DATA,FW  CMEBS
         OPCODE   B,D,R                                                 00450000
         OPCODE   B,I,R                                                 00453000
         OPCODE   A,W,M                                                 00456000
         OPCODE   E,X,U                                                 00459000
         DATA,FW  BCRINST
         DATA,FW  BCSINST
         OPCODE   B,A,L                                                 00471000
         OPCODE   I,N,T                                                 00474000
         OPCODE   R,D                                                   00574000
         OPCODE   W,D                                                   00577000
         OPCODE   A,I,O                                                 00580000
         OPCODE   M,M,C                                                 00583000
         DATA     LCFINST
         OPCODE   C,B
         OPCODE   L,B
         DATA,FW  MTXINST
         OPCODE   S,T,C,F                                               00504000
         OPCODE   S,T,B                                                 00507000
         OPCODE   P,A,C,K                                               00510000
         OPCODE   U,N,P,K                                               00513000
         OPCODE   D,S                                                   00519000
         OPCODE   D,A                                                   00522000
         OPCODE   D,D                                                   00525000
         OPCODE   D,M                                                   00528000
         OPCODE   D,S,A                                                 00531000
         OPCODE   D,C                                                   00534000
         OPCODE   D,L                                                   00537000
         OPCODE   D,S,T                                                 00540000
CODENENT EQU      %-OPCODES
NOLCFI   OPCODE   #@,#0,#2
NOLCF    OPCODE   #@,#7,#0
         PAGE
*
*        THE FOLLOWING TABLE IS USED IN THE INTERPRETIVE EXECUTION
*        OF BRANCHING INSTRUCTIONS (SEE ROUTINE INTEX-TRACEXEC)
*
BACT     EQU      %
         B        BDRBNCH           BDR
         B        BIRBNCH           BIR
         B        DRERR             AWM
         B        DRERR             EXU
         B        BCRBNCH           BCR
         B        BCSBNCH           BCS
         STW,3    SAVREGS,2         BAL
*                                                                       00993000
*                                                                      *
TT       EQU      DELTA%BASE        BASE ADR OF DELTA FOR COMPUTING
*                                   RELATIVE ADDRESSES OF SEMI- AND PUNC
*                                   -TUATION ROUTINES
DRSPCSYM EQU      %                                                     01426000
         DATA,HW  DR#SEMIQ-TT       ;Q                                  01428000
         DATA,HW  DR#SEMII-TT       ;I                                  01429000
         DATA,HW  DR#SEMIC-TT       ;C                                  01430000
         DATA,HW  DR#SEMIF-TT       ;F                                  01431000
         DATA,HW  DR#SEMIM-TT       ;M                                  01432000
         DATA,HW  DR#SEMI1-TT       ;1                                  01433000
         DATA,HW  DR#SEMI2-TT       ;2                                  01434000
         DATA,HW  DR#SEMI3-TT       ;3
         DATA,HW  DR#SEMI4-TT       ;4
         PAGE                                                           01435000
*                                                                       01436000
* PUNCTUATION DISPATCH TABLE                                            01437000
* HALF WORD TABLE OF ADDRESS POINTERS                                   01438000
*                                                                       01439000
         BOUND    FW                                                    01440000
*                                                                       01441000
DRPOINT1 EQU      %                 BEGINNING OF TABLE                  01442000
DRPSPACE DATA,HW  DRSPACE-TT        SPACE                               01443000
DRPADDER DATA,HW  DRINITC-TT        PLUS                                01444000
DRPMINUS DATA,HW  DRINITC-TT        MINUS                               01445000
DRPCOMMA DATA,HW  DRCOMMA-TT        COMMA                               01445500
DRPASTIK DATA,HW  DRASTISK-TT       ASTERISK
DRPCRTRN DATA,HW  DRCRTRN-TT        CARRIAGE RETURN                     01446000
DRPLFEED DATA,HW  DRLFEED-TT        LINE FEED                           01447000
DRPUAROW DATA,HW  DRUPAROW-TT       UP ARROW                            01448000
DRPBSLSH DATA,HW  DRBSLASH-TT       BACKSLASH                           01449000
DRPSLASH DATA,HW  DRSLASH-TT        SLASH                               01450000
DRPEQUAL DATA,HW  DREQUAL-TT        EQUAL                               01453000
DRPLSTHN DATA,HW  DRLSTHAN-TT       LESS THAN                           01453250
DRPTAB   DATA,HW  DRTAB-TT          TAB
DRVAL1XX EQU      %                 END OF EVALUATING PUNCTUATION       01453500
DRPPEROD DATA,HW  DRPERIOD-TT       PERIOD                              01454000
DRPGRTHN DATA,HW  DRERR-TT          GREATER THAN - MUST BE AN ERROR     01455500
DRPLBRKT DATA,HW  DRLBRKET-TT       LEFT BRACKET                        01456000
DRPAMPER DATA,HW  DRAMPRSD-TT       AMPERSAND                           01457000
DRPEXCLM DATA,HW  DREXCLAM-TT       EXCLAMATION                         01458000
DRPLFPAR DATA,HW  CHNGMODE-TT
DRPRTPAR DATA,HW  DRRPAR-TT         RIGHT PARENTHESIS                   01459000
DRPSCOLN DATA,HW  DRSCOLON-TT       SEMICOLON                           01460000
DRPRBRKT DATA,HW  DRRBRKET-TT       RIGHT BRACKET                       01461000
DRPPERCT DATA,HW  DRPERCNT-TT       PERCENT SIGN                        01463000
DRPUSCRE DATA,HW  DRUNDSCR-TT       UNDERSCORE                          01464000
DRPSQUOT DATA,HW  DRSQUOTE-TT       SINGLE QUOTE                        01465000
DRPDQUOT DATA,HW  DRDQUOTE-TT       DOUBLE QUOTE                        01466000
DRXX     DATA,HW  DRERR-TT          ERROR EXIT                          01467000
DRPQUEST DATA,HW  DRERR-TT
         PAGE                                                           01471000
*                                                                       01472000
* SEMI-COLON COMMAND DISPATCH TABLE                                     01473000
* HALF WORD TABLE OF ADDRESS POINTERS                                   01474000
*                                                                       01475000
         BOUND    FW                                                    01476000
*                                                                       01477000
DRPOINT2 EQU      %                                                     01478000
DRPSEMIB DATA,HW  DRSEMIB-TT+K8000
DRPSEMID DATA,HW  DRSEMID-TT+K8000
DRPSEMIG DATA,HW  DRSEMIG-TT
DRPSEMIL DATA,HW  DRSEMIL-TT
DRPSEMIN DATA,HW  DRSEMIN-TT
DRPSEMIO DATA,HW  DRSEMIO-TT        ;O
DRPSEMIP DATA,HW  DRSEMIP-TT+K8000
DRPSEMIR DATA,HW  DRSEMIR-TT        ;R                                  01492000
DRPSEMIW DATA,HW  DRSEMIW-TT
DRPSEMIX DATA,HW  DRSEMIX-TT+K8000
DRPSEMIY DATA,HW  SEMIY-TT+K8000
DRPSEMIZ DATA,HW  DRSEMIZ-TT
DRPSEMIA DATA,HW  DRSEMIA-TT        ;A
DRPSEMIV DATA,HW  DRSEMIV-TT        ;V
DRSLIMIT EQU      HA(%)-HA(DRPOINT2)  EVALUATE FOR ABOVE ROUTINES
DRPSEMIQ DATA,HW  DRSPCHR-TT        ;Q                                  01478100
DRPSEMII DATA,HW  DRSPCHR-TT+K8000
DRPSEMIC DATA,HW  DRSPCHR-TT+K8000
DRPSEMIF DATA,HW  DRSPCHR-TT+K8000
DRPSEMIM DATA,HW  DRSPCHR-TT        ;M                                  01478500
DRPSEMI1 DATA,HW  DRSPCHR-TT        ;1                                  01478600
DRPSEMI2 DATA,HW  DRSPCHR-TT        ;2                                  01478700
DRPSEMI3 DATA,HW  DRSPCHR-TT+K8000
DRPSEMI4 DATA,HW  DRSPCHR-TT+K8000
DRPSEMIE DATA,HW  DREND-TT+K8000    ;E  DISASSOCIATE AND EXIT
DRPSEMIH DATA,HW  DRSEMIH-TT+K8000  ;H  HALT/ALLOW OVERLAY TRACE
DRPSEMIJ DATA,HW  DRSEMIJ-TT        ;J  CHANGE OUTPUT DEVICE
DRPSEMIK DATA,HW  DRSEMIK-TT        ;K                                  01486000
DRPSEMIS DATA,HW  DRSEMIS-TT        ;S
DRPSEMIT DATA,HW  DRSEMIT-TT+K8000
DRPSEMIU DATA,HW  DRSEMIU-TT        ;U                                  01494000
DRPSMISL DATA,HW  DRSEMISL-TT       ;/                                  01501000
DRPSMIEQ DATA,HW  DRSEMIEQ-TT       ;=                                  01502000
DRPSMISP DATA,HW  DRSEMISP-TT       ;SPACE                              01503000
DRPSMIER DATA,HW  DRERR-TT          ILLEGAL SEMI-COLON COMMAND          01504000
*                                                                       01505000
         PAGE                                                           01506000
*                                                                       01507000
* INDEXES TO THE PUNCTUATION DISPATCH TABLE                             01508000
* VALUE DETERMINES THE TYPE OF EVALUATION(IF ANY), WHICH IS REQUIRED    01509000
*                                                                       01510000
#T1      EQU      HA(DRPOINT1)      USED TO FORM DELIMITER INDEX        01511000
DRDELBAD EQU      HA(DRXX)-#T1      PUNCTUATION ERROR INDEX             01513000
*                                                                       01514000
         BOUND    FW                                                    01515000
DRKEY1   EQU      %                                                     01517000
         DATA,BT  HA(DRPSPACE)-#T1  BLANK                               01518000
         DATA,BT  DRDELBAD          --                                  01519000
         DATA,BT  DRDELBAD          --                                  01520000
         DATA,BT  DRDELBAD          --                                  01521000
         DATA,BT  DRDELBAD          --                                  01522000
         DATA,BT  HA(DRPTAB)-#T1    TAB
         DATA,BT  DRDELBAD          --                                  01524000
         DATA,BT  DRDELBAD          --                                  01525000
         DATA,BT  DRDELBAD
         DATA,BT  DRDELBAD          --                                  01527000
         DATA,BT  HA(DRPBSLSH)-#T1  BACKSLASH                           01528000
         DATA,BT  HA(DRPPEROD)-#T1  PERIOD                              01529000
         DATA,BT  HA(DRPLSTHN)-#T1  LESS THAN                           01530000
         DATA,BT  HA(DRPCRTRN)-#T1  CARRIAGE RETURN
         DATA,BT  HA(DRPADDER)-#T1  PLUS                                01532000
         DATA,BT  HA(DRPLBRKT)-#T1  LEFT BRACKET                        01533000
         DATA,BT  DRDELBAD
         DATA,BT  DRDELBAD          --                                  01535000
         DATA,BT  DRDELBAD          --                                  01536000
         DATA,BT  DRDELBAD          --                                  01537000
         DATA,BT  DRDELBAD          --                                  01538000
         DATA,BT  HA(DRPLFEED)-#T1  LIME FEED
         DATA,BT  DRDELBAD          --                                  01540000
         DATA,BT  DRDELBAD          --                                  01541000
         DATA,BT  DRDELBAD          --                                  01542000
         DATA,BT  DRDELBAD          --                                  01543000
         DATA,BT  HA(DRPEXCLM)-#T1  EXCLAMATION POINT                   01544000
         DATA,BT  DRDELBAD          --                                  01545000
         DATA,BT  HA(DRPASTIK)-#T1  ASTERISK                            01546000
         DATA,BT  HA(DRPRTPAR)-#T1  RIGHT PAREN                         01547000
         DATA,BT  HA(DRPSCOLN)-#T1  SEMICOLON                           01548000
         DATA,BT  HA(DRPRBRKT)-#T1  RIGHT BRACKET                       01549000
         DATA,BT  HA(DRPMINUS)-#T1  MINUS                               01550000
         DATA,BT  HA(DRPSLASH)-#T1  SLASH                               01551000
         DATA,BT  DRDELBAD          --                                  01552000
         DATA,BT  DRDELBAD          --                                  01553000
         DATA,BT  DRDELBAD          --                                  01554000
         DATA,BT  HA(DRPLFEED)-#T1  LINE FEED                           01555000
         DATA,BT  DRDELBAD          --                                  01556000
         DATA,BT  DRDELBAD          --                                  01557000
         DATA,BT  DRDELBAD          --                                  01558000
         DATA,BT  DRDELBAD          --                                  01559000
         DATA,BT  HA(DRPUAROW)-#T1  UP ARROW
         DATA,BT  HA(DRPCOMMA)-#T1  COMMA                               01561000
         DATA,BT  HA(DRPPERCT)-#T1  PERCENT SIGN                        01562000
         DATA,BT  HA(DRPUSCRE)-#T1  UNDERSCORE                          01563000
         DATA,BT  HA(DRPGRTHN)-#T1  GREATER THAN                        01564000
         DATA,BT  HA(DRPQUEST)-#T1  QUESTION MARK                       01565000
         DATA,BT  DRDELBAD          --                                  01566000
         DATA,BT  HA(DRPBSLSH)-#T1  OTHER BACKSLASH
         DATA,BT  DRDELBAD          --                                  01568000
         DATA,BT  DRDELBAD          --                                  01569000
         DATA,BT  DRDELBAD          --                                  01570000
         DATA,BT  DRDELBAD          --                                  01571000
         DATA,BT  DRDELBAD          --                                  01572000
         DATA,BT  DRDELBAD          --                                  01573000
         DATA,BT  DRDELBAD          --                                  01574000
         DATA,BT  DRDELBAD          --                                  01575000
         DATA,BT  DRDELBAD          --                                  01576000
         DATA,BT  DRDELBAD          --                                  01577000
         DATA,BT  DRDELBAD          --                                  01578000
         DATA,BT  HA(DRPSQUOT)-#T1  SINGLE QUOTE                        01579000
         DATA,BT  HA(DRPEQUAL)-#T1  EQUAL                               01580000
         DATA,BT  HA(DRPDQUOT)-#T1  DOUBLE QUOTE                        01581000
         PAGE                                                           01583000
*                                                                       01584000
* INDEXES TO THE SEMI-COLON DISPATCH TABLE                              01585000
* VALUE DETERMINES THE TYPE OF EVALUATION (IF ANY), WHICH IS REQUIRED   01586000
*                                                                       01587000
#T2      EQU      HA(DRPOINT2)      USED TO FORM SEMICOLON INDEX        01588000
*                                                                       01589000
DRSMIBAD EQU      HA(DRPSMIER)-#T2  SEMICOLON ERROR INDEX               01590000
*                                                                       01591000
         BOUND    FW                                                    01592000
*                                                                       01593000
DRKEY2   EQU      %                                                     01594000
         DATA,BT  HA(DRPSMISP)-#T2  ;SPACE                              01595000
         DATA,BT  HA(DRPSEMIA)-#T2  ;A                                  01596000
         DATA,BT  HA(DRPSEMIB)-#T2  ;B                                  01597000
         DATA,BT  HA(DRPSEMIC)-#T2  ;C                                  01598000
         DATA,BT  HA(DRPSEMID)-#T2  ;D *** TEMPORARY CARD ***           01599000
         DATA,BT  HA(DRPSEMIE)-#T2  ;E                                  01600000
         DATA,BT  HA(DRPSEMIF)-#T2  ;F                                  01601000
         DATA,BT  HA(DRPSEMIG)-#T2  ;G                                  01602000
         DATA,BT  HA(DRPSEMIH)-#T2  ;H
         DATA,BT  HA(DRPSEMII)-#T2  ;I                                  01604000
         DATA,BT  DRSMIBAD          --                                  01605000
         DATA,BT  DRSMIBAD          --                                  01606000
         DATA,BT  DRSMIBAD          --                                  01607000
         DATA,BT  DRSMIBAD          --                                  01608000
         DATA,BT  DRSMIBAD          --                                  01609000
         DATA,BT  DRSMIBAD          --                                  01610000
         DATA,BT  DRSMIBAD          --                                  01611000
         DATA,BT  HA(DRPSEMIJ)-#T2  ;J
         DATA,BT  HA(DRPSEMIK)-#T2  ;K                                  01613000
         DATA,BT  HA(DRPSEMIL)-#T2  ;L                                  01614000
         DATA,BT  HA(DRPSEMIM)-#T2  ;M                                  01615000
         DATA,BT  HA(DRPSEMIN)-#T2  ;N                                  01616000
         DATA,BT  HA(DRPSEMIO)-#T2  ;O  PRINTER DUMP
         DATA,BT  HA(DRPSEMIP)-#T2  ;P                                  01618000
         DATA,BT  HA(DRPSEMIQ)-#T2  ;Q                                  01619000
         DATA,BT  HA(DRPSEMIR)-#T2  ;R                                  01620000
         DATA,BT  DRSMIBAD          --                                  01621000
         DATA,BT  DRSMIBAD          --                                  01622000
         DATA,BT  DRSMIBAD          --                                  01623000
         DATA,BT  DRSMIBAD          --                                  01624000
         DATA,BT  DRSMIBAD          --                                  01625000
         DATA,BT  DRSMIBAD          --                                  01626000
         DATA,BT  DRSMIBAD          --                                  01627000
         DATA,BT  HA(DRPSMISL)-#T2  ;/                                  01628000
         DATA,BT  HA(DRPSEMIS)-#T2  ;S
         DATA,BT  HA(DRPSEMIT)-#T2  ;T                                  01630000
         DATA,BT  HA(DRPSEMIU)-#T2  ;U                                  01631000
         DATA,BT  HA(DRPSEMIV)-#T2  ;V  SAVE ON TAPE
         DATA,BT  HA(DRPSEMIW)-#T2  ;W                                  01633000
         DATA,BT  HA(DRPSEMIX)-#T2  ;X                                  01634000
         DATA,BT  HA(DRPSEMIY)-#T2  ;Y                                  01635000
         DATA,BT  HA(DRPSEMIZ)-#T2  ;Z                                  01636000
         DATA,BT  DRSMIBAD          --                                  01637000
         DATA,BT  DRSMIBAD          --                                  01638000
         DATA,BT  DRSMIBAD          --                                  01639000
         DATA,BT  DRSMIBAD          --                                  01640000
         DATA,BT  DRSMIBAD          --                                  01641000
         DATA,BT  DRSMIBAD          --                                  01642000
         DATA,BT  DRSMIBAD          --                                  01643000
         DATA,BT  HA(DRPSEMI1)-#T2  ;1                                  01644000
         DATA,BT  HA(DRPSEMI2)-#T2  ;2                                  01645000
         DATA,BT  HA(DRPSEMI3)-#T2  F;3
         DATA,BT  HA(DRPSEMI4)-#T2  ;4
         DATA,BT  DRSMIBAD          --                                  01648000
         DATA,BT  DRSMIBAD          --                                  01649000
         DATA,BT  DRSMIBAD          --                                  01650000
         DATA,BT  DRSMIBAD          --                                  01651000
         DATA,BT  DRSMIBAD          --                                  01652000
         DATA,BT  DRSMIBAD          --                                  01653000
         DATA,BT  DRSMIBAD          --                                  01654000
         DATA,BT  DRSMIBAD          --                                  01655000
         DATA,BT  DRSMIBAD          --                                  01656000
         DATA,BT  HA(DRPSMIEQ)-#T2  ;=                                  01657000
         DATA,BT  DRSMIBAD          --                                  01658000
************************************************************************
*                                                                      *
*                                                                      *
************************************************************************
         BOUND    FW
CONDTION EQU      %
        DATA,HW  0,'QL','SL','QE'
        DATA,HW  'QN','QG','RG'
         DATA,HW  'EL',' L',' E','EN','EG',' G'
         BOUND    FW
BKCNDTN  BGE      0,4               CODE WHICH PERFORMS COMPARISON
         BG       0,4               FOR CONDITIONAL BREAKS.
         BE       0,4               THE ORDER IS THE REVERSE OF
         BNE      0,4               THE CONDITION TABLE ABOVE BECAUSE
         BLE      0,4               COMPARISON VALUE IS IN HAND
         BL       0,4               WHEN COMPARISON IS MADE.
*
*        TRANSLATION TABLE DELTA FORMAT CODES -> META-SYM CODES
*
DELTATYP EQU      %
         DATA,1   0,0,2,3,7,1,6
         BOUND    4
*                                                                       01104000
* TABLE USED FOR BIT TESTING                                            01105000
* NOTE : THE ODERING OF THIS TABLE MUST NOT BE CHANGED                  01106000
*                                                                       01107000
DRBITS   EQU      %                                                     01109000
DLBITS   EQU      %                                                     01108000
DRBIT0   DATA,4   X'80000000'                                           01110000
DRBIT1   DATA,4   X'40000000'                                           01111000
DRBIT2   DATA,4   X'20000000'                                           01112000
DRBIT3   DATA,4   X'10000000'                                           01113000
DRBIT4   DATA,4   X'8000000'                                            01114000
DRBIT5   DATA,4   X'4000000'                                            01115000
DRBIT6   DATA,4   X'2000000'                                            01116000
DRBIT7   DATA,4   X'1000000'                                            01117000
DRBIT8   DATA,4   X'800000'                                             01118000
DRBIT9   DATA,4   X'400000'                                             01119000
DRBIT10  DATA,4   X'200000'                                             01120000
DRBIT11  DATA,4   X'100000'                                             01121000
DRBIT12  DATA,4   X'80000'                                              01122000
DRBIT13  DATA,4   X'40000'                                              01123000
DRBIT14  DATA,4   X'20000'                                              01124000
DRBIT15  DATA,4   X'10000'                                              01125000
DRBIT16  DATA,4   X'8000'                                               01126000
DRBIT17  DATA,4   X'4000'                                               01127000
DRBIT18  DATA,4   X'2000'                                               01128000
DRBIT19  DATA,4   X'1000'                                               01129000
DRBIT20  DATA,4   X'800'                                                01130000
DRBIT21  DATA,4   X'400'                                                01131000
DRBIT22  DATA,4   X'200'                                                01132000
DRBIT23  DATA,4   X'100'                                                01133000
DRBIT24  DATA,4   X'80'                                                 01134000
DRBIT25  DATA,4   X'40'                                                 01135000
DRBIT26  DATA,4   X'20'                                                 01136000
DRBIT27  DATA,4   X'10'                                                 01137000
DRBIT28  DATA,4   X'8'                                                  01138000
DRBIT29  DATA,4   X'4'                                                  01139000
DRBIT30  DATA,4   X'2'                                                  01140000
DRBIT31  DATA,4   X'1'                                                  01141000
*                                                                       01143000
************************************************************************
*                                                                      *
* THE FOLLOWING TRANSFER VECTOR IS USED FOR INPUT SWITCHING             01395000
* NOTE : THE DEBUGGER IS VERY SENSITIVE TO THE ORDERING OF THIS TABLE   01396000
*** DO NOT REARRANGE UNDER ANY CIRCUMSTANCES ***                        01397000
*                                                                      *
************************************************************************
DRBUILD  EQU      %                                                     01399000
DREBCDIC B        DRINPEBD          READ IN AS AN EBCDIC VALUE          01400000
DRSYMBOL B        DRINPSYM          READ IN AS A SYMBOL                 01401000
DRINTGER B        DRINPINT          READ IN AS AN INTEGER               01402000
DRHEXAD  B        DRINPHEX          READ IN AS A HEXADECIMAL            01404000
DRNUMBER B        DRINPNUM          READ IN AS A NUMBER                 01405000
DRSPCINP B        DRVALERR          SPECIAL ERROR ENTRY                 01406000
*                                                                       01407000
*                                                                       01813000
* TABLE OF EBCDIC VALUES FOR THE HEXADECIMAL DIGITS                     01814000
*                                                                       01815000
DRDIGITS EQU      %                                                     01816000
         DATA,BT  '0'                                                   01817000
         DATA,BT  '1'                                                   01818000
         DATA,BT  '2'                                                   01819000
         DATA,BT  '3'                                                   01820000
         DATA,BT  '4'                                                   01821000
         DATA,BT  '5'                                                   01822000
         DATA,BT  '6'                                                   01823000
         DATA,BT  '7'                                                   01824000
         DATA,BT  '8'                                                   01825000
         DATA,BT  '9'                                                   01826000
         DATA,BT  'A'                                                   01827000
         DATA,BT  'B'                                                   01828000
         DATA,BT  'C'                                                   01829000
         DATA,BT  'D'                                                   01830000
         DATA,BT  'E'                                                   01831000
         DATA,BT  'F'                                                   01832000
*                                                                       01833000
*                                                                       01760000
* BYTE ARRAY OF POSSIBLE MODE CHARACTERS                                01761000
*                                                                       01762000
         BOUND    FW                                                    01763000
DRMODCHR EQU      %                                                     01765000
         DATA,BT  0                 DUMMY ENTRY - NOT USED              01766000
         DATA,BT  'I'               INTEGER                             01767000
         DATA,BT  'O'               OCTAL                               01768000
         DATA,BT  'X'               HEXADECIMAL                         01769000
         DATA,BT  'C'               EBCDIC                              01770000
DRMODCNT EQU      BA(%)-BA(DRMODCHR) COUNT OF POSSIBLE MODES            01771000
*                                                                       01772000
* BYTE ARRAY OF POSSIBLE MODE VALUES                                    01773000
* INDEX OF CHARACTER IN THE MODE ARRAY GIVES POSITION OF VALUE HERE     01774000
*                                                                       01775000
         BOUND    FW                                                    01776000
DRMODVAL EQU      %                                                     01778000
         DATA,BT  0                 DUMMY ENTRY - NOT USED              01779000
         DATA,BT  #INTTYPE          INTEGER                             01780000
         DATA,BT  #HEXTYPE          HEXADECIMAL                         01782000
         DATA,BT  #EBDTYPE          EBCDIC                              01783000
         BOUND    FW
*                                                                       01784000
         PAGE
*                                                                       01700000
* TRANSFER VECTOR FOR DISPATCHING TO THE APPROPRIATE PRINT ROUTINE      01701000
* INDEXED BY OUTPUT TYPE VALUE                                          01702000
*                                                                       01703000
DRPRTVEC EQU      %
         B        DRPRTFS
         B        DRPRTFL
         B        DRPRTEBD          EBCDIC                              01706500
         B        DRPRTINT          INTEGER (SIGNED)                    01710000
         B        DRPRTHXA
         B        DRERR
*                                                                       01512000
DRTYPCHR EQU      %                                                     01686000
         DATA,BT  0                 DUMMY ENTRY - NOT USED              01687000
         DATA,BT  'R'               RELATIVE                            01688000
         DATA,BT  'A'               ABSOLUTE                            01689000
         DATA,BT  'S'               SHORT FLOATING
         DATA,BT  'L'               LONG FLOATING
         DATA,BT  'C'               EBCDIC                              01689500
         DATA,BT  'I'               INTEGER                             01693000
         DATA,BT  'X'               HEXADECIMAL                         01691000
         DATA,BT  'F'               SYMBOL TABLE SPECIFICATION
         DATA,BT  'K'               CONSTANT SYMBOL TYPE
DRTYPCNT EQU      BA(%)-BA(DRTYPCHR) NUMBER POSSIBLE OUTPUT TYPES       01696000
DRTYPLST EQU      DRTYPCNT-1        INDEX TO LAST ELEMENT OF TYPE ARRAYS01696500
         BOUND    FW
*                                                                       01695000
ERMSVEC  DATA,FW  BA(DRNOTOPR)
         DATA,FW  BA(DRNOTMEM)
         DATA,FW  BA(DRPRIVIL)
         DATA,FW  BA(DRMEMPRO)
*
*                 TRANSLATION TABLE FOR CONVERTING FROM METASYMBOL
*                 SYMBOL TYPES TO DELTAS OUTPUT FORMAT CODES
*
METATYPE EQU      %
         DATA     X'50203',X'2030604',X'50203',X'2030604'
         DATA     X'6060101',X'1010101',X'1060101',X'1010101'
*
         BOUND    4
*
* TABLE OF ABORT CODES CAUSED BY USER SETTING DATA BREAK POINT
*
ABRTCDT  DATA     X'4A00'
         DATA     0                 END OF TABLE FLAG
*
         BOUND    4
*
*                 TRAP FLAG BITS IN BYTE 0 OF J:USENT IN JIT WHEN
*                 USER HAS TRAP CONTROL
*
TRAPFLAG EQU      %
         DATA,2   X'0040',X'0020',X'0010',2,8,4,X'0080',X'0100'
         PAGE
         BOUND    4
*
*        TABLE OF TRAP LOCATIONS IN DELTA CAUSED BY THE USER
*
TRAPTBL  EQU      %-1
         DATA     DRSEMIWX          ;W ERROR
         DATA     STOREXX           STORE INTO PROTECTED PAGE
         DATA     TESTBRK-1         BAD ;B ADDRESS
         DATA     TESTBRK           BAD ;B ADDRESS
         DATA     SLASHXX           BAD SLASH ADDRESS
         DATA     SLASHYY           BAD SLASH ADDRESS
TTBLSZ   EQU      %-TRAPTBL-1       TABLE SIZE
*                                                                       01777000
*        TRANSFER VECTOR FOR TRAP CONTROL
*                                                                       01764000
TRAPS    EQU      %
         B        TRAP40            TRAP 40
         B        UNIMP             TRAP 41
         B        STAKOFLW          TRAP 42
         B        FIXARITH          TRAP 43
         B        FLTFLT            TRAP 44
         B        DECFLT            TRAP 45
*                                                                       01711000
*                                                                       01785000
WTPTCT   EQU      %                 WRITE PROTECT CODES FOR THE
*                                   FOUR USER PAGES
         DATA,FW  X'40'
         DATA,FW  X'10'
         DATA,FW  4
         DATA,FW  1
*                                                                       01419000
************************************************************************
*                                                                      *
*                                                                      *
************************************************************************
*                                                                       01659000
         PAGE                                                           01660000
*                                                                       01661000
* THE FOLLOWING INSTRUCTIONS ARE EXECUTED WHEN BUILDING AN EXPRESSION   01662000
*                                                                       01663000
DREXUTB1 EQU      %                                                     01664000
DRBLANKX NOP                        BLANK (SPACE)                       01665000
DRPLUSX  NOP                        PLUS                                01666000
DRMINUSX LCW,2    2                 MINUS
DRCOMMAX NOP                        COMMA                               01667500
         BAL,14   DRMULTR           MULTIPLICATION
         BAL,14   DRMULTR           POS SHIFT
         BAL,14   DRMULTR           NEG SHIFT
*                                                                       01668000
* THE FOLLOWING INSTRUCTIONS ARE EXECUTED WHEN FORMING AN ADDRESS VALUE 01669000
*                                                                       01670000
DREXUTB2 EQU      %                                                     01671000
         NOP                        BYTE ADDRESS                        01672000
         SLS,3    -1                HALFWORD ADDRESS                    01673000
         SLS,3    -2                WORD ADDRESS                        01674000
         SLS,3    -3                DOUBLEWORD ADDRESS                  01675000
*                                                                       01676000
* MISCELLANEOUS INSTRUCTIONS USED IN DEBUG                              01677000
*                                                                       01678000
*                                                                       01680000
DRNEQTST BE       DRSEMIWT          BRANCHES IF VALUES ARE EQUAL        01681000
DREQTST  BNE      DRSEMIWT          BRANCHES IF VALUES ARE NOT EQUAL    01682000
*                                                                       01683000
         PAGE                                                           01684000
************************************************************************
*                                                                      *
*                                                                      *
************************************************************************
*                                                                       01425000
#:       EQU      X'8000'           BIT TO INDICATE SPECIAL SYMBOL      00831000
#ASTRISK EQU      '*'                                                   00850000
#BELL    EQU      X'07'
#BLANK   EQU      ' '               BLANK
#BSLASH  EQU      X'B1'
#COMMA   EQU      ','                                                   00852000
#CRETRN  EQU      X'D'
#CRLF    EQU      #CRETRN
#DOLLAR  EQU      '%'                                                   00853000
#DOLLAR2 EQU      X'5B00'                                               00869000
#DQUOTE  EQU      '"'                                                   00863000
#EBDTYPE EQU      DREBCDIC-#S3      INDEX FOR EBCDIC INPUT              01412000
#FLTYPE  EQU      2                 SHORT FLOATING INPUT CODE
#GTRTHAN EQU      '>'                                                   00854000
#HEXTYPE EQU      DRHEXAD-#S3       INDEX FOR HEXADECIMAL INPUT         01416000
#INTTYPE EQU      DRINTGER-#S3      INDEX FOR INTEGER INPUT             01414000
#LNFEED  EQU      8
#LSSTHAN EQU      '<'                                                   00855000
#MINUS   EQU      '-'                                                   00856000
#NUMTYPE EQU      DRNUMBER-#S3      INDEX FOR NUMBER INPUT              01417000
#PERIOD  EQU      '.'                                                   00857000
#PLUS    EQU      '+'                                                   00855500
#QUESTN  EQU      '?'                                                   00858000
#SEMI:   EQU      ';'                                                   00859000
#SEMI:2  EQU      X'5E00'                                               00871000
#SLASH   EQU      '/'                                                   00860000
#SLASHSP EQU      ' /'                                                  00872000
#SPACE   EQU      ' '                                                   00861000
#SPCTYPE EQU      DRSPCINP-#S3      INDEX FOR EBCDIC CLEAN-UP ROUTINE   01418000
#SPQUEST EQU      ' ?'
#SQUOTE  EQU      ''''                                                  00862000
#UNDERL  EQU      X'6D'             UNDERLINE
#SYMTYPE EQU      DRSYMBOL-#S3      INDEX FOR SYMBOL INPUT              01413000
#S3      EQU      DRBUILD                                               01410000
#S4      EQU      DREXUTB1                                              01807000
#2SPACE  EQU      '  '                                                  00868000
ACSPTCT  DATA     X'40100401'
AWM      DATA     X'66000000'
BALBRNCH B        *EFADR            EXECTD INSTEAD OF BAL ON I BRK
BALJMP   B        *BADR             EXECTD INSTEAD OF BAL ON TRACES
BLANKS   DATA,FW  '    '
BLNK     DATA     X'00404040'
BLNKUPER DATA,FW  X'4040FFFF'
MOVTRANS DATA     X'2000005E'+BA(OUTBUF)
TABLE    CNAME
         PROC
LF       SET      %
TAB%     SET      %
         DO1      64
         TEXT     '....'
S%       SET      %
ALIST    SET      S:PT(AF)
ALIST    SET      S:UT(ALIST)
IX       DO       NUM(ALIST)
AA       SET      ALIST(IX)&X'FF'
         ORG,1    AA+BA(TAB%)
         DATA,1   ALIST(IX)
         FIN
         ORG      S%
         PEND
OTT      TABLE    'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',;
                  '  #%%&''()*:=-@[\+;  <> ,.?/'
         BOUND    DW
BRXPSD   DATA     X'1400000B'       RETURN TO EXECUTE BRANCHES
CONSTYPE EQU      X'80'             CONSTANT SYMBOL CODE
CSECT%TYPE        ;
         EQU      DRBIT11           BIT INDICATING CSECT TYPE IN VALUE
*                                   WORD OF SYMBOL TABLE
DELENT   EQU      J:INTENT          DELTA ENTRY TABLE LOC, FOR USE IN
*                                     INTERFACING WITH ANALZ/MONFIX;
*                                     J:INTENT POINTS TO A 4-WORD TBL:
*                                           0 - LOC OF 'GET' SUBR
*                                           1 - LOC OF 'PUT' SUBR
*                                           2 - ENTRY LOC FOR ';G'
*                                           3 - NAME/ACCOUNT/PASSWORD
*                                                 TABLE LOCATION.
*                                     WORD #3 POINTS TO A 7-WORD TABLE:
*                                           ACCOUNT NAME (2 WDS)
*                                           PASSWORD (2 WDS)
*                                           LMN NAME (3 WDS, TEXTC)
DRADMSKL EQU      M20                                                   01722000
DRADMSKM EQU      M17                                                   01721000
DRADMSKS EQU      DRADMSKM          NO MORE 16 BIT ADDRESSES
         BOUND    DW                                                    01786000
DRALPHAS DATA,FW  ':','@'           RANGE OF SPECIAL ALPHABETIC DIGITS  01788000
DRAMPRSD EQU      DRNOCODE                                              01944000
DRASTBIT EQU      DRBIT18           BIT USED TO INDICATE INDIRECT ADDR  01726500
DRBLKOPR EQU      DRBLANKX-#S4      CODE  FOR SPACE OPERATOR            01808000
DRCOMOPR EQU      DRCOMMAX-#S4      CODE FOR COMMA OPERATOR             01810500
DRCONBIT EQU      DRBIT5            BIT USED TO TEST FOR CONSTANTS      01726000
DRDEFMOD EQU      K200              INDICATOR FOR SYMBOL DEFINE MODE    01096500
DRDEFTST DATA,FW  1                 USED TO TEST STATE OF SCANNER       01751000
DRD10    DATA,FW  10                VALUE USED AS RADIX IN INTEGER PRINT01754000
DRERROR  EQU      DRERR                                                 01936000
DREBDMSK EQU      YFF                                                   01742000
DRFD0BIT EQU      8                 BIT TO INICATE FIELD 0 WAS USED     01735000
DRFD1BIT EQU      4                 BIT TO INICATE FIELD 1 WAS USED     01736000
DRFD2BIT EQU      2                 BIT TO INICATE FIELD 2 WAS USED     01737000
DRFD3BIT EQU      1                 BIT TO INICATE FIELD 3 WAS USED     01738000
DRFLDBIT EQU      DRBIT28                                               01728000
DRFLDBTS EQU      DRBIT28           USES STANDARD BIT ARRAY SHOW USAGE  01729000
DRFULLWD EQU      DRBIT30           BIT TO INDICATE FULL WORD VALUE     01732000
*                                                                       01796000
         BOUND    DW
DRHEXAS  DATA,FW  KC1-KF0           SPECIAL CHECK FOR THE CHARACTER A   01789000
         DATA,FW  KC6-KF0           SPECIAL CHECK FOR THE CHARACTER F   01789500
DRLBRKET EQU      DRNOCODE                                              01943000
DRMASKBT EQU      DRBIT24           USES  STANDARD BIT ARRAY FOR MASKING01727000
*                                                                       01798000
DRMODABS EQU      1                 VALUE FOR ABSOLUTE ADDRESS MODE
DRMODREL EQU      0                 VALUE FOR RELATIVE ADDRESS MODE
DRNEGOPR EQU      DRMINUSX-#S4      CODE FOR MINUS OPERATOR             01810000
DRNOCODE EQU      DRERR                                                 01936500
DRNOVAL  EQU      DRBIT29           FLAG TO SHOW SYMBOL IS NOT IN TABLE 01731000
DROPBITS EQU      Y7FF                                                  01724000
DRPLSOPR EQU      DRPLUSX-#S4       CODE FOR PLUS OPERATOR              01809000
*                                                                       01802000
         BOUND    DW
DRSCNFIX EQU      %                 RESETS SCANNER AFTER SEMI-COLON
         DATA     DRSYMAXE-6,#SYMTYPE SPECIAL SYMBL AS TERM IN CMND LINE
*                                                                       01804000
         BOUND    DW
DRSCNSET DATA,FW  -DRSYMMAX,#NUMTYPE USED TO INITIALIZE THE SCANNER     01794000
DRSEMISP EQU      DRNOCODE                                              01952000
DRSOPRBT EQU      X'800'            VALUE TO CHECK FOR 20 BIT ADDRESS
DRSOPRFG EQU      DRBIT20           BIT USED TO SET 20 BIT
DRSOPRFL EQU      DRBIT20           ADDRESS MODE
DRSYMAXE EQU      -DRSYMMAX+8       MAX LENGTH EVALUATABLE SYMBOLS
DRSYMMAX EQU      12                MAX CHARS TO CHAR BUFFER
DRTMPEVL EQU      DRCHRBFX          USED TO SAVE A CONDITION CODE       01805000
DRUDEFBT EQU      X'10'             BIT TO SHOW AN UNDEFINED            01740000
DRUDEFLG EQU      DRBIT27           BIT WORD FOR UNDEFINED FLAG
DRUNDSCR EQU      DRNOCODE                                              01948000
DRVALERR EQU      DRERR                                                 01935000
DRVAL1   EQU      HA(DRVAL1XX)-#T1  INDEX FOR DECIDING WHEN TO EVALUATE 01801000
ERKEY    DATA     X'03000000'       ERROR MESSAGE FILE KEY
ERCODES  DATA     X'B402'           CODES AND SUBCODES FOR ERR/ABRT
         DATA     X'B401'
         DATA     X'B403'
EXU      EQU      X'67'
F%TYPE   EQU      7                 SYM TAB CONTROLS OUTPUT FORMAT
FILE%TYPE         ;
         EQU      1                 DCB M:XX OPEN TO FILE
HEADKEY  TEXTC    'HEAD'            KEY FOR READING HEAD RECORD
IBRKJUMP B        1
IBRKXPSD DATA     X'14000001'       NON-EXISTENT INST FOR BREAK
K%CONST  EQU      8                 CONSTANT SYMBOL MODE SPECIFICATION
KILL%BIT EQU      DRBIT2            BIT IN BYTE COUNT THAT FLAGS A
LOCTYPE  EQU      X'40'             LOCATION SYMBOL CODE
*                                   SYMBOL AS 'KILLED'
         BOUND    DW
OPLMTS   DATA     X'64',X'6A'
OUTBUF%SIZE       ;
         EQU      33                SIZE OF OUTPUT BUFFER
OVFLW%MASK        ;
         DATA     X'F0000000'       MASK TO CHECK FOR HEX OVERFLOW
PAGE%BOUND        ;                 CONSTANT USED TO DETERMINE IF ADDING
         DATA     X'1FD'            A SYMBOL HAS MOVED THE TOP OF THE
*                                   SYMBOL TABLE TO A NEW PAGE
PAGE%MASK         ;                 MASK USED TO CHECK IF A MEMORY VIOL-
         DATA     X'1FE00'          ATION HAS OCCURRED IN A PAGE THAT
SYM%MASK DATA     X'1FFFFFFF'       MASK FOR LENGTH+3 BYTES OF SYMBOL
*                                   HAS A DATA BREAK ON IT.
PRNT%TYPE         ;
         EQU      2                 DCB M:XX OPEN TO PRINTER
PUL     EQU      J:EUP             END OF USERS PROGRAM
R%TYPE   EQU      0                 RELATIVE ADDRESS OUTPUT MODE
SHFTCODE EQU      X'400'            CODE MEANS SPECIAL SHIFT OP CODE
*                                   IN EVALUATION
        BOUND    8
STKINIT DATA     DELSTK+1          USED TO INITIALIZE DELTAS
        DATA,2   20,0              WORKING STACK
TEMPS    EQU      DELTREGS          TEMPORARY STOREAGE
         BOUND    8
XRETURN  DATA     EXECINST+1,EXECINST+3
EXCDRTN  DATA     EXCDBRK,EXCDBRK+1
PULLDELNO DATA    PULLDELX1,PULLDELX2
         BOUND    8
TREE     TEXTC    'TREE'
         PAGE
KADMSKM  EQU      KM17                                                  01080000
KADMSKS  EQU      KM14                                                  01079000
KASTBIT  EQU      K2000             INDICATOR FOR INDIRECT ADDRESS      01099000
KCHKDIF  EQU      K400              ALLOWABLE OFFSET FROM SYMBOL        01092000
KCONSBIT EQU      K400              TEST FOR CONSTANT SYMBOL VALUE      01093000
KDEFMOD  EQU      K4000             INDICATOR FOR SYMBOL DEFINE MODE    01100000
KFULLWD  EQU      K80               INDICATOR FOR FULL WORD VALUE       01095000
KSOPRBT  EQU      K1000             INDICATOR FOR SPECIAL OPCODES       01098000
KUDEFLG  EQU      K8000             INDICATOR FOR UNDEFINED SYMBOL      01101000
*                                                                       00995000
* DEFINITIONS OF ADDRESSES USED IN IMMEDIATE INSTRUCTIONS               00996000
*                                                                       00997000
K0       EQU      0                                                     00998000
K1       EQU      1                                                     00999000
K2       EQU      2                                                     01000000
K3       EQU      3                                                     01001000
K4       EQU      4                                                     01002000
K5       EQU      5                                                     01003000
K6       EQU      6                                                     01004000
K7       EQU      7                                                     01005000
K8       EQU      8                                                     01006000
K9       EQU      9                                                     01007000
KA       EQU      X'A'                                                  01008000
KB       EQU      X'B'                                                  01009000
KC       EQU      X'C'                                                  01010000
KF       EQU      X'F'                                                  01011000
K10      EQU      X'10'                                                 01012000
K13      EQU      X'13'                                                 01013000
K19      EQU      X'19'                                                 01014000
K20      EQU      X'20'                                                 01015000
K3F      EQU      X'3F'                                                 01016000
K40      EQU      X'40'                                                 01017000
K60      EQU      X'60'                                                 01018000
K6C      EQU      X'6C'                                                 01019000
K77      EQU      X'77'                                                 01020000
K7F      EQU      X'7F'                                                 01021000
K80      EQU      X'80'                                                 01022000
K84      EQU      X'84'                                                 01023000
KC1      EQU      X'C1'                                                 01023500
KC6      EQU      X'C6'                                                 01023750
KF0      EQU      X'F0'                                                 01024000
KFF      EQU      X'FF'                                                 01025000
K100     EQU      X'100'                                                01026000
K102     EQU      X'102'                                                01027000
K180     EQU      X'180'                                                01028000
K1FF     EQU      X'1FF'                                                01029000
K200     EQU      X'200'                                                01030000
K400     EQU      X'400'                                                01031000
K600     EQU      X'600'                                                01033000
K700     EQU      X'700'                                                01034000
K800     EQU      X'800'                                                01035000
K1000    EQU      X'1000'                                               01036000
K1200    EQU      X'1200'                                               01037000
K2000    EQU      X'2000'                                               01038000
K3FFF    EQU      X'3FFF'                                               01039000
K4000    EQU      X'4000'                                               01040000
K7FFF    EQU      X'7FFF'                                               01041000
K8000    EQU      X'8000'                                               01042000
DRDEFBIT EQU      K8000                                                 01043000
K8402    EQU      X'8402'                                               01044000
KA000    EQU      X'A000'                                               01045000
KA400    EQU      X'A400'                                               01046000
KE000    EQU      X'E000'                                               01047000
KFF00    EQU      X'FF00'                                               01048000
KFFFF    EQU      X'FFFF'                                               01049000
K10000   EQU      X'10000'                                              01050000
K1C000   EQU      X'1C000'                                              01051000
K1F8FF   EQU      X'1F8FF'                                              01052000
K1FF00   EQU      X'1FF00'                                              01053000
K1FFFF   EQU      X'1FFFF'                                              01054000
K20000   EQU      X'20000'                                              01055000
K40000   EQU      X'40000'                                              01056000
K80000   EQU      X'80000'                                              01057000
K80001   EQU      X'80001'                                              01058000
KN1      EQU      -1                                                    01059000
KN6      EQU      -6                                                    01060000
KN8      EQU      -8                                                    01061000
KN100    EQU      -X'100'                                               01063000
KN400    EQU      -X'400'                                               01063500
*                                                                       01064000
*                                                                       01066000
* DEFINITIONS OF IMMEDIATE ADDRESSES USED AS MASKS                      01067000
*                                                                       01068000
KM1      EQU      K1                                                    01069000
KM2      EQU      K3                                                    01070000
KM3      EQU      K7                                                    01071000
KM4      EQU      KF                                                    01072000
KM6      EQU      K3F                                                   01072500
KM7      EQU      K7F                                                   01073000
KM8      EQU      KFF                                                   01074000
KM9      EQU      K1FF                                                  01075000
KM14     EQU      K3FFF                                                 01076000
KM17     EQU      K1FFFF                                                01077000
*                                                                       01102000
* M IS USED FOR MASKS                                                   01144000
*                                                                       01145000
M3       DATA,4   X'7'                                                  01148000
M4       DATA,4   X'F'                                                  01149000
M6       DATA,4   X'3F'                                                 01150000
M7       DATA,4   X'7F'                                                 01151000
M8       DATA,4   X'FF'                                                 01152000
M11      DATA,4   X'7FF'                                                01153000
M12      DATA     X'FFF'
M15      DATA     K7FFF
M16      DATA,4   X'FFFF'
M17      DATA,4   X'1FFFF'                                              01156000
M19      DATA     X'7FFFF'
M20      DATA,4   X'FFFFF'                                              01157000
M24      DATA     X'FFFFFF'
*                                                                       01160000
* X IS USED FOR RIGHT JUSTIFIED HEX                                     01161000
*                                                                       01162000
XF0      DATA,4   X'F0'                                                 01165000
XE0000   DATA,4   X'E0000'                                              01167000
*                                                                       01171000
X7       EQU      M3                                                    01714000
XF       EQU      M4                                                    01715000
X3F      EQU      M6                                                    01716000
X7F      EQU      M7                                                    01717000
XFF      EQU      M8                                                    01718000
X7FF     EQU      M11                                                   01719000
*                                                                       01173000
* Y IS USED FOR LEFT JUSTIFIED HEX                                      01174000
*                                                                       01175000
Y4       DATA     X'40000000'
Y07      DATA     X'7000000'
Y7FF     DATA,4   X'7FF00000'                                           01200000
YFF      DATA,4   X'FF000000'                                           01203000
YFFFF    DATA,4   X'FFFF0000'                                           01204000
*
         PAGE                                                           01834000
************************************************************************
*                                                                      *
*                                                                      *
************************************************************************
*                                                                       01835000
* MESSAGES OUTPUT TO THE USER VIA THE DRPRTMSG ROUTINE                  01836000
*                                                                       01837000
ABRTCD   TEXTC    '
ABORT WITH CODE =  '
ABRTSC   TEXTC    ', SUBCODE =  '
BRKAT    TEXTC    '
BRK AT '
BRKDELT  TEXTC    '
BRK IN DELTA'
DECTRP   TEXTC    '
DECIMAL FAULT AT '
DELTMSG TEXTC    '
DELTA HERE
'
DRMEMPRO TEXTC    '
MEM PROTECT FAULT AT '
DRMEMPRX TEXTC    '
MEM PROTECT FAULT ACCESSING '
DRNOTMEM TEXTC    '
NONEXIST MEM REF AT '
DRNOTOPR TEXTC    '
NONEXIST INSTR AT '
DRPRIVIL TEXTC    '
PRIVIL INSTR AT '
TRUNMSG  TEXTC    ' *TR*  '
DTRPMSG  TEXTC    '
TRAP '
DTRPMSG1 TEXTC    ' IN DELTA AT '
EXITMS   TEXTC    '
EXIT '
FIXTRP   TEXTC    '
FIX ARITH OVFLW AT '
FLTTRP   TEXTC    '
FLOAT FAULT AT '
ILSTRMSG TEXTC    '
ILLEGAL STORE ATTEMPTED INTO '
NOFIL    TEXTC    '
CANT OPEN FILE '
NOPGM    TEXTC    '
NO USER PROGRAM
'
NOREC    TEXTC    '
CANT FIND '
NOTINTAB TEXTC    ' NOT IN TABLE'
PAGEASGN TEXTC    ' CANT GET PAGE '
STKOVFLW TEXTC    '
STACK LIMIT FAULT AT '
TABLFULL TEXTC    '
TABLE FULL'
UNIMPTRP TEXTC    '
UNIMP INSTR AT '
EXIT     TEXTC    '
EXIT AT '
LOCATION TEXTC    '
LOCATION = '
SEGMSG   TEXTC    '
SEGMENT '
LDMESS   TEXTC    ' LOADED'
*                                                                       01849000
* MESSAGES OUTPUT TO THE USER VIA THE DRPRTSML ROUTINE                  01850000
*                                                                       01851000
ATMSG    TEXT     ' TA '
DBPT     DATA,FW  ' >D;'
DRMESS1  DATA,FW  '   /'            MESSAGE FOR USE BY OUTPUT SECTION   01853000
DROKMESS DATA,FW  'KO '             MESSAGE USED TO REQEUST CONFIRMATION01853100
DR4SPACE DATA,FW  '    '            CONSTANT OF 4 EBCDIC SPACES         01852000
IBPT     DATA,FW  ' >B;'
JUMPMESS DATA     ' >- '
NOMESS   DATA,FW  'ENON'
QUES     DATA,FW  X'00406F15'
TRACOUT  DATA,FW  ' T '
#3SPACE  DATA,FW  '   '
SHFTMSK  DATA     X'000E00FF'       M FOR INDEX AND COUNT (SHIFT)
*                                                                       01857000
PCH      RES      50                PURE PROCEDURE PATCH AREA
         PAGE
************************************************************************
*                                                                      *
*                                                                      *
*                 VARIABLE DATA - USERS CONTEXT                        *
*                                                                      *
*                                                                      *
************************************************************************
         USECT    ALPHA             ALPHA IS CSECT OF TYPE 00
DELTA%DATA        ;                 BASE OF DELTA'S CONTEXT
         EQU      %
VDUC     EQU      %                 VARIABLE DATA USERS CONTEXT DEF
         DEF      VDUC              FOR PATCHING
         DO       TEST=0
DTSTACK  DATA     %+1               DELTA'S TEMP STACK
         GEN,16,16 X'2A',0
         ELSE
DTSTACK  DATA     %+22
         GEN,16,16  21,21           DUMMY UP DELTA STACK IN TEST MODE.
         FIN
DTS      EQU      %                  DELTAS TEMP STACK
         DATA     0,-1              BLOCK CONTROL WORDS
OLDPSD   DATA     X'00F00000',0     USER'S PSD
SAVREGS  RES      16                USERS REGISTERS
TRAPLOC  RES      2                  TRAP LOCATION
DELTPSD  RES      2                 DELTAS PSD
DELTREGS RES      17                DELTAS REGISTERS
TMODESV  DATA     0
TRTNFLG  DATA     -1
TRTNSV   DATA     0
TRTNINST DATA     X'1400000C'
         BOUND    DW
TRTNTRP  DATA     TRTNINST,X'1FFFF'
************************************************************************
*                                                                      *
*                 FPT'S                                                *
*                                                                      *
************************************************************************
*        FPT FOR SET ACCESS PROTECTION                                 *
ACCESS%FPT        ;
         EQU      %
SET%PRTCT%ADR     ;
         GEN,8,24 X'0A',0
SET%PRTCT%TYPE    ;
         DATA     0
LO%FPT   EQU      %                 FPT FOR PRINT OPEN
         GEN,8,24 X'14',M:XX
         DATA,2   4,0,0,'LP'
         BOUND    4
         PAGE
************************************************************************
*                                                                      *
*        FPT FOR OPEN CAL ON DCB M:XX FOR FILE I/O                     *
*                                                                      *
************************************************************************
         BOUND    8                 THIS BOUND AND RES FORCES 'PASSWORD'
*                                   TO A DOUBLEWORD BOUNDARY
OPEN%FPT EQU      %
         GEN,8,24 X'14',M:XX
         GEN,8,24 X'C3',1
         DATA     OPEN%ABN,OPEN%ABN ERR/ABN ADDRS
         DATA     2
         DATA     1                 INPUT FILE MODE
FILE%OPT EQU      %
         DATA     X'01000303'
FILE%NAME         ;
         EQU      %
         RES      3
FILE%ACCT         ;
         EQU      %
         DATA     X'2000002'        ACCOUNT # WILL BE FILLED IN BY
         DATA     0,0               IOSYM FROM ACCOUNT # IN JIT
         DATA     X'03010202'
PASSWORD RES      2
************************************************************************
*                                                                      *
*        FPT FOR CLOSE CAL ON DCB M:XX                                 *
*                                                                      *
************************************************************************
CLOSE%FPT         ;
         EQU      %
         GEN,8,24 X'15',M:XX
         DATA     0
         PAGE
************************************************************************
*                                                                      *
*    FPTS FOR OPENING AND CLOSING ERROR MESSAGE FILE THROUGH M:XX      *
*                                                                      *
************************************************************************
FOPEN    GEN,8,24 X'14',M:XX        FPT TO OPEN ERROR MESSAGE FILE
         DATA     X'C7080001'
         DATA     ABRT70            ERROR ADDRESS
         DATA     ABRT70            ABNORMAL ADDRESS
         DATA     2                 KEYED FILE
         DATA     2                 DIRECT ACCESS
         DATA     1                 IN MODE
         DATA     4                 MAX KEY SIZE
         DATA     X'01000202'       FILE NAME COMING
         TEXTC    'ERRMSG'          FILE NAME
         DATA     X'02010202'       ACCOUNT COMING, LAST ITEM IN FPT
         TEXT     ':SYS    '        ACCOUNT NUMBER
*
FCLOSE   GEN,8,24 X'15',M:XX        FPT LIST TO CLOSE ERROR MESSAGE FILE
         DATA     X'80000000'
         DATA     2                 SAVE THE FILE
************************************************************************
*                                                                      *
*        FPT FOR GET- AND RELEASE- PAGE CAL                            *
*                                                                      *
************************************************************************
PAGE%FPT EQU      %
         DATA     GTRLPAGE
************************************************************************
*                                                                      *
*        TABLE OF LOCATION AND CONSTANT SYMBOLS                        *
*                                                                      *
************************************************************************
************************************************************************
SPC%OP   CNAME
         PROC
         BOUND    FW
         DATA,BT  X'80'+NUM(AF)
         DATA,BT  AF(1),AF(2),0
         DATA     0
         PEND
************************************************************************
*                                                                      *
*                                                                      *
************************************************************************
SPECSYM  EQU      %
         SPC%OP   #%
DR#DSIGN DATA,FW  0                                                     00083000
         SPC%OP   #S:,Q
DR#SEMIQ DATA,FW  0                                                     00086000
         SPC%OP   #S:,I
DR#SEMII DATA,FW  0                                                     00089000
         SPC%OP   #S:,C
DR#SEMIC DATA,FW  0                                                     00092000
         SPC%OP   #S:,M
DR#SEMIM DATA,FW  -1                                                    00095000
         SPC%OP   #S:,#1
DR#SEMI1 DATA,FW  0                                                     00098000
         SPC%OP   #S:,#2
DR#SEMI2 DATA     X'1FFFF'
         SPC%OP   #S:,#3
DR#SEMI3 DATA     0                 MAP/MASTER BYTE
         SPC%OP   #S:,#4
DR#SEMI4 DATA     0                 WRITE KEY BYTE
         SPC%OP   #S:,F
DR#SEMIF DATA,FW  0                                                     00104000
NENTSPEC EQU      %-SPECSYM
         PAGE
         BOUND    FW
ABORTSV  RES,FW   1                 RETURN LINK SAVE DURING ABORT
ABORTDCB RES,FW   1                 SAVE ADR OF ABORT CAUSING DCB HERE
ABORTFLG DATA     0                 SPECIAL ABORT PROCESSING FLAG
ACTBKLOC RES      1                 LOCATION OF ACTIVE BREAK
BALREG   RES      1
BASEADRS EQU      %
         RES,FW   1
TRCTBL   RES      1                 TRACE
BRKNENT  RES      1                 NENT
BRKCOND  RES      1                 COND
WORD1A   RES      1                 MASK
WORD1    RES      1                 VAL
BRKLOC   RES      1                 LOC
ADRSNENT EQU      %-BASEADRS
BRKPRCD  DATA     0                 PROCEED TO USERBRK COUNT FOR BREAK
BREAKEY  DATA,FW  0                 =1,USER HIT BREAK KEY
BRKMSGXT RES,FW   1                 RETURN LOC FROM BRK MSG ROUTINE
CHARINDX DATA,FW  0                 CHAR INDEX FOR COMMAND LINE SCAN
CURNOPR  RES,FW   1                 CURRENT ARITH OPERATOR (DREVAL)
DBANLZFG DATA     0                 DATA BREAK ANLZ TRAP FLAG
DBEFADR  RES,4    1                 EFFECTIVE ADDRESS CAUSING BREAK
DBRKMODE DATA,FW  -1                NEG MEANS NOT IN D BREAK MODE
DBRKNUM  DATA,FW  0                 # OF D BREAK CAUSING THE TRAP
DBRK%YES DATA     -1                CHECK DATA BREAKS
DBRKSPD  DATA     0                 D-BRK STACK INSTRUCTION FLAG
DCB%STAT DATA     0                 CURRENT STATUS OF M:XX DCB
*                                   =0, CLOSED
*                                   =1, OPEN TO FILE (CURRENT LMN)
*                                   =2, OPEN TO PRINTER - DEVICE,LO
         BOUND    8
DELSTK   EQU      %
         DATA     %+1               TEMP STACK FOR INTERNAL
         DATA,2   20,0              PROCESSING IN DELTA
         RES      20
DELTCNTL DATA,FW  0                 =1,IN DELTA WHEN BRK KEY HIT
DIC      DATA     0                 PREVIOUS DELTA-IN-CONTROL FLAG
DO%DONT  DATA     0                 SPECIAL ACTION FLAG FOR TRANSFER
*                                   BREAKPOINTS
DOTCHAR  RES,FW   1                 POSITION OF DOT IN COMMAND LINE
DOTMODE  DATA,FW  0                 >0 MEANS CURRENT TERM PRECEEDED BY 9
DBEFADRX RES      1                 END LOC OF INST CAUSING BREAK
DRADRMOD DATA,FW  0                 VALUE OF ADDRESS PRINT MODE
PROMPT   DATA     X'07000000'       PROMPT CHARACTER--BELL
         BOUND    DW
DRCHRBUF RES,BT   DRSYMMAX          RESERVE SPACE FOR BUILDING A SYMBOL 00909000
DRCHRBFX EQU      %                 SYMBOL USED WHEN INPUTTING TO BUFFER00910000
         BOUND    FW                                                    00912000
DRCLSRTN RES,FW   1                 STORAGE FOR RETURN LINK FROM DRCLOSE00934500
DREQDFLT DATA     6                 '=' DEFAULT OUTPUT NMODE
DREVLRTN RES,FW   1                 STORAGE FOR RETURN LINK FROM EVAL   00929000
         BOUND    DW
DREXPRS  RES,FW   4                 STORAGE FOR EXPRESSION FIELDS       009
DRFNDVAL RES,FW   1                 VALUE BEING SEARCHED FOR            00922000
DRLSTOPR RES,FW   1                 STORAGE FOR LAST ARITHMETIC OPERATOR00930000
DRMULT#  DATA     1
DROPENER DATA,FW  1                 SWITCH : NON-ZERO MEANS SLASH MODE  00931750
DROPENSW RES,FW   1                 SWITCH TO TELL IF A REGISTER IS OPEN00932000
DRPRTSAV RES,FW   1                 STORAGE FOR RETURN LNK FROM DRPRTADR00933000
DRPRTSW  RES,FW   1                 STORAGE FOR ADDRESS PRINT MODE      00931000
DRPTEXP# RES,FW   1                 STORAGE FOR RETURN LINK FROM DRPTEXP00934000
DRSLDFLT DATA     F%TYPE            SLASH DEFAULT MODE
DRSLSHMD DATA     F%TYPE            STORAGE FOR MOST RECENT PRINT MODE
         BOUND    DW                                                    00947000
DRSRCHLM RES,DW   1                 STORAGE FOR SEARCH LIMITS           00954000
DRTEMPD1 RES,DW   1                 TEMP
DRTEMPS1 RES,DW   1                 TEMP
DRTEMPS2 RES,DW   1                 TEMP
DRTESTER RES,FW   1                 STORAGE FOR TEST USED IN SEARCHES   00937000
DRTAGVAL RES,FW   1                 STORAGE FOR INDEX FROM PRINT VALUES
DRUPRLIM RES,FW   1                 STORAGE FOR END TEST ON RANGE LOOK  00939000
DRVALSAV RES,BT   12                BYTE STACK FOR INTEGER PRINT ROUTINE00914000
         BOUND    DW
DUMP%LMTS         ;
         EQU      %
DUMP%LM1 RES      1
DUMP%LM2 RES      1
EFADR    RES      1
DRWRDVAL RES,FW   1                 STORAGE FOR WORD TO BE PRINTED
ENDOFDMP RES      1                 END OF DUMP FLAG
ERKEYM   RES      1                 ERROR MESSAGE FILE KEY
         BOUND    DW
EXCTRAC  RES      1
         DATA     X'14000009'
EXECINST RES,FW   1                 INSTRUCTIONS EXECUTED HERE
         DATA     X'14000000'       RETURN TO DELTA AFTER EXECUT INST
         DATA     X'14000000'       PLUS 2 RETURN
         DATA     X'14000000'       PLUS 3 RETURN
SYMBFLAG RES      1                 USED FOR SETTING GLOBAL OR INTERNAL
*                                   SYMBOL TABLE IN-CORE-FLAGS
FIRSTIME DATA,FW  -1                FIRST TIME INTO DELTA FLAG
FLDREG   RES      1                 FIELD PRESENCE INDICATORS
NOBREAKS DATA     0                 BREAK INHIBIT FLAG
GOTBREAK DATA     0                 BREAK RECEIVED FLAG
FORKINST DATA     0                 REPLACED BRANCH INSTRUCTION
SEGFLAG  DATA     -1                OVERLAY TRACE FLAG (DEFAULT=NO)
GLBLFLAG DATA     0                 PRESENCE FLAG FOR GLOBAL SYMBOLS
*                                   =0 GLOBAL SYM PAGES RELEASED
*                                   =1 GLOBAL SYM TABLE IN CORE
GO%FLAG  RES      1                 EXECUTION FLAG FOR T BRK RETURN
GST      RES      1                 GLOBAL SYMBOL TABLE SIZE/LOC
GTPGMODE DATA,FW  0                 GET-A-PAGE MODE,SET NBY BACKSLASH
         BOUND    DW
EXCDBRK  EXU      *EXCTRAC          USED TO EXECUTE A LOCATION
         DATA     X'1400000A'       THAT DELTA CANNOT ACCESS
*                                   (SUCH AS IN SHARED LIBRARY)
IAP      RES      1
IA       RES      1
BADR     DATA     0
         DATA     EXCTRAC+1         USED TO CHECK FOR TRANSFER BREAK
*                                   WHEN A PRIVIL INSTR TRAP OCCURS
GTRLPAGE RES      1                 USED IN GET & RELEASE PAGE ROUTINE
HEADBUF  EQU      STRNGBUF+1        BUFFER FOR READING HEAD RECORD
HEX%OFFSET        ;                 MAX OFFSET FOR A VALUE TO BE OUTPUT
         DATA     X'50'             AS SYMB+OFFSET RATHER THAN ABSOLUTE
IBRKEXEC RES,FW   2                 BROKEN INSTRUCTIONS ARE EXECUTED
*                                   HERE.
IBRKMODE DATA,FW  -1                NEG MEANS NOT IN I BREAK MODE
IBRKNUM  DATA,FW  0                 # OF CURRENT I BREAK
INBUF    RES,FW   20                INPUT BUFFER
INTL%SYM%BEGIN    ;                 START ADR OF INTERNAL SYMBOL TABLE
         RES      1
INTLFLAG DATA     0                 PRESENCE FLAG INTERNAL SYMBOL TABLE
*                                   CF. GLBLFLAG FOR VALUE-MEANING
INTPMODE DATA     0                 TRANSFER BREAK MODE FLAG
IST      RES      1                 INTERNAL SYMBOL TABLE SIZE/LOC
K%OUTMODE         ;                 =0,FALSE   =1,TRUE
         DATA     0                 OUTPUT NEAREST CSECT TYPE SYMB +
*                                   OFFSET UNLESS VALUE IS EXACTLY THAT
*                                   OF A SYMBOL
LOC%ONLY DATA     0                 FLAG FOR OUTPUTTING ONLY LOCTION SYM
MESSEXIT DATA,FW  WA(DRINITA)       EXIT AFTER MESSAGE COMES IN
         BOUND    DW
MODINPUT DATA,FW  -1         FLAG INDICATIONG THAT OUTPUT MODE
*                            HAS BEEN SPECIFIED
NENTINTL DATA     0                 # WORDS IN ACTIVE INTL SYMBOL TABLE
NENTSYM  DATA,FW  0                 # OF ENTRIES IN SYMBOL TABLE
NUMBCHAR DATA,FW  0                 # OF CHARACTERS  IN COMMAND LINE
OLDELENT DATA     X'4000'           LAST CONTENTS OF DELENT
DRADMSKA DATA     X'1FFFF'          ADDRESS MASK FOR DISLAY
VFCHAR   DATA     X'C0'             PRINTER FORMAT CHAR - SINGL SPACE
         BOUND    8
OUTBUF   RES      33
OUTCHAR  DATA,FW  0                 POINTS TO NEXT AVAILABLE BYTE IN
*                                   OUTPUT BUFFER
OUTMODE  DATA,FW  0          SPECIFIED OUTPUT MODE
PRINT%OK  DATA    1                 =0, PRINT IF SELECCTED.
*                                   =1, FORCE TO TELETYPE
RSTRTRN  RES,FW   1                 STORAGE FOR RETURN LINK FROM RESTORE
RETRNTYP RES      1                 TEMP FOR RETURN CODE IN TRANSFER
*                                   BREAK PROCESSING
SEMIJ    DATA     1                 PRINTER-TELETYPE OUTPUT SWITCH
SLSHEXIT DATA,FW  MESSAGE           EXIT FROM SLASH ROUTINE
STEPMODE DATA     0
STORFLAG RES      1
STRNGBUF DATA,BT  0                 STRING BUF (FOR MONFIX INTERFACE)
         RES,BT   79                  A LA 'TEXTC'
         BOUND    DW
STWSAVE  RES,FW   2                 TEMPS USED BY STORWORD
SUBSVAL  RES      1
SUM      RES      1                 LINE SUM TO CHECK FOR ZERO LINES
SYMBSIZE RES      1                 ADR OF NENT CELL TO BUMP
*                                   IN PRINTER DUMP
SYM%ADR  RES      1                 ADDRESS OF SYMBOL IN SYMBOL TABLE
SYMBEGIN RES      1                 START LOC GLOBAL SYMBOL TABLE
SYM%BUF  RES      1                 BUFFER ADR FOR READ OF SYM TABLES
SYM%CODE RES      1                 SYMBOL CODE SAVED HERE
*                                   =0, UNDEFINED
*                                   =1, LOCATION
*                                   =2, CONSTANT
SYM%SIZ  RES      1                 BUF SIZE FOR READ OF SYM TABLES
SYM%TYPE RES      1                 TYPE FOR MOST RECENT LOCATION SYMBOL
TCOND    RES,FW   1                 CONTAINS CONDITIONS ON TRAPS
         BOUND    DW
TMP6     RES,FW   1
TOUT     RES,FW   1                 TEMP
TRACLOOP DATA     0                 0=IGNORE BDR/BIR IN TRACE
*                                   1=TRACE BDR/BIR
TRACMODE DATA     0                 0=JUMP-STOP MODE
*                                   1=JUMP-TRACE MODE
DBRKADR  DATA     0                 ADDRESS OF INSTR CAUSING D-BRK
         BOUND    8
PTC      DATA     0,0
TRACNENT DATA     0                 # OF ENTRIES IN SPECIAL ACTION TABLE
TRACSPEC EQU      %                 SPECIAL ACTION TABLE FOR
         DO       8                 TRANSFER MODE
         DATA     0
         FIN
TRAPINST RES      1                 'RESTORE' STORES TRAPPING INSTR
TRAPTEMP RES      1                 AND TRAPPING ADDRESS
*                                   HERE IN CASE ANALYSIS IN I, T, OR X
*                                   BREAK RETURNS IS REQUIRED
TRAPMESS RES,FW   1
TYPE     RES      1
WHCHSRCH RES      1                 POINTS TO VALUE OR SYMBOL SEARCH RTN
         BOUND    DW
*
         PAGE
*
*     CONTEXT FOR F.P. OUTPUT ROUTINES
*
         BOUND    8
ADLOC    DATA     0,0               FIRST WORD MUST BE ZERO
CENTRAL1 DATA     0                 HIGH ORDER WORD OF FLTG NUMBER
CENTRAL2 DATA     0                 LOW  ORDER WORD OF FLTG NUMBER
ETEMP    RES      1                 EXPONENT IN REAL
DCOUNT   RES      1                 TOTAL DIGITS TO PRINT IN REAL
EXPCHAR  RES      1                 EXPONENT CHAR
FLOAT2ND RES      1                 2ND WORD OF LONG F.P. VALUE
PWR10    RES      1                 TEMP IN REAL
TEMP     RES      1                 TEMP IN REAL
         PAGE
************************************************************************
*        DATA BREAKPOINT TABLE
************************************************************************
         BOUND    FW
DBRKLOC  EQU      %
         DO       8
         DATA,FW  0
         FIN
DBRKVAL  RES,FW   8
DBRKMASK RES      8
DBRKCOND RES      2
DBRKNENT DATA     0
TRACETBL RES      1
*
*        DATAIBREAKPOINT TABLES AND INSTRUCTION BREAKPONT TABLES
*        MUST BE IN THE SAME ORDER DUE TO COMMON CODE FOR SETUP
*
BASEDISP DATA,2  0,0,0,1,2,8,8,8  THIS TABLE DEFINES SPACING OF THE TABLES
         PAGE
************************************************************************
*        INSTRUCTION BREAKPOINT TABLE                                  *
************************************************************************
         BOUND    FW
IBRKLOC  EQU      %
         DO       8
         DATA,FW  0
         FIN
IBRKDPLY EQU     %
         RES      8
IBRKVAL  RES      8
IBRKCOND RES      2
IBRKNENT DATA    0
ITRCTBL  RES      1
IBRKINST RES,FW   8
IBRKPRCD RES,FW   8
IBRKOVL  DATA     0,0               8 BYTES FOR OVERLAY NOS.
TREEBUF  RES      4                 TREE RECORD BUFFER
PCHD     RES      512-%+VDUC        REST OF PAGE FOR PATCH AAREA
END%DATA EQU      %                 END OF DELTA'S CONTEXT
************************************************************************
         USECT    DELTA%PROCEDURE   PUT LITERALS IN PROCEDURE CSECT
         END      T:DBRK

