	SUBROUTINE DECODE
	INTEGER COL,TYPE,VALUE
	REAL II,KK,LL,MM,NN,MINUS,N
	DIMENSION N(10)
	COMMON/A/CHAR(72)
	COMMON/B/VALUE
	COMMON/C/COL,TYPE
      DATA N(1),N(2),N(3),N(4),N(5),N(6),N(7),N(8),N(9),N(10)/1H0,1H1,1H
     12,1H3,1H4,1H5,1H6,1H7,1H8,1H9/
      DATA BLANK,COMMA,MINUS,PLUS,SLASH/1H ,1H,,1H-,1H+,1H//
	DATA AA,BB,CC,DD,EE/1HA,1HB,1HC,1HD,1HE/
	DATA FF,GG,HH,II,KK/1HF,1HG,1HH,1HI,1HK/
	DATA LL,MM,NN,OO,PP/1HL,1HM,1HN,1HO,1HP/
	DATA QQ,RR,SS,TT,UU,YY/1HQ,1HR,1HS,1HT,1HU,1HY/
C	TYPE=-1: UNRECOGNIZABLE FIELD
C	TYPE=0:  SPECIAL FIELD
C	         VALUE=-1 FOR -,0 FOR BLANK,+1 FOR +
C	TYPE=1:  NUMERIC FIELD
C	         VALUE=INTEGER EQUIVALENT
C	TYPE=2: ERROR CONTROL OPTION
C	        VALUE=-1 (E),0 (H),1 (S)
C	TYPE=3:  COMMAND CODE
C	       VALUE=-6 (YES),-5(N0),-4 (ON),-3 (OFF),-2 (END),-1 (CO)
C	            =0 (A),1 (D),2 (F),3 (T),4 (P),5 (PB),6 (D/),7 (Q)
C	              =10 (AD),11 (DA)
C	              =15 (SL),16 (GP), 17 (CS)
C	              =20 (FR), 21 (CL),
C	              =25 (ER), 26 (SK)
C	TYPE=4:  ANALOG MODE
C	        VALUE=1 (PC),2 (PP),3 (ST),4 (OP),5 (HD),6 (IC),7 (SP)
C	TYPE=5:  TIME CONSTANT
C	         VALUE=0 (NS),1 (FS),2 (NM),3 (FM)
C	TYPE=6:  LOGIC MODE
C	        VALUE=1 (RUN),2 (STOP),3 (CLEAR)
10	IF (COL.GT.36) GO TO 60
	IF (CHAR(COL).NE.BLANK) GO TO 20
	COL=COL+1
	GO TO 10
C	START OF FIELD
20	CH=CHAR(COL)
	IF (CH.EQ.COMMA) GO TO 60
	IF (CH.EQ.PLUS) GO TO 70
	IF (CH.EQ.MINUS) GO TO 80
	IF (CH.GT.N(10)) GO TO 100
	IF (CH.LT.N(1)) GO TO 110
C	NUMERIC FIELD
	TYPE=1
	VALUE=0
30	DO 40 I=1,10
	IF (CH.NE.N(I)) GO TO 40
	VALUE=10*VALUE+I-1
	GO TO 50
40	CONTINUE
	GO TO 600
50	COL=COL+1
	IF (COL.GT.36) RETURN
	CH=CHAR(COL)
	GO TO 30
C	BLANK FIELD
60	TYPE=0
	VALUE=0
	COL=COL+1
	RETURN
C	PLUS SIGN
70	VALUE=1
	GO TO 90
C	MINUS SIGN
80	VALUE=-1
C	SIGN FIELD
90	TYPE=0
	COL=COL+1
	CH=CHAR(COL)
	GO TO 600
C	ALPHABETIC FIELD
100	COL=COL+1
	CT=CHAR(COL)
	IF (CH.EQ.AA) GO TO 120
	IF (CH.EQ.CC) GO TO 140
	IF (CH.EQ.DD) GO TO 180
	IF (CH.EQ.EE) GO TO 210
	IF (CH.EQ.FF) GO TO 240
	IF (CH.EQ.GG) GO TO 280
	IF (CH.EQ.HH) GO TO 290
	IF (CH.EQ.II) GO TO 310
	IF (CH.EQ.NN) GO TO 320
	IF (CH.EQ.OO) GO TO 360
	IF (CH.EQ.PP) GO TO 390
	IF (CH.EQ.QQ) GO TO 430
	IF (CH.EQ.RR) GO TO 440
	IF (CH.EQ.SS) GO TO 450
	IF (CH.EQ.TT) GO TO 550
	IF (CH.EQ.YY) GO TO 560
C	FIRST ALPHABETIC IS ILLEGAL
110	TYPE=-1
	RETURN
120	IF (COL.LT.37.AND.CT.EQ.DD) GO TO 130
C	AMPLIFIER
	VALUE=0
	GO TO 570
C	A-TO-D
130	VALUE=10
	GO TO 490
140	IF (CT.EQ.LL) GO TO 150
	IF (CT.EQ.OO) GO TO 170
	IF (CT.NE.SS) GO TO 110
C	COMPARATOR STATUS
	VALUE=17
	GO TO 490
150	IF (COL.LT.37.AND.CHAR(COL+1).EQ.EE) GO TO 160
C	CONTROL LINE
	VALUE=21
	GO TO 490
160	COL=COL+4
	IF (CHAR(COL-2).NE.AA) GO TO 110
	IF (CHAR(COL-1).NE.RR) GO TO 110
C	CLEAR
	VALUE=3
	GO TO 540
C	COMMENT
170	VALUE=-1
	GO TO 490
180	IF (COL.EQ.37) GO TO 185
	IF (CT.EQ.AA) GO TO 190
	IF (CT.EQ.SLASH) GO TO 200
C	DERIVATIVE
185	VALUE=1
	GO TO 570
C	D-TO-A
190	VALUE=11
	GO TO 490
C	DERIVATIVE/10
200	VALUE=6
	GO TO 490
210	IF (COL.EQ.37) GO TO 215
	IF (CT.EQ.NN) GO TO 220
	IF (CT.EQ.RR) GO TO 230
C	E OPTION
215	VALUE=-1
	GO TO 460
220	COL=COL+2
	IF (CHAR(COL-1).NE.DD) GO TO 110
C	END
	VALUE=-2
	GO TO 570
C	ERROR TOLERANCE
230	VALUE=25
	GO TO 490
240	IF (COL.EQ.37) GO TO 245
	IF (CT.EQ.MM) GO TO 250
	IF (CT.EQ.RR) GO TO 260
	IF (CT.EQ.SS) GO TO 270
C	FUNCTION GENERATOR
245	VALUE=2
	GO TO 570
C	FAST-MILLISECONDS
250	VALUE=3
	GO TO 350
C	FUNCTION RELAY
260	VALUE=20
	GO TO 490
C	FAST-SECONDS
270	VALUE=1
	GO TO 350
280	IF (CT.NE.PP) GO TO 110
C	GENERAL PURPOSE INTERRUPT
	VALUE=16
	GO TO 490
290	IF (CT.EQ.DD) GO TO 300
C	H OPTION
	VALUE=0
	GO TO 460
C	HOLD
300	VALUE=5
	GO TO 520
310	IF (CT.NE.CC) GO TO 110
C	INITIAL CONDITION
	VALUE=6
	GO TO 520
320	IF (CT.EQ.MM) GO TO 340
	IF (CT.EQ.OO) GO TO 330
	IF (CT.NE.SS) GO TO 110
C	NORMAL-SECONDS
	VALUE=0
	GO TO 350
C	NO
330	VALUE=-5
	GO TO 490
C	NORMAL-MILLISECONDS
340	VALUE=2
C	TIME CONSTANT
350	TYPE=5
	GO TO 580
360	IF (CT.EQ.FF) GO TO 370
	IF (CT.EQ.NN) GO TO 380
	IF (CT.NE.PP) GO TO 110
C	OPERATE
	VALUE=4
	GO TO 520
370	COL=COL+2
	IF (CHAR(COL-1).NE.FF) GO TO 110
C	OFF
	VALUE=-3
	GO TO 570
C	ON
380	VALUE=-4
	GO TO 490
390	IF (COL.EQ.37) GO TO 395
	IF (CT.EQ.BB) GO TO 400
	IF (CT.EQ.CC) GO TO 410
	IF (CT.EQ.PP) GO TO 420
C	POTENTIOMETER
395	VALUE=4
	GO TO 570
C	PATCH-BOARD (ADDRESS)
400	VALUE=5
	GO TO 490
C	POT COEFFICIENT
410	VALUE=1
	GO TO 520
C	PATCH PANEL (MODE)
420	VALUE=2
	GO TO 520
C	QUOTENTIOMETER
430	VALUE=7
	GO TO 570
440	IF (CT.NE.UU) GO TO 110
	COL=COL+2
	IF (CHAR(COL-1).NE.NN) GO TO 110
C	RUN
	VALUE=1
	GO TO 540
450	IF (COL.EQ.37) GO TO 455
	IF (CT.EQ.KK) GO TO 470
	IF (CT.EQ.LL) GO TO 480
	IF (CT.EQ.PP) GO TO 500
	IF (CT.EQ.TT) GO TO 510
C	S OPTION
455	VALUE=1
C	ERROR CONTROL OPTION
460	TYPE=2
	GO TO 590
C	SKIP
470	VALUE=26
	GO TO 490
C	SENSE LINE
480	VALUE=15
C	COMMAND CODE
490	TYPE=3
	GO TO 580
C	SET POT
500	VALUE=7
	GO TO 520
510	IF (COL.LT.36.AND.CHAR(COL+1).EQ.OO) GO TO 530
C	STATIC TEST
	VALUE=3
C	ANALOG MODE
520	TYPE=4
	GO TO 580
530	COL=COL+3
	IF (CHAR(COL-1).NE.PP) GO TO 110
C	STOP
	VALUE=2
C	LOGIC MODE
540	TYPE=6
	GO TO 590
C	TRUNK
550	VALUE=3
	GO TO 570
560	COL=COL+2
	IF (CT.NE.EE) GO TO 110
	IF (CHAR(COL-1).NE.SS) GO TO 110
C	YES
	VALUE=-6
C	COMMAND CODE
570	TYPE=3
	GO TO 590
C	COL=LAST COLUMN PROCESSED
580	COL=COL+1
C	COL=LAST COLUMN PROCESSED+1
590	IF (COL.GT.37) GO TO 110
	CH=CHAR(COL)
	IF (CH.GE.AA) GO TO 110
C	CHECK FOR COMMA
600	IF (CH.EQ.COMMA) COL=COL+1
	RETURN
	END
