      SUBROUTINE LABEL(MODE)
C 
C 
C     THIS ROUTINE PROCESSES ALL SYMBOLS USED IN THE ASSEMBLY 
C     PROGRAM.  IT SCANS THE SYMBOL TABLE TO SEE IF A GIVEN SYMBOL
C     IS DEFINED OR NOT 
C 
C 
C 
C     ENTRY PARAMETERS
C        MODE - INDICATES WHETHER DEFINITION OR REFERENCE OF LABEL
C           0 = DEFINITION
C           1 = REFERENCE 
C        ICOL - STARTING COLUMN OF SCAN 
C     EXIT PARAMETERS 
C        CVAL - VALUE OF LABEL ON RETURN
C        JTYPE - SYMBOL TYPE
C           1 = REGULAR SYMBOL
C           2 = ENTRY POINT SYMBOL
C           3 = SET SYMBOL
C           4 = DEF NAME
C           5 = SUB NAME
C        INDEX - INDEX OF SYMBOL IN TABLE 
C        KLEN - IMPLICIT LABEL LENGTH
C        LLEN - EXPLICIT LABEL LENGTH
C        IERR - ERROR STATUS
C           1 = VALID SYMBOL FOUND
C           2 = SYMBOL NOT IN TABLE
C           3 = SYMBOL ERROR
C           4 = SYMBOL TABLE FULL
C   
C   
      INTEGER FTYPE
      REAL ITABV(249)
      COMMON ICRD,IPRT,MCFLE,IDFLE,MCREC,IDREC,IFORM,ITRUN,ILOUT,IXCOL
      COMMON MLAB,MOPC,IBIT,ICCNT,IWORD,IERRL,IERRI,IEND,IFRMC
      COMMON LSOR,LIF,LSYM,LREF,LDEF,LOCT,ITRMI,ITRMO
      COMMON ILEN,KLEN,LLEN,KWORD,IFLD(2400),IYFLD,IZFLD
      COMMON IFBIT,ZVAL,CVAL,JREAD,IN(80),INB(80),LINE,IPAGE,LISN
      COMMON IALPH(37),IAST,IDOLR,ISHRP
      COMMON ICOLN,IBLNK,ICTAB,ISEMI,ICOMM,IPLUS,IMIN,IMULT,IDIV
      COMMON IRPAR,ILPAR,IATT(9),JATT(5),LATT(9),IFPAR(16),NBASE,JBASE
      COMMON ICOL,IFCOL,MCOL,MLCOL,IOLIN,ICNT,LTITL(50),IADDR(4,12)
      COMMON ITYPE,JTYPE,FTYPE,IERR,IERRS,IOPVA,JCOL,IBUG
      COMMON ITAB(4,249),ITABS(249),ITABV,NAME(4),INDEX,INDET,ISYM,LTAB
      COMMON IXTAB(256),MXREF,IXT,IXPNT,IXCNT,IXPAG,MCORE(128)
C INCLUDE(:F1:METAD.COM)
C
      LLEN = 0
      INDEX = 0 
      CVAL = 0. 
C     SCAN SYMBOL, PLACE IN NAME BUFFER 
      CALL SYMBL
      IF(IERR-3) 100,920,100
C     CHECK TO SEE IF LABEL IS IN TABLE 
100   IF(ISYM) 120,910,120
120   DO 200 I=1,ISYM 
      DO 150 J=1,IWORD
      IF(ITAB(J,I)-NAME(J)) 200,150,200 
150   CONTINUE
      GO TO 900 
200   CONTINUE
      GO TO 910 
C     SYMBOL FOUND, GET ITS VALUE AND TYPE
900   INDEX = I 
      CVAL = ITABV(INDEX) 
      JTYPE = ITABS(INDEX)
      IF(JTYPE) 901,902,902
901   JTYPE = -JTYPE/(2**14)+4
      GO TO 903
C     SET LABEL LENGTH FOR ORDINARY LABELS
902   KLEN = JTYPE/16 
      I = JTYPE/8
      JTYPE = JTYPE-I*8
903   IERR = 1
      IF(LREF) 904,990,904
904   CALL XREFT(MODE,0)
      GO TO 990 
C     SYMBOL NOT IN TABLE 
910   IERR = 2
      GO TO 990 
C     SYMBOL ERROR
920   IERR = 3
      GO TO 990 
C     SYMBOL TABLE FULL 
940   IERR = 4
990   RETURN
      END 
   IERR = 4
990   RETURN
      END 
