*M*      XDLT     EXECUTIVE DELTA - MONITOR DEBUGGING AND PATCHING
*P*  NAME:  XDLT
*P*
*P*  PURPOSE:  XDELTA PROVIDES FOR TWO BASIC FUNCTIONS, DURING
*P*            THE BOOT PROCESS IT READS THE PATCH CARDS AND APPLIES THE
*P*            PATCHES TO THE MONITOR AND OVERLAYS, AND AFTER
*P*            BOOTING IT PROVIDES AN EXECUTIVE LEVEL DEBUGGER
*P*            SIMILAR IN OPERATION TO THE USER DELTA PROGRAM.
*P*
*P*  DESCRIPTION:
         DEF      XDLT:             FOR PATCHING
XDLT:    RES
XDLT     EQU      %
UTSPROC SET    0
S69PROC SET    1
DISCBPROC  SET    1
MONSIM   SET      0
VVM      SET      0
         SYSTEM UTS
         SYSTEM   SIG7FDP                                               00001000
         REF      :BIG,:BSIG,:B560
BFLAG    EQU      :BIG              SAVE OLD VALUE OF :BIG
B9FLAG   EQU      :BSIG
B560FLAG EQU      :B560             SAVE OLD VALUE OF :B560
         OPEN     :BIG,:B9,:B560
         DO       MONSIM
         REF      M:UC,M:LO
:BIG     EQU      0
:B9      EQU      0
:B560    EQU      0
         ELSE
:BIG     EQU      BFLAG
:B9      EQU      B9FLAG
:B560    EQU      B560FLAG
         FIN
         TITLE    'XDELTA 10/1/70'
ORD8     COM,8,24 AF(1),AF(2)
         OPEN     SIO,TIO,TDV,HIO,WD
SIO      CNAME    X'4C'
TIO      CNAME    X'4D'
TDV      CNAME    X'4E'
HIO      CNAME    X'4F'
WD       CNAME    X'6D'
         PROC
LF       EQU      %
         DO       MONSIM
         DO       NAME=X'4E'|NAME=X'4D'
         LI,CF(2) 0
         ELSE
         LCI      0
         FIN
         ELSE
         GEN,1,7,4,3,17 AFA(1),NAME,CF(2),AF(2),AF(1)
         FIN
         PEND
         REF      JX:CMAP
         REF      JOVVPA
         DO       MONSIM
         ELSE
         REF      LKIMG
         REF      MPATCH,MX:PPUT
         REF      OCNDD
         REF      BOOTFLG
         REF      MASKS
         REF      LEE20
         REF      IBRKEXEC
         REF      EXECINST,EXECPSD
         FIN
         REF      JITLOC
         REF      PPSTART
         REF      DCT24
         REF      Y001
         REF      DCT16
M14      EQU      MASKS+14
         PAGE
:CDW     CNAME
         PROC
         BOUND    8
LF       GEN,8,24,8,24  AF(1),;     ORDER CODE
                        AF(2),;     ADDRESS
                        AF(3),;     FLAGS
                        AF(4)       SIZE
         PEND
*
:IDCW    CNAME
         PROC
         BOUND    8
LF       GEN,6,6,6,3,1,1,1,6,34  CF(2),;  DEVICE COMMAND
                                     0,;  DEVICE ADDRESS
                                      ,;  MBZ
                                     7,;  MUST BE ALL ONES
                                     0,;  MASK FIELD
                                 AF(1),;  CONTINUE BIT
                                     0,;  MARK BIT
                                 AF(2),;  CHANNEL INSTRUCTION
                                     0    MBZ
         PEND
*
CC       EQU      X'22'             COMMAND CHAIN FLAGS
NCC      EQU      X'02'             NO COMMAND CHAINING
RD       EQU      X'15'             MPC READ ORDER
SK       EQU      X'1C'             MPC SEEK ORDER
         PAGE
*
*********************************************************************
*
*                   EXEC DELTA ENTRY POINTS
*
*********************************************************************
*
         B        LEES%WATERING%HOLE
         B        PACHSTRT          BOOT PATCH ENTRY POINT
*
*
XDMAPDISP EQU     X'EC00'/X'800'    WORD DISPLACEMENT OF XDELTA INTO
*                                   MEMORY MAP IMAGE
*                                   FOR BYTE TYPE MEMORY MAPS
NEXTSYM  DATA     SYMBOLS
LASTSYM  DATA     SYMBOLS
PACHSYMSZ DATA    0                 SIZE OF PATCHING SYMBOLS
*                                                                       00002000
* GIVE EACH ALPHABETIC & NUMERIC CHARACTER ITS EBCDIC VALUE             00003000
* NOTE : ALL SYMBOLS ARE LOCAL TO AVOID CONFLICTS LATER                 00004000
*                                                                       00005000
         LOCAL    A,B,C,D,E,F,G,H,I                                     00006000
         LOCAL    J,K,M,N,O,P,Q,R
         LOCAL    S,T,U,V,W,X,Y,Z                                       00008000
*                                                                       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
         PAGE                                                           00037000
*                                                                       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
#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
*                                                                       00058000
* SPECIAL SYMBOLS USED IN GENERATING THE SYMBOL TABLE                   00059000
*                                                                       00060000
#%       EQU      '%'                                                   00061000
#S:      EQU      ';'                                                   00062000
*                                                                       00063000
*
*
*                                                                       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
*
*
*                                                                       01929000
* ROUTINE TO HANDLE AN INPUT ERROR                                      01930000
*                                                                       01931000
DRERR    LW,0     QUES
         BAL,1    DRPRTSML          PRINT MESSAGE FOR THE USER          01933000
         LW,3     CHARINDX          OUTPUT CHARACTER NUMBER WHEN
         LI,0     0                 RESET IT
         XW,0     WHERETO           IF PATCHING, ADJUST N
         BEZ      %+4
         STW,1    SEMIJ             KEEP OUTPUT TO TTY UNTIL FIXPATC
         AW,3     CARDINDX          +END OF EXPREXXION
         SW,3     NUMBCHAR          -ITS SIZE
         BAL,4    DRPRTINT          ERROR OCCURRED
         STW,4    BRKTIME           FORCE OUTPUT ON OC
*                                                                       01934000
DRVALERR EQU      DRERR                                                 01935000
DRERROR  EQU      DRERR                                                 01936000
*                                                                       01955000
* DIFFERENT INITIALIZATION STEPS BEFORE STARTING THE SCANNER            01956000
*                                                                       01957000
*                                                                       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
         STW,7    DROPENSW          SET NO OPEN REGISTER
*
*
*
*        INPUT A COMPLETE MESSAGE, I.E. INPUT UNTIL
*        A BREAK CHARACTER IS ENCOUNTERED
*        BREAK CHARACTERS ARE; CR,LF,TAB,/,=,UP ARROW
*
PMESS    LI,6     0                 INITIALIZE INPUT BUFFER POINTER
         STW,6    CHARINDX
INPUT    BAL,4    TYPIN      GET A BYTE AND
         CI,0     X'7C'             CHECK FOR RUBOUT CHAR
         BNE      %+4               BRANCH IF NO
         AI,6     -1                BACK CHAR POINTER UP BY ONE
         BLZ      DRINIT            TOO MANY
         B        INPUT             GET NEXT
         STB,0    INBUF,6    STORE IT IN INPUT BUFFER
         AI,6     1          INCREMENT BYTE COUNTER
         CI,0     K80        CHECK TO SEE IF CHARACTER IS A LETTER OR
         BCS,4    INPUT      NUMBER. YES, GET NEXT CHARACTER
         CB,0     BRKCHAR           QUESTION MARK INPUT?
         BE       DRINIT            YES
         LI,7     7                 NO,CHECK TO SEE IF A BREAK
TEST1    CB,0     BRKCHAR,7  CHARACTER WAS INPUT
         BE       BREAK      YES, GOTO BREAK
         BDR,7    TEST1
         B        INPUT      NO, GET NEXT CHARACTER
BREAK    STW,6    NUMBCHAR   SAVE NUMBER OF CHARACTERS IN THIS
         B        MESSAGE           MESSAGE, GO DELETE LEADING BLANKS
*                                   AND GO TO INITIALIZING ENTRY
*
*
*        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
COMEND   BAL,4    INPTCHAR          GET NEXT CHARACTER
         CI,0     #SPACE            IS IT A COMMAND TERMINATOR
         BE       MESSAGE           YES. GET NEXT COMMAND
         CI,0     #CRETRN
         BE       MESSAGE
         B        *14               RETURN
*                                                                       01967000
* RESET COUNTS AND FLAGS - USED FOR STARTING A NEW EXPRESSION           01968000
*                                                                       01969000
DRINITB  LI,5     0                 INITIALIZE FIELD NUMBER             01970000
         INT,9    DELSTK+1          EMPTY STACK
         LCW,9    9
         MSP,9    DELSTK
         SD,8     8                 RESET FLAGS
         SD,10    10                ELEMENT AND COMMA COUNT
         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    DRUPRLIM          DEFALUT SLASH TO ONE LOC
         LD,6     DRSCNSET          INITIALIZE THE SCANNER              01979000
*
*
*                                                                       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
         BGZ      %+2               IS IT?                              01989000
         B        DRINPEBD          YES                                 01990000
         CI,0     K80               CHECK CHARACTER TYPE                01991000
         BCS,4    DRBUILD,7         IS IT A LETTER OR DIGIT?            01992000
         CLM,0    DRALPHAS          NO - KEEP CHECKING                  01993000
         BCR,9    DRBUILD,7         :,#, AT SIGN
         CI,0     #DOLLAR           NOT ONE OF THOSE - CHECK DOLLAR SIGN01995000
         BE       DRBUILD,7         IS THAT WHAT IT IS?                 01996000
         CI,8     DRDEFMOD          NO - CHECK FOR SYMBOL DEFINE MODE   01996200
         BCR,4    %+2               ARE WE IN THAT MODE?                01996400
         B        DRDEFCHK          YES - GO TO PROPER ROUTINE          01996600
         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 ADDRESS OF PROPER ROUTINE       02000000
         AND,4    M16
         CI,1     DRVAL1            CHECK INDEX                         02001000
         BL       DREVAL            SHOULD WE EVALUATE?                 02002000
         B        0,4               NO - GO PROCESS INPUT               02003000
*                                                                       02004000
*
*
*                                                                       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
         BGE      DRINPINT          ALREADY 8
         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
         AI,6     0                 TEST SIZE OF SYMBOL                 02025000
         B        DRSYMBLX          GO FINISH CHECKING                  02026000
DRCOMPIT MI,3     10                MULTIPLY CURRENT VALUE BY 10        02027000
         BCS,4    DRVALERR          DID AN OVERFLOW OCCUR?              02028000
         AW,3     0                 NO                                  02029000
         BCR,4    DRSCAN1           IS TOTAL VALUE CORRECT?             02030000
         B        DRVALERR          NO - JUST HAD AN OVERFLOW           02031000
*                                                                       02032000
*
*
*                                                                       02034000
* ROUTINE TO HANDLE SYMBOLIC INPUT                                      02035000
*                                                                       02036000
DRINPSYM STB,0    DRCHRBFX,6        PUT NEW CHARACTER IN BUFFER         02037000
         AI,6     1                 INCREMENT CHARACTER INDEX           02038000
DRSYMBLX BLEZ     DRSCAN1           IS THE SYMBOL TOO LONG?             02039000
         B        DRVALERR          YES                                 02040000
*                                                                       02047000
* 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  AI,6     1                 MAX 8 CHARS
         BGZ      DRVALERR          TOO BIG
         SLS,3    4
         AW,3     0                 ADD NEW CHARACTER                   02058000
         B        DRSCAN1           GO GET MORE                         02059000
*                                                                       02060000
*
*
*                                                                       02062000
* 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
*
*
*                                                                       02104000
* SUBROUTINE TO FIND TYPE OF PRINTOUT                                   02105000
*   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
CHNGMODE EQU      %
DRGETTYP LI,2     DRTYPLST          SET UP INDEX FOR LOOP               02115000
DRGETSPC BAL,4    INPTCHAR    GET OUTPUT MODE CHAR
         MTW,2    DOTCHAR           ALLOWS '.(F/'
DRGETMMO CB,0     DRTYPCHR,2        CHECK ONE ENTRY                     02118000
         BNE      DRGETAMO          IS IT THIS ONE?                     02119000
         AI,2     -1                CONVT TO MODE CODE
         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
*
*
*                                                                       02127000
* ROUTINE TO COMPUTE LIMITS                                             02128000
*   OUTPUT                                                              02129000
*     R2 : LOWER LIMIT                                                  02130000
*     R3 : UPPER LIMIT                                                  02131000
*                                                                       02132000
DRGETLIM LD,2     DREXPRS           GET FIELDS0 AND 1
         AW,3     DREXPRS+3         R3 = FIELD1+FIELD3                  02137000
         CI,8     DRFD1BIT          CHECK FIELD 1 BIT                   02138000
         BCS,4    DRGTLIMG          DOES FIELD 1 EXIST?                 02139000
         AW,2     DREXPRS+2         NO - ADD FIELD 2 TO LOWER LIMIT     02140000
DRGETLMX AND,2    DRADMSKS          EXTRACT ADDRESS FIELD FROM LIMITS   02141000
         AND,3    DRADMSKS                                              02142000
         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                                                           02147000
*                                                                       02148000
* EVALUATION ROUTINE                                                    02149000
*                                                                       02150000
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
         XW,1     DRLSTOPR          YES - SAVE OPERATOR FOR NEXT TIME
         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 LD,14    DRCHRBUF          GET EBCDIC VALUE OF SYMBOL          02157000
         STW,4    DREVLRTN          SAVE RETURN INDEX                   02158000
         CI,6     -4                WAS IT TOO BIG TO BE A MNEMONIC
         BG       CYMBALS           YES, GO SEARCH TAGS & CONSTANTS
         BAL,4    SRCHCODE          SEARCH MNEMONICS
         CI,0     0                 FIND IT
         BNE      DREVLXX           YES.
         CW,14    SPATCH            IS IT @
         BE       DREVLSYM1         YES, GET VALUE
         CW,14    DPATCH            IS IT @@
         BNE      CYMBALS
         LI,2     1                 YES, MAKE DELPACHVAL EVEN
         CW,2     DELPACHVAL
         BAZ      %+2
         MTW,1    DELPACHVAL
DREVLSYM1 LW,2    DELPACHVAL        GET VALUE
         B        DREVLXX           AND FINISH UP
SPATCH   DATA,1   '@',,,
DPATCH   DATA,1   '@','@',,
DELPACHVAL EQU   MPATCH    USE FIRST LOCATION FOR POINTER
CYMBALS  LI,0     FINDSYM           SET TO SEARCH ON SYMBOLS
         STW,0    WHCHSRCH
         BAL,4    SRCHSYMB          SEARCH ALL SYMBOL TABLES
         CI,0     0                 FIND IT
         BNE      %+5               YES, CONTINUE EVALUATION
         LW,4     WHERETO           IF ACCEPTING BAD SYMBOLS
         BGEZ     DRERR             (NO)
         STW,0    DREXPRS           SET VALUE TO 0 AND RETURN
         B        DREVLXIT+1
         LW,2     13                VALUE INTO R2
DREVLXX  LW,4     DREVLRTN          RESTORE RETURN INDEX                02162000
         B        DREVLDNE          GO FINISH UP                        02163000
*                                                                       02164000
* COME HERE IF SYMBOL IS UNDEFINED                                      02165000
*                                                                       02166000
         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 EQU      %
         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
         BLE      SETIMMED          YES, SET FLAG (OR TWO)
         CI,1     SHFTINDX          IS IT  A SHIFT TYPE INSTRUCTION
         BL       FNSHUP            NO
         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
         AI,8     X'400'            SPECIAL SHIFT FLAG
         B        FNSHUP+1
SETIMMED BL       %+2               SET LCI FLAG IF ITS THAT
         AI,8     KLCIBIT
         OR,8     DRSOPRFL          SET 20 BIT ADDR FLAG
FNSHUP   SLS,2    16                POSITION OP CODE
         LI,0     4                 SET FOUND FLAG
         B        0,4
         PAGE                                                           02209000
*                                                                       02210000
* ROUTINE TO DO A FINAL EVALUATION AND CREATE A FULL WORD QUANTITY      02211000
*                                                                       02212000
DREVALIT LW,3     DREXPRS           VALUE OF FIELD 0                    02213000
         LW,14    DREXPRS+1         VALUE OF FIELD 1
         LI,15    KF                REG MASK(4 BITS)
         SLD,14   20                POSITION PROPERPY
         CW,8     DRFLDBIT+1        WAS THERE ONE
         BAZ      %+2
         STS,14   3                 YES, STKCK IT IN
         CI,5     1                 CHECK PRESENCE OF ADDRESS FIELD     02218000
         BLE      0,4               IS IT THERE?                        02219000
DREVLITN LI,2     KM3               MASK FOR EXTRACTING INDEX NUMBER
         AND,2    DREXPRS+3         EXTRACT INDEX : LOWER 3 BITS        02253000
         SLS,2    17                MOVE INTO PROPER POSITION           02254000
         OR,3     2                 MERGE INTO FINAL VALUE              02255000
SPCHK2   CI,8     X'400'            SPECIAL SHIFT OP
         BCR,4    SPCHK3            NO
         LI,2     X'7F'             YES. GET SPECIAL MASK
         B        DREVLITA          SKIP INDIRECT CHECK
SPCHK3   CI,8     KASTBIT           IS INDIRECT FLAG SET
         BCR,4    SPCHK4            CHECK FOR 20 BIT ADDRESS
         AW,3     DRBIT0            YES. SET INDIRECT BIT IN WORD
         B        DREVLITA-1        GET MASK AND FINISH UP
SPCHK4   CI,8     DRSOPRBT          CHECK FOR 20 BIT ADDRESS FIELD
         BCR,4    DREVLITA-1        NO
         LW,2     M20               YES. GET 20 BIT MASK
         B        %+2
         LI,2     KADMSKM           MASK FOR 17 BIT ADDRESS FIELD       02256000
DREVLITA AND,2    DREXPRS+2         EXTRACT DESIRED FIELD SIZE          02257000
         CI,8     KLCIBIT           IF LCI, SHIFT ADDR TO PROPER
         BAZ      DREVLITX          POSITION
         SLS,2    4
DREVLITX AW,3     2                 NO - MERGE ADDRESS INTO FINAL VALUE
         B        0,4               RETURN                              02263000
*                                                                       02264000
         PAGE                                                           02265000
*                                                                       02273000
* HEXADECIMAL PRINT ROUTINE                                             02274000
*                                                                       02275000
DRPRTHXA LI,0      #PERIOD
         STW,4    TOUT
         BAL,4    TYPOUT
         LI,1     8                 MAX # HEX DIGITS
         LC       3                 SHIFT UNTIL DIGIT APPEARS
         BCS,15   %+3               GOT ONE
         SLS,3    4
         BDR,1    %-3               NO, TRY THW NEXT
DRPRTHXN LI,2     0                 RESET UPPER REGISTER                02286000
         SLD,2    4                 MOVE INTHE NEXT ONE
DRPRTHXR LB,0     DRDIGITS,2        GET EBCDIC EQUIVALENT               02288000
         BAL,4    TYPOUT
         BDR,1    DRPRTHXN          DO AT LEAST TILL END OF WORD
         B         *TOUT            NO, RETURN
*                                                                       02293000
*                                                                       02294000
* INTEGER PRINT ROUTINE                                                 02295000
*                                                                       02296000
DRPRTINT LI,1     0                 SET DIGIT COUNT=0                   02297000
         STW,4    TOUT              SAVE RETURN
         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
         LI,1     4                 SET UP INDEX FOR LOOP               02318000
         SCS,0    8                 PUT DESIRED CHARACTER IN LOWER 8 BIT02319000
         STW,4    TOUT
         BAL,4    TYPOUT
         LW,4     TOUT
         BDR,1    %-4
         B        0,4               YES - RETURN                        02322000
*                                                                       02323000
*
*
************************************************************************
*                                                                      *
*        ROUTINE FOR OUTPUT OF A SYMBOL                                *
*        THERE ARE TWO ENTRANCES                                       *
*        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        %+4
DRSYMPT  LW,6     *9,3              GET 1ST FOUR CHARACTERS
         AI,3     1
         LW,7     *9,3              GET 2ND FOUR CHARACTERS
         STD,6    DRTEMPD1          SAVE SYMBOL
         STW,4    TOUT
         LI,1     -8                MAXIMUM SIZE OF SYMBOL              02337000
DRSYMPTM LB,0     DRTEMPD1+2,1      GET A CHARACTER                     02338000
         BEZ      *TOUT             IS ZERO - RETURN
DRSYMPTX BAL,4    TYPOUT
         BIR,1    DRSYMPTM          ANY CHARACTERS LEFT TO PRINT        02342000
         B        *TOUT
*                                                                       02344000
*
*
*                                                                       02346000
* 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
         AND,2    M3
         B        DRPRTVEC,2        GET PROPER ROUTINE
DRPTEXPR STW,4    DRPTEXP#          SAVE RETURN ADDRESS                 02362000
         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
         BCR,4    DRPTEXPI          ARE ANT OF THOSE BITS SET?          02365000
         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
         BCS,4   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
         CI,8     DRSOPRBT          CHECK FOR SPECIAL ADDRESS - 20 BIT  02385000
         BCS,4    %+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 ADDRESS PRINT MODE      02390500
         BAL,4    DRPRTADR          PRINT ADDRESS
DRPTEXPD LW,4     DRPTEXP#          RESTORE RETURN ADDRESS              02397000
         CI,8     DRSOPRBT          CHECK FOR SPECIAL ADDRESS - 20 BIT  02397100
         BCR,4    DRPTEXPT          IS IT?                              02397200
         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
         STW,4    TOUT
         BAL,4    TYPOUT
         LW,4     TOUT
         B        DRPRTINT          PRINT A DECIMAL NUMBER AND RETURN   02402000
*                                                                       02407000
* THIS CODE HANDLES THE SPECIAL CASES (BYTE,IMMEDIATE,BRANCH,SHIFT)     02408000
*                                                                       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
         LW,6     BYTOP,1           GET MNEMONIC
SPECFLAG OR,8     DRSOPRFL          SPECIAL OP CODE FLAG
         B        DRMNEMPT          PRINT MNEMONIC
BCRINST  LI,6     BCROP             BASE ADDRESS OF BCR INSTRUCTIONS
         B        %+2
BCSINST  LI,6     BCSOP             BASE OF BCS INSTRUCTIONS
         CI,2     4                 IS IT 0,1,2,3,4 TYPE BRANCH
         BG       PRNTSYM           NO, GO PRINT BCR OR BCS
         AI,6     1
NOREGPRT AW,6     2                 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    DRADFLD           CLEAR ALL BUT ADDRESS PORTION
         CI,0     K600              LEGAL SHIFT TYPE
         BGE      PRNTSYM           NO, PRINT  AS ABOVE
         AI,6     1                 INCREMENT INTO SPECIAL CODES
         LI,1     0                 CLEAR LOWER FOR SHIFTING
         SLD,0    -8                SHIFT COUNT IN R1
         SCS,1    8
         STW,1    DRWRDVAL          SAVE COUNT FOR OUTPUT
         AW,6     0                 ADD TYPE TO BASE FOR CORRECT MNEM.
         B        PRNTSYM           PRINT IT.
LCFIINST LI,6     LCFIOP            BASE OF LCFI INSTS
         OR,8     DRSOPRFL          SET IMMEDIATE FLAG
         B        %+2
LCFINST  LI,6     LCFOP             BASE OF LCF INSTS
         CI,2     3                 REG SUPPRESS
         BG       PRNTSYM           NO
         BAZ      BCSINST           YES BUT PRNT NOP
         BL       NOREGPRT          YES DO LC(I) OR LF(I)
         BE       NOREGPRT+1        YES DO LCFI OR LCF
*
*
*                                                                       02446000
* 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 AI,2     0                 CHECK ON TYPE OF PRINT OUT DESIRED  02453000
         BGZ      DRPRTHXA          IS IT SYMBOLIC
         CI,3     100               YES. CHECK VALUE
         CI,3     K100              YES. CHECL VALUE
         BL       DRPRTHXA          IS TIT LESS THAN 100
         STW,4    DRPRTSAV          SAVE RETURN ADDRESS
         LI,2     K100              LOWER LIMIT
         STD,2    DRSRCHLM          SAVE LIMITS FOR USE IN COMPARISONS  02459000
         LI,0     FINDVAL           SET UP TO SEARCH ON VALUE
         STW,0    WHCHSRCH
         BAL,4    DEFSYMB           SEARCH ALL BUT SPECIAL SYMBOLS
         LW,2     DRSRCHLM+1        YES - GET VALUE OF UPPER LIMIT      02474000
         SW,2     DRSRCHLM          FIND DELTA OF LIMITS                02475000
         CW,2     DROFFSET          CHECK DIFFERENCE
         BL       DRPRTAGL          IS IT TOO BIG?                      02477000
         LW,3     DRSRCHLM+1        YES - GET ORIGINAL VALUE            02478000
         B        DRPRTAGH          GO PRINT AS CONSTANT                02480000
DRPRTAGL LW,3     DRLOWPNT          GET POINTER TO CORRECT SYMBOL       02481000
         LW,9     SYMTADR           GET START ADR OF CORRECT SYM TAB
         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
*
*
************************************************************************
*                                                                      *
*        THIS CODE INITIALIZES AND SEARCHES IN PRIORITY SERIES THE     *
*        VARIOUS SYMBOLS TABLES IN EXEC DELTA.  THE SEARCH CAN BE      *
*        EITHER VALUE TO SYMBOL OR SYMBOL TO VALUE DEPENDING ON        *
*        WHICH SEARCH ROUTINE ITEM 'WHCHSRCH' POINTS TO.  SEARCHING    *
*        SYMBOL TO VALUE, TABLES CAN BE SEARCHED SEPARATELY BY SET-    *
*        TING 'WHCHSRCH' TO POINT TO 'FINDSYM'-1.                      *
*        THE ORDER OF PRIORITY OF SEARCH IS                            *
*        SPECIAL SYMBOLS            EG., %,;M,;1, ETC.                 *
*        DEFINED SYMBOLS            I.E. SYMBOLS ADDED VIA ! OR < >    *
*        ROOT SYMBOLS               GLOBAL ROOT SYMBOLS (DEFS)         *
*        SEGMENT SYMBOLS            GLOBAL SEGMENT SYNBOLS             *
*        R0       # OF ENTRIES IN CURRENT TABLE                        *
*       (R1)      SEGMENT SEARCH SET-UP ONLY                           *
*       (R2)      SEGMENT SEARCH SET-UP ONLY                           *
*       (R3)      USED IN SEARCH ROUTINES                              *
*        R4       LINK                                                 *
*        R9       START ADDRESS OF CURRENT TABLE                       *
*        R12      SERIES LINK                                          *
*       (R13)     USED IN SEARCH ROUTINES (CF. BELOW)                  *
*       (R14)     CONTAINS SYMBOL IF GOING TO 'FINDSYM'                *
*       (R15)     CONTAINS SYMBOL IF GOING TO 'FINDSYM'                *
*                                                                      *
*        THIS CODE IS INVOKED AT THE FOLLOWING POINTS OR FUNCTIONS     *
*        DREVAL      EVALUATION OF A SYMBOL IN THE COMMAND SCAN        *
*        DRPRTADR    SYMBOLIC PRINTING OF AN ADDRESS VALUE             *
*        DREXCLAM,   LOCATION OR CONSTANT SYMBOL DEFINITION            *
*        DRDEFCHK                                                      *
*        DRSEMIK     ;K  KILL A SYMBOL                                 *
*                                                                      *
************************************************************************
SRCHSYMB EQU      %
SPECSYMB LI,0     NENTSPEC          # ENTRIES IN SPECIAL SYM TAB
         LI,9     SPECSYM           START ADDR
         BAL,12   *WHCHSRCH         GO TO SPECIFIED SEARCH ROUTINE
DEFSYMB  EQU      %
         LW,0     NEXTSYM           ADDRESS OF END OF TABLE
         LI,9     SYMBOLS           ADDRESS OF BEGINNING
         AI,0     -SYMBOLS          SIZE
         BAL,12   *WHCHSRCH         LOOK ST EM
         LI,9     JITLOC+8          ADDRESS OF OVERLAY SYMBOLS
         REF      TSTACK
         LW,0     PACHSYMSZ         IF THERE ARE ANY
         BEZ      %+2
         BAL,12   *WHCHSRCH         GO TO SPECIFIED SEARCH ROUTINE
         B        0,4               NOT FOUND RETURN
*
*
************************************************************************
*                                                                      *
*        THIS CODE SEARCHES THE SYMBOL TABLES FOR THE SYMBOL CON-      *
*        TAINED IN R14 AND R15.                                        *
*        IF NOT FOUND, R11=0 AND RETURN IS THRU R12, I.E. USUALLY      *
*           BACK TO SERIES OF SYMBOL TABLE SEARCHES IN 'SRCHSYMB'.     *
*        IF FOUND AND                                                  *
*             DEFINED               R11=2 AND VALUE IN R13             *
*             UNDEFINED             R11=1 AND LINK TO 1ST USE OF SYMBOL*
*                                   IN R13 (IF APPLICABLE)             *
*                                                                      *
************************************************************************
         LW,12    4                 SPECIAL ENTRANCE FOR SEARCHING
*                                   ONE SYMBOL TABLE AT A TIME
FINDSYM  LI,3     1
STRTSRCH CW,14    *9,3              COMPARE 1ST CHARACTERS
         BNE      NOTIT             NO MATCH
         AI,3     1                 1ST MATCH, CHECK REMAINDER
         CW,15    *9,3
         BNE NOTIT-1                NO MATCH
         AI,3     -2                FOUND
         LW,13    *9,3              VALUE TO R13
         LI,0     2                 FOUND & DEFINED FLAG
         B        0,4               RETURN TO CALLER
         AI,3     -1                ADJUST INDEX
NOTIT    AI,3     3                 BUMP INDEX
         CW,3     0                 DONE
         BL       STRTSRCH          NO
         LI,0     0                 YES, SET NOT FOUND FLAG
         B        *12               RETURN TO SERIES
*
*
************************************************************************
*                                                                      *
*        THIS CODE SEARCHES THE SPECIFIED SYMBOL TABLE FOR THE         *
*        VALUE EQUAL TO OR WITHIN THE LIMITS SPECIFIED IN DRSRCHLM.    *
*        IF EQUAL    PRINT SYMBOL AND RETURN TO THE POINT FROM WHICH   *
*                    'SRCHSYMB' WAS ENTERED.                           *
*        IF UNEQUAL BUT WITHIN LIMITS                                  *
*                    STORE NEW VALUE AS UPPER LIMIT AND CONTINUE       *
*                    SEARCHING.                                        *
*                                                                      *
************************************************************************
FINDVAL  LI,3     0
TAKALOOK LW,15    *9,3              GET VALUE FROM SYM TAB
         AI,3     1                 ADJUST TO POINT TO SYMBOL
         CLM,15   DRSRCHLM          COMPARE WITHIN LIMITS
         BCS,9    NXCHK             NOT IN RANGE
         BCR,12   GOTASYM           EQUAL
         STW,3    DRLOWPNT          SAVE INDEX TO NEW LIMIT
         STW,9    SYMTADR           SAVE START ADR OF SYM TAB
         STW,15   DRSRCHLM          SAVE NEW LIMIT VALUE
NXCHK    AI,3     2                 BUMP INDEX
         CW,3     0                 DONE
         BL       TAKALOOK          NO
         B        *12               RETURN
GOTASYM  LW,4     DRPRTSAV          GET RETURN ADR FROM DRPRTADR
         B        DRSYMPT           GO PRINT SYMBOL
*
*
************************************************************************
*                                                                      *
*        THIS ROUTINE ADDS AN ENTRY TO THE BOTTOM OF THE SYMBOL TABLE  *
*        TABLE.  IN THE EXECUTIVE VERSION OF DELTA THE STRUCTURE       *
*        OF THE SYMBOL TABLE IS AS FOLLOWS:                            *
*        SYMBOLS ARE ADDED ONLY TO SYMBOL TABLE IN DELTA, NOT TO       *
*        MONITOR TABLES                                                *
*                                                                      *
************************************************************************
*                                                                       02541000
*   INPUT                                                               02543000
*     R12-R15 : ENTRY TO BE PUT INTO THE TABLE                          02544000
*   LINK : R4                                                           02547000
*                                                                       02548000
DRSYMAPD EQU      %
         LW,12    NEXTSYM           IS THERE ROOM
         CW,12    LASTSYM
         BLE      SYMFITS
         LI,1     %+3
         BAL,4    DLMSG
         B        DRERR
         TEXTC    'SYMBOL TABLE FULL'
SYMFITS  LCI      3
         STM,13   *NEXTSYM          STORE ENTRY
         MTW,3    NEXTSYM           COUNT IT
         B        0,4               RETURN                              02566000
*                                                                       02567000
*
*
*                                                                       02638020
* ROUTINE TO CLOSE AN OPEN REGISTER                                     02638030
*                                                                       02638040
DRCLOSE  EQU      %
         AI,10    0                 CHECK ELEMENT COUNT                 02638062
         BEZ      0,4               WAS ANYTHING TYPED?                 02638064
         LW,0     DROPENSW          CHECK TO SEE IF A CELL IS OPEN
         BNEZ     DRERR             NO, PROBLE ERROR
         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,2     DR#DSIGN          GET LOCATION OF OPEN REGISTER
         CI,2     15                IS OPEN CELL A GENERAL REGISTER
         BG       %+3               NO
         STW,3    SAVREGS,2         YES. STORE VALUE IN TEMP STACK
         B        %+3               DONT RECORD THIS PATCH
         BAL,11   RCORDPCH          RECORD IT
         STW,3    0,2               PUT NEW VALUE IN MEMORY
         B        *DRCLSRTN         RETURN
************************************************************************
*                                                                      *
*        THIS ROUTINE RECORDS THE ADDRESS OF ALL ON-LINE PATCHES IN    *
*        THE WRAP-AROUND BUFFER 'PATCH'. THE PATCH ADDRESSES AND       *
*        THEIR CONTENTS ARE DISPLAYED BY ISSUING A SEMI E COMMAND      *
*                                                                      *
************************************************************************
RCORDPCH EQU      %
         CI,2     HIGHPACH          ABOVE HIGH PATCGH NOT RECORDED
         BGE      *11               EXIT
         AI,2     -X'8000'          SIGN EXTEND (COMPLEMENTED)
         LW,7     PTCHINDX          DONT PUT SAME ADDR IN TWICE
         CH,2     PATCH+32,7
         BE       RPCH10
         BIR,7    %-2
         MTW,-1   PTCHINDX
         LW,1     PTCHINDX
*
         STH,2    PATCH+32,1
         CI,1     -64               IS BUFFER FULL
         BLE      RPCH20            YES, DUMP AND DEPART
*
RPCH10   AI,2     X'8000'           RESTORE VALUE
         B        *11               RETURN
*
RPCH20   EQU      %
         STW,7    PTCHINDX          SET FLUSH FLAG
         LCI      2                 SAVE REGS
         PSM,2    DELSTK
         PSW,11   DELSTK
         B        SEMIE1
*
*
*                                                                       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 STW,4    TOUT
         BAL,4    TYPOUT
         SLS,0    -8                MOVE NEXT CHARACTER INTO POSITION   02648000
         AI,0     0                 CHECK FOR REMAINS                   02649000
         BGZ      DRPRTSML+1        ANYTHING LEFT?
         LW,4     TOUT
         B        0,1               NO - RETURN                         02651000
*                                                                       02652000
*
*
*                                                                       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                 YES, IS IT ADDRESS FIELD2
         BNE      DRERR             NO, NOT GOOD
         AI,10    0                 YES - CHECK ELEMENT COUNT           02661000
         BEZ      DRERR             IS IT NON-ZERO?
         CI,8     DRSOPRBT          IS THIS IMMEDIATE
         BANZ     DRERR             YES, CANT BE INDIRECT
         OR,8     DRASTBIT          SET INDIRECT INDICATOR FLAG         02664000
         B        DRSCAN1           GO SCAN FOR MORE INPUT              02665000
DRMULT   STW,2    DRMULT#           SAVE NUMBER TO MULTIPLY BY
         MTW,1    DRLSTOPR          INCR LSTOPR TO MULT
         LCW,2    2                 AND SUBTRACT IT FROM SUM
         AWM,2    DREXPRS,5
         BAL,4    INPTCHAR          CHECK IF SHIFT
         CI,0     '*'
         BNE      DRMULT1           NO
         MTW,1    DRLSTOPR          INCR LSTOPR TO POS SHIFT
         BAL,4    INPTCHAR          CHECK IF NEXT IS -
         CI,0     '-'
         BNE      DRMULT1           NO
         MTW,1    DRLSTOPR          INCR TO NEG SHIFT
         B        DRINITC
DRMULT1  MTW,-1   CHARINDX          REUSE CHAR THAT WASNT * OR -
         B        DRINITC           SCAN FOR NEXT TERM
* ROUTINE TO DO MULTIPLY (FROM DREVAL)
DRMULTR  LW,15    DRMULT#           GET MULTIPLIER
         EXU      MVEC,1            DO MW,15 2;NOP;OR LCW,2 2
         EXU      MVEC1,1           BCS,4 DRERR;SLS,15 0,2;SLS,15 0,2
         LW,2     15                PUT RESULT IN 2
         B        *14               RETURM
DRMULT#  DATA     1
MVEC     EQU      %-5
         MW,15    2
         NOP
         LCW,2    2
MVEC1    EQU      %-5
         BCS,4    DRERR
         SLS,15   0,2
         SLS,15   0,2
*                                                                       02666000
*
*
*                                                                       02668000
* ROUTINE TO HANDLE LESS THAN                                           02669000
*                                                                       02670000
DRLSTHAN EQU      %
         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        DRINITC           GO SCAN FOR SYMBOL NAME
*                                                                       02700000
*
*
*                                                                       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
         LW,4     TOUT
         B        0,4               YES - RETURN                        02715000
*                                                                       02731000
* ROUTINE TO HANDLE CARRIAGE RETURN                                     02732000
*                                                                       02733000
DRCRTRN  BAL,4    DRCLOSE           CLOSE OPEN REG IF THERE IS ONE
         STW,4    DROPENSW          SET CLOSED
         B        MESSAGE           GET MORE INPUT
*                                                                       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     MESSAGE
         LI,0     #2SPACE           PRINT 2 SPACES AFTER THE VALUE      02747200
         B        DRPRTSML                                              02747300
*                                                                       02748000
*
*
*                                                                       02750000
* ROUTINE TO HANDLE SPACE                                               02751000
*                                                                       02752000
DRSPACE  CD,6     DRSCNSET          ARE WE AT FIRST OF FIELD
         BE       %+3               NO, RESET BLANK COUNT
         LI,0     3                 MAX 3 CONSECUTIVE BLANKS
         STW,0    BLANKCHECK
         MTW,-1   BLANKCHECK
         BEZ      DRERR
         CI,5     2                 CHECK FIELD NUMBER
         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
*                                                                       02768000
* ROUTINE TO HANDLE COMMA                                               02769000
*                                                                       02770000
DRCOMMA  CI,5     2                 ARE WE IN FIELD 3 ALREADY
         BG       DRERR             YES, NO MORE
         BL       %+3
         CI,8     DRSOPRBT          NO INDEX IF IMMEDIATE
         BANZ     DRERR
         AI,5     1                 NO - ADVANCE FIELD NUMBER           02773000
         AI,11    1                 INCREMENT COMMA COUNT               02774000
DRFLDFIX OR,8     DRFLDBIT,5        SET BIT APPROPRIATE TO THIS FIELD   02775000
         B        DRINITC           GO RESET AND SCAN FOR NEXT FIELD    02776000
*                                                                       02777000
* ROUTINE TO HANDLE UP ARROW                                            02778000
* LINE FEED, AND TAB
*
DRLFEED  EQU      %
DRTAB    EQU      %
DRUPAROW LI,0     #CRETRN
         BAL,1    DRPRTSML                                              02779600
         BAL,4    DRCLOSE           CLOSE REGISTER IF IT IS OPEN        02779700
         LI,3     HA(DRPTAB)-HA(DRPOINT1) INDX OF TAB
         SW,3     CURNOPR           LF=1,TAB=0,UPARROW=-1
         BNEZ     %+3
         LW,3     DR#SEMIQ          TAB, GET SEMIQ
         B        %+2
         AW,3     DR#DSIGN          OTHER, ADD TO .
         B        DRSLASHS          GO FINISH AS A SLASH COMMAND        02784000
*                                                                       02790000
* ROUTINE TO HANDLE THE BACKSLASH CHARACTER                             02791000
*                                                                       02792000
DRBSLASH BAL,4    DREVALIT          FIND VALUE OF EXPRESSION            02793000
         AND,3    DRADMSKS          EXTRACT ADDRESS FIELD               02794000
         STW,3    DR#DSIGN          SAVE ADDRESS
         LI,1     0                 SHOW THAT WE ARE IN BACKSLASH MODE  02794200
         STW,1    DROPENER                                              02794400
         B        DRSLASHD+2        OPEN THE REGISTER
*                                                                       02796000
* ROUTINE TO HANDLE THE PERIOD (DOT)                                    02797000
*                                                                       02798000
DRPERIOD CD,6     DRSCNSET          ARE WE INITIALIZED
         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
*
*
************************************************************************
*                                                                      *
*        ROUTINE TO EXECUTE THE LAST VALUE TYPD AND OPEN AND           *
*        DISPLAY THE NEXT LOCATION MAKING IT A CANDIDATE FOR EXECUTION *
*                                                                      *
************************************************************************
STEPPER  EQU      %
         CD,6     DRSCNSET          CHECK TO MAKE SURE
         BNE      DRERR             SCANNER IS INITIALIZED
         CW,5     10                IF NOT, GIVE ERROR
         BCS,7    DRERR
         MTW,-1   CHARINDX          MOVE INPUT INDEX BACK ONE
         LW,1     CHARINDX          LOAD INDEX
         LI,0     8                 STORE A LINE FEED OVER THE
         STB,0    INBUF,1           STEP CHARACTER
         LW,0     DROPENSW          REGISTER OPEN
         BNEZ     DRERR             NO-EXIT
         BAL,15   MAPUNMAP          GET IN SAME MODE AS ;I
         LW,10    DR#DSIGN          GET ADDRESS OF OPEN CELL
         STW,10   DR#SEMII          SET ;I
         MTW,1    DR#SEMII          ADJUST SEMII
         B        BRANCHK           CHECK INSTRUCTION TYPE
INTB     EQU      %
         LW,3     DR#SEMII          BAL+1
         LW,2     BALREG            GET INSTRUCTION REGISTER FIELD
         LW,1     TYPE              CONVERT OPCODE TO INDEX FOR
         EXU      BACT1,1           TRANSFER VECTOR
         EXU      BACT2,1           S
INTB1    STW,10   DR#SEMIQ          SAVE INSTRUCTION ADDRESS
         STW,10   DR#SEMII          SET ;I
         LI,11    KADMSKM           SET OLDPSD TOO
         STS,10   OLDPSD
         LW,1     CHARINDX          CHANGE LINE FEED TO TAB
         MTB,-3   INBUF,1
         B        MESSAGE
BACT1    EQU      %-X'64'
         MTW,-1   SAVREGS,2         BDR
         MTW,1    SAVREGS,2         BIR
         LW,3     *EFADR            AWM, GET IT TO EXECUTE
         B        BRANCHK           EXU, CHECK NEXT IN CHAIN
         CW,2     DR#SEMIC          BCR
         CW,2     DR#SEMIC          BCS
BACT2    EQU      %-X'64'           BAL FOR BACT1 IS NOP (CC>0)
         BLEZ     MESSAGE           BDR
         BGEZ     MESSAGE           BIR
         B        DRSEMIX+1         AWM
         NOP      0                 EXU
         BANZ     MESSAGE           BCR
         BAZ      MESSAGE           BCS
         STW,3    SAVREGS,2         BAL
BRANCHK  EQU      %
         STW,10   EFADR             SAVE EFFECTIVE ADDRESS
         LW,3     *EFADR            GET INSTR TO EXECUTE IN NO BRANCH
         LI,11    0                 GET OPCODE AND R 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
         BCS,9    DRSEMIX+1         NO, JUST EXECUTE IT
         STW,10   TYPE              SAVE OPCODE
         SCS,11   4
         STW,11   BALREG            SAVE R FIELD
         LCI      0
         LM,0     SAVREGS
         ANLZ,10  *EFADR            GET EFFECTIVE ADDRESS
         B        INTB
*                                                                       02810000
* ROUTINE TO HANDLE SINGLE QUOTE                                        02811000
*                                                                       02812000
DRSQUOTE CD,6     DRSCNSET          ARE WE INITIALIZED
         BE       DRQUOTE           YES, START EBD INPUT
         CI,7     #EBDTYPE          ARE WE IN EBD MODE
         BNE      DRERR             NO
         LI,7     #SPCTYPE-#EBDTYPE+#NUMTYPE  YES, MUST BE BREAK NEXT
DRQUOTE  AI,7     #EBDTYPE-#NUMTYPE SET EBD MODE
         B        DRSCAN1           AND SCAN FOR INPUT
*                                                                       02840000
* ROUTINE TO HANDLE EXCLAMATION POINT                                   02841000
*                                                                       02842000
DREXCLAM EQU      %
         LW,13    DR#DSIGN          GET CURRENT VALUE OF DOLLAR SIGN    02843000
         STW,13   DRVALSAV          SAVE FOR REPLACEMENT POSSIBILITY2
         OR,5     10                CHECK ELEMENTS AND FIELD NUMBER     02844000
         BEZ      DRDEFINE          WERE BOTH ZERO?                     02845000
         B        DRERR             NO                                  02846000
*                                                                       02847000
* ROUTINE TO CHECK FOR GREATER THAN SIGN WHEN IT IS EXPECTED            02848000
*                                                                       02849000
DRDEFCHK CI,0     #GTRTHAN          CHECK INPUT CHARACTER               02850000
         BNEZ     DRERR             WAS IT A GREATER THAN SIGN?         02851000
         LW,13    DRVALSAV          GET THE VALUE SYMBOL WILL HAVE      02851750
DRDEFINE CI,7     #SYMTYPE          CHECK CURRENT INPUT MODE            02852000
         BNE      DRERROR           IS IT LEGITIMATE?                   02853000
DRDEFSET LD,14    DRCHRBUF          GET NAME OF SYMBOL                  02855000
         LI,0     FINDSYM-1         SPECIAL ENTRY TO SEARCH JUST
         STW,0    WHCHSRCH          ONE SYM TAB - DELTA DEFINED
         BAL,4    DEFSYMB           SEARCH DEELTA DEFINED SYMBOLS
         CI,0     2                 ALREADY THERE
         BE       DRDEFNEW          YES
         BAL,4    DRSYMAPD          NO. ADD IT TO TABLE
DRDEFFIN EQU      %
         B        MESSAGE
DRDEFNEW LW,13    DRVALSAV          GET INPUT VALUE
         STW,13   SYMBOLS,3         STORE NEW VALUE IN TABLE
         B        DRDEFFIN          GO FINISH UP PROCESSING             02868000
*                                                                       02869000
*
*
*                                                                       02871000
* ROUTINE TO HANDLE THE SLASH COMMAND                                   02872000
*                                                                       02873000
DRSLASH  LW,2     OUTMODE           USE SPECIFIED MODE OF
         MTW,0    MODINPUT          SLASH IF SPECIFIED
         BGEZ     %+2               YES
         LW,2     DRSLDFLT          USE DEFAULT OUTPUT MODE
         STW,2    DRSLSHMD   SAVE SPECIFIED MODE
         AI,10    0
         BGZ      DRSLASHI          WAS THERE ANY?                      02877000
         LI,3     KADMSKM           MASK FOR 17 BIT ADDRESS FIELD       02878000
         AND,3    DR#SEMIQ          FIND ADDRESS POINTER IN ;Q          02879000
         LI,0     #2SPACE           PRINT 2 SPACES BEFORE THE VALUE     02881000
         BAL,1    DRPRTSML                                              02882000
         LW,3     0,3               GET VALUE TO BE PRINTED             02882500
         LI,4     DRSLASHD          RETURN FROM DRPRTEXP
         B        DRPTEXP           GO PRINT VALUE IN DESIRED MODE      02884000
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
DRSLASHM LW,3     DR#DSIGN          PUT STARTING LOCATION IN R3         02889500
         LI,0     #2SPACE           PRINT 2 SPACES BEFORE THE VALUE     02890000
         BAL,1    DRPRTSML                                              02891000
         CI,3     15                CHECK TO SEE IF ITS A REGISTER
         BG       %+2               NO
         AI,3     SAVREGS           YES, GET REGISTER VALUE
         LW,3     0,3               GET CONTENTS OF ADDRESS REQUESTED   02892500
         LW,2     DRSLSHMD          GET MOST RECENT PRINT MODE          02893500
         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
         LI,0     #CRLF             GO TO A NEW LINE                    02898200
         BAL,1    DRPRTSML                                              02898400
DRSLASHS AND,3    DRADMSKS          EXTRACT ADDRESS FIELD               02899000
         STW,3    DR#DSIGN          SAVE NEW LOCATION INDEX             02900000
         LW,2     DRADRMOD          GET CURRENT MODE OF LOCATION PRINT  02902750
         BAL,4    DRPRTADR          PRINT LOCATION VALUE IN DESIRED MODE02903000
         LI,0     #SLASH            SEND OUT A SLASH
         LI,4     DRSLASHM          RETURN FROM TYPOUT
         LW,1     DROPENER          CHECK OPEN MODE SWITCH
         BNEZ     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
         LI,8     0                 CLEAR FLAG REGISTER
         LI,0     -1                FLAG TO SHOW A REGISTER IS OPEN     02907000
         STW,0    MODINPUT   TURN OFF MODE IMPUT SWITCH
         STW,8    DROPENSW          SET OPEN SWITCH
DRSLASHE LI,0     MESSAGE           RESET DEFAULT SLSHEXIT
         XW,0     SLSHEXIT
         B        *0
*                                                                       02912000
         PAGE                                                           02913000
*                                                                       02914000
* SEMI-COLON DISPATCHER                                                 02915000
DRSCOLON BAL,4    INPTCHAR
         CI,0     K40               SEE IF IT WAS A CONTROL CHARACTER   02918000
         BL       DRERROR           WAS IT?                             02919000
         MTW,1    DOTCHAR           BUMP DOT CHAR INDEX
         LI,2     KM6               NO - COLLAPSE THE INPUT TABLE       02920000
         AND,2    0                                                     02921000
         LB,1     DRKEY2,2          FIND COMMAND TYPE
         LH,4     DRPOINT2,1        ADDRESS OF PROPER ROUTINE
         AND,4    M16               CLEAR UPPER BITS
         CI,4     DRSPCHR           IF SPECIAL, DONT RESET DROPENSW
         BE       %+2
         STW,4    DROPENSW
         CI,1     DRSLIMIT          IS EVALUATION REQUIRED
         BL       DREVAL            GO EVALUATE IF APPROPRIATE          02925000
         B        0,4               GO TO CORRECT ROUTINE               02926000
*                                                                       02927000
*
*
*                                                                       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  EQU      %
         CD,6     DRSCNSET          AND CHECK FOR INPUT
         BNE      DRSPCHRB          YES, SET VALUE
*                                                                       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
         STW,1    DRLSTOPR          RESTORE LAST OPERATOR
         B        DRSCAN1           GO SCAN SOME MORE                   02945000
DRSPCHRB BAL,4    DREVALIT          GET COMPLETE VALUE
         STW,4    DROPENSW          CLOSE OPEN LOCATION
         LW,1     CURNOPR           CALCULATE ADDRESS OF VALUE
         MI,1     3
         STW,3    SPECSYM+3,1       SET VALUE
         LW,1     CURNOPR           RESTORE INDEX
         CI,1     DROLIMIT          DOES VALUE ALSO GO IN PSD
         BGE      DRSPCHRC          NO
         EXU      SEMPSD1,1         SET MASK
         EXU      SEMPSD2,1         SHIFT TO POSITION
         STS,2    OLDPSD            SET IN PSD
DRSPCHRC EQU      %
         LI,0     #2SPACE           PRINT A COUPLE OF SPACES            02950000
         BAL,1    DRPRTSML                                              02951000
         B        MESSAGE
SEMPSD1  LI,2     X'1FFFF'          ;I
         LI,2     X'F'              ;C
         LI,2     X'7'              ;F
         LI,2     X'F'              ;H
SEMPSD2  XW,2     3                 ;I
         SCD,2    -4                ;C
         SCD,2    -8                ;F
         SCD,2    -12               ;H
*                                                                       02953000
*
*
*                                                                       02955000
* ;A ROUTINE : CHANGES ADDRESS PRINT MODE TO ABSOLUTE                   02956000
*                                                                       02957000
DRSEMIA  LI,0     DRMODABS          MODE FOR ABSOLUTE ADDRESSES         02958000
         B        DRSEMIRX          GO FINISH PROCESSING                02959000
*                                                                       02960000
* ;R ROUTINE : CHANGES ADDRESS PRINT MODE TO RELATIVE                   02961000
*                                                                       02962000
DRSEMIR  CD,6     DRSCNSET          ANY INUT
         BE       %+3
         BAL,4    DREVALIT
         STW,3    DROFFSET
         LI,0     DRMODREL
DRSEMIRX STW,0    DRADRMOD          SET NEW ADDRESS MODE                02964000
         STW,0    DRSLSHMD          STORE FOR SLASH-LIKE COMMANDS
         B        MESSAGE
*                                                                       02966000
         PAGE
************************************************************************
*                                                                      *
*        ;B       ROUTINE TO SET UP INSTRUCTION BREAKPOINTS            *
*                                                                      *
************************************************************************
DRSEMIB  EQU      %
         AI,5     0                 ONLY 1 FIELD INPUT?
         BGZ      ICHKNMB           NO. GO CHECK NUMBER FIELD
         LW,15    DREXPRS           CHECK INPUT VALUE
         CI,15    8                 <9, MUST BE BREAK RELEASE
         BLE      IBRKRELS
         B        IGETIT            BRK LOC INPUT, NO BRK #
ICHKNMB  LW,6     DREXPRS+1         CHECK NUMBER FIELD
         BLZ      DRERR
         BGZ      ICHKNUMB          CHECK FOR LIMIT
IGETIT   LI,15    IBRKLOC
         LI,4     RESET             RETURN LINK
         B        GETANUMB          GET LOWEST AVAILABLE ENTRY #
ICHKNUMB CI,6     8                 CHECK FOR
         BG       DRERR                       BOUNDS
         AI,6     -1
RESET    LW,2     DREXPRS           BREAK LOCATION
         AND,2    DRADFLD
         CI,2     JOVVPA            IS THIS ADDRESS IN RES MONITOR
OVBRK    BGE      BADBRK            NO.
         XW,2     IBRKLOC,6         SET IT, SEE IF THERE WAS ONE THERE
         BNEZ     %+2               YES, DONT COUNT THIS ONE
         MTW,1    IBRKNENT
INTLZ    LI,0     -1                INITIALIZE PROCEED COUNT
         STW,0    IBRKPRCD,6
         STW,0    IBRKDPLY,6
         CW,6     IBRKNUM           RESET IBRKMODE IF CHANGING CURRENT ONE
         BNE      %+2
         STW,0    IBRKMODE
         CI,5     2                 WAS A DISPLAY ADDRESS INPUT?
         BL       %+3               NO
         LW,2     DREXPRS+2         YES, SAVE DISPLAY ADDRESS
         STW,2    IBRKDPLY,6
         LW,2     DREXPRS+3         CHECK IF SNAP REQUESTED
         CI,2     8                 ISS GOOD NUMBER
         BG       DRERR             NO GOOD, PUT EH
         STB,2    ISNAP,6           SAVE SNAP SPEC
         LW,3     DRBIT0,6          CLEAR TRACE TABLE
         LI,2     0                 FOR THIS ENTRY
         STS,2    ITRCTBL
         BAL,14   COMEND            GET A CHAR IF ANY LEFT IN COMMAND
         CI,0     T                 IS IT A 'T'?
         BNE      DRERR             NO
         STS,3    ITRCTBL           YES. SET TRACE TABLE
         B        MESSAGE           GET NEXT MESSAGE
BADBRK   LI,2     OVBRK             SET PLACE TO NOP
         STW,2    DR#DSIGN
         B        DRERR
*
************************************************************************
*
*
************************************************************************
*                                                                      *
*        ROUTINE TO RELEASE ONE OR ALL INSTRUCTION BREAKPOINTS         *
*                                                                      *
************************************************************************
IBRKRELS AI,10    0                 ANY INPUT?
         BEZ      IBRKDUMP          GO DUMP I BREAK TABLES
         LW,3     DREXPRS           YES. GREATER THAN 0 MEASN RELEASE
         BGZ      SPECRELS          SPECIFIED BREAK.
ALLOFF   LI,4     8                 RELEASE ALL BREAKS
         STW,3    IBRKLOC-1,4        *
         BDR,4    %-1                *
         STW,3    IBRKNENT           *
         STW,3    IBRKNUM            *
         B        IBRKRST            *
SPECRELS CI,3     8                 CHECK VALUE INPUT
         BG       DRERR
         AI,3     -1                OK.
         LI,0     0
         XW,0     IBRKLOC,3         CLEAR ENTRY, IF THERE WAS ONE
         BEZ      DRERR             NOPE
         MTW,-1   IBRKNENT          DECREMENT NENT
         CW,3     IBRKNUM           CLEAR/IBRKMODE IF RELING CURRENT ONE
         BNE      %+2
IBRKRST  STW,10   IBRKMODE          CLEAR IT
         B        MESSAGE
*
************************************************************************
GETANUMB LI,6     0                 SET INDEX
         LW,2     *15,6             IS THIS ENTRY AVAILABLE
         BLEZ     0,4               YES. RETURN. R6 = ENTRY #
         AI,6     1                 NO. INCREMENT INDEX
         CI,6     8                 DONE
         BL       GETANUMB+1        NO
         B        DRERR             YES. NONE AVAILABLE
*
*
************************************************************************
*                                                                      *
*        THIS ROUTINE DUMPS THE FORMATTED INSTRUCTION BREAK TABLES     *
*        ON THE SPECIFIED DEVICE                                       *
*                                                                      *
************************************************************************
IBRKDUMP LW,3     IBRKNENT          ANY I BREAKS
         BNEZ     GOGETEM            YES
NOBREAKS LW,0     NOMESS            NO
         LI,1     MESSAGE           RETURN FROM DRPRTSML
         B        DRPRTSML          PRINT NONE
GOGETEM  LI,12    IBRKLOC           ADDRESS OF I BREAK LOCS TO R12
         LW,11    ITRCTBL           I TRACE TABLE TO R11
         BAL,14   BRKDUMP           GOTO BREAK SEARCH-DUMP ROUTINE
*        BRKDUMP REURNS HERE EACH TIME IT FINDS AN ACTIVE ENTRY        *
         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
         B        TESTBD
         PAGE
**********************************************************************
*                                                                    *
*        ;D       ROUTINE TO SET OR RESET DATA BREAKPOINTS           *
*                                                                    *
**********************************************************************
DRSEMID  EQU      %
         AI,5     0                 CHECK IF ONLY 1 FIELD INPUT
         BGZ      DCHKNMB           NO. GO CHECK NUMBER FIELD
         LW,15    DREXPRS           CHECK INPUT VALUE
         CI,15    8                 <9, MUST BE RELEASE
         BLE      DBRKRELS
         B        DGETIT            BRK LOC INPUT, VO BRK #
DCHKNMB  LW,6     DREXPRS+1         CHECK BRK # FIELD
         BLZ      DRERR
         BGZ      DCHKNUMB          CHECK FOR LIMIT
DGETIT   LI,15    DBRKLOC
         LI,4     DK20              RETURN LINK
         B        GETANUMB          GET LOWEST AVAILABLE ENTRY #
DCHKNUMB EQU      %
         CI,6     8                 CHECK AGAINST UPPER LIMIT
         BG       DRERR
         AI,6     -1
DK20     EQU      %
         LW,5     DREXPRS           ADDRESS OF DATA PREAKPOINT
         CI,5     PPSTART
         BGE      DRERR             NO.
         BAL,11   SETLOCK
         BAZ      DRERR
         XW,5     DBRKLOC,6         SET, AND GET PREV VALUE
         BNEZ     %+2               DONT COUNT IF IT WAS THERE
         MTW,1    DBRKNENT
         LI,0     -1                INITIALIZE OPTIONAL ITEMS IN
         STW,0    DBRKCOND,6        THE DATA BREAKPOINT TABLE.
         STW,0    DBRKMASK,6        *
         LI,0     0                 INITIALIZE
         LW,1     DRBIT0,6          THIS ENTRY
         STS,0    TRACETBL          IN TRACE TABLE
         BAL,14   COMEND            GET A CHAR IF ANY LEFT IN COMMAND
         CI,0     T                 IS THIS A TRACE POINT
         BE       TRACE             YES
COND     EQU      %
         STW,0    2                 NO,COLLECT 2 CHARS FOR CONDITION
         BAL,4    INPTCHAR          GET 2ND CHAR
         SLS,0    8                 FORM BACKWARD CONDITIONAL
         OR,2      0
         OR,2     YFFFF             SET UPPER BITS FOR HALF WORD COMPARE
         LI,4     6                 *
         CH,2     CONDTION,4        FIND CONDITION SPECIFIED
         BE       FOUNDIT           *
         BDR,4     %-2              *
         B        DRERR             *
FOUNDIT  LW,2     DREXPRS+2
         STW,2    DBRKVAL,6         STORE DONDITION VALUE
         LW,2     DBKCNDTN-1,4
         STW,2    DBRKCOND,6
         CI,5     3                 WAS A MASK INPUT
         BL       MESSAGE           NO
         LW,2     DREXPRS+3         GET MASK
         STW,2    DBRKMASK,6        ENTER IT
         B        MESSAGE
TRACE    LW,1      DRBIT0,6         SET FLAG INDICATING TRACE MODE
         STS,1    TRACETBL          FOR THIS BREAKPOINT
         LI,14    COND              RETURN FROM COMEND
         B        COMEND            GET A CHAR IF ANY LEFT IN COMMAND
*
*
*
*        REMOVE DATA BREAKPOINT N. IF N=0, REMOVE ALL BREAKPOINTS
*
DBRKRELS AI,10    0                 ANY INPUT
         BEZ      DBRKDUMP          GO DUMP D BREAK TABLES
         LW,3     DBRKNENT          YES. ANY DATA BREAKPOINTS
         BLEZ     DRERR
         LW,3     DREXPRS           YES. WHAT KIND OF RELEASE
         BGZ      SELCTIVE          A SPECIFIC BREAKPOINT
         LI,4     8                 RELEASE ALL D BREAKPOINTS
DKR10    EQU      %
         STW,3     DBRKLOC-1,4
         BDR,4    DKR10
         STW,3    DBRKNENT          # ENTRIES = 0
         B        MESSAGE
SELCTIVE CI,3     8                 VERIFY BREAKPOINT NUMBER
         BG       DRERR
         AI,3     -1                CONVERT TO ENTRY NUMBER
SETBKTBL LI,4      0                CLEAR THE SPECIFIED ENTRY IN
         XW,4     DBRKLOC,3         GET ADDRESS
         BEZ      DRERR             NOT THERE
         MTW,-1   DBRKNENT          DECREMENT # OF ENTRIES
         B        MESSAGE           GET NEXT COMMAND
         PAGE
*
*        R2       =ADR OF D BRK TO BE SET
*        R11      =LINK
*        R1,R4,R5 USED
*
SETLOCK  EQU      %
         LW,2     5                 PRESERVE 5
         SLD,2    -13               IMAGE WORD# TO 2
         SLS,3    -28               PAGE# IN WORD TO 3
         MI,3     -2                SHIFT FACTOR
         LI,1     3                 SET TO 11
         SCS,1    -2,3              SHIFT TO PORPER POSITION
         STS,1    XDLKIMG,2         SET IN OUR IMAGE
         CW,1     LKIMG,2           TEST MONITOR VALUE
*
         B        *11
         PAGE
DBRKDUMP LW,3     DBRKNENT          ANY D BREAKS
         BEZ      NOBREAKS          NO
         LW,11    TRACETBL          D TRACE TABLE TO R11
         LI,12    DBRKLOC           YES. GET ADDRESS OF D LOC TABLE
         BAL,14   BRKDUMP           GOTO BREAK SEARCH-DUMP ROUTINE
         LW,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,4     6
         CW,3     DBKCNDTN-1,4      FIND CONDITION TYPE
         BE       FNDCOND           FOUND IT. YES
         BDR,4    %-2
         B        DRERR
FNDCOND  LH,0     CONDTION,4        GET NNEMONIC FOR CONDITION
         AND,0    BLNKUPER          SET UPPER HALF WORD TO BLANKS
         SCS,0    8                 POSITION MNEMONIC BETWEEN BLANKS
         BAL,1    DRPRTSML          STORE IN OUTBUF
         LW,3     DBRKVAL,5         GET SPECIFIED VALUE
         BAL,4    DRPRTHXA          PUT IT OUT
         LW,3     DBRKMASK,5        GET MASK
         CI,3     -1                IS MASK NOMINAL
         BE       TESTBD            YES, DONT PUT IT OUT
         LI,0     31                SPACE TO COL 31
         BAL,4    SPACER
         LI,4     TESTBD            RETURN FROM PRTHXA
         B        DRPRTHXA          PUT OUT MASK
*
*
************************************************************************
*                                                                      *
*        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                                   *
*        R12      ADDRESS OF D OR I TABLE OF BREAK LOCATIONS           *
*        R14      LINK TO SPECIAL PROCESSING FOR D OR I OPTIONAL SPECS *
*                                                                      *
************************************************************************
BRKDUMP  LI,5     0                 INDEX INTO BREAK TABLE
         STW,11   TRACBITS          SAVE TRACE TABLE
         STW,12   BRKLOC            SAVE LOCATION OF ADDRESSES
GETBKLOC LW,10    *BRKLOC,5         GET BREAK LOC
         BEZ      TESTBD+1
         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    TRACBITS          GET TRACE TABLE
         AND,11   DRBIT0,5          CHECK TRACE TABLE FOR THIS ENTRY
         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
         B        *14
TESTBD   BAL,7    DUMPBUF           DUMP THIS LINE
         AI,5     1
         CI,5     7                 MAX ENTRY # YET
         BLE      GETBKLOC          NO
         B        MESSAGE            YES
************************************************************************
*                                                                      *
*        THIS ROUTINE SPACES OUT TO THE COLUMN SPECIFIED IN R0         *
*                                                                      *
************************************************************************
SPACER   LI,2      #SPACE
         LW,1     OUTCHAR           GET CURRENT CHARACTER INDEX
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           YES. SAVE NEW CHARACTER INDEX
         B        0,4               RETURN
*
*
************************************************************************
*                                                                      *
*        THIS ROUTINE DISPLAYS ALL PATCHES RECORDED IN BUFFER 'PATCH'  *
*                                                                      *
************************************************************************
SEMIE    EQU      %
         LW,1     PTCHINDX          GET POINTER TO LAST PATCH
         BEZ      MESSAGE           NONE THERE
SEMIE1   RES
         STW,1    DRTEMPS1          SAVE INDEX
         MTW,1    DROPENER          SET OPEN MODE SWITCH FOR SLASH
         LI,0     -1
         XW,0     SEMIJ             SET & SAVE CURREN  PRINT SWITCH
         PSW,0    DELSTK
PTCH1    EQU      %
         LI,0     PTCH2             SET SLSHEXIT EACH TIME
         STW,0    SLSHEXIT
         LH,3     PATCH+32,1        GET ADDRESS OF PATCH
         AI,3     X'8000'           UN SIGN EXTEND
         B        DRSLASHS          NON-ZERO, OUTPUT ADR AND PATCH
PTCH2    EQU      %
         LI,0     #CRETRN
         BAL,4    TYPOUT
         MTW,1    DRTEMPS1          INCREMENT INDEX
         LW,1     DRTEMPS1
         BLZ      PTCH1
         PLW,0    DELSTK            RESTORE PRINT SWITCH
         STW,0    SEMIJ
         MTW,0    PTCHINDX          ARE WE FLUSHING
         BLZ      MESSAGE           NO , EXIT
*
         PLW,11   DELSTK
         LCI      2                 RESTORE REGS
         PLM,2    DELSTK
         B        *11               RETURN FROM RECORD PATCH
*                                                                       03036000
* ;G ROUTINE : STARTS A USER PROCESS AT DESIRED LOCATION                03037000
*                                                                       03038000
DRSEMIG  AI,10    0                 WAS AN ADDRESS INPUT
         BEZ      DRSEMIGB          NO, GO FROM WHERE WE WRER
         BAL,4    DREVALIT          YES, EVALUATE
         LW,2     3                 AND PUT IN OLDPSD
         LI,3     X'1FFFF'
         STS,2    OLDPSD            STORE IN START-UP PSD
*
*        GENERAL EXIT POINT TO MONITOR OR USER                         *
DRSEMIGB EQU      %
         BAL,15   MAPUNMAP          GET SAME MAP AS OLDPSD, PLUS DISABLED
         BAL,4    DBRK%SET          SET UP D BRKS
         BAL,4    IBRKSET           SET UP INSTRUCTION BREAKPOINTS
         BAL,10   SETMAP            GET UNMAPPED
         CW,10    DRBIT9
         BANZ     %-2               ANOTHER TRY
         BAL,4    CPIORSTR          RESTORE CONSOLE & IO INTERRUPTS
         BAL,4    RSTRINTR          GENERATE I/O INTERRUPTS IF ANY
         STW,4    IBRKMODE          RESET IBRKMODE
         STW,4    DBRKMODE          AND DBRKMODE
         BAL,2    RESETLEE
         LCI      0                 RESTORE REGISTERS
         LM,0     SAVREGS
         LPSD,0   OLDPSD
         PAGE
DBRK%SET EQU      %
         LCI      4
         LM,0     LKIMG             GET MONITOR LOCKS
         STM,0    XDLKIMG
         LI,6     8
         LW,5     DBRKLOC-1,6       SET EACH ONE
         BEZ      %+2               THAT'S THERE
         BAL,11   SETLOCK
         BDR,6    %-3
         LI,2     XDLKIMG           NOW LOAD THEM
         LW,3     DRBIT5            Y04
         LLOCKS,2                   LOAD THE WRITE LOCKS
*
         LW,11    DBRKNENT
         BEZ      RSTR40
TAKE40   EQU      %
         INT,11   X'40'
         STW,11   M40TRAP           SAVE DEST
         AI,11    2
         STW,11   M40TRAP+1
         LI,11    DATBRK            CHANGE DESTINATION OF XPSD
         XW,11    *M40TRAP+1
         CI,11    DATBRK            ARE WE ALREADY THERE
         BE       *4              YES
         STW,11   SAVE40            NO, SAVE XPSD THAT WAS THERE
         B        *4
*
RSTR40   EQU      %
         LI,11    0                 RESTORE LOC 40 IF IT HAS BEEN
         XW,11    SAVE40            CLOBBERED
         BEZ      *4
         STW,11   *M40TRAP+1
         B        *4
*
SAVE40   DATA
         PAGE
*
************************************************************************
*                                                                      *
*        TOGGLE THE OUTPUT DEVICE SWITCH                               *
*                                                                      *
************************************************************************
DRSEMIJ  BAL,7    DUMPBUF           DUMP WAITING OUTPUT ON PREVIOUS DEVC
         LCW,15   SEMIJ             TOGGLE IT
         STW,15   SEMIJ
         B        MESSAGE
*                                                                       03051000
* ;K ROUTINE : KILLS ONE SYMBOL OR THE ENTIRE SYMBOL TABLE              03052000
*                                                                       03053000
DRSEMIK  CW,5     10                FIELD # AND ELEMENT COUNT
         BCS,7    DRERR             MUST BOTH BE ZERO
         CI,7     #SYMTYPE          YES - CHECK STATUS OF SCANNER       03058000
         BNE      DRERR             ARE WE IN SYMBOL MODE?              03059000
         CI,6     -DRSYMMAX         YES - CHECK FOR INPUT               03059500
         BE       DRERR             NOT GOOD, CANT KILL THE WHOLE THING
         LD,14    DRCHRBUF          YES - MUST BE A SELECTIVE KILL      03061000
         LI,0     FINDSYM-1
         STW,0    WHCHSRCH
         BAL,4    DEFSYMB           FIND SYM IN DELTA-DEFINED TABLE
         CI,0     0
         BE       DRERR             NOT THERE
         MTW,-3   NEXTSYM           MOVE LAST SYMBOL ON TOP
         LCI      3
         LM,13    *NEXTSYM
         STM,13   *9,3
         B        MESSAGE           RETURN
*                                                                       03098000
*
*
*                                                                       03100000
* ;L ROUTINE : SETS BOTH SEARCH LIMITS (LOWER AND UPPER)                03101000
*                                                                       03102000
DRSEMIL  EQU      %
         CI,11    1                 NO - CHECK COMMA COUNT              03106000
         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
*                                                                       03112000
*
*
*                                                                       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
         LI,0     0                 INITIALIZE SUBS FLAG TO FALSE
         STW,0    STORFLAG
         CI,5     1                 WERE ONLY FLDS 0 & 1 INPUT
        BNE      NOSTORE           NO,NOT SUBSTITUTION MODE
         LW,1     DREXPRS+1         YES, GET SUBS VALUE
         STW,1    SUBSVAL           SAVE IT
         MTW,1    STORFLAG          SET SUBS FLAG TO TRUE
         LW,3     DREXPRS           GET SEARCH VALUE
         B        %+2               GO MASK AND SAVE IT
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,3     0,3               GET VALUE TO BE TESTED
         STW,3    DRTEMPS2          SAVE VALUE FOR USE LATER IF NEEDED  03134000
         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
         LW,2     DRADRMOD          YES - GET MODE OF ADDRESS PRINT     03138000
         LI,0     #CRLF             PUT TTY ON A NEW LINE               03139000
         BAL,1    DRPRTSML                                              03140000
*       THE SPECIFIED SUBSTITUTE VALUE WILL BE STORED THROUGH THE     *
*        MASK INTO THE CELL WHICH PASSED THE TEST IF SUBSTITUTION MODE *
         LW,2     DRTEMPS1          GET ADR WHICH PASSED TEST
         LW,0     STORFLAG          CHECK FOR SUBS MODE
         BEZ      SRCH1
         LW,0     SUBSVAL           YES, GET SUBS VALUE
         LW,1     DR#SEMIM          GET MASK
         STS,0    0,2               STORE IN LOC WHICH PASSED TEST
SRCH1    EQU      %
         LW,3     2                 MOVE ADR TO R3
         LI,8     0                 FLUSH STATUS BITS                   03142000
         LW,2     DRADRMOD          ADDRESS OUTPUT MODE
         BAL,4    DRPRTADR          PRINT ADDRESS IN APPROPRIATE MODE   03143000
         LI,0     #SLASHSP
         BAL,1    DRPRTSML                                              03145000
         LW,3     DRTEMPS2          GET EXPRESSION TO BE PRINTED        03150000
         LW,2     DRSLDFLT          GET CURRENT SLASH DEFAULT MODE      03150500
         BAL,4    DRPTEXP           GO PRINT IN THE DESIRED MODE        03151000
DRSEMIWT MTW,1    DRTEMPS1          ADVANCE LOCATION COUNTER            03152000
         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
*                                                                       03157000
************************************************************************
*                                                                      *
DRSEMIP  EQU      %
         LW,0     IBRKMODE          IN I-BRK MODE
         BNEZ     DRSEMIGB          NO, GO FROM WHERE EW RWEW
         BAL,15   MAPUNMAP          GET SAME AS OLDPSD
         LW,5      IBRKNUM             GET CURRENT BREAK NUMBER
         LW,2      DREXPRS             GET PROCEED COUNT
         AI,2      -1                  ADJUST
         STW,2     IBRKPRCD,5          SAVE PROCEED COUNT
IBRKCONT LW,6     IBRKLOC,5         GET BREAK ADDRESS
         LW,15    0,6               AND BROKEN INSTRUCTION
         STW,15   IBRKEXEC          PUT IN WHERE IT WILL EXECUTE
         LB,2     15                IS IT A BAL
         AND,2    M7
         CI,2     X'6A'
         BNE      NOTBAL
         LCI      0                 YES, DETERMINE EFFECTIVE ADDRESS
         LM,0     SAVREGS
         ANLZ,14  IBRKEXEC
         LW,15    BALMASK           MASK TO TURN INTO BRANCH
         LW,2     IBRKEXEC          SAVE REG FIELD
         STS,14   IBRKEXEC
         SLS,2    -20
         AND,2    M4                SET RETURN REG
         ANLZ,3   IBRKEXEC+1        HAS RETURN ADDRESS IN IT
         STW,3    SAVREGS,2
NOTBAL   LI,2     IBRKEXEC          SET UP TO GO TO IBRKEXEC
         B        DRSEMIGB-2
*
*
************************************************************************
*                                                                      *
*        ;O ROUTINE DUMPS SPECIFIED AREA OF CORE ON PRINTER
*                                                                      *
************************************************************************
*
DRSEMIO  EQU      %
         CI,5     1                 CHECK # OF FIELDS INPUT
         BL       SMO00             1, MUST BE A SNAP DUMP
         BE       SMO05             2, MUST BE REGULAR DUMP
*                                   3, MUST BE A DISC DUMP
         LW,15    DREXPRS+2         GET # OF SECTORES
         BNEZ     %+2
         LI,15    1                 NOMINAL 1 SECTOR
         STW,15   DDUMP
*
         LW,2     DREXPRS           GET SEEK ADR
         LW,3     DREXPRS+1         GET DISC UNIT ADR
         BNEZ     SMS10             OLD FORMAT,CHECK DEVICE
         LW,3     DISCADR           MAYBE OLD,TRY CURRENT VAL
         GOTO,VVM SMS10
         LH,7     DREXPRS           IF SEEK ONLY HALFWORD
         AND,7    MASKS+6
         BEZ      SMS10
         LH,3     DCT1,7            GET DISCADR
         LW,8     DREXPRS
         STW,8    LOGDISC
         BAL,11   DSCCVT
         BEZ      DRERR
         LW,2     8
SMS10    EQU      %
         BAL,4    PRNTSKIP
         BAL,4    HDCHK             CHECK FOR HEADER
         BAL,11   DISCDUMP          DO IT
        B        MESSAGE
*
SMO00    EQU      %
        LW,1     DREXPRS           1,  MUST BE SNAP DUMP
        BLZ      DRERR
         CI,1     8                 VERIFY INPUT
        BG       DRERR
*
         BAL,4    HDCHK             CHECK FOR HEADER
        BAL,11   DSNAP             SNAP IT
         B        MESSAGE
*
SMO05   EQU      %
         BAL,4    DRGETLIM          GET LIMITS
         CW,3     2                 UPPER < 2
         BL       DRERR             YES, ERROR
         STW,2    BEGINLOC
         STW,3    LASTLOC
         BAL,4    PRNTSKIP          PAGE EJECT IN ANY CASE
         LI,4     PRNTDMP           SET UP RETURN
         B        HDCHK             CHECK FOR HEADER
*
**       THE FOLLOWING CODE DETERMINES IF A HEADER WAS INPUT
**       FOLLOWING THE DUMP COMMAND.  IF SO, THE HEADER IS PRINTED
**       AND 3 LINES ARE SKIPPED
*
HDCHK    PSW,2    DELSTK
         PSW,4    DELSTK            SAVE RETURN
         LW,2     NUMBCHAR          COMPUTE NUMBER OF CHARACTERS
         SW,2     CHARINDX          REMAINING IN INPUT BUFFER.
         CI,2     1                 HEADER INPUT?
         BLE      HDEX
         AI,2     -1                YES, R2 NOW = # CHARS IN HEADER
         LI,6     0                 R6 IS INDEX INTO PRINTBUF
         BAL,13   BLANKPRT          BLANK BUFFER
         BAL,4    INPTCHAR          GET NEXT CHARACTER
         STB,0    PRINTBUF+10,6     STORE IN MIDDLE OF PRINT BUFFER
         AI,6     1                 INCRENENT PRINT INDEX
         BDR,2    %-3               DONE
         BAL,4    PRINTRTN          YES, PRINT HEADER
HDEX     BAL,4    PRNTSPAC
         PLW,4    DELSTK
         PLW,2    DELSTK
         B        0,4
*
*
************************************************************************
*                                                                      *
*        ROUTINE TO DUMP IN HEX ON THE PRINTER                         *
*        THIS ROUTINE DUMPS FROM START LOC TO END LOC                  *
*        SUPPRESSING OUTPUT OF DUPLICATE LINES                         *
*                                                                      *
*        R3 CONTAINS START LOCATION                                    *
*        R10 CONTAINS END LOCATION                                     *
*                                                                      *
************************************************************************
*
PRNTDMP  EQU      %
         LI,3     0                 DUMP REGS FIRST
         LI,10    15                0 THRU 15
         BAL,4    LINESET           SET U` DMP LINE
         BAL,4    PRINTRTN          AND PRINT IT
         BAL,4    LINESET           NEXT DUMP LINE
         BAL,4    PRINTRTN
         LI,11    MESSAGE           RETURN FROM SMO100
*
SMO100  EQU      %
        BAL,4    PRNTSPAC          SPACE 3 LINES
SMO110   EQU      %
         PSW,11   DELSTK
         LW,3     BEGINLOC          START OF DUMP
         LW,10    LASTLOC           END OF DUMP
         BAL,4    LINESET           DUMP AT LESAT ONE LINE
         B        PRNTALIN
SETUPLIN BAL,4    LINESET           GO SET UP A LINE
         BG       PRNTALIN          ALWAYS PRINT LAST LINE
         LW,15    SUM               WAS LINE ALL ZEROS
         BNEZ     PRNTALIN          NO, OUTPUT THIS LINE
         LI,9     1                 SET DUP LINE INDICATOR
         B        ENDTEST
PRNTALIN EQU      %
         CI,9     1                  TEST FOR PRECEEDING DUP LINE
         BNE      %+3               BRANCH IF NO
         BAL,4    PRNT1SPAC
         LI,9     0                  RESET FLAG
         BAL,4    PRINTRTN           OYUTPUT THE LINE
ENDTEST  EQU      %
         CW,3     10                ARE WE DONE
         BLE      SETUPLIN          NO
         PLW,11   DELSTK
         B        *11
*
*
************************************************************************
*                                                                      *
*        R3       CONTAINS START LOC                                   *
*        R10      CONTAINS END LOC                                     *
*                                                                      *
************************************************************************
*
LINESET  EQU      %
         LI,1     0                 INITIALIZE INDEX INTO PRINT BUFFER
         STW,1    SUM               RESET DUP LINE INDICATOR
         BAL,13   BLANKPRT          ZAP PRINT BUFFER
         LW,7     3                 ADDRESSS FOR THIS LINE
         CI,10    DISCBUF+255       IF DUMPING DISC, USE REL ADDR
         BNE      %+2
         AI,7     -DISCBUF
         SLS,7    12                PRINT
         LI,5     5                 ONLY FIVE DIGITS IN ADDRESS
         BAL,13   CONVBGN
         AI,1     3                 ADJUST LINE INDEX
CONVSTR  LW,7     0,3               GET NEXT WORD FOR OUTPUT
         CI,3     15                CHECK IF SNAPPING REGISTERS
         BG       %+3               NO
         LW,7     SAVREGS,3         YES
         B        %+3               DONT TRAP
         CW,7     *24BM8,3          IS IT SAME AS LAST TIME
         BE       %+2
         MTW,1    SUM               FORCE OUTPUT OF LINE
         LW,13    1                 PUT TEXT AT COL 92
         DW,13    DRD10             10 BYTES/WORD IN HEX PART
         AI,13    PRINTBUF+24       END OF THIS WORD
         LI,6     -4                4BYTES/WORD
         LB,15    8,6               WORD IN 7
         LI,5     X'3F'             6 BIT PRINTER
         AND,5    15
         CB,15    CONVCHRS,5        IS THIS ONE PRINTABLE
         BE       %+2               YES
         LI,15    '.'               NO, PRINT .
         STB,15   *13,6
         BIR,6    %-7
*
         BAL,13   CONV              CONVERT AND STORE
         CI,1     50
         BNE      %+2               ADD EXTRAA SPACE
         AI,1     1                 AT HALFWAY IN LINE
         AI,3     1                 INCREMENT LOC INDEX
         CW,3     10                DONE WITH THIS LINE?
         BG       0,4               YES, RETURN
         CI,1     91                JUST THIS LINE DONE
         BL       CONVSTR           NO, DO NEXT WORD
         B        0,4               YES. RETURN
         PAGE
*************************************************************
*
*        TABLE OF PRINTABLE CHARACTERS
*        IN 6-BIT ORDER
*
******************************************************************
CONVCHRS EQU      %
         DATA,10  ' ABCDEFGHI'      00-09
         DATA,7   X'4A4B4C4D4E4F50' 0A-10
         DATA,9   'JKLMNOPQR'       11-19
         DATA,8   X'5A5B5C5D5E5F6061' 1A-21
         DATA,8   'STUVWXYZ'        22-29
         DATA,6   X'6A6B6C6D6E6F'   2A-2F
         DATA,10  '0123456789'      30-39
         DATA,6   X'7A7B7C7D7E7F'   3A-3F
************************************************************************
*                                                                      *
*        R7       CONTAINS WORD TO BE CONVERTED AND STORED             *
*        R5&6     TEMPORARY REGS                                       *
*        R4       LINK                                                 *
*                                                                      *
************************************************************************
*
CONV     LI,5     8                 *
CONVBGN  LI,6     0                 *
         SLD,6    4                 *
         LB,15    DRDIGITS,6        *
         STB,15   PRINTBUF,1        *
         AI,1     1                 *
         BDR,5    CONVBGN           *
         AI,1     2                 SKIP 2 SPACES BET WORDS
         B        *13
*
         GOTO,VVM DSNAP
         PAGE
*  ROUTINE TO CONVERT PHYSICAL ADDRESS TO
*        LOGICAL ADDRESS
*        R11 = LINK
*
         REF      DCT22,CYL%SHFT,NSPC,TRK%SHFT
         REF      SEC%SHFT,NSPT,NCYL
         REF      Y004,Y008
*
SEEKCNT  LW,2     TRACK             GET DISC ADDESSS
         REF      DCT1,DCTSIZ,DSCCVT
         LW,3     DISCADR           DEVICE ADDRESS
         LI,5     DCTSIZ            FIDN IN DCT TABLE
         CH,3     DCT1,5
         BE       %+4
         BDR,5    %-2
         STW,5    LOGDISC
         B        *11               EXIT
         LB,4     DCT22,5           INDEX INTO DISK TABLES
         LW,8     5                 SAVE DCT INDEX
         LW,7     2
         LB,5     DCT24,5           IF MPC,
         CI,5     4                 7 ALREADY HAS SECTOR#
         BANZ     SEEK1
         LI,5     32                SHIFT OFFSET
         SLD,2    -32               SET UP SEEK ADDRESS,ZAP 2
         MTW,0    NCYL,4            ANY CLY ON DEVICE
         BNEZ     %+3               YES
         LI,6     32                NO, RAD
         B        SEEK
         LI,6     X'7F'
         AND,6    CYL%SHFT,4        CYL SHIFT FACTOR
         SW,5     6                 CYL SIZE
         SLD,2    0,5
SEEK     LW,7     2                 MOVE # CYLS
         MW,7     NSPC,4            COMPUTE  #TRACKS
         LI,2     0
         LI,5     X'7F'             TRACK SHIFT FACTOR
         AND,5    TRK%SHFT,4
         SW,6     5
         SCD,2    32,6              R3 = #TRACKS
         MW,3     NSPT,4            R3=TOT #SECTOR FOR TRK
         AW,7     3                 R7= TOT SECTORS FOR CYL+TRK
         LI,6     X'7F'
         AND,6    SEC%SHFT,4        SECTOR SHIFT
         SW,5     6
         SLS,2    -32,5
         AW,7     2                 R7= RELATIVE SECTOR
SEEK1    RES
         STW,7    LOGDISC
         LH,7     7                 MOVE HIGH BITS TO PROPER POS
         LB,7     HIGCVT,7
         OR,8     7                 PUT IN DCTX
         STH,8    LOGDISC
         B        *11
HIGCVT   DATA,1   0,X'80',X'40',X'C0'
         PAGE
*        R1  - SNAP SPECIFICATION #                                    *
DSNAP    EQU      %
         PSW,11   DELSTK
*
         LD,2     DLIM-2,1          GET DMP SPECIFICATIONS
         BEZ      DS25              BRANCH IF NOT SET
         BGZ      DS14              BRANCH IF NOT INDIRECT
*
         LI,15    0                 CLEAR UPPER BYTE OR R2 FOR
         STB,15   2                 REGISTER CHECK
         CI,2     15                CHECK IF INDIRECT THROUGH REGISTER
         BG       DS12              BRANCH IF NO
*
         AI,2     SAVREGS           GET VALUE IN USERS REGS
DS12     EQU      %
         LW,2     0,2               GET  LOW LIM INDIRECT
DS14     EQU      %
*
*                 IF A REGISTER IS SPECIFIED WITHOUT INDIRECT, THE
*                 CONVERT ROUTINE WILL PICK UP THE VALUE FROM THE
*                 USERS STACK.
*
         LB,15    3                 CHECK IF DISC DUMP
         BEZ      DS15
*
         STW,15   DDUMP
         AND,3    MASKS+24          IS THERE DISC ADR
         BNEZ     %+5               YES
         LW,8     2                 NO, MUST BE REL DISCADR
         DO       VVM
         LCI      0
         ELSE
         BAL,11   DSCCVT
         FIN
         BEZ      DS25
         LW,2     8
         BAL,11   DISCDUMP          DO DISC DUMP
         B        DS25
*
DS15     EQU      %
         AW,3     2                 COMPUTE UPPER MEMORY LIMIT
        STW,2    BEGINLOC
         STW,3    LASTLOC
         BAL,11   SMO100
DS25     EQU      %
*
         BAL,4    PRNTSKIP
         PLW,11   DELSTK
         B        *11
         PAGE
*
*       R3  =  DISC UNIT ADDRESS
*        R2  =  START TRACK ADDRESS
*        R15 =  # OF SECTORS TO DUMP
*
DISCDUMP EQU      %
         PSW,11   DELSTK
         STW,2    TRACK             SAVE SEEK ADRES
        STW,3    DISCADR           SET UP FOR DISC I/O
         LI,5     2                 MAKE TWO BYTE SEEK FOE RADS
         STW,5    READCOM+1         TRY JUST SEEK FIRST
         HIO,0    *DISCADR
         BCS,8    DRERR             DEVICE NOT THERE
         LI,5     DCTSIZ
         CH,3     DCT1,5            FIND THE ADDRESS
         BE       %+2
         BDR,5    %-2               DEVELOP DCTX
         LB,5     DCT24,5
         CI,5     4                 MPC CONTROLLED DEVICR
         BANZ     DDMP10            YES
         BAL,11   RADREAD           DO SEEK
         CW,1     Y008              DID WE GET INCORRECT LENGTH
         BAZ      %+3               NO,  MUST BE A RAD
         MTW,2    READCOM+1         YES, IS PACK DO 4 BYTE SEEKS
         B        DDMP10            AND KEEP FULL WORD ADDRESS
         LW,2     TRACK             SEEK ADDRESS
         STH,2    TRACK             SEE IF LEFT HW NONZERO
         BNOV     %+2               YES, SKIP STW
         STW,2    TRACK
DDMP10  EQU      %
*
         DO1      1-VVM
         BAL,11   SEEKCNT           GENERATE LOGDISC
        BAL,13   BLANKPRT          BLANK BUFFER
*
         LW,7     TRACK
         LI,1     20                INDENT 20
        BAL,13   CONV
         LI,1     32                INDENT TO 32
         STB,1    READCOM+1         SET COMMAND CHAIN
         LW,7     DISCADR
         BAL,13   CONV
         LI,1     44                INDENT TO 44
         LW,7     LOGDISC
         BAL,13   CONV
*
         BAL,4    PRINTRTN          PRINT LINE
         BAL,4    PRNT1SPAC         SPACE 1 LINE
*
         BAL,11   RADREAD           READ SPECIFIED SECTOR
        LI,11    DISCBUF           SET DUMP LIMITS TO SECTORBUF
        STW,11   BEGINLOC          BEGIN & END
         AI,11    255
        STW,11   LASTLOC
*
         BAL,11   SMO110            DUMP
*
         MTW,-1   DDUMP             DECREMENT & TEST SECTOR COUNT
         BLEZ     DISRET
         BAL,4    PRNTSPAC
         GOTO,VVM DDMP11
         LI,4     1
         LW,8     LOGDISC
         MTH,1    8,4
         BNC      OKS
         EOR,8    Y008
         CW,8     Y008
         BANZ     OKS
         EOR,8    Y004
OKS      STW,8    LOGDISC
         BAL,11   DSCCVT            MAKE SEEK ADDRESS
         BEZ      %+2               NO GUDNIK
DDMP11   EQU      %
         STW,8    TRACK
         B        DDMP10
DISRET   RES      0
*
        PLW,11   DELSTK
         B        *11
        PAGE
*
*        THIS ROUTINE READS A DISC SECTOR STARTING AT ADR SPECIFIED
*       IN 'TRACK' AND INCREMENTS 'TRACK' BY 1
*
RADREAD EQU      %
         LW,2     DISCADR           DEVICE ADDRESS
         LI,5     DCTSIZ
         CH,2     DCT1,5            FIND DEVICE
         BE       %+3
         BDR,5    %-2               DEVELOP DCTX
         B        DRERR
         LB,5     DCT24,5
         CI,5     4                 MPC CONTROLED DEVICE
         BAZ      RADREAD1          NO
*
         LI,3     X'F'
         SLD,2    20                SHIFT DEVICE NUMBER INTO POSITION
         STS,2    MPCSEEK           INTO MPCSEEK
         STS,2    MPCORDER            AND ORDER
         LW,2     TRACK             SEEK
         LI,3     0
         SLD,2    -4                SEEK TO POSITION
         OR,2     Y001              ONE SECTOR
         STD,2    MPCSEEK1          MPC SEEK ADDRESS
         LD,2     MPCCDW
         STD,2    READCOM           CHANGE TO MPC CLIST
         LI,2     X'B0'
         STB,2    READCOM+4         STOP ORDER
         LI,0     DA(MPCCLIST)
         B        %+2
RADREAD1 EQU      %
         LI,0     DA(READCOM)
         SIO,0    *DISCADR          READ A SECTOR
         BCS,12   %-1
DCTIO    LI,1     41                DELAY BETWEEN TIOS
         BDR,1    %
         TIO,1    *DISCADR
         BCS,12   DCTIO
         CW,1     BUSYMASK          CHECK BUSY STATIS
         BANZ     DCTIO
         CI,5     4
         BAZ      *11               NOT A MPC DEVICE
         MTW,1    TRACK             INC ONE SECTOR
         LD,2     XERCDW
         STD,2    READCOM           RESTORE TO XEROX CLIST
         LI,2     8                 TIC ORDER
         STB,2    READCOM+4         RESTORE TIC
         B        *11
*
************************************************************************
*                                                                      *
*        PRINT ROUTINE HAS 3 ENTRANCES.                                *
*        PRNTSKIP -- PAGE EJECT                                        *
*        PRNTSPAC -- SPACES 3 LINES                                    *
*        PRINTRTN -- PRINTS 1 LINE, 132 CHARACTERS, FROM PRINTBUF      *
*        R4  IS LINK                                                   *
*                                                                      *
************************************************************************
*
         DO       MONSIM
WCAL     GEN,8,24 X'11',M:LO
         DATA     X'30000010',PRINTBUF,132
PAGCAL   GEN,8,24 4,M:LO
SPACCAL  GEN,8,24 X'11',M:LO
         DATA     X'30000010',BLANKS,4
PRINTRTN CAL1,1   WCAL
         B        0,4
*
PRNTSKIP CAL1,1   PAGCAL
         B        0,4
*
PRNTSPAC LI,0     3
         CAL1,1   SPACCAL
         BDR,0    %-1
         B        0,4
PRNT1SPAC LI,0    1
         B        PRNTSPAC+1
         ELSE
PRINTRTN LI,0     DA(COMPRNT)       PRINT 132 CHARACTERS FROM PRINTBUF
         MTW,0    LPIOADR
         BGZ      %+2
         AI,0     -1
         B        PRNTOUT
PRNTSKIP LI,0     DA(COMSKIP)       PAGE EJECT
         B        PRNTOUT
PRNT1SPAC EQU     %
         LI,0     DA(COM1SPAC)      SPACE 1 LINE
         B        PRNTOUT
PRNTSPAC LI,0     DA(COMSPAC)       SPACE THREE LINES
PRNTOUT  EQU      %
PRNTGO   STW,0    PRNTGSV0          SAVE CLIST ADDRESS
         TIO,5    *LPIOADR
         BCR,12   PRNTGO20          GO PRINT THE LINE
         BCS,8    PRNTGO10          PUT OUT NOTOP MESSAGE
         LC       5                 L/ STATUS BITS 0-3 INTO CC
         BCS,1    PRNTGO+1          DEVICE AUTOMATIC, RECHECK STATUS
PRNTGO10 MTW,-1   PRNTERRFLG        SHOULD WE PUT OUT MESSAGE?
         BGZ      PRNTGO+1          NOPE
         STW,4    PRNTERRFLG        SAVE LINK REGISTER
         LW,0     LPIOADR           GET ADDRESS OF PRINTER
         AND,0    M14
         LI,4     DCTSIZ
         CH,0     DCT1,4            FIND ADDRESS IN DCT1
         BE       %+3               FOUND IT
         BDR,4    %-2
         LI,4     DA(T:PRNTR)-DA(DCT16) DIDN'T FIND IT
         AI,4     DA(DCT16)         R4 := DA(DEVICE NAME)
         SLS,4    3                 CONVERT TO BYTE ADDRESS
         LI,5     X'7FFFF'          MASK FOR STS
         STS,4    LPERRCOM          SHOVE IT INTO CLIST
         LI,0     DA(LPERRCOM)      L/ DA(CLIST) FOR OC
         BAL,4    TYPEIT2           PUT MESSAGE ON OC
         LI,4     X'7FFFF'          L/ A SUITABLE DELAY VALUE
         XW,4     PRNTERRFLG         RESTORE LINK REGISTER
         B        PRNTGO+1         TEST STATUS AGAIN
PRNTGO20 EQU      %
         LI,5     33
         LW,0     PRINTBUF-1,5
         STW,0    PRINTBUF2-1,5
         BDR,5    %-2
         STW,5    PRNTERRFLG
         LW,0     PRNTGSV0
         SIO,0    *LPIOADR          MOVE LINE TO PRINT BUFFER
         BCS,12   %-1               AND DO I/O..
         B        0,4               RETURN
*
PRNTGSV0 DATA     0
         BOUND    DW
         GEN,8,24    1,BA(PRINTBUF2)
         GEN,8,24 X'20',132
COMPRNT  GEN,8,24  1,BA(PRINTBUF2)
         GEN,32   132
         FIN
PRINTBUF RES,FW   33                BUFFER FOR OUTPUT ON PRINTER
PRINTBUF2  RES,FW   33
         BOUND    DW
COMSKIP  GEN,8,24 3,BA(SKIPAGE)
         GEN,32   1
COMSPAC  GEN,8,24 3,BA(SPACLIN)
         GEN,32   1
COM1SPAC ORD8     3,BA(1SPAC)
         DATA     1
SKIPAGE  DATA,BT  '1'               PAGE EJECT FORMAT CHARACTER
SPACLIN  DATA,BT  'C'               SPACE 3 LINES FORMAT CHAR
1SPAC    DATA,1   'A'               SPACE 1
         BOUND    4
PRNTERRFLG DATA   0
NOTOP    TEXT     ' NOT OPERATIONAL'
         GEN,8,24 X'15',0
T:PRNTR  TEXT     'PRNTR'
         BOUND    DW
LPERRCOM GEN,8,24 1,0               CLIST TO WRITE NOTOP MSG ON OC
         GEN,8,24 X'80',8           DATA CHAIN, 8 BYTES
         GEN,8,24 1,BA(NOTOP)
         GEN,32   17                17 BYTES
         PAGE
*
*
**************************************************************
*
*        THIS ROUTINE SET UP A DUMP SPECIFICATION            *
*        ;S       =LIST
*        N;S      =REMOVE #N
*        N,LOC,SIZ=CORE DUMP
*        N,GDA,,# =DISC DUMP
*        N,SEEK,DEVICE,# = DISC  DUMP
*        N,....   N IS OPTIONAL
*                                                            *
**************************************************************
DRSEMIS  LCI      4                 GET ALL VAULES
         LM,1     DREXPRS
         CI,5     1                 HOW MANY ARE THERE
         BL       DRSMSREL           ONE OR NONE, REL OR DUMP
         BE       DRERR             TWO, MAKES NO SENSE
         AI,1     -1                THREE OR FOUR, FIRST IS DUMP #
         BGEZ     DRSMS1            SPECIFIED
         LI,1     -16               NO, TRY TO FIND ONE
         AI,1     1
         MTW,0    DLIM+16,1
         BEZ      %+3               GOT ONE
         BIR,1    %-3
         B        DRERR
         AI,1     16
         SLS,1    -1
DRSMS1   CI,4     255               IF NO FIELD4, NOT DISC DUMP
         BAZ      %+2
         STB,4    3
         AI,3     0                 IF THREE ZERO, BLEW IT
         STD,2    DLIM,1
         B        MESSAGE
DRSMSREL AI,10    0                 IF NO INPUT, IS DUMP
         BEZ      DRSMSDMP
         STB,2    1                 ZAP HIGH BYTE
         CI,1     8                 IS IT LEGAL #
         BG       DRERR
         MTB,-1   1                 MAKE BDR FAIL
         CI,1     15
         BANZ     %+2               ZAP ALL IF 0 INPUT
         LI,1     8
         STD,2    DLIM-2,1
         BDR,1    %-1
         B        MESSAGE
*
*
*
DRSMSDMP LI,5     -8
         LI,4     0                 SET NONE FLAG
         LD,10    DLIM+16,5
         BEZ      DRSMS5
         LI,0     #CRETRN           GOT ONE, MAKE DIAPLST
         BAL,4    TYPOUT
         LW,3     5
         AI,3     9                 DUMP NUMBER
         BAL,4    DRPRTINT
         LW,0     #3SPACE           THREE SPACES
         BAL,1    DRPRTSML
         LW,2     DRADRMOD          GET CURRENT ADDRESS PRINT MODE
         LW,3     10                GE START ADDRESS
         BGZ      %+3               NOT INDIRECT
         LI,0     #ASTRISK
         BAL,4    TYPOUT
         BAL,4    DRPRTADR          PRINT ADDRESS TO START
         LI,0     #COMMA            COMMA BETWEEN FIELDS
         BAL,4    TYPOUT
         LW,3     MASKS+24
         AND,3    11                IF SIZE, DO IT
         BEZ      %+2
         BAL,4    DRPRTHXA
         LB,3     11                IF DISC SNAP, OUTPUT #SECTORS
         BEZ      %+4
         LI,0     #COMMA
         BAL,4    TYPOUT
         BAL,4    DRPRTINT
         BAL,7    DUMPBUF
DRSMS5   BIR,5    DRSMSDMP+2
         BDR,4    MESSAGE
         B        NOBREAKS
*
*
*
************************************************************************
*                                                                      *
*        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     DRERR             NO, ERROR
         LW,1     DBRKNUM           GET BREAK NUMBER
         LW,3     DRBIT0,1
         STS,3    TRACETBL          SET TRACE TABLE
         B        MESSAGE
*
*
DRSEMIU  EQU      %      TOGGLE MAPPED/UNMAPPED IN XDELTA
*
*                        PUT DELTA IN MAP IF GOING MAPPED
*                        RESTORE USER IF GOING UNMAPPED
*
         LI,10    MESSAGE           SET NORMAL RETURN
SETMAP   EQU      %                 ENTRY
         LI,4     XDMAPDISP
         SLS,4    :BIG
         LCI      3+:BIG+:BIG       GET MAP IMAGE OF XDELTA AREA
         LM,0     JX:CMAP,4         FROM CURRENT JIT
         XPSD,0   TOGLMAP           GET CURRENT PSD AND GO UNMAPPED
SMU10    EQU      %
         LW,11    DRBIT9            TOGGLE THE MAP BIT
         LS,10    TOGLMAP
         EOR,10   DRBIT9
         STW,10   TOGLMAP
         LW,6     TOGLMAP+1         TOGGLE MEMORY EXTENSION BITS
         EOR,6    REABITS
         OR,6     TOGLMAP+3         DISABLE
         STW,6    TOGLMAP+1
         CW,10    DRBIT9            ARE WE GOING MAPPED
         BAZ      SMU11             NO  RELOAD OLD MAP
         LCI      3+:BIG+:BIG+:BIG
         LM,0     ONETOONE+:BIG+:BIG+:BIG
SMU11    LD,6     MMCNTRL
         LDMAP,6                    LOAD DELTA MAP PAGES.
         LPSD,0   TOGLMAP
*
         BOUND    8
TOGLMAP  DATA,8  0
         DATA    SMU10
         GEN,8,24  5,0
MMCNTRL  GEN,32,8,7,8,9  0,3+:BIG+:BIG+:BIG,,XDMAPDISP*4,0
REABITS  GEN,8,1,6,1,13,1,2  0,:B9,0,:B9,0,:B560,0
*
*
*                                                                       03200000
* ;X ROUTINE : EXECUTES THE INPUT EXPRESSION AS AN INSTRUCTION          03201000
*                                                                       03202000
DRSEMIX  EQU      %
         BAL,4    DREVALIT          NO - EVALUATE ENTIRE EXPRESSION     03206000
         STW,3    EXECINST          STORE INST IN EXECUTE AREA
         LI,0     EXECRTRN          STORE RETURN ADDRESS IN RETURN PSD
         STW,0    EXECPSD+2
         LI,2     EXECINST          SET UP TO EXECUTE IT
         B        DRSEMIGB-2
*        RETURN FROM EXECUTING AN INSTRUCTION                          *
EXECRTRN LCI      0                 SAVE
         STM,0    SAVREGS                REGISTERS
         LD,0     EXECPSD           GET EXECUTE PSD
         STD,0    OLDPSD            EXECUTE PSD TO EXIT PSD
         LW,0     DR#SEMII          RESTORE ;I
         LI,1     KADMSKM
         STS,0    OLDPSD
         BAL,14   ENTRY             GET INTO DELTA
         B        MESSAGE
*
*                                                                       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
         LW,2     DREXPRS           GET 1ST LOC
         LW,3     DREXPRS+1         GET 2ND LOC
         AI,3     1
         SW,2     3                 GET SIZE OF AREA
         BGZ      DRERR             UPPER LESS THAN LOWER
         LW,10    DREXPRS+2         GET VALUE
         STW,10   *3,2              FILL AREA
         BIR,2    %-1
         B        MESSAGE
*                                                                       03246000
*
*
*                                                                       03248000
* ;/ ROUTINE : CHANGES THE DEFAULT TYPE OF THE "SLASH" COMMAND          03249000
*                                                                       03250000
DRSEMISL EQU      %
         LW,2     OUTMODE           GET SPECIFIED MODE
         STW,2    DRSLDFLT          STORE IN DEFAULT LOC
         STW,2    DRSLSHMD          STORE IN CURRENT SLASH MODE
         B        MESSAGE
*                                                                       03253000
* ;= ROUTINE - CHANGES THE DEFAULT TYPE OF THE "EQUAL" COMMAND          03254000
*                                                                       03255000
DRSEMIEQ LI,1     DREQDFLT          GET POINTER TO EQUAL DEFAULT CELL   03256000
DRSEMIMD LW,2     OUTMODE           NEW MODE
         STW,2    0,1               UPDATE PROPER DEFAULT CELL          03259000
         B        MESSAGE
*                                                                       03261000
         PAGE
*        DATA BREAKPOINT TRAP PROCESSING
*
DATBRK   STCF     SAVE40            SAVE CONDITIONS
         LC       X'55'             IS CLOCK4 INDIRECT ?
         BCR,8    DRERR             NO, DELTA IN CONTROL
         LCI      0                  NO, SAVE REGISTERS
         STM,0    SAVREGS
         LD,0     *M40TRAP          GET TRAP PSD
         STD,0    OLDPSD            SAVE FOR USER
         BAL,14   ENTRY
         LC       SAVE40            GET CONDITIONS AGAIN
         BCS,14   ERRCOND           NOT MEM PROT
         LW,2     DBRKNENT          ANY D BRKS
         BLEZ     MEMVIOL           NO
         LCI      0
         LM,0     SAVREGS
         ANLZ,7   *DR#SEMII
         BCR,13   BYTE
         BCR,5    WORD
         BCS,1    BYTE
         BCR,8    HALF
         MI,7     -8                DOUBLE
BYTE     SAS,7    -1
HALF     SAS,7    -1
WORD     STW,7    DBEFADR           SAVE IT
         LAW,7    7                 MAKE POS
         SLS,7    -9                PAGE #
         SCS,7    -2                BYTE #
         LB,6     XDLKIMG,7         GET BYTE OF WRITELOCKS
         SLS,7    -29               CHECK IF SET
         SLS,6    0,7
         CI,6     X'80'             IS THIS ONE SET
         BAZ      MEMVIOL           NO
         LD,6     SAVREGS+6
         LC       OLDPSD            GET USER CC
         EXU      *DR#SEMII         EXECUTE THE INSTRUCTION
         STCF     OLDPSD            SET NEW CCS
         LCI      0
         STM,0    SAVREGS           SAVE NEW REGS
         MTW,1    OLDPSD
         BAL,14   RSTORPSD          SET ;C,;F,;H,;I
         LAW,6    DBEFADR           GET AFFECTED ADDRESS
DBLTRY   LI,7     8
         CW,6     DBRKLOC-1,7       IS THERE A D BREAK ON THIS ADR
         BE       FND               YES
         BDR,7    %-2               NO, KEEP CHECKING
         XW,7     DBEFADR           IS THIS DOUBLE
         BGEZ     DRSEMIGB          NO, OR NOT SECOND OF PAIR EITHER
         AI,6     1                 DOBLEWORD PAIR
         B        DBLTRY            GO CHECK 2ND ADDRESS
FND      STW,6    DBEFADR
         AI,7     -1                BUMP ENTRY # DOWN
         STW,7    DBRKNUM
         LW,0     DBRKCOND,7        GET BRK CONDITION IF ANY
         BLZ      DATABRK           BRANCH IF NONE
         LW,6     DBRKVAL,7         GET CONDITIONAL VALUE
         LW,7     DBRKMASK,7
         CS,6     *DBEFADR          COMPARE WITH CONTENTS OF BRK LOC
         EXU      0                 EXECUTE THE CONDITIONAL BRANCH
         B        DRSEMIGB          FAILS, CONTINUE EXECUTION
*
*
*
*         DATA BREAKPOINT - CONTROL TO DEBG
*
DATABRK  EQU      %
         LW,5     DBRKNUM
         LW,1     DRBIT0,5
         LS,1     TRACETBL
         BEZ      RSTRIBRK          NOT A TRACE BREAKPOINT
         LI,0     TRACEOFF
         STW,0    SLSHEXIT
         B        DMSG              DONT RESTORE I BREAKS,SET BREAK FLAG
RSTRIBRK EQU      %
         STW,1    DBRKMODE          SET DATABREAK MODE
         MTW,1    BRKTIME           FORCE TTY OUTPUT (ONCE)
DMSG     BAL,7    DBRKMSG           PRINT D BREAK MESSAGE
         LW,3     DBEFADR
         B        DRSLASHS
TRACEOFF BAL,7    DUMPBUF
         B        DRSEMIGB          PROCEED
*                                                                       03277000
         PAGE
*********************************************************************
*                                                                    *
*                    THE TRAP TO 40 WAS ILLEGAL                      *
*                                                                    *
*********************************************************************
MEMVIOL  EQU      %
ERRCOND  EQU      %
         LD,0     *M40TRAP+1        GET WHERE TO START UP
         LW,0     SAVE40            PROPERLY
         STD,0    OLDPSD
         B        DRSEMIGB          AND DO IT
         PAGE
************************************************************************
*                                                                      *
*        RETURN TO DELTA FROM AN INSTRUCTION BREAKPOINT                *
*                                                                      *
************************************************************************
LEES%WATERING%HOLE EQU %
         STM,0    SAVREGS
         MTW,-1   LEE20
         LD,0     LEE20
         STD,0    OLDPSD
         BAL,14   ENTRY
         LI,5     8
         LW,6     DR#SEMII
         BEZ      %+4               NOT ZERO
         CW,6     IBRKLOC-1,5
         BE       IBRKFND
         BDR,5    %-2
         BIF,X560 %+4
         LW,6     0,6               IF XPSD, SKIP IT
         CW,6     IBRKXPSD
         BNE      %+3
         MTW,1    OLDPSD
         MTW,1    DR#SEMII
         MTW,1    BRKTIME           FORCE 'DELTA' ON TTY
         LI,1     DELTMSG
         BAL,4    DLMSG
         B        DRINIT
IBRKFND  AI,5     -1                R5 = BREAKPOINT NUMBER
         STW,5    IBRKNUM
         LW,4     IBRKJUMP          UCTION AND CONTINUE EXECUTION
         AW,4     6                  *
         STW,4    IBRKEXEC+1         *
         LW,10    IBRKPRCD,5        CHECK FOR PROCEED COUNT
         BLZ      NOPRCD             STOP ON THIS BREAK
         MTW,-1   IBRKPRCD,5        DECREMENT PROCEED COUNT
         B        IBRKCONT          GO DO IT
*
NOPRCD   EQU      %
         LW,15    DRBIT0,5          IS THIS A TRACE BREAKPOINT
         LS,15    ITRCTBL
         BEZ      NOTRACE           NO
         LI,15    TRACECHK          YES. SET UP SPECIAL RETURN FROM
         STW,15   SLSHEXIT          SLASH ROUTINE
         B        IMSG              DONT RESTORE I BREAKS,SET BREAK FLAG
NOTRACE  STW,15   IBRKMODE          SET IBRKMODE
         MTW,1    BRKTIME           FORCE BRK MSG TO TTY
IMSG     EQU      %
         LB,1     ISNAP,5           GET SNAP SPEC
         BEZ      IBK80             BRANCH IF NONE
*
         PSW,5    DELSTK
         BAL,11   DSNAP             SNAP IT
         PLW,5    DELSTK
*
IBK80    EQU      %
         BAL,7    IBRKMSG           PRINT I BRK MESSAGE
         LW,3     IBRKDPLY,5        WAS DISPLAY REQUESTED
         BLZ      DRSLASHE          NO, EXIT (RESTORE SLSHEXIT)
         B        DRSLASHS          OUTPUT DISPLAY AND EXIT
TRACECHK BAL,7    DUMPBUF           OUTPUT TRACE MESSAGE
         B        IBRKCONT          AND PROCEED
*
************************************************************************
         PAGE
CPINT    EQU      %                 THIS ROUTINE TAKE S CONSOLE
*                                   INTERRUPTS WHILE DELTA IS IN CONTROL
         LI,0     0
         STW,0    OUTCHAR            RESET OUTPUT CHARACTER COUNT
         LI,2     DRINIT             CONSTRUCT A PSD WHICH GOES TO
         LW,3     DRBIT9             DRINIT WITH MAP BIT SET AS IT WAS
         LS,2     CNSLIOBK          BEFORE INTERRUPT AND WITH
         LW,3     CNSLIOBK+1        CP-IO INHIBIT BIT IN PSD RESET.
*
         LPSD,3   2                  CLEAR CP INTERRUPT AND GO.
         PAGE
CPIOCNTL EQU      %
         LW,15    CPIOXPSD           SEND CONSOLE INTERRUPTS TODELTA
         XW,15    CPINTLOC
         STW,15   UPRLIM            SAVE CPINT XPSD
*
         LW,15    DRBIT26           DISABLE THE I/O
         WD,15    X'1500'            INTERRUPT LEVEL
         B        *4
*
*
CPIORSTR EQU      %
         WD,0     X'32'             SET CP-IO INHIBIT BIT INN PSD
*
         LW,15    DRBIT26           ENABLE THE I/O
         WD,15    X'1400'           INTERRUPT LEVEL
*
         LW,15    UPRLIM            GET CPINT XPSD
         STW,15   CPINTLOC
         B        *4
         PAGE
***********************************************************
*                                                         *
*        ENTRY INIAIALIZES STUFF FOR DELTA EXECUTION      *
*                                                         *
*        BAL,14   ENTRY                                   *
*                                                         *
***********************************************************
ENTRY    EQU      %
         LW,0     LEE20+2
         CI,0     1                 ARE WE ALREADY SET
         BANZ     *14               YES, RETURN
         LI,1     4                 TURN OFF CLOCKS
         LW,0     CLKNOP
         XW,0     CLOCKS,1
         STW,0    CLKNOP,1
         BDR,1    %-3
         MTW,1    LEE20+2           BLOCK FURTHER USE OF DELTA
         LI,15    RSTORALL          SET RETURN FROM MAPUNMAP
MAPUNMAP BAL,10   SETMAP            SWITCH MAP
         CS,10    OLDPSD            IS IT THE SAME NOW
         DO       MONSIM
CLOCKS   EQU      CLKNOP
CPINTLOC EQU      CPIOXPSD
         ELSE
CLOCKS   EQU      X'51'
CPINTLOC EQU      X'5D'
         BNE      MAPUNMAP          NO, SWITCH AGAIN
         FIN
         B        *15
*
*
***********************************************************
*                 RESETLEE UNBLOCKS ENTRY TO XDELTA       *
*        BAL,2    RESETLEE                                *
***********************************************************
RESETLEE EQU      %
         LI,1     4                 PUT CLOCKS BACK
         LW,0     CLKNOP,1
         STW,0    CLOCKS,1
         BDR,1    %-2
         MTW,-1   LEE20+2
         B        0,2
*
CLKNOP   MTW,0    X'55'
         RES      4
         PAGE
ONETOONE EQU      %
II       DO       12
         DATA,1   XDMAPDISP*4+II-1
         FIN
ONETOONE:9  EQU   %
II       DO       12
         DATA,2   XDMAPDISP*4+II-1
         FIN
         PAGE
*
*
************************************************************************
*                                                                      *
*        ROUTINE TO SET AND RESTORE INSTRUCTION BREAKPOINTS            *
*                                                                      *
************************************************************************
         LW,15    IBRKXPSD
IBRKSET  LW,13    %-1               SET UP TO SET UP BREAKPOINTS
         B        %+3
         LW,15    IBRKINST,1        SET UP TO RESTORE IBREAKS
IBRKRSTR LW,13    %-1
         LI,1     0
         LW,6     IBRKNENT          *
         BLEZ     0,4               RETURN IF NO I BREAKS
LOOPSTRT LW,3     IBRKLOC,1         *
         BEZ      IBRK20
         EXU      13                GET WHAT TO PUT THERE
         XW,15    0,3               PUT IT THERE
         STW,15   IBRKINST,1        SAVE IT IN CASE WERRE SETTING
IBRK20   EQU      %
         AI,1     1
         CI,1     8
         BL       LOOPSTRT
         B        0,4               RETURN
*
*
*
************************************************************************
*                                                                      *
*        ROUTINE TO OUTPUT I & D BREAKPOINT MESSAGES                   *
*                                                                      *
************************************************************************
DBRKMSG  LW,13    DBPT              DATA BREAK ENTRY
         LW,3     OLDPSD
         B        %+3
IBRKMSG  LW,13    IBPT              I BREAK ENTRY
         LW,3     IBRKLOC,5
         AND,3    DRADFLD
         STW,7    BRKMSGXT          SAVE RETURN LINK
         LI,8     0                 CLEAR FLAG REGISTER
         MTW,1    DROPENER          SET SLASH MODE
         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
*
*
*
*        SAVE CC,FC,IA & RESTORE BROKEN INSTRUCTIONS
RSTORALL EQU       %
         BAL,4    IBRKRSTR          RESTORE BROKEN INSTRUCTIONS
         BAL,4    CLEARDVC          CLEAR LP,TTY INTERRUPTS
         BAL,4    CPIOCNTL          TAKE OCINT CONTROL
         BAL,4    TAKE40            GET 40 TRAP CONTROL
RSTORPSD LW,2     OLDPSD            SET PSD PARTS
         SLD,2    -28
         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     0                 CLEAR AGAIN
         SLD,2    4                 MOVE MS,MM,DF,FF INTO 2
         STW,2    DR#SEMIH          SET ;H
         SLS,3    -12               GET ;I
         AND,3    DRADFLD
         STW,3    DR#SEMII          ST IIT
         B        *14               RETURN
*
*        THIS IS THE TYPEWRITE ROUTINE
*
         DO       MONSIM
IN1CAL   GEN,8,24 X'10',M:UC
         DATA     X'30000010',BUF,1
TYPIN    CAL1,1   IN1CAL
         ELSE
TYPIN    RES      0
IO       LI,0     DA(COMWORD)
         SIO,0    *OCIOADR          TRY TO START I/O
         BCS,12   %-1               KEEP TRYING IF BUSY
CHECK    TIO,0    *OCIOADR          CHECK DEVICE
         BCS,12   %-1               WAIT FOR COMPLETION
         FIN
         LB,0     BUF               NO, GET INPUT CHARACTER
         B        0,4
*
*        DATA DEFINITIONS FOR TYPEWRITER ROUTINE
*
         BOUND    8
COMWORD  GEN,8,24,32 6,BA(BUF),1
BUF      DATA,4   0
         PAGE                                                           03327500
************************************************************************
*                                                                      *
*        THE FOLLOWING IS THE CODE FOR MESSAGE ORIENTED OUTPUT         *
*                                                                      *
************************************************************************
MESSAGE  EQU      %
         LW,1     WHERETO           IF PATCHING, SKIP OUTPUT
         BNEZ     MESSAGE1
         LW,1     OUTCHAR           ANY OUTPUT EWAITING
         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
MESSAGE1 EQU      %
         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        DRINITB           EXIT FROM MESSAGE ROUTINE
************************************************************************
*                                                                      *
*        THIS CODE DUMPS THE OUTPUT BUFFER(IF THERE IS ANYTHING IN IT) *
*        ON THE SPECIFIED DEVICE                                       *
*                                                                      *
************************************************************************
DUMPBUF  LCI      0                 SAVE REGISTRS
         STM,0    TMPSTK
         LW,1     OUTCHAR           ANY OUTPUT WAITING
         BLEZ     RSTREG            NO. EXIT.
         LW,2     BRKTIME           D OR I BREAKPOINT MESSAGE?
         BNEZ     TYPRITER          YES, MUST GO ON TYPEWRITER.
         LW,2     SEMIJ             CHECK OUTPUT DEVICE SWITCH
         BGZ      TYPRITER          TYPEWRITER
         BAL,13   BLANKPRT          BLANK PRINT BUFFER
         LW,3     1
         AI,3     3
         SLS,3    -2
         LW,4     OUTBUF-1,3
         STW,4    PRINTBUF-1,3
         BDR,3    %-2
         BAL,4    PRINTRTN          PRINT IT.
         MTW,0    SEMIJ             IF BOTH, DO IT
         BLZ      %+2               NOT
TYPRITER BAL,4    TYPIT             TYPE (R1E WORDS
         BAL,13   BLANKTYP          BLANK OUTPUT BUFFER
         LI,2     0
         STW,2    BRKTIME           RESET BREAK INDICATOR TO FALSE
         STW,2    OUTCHAR           RESET OUTPUT BUFFER POINTER
RSTREG   LCI      0                 RESTORE REGISTERS
         LM,0     TMPSTK
         WD,0     X'22'             ENABLE CONSOLE INTERRUPT NOW
         B        0,7               RETURN
************************************************************************
*                                                                      *
*                                                                      *
************************************************************************
TYPOUT   STW,4    R4                SAVE RETURN LINK
         LW,4     OUTCHAR           GET POINTER
         STB,0    OUTBUF,4          ADD A CHARACTER TO OUTPUT BUFFER
         MTW,1    OUTCHAR           BUMP POINTER
         LW,15    SEMIJ             IS OUTPUT GOING TO PRINTER
         BGZ      TYPCHAR           NO
         CI,0     #CRETRN           IS IT A CARRIAGE RETURN
         BNE      PRNTCHAR          NO
         MTW,-1   OUTCHAR           DECREMENT CHARACTER COUNT
         B        DUMPER            DUMP AND EXIT
PRNTCHAR CI,4     107               IS PRINTER LINE FULL
         BL       RSTOR4            NO
TYPCHAR  CI,4     79                IS TYPEWRITER LINE FULL
         BL       RSTOR4            NO
DUMPER   BAL,7    DUMPBUF           YES. PUT IT OUT
RSTOR4   LW,4     R4                RESTORE 4
         B        0,4
************************************************************************
*                                                                      *
*        ROUTINE OUTPUTS (R1) WORDS ON THE TYPEWRITER                  *
*                                                                      *
         DO       MONSIM
OUT1CAL  GEN,8,24 X'11',M:UC
         DATA     X'30000010',OUTBUF,X'80000001'
TYPIT    CAL1,1   OUT1CAL
TYPEIT2  EQU      %
         ELSE
************************************************************************
TYPIT    STW,1    COM1+1            CHARACTER COUNT TO COMMAND WORD
         LI,0     DA(COM1)          COMMAND WORD ADDRESS TO R0
TYPEIT2  EQU      %
         SIO,0    *OCIOADR          TRY TO START I/O
         BCS,12   %-1               KEEP TRYING
         TIO,0    *OCIOADR          WAIT FOR COMPLETION
         BCS,12   %-1
         FIN
         B        0,4               RETURN
************************************************************************
*                                                                      *
*        THE FOLLOWING CODE CHECKS THE TYPEWRITER AND PRINTER FOR      *
*        BUSY.  IT WAITS FOR THEM TO COME NOT BUSY AND THEN CHECKS     *
*        FOR PENDING INTERRUPTS.  IF THERE ARE ANY , THEY ARE CLEAR-   *
*        AT THE DEVICE.  THE SIGNALS HOWEVER, WILL STILL BE UP IN THE  *
*        CPU WHEN CONTROL IS RETURNED TO THE MONITOR.                  *
*                                                                      *
************************************************************************
CLEARDVC LW,7     OCIOADR
         BAL,12   DEVICHK
         STW,0    TYPINT
         LW,7     LPIOADR
         BAL,12   DEVICHK
         STW,0    PRINTINT
         B        0,4               RETURN
*
DEVICHK  LI,0     0                 NO-INTERRUPT FLAG
         TIO,13   *7                TEST THE DEVICE
         LW,15    13                SAVE THE RESPOMSE
         AND,13   BUSYMASK          IS IT BUSY
         BNEZ     DEVICHK           YES, KEEP CHECKING
         AI,15    0                 WAS THEERE AN INTERRUPT
         BGEZ     *12               NO
         HIO,0    *7                CLEAR THE PENDING INTERRUPT
         LI,0     1
         B        *12               RETURN
*
*
*        THE FOLLOWING CODE BLANKS THE APPROPRIATE BUFFER
*
BLANKCRD BAL,5    BLANKBUF          SET 5 GO DO IT
         GEN,8,24 18,CARDIMAG
BLANKTYP BAL,5    BLANKBUF
         GEN,8,24 27,OUTBUF
BLANKPRT BAL,5    BLANKBUF
         GEN,8,24 33,PRINTBUF
BLANKBUF LW,5     0,5
         STW,0    PRNTGSV0
         LW,0     BLANKS
         STW,0    0,5
         AI,5     1
         MTB,-1   5
         BG       %-3
         LW,0     PRNTGSV0
         B        *13
************************************************************************
*                                                                      *
*        DATA FOR MESSAGE ORIENTED OUTPUT                              *
*                                                                      *
************************************************************************
OUTBUF   DO1      27
         TEXT     ' '
OUTCHAR  DATA,FW  0                 POINTS TO NEXT AVAIL BYTE IN OUTBUF
BRKTIME  DATA,FW  0                 =1, OUTPUT WAITING IS BREAK MESSAGE
SEMIJ    DATA     -1                >0, TYPE
*                                   <0, PRINT
*                                   =0, TYPE AND PRINT
YC       DATA     X'C0000000'       FOR SETTING SEMIJ FROM BOOTFLG
R4       RES,FW   1                 TEMP FOR R4 IN TYPEOUT ROUTINE
         BOUND    DW
COM1     GEN,8,24 5,BA(OUTBUF)
         DATA,FW  0
TMPSTK   RES,FW   16                SAVE REGS WHEN DUMPING IN TYPEOUT
************************************************************************
*                                                                      *
*        THIS ROUTINE GENERATES AN INTERRUPT ON A DEVICE IF DELTA HAS*
*        CLEARED AN INTERRUPT ON IT THAT WAS REQUESTED BY THE MONITOR  *
*                                                                      *
************************************************************************
RSTRINTR LW,0     TYPINT            CHECK FOR TYPEWRITER INTRPT
         BEZ      PRNTCHK           NONE
         LI,0     DA(TYPINTR)       GENERATE AN INTERRUPT ON TYPER
         SIO,0    *OCIOADR
         TIO,1    *OCIOADR          WAIT UNTIL INTERRUPT IS PENDING
         AI,1     0
         BGEZ     %-2
         MTW,-1   TYPINT            CLEAR TYPER INTERRUPT FLAG
PRNTCHK  LW,0     PRINTINT          CHECK FOR PRINTER INTERRUPT
         BEZ      DISCHEK           NONE, CHECK DISC
         BAL,13   BLANKPRT          BLANK PRINT BUFFER
         LI,13    6                 FORMAT CHARACTER TO INHIBIT SPACE
         STB,13   PRINTBUF          INTO PRINT BUFFER
         LI,0     DA(PRNTINTR)      GENERATE AN INTERRUPT
         SIO,0    *LPIOADR
         TIO,1    *LPIOADR          WAIT UNTIL IT IS PENDING
         AI,1     0
         BGEZ     %-2
         MTW,-1   PRINTINT          CLEAR PRINTER INTRPT FLAG
DISCHEK  EQU      %
         B        *4
         PAGE
************************************************************************
*                                                                      *
*        THE FOLLOWING CODE OUTPUTS ON THE TYPEWRITER THE PATCH WHICH  *
*        IS IN ERROR AND THEN GOES TO THE TYPEWRITER FOR INPUT OF A    *
*        CORRECT VERSION OF THAT PATCH.                                *
*        INPUT IS TERMINATED EITHER BY NL OR BY THE 80TH CHARACTER.    *
*                                                                      *
************************************************************************
FIXPATCH EQU      %
         MTW,0    SAVE40            ARE WE PATCHING
         BNEZ     DRERR             NO, DONT BELONG HERE
         LW,3     DRTEMPS2          GET %
         STW,3    DR#DSIGN          AND SET IT
*                 GET CORRECT VERSION OF PATCH
BLNKCARD BAL,13   BLANKCRD          BLANK CARD IMAGE
         LI,0     X'15'             *  SEND OUT  *
         STB,0    OUTBUF            *  A         *
         LI,1     1                 *  CARRIAGE  *
         BAL,4    TYPIT             *  RETURN    *
         LI,7     0                 CHARACTER POINTER
         STW,7    PSEG+21           ALLOW ANY SEGNAME
GETNEW   BAL,4    TYPIN             GET A CHARACTER
         CI,0     #CRETRN           DONE
         BE       PATCHIN           YES
         CB,0     BRKCHAR           LINE ABORT COMMAND
         BE       BLNKCARD          YES, BLANK IMAGE & TRY AGAIN
         STB,0    CARDIMAG,7        NO, STORE CHAR IN CARD IMAGE
         AI,7     1                 BUMP POINTER
         CI,7     72                CHECK CHARACTER COUNT
         BL       GETNEW            NOT DONE
PATCHIN  RES
         MTB,-1   SEMIJ             OUTPUT TO LP NOW
         B        GETACARD+2        TRUNDLE INTO PATCHER
*
***************************************************************
*
*        THE FOLLOWING CODE PROCESSES SYMBOL DEFINITION
*        AND PATCH SKIP CONTROL
*        PATCH CARDS OF THE FORM    #SYMBOL=VALUE
*                      OR           #VALUE
*        WHERE SYMBOL IS THE SYMBOL TO BE DEFINED
*        AND VALUE IS A BLANKLESS EXPRESSION
*
**************************************************************
*
SYMDEF   EQU      %                 PATCH SYMBOL DEFINITION
         LI,3     0                 SET POINTERS
         STW,3    CHARINDX
         STW,3    CARDINDX
         STW,3    OUTCHAR
         STW,3    NUMBCHAR
         STW,3    INBUF             ZAP FOR POSSIBLE SYMBOL
         STW,3    INBUF+1
         LI,5     %+2               RETURN FROM PUTIN
         BAL,6    GETCHAR           RETURNS THRU PUTOUT
         BAL,6    GETCHAR
SYMDEF0  CI,0     ' '               BLANK TERMINATES
         BE       SYMDEF1
         CI,0     '='               EQUALS TERMINATES ALSO
         BNE      PUTIN             BUT SAYS DEFINE SYMBOL
         MTW,0    PACHSKIP          IF SKIPPING, DONT DEFINE SYMBOLSHJK
SYMDEF00 EQU      %
         BLEZ     SYMDEF5
         LW,6     INBUF             SAVE THE TEXT
         LW,7     INBUF+1
         STD,6    DRSYMSTR
         XW,3     NUMBCHAR          RESET INBUF
         BEZ      DRERR             NO SYMB INPUT
         LI,5     %+1               RETURN FROM PUTIN
         BAL,6    GETCHAR
         CI,0     ' '
         BNE      PUTIN             TERMINATE ONLY BY BLANK
SYMDEF1  LI,0     X'37'             SPECIAL CHAR
         BAL,5    PUTIN
         CI,6     SYMDEF0           WHICH TYPE
         BNE      %+4
         AI,7     0
         BEZ      SYMDEF4           NO CHAR => NO SKIP
         AI,0     SYMDEF3-SYMDEF2+X'80000' SET PACHEVAL RETURN
         AI,0     SYMDEF2-X'37'     DITTO
         B        PACHEVAL
SYMDEF2  LD,14    DRSYMSTR
         LI,0     FINDSYM-1         REPLACE OLD VALUE IF THERE IS ONE
         STW,0    WHCHSRCH
         BAL,4    DEFSYMB           LOOK FOR IT
         LW,13    DREXPRS           GET NEW VALUE
         BDR,0    %+3               REPLACE IF THERE
         BAL,4    DRSYMAPD          PUT IT IN
         B        MOVCOM            PRINT COMMENT PORTION
         STW,13   SYMBOLS,3         PUT IN NEW VALUE
         B        MOVCOM            AND PRINT COMMENT PORTION
         BOUND    8
SYMDEF30 TEXT     'SKIP'
         TEXT     'ELSE'
SYMDEF3  LD,6     SYMDEF30          GET SKIP/ELSE
         CW,7     INBUF              AND WORD1=ELSE
         BE       SYMDEF8           GOT ONE, SWITCH SKIP FLAG
         MTW,0    DREXPRS           CHECK EXPRESSION
         BLEZ     %+2               SET SKIP FLAG
SYMDEF4  LW,6     BLANKS            NO, RESET IT
         STW,6    PACHSKIP
SYMDEF5  BGZ      MOVCOM            AND FINISH OUTPUT BUFFER
         B        SKIPCHK           SKIP IF SKIP
SYMDEF6  LB,0     CARDIMAG          DO SKIP/DEF CARDS FOR GENMDS
         LW,4     5                 GET RETURN
         CI,0     '!'               IF BANG, RETURN
         BE       0,4
         AI,4     -1
         CI,0     '#'               IS THIS ONE
         BNE      MOVCARD           NO
         STW,4    SYMDEF2
         B        SYMDEF            AND DO IT
SYMDEF7  BAL,4    MOVCARD           PUT IT IN `ATCH DECK FILE
         B        *SYMDEF2          RETURN TO GETCARD
SYMDEF8  XW,6     PACHSKIP          SWITCH FLAG
         BGZ      SKIPCHK           DID IT, DO SKIP #
         B        SYMDEF4           WAS SKIP, SET DO
COMMENT  EQU      %                 PROCESS COMMENT CARDS
         LI,1     -28               STICK < OR >
*                                   IN FIRST 28
         STB,0    OUTBUF+7,1        COLUMNS
         BIR,1    %-1               TO FLAG OUTPUT
         LI,1     -80               THEN FOLLOW BY
         LB,0     CARDIMAG+20,1     PRINTING
         STB,0    OUTBUF+27,1       THE COMMENT CARD
         BIR,1    %-2               STARTING AT COLUMN 29
         LI,1     108               TOTAL #
         STW,1    OUTCHAR           OF CHARS. TO LIST
         B        STORVAL1          PRINT OUTBUF AND GET NEXT CARD
         PAGE
*****************
*  RECONFIGURATION COMMAND ENCOUNTERED.
*  PROCESSING OF COMMAND IS DONE IN RECNFIG, THEREFORE,
*  PASS IT THE COMMAND BUFFERS ADDR., THE ADDR. OF WHERE
*  TO RETURN TO IN XDELTA, & CONTROL FOR PROCESSING COMMAND.
*  ALSO, PASS THE ADDRESS OF ROUTINE IN XDELTA WHERE
*  MESSAGES CAN BE ADDED TO PATCH FILE AS COMMENTS.
*****************
         REF      RECNFG            DEFINED IN BOOTSUBR
RECONFIG EQU      %
         LI,0     '.'
         MTW,0    PACHSKIP
         BLEZ     COMMENT     YES-- SKIP MODE
         BAL,4    MOVCARD     ****  PUT CARD INTO PATCH FILE BUFFER
         LI,12    CARDIMAG          CARD BUFFER ADDR.
         LI,14    CONFGSUM          RETURN ADDR.OF MSG.ROUTINE
         LI,15    GETACARD          RETURN ADDR. IN XDELTA
         B        RECNFG      --->  EXIT TO RECONFIGURATOR
********
*  ROUTINE WHICH ENTERS A MESSAGE INTO THE PATCH FILE
*    AS A COMMENT.
*
*  INPUT:         R12 = ADDRESS OF MESSAGE
*
*  CALL:          R10 = LINK
*
****
CONFGSUM EQU      %
         LB,1     *12               MESSAGE SIZE (BYTES, TEXTC TYPE)
         LB,0     *12,1             MOVE MESSAGE
         STB,0    OUTBUF,1            TO BUFFER
         BDR,1    %-2
         LI,0     '<<'              COMMENT CHAR.AS 1ST CHAR.
         STH,0    OUTBUF
         LI,6     OUTBUF+20
         BAL,4    MOVCARD1
         BAL,13   BLANKTYP    ****  BLANKS TO BUFFER
         B        *10         --->  RETURN
*****************
         PAGE
************************************************************************
*                                                                      *
*        THE FOLLOWING CODE PROCESSES, INSERTS AND PRINTS SYMBOLIC     *
*        PATCHES AT BOOT-TIME.                                         *
*                                                                      *
************************************************************************
PACHSTRT LCI      0                 SAVE REGISTERS
         STM,0    SAVREGS
* SEGNUM EQU  SAVREGS+1
* SEGBUF EQU  SAVREGS+2
* SEGBASE EQU SAVREGS+3
* SEGMAX EQU  SAVREGS+6
         AI,1     0                 IF SEGNUM=0 THEN INITIALIZE
         BNEZ     CHKSEG
MAXSEG   RES      1
SEGSTRT  RES      1                 MUST BE NONZERO INITIALLY
         BOUND    8
DRSYMSTR RES      2
CHARQ    RES      1
PSEG2    EQU      %                 MUST BE ON ODD BOUNDARY
         ORG      MAXSEG
*
         REF      S:DP,MB:SDI,M:SWAPD,PSA%END
MPRSWAP  EQU      M:SWAPD
*
*
*                 SET UP WRITE LOCK IMAGE FOR DATA BREAKS
*
*                 AREA ABOVE 'GETHGP' IS PURE PROCEEDURE
*                 AREA BELOW IS DATA
*
INIT0    RES
         STW,11   LASTREC           PUT NOT-LAST-FLAG IN BUFFER
         STW,3    MAXSEG            SAVE MAX SEG#
         INT,1    CRIOADR           CARD ADDRESS
         LW,2     BLANKS            INITIALISEPACHSKIP2
         INT,3    TPIOADR           GET TAPE IO ADDRESS
         LC       BOOTFLG
         BCR,1    %+4               NO TAPE PATCHES, ALL IS RIGHT NOW
         STW,3    PSEG              START WITH TAPE IF NO CARDS
         BCR,2    %+3               NO CARDS
         STW,3    PSEG2             SAVE TAPE ADDR, SET 2 DEVICE FLAG
         STW,1    PSEG              BUT START WITH CARDS
         DO1      PSEG2+21-%
         LCI      4                 INITIALIZE REST OF BUF2
         LM,3     PSEG+20
         STM,2    PSEG2+19
GETACARD EQU      %
         BAL,4    READCARD
         MTW,1 DBRKLOC              COUNT CARDS
         LB,0     CARDIMAG          GET 1ST BYTE
         STH,0    PSEG              SAVE IT (MAKING BIG SEG#)
         CI,0     ':'               RECONFIGURATION COMMAND
         BE       RECONFIG    ****  GO TO RECONFIGURATOR
         CI,0     '#'               SYMBOL DEFINITION
         BE       SYMDEF            YUP
         CI,0     '*'
GCX      BE       EXITP0            RETURN (B SYMDEF7 IF PAST *)
         CI,0     '<'               COMMENT CARD
         BE       COMMENT           YUP
         BAL,4    MOVEXPRS0         GET SEG# IN INBUF
         STH,7    PSEG              SAVE VALUE IN CASE ZERO
         LW,3     7                 IF NO FIELD, IS ZERO
         BEZ      CHKSEG            SO DONT SCAN
         LI,0     %+X'80005'        UNDEFINED OK IN SEGNAME
PACHEVAL AND,0    %+3               SCRUB BAD BIG9 BITS
         STW,0    WHERETO           SAVE RETURN
         B        DRINITB           EVALUATE EXPRESSION
         DATA     X'8000FFFF'
         AW,5     10                CHECK THAT ONLY ONE ITEM OCCURRED
         BDR,5    DRERR
         CI,7     #SYMTYPE          MUST BE SYMBOL TOO
         BNE      DRERR
         LW,3     DREXPRS           GET THE VALUE
         BLZ      DRERR             NEG ILLEGAL
         CW,3     MAXSEG            IS IT TOO BIG
         BG       DRERR             YES
CHKSEG0  STH,3    PSEG              PUT IT AWAY (ONLY CHANGES CC2)
         BNE      %+2               SET BIG NAME IF LAST
         LI,14    -2
         CI,3     0                 IF ZERO, CHECK NAME
         BE       %+4
         CI,3     2+3+3             IF IN GHOSTS, MAKE DUMMY CHECK
         BG       %+2
         STD,3    14                UNLESS UNDEFINED
         LI,1     -1
         LW,0     PSEG+21
         CS,0     14
         BNE      CHKSEG1
         LW,0     PSEG+22
         CS,0     15
CHKSEG1  EQU      %
         STD,14   PSEG+21           SAVE NEW ONE
         BG       DRERR             BACKWARDS
         BL       EXITP             TO NEXT, MEBBE SWITCH DEVICES
CHKSEG   EQU      %
         LD,14    PSEG+21           GET TEXT SEGNAME
         LW,11    SYMDEF30          GET SKIP FLAG
         LH,1     PSEG              GET NEXT PATCH'S SEG #
         BEZ      ANALSTOR
         LW,11    BLANKS            GET NO SKIP FLAG IN CASE SEGNAME//
         CW,1     SEGNUM            IS IT THIS ONE
         BL       DRERR             GOING BACKWARDS
         BNE      EXITP             NO, RETURN
************************************************************************
*                                                                      *
*        ANALYZE AND OUTPUT PATCH LINE, STORE VALUE IN RIGHT PLACE     *
*                                                                      *
************************************************************************
ANALSTOR EQU      %
         BAL,4    MOVEXPRS0         NO, PUT SEGNO ON OUTBUF
         BAL,4    MOVEXPRS          MOVE LOC INTO IN-,OUT-PUT BUFFERS
         CI,3     X'1FF00'          IF 3 HAS BIAS OR EXIT ADDR FROM EXIT
         BAZ      SKIPCHK           THIS IS FIRST PATCH OF A NEW SEGMENT NAME
         AI,7     1                 MAKE FOR BDR SEGN// CHECK
         SD,14    PSEG2+21          SET FLAG TO NOT OUTPUT SECOND SEGN//
         OR,14    15                WITH THE SAME NAME
         XW,14    SEGSTRT           GET PREV FLAG
         BDR,7    SKIPCHK           THIS IS NOT SEGN//
         STW,11   PACHSKIP          SET SKIP FLAG APPROPRIATELY
         BEZ      GETACARD          SECOND THE SAME, DONT OUTPUT
         B        MOVCOM            FIRST, OUTPUT IT
SKIPCHK  LI,0     '.'               SKIP PADDING
         MTW,0    PACHSKIP          ARE WE SKIPPING
         BLEZ     COMMENT           YES
         BAL,0    PACHEVAL          SCAN AND EVALUATE
GOTADR   BAL,4    DREVALIT          FINAL EVALUATION
         STW,3    DR#DSIGN          TRUE LOAD LOCATION
         LH,1     PSEG              CHECK FOR SEGMENT OR ROOT
         BEZ      STORLOC           ROOT
         SW,3     SEGBASE           COMPUTE REXATIVE LOC IN BUFFER
         BLZ      DRERR
         CW,3     SEGMAX            DOES IT FIT
         BGE      DRERR             NO
         AW,3     SEGBUF
STORLOC  STW,3    ABSPLOC           SAVE ABS LOC
         CI,3     X'FFF0'           DONT PATCH REGISTERS
         BAZ      DRERR
         BG       DRERR             OR > 64K
         CW,3     DELPACHVAL
         BNE      NOTAT
         CI,3     MX:PPUT           AT TOP OF MPATCH YET
         BGE      TOOMANY           UH OH
         LI,0     '='               OUTPUT HEX EQUIVALENT ALSO
         LW,4     OUTCHAR
         AI,4     -1                PUT = ONTOP OF /
         STB,0    OUTBUF,4
         BAL,4    DRPRTHXA
         LI,0     '/'
         BAL,4    TYPOUT
NOTAT    EQU      %
         LI,0     18                SPACE OUT TO COLUMN 18
         BAL,4    SPACER
         LI,2     0                 SYMBOLIC PRINT MODE
         LW,3     *ABSPLOC          GET OLD VALUE
         BAL,4    DRPTEXP           PRINT IT
         LI,0     39                SPACE TO COLUMN 39 FOR OLD EXPRSION
         BAL,4    SPACER
         LI,0     '('               SET OLDVAL CHECK DELIM
         STB,0    CHARQ
         BAL,4    MOVEXPRS          MOVE PATCH EXPRS TO BOTH BUFFERS
         BAL,0    PACHEVAL          SCAN AND EVALUATE
STORVAL  BAL,4    DREVALIT          FINAL EVALUATION
         LC       CHARQ             DO WE HAVE OLD VALUE
         BCR,1    STORVAL0          NO
         STW,3    DRSYMSTR          YES, SAVE NEW VALUE
         BAL,4    MOVEXPRS          NO, GET OLD VALUE IN INBUF
         BAL,0    PACHEVAL          AND EVALUATE IT
         BAL,4    DREVALIT          FINAL EVALUATION
         CW,3     *ABSPLOC          EXPECTED VALUE VS. ACTUAL VALUE
         BNE      DRERR             THEY DON'T COMPARE
         LW,3     DRSYMSTR          RESTORE OLD VALUE
STORVAL0 EQU      %
         LW,1     DR#DSIGN          IF PATCHING PATCH AREA, INCR POINTER
         CW,1     DELPACHVAL
         BNE      %+2
         MTW,1    DELPACHVAL
         STW,1    DRTEMPS2          SAVE % FOR FIXPATCH
         STW,3    *ABSPLOC          STORE VALUE  WHERE IT SHOULD GO
MOVCOM   LI,1     35
         AW,1     CARDINDX
         CW,1     OUTCHAR
         BL       %+2
         STW,1    OUTCHAR
         SW,1     OUTCHAR
         LCW,1    1
         AWM,1    CARDINDX
         BAL,6    GETCHAR           MOVE ID PORTION
         CI,1     71                PATCHES ARE 72 BYTES MAX
         BL       GETCHAR
*
STORVAL1 BAL,4    MOVCARD           PUT PATCH IN PATCH FILE
         LC       BOOTFLG           ARE WE PRINTING
         BCR,4    %+2               NO
         BAL,7    DUMPBUF           YES, PUT OUT OUTPUT BUFFER
         B        GETACARD          GET NEXT CARD
MOVCARD  LI,6     CARDIMAG+20
MOVCARD1 LI,7     20
         AWM,7    MPRBUF
         LI,7     -20
         LW,0     *6,7
         STW,0    *MPRBUF,7
         BIR,7    %-2
         LW,7     MPRBUF
MPRCHK   EQU      %
         CI,7     LASTREC
         BL       0,4
MPRFILE  EQU      %                 WRITE PATCH DECK TO SWAPPER
         DO       MONSIM
         B        %+3
         GEN,8,24 17,M:PATCH
         DATA     0
         CAL1,1   %-2
         ELSE
         GOTO,VVM LASTREC
         MTW,2    BOOTFLG
         LW,8     PSA%END
         SW,8     BOOTFLG
         LB,0     MB:SDI
         STH,0    8
         BAL,11   DSCCVT
         STW,8    MPRSEEK
         LI,0     DA(MPRCMD1)       IOCD
         SIO,0    *MPRSWAP          WRITE ON SWAPPER
         BCS,12   %-1
         LI,8     15000
         BDR,8    %                 DELAY
         TIO,0    *MPRSWAP
         BCS,12   %-3
LASTREC  EQU      XDLT-12
         FIN
         LI,11    -20*25            GO BACK TO START OF PAGE
         AWM,11   MPRBUF
         B        0,4
MPRBUF   GEN,15,17  0,LASTREC-20*25
MPRSEEK  DATA     0                 SEEK ADDRESS
         BOUND    DW
MPRCMD1  GEN,8,24 3,BA(MPRSEEK)     SEEK ON
         DATA     X'22000004'
MPRCMD   GEN,8,24 1,BA(LASTREC-20*25)
         DATA     512*4
EXITP0   LW,3     BLANKS            RESET PACHSKIP FLAG
         STW,3    PACHSKIP
         LI,3     -1                MAKE BIG SEGN
         STD,3    PSEG+21
EXITP    LI,3     CHKSEG            RETURN IF WE SWITCH TO CARD
         LD,14    PSEG+21           GET CURR SEGNAME
         LC       PSEG2             ARE WE READING 2 DEVICES
         BCS,15   EXITP2            NO
         INT,1    PSEG              WHAT WERE WE DOING
         CW,1     CRIOADR
         BNE      %+3               WAS TAPE
*                                   SEE IF WE SHOULD USE TAPE OR
         AI,15    1                 CARD NEXT (TAPE HAS PRIORITY)
         LI,3     EXITP2            RETURN IF SWITCH
         LW,11    PSEG2+21          GET OTHER SEG #
         BNEZ     %+2               NOT FIRST TAPE SEG
         LI,3     GETACARD          READ TAPE SECOND FIRST TIME
         LI,11    -1
         LW,10    PSEG2+21
         CS,10    14
         BNE      CHKSNAM0
         LW,10    PSEG2+22
         CS,10    15
CHKSNAM0 EQU      %
         BGE      EXITP2            CURRENT DEVICE IS ALSO NEXT
         LI,2     23                POINTERS AND IMAGES ALSO
         LW,11    PSEG2-1,2
         XW,11    PSEG-1,2
         STW,11   PSEG2-1,2
         BDR,2    %-3
         B        0,3
CHKSNAM  GEN,8,24 8,14*4
EXITP2   EQU      %
         LH,0     PSEG              IS THIS A REAL NEW SEGN
         BEZ      CHKSEG            NO, GO BACK TO PROCESSING
         CW,0     SEGNUM            IF STILL THIS ONE, GO DO IT
         BE       CHKSEG
EXITP3   LCI      0                 YES, RESTORE REGISTERS
         LM,0     SAVREGS
         CW,1     MAXSEG            IS THIS THE LAST TIME
         BE       EXIT1             YES COPY REST OF THE PATCH DECK
         LI,14    CONFGSUM          ADDR.OF MESSAGE ROUTINE
         B        *11               RETURN TO LOADER
PATCHRTN B        *WHERETO          TRANSFER POINT ON RETURN FROM DELTA
TOOMANY  EQU      %                 MPATCH OVERFLOWED
         LI,1     TOOMANYM          MESSAGE
         BAL,4    DLMSG             TELL 'EM
         B        DRERR
TOOMANYM TEXTC    'PATCH AREA FULL'
*
EXIT1    EQU      %
         LI,4     SYMDEF7           SET RETURN FROM SYMDEF
         LW,5     BALMASK
         STS,4    SYMDEF5
         STS,4    GCX               AND ON FIXPATCH RETURNS
         STS,4    SYMDEF00          DONT ALLOW SYMBOL DEFS EITHRER
         BAL,4    MOVCARD           PUT ASTERISK IN FILE
         LC       PSEG2             IF ONLY ONE DEVICE,
         BCS,15   EXIT2             ONLY DO ONE
         INT,3    TPIOADR           MOVE TAPE RECORDS FIRST
         STW,3    PSEG
         BAL,5    READCARD0         READ AND PUT UNTIL BANG CARD
         INT,3    CRIOADR           CARDS NEXT
         STW,3    PSEG
EXIT2    BAL,5    READCARD0         NOW DO THE REST
         LI,3     0
         STW,3    MAXSEG            RETURN THIS TIME
         STW,3    PACHSYMSZ         DELETE PATCHING SYMBOLS
         STW,3    OUTCHAR           ZAP OUTBUF
         STW,3    WHERETO           AND PATCHING FLAG
         LW,2     MPRBUF            ZAP LAST WORD
         STW,3    20,2
         XW,3     DBRKLOC
         MTB,1    MPRBUF            MAKE IT GO TO MPRFILE
         BAL,4    MOVCARD
         LW,0     YC                DO WE NEED TO MAKE THIS MESSAGE
         AND,0    BOOTFLG
         BEZ      EXIT2A            NO
         EOR,0    YC
         STW,0    SEMIJ
         LI,0     #CRETRN           OUTPUT CR FIRST
         BAL,1    DRPRTSML
         BAL,4    DRPRTINT          OUTPUT INFORMATIONAL MESSAGE
         LI,1     CARDMESS          # OF PATCH CARDS READ
         BAL,4    DLMSG
         LI,3     MX:PPUT           TOP OF MPATCH+1
         SW,3     DELPACHVAL        CURRENT VALUE OF @
         STH,3    DELPACHVAL        PUT REMAINING COUNT IN TOP HALF
         BAL,4    DRPRTINT          =NO. OF LOCS. IN MPATCH
         LI,1     CARDMESSR         REMAINING
         BAL,4    DLMSG
         BAL,7    DUMPBUF
EXIT2A   STW,4    SEMIJ             SET TTY DEFOULT
         B        EXITP3
         PAGE
*
************************************************************************
*                                                                      *
*                                                                      *
************************************************************************
*
GETCHAR  LW,1     CARDINDX          GET POINTER
         LB,0     CARDIMAG,1        GET NEXT CHARACTER
         MTW,1    CARDINDX          BUMP POINTER
         B        PUTOUT            RETURN THRU PUTOUT
*
PUTIN    LW,7     NUMBCHAR          GET POINTER
         STB,0    INBUF,7           STORE CHARACTER IN INPUT BUFFER
         MTW,1    NUMBCHAR          BUMP POINTER
         B        0,5               RETURN
*
PUTOUT   LW,7     OUTCHAR           GET POINTER
         STB,0    OUTBUF,7          STORE CHAR IN OUTPUT BUFFER
         MTW,1    OUTCHAR           BUMP POINTER
         B        0,6               RETURN
*
MOVEXPRS0 LI,0    0
         STW,0    CARDINDX
         STW,0    OUTCHAR
         STB,0    CHARQ
MOVEXPRS STW,4    EXPRSEXT          SAVE RETURN ADR
         LI,0     0
         STW,0    NUMBCHAR          INITIALIZE INPUT BUFFER POINTERS
         STW,0    CHARINDX
         LI,5     %+1               RETURN FROM PUTIN
         BAL,6    GETCHAR           GET/PUT NEXT CHAR
         CI,1     72                ARE WE STILL IN 72 COLS
         BGE      DRERR             MUST BE MISSING SLASH
         LW,6     NUMBCHAR          IS THIS FIRST
         BNEZ     %+3               CHAR OF FIELD
         CI,0     ' '               YES-IT CAN'T BE BLANK
         BE       0,5               BUT IT IS - SO SKIP IT
         CI,0     '/'               CHECK FOR SLASH
         BE       %+5
         CB,0     CHARQ             CHECK FOR SPECIAL CHAR
         BNE      PUTIN             NO, STORE CHAR IN INPUT BUFFER
         AI,0     ')'-'('           CHANGE TO )
         STB,0    CHARQ
         LI,0     X'37'             REPLACE SLASH WITH SPECIAL CHAR TO
*                                   RETURN CONTROL TO PATCH ROUTINE
*                                   AFTER SCAN AND EVALUATION
         BAL,5    PUTIN             STORE SPECIAL CHAR
         B        *EXPRSEXT         RETURN
         PAGE
*
*
*
************************************************************************
*                                                                      *
*        CARD READER ROUTINE                                           *
*                                                                      *
************************************************************************
READCARD0 LI,4    SYMDEF6           RETURN FOR DOING GENMD PORTION
READCARD MTB,-2   CARDIMAG          CHANGE * TO BANG IF NO PATCHES
         LC       BOOTFLG
         BCR,3    0,4               NO PATCHES
         LI,6     X'FFFF'           GET DEVICE ADDR
         AND,6    PSEG
         DO       MONSIM
         AI,6     X'10000'          DCBS HAVE MOVED
         LW,1     ZAPCARD           BLANK IMAGE
         MBS,0    BA(BLANKS)
         CAL1,1   CARDCAL
         B        0,4
CARDCAL  DATA     X'90000006',X'30000010',CARDIMAG,72
ZAPCARD  GEN,8,24 72,BA(CARDIMAG)
         ELSE
         DO       VVM
         LI,0     DA(CRDBLWD)
         SIO,0    *6
         LI,0     5500
         BDR,0    %
         TIO,0    *6
         BCS,12   %-3
         ELSE
         LI,0     0                 SET CODE FOR ERROREC
         CW,6     CRIOADR
         BNE      %+2
         LI,0     1
         STW,0    ERECODE
         SLS,0    2                 0 OR 4 (TAPE,CARD)
         AI,0     2                 2,6  (TAPE,CARD)
         STB,0    CRDBLWD           SET COMMAND SO SIMULATOR WORKS
         LI,0     DA(CRDBLWD)       SET UP I/O
         REF      ERROREC
         BAL,11   ERROREC
ERECODE  DATA     0                 0 FOR TAPE, 1 FOR CARDS
         FIN
         FIN
         B        0,4               RETURN
*
         BOUND    DW
CRDBLWD  GEN,8,24 6,BA(CARDIMAG)
         DATA,1   2,,,72            SUPPRESS INCORRECT LENGTH
*
*
         PAGE
*                                                                       00065000
* COM DEFINITIONS USED IN GENERATING THE SYMBOL TABLE                   00066000
*                                                                       00067000
*                                                                       00071000
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
TBSOP    OPCODE   T,T,B,S
         OPCODE   T,B,S
BYTOP    OPCODE   C,B,S
         OPCODE   M,B,S
         OPCODE   C,R,A,P
         OPCODE   E,B,S
LCFIOP   OPCODE   L,C,F,I
         OPCODE   L,F,I
NOTAGFLD EQU      %-SPECODES
         OPCODE   L,C,I
LCFOP    OPCODE   L,C,F
         OPCODE   L,F
         OPCODE   L,C
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   N,O,P
         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
         OPCODE   B,E,V
         OPCODE   B,O,D
         OPCODE   C,X
         OPCODE   L,X
         OPCODE   M,T,X
         OPCODE   S,T,X
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
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      4                 TTBS
         COD      4,1               TBS
         COD      6                 CBS
         COD      6,1               MBS
         COD      0                 CRAP
         COD      6,3               EBS
         COD      ,2,3              LCFI
         COD      ,2,1              LFI
         COD      ,2,2              LCI
         COD      7,,3              LCF
         COD      7,,1              LF
         COD      7,,2              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      ,2                NOP
         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      6,8,8             BEV
         COD      6,9,8             BOD
         COD      7-:BIG-:BIG,1     COMPARE
         COD      7-:BIG-:BIG,2     LOAD
         COD      7-:BIG-:BIG,3     MODTST
         COD      7-:BIG-:BIG,5     STORE
         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
         BOUND    4
*                                                                       00108000
* STANDARD OPERATION CODES                                              00109000
*                                                                       00110000
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
         OPCODE   M,T,W                                                 00285000
         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
         OPCODE   M,T,H                                                 00393000
         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
         OPCODE   M,T,B
         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
         PAGE
************************************************************************
*                                                                      *
*        TABLE OF LOCATION AND CONSTANT SYMBOLS                        *
*                                                                      *
************************************************************************
         BOUND    DW
SPECSYM  EQU      %
DR#DSIGN DATA,FW  0                                                     00083000
         OPCODE   #%                                                    00084000
         OPCODE
DR#SEMII DATA,FW  0                                                     00089000
         OPCODE   #S:,I                                                 00090000
         OPCODE
DR#SEMIC DATA,FW  0                                                     00092000
         OPCODE   #S:,C                                                 00093000
         OPCODE
DR#SEMIF DATA     0
         OPCODE   #S:,F
         OPCODE
DR#SEMIH DATA     0
         OPCODE   #S:,H
         OPCODE
DR#SEMIQ DATA     0
         OPCODE   #S:,Q
         OPCODE
DR#SEMIM DATA,FW  -1                                                    00095000
         OPCODE   #S:,M                                                 00096000
         OPCODE
DR#SEMI1 DATA,FW  0                                                     00098000
         OPCODE   #S:,#1                                                00099000
         OPCODE
DR#SEMI2 DATA,FW  X'FFFF'
         OPCODE   #S:,#2                                                00102000
         OPCODE
NENTSPEC EQU      %-SPECSYM
         PAGE
************************************************************************
*                                                                      *
*        THE FOLLOWING DATA IS USER CONTEXT AND DELTA CONSTANTS        %
*                                                                      *
************************************************************************
DRSYMMAX EQU      8                 MAXIMUM SIZE SYMBOL ALLOWED         00829000
*                                                                       00832000
*
*
*                                                                       00834000
*                                                                       00835000
TOUT     DATA,4   0
BUSYMASK ORD8     X'66',0
*
OCIOADR  EQU      OCNDD
LPIOADR  EQU      OCNDD+1
CRIOADR  EQU      OCNDD+2
         DO       MONSIM
TPIOADR  EQU      OCNDD+1
         ELSE
TPIOADR  EQU      X'25'
         FIN
*
*                                                                       00847000
* ADDITIONAL SYMBOL ASSIGNMENTS FOR PUNCTUATION CHARACTERS AND PAIRS    00848000
*                                                                       00849000
#ASTRISK EQU      '*'                                                   00850000
#COMMA   EQU      ','                                                   00852000
#DOLLAR  EQU      '%'                                                   00853000
#GTRTHAN EQU      '>'                                                   00854000
#PLUS    EQU      '+'                                                   00855500
#MINUS   EQU      '-'                                                   00856000
#PERIOD  EQU      '.'                                                   00857000
#SLASH   EQU      '/'                                                   00860000
#BSLASH  EQU      X'4A'                                                 00860500
#SPACE   EQU      ' '                                                   00861000
#SQUOTE  EQU      ''''                                                  00862000
#CRETRN  EQU      X'15'                                                 00864000
#CRLF    EQU      X'15'
#2SPACE  EQU      '  '                                                  00868000
#SEMI:2  EQU      X'5E00'                                               00871000
#SLASHSP EQU      ' /'                                                  00872000
*                                                                       00874000
         PAGE                                                           00875000
*                                                                       00876000
* STORAGE FOR DEBUG READ/WRITE VARIABLES                                00877000
* THE FOLLOWING STORAGE MUST BE ON A READ/WRITE PAGE                    00878000
*                                                                       00879000
*                                                                       00902000
* AREA BELOW THIS POINT IS TO BE CONSIDERED VOLATILE                    00903000
*                                                                       00904000
*                                                                       00908000
         BOUND    DW
DRCHRBUF RES,BT   DRSYMMAX          RESERVE SPACE FOR BUILDING A SYMBOL 00909000
DRCHRBFX EQU      %                 SYMBOL USED WHEN INPUTTING TO BUFFER00910000
*                                                                       00911000
         BOUND    FW                                                    00912000
*                                                                       00913000
DRVALSAV RES,BT   12                BYTE STACK FOR INTEGER PRINT ROUTINE00914000
*                                                                       00915000
         BOUND    FW                                                    00916000
*                                                                       00917000
DRFNDVAL RES,FW   1                 VALUE BEING SEARCHED FOR            00922000
DRLOWPNT RES,FW   1                 USED IN ADDRESS PRINT ROUTINE       00923000
DRADRMOD DATA,FW  0                 VALUE OF ADDRESS PRINT MODE
DREVLRTN RES,FW   1                 STORAGE FOR RETURN LINK FROM EVAL   00929000
DRLSTOPR RES,FW   1                 STORAGE FOR LAST ARITHMETIC OPERATOR00930000
DRPRTSW  RES,FW   1                 STORAGE FOR ADDRESS PRINT MODE      00931000
DROPENER DATA,FW  1                 SWITCH : NON-ZERO MEANS SLASH MODE  00931750
DROPENSW DATA,FW  1                 SWITCH: NONZERO MEANS REGISTER CLOSED
DRPRTSAV RES,FW   1                 STORAGE FOR RETURN LNK FROM DRPRTADR00933000
DRPTEXP# RES,FW   1                 STORAGE FOR RETURN LINK FROM DRPTEXP00934000
DRCLSRTN RES,FW   1                 STORAGE FOR RETURN LINK FROM DRCLOSE00934500
DRSLSHMD RES,FW   1                 STORAGE FOR MOST RECENT PRINT MODE  00935000
DRTESTER RES,FW   1                 STORAGE FOR TEST USED IN SEARCHES   00937000
DRTAGVAL RES,FW   1                 STORAGE FOR INDEX FROM PRINT VALUE  00938000
DRUPRLIM RES,FW   1                 STORAGE FOR END TEST ON RANGE LOOK  00939000
DRWRDVAL RES,FW   1                 STORAGE FOR WORD TO BE PRINTED      00940000
DOTMODE  DATA,FW  0
DOTCHAR  RES,FW   1
ABSPLOC  RES,FW   1
BLNKUPER DATA,FW  X'4040FFFF'
BRKLOC   RES,FW   1
BRKMSGXT RES,FW   1
         RES      -1
         BOUND    8
         RES      1                 MAKE PSEG ON ODD BOUNDATY
PSEG     RES      1
PACHSKIP EQU      %+19
CARDIMAG TEXT     ';   '
         DO1      19
         TEXT     ' '
         DATA     0,0               CURRENT SEGMENT TEEXT
CARDINDX RES,FW   1
CARDMESS TEXTC    ' PATCHES READ  '
CARDMESSR TEXTC   ' PATCH LOCATIONS REMAINING  '
         BOUND    DW
CNSLIOBK EQU      %
         DATA     0,0
         DATA     CPINT
         ORD8     7,0
CURNOPR  RES,FW   1
CPIOXPSD XPSD,0   CNSLIOBK          CP INT WHILE DELTA IS IN CONTROL
         BOUND    8
DELSTK   DATA     DELSTK+1
         DATA,2   20,0
         RES      20                DELTAS WORKING STACK
DDUMP   DATA     0                 FLAG FOR DISC DUMP IN PROGRESS
LOGDISC  DATA     0
DISCADR DATA     0                 CONTAINS DISC UNIT ADR
BLNK     DATA     X'00404040'
DISCBUF  EQU      PACHSTRT
XDLKIMG  EQU      PACHSTRT
ISNAP    DATA     0,0               BYTE TABLE FOR SNAP SPECIFICATIONS
*                                   ON I BREAKS
M40TRAP  RES,FW   2                 ADDRESS FOR TRAP AT 40
         BOUND    8
DLIM     RES
         DO1      8
         DATA,8   0
         DO       MONSIM
HIGHPACH EQU      X'10000'
         ELSE
HIGHPACH EQU      X'A000'           PATCHES BELOW THIS WILL BE RECORDED
         FIN
PATCH    EQU      %                 HALF WORD BUFFER CONTAINING ADDRESSE
         RES      32                S OF PATCHES ENTERED ON-LINE
PRINTINT DATA,FW  0
         BOUND    DW
PRNTINTR GEN,8,24 5,BA(PRINTBUF)    COMMAND WORD TO GENERATE AN
         GEN,8,24,32 X'20',132,BA(PRINTBUF)
         GEN,4,28 1,132             I/O INTERRUPT ON PRINTER WHEN RETURN
*                                   ING TO THE MONITOR
PTCHINDX DATA     0                 INDEX INTO PATCH RECORDING BUFFER
BLANKCHECK DATA   0                 BLANK COUNTER
QUES     DATA,FW  X'00406F15'
RDIND    DATA,FW  0
         BOUND    8
MPCCLIST :CDW     3,BA(MPCSEEK),CC,5
         :CDW     1,BA(MPCSEEK1),CC,5
READCOM  :CDW     3,BA(TRACK),CC,4
         :CDW     2,BA(DISCBUF),CC,1024
         :CDW     8,DA(%+4)
         :CDW     8,DA(READCOM)
         :CDW     4,BA(TRACK),NCC,4
MPCCDW   :CDW     3,BA(MPCORDER),CC,5
MPCSEEK  :IDCW,SK 1,X'11'           MPC SEEK ORDER
MPCSEEK1 DATA     0,0               MPC SEEK ADDRESS
MPCORDER :IDCW,RD                   MPC REED ORDER
XERCDW   :CDW     3,BA(TRACK),CC,4
24BM8    DATA     X'FFFFF8'
STORFLAG RES      1
SUBSVAL  RES      1
SYMTADR  RES,FW   1                 START ADDR OF CURRENT SYM TAB
TRACK    RES,FW   1                 TRACK ADR FOR DISC WRITE
TRACBITS RES,FW   1
TYPINT   DATA,FW  0
         BOUND    DW
TYPINTR  GEN,8,24 5,BA(TYPJUNK)     COMND WORD TO GENERATE AN INTRPT
         GEN,4,28 1,1
TYPJUNK  DATA,FW  0
UPRLIM   RES,FW   1
WHCHSRCH RES,FW   1                 POINTS TO VALUE OR SYMBOL SEARCH
*                                   ROUTINE
EXPRSEXT RES      0                 SAME AS WHERETO
WHERETO  RES,FW   1
*
************************************************************************
*                                                                      *
*        DATA DEFINITIONS FOR FOR DATA BREAKPOINT PROCESSING
*                                                                      *
************************************************************************
*
*        DATA BREAKPOINT TABLE
*
         BOUND    FW
DBRKLOC  EQU      %
         DO       8
         DATA,FW  0
         FIN
DBRKCOND EQU      %
         DO       8
         DATA,FW  -1
         FIN
DBRKVAL  RES,FW   8
DBRKMASK EQU      %
         DO       8
         DATA,FW  X'FFFFFFFF'
         FIN
*
CONDTION EQU      %
         DATA,HW  0                 DUMMY ENTRY
         DATA,HW  'SL'
         DATA,HW  'EL'
         DATA,HW  'QE'
         DATA,HW  'EN'
         DATA,HW  'RG'
         DATA,HW  'EG'
         BOUND    FW
DBEFADR  RES,4    1                 EFFECTIVE ADDRESS CAUSING BREAK
DBKCNDTN BG       DATABRK           CODE WHICH PERFORMS COMPARISON
         BGE      DATABRK           FOR CONDITIONAL D BREAKS
         BE       DATABRK           THE ORDER IS THE REVERSE OF
         BNE      DATABRK           THE CONDITION TABLE ABOVE,
         BL       DATABRK           BUT IS CORRECT.
         BLE      DATABRK
DBPT     DATA,FW  ' >D;'
DBRKMODE DATA,FW  -1                NEG MEANS NOT IN D BREAK MODE
DBRKNENT DATA,FW  0                 ENTRIES   IN DATA BREAKPOINT TABLE
DBRKNUM  DATA,FW  0                 # OF D BREAK CAUSING THE TRAP
         BOUND    DW
SAVREGS  RES,FW   16                USERS REGISTERS AFTER A DATA BREAK
SEGNUM   EQU  SAVREGS+1
SEGBUF   EQU  SAVREGS+2
SEGBASE  EQU  SAVREGS+3
SEGMAX   EQU  SAVREGS+6
SLSHEXIT DATA,FW  MESSAGE
TRACETBL DATA,FW  0                 BITS 0-7 ARE TRACE INDICATORS
*
         BOUND    8
OLDPSD   GEN,32,4,28 0,2,0          WRITE KEY = 2
************************************************************************
*                                                                      *
*        DATA DEFINITIONS FOR INSTRUCTION BREAKPOINTS                  *
*                                                                      *
************************************************************************
*        INSTRUCTION BREAKPOINT TABLE                                  *
************************************************************************
         BOUND    FW
IBRKLOC  EQU      %
         DO       8
         DATA,FW  0
         FIN
IBRKINST RES,FW   8
IBRKDPLY RES,FW   8
IBRKPRCD RES,FW   8
************************************************************************
*
BALMASK  DATA     X'97FFFFFF'
IBPT     DATA,FW  ' >B;'
IBRKJUMP B        1
IBRKMODE DATA,FW  -1                NEG MEANS NOT IN I BREAK MODE
IBRKNENT DATA,FW  0                 # OF ENTRIES IN I BREAK TABLE
IBRKNUM  DATA,FW  0                 # OF CURRENT I BREAK
IBRKXPSD XPSD,0   LEE20             RETURN CONTROL TO DELTA FROM USER
ITRCTBL  DATA,FW  0                 I BREAK TRACE TABLE
         PAGE
BEGINLOC RES,FW   1
ENDOFDMP RES,FW   1
LASTLOC  RES,FW   1
SUM      RES,FW   1
BLANKS   DATA,FW  '    '
*
*
*        DATA DEFINITIONS FOR MESSAGE INPUT
*
CHARINDX DATA,FW  0
NUMBCHAR DATA,FW  0
INBUF    RES,FW   20
BRKCHAR  DATA,BT  '?'               IGNORE MESSAGE CHARACTER
         DATA,BT  '&'        UP ARROW
         DATA,BT  '='
         DATA,BT  X'15'      CARRIAGE RETURN
         DATA,BT  X'08'      LINE FEED
         DATA,BT  '/'
         DATA,BT  5                 TAB
         DATA,BT  ')'
         BOUND    FW
*
*        DATA DEFINITIONS FOR OUTPUT MODE SPECIFICATION
*
MODINPUT DATA,FW  -1         FLAG INDICATIONG THAT OUTPUT MODE
*                            HAS BEEN SPECIFIED
OUTMODE  DATA,FW  0          SPECIFIED OUTPUT MODE
*                                                                       00941000
DROFFSET DATA     X'400'            LARGEST DIFFERENCE TO LABEL
*                                   IN ADDRESS OUTPUT
DRSLDFLT DATA,FW  0                 VALUE OF SLASH DEFAULT MODE         00942000
DREQDFLT DATA     3                 VALUE OF EQUAL DEFAULT MODE
*                                                                       00944000
* SPECIAL STORAGE FOR USE BY PROCEED CODE                               00945000
*                                                                       00946000
         BOUND    DW                                                    00947000
*                                                                       00948000
*                                                                       00953000
DRSRCHLM RES,DW   1                 STORAGE FOR SEARCH LIMITS           00954000
DREXPRS  RES,FW   4                 STORAGE FOR EXPRESSION FIELDS       00956000
*                                                                       00968200
DRTEMPS1 RES,FW   1                 SINGLE WORD TEMPORARY STORAGE       00969000
DRTEMPS2 RES,FW   1                                                     00970000
*                                                                       00974000
         BOUND    DW                                                    00975000
*                                                                       00976000
DRTEMPD1 RES,DW   1                 DOUBLEWORD TEMPORARY STORAGE        00977000
*                                                                       00981100
*                                                                       00982000
*
*
*                                                                       00984000
* STORAGE FOR READ ONLY DATA AND CODE                                   00985000
*                                                                       00986000
*                                                                       00988000
*                                                                       00993000
*
*
*                                                                       01394000
* 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
*                                                                       01398000
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
* DEFINITIONS FOR THE VARIOUS INPUT TYPES                               01408000
*                                                                       01409000
#S3      EQU      DRBUILD                                               01410000
*                                                                       01411000
#EBDTYPE EQU      DREBCDIC-#S3      INDEX FOR EBCDIC INPUT              01412000
#SYMTYPE EQU      DRSYMBOL-#S3      INDEX FOR SYMBOL INPUT              01413000
#INTTYPE EQU      DRINTGER-#S3      INDEX FOR INTEGER INPUT             01414000
#HEXTYPE EQU      DRHEXAD-#S3       INDEX FOR HEXADECIMAL INPUT         01416000
#NUMTYPE EQU      DRNUMBER-#S3      INDEX FOR NUMBER INPUT              01417000
#SPCTYPE EQU      DRSPCINP-#S3      INDEX FOR EBCDIC CLEAN-UP ROUTINE   01418000
*
*
*                                                                       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           SPACE                               01443000
DRPADDER DATA,HW  DRINITC           PLUS                                01444000
DRPMINUS DATA,HW  DRINITC           MINUS                               01445000
DRPCOMMA DATA,HW  DRCOMMA           COMMA                               01445500
DRPASTIK DATA,HW  DRASTISK          ASTERISK
DRPCRTRN DATA,HW  DRCRTRN           CARRIAGE RETURN                     01446000
DRPLFEED DATA,HW  DRLFEED           LINE FEED                           01447000
DRPTAB   DATA,HW  DRTAB             TAB (MUST BE NEXT TO LF AND UPARROW)
DRPUAROW DATA,HW  DRUPAROW          UP ARROW                            01448000
DRPBSLSH DATA,HW  DRBSLASH          BACKSLASH                           01449000
DRPSLASH DATA,HW  DRSLASH           SLASH                               01450000
DRPEQUAL DATA,HW  DREQUAL           EQUAL                               01453000
DRPLSTHN DATA,HW  DRLSTHAN          LESS THAN                           01453250
DRPATCHR DATA,HW  PATCHRTN          SPECIAL CHAR FOR BOOT-TIME PATCHING
DRVAL1XX EQU      %                 END OF EVALUATING PUNCTUATION       01453500
DRPPEROD DATA,HW  DRPERIOD          PERIOD                              01454000
DRPEXCLM DATA,HW  DREXCLAM          EXCLAMATION                         01458000
DRPLFPAR DATA,HW  CHNGMODE
DRPRTPAR DATA,HW  STEPPER           ;Q;X,LINE FEED
DRPSCOLN DATA,HW  DRSCOLON          SEMICOLON                           01460000
DRPRBRKT DATA,HW  FIXPATCH          RIGHT BRACKET
DRPSQUOT DATA,HW  DRSQUOTE          SINGLE QUOTE                        01465000
DRXX     DATA,HW  DRERR             ERROR EXIT                          01467000
         BOUND    FW
*                                                                       01470000
*
*
*                                                                       01472000
* SEMI-COLON COMMAND DISPATCH TABLE                                     01473000
* HALF WORD TABLE OF ADDRESS POINTERS                                   01474000
*                                                                       01475000
         BOUND    FW                                                    01476000
*                                                                       01477000
DRPOINT2 EQU      %                                                     01478000
DRPSEMII DATA,HW  DRSPCHR           ;I                                  01478200
DRPSEMIC DATA,HW  DRSPCHR           ;C                                  01478300
DRPSEMIF DATA,HW  DRSPCHR           ;F                                  01478400
DRPSEMIH DATA,HW  DRSPCHR           ;H
DROLIMIT EQU      HA(%)-HA(DRPOINT2)
DRPSEMIQ DATA,HW  DRSPCHR           ;Q
DRPSEMIM DATA,HW  DRSPCHR           ;M                                  01478500
DRPSEMI1 DATA,HW  DRSPCHR           ;1                                  01478600
DRPSEMI2 DATA,HW  DRSPCHR           ;2                                  01478700
DRPSEMIB DATA,HW  DRSEMIB           ;B                                  01480000
DRPSEMID DATA,HW  DRSEMID           ;D
DRPSEMIG DATA,HW  DRSEMIG           ;G                                  01484000
DRPSEMIL DATA,HW  DRSEMIL           ;L                                  01487000
DRPSEMIN DATA,HW  DRSEMIN           ;N                                  01489000
DRPSEMIO DATA,HW  DRSEMIO           ;O  PRINTER DUMP
DRPSEMIP DATA,HW  DRSEMIP           ;P                                  01490000
DRPSEMIR DATA,HW  DRSEMIR           ;R
DRPSEMIS DATA,HW  DRSEMIS           ;S
DRPSEMIW DATA,HW  DRSEMIW           ;W                                  01495000
DRPSEMIX DATA,HW  DRSEMIX           ;X                                  01496000
DRPSEMIZ DATA,HW  DRSEMIZ           ;Z                                  01498000
DRSLIMIT EQU      HA(%)-HA(DRPOINT2)
DRPSEMIA DATA,HW  DRSEMIA           ;A
DRPSEMIE DATA,HW  SEMIE             ;E
DRPSEMIJ DATA,HW  DRSEMIJ           ;J
DRPSEMIK DATA,HW  DRSEMIK           ;K
DRPSEMIT DATA,HW  DRSEMIT           ;T
DRPSEMIU DATA,HW  DRSEMIU           ;U
DRPSMISL DATA,HW  DRSEMISL          ;/                                  01501000
DRPSMIEQ DATA,HW  DRSEMIEQ          ;=                                  01502000
DRPSMIER DATA,HW  DRERR             ILLEGAL SEMI-COLON COMMAND          01504000
         BOUND    FW
*                                                                       01505000
*
*
*                                                                       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
*                                                                       01512000
DRDELBAD EQU      HA(DRXX)-#T1      PUNCTUATION ERROR INDEX             01513000
*                                                                       01514000
         BOUND    FW                                                    01515000
*                                                                       01516000
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  HA(DRPLFEED)-#T1  LINE FEED = EOM
         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(DRPLFPAR)-#T1     ( = BACKARROW
         DATA,BT  HA(DRPADDER)-#T1  PLUS                                01532000
         DATA,BT  DRDELBAD          --
         DATA,BT  HA(DRPUAROW)-#T1  UPARROW = &
         DATA,BT  DRDELBAD          --                                  01535000
         DATA,BT  DRDELBAD          --                                  01536000
         DATA,BT  DRDELBAD          --                                  01537000
         DATA,BT  DRDELBAD          --                                  01538000
         DATA,BT  HA(DRPCRTRN)-#T1  CARRIAGE RETURN                     01539000
         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  DRDELBAD          --                                  01560000
         DATA,BT  HA(DRPCOMMA)-#T1  COMMA                               01561000
         DATA,BT  DRDELBAD          --
         DATA,BT  DRDELBAD          --
         DATA,BT  DRDELBAD          --
         DATA,BT  DRDELBAD          --
         DATA,BT  DRDELBAD          --                                  01566000
         DATA,BT  DRDELBAD          --                                  01567000
         DATA,BT  DRDELBAD          --                                  01568000
         DATA,BT  DRDELBAD          --                                  01569000
         DATA,BT  DRDELBAD          --                                  01570000
         DATA,BT  DRDELBAD          --                                  01571000
         DATA,BT  DRDELBAD          --                                  01572000
         DATA,BT  HA(DRPATCHR)-#T1  SPECIAL PATCH CHARACTER
         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  DRDELBAD          --
         BOUND    FW
*                                                                       01582000
*
*
*                                                                       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  DRSMIBAD          --
         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
         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  DRSMIBAD          --
         DATA,BT  HA(DRPSEMIW)-#T2  ;W                                  01633000
         DATA,BT  HA(DRPSEMIX)-#T2  ;X                                  01634000
         DATA,BT  DRSMIBAD          --
         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  DRSMIBAD          --                                  01646000
         DATA,BT  DRSMIBAD          --                                  01647000
         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
*                                                                       01659000
*
*
*                                                                       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
         NOP                        INDIRECT BIT
         BAL,14   DRMULTR           ASTERISK (MULTIPLICATION)
         BAL,14   DRMULTR           ** POS SHIFT
         BAL,14   DRMULTR           **- NEG SHIFT
*                                                                       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
*
*
*                                                                       01685000
DRTYPCHR EQU      %                                                     01686000
         DATA,BT  0                 DUMMY ENTRY - NOT USED              01687000
         DATA,BT  'R'               RELATIVE                            01688000
         DATA,BT  'A'               ABSOLUTE                            01689000
         DATA,BT  'C'               EBCDIC                              01689500
         DATA,BT  'X'               HEXADECIMAL                         01691000
         DATA,BT  'I'               INTEGER                             01693000
*        SPACE DELETED AS OUTPUT MODE TYPE
*                                                                       01695000
DRTYPCNT EQU      BA(%)-BA(DRTYPCHR) NUMBER POSSIBLE OUTPUT TYPES       01696000
DRTYPLST EQU      DRTYPCNT-1        INDEX TO LAST ELEMENT OF TYPE ARRAYS01696500
*                                                                       01697000
*                                                                       01698000
*                                                                       01699000
*                                                                       01700000
* TRANSFER VECTOR FOR DISPATCHING TO THE APPROPRIATE PRINT ROUTINE      01701000
* INDEXED BY OUTPUT TYPE VALUE                                          01702000
*                                                                       01703000
DRPRTVEC B        DRPTEXPR          RELATIVE
         B        DRPTEXPR          ABSOLUTE
         B        DRPRTEBD          EBCDIC                              01706500
         B        DRPRTHXA
         B        DRPRTINT          INTEGER (SIGNED)                    01710000
*                                                                       01785000
         BOUND    DW                                                    01786000
*                                                                       01787000
DRALPHAS DATA,FW  ':','@'           RANGE OF SPECIAL ALPHABETIC DIGITS  01788000
DRHEXAS  DATA,FW  KC1-KF0           SPECIAL CHECK FOR THE CHARACTER A   01789000
         DATA,FW  KC6-KF0           SPECIAL CHECK FOR THE CHARACTER F   01789500
DRSCNFIX DATA,FW  0,#SYMTYPE        USED TO PUT SCANNER IN SPECIAL STATE01793000
DRSCNSET DATA,FW  -DRSYMMAX,#NUMTYPE USED TO INITIALIZE THE SCANNER     01794000
*                                                                       01795000
*                                                                       01796000
*
*
*                                                                       01798000
DRVAL1   EQU      HA(DRVAL1XX)-#T1  INDEX FOR DECIDING WHEN TO EVALUATE 01801000
*                                                                       01802000
*                                                                       01804000
*                                                                       01806000
#S4      EQU      DREXUTB1                                              01807000
*                                                                       01811000
*
*
*                                                                       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
DELTMSG  TEXTC    '
DELTA'
*                                                                       01849000
* MESSAGES OUTPUT TO THE USER VIA THE DRPRTSML ROUTINE                  01850000
*                                                                       01851000
NOMESS   DATA,FW  'ENON'
TRACOUT  DATA,FW  ' T '
#3SPACE  DATA,FW  '   '
*                                                                       01857000
*
*                                                                       01859000
         BOUND    FW
EFADR    DATA,FW  0
TYPE     DATA,FW  0
BALREG   DATA,FW  0
         BOUND    DW
OPLMTS   DATA     X'64',X'6A'
*                                                                       01753000
DRD10    DATA,FW  10                VALUE USED AS RADIX IN INTEGER PRINT01754000
*
*
*                                                                       00995000
* DEFINITIONS OF ADDRESSES USED IN IMMEDIATE INSTRUCTIONS               00996000
*                                                                       00997000
KF       EQU      X'F'                                                  01011000
K3F      EQU      X'3F'                                                 01016000
K40      EQU      X'40'                                                 01017000
KLCIBIT  EQU      X'40'
K7F      EQU      X'7F'                                                 01021000
K80      EQU      X'80'                                                 01022000
KC1      EQU      X'C1'                                                 01023500
KC6      EQU      X'C6'                                                 01023750
KF0      EQU      X'F0'                                                 01024000
K100     EQU      X'100'
K200     EQU      X'200'                                                01030000
K600     EQU      X'600'                                                01033000
K2000    EQU      X'2000'                                               01038000
K3FFF    EQU      X'3FFF'                                               01039000
K8000    EQU      X'8000'                                               01042000
*                                                                       01064000
*
*
*                                                                       01066000
* DEFINITIONS OF IMMEDIATE ADDRESSES USED AS MASKS                      01067000
*                                                                       01068000
KM6      EQU      K3F                                                   01072500
KM3      EQU      7
KADMSKM  EQU      X'1FFFF'
*                                                                       01081000
*
*
*                                                                       01083000
DRMODREL EQU      0                 VALUE FOR RELATIVE ADDRESS MODE
DRMODABS EQU      1                 VALUE FOR ABSOLUTE ADDRESS MODE
*                                                                       01086000
DRDEFMOD EQU      K200              INDICATOR FOR SYMBOL DEFINE MODE    01096500
KASTBIT  EQU      K2000             INDICATOR FOR INDIRECT ADDRESS      01099000
*                                                                       01104000
* TABLE USED FOR BIT TESTING                                            01105000
* NOTE : THE ODERING OF THIS TABLE MUST NOT BE CHANGED                  01106000
*                                                                       01107000
DRBIT0   DATA,4   X'80000000'                                           01110000
DRBIT5   DATA,4   X'4000000'                                            01115000
DRBIT9   DATA,4   X'400000'                                             01119000
DRBIT18  DATA,4   X'2000'                                               01128000
DRBIT19  DATA,4   X'1000'                                               01129000
DRBIT22  DATA,4   X'200'                                                01132000
DRBIT24  DATA,4   X'80'                                                 01134000
DRBIT26  DATA,4   X'20'                                                 01136000
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
* M IS USED FOR MASKS                                                   01144000
*                                                                       01145000
M3       EQU      MASKS+3
M4       EQU      MASKS+4
M7       EQU      MASKS+7
M16      EQU      MASKS+16
M17      EQU      MASKS+17
M20      EQU      MASKS+20
*                                                                       01160000
* X IS USED FOR RIGHT JUSTIFIED HEX                                     01161000
*                                                                       01162000
XF0      DATA,4   X'F0'                                                 01165000
*                                                                       01171000
*                                                                       01173000
* Y IS USED FOR LEFT JUSTIFIED HEX                                      01174000
*                                                                       01175000
Y7FF     DATA,4   X'7FF00000'                                           01200000
YFF      DATA,4   X'FF000000'                                           01203000
YFFFF    DATA,4   X'FFFF0000'                                           01204000
         BOUND    FW                                                    01860000
*                                                                       01861000
*
*
*                                                                       01713000
DRADFLD  EQU      M17
DRADMSKS GEN,12,1,1,1,17  0,:BIG,:BIG,:BIG,X'1FFFF'
DRADMSKL EQU      M20                                                   01722000
*                                                                       01723000
DROPBITS EQU      Y7FF                                                  01724000
*                                                                       01725000
DRASTBIT EQU      DRBIT18           BIT USED TO INDICATE INDIRECT ADDR  01726500
DRFLDBIT EQU      DRBIT28                                               01728000
DRSOPRFL EQU      DRBIT19
*                                                                       01734000
DRFD1BIT EQU      4                 BIT TO INICATE FIELD 1 WAS USED     01736000
DRSOPRBT EQU      X'1000'
*                                                                       01740100
*                                                                       01741000
DREBDMSK EQU      YFF                                                   01742000
*
*
SYMBOLS  EQU      %
SYME     CNAME
SYM      CNAME    1
         PROC
         DO1      NAME
         REF      AF
         DEF      LF
LF       EQU      AF
         PEND
         GOTO,VVM MASKS:
S:CUN:   SYM      S:CUN
TSTACK:  SYME     TSTACK
BITS:    SYM      BT31TO0
NBITS:   SYM      NB31TO0
MASKS:   SYME     MASKS
*                                                                       01392000
         DO       MONSIM
         REF      F:CP,F:TP
         RES      100               FOR SYMBOLS
OCNDD    EQU      %-1
         DATA     F:TP,F:CP
KEYIN    DATA     X'4000000',X'F0000000',MESS,MESS,8,KEYIN
MESS     TEXTC    'CODES?'
CODES    TEXTC    'DFTCPI'
BOOTFLG  DATA     0
START    CAL1,2   KEYIN
         LB,1     MESS
         LI,3     1
         LB,2     CODES
         LB,0     MESS,1
         SCS,3    -1
         CB,0     CODES,2
         BNE      %+2
         STS,3    BOOTFLG
         BDR,2    %-4
         BDR,1    %-8
         CAL1,8   TRAPCAL
         LI,2     OCNDD+2
         STW,2    XDLT+3
         LI,1     0
         LI,3     17
         BAL,11   PACHSTRT
         LI,2     X'C000'
         LI,3     X'C000'
         LI,5     17
         LI,6     500
         AI,1     1
         BAL,11   PACHSTRT
         BDR,5    %-2
         CAL1,1   PCLOS
         CAL1,9   1
PCLOS    GEN,8,24 21,M:PATCH
         DATA     X'80000000',2
TRAPCAL  DATA     X'14000002'+%
         DATA     X'200001'
         BCR,2    BADTRAP
         LW,2     0,1
         LB,3     *2
         ANLZ,4   0,2
         AI,3     -14
         BNEZ     %+4
         LD,6     0,4
         STD,6    *1
         CAL1,9   5
         MTW,1    0,1
         AI,3     -1
         BNEZ     %-3
         LD,6     *1
         STD,6    0,4
         LD,6     2,4
         STD,6    *1
         CAL1,9   5
MASKS    EQU      %-1
         LOCAL    I
I        DO       24
         DATA     -1+1**(I)
         FIN
MPATCH   RES      100
MX:PPUT  EQU      %
BADTRAP  CAL1,2   KEYIN
         MTW,1    0,1
         CAL1,9   5
         RES      512
LASTREC  EQU      %-12
M:PATCH  DSECT    2
         DATA     1,X'40000',LASTREC-500,X'10000000',0
         DATA     X'80000011',PFLP,0,0,0,PKBF
         DO1      11
         DATA     0
PFLP     DATA,1   1,0,2,2
         TEXTC    'PATCH'
         DATA,1   2,1,0,2
         RES      2
PKBF     RES      8
         USECT    START
         BOUND    8
EXECINST RES      1
         XPSD,0   EXECPSD
EXECPSD  RES      2
         DATA     0,0
IBRKEXEC RES      2
LEE20    RES      2
         DATA     XDLT,0
LKIMG    EQU      %
LKWRD    RES      3
         ELSE
START    EQU      XDLT
         FIN
         END      START

