         PCC      0
         SYSTEM   SIG7
         TITLE    'LEMUR4 -- ERROR HANDLER'
         SPACE    3
*M* LEMUR4  ERROR HANDLING ROUTINES FOR LEMUR
         SPACE    2
*P****************************************************************
*P*
*P* NAME:  LEMUR4
*P*
*P* DESCRIPTION:
*P*      THIS MODULE DEFINES ALL THE ERROR SYMBOLS (E#XXX), AND
*P*      THE ROUTINE WHICH DISPATCHES ERRORS TO THE ERROR HANDLER,
*P*      ERR:.  NOTE THAT THE ERROR CODES, E#XXX, ARE REALLY ADDRESSES
*P*      IN A TABLE OF BALS TO ERR:, THE ROOT ERROR DISPATCHER.
*P*      NOTE ALSO THAT ONE CAN SPECIFY A VARIABLE ERROR CODE BY
*P*      DOING A LI,1 +E#XXX, FOLLOWED BY A BRANCH TO ERR:1, WHICH
*P*      WILL CALCULATE THE PROPER DISPLACEMENT, THEN BRANCH TO ERR#.
*P*
*P***************************************************************
         SPACE
         TITLE    'LEMUR4 -- ERROR CODE MACROS'
         SPACE
ERR      CNAME
         PROC
         USECT    ERRENT
         DEF      LF
LF       EQU      %
         BAL,1    ERR:
         USECT    ERRVECT
         GEN,8,8  AF(1),AF(2)
         DO1      MAXSC<AF(2)
MAXSC    SET      AF(2)
         PEND
         SPACE
MAXSC    SET      0
ENDGRP   CNAME
         PROC
         SPACE    2
         DISP     MAXSC
MAXSC    SET      0
         PEND
         PAGE
         SPACE
         DEF      ERRENT
         DEF      ERRVECT           HWCVECTOR OF ERROR CODES.
         DEF      #SYN
         DEF      #SEM
         DEF      #ROM
         DEF      #COM
         DEF      #IO
         DEF      #LIB
         DEF      ERR:1
         DEF      ERR:
         REF      ERR#
ERRENT   CSECT    1
ERRVECT  CSECT    1
CODE     CSECT    1
         PAGE
** REGISTER DEFS
         PAGE
         SPACE
*** SYNTAX ERROR CODES:
         SPACE
#SYN     EQU      0
         SPACE
E#ACTL   ERR      #SYN,0            ACCOUNT NAME TOO LONG.
E#BFID   ERR      #SYN,1
E#BQS    ERR      #SYN,2
E#EEOL   ERR      #SYN,3
E#EH     ERR      #SYN,4
E#FNTL   ERR      #SYN,5
E#ILCL   ERR      #SYN,10           ILLEGAL CONTINUATION LINE
E#ISTBG  ERR      #SYN,14
E#LNTL   ERR      #SYN,6
E#MFID   ERR      #SYN,7
E#MFO    ERR      #SYN,8
E#MLID   ERR      #SYN,9
E#MRP    ERR      #SYN,11
E#NONM   ERR      #SYN,12
E#PWTL   ERR      #SYN,13
         ENDGRP
         PAGE
         SPACE
*** SEMANTIC ERROR CODES:
         SPACE
#SEM     EQU      1
         SPACE
E#IOTC   ERR      #SEM,0
E#MLTOP  ERR      #SEM,1
E#UNKCM  ERR      #SEM,2
E#UNKOP  ERR      #SEM,3
         ENDGRP
         PAGE
         SPACE
*** ERRORS ENCOUNTERED WHILE SCANNING A ROM:
         SPACE
#ROM     EQU      2
         SPACE
E#ILRC   ERR      #ROM,0
E#ILRH   ERR      #ROM,1
E#ILRL   ERR      #ROM,2
E#MSLX   ERR      #ROM,3
E#UEOR   ERR      #ROM,4
         ENDGRP
         PAGE
         SPACE
*** ERRORS ENCUNTERED WHILE DOING WORK FOR COMMANDS:
         SPACE
#COM     EQU      3
         SPACE
E#MAE    ERR      #COM,0
E#NES    ERR      #COM,1
E#NOCORE ERR      #COM,2
E#IDS    ERR      #COM,3
         ENDGRP
         PAGE
         SPACE
*** ERRORS ENCOUNTERED WHILE TRYING TO DO I/O
         SPACE
#IO      EQU      4
         SPACE
E#CCRL   ERR      #IO,4             CAN'T CREATE LIBRARY.
E#COF    ERR      #IO,0
E#COL    ERR      #IO,3             CAN'T OPEN LIBRARY (NOT DUE TO 0300)
E#IOERR  ERR      #IO,1
E#IOERRA ERR      #IO,2
         ENDGRP
         PAGE
         SPACE
*** ERRORS IN FORMAT OF INPUT LIBRARY FILE
         SPACE
#LIB     EQU      5
         SPACE
E#NLIB   ERR      #LIB,0            NOT A LIBRARY
E#OLIB   ERR      #LIB,1            OLD-STYLE LIBRARY
E#SLSADL ERR      #LIB,2
         ENDGRP
         PAGE
         SPACE
*** ERROR HANDLER:  THIS BRANCH MAY SEEM USELESS, BUT IT SERVES
*** TO GET US OFF TO THE ERROR-HANDLING OVERLAY.
         USECT    CODE
ERR:1    AI,1     +1
ERR:     AI,1     -(ERRENT+1)
         LH,1     ERRVECT,1
         B        ERR#              GOT CODE IN I1; GO PRINT MESSAGE.
         B        ERR#
         END

