
      HED ERROR ROUTINES
* 
*  WHILE READING A PROGRAM IN 'TAPE' MODE, ERRONEOUS STATEMENTS 
*  ARE REPLACED WITH ERROR PSUEDO-STATEMENTS.  THESE ARE THREE
*  WORD 'STATEMENTS':  THE STATEMENT NUMBER, THE LENGTH (ALWAYS 
*  3), AND THE ERROR NUMBER.  SINCE BITS 15-9 ARE CLEAR IN WORD 
*  THREE, ERRORS HAVE A STATEMENT TYPE OF 0.  ERRCT HOLDS A 
*  COUNT OF THE EMBEDDED ERRORS AND THE USER'S BIT OF TERR IS 
*  SET IF ANY EMBEDDED ERRORS EXIST.  ADDITIONALLY, THE 'OUT-OF-
*  STORAGE' ERROR SETS OFLAG = 1 TO ASSIST SYNTAX.  ALL STATEMENTS
*  WITH A SEQUENCE NUMBER OF ZERO WILL BE COLLAPSED INTO A SINGLE 
*  ERROR AND UNDER/OVERFLOWS IN NUMERICAL CONSTANTS ARE NOT 
*  REPORTED.
* 
**                             ** 
***  OUTPUT TAPE MODE ERRORS  *** 
**                             ** 
* 
*  UPON ENTRY ALL EMBEDDED ERRORS ARE STRIPPED FROM THE PROGRAM 
*  AND STORED BELOW IT AS TWO-WORD QUANTITIES (THE LENGTH WORD
*  IS DROPPED).  FOLLOWING THIS THE ERRORS ARE PRINTED ONE BY 
*  ONE WITH LINE NUMBERS.  AFTER PRINTING ALL ERRORS (OR, IF THE
*  USER ABORTS THE ERROR PRINTING, AFTER THE USER TYPES THE NEXT
*  LINE) EVERYTHING IS CLEANED UP AND A MESSAGE PRINTED TO SAY
*  THE LAST RECEIVED INPUT HAS BEEN IGNORED.
* 
TAPER CLA           FIRST 
      CPA ERRCT       ENTRY?
      JMP TAPE5     NO
      STA OFLAG     YES, RESET 'OUT-OF-STORAGE' FLAG
      LDA PBPTR     INITIALIZE
      STA SPTR
      LDB PBUFF       PROGRAM 
      STB DEST
      STB SOURC         POINTERS
*                               * 
**  STRIP OUT EMBEDDED ERRORS  ** 
*                               * 
TAPE1 INB           SET (B) 
     LDA 1           TO FIRST WORD
      ADB 1,I           OF NEXT 
      ADB .-1             PROGRAM STATEMENT 
      INA           IS THE
      LDA 0,I         CURRENT STATEMENT 
      AND OPMSK         OF TYPE 
      SZA                 'ERROR' ? 
      JMP TAPE1     NO
      LDA SOURC     YES, LOAD SOURCE ADDRESS
      STB SOURC     SET SOURCE TO NEW VALUE 
      ADB .-3       JUXTAPOSED
      CPA 1           ERRORS? 
      JMP TAPE2     YES, NO MOVE NEEDED 
      CPA DEST      NO, FIRST ERROR ENCOUNTERED?
      JMP TAPE6     YES 
      JSB MOVER     NO, DELETE PRIOR ERROR(S) 
TAPE2 LDB PBPTR     ENOUGH
      STB TAP0
      INB             USER SPACE
      CPB LWAUS 
      JMP TAPE7         TO TRANSFER 
      INB 
      CPB LWAUS           ERROR?
      JMP TAPE7     NO
      STB PBPTR     YES, APPEND TWO WORDS 
      LDB 0,I       TRANSFER
      STB TAP0,I      LINE NUMBER 
      ISZ TAP0
      ADA .+2       TRANSFER
      LDB 0,I         ERROR 
      STB TAP0,I        NUMBER
      LDB SOURC     RETRIEVE POINTER TO STATEMENT 
      CCA           DECREMENT 
      ADA ERRCT       ERROR 
      STA ERRCT         COUNTER 
      SZA           ALL ERRORS DELETED? 
      JMP TAPE1     NO
      CPB SPTR      YES, PROGRAM REMAINING? 
      JMP TAPE3     NO
      LDA SOURC     YES, SLIDE UP 
      LDB SPTR        OVER LAST 
      JSB MOVER         ERROR(S)
*                           * 
**  OUTPUT ERROR MESSAGES  ** 
*                           * 
TAPE3 LDA RETAD     SET 
      STA SERR        RETURN ADDRESS
      LDA WERRA     FAKE
      ADA FERRA 
      CMA,INA         'WARNING ONLY'
      STA LT5           ERROR MODE
TAPE4 CCB           FORCE 
      STB LT6         LINE NUMBER 
      LDB SPTR,I    MAKE LINE NUMBER OF 
      STB .LNUM       CURRENT ERROR ACCESSIBLE
      ISZ SPTR      LOAD
      LDB SPTR,I      ERROR                      [B]
      STB LT3           NUMBER                   [B]
      JMP SER1A     EXIT TO ERROR PRINTER        [B]
RETAD DEF *+1 
      LDA FERRA     RESTORE 
      CMA,INA       'WARNING
      ADA LT5           ONLY' 
      STA LT5             MODE
      ISZ SPTR      MORE
      LDA SPTR
      CPA PBPTR       ERRORS? 
      RSS           NO
      JMP TAPE4     YES 
TAPE5 LDA DEST      CORRECT POINTER TO
      STA PBPTR       LAST WORD +1 OF PROGRAM 
      CLF 0 
      LDA TERR      TURN
      CMA             ERROR 
      AND MAIN,I        FLAG
      STA MAIN,I          OFF 
      STF 0 
      JSB RERRS+33,I  EMIT PARTING SHOT 
* 
TAPE6 STB DEST      SET DESTINATION POINTER 
      LDA 1           TO FIRST ERROR ENCOUNTERED
      JMP TAPE2 
TAPE7 STA TAP1      SAVE SOURCE ADDRESS 
      CMA,INA       COMPUTE SIZE OF AREA
      ADA DEST        TO BE RECLAIMED 
      STA TAP0          AND SAVE IT 
      ADA SPTR      RESET POINTER TO
      STA SPTR        LAST WORD +1 OF PROGRAM 
      LDB SOURC     SET POINTER TO
      ADB TAP0        NEXT STATEMENT
      STB SOURC         TO NEW VALUE
      LDA TAP1      RETRIEVE SOURCE ADDRESS 
      LDB PBPTR     RECLAIM 
      JSB MOVER       SPACE 
      LDB DEST      SET NEW POINTER TO
      STB PBPTR       PROTECTED AREA
      LDA SOURC     COMPUTE POINTER TO
      ADA .-3         CURRENT ERROR STATEMENT 
      STA DEST      SET NEW DESTINATION POINTER 
      JMP TAPE2+1 
**                              **
***  MOVE BLOCK TO LOWER CORE  ***
**                              **
* 
*  UPON ENTRY (B) POINTS TO THE LAST WORD +1 TO BE MOVED AND
*  (A) POINTS TO THE FIRST WORD TO BE MOVED.  DEST POINTS TO THE
*  FIRST WORD OF THE DESTINATION SPACE. 
* 
#MOVE STB ETEMP     SAVE POINTER TO LAST WORD + 1 
      LDB 0,I       TRANSFER
      STB DEST,I      WORD
      ISZ DEST      BUMP
      INA             POINTERS
      CPA ETEMP     DONE? 
      JMP MOVER,I   YES 
      JMP #MOVE+1   NO
      SKP 
**                             ** 
***  OUTPUT AN ERROR MESSAGE  *** 
**                             ** 
* 
*  THE ERROR IS IDENTIFIED VIA THE RELATIVE JUMP THROUGH THE ERROR
*  JUMP TABLE.  IF THE ERROR IS A SYNTAX TYPE AND THE USER IS IN
*  'TAPE' MODE, THE ERROR IS EMBEDDED IN THE PROGRAM AS A PSEUDO- 
*  STATEMENT FOR LATER PRINTOUT AND THE ERROR FLAGS ARE ADJUSTED
*  AS APPROPRIATE.  OTHERWISE, THE DISC BLOCK CONTAINING THE ERROR
*  MESSAGE IS READ INTO CORE (IF IT IS NOT ALREADY THERE) AND THE 
*  MESSAGE IS PLACED IN A USER BUFFER FOR PRINTOUT.  IF A SYNTAX
*  ERROR IS IDENTIFIED IN THE 'KEY' MODE, 'ERROR' IS PRINTED AND INPUT
*  REQUESTED.  THE ERROR MESSAGE IS PRINTED IF THE REPLY IS OTHER 
*  THAN A SIMPLE CARRIAGE RETURN.  IF THE LENGTH WORD OF THE ERROR
*  MESSAGE IS POSITIVE THE CURRENT LINE NUMBER IS APPENDED. 
* 
#SERR CCA           COMPUTE 
      ADA SERR
      LDA 0,I         AND SAVE
      ADA SERRA 
      AND B777          ERROR NUMBER
      STA LT3 
      ADA RERRA 
      STA LT5 
      ADA FERRA 
      ADA WERRA     WARNING 
      SSA,RSS         ERROR?
      JMP SERR0     YES 
      LDA MAIN      DOES THIS 
      INA             USER HAVE 
      CPA PRIST         THE LP? 
      CLB,RSS                                    [B]
      JMP SERR0     NO
      LDA SLPMS     YES 
      STA LT1       OUTPUT                       [B]
      STB LT2 
      STB PRIST       MESSAGE 
      LDA .-6 
      JSB OUTST         TO USER 
      LDA LPD       TELL I/O PROCESSOR
      JSB S14SC,I     TO REMOVE USER
SERR0 LDA LT5       SYNTAX
      SSA,RSS         ERROR?
      JMP SERR1     NO
      LDA TAPEF     YES 
      AND MAIN,I    TAPE
      SZA             MODE? 
      JMP SERR6     YES 
      CLB           NO
      STB OFLAG                                  [B]
      STB LT2       OUTPUT
      LDA ASCER       'ERROR' 
      STA LT1           AND 
      LDA .-3             WAIT
      JSB OUTST             FOR 
      LDA IWT 
      JSB SCHIN,I             INPUT.
      JSB GETCR     CARRIAGE RETURN ONLY? 
      JMP SERR4     YES 
*                       * 
**  PRINT THE MESSAGE  ** 
*                       * 
SERR1 CLB           CLEAR 'LINE                  [B]
      STB LT6         NUMBER' FLAG               [B]
      LDB LT3                                    [B]
SER1A LDA DSERR                                  [B]
SER1B ADB M32       IS MESSAGE ON                [B]
      SSB             THIS BLOCK?                [B]
      JMP SER1C     YES                          [B]
      ADA .+2       NO, INCREMENT ADDRESS POINTER[B]
      STB LT3                                    [B]
      JMP SER1B     TRY NEXT BLOCK               [B]
SER1C CLB           BLOCK                        [B]
      STB DCLC1,I     CLOCK                      [B]
      CPA LIB       IS MESSAGE IN CORE?          [B]
      JMP SER1D     YES                          [B]
      STA LIB       NO, SET LIB                  [B]
      LDB M512      STORE NUMBER
      STB MWORD       OF WORDS
      LDB #LIB#     FIX CORE ADDRESS POINTER
      ADB MNEG        AND 'READ' INDICATOR
      JSB DISCZ,I   READ ERROR MESSAGE INTO CORE
      JSB SICKP,I   BAD LUCK
SER1D LDA LT3       LOAD                         [B]
      MPY .+16
      ADA #LIB#       ERROR MESSAGE 
      LDB DEST      SAVE
      STB ETMP1       DEST
      LDB ERSCA 
      STB DEST          INTO
      LDB A 
      ADB .+16            OUTPUT
      JSB MOVER             BUFFER
      LDB ETMP1     RESTORE 
      STB DEST        DEST
      LDA DCLC2,I   UNBLOCK                      [B]
      STA DCLC1,I     CLOCK                      [B]
      LDA LT5 
      SSA,RSS       EXECUTION ERROR?
      JMP SERR5     YES 
      LDA .-7 
      STA LT1       OUTPUT
      LDA .+40B 
      JSB OUTCR       7 
      ISZ LT1 
      JMP *-3           BLANKS. 
SERR2 LDA ERSCA     STORE MESSAGE 
      STA LT1         ADDRESS 
      CCB 
      LDA 0,I 
      SSA           LINE NUMBER?
      JMP *+3       NO
      STB LT6       YES, SET FLAG 
      CMA,INA 
      CLB           OUTPUT
      STB LT2         ERROR 
      JSB OUTST         MESSAGE 
      ISZ LT6       LINE NUMBER FLAG SET? 
      JMP SERR3     NO
      LDA LINEA     YES 
      STA LT1       PRINT 
      CLB 
      LDA .-5         " IN LINE " 
      JSB OUTST 
      LDB .LNUM     OUTPUT
      JSB OUTIN       LINE NUMBER 
SERR3 LDA LT5       'BAD
      ADA FERRA 
      STA LT5 
      ADA WERRA       INPUT'
      SZA,RSS           ERROR 
      JMP SERR8     YES 
      LDA .+15B     OUTPUT
      JSB OUTCR       CARRIAGE RETURN 
SERR4 LDA .+12B     OUTPUT
      JSB OUTCR       LINE FEED 
      LDA LT5       RUN 
      SSA             ERROR?
      JMP SER13     YES 
      ADA WERRA     NO, WARNING 
      SSA             ONLY? 
      JMP SERR9     NO, FORMAT ERROR
      CLA           YES 
SERR8 STA CHRCT 
      JMP SERR,I
SERR9 CLB 
      LDA IFSTR     CONVERT 
      RRR 1           CHARACTER 
      STA LT1       SAVE POINTER
      LDA NCH       SAVE
      CMA,INA         NUMBER OF 
      STA NCH           CHARACTERS
      SZB           START WITH RIGHT BYTE?
      JMP SER11     YES 
SER10 EQU * 
      LDA LT1,I     FETCH 
      ALF,ALF         LEFT
      AND B377          CHAR
      JSB OUTCR     OUTPUT IT 
      ISZ NCH       FINISHED ALL CHARS? 
      RSS           NO
      JMP SER12     YES 
SER11 EQU * 
      LDA LT1,I     FETCH RIGHT 
      AND B377        CHARACTER 
      JSB OUTCR     OUTPUT IT 
      ISZ LT1       BUMP POINTER
      ISZ NCH       FINISHED ALL CHARS? 
      JMP SER10     NO
SER12 EQU * 
      JSB OUTCL     OUTPUT CR-LF
SER13 EQU * 
      CLF 0 
      LDA MAIN,I    DISALLOW
      IOR UNABT 
      STA MAIN,I      ABORTS
      STF 0 
      LDA FCNTR 
      STA FRMAT 
      JSB LCDLP     UPDATE LAST CHANGE DATE 
      JMP SCHEN,I 
* 
SERR5 LDA .+15B     OUTPUT
      JSB OUTCR       CARRIAGE RETURN 
      LDA .+12B         AND 
      JSB OUTCR           LINE FEED 
      JSB ABCK,I    CHECK FOR ABORTS
      LDA LT5       WARNING 
      ADA FERRA 
      ADA WERRA 
      SSA,RSS         ERROR?
      JMP SERR2     YES 
      LDA CHNFG     NO
      CMA 
      CLF 0 
      AND 1,I       CLEAR 
      STA 1,I         CHAIN FLAG
      STF 0 
      INB 
      LDA B,I       TELL IOP
      IOR UNR         USER IS NO
      JSB S14LP,I       LONGER RUNNING
      LDA .+4       CLEAR PBFLG AND CBFLG 
      ADB .-?TNUM 
      JSB EDABR          BITS.
      JMP SERR2 
SERR6 LDB PBPTR 
      ADB .+2       STORE 
      LDA LT3         ERROR 
      STA 1,I           NUMBER
      INB           SET POINTER TO
      STB SBPTR       LAST WORD +1 OF ERROR 
      SZA,RSS       'OUT OF STORAGE' ERROR? 
      ISZ OFLAG     YES                          [B]
      CLF 0         NO
      LDA MAIN,I    FIRST 
      IOR TERR
      CPA MAIN,I      ERROR?
      JMP *+4       NO
      STA MAIN,I    YES--SET FLAG 
      CLA           CLEAR 
      STA ERRCT       ERROR COUNTER 
      STF 0 
      ISZ ERRCT     COUNT ERROR 
      JSB BCKSP     SEEK
SERR7 JSB GETCR       CARRIAGE RETURN 
      JMP ACCSA,I 
      JMP *-2 
* 
ASCER DEF ERR-1 
ERR   OCT 5105
      ASC 2,RROR
LINEA DEF * 
      ASC 4, IN LINE
      OCT 20000 
ETEMP EQU ERSEC+62
ETMP1 EQU ERSEC+63
SLPMS DEF LPM-1     => LP FREE MESSAGE
      HED MATRIX EXECUTION
      ORG 46000B
ENDIN DEF EIN12 
MINP2 DEF EINP0+3 
MINP1 DEF EINP1 
D65   OCT -65 
* 
***                         **
**  EXECUTE <MAT STATEMENT>  ** 
***                         **
* 
MLP2A DEF MLOP2 
MLP3A DEF MLOP3 
MADDA DEF MADD
MSUBA DEF MSUB
SMULA DEF SMULT 
IDNA  DEF IDN 
MCPYA DEF MCPY
TOLC  DEC +1E-6 
F0.0A DEF F0.0
F0.0  DEC 0.0 
F1.0A DEF F1.0
F1.0  DEC 1.0 
* 
EMAT  LDA TEMP1,I   FIRST 
      AND OPDMK       OPERAND 
      SZA               NULL? 
      JMP EMAT1     NO
*                         * 
**  IDENTIFY MATRIX I/O  ** 
*                         * 
      ISZ TEMP1 
      CCA           CHECK 
      STA ELCNT       FOR 
      JSB EPRUS         'MAT PRINT USING' 
      LDA TEMP1,I   COMPUTE AND SAVE
      RRR 9           I/O TYPE: 
      AND B77           INPUT = -2
      ADA D65           READ  = -1
      STA MT1           PRINT =  0
      SSA,INA,SZA   SAVE FLAG 
      STA MT0         IF 'INPUT'
      JSB VLFIL     PROCESS ANY 
      NOP             FILE REQUEST
MIO1  LDA TEMP1,I   LOAD NEXT 
      AND OPDMK       IDENTIFIER
      SZA,RSS       ZERO? 
      JMP XEC1A,I   YES 
*                              *
**  PREPARE A MATRIX FOR I/O  **
*                              *
      ALS           LOAD
      ADA SYMTB       BASE ADDRESS
      ADA .-1           OF ARRAY
      LDB 0,I 
      ADB .-2       SAVE POINTER TO 
      STB SBPTR       DYNAMIC DIMENSIONS
      LDA TEMP1     LAST
      INA             WORD OF 
      CPA PRGCT         STATEMENT?
      CLA           YES 
      LDA 0,I       NO, LOAD (A) WITH 
      AND OPMSK       FOLLOWING OPERATOR
      LDB MT1       MAT 
      SZB,RSS         PRINT?
      JMP MIO2      YES 
      CPA LBOP      NO, '[' NEXT OPERATOR?
      JSB REDIM     YES, REDIMENSION ARRAY
      LDA SBPTR,I   SET POINTER 
      ISZ SBPTR       TO FIRST ELEMENT
      MPY SBPTR,I       OF ARRAY
      ISZ SBPTR           WHILE COMPUTING 
      CMA,INA               NUMBER OF 
      STA MCNT                ELEMENTS
      CCA           MAT 
      CPA MT1         READ? 
      JMP MIO9      YES 
*                             * 
**  INPUT VALUES FOR MATRIX  ** 
*                             * 
      ISZ MT0       FIRST MATRIX TO BE INPUT? 
      RSS           NO
      JMP MINP1,I   YES 
      ADA MT0       RETRIEVE
      JMP MINP2,I     SAVED CHARACTER 
*                            *
**  READ VALUES FOR MATRIX  **
*                            *
MIO9  CLB,INB       FETCH 
      JSB FDATA       CONSTANT
      DST SBPTR,I   STORE 
      ISZ SBPTR 
      ISZ SBPTR       IT
      ISZ MCNT      DONE? 
      JMP MIO9      NO
      JMP MIO7      YES 
* 
MIO2  CPA B3000     ';' FOLLOWING ARRAY?
      CCB           YES 
      STB MCNT      NO, TREAT AS COMMA
      LDB SBPTR     VALIDATE
      JSB VCHK        ARRAY ELEMENTS
      LDA SBPTR,I   SAVE
      ISZ SBPTR       COUNT 
      CMA,INA           OF
      STA MT0             ROWS
      LDA SBPTR,I 
      ISZ SBPTR 
      LDB FILE#     WRITE ON
      SSB             A FILE? 
      JMP MIO3      NO
*                          *
**  WRITE MATRIX ON FILE  **
*                          *
      MPY MT0       SET 
      STA MCNT        ELEMENT COUNTER 
MIO4  LDB .-2       WRITE ELEMENT 
      JSB FILST       TO FILE 
      ISZ SBPTR     MOVE TO 
      ISZ SBPTR       NEXT ELEMENT
      ISZ MCNT      MATRIX DONE?
      JMP MIO4      NO
      JMP MIO7      YES 
      SKP 
*                              *
**  WRITE MATRIX ON TELETYPE  **
*                              *
MIO3  CMA,INA       SAVE
      STA MT3         COLUMN COUNT
MIO8  STA MT2       SET COLUMN COUNT
      JMP MIO6
MIO5  CLA 
      CPA MCNT
      JSB EDELM 
MIO6  DLD SBPTR,I   PRINT 
      JSB ENOUT       ELEMENT 
      ISZ SBPTR     MOVE TO 
      ISZ SBPTR       NEXT ELEMENT
      ISZ MT2       ROW DONE? 
      JMP MIO5      NO
      JSB OUTLN     YES, DOUBLE 
      JSB OUTLN       SPACE 
      LDA MT3 
      ISZ MT0       MATRIX DONE?
      JMP MIO8      NO
*                             * 
**  CHECK FOR MORE MATRICES  ** 
*                             * 
MIO7  ISZ TEMP1 
      LDB TEMP1     STATEMENT 
      CPB PRGCT       FINISHED? 
      JMP *+3       YES 
      STA MT0       NO, SAVE (A)
      JMP MIO1
      LDB .-2       MATRIX
      CPB MT1         INPUT?
      JMP ENDIN,I   YES 
      JMP XEC1A,I   NO
*                               * 
**  PREPARE MATRIX ASSIGNMENT  ** 
*                               * 
EMAT1 LDB XEC1A     SET MAIN LOOP TO
      STB MEXIT       STATEMENT EXIT MODE 
      ALS 
      ADA SYMTB     COMPUTE 
      ADA .-1         POINTER 
      LDB 0,I           TO
      ADB .-2             DESTINATION 
      STB BS1               MATRIX
      ISZ TEMP1 
      LDA TEMP1,I   MATRIX
      SSA             FUNCTION? 
      JMP EMAT6     YES 
      LDB MLP2A     NO, SET OPERATION 
EMAT2 STB MOP         JUMP TO 'REPLACE' MODE
      ISZ TEMP1 
      AND OPDMK     SCALAR
      SZA,RSS         MULTIPLICATION? 
      JMP EMAT5     YES 
      ALS          NO 
      ADA SYMTB     COMPUTE 
      ADA .-1         POINTER 
      LDB 0,I           TO FIRST
      ADB .-2             SOURCE
      STB BS2               MATRIX
      JSB VCHK      VALIDATE ITS ELEMENTS 
      LDA TEMP1     END OF
      CPA PRGCT       STATEMENT?
      JMP EMAT3     YES 
      LDA TEMP1,I   NO
      AND OPDMK     COMPUTE 
      ALS 
      ADA SYMTB       POINTER TO
      ADA .-1 
      LDB 0,I           SECOND
      ADB .-2 
      STB BS3             SOURCE MATRIX 
      JSB VCHK      VALIDATE ITS ELEMENTS 
      LDA TEMP1,I 
      AND OPMSK     MATRIX
      CPA MULOP       MULTIPLICATION? 
      JMP EMAT4     YES 
      RRL 6         NO
*                                             * 
**  SET UP MATRIX ADD, SUBTRACT, OR REPLACE  ** 
*                                             * 
      LDB MADDA     RECORD
      SSA             'MATRIX ADD'
      LDB MSUBA         OR 'MATRIX SUBTRACT'
      STB MOP             OPERATION JUMP
      LDB BS1 
      LDA 1,I       ROW 
      CPA BS3,I       COMPATIBILITY?
      INB,RSS       YES 
      JSB RERRS+11,I  NO
      ISZ BS3 
      LDB 1,I       COLUMN
      CPB BS3,I       COMPATIBILITY?
      RSS           YES 
      JSB RERRS+11,I  NO
      ISZ BS3 
EMAT3 LDA BS2,I     ROW 
      CPA BS1,I       COMPATIBILITY?
      RSS           YES 
      JSB RERRS+11,I  NO
      ISZ BS2 
      ISZ BS1       COMPUTE NUMBER
      MPY BS2,I       OF MATRIX ELEMENTS
      LDB BS2,I     COLUMN
      CPB BS1,I       COMPATIBILITY?
      CMA,INA,RSS   YES 
      JSB RERRS+11,I  NO
      STA MCNT      SAVE 2'S COMPLEMENT OF SIZE 
      ISZ BS2 
      ISZ BS1 
      SKP 
