	SUBROUTINE SRCH
C
C	FOR FURTHER INFORMATION CONTACT:
C
C	ROBERT WATSON
C	CISCO, INC.
C	4135 S. 100 E. AVE.
C	TULSA OK 74145
C
	INTEGER*4	PC,		IBEG,		IEND
	INTEGER*4	IENDS
	INTEGER*2	BLK(256),	PCDUM(2),	LOPC
	INTEGER*2	HIPC,		SEGTAB(3,50)
	BYTE		Z,		LOC(6),		RD
	BYTE		ANS,		FND,		BDUM(2)
	BYTE		F,		RAD(3),		SNAM(25)
	EQUIVALENCE	(PC,PCDUM(1)),		(PCDUM(1),LOPC),
	1		(PCDUM(2),HIPC),	(IDUM,BDUM(1))
	COMMON	/TSKCOM/  BLK, IREC, ISUB, PC, SEGTAB, IZRWRD, SNAM
	Z = .TRUE.
	RD = .FALSE.
	FND = .FALSE.
100	WRITE  (5, 210)
210	FORMAT (/,' ENTER A TO SPECIFY WORD TO FOUND AS ASCII',/,
	1	  ' ENTER W TO SPECIFY AS OCTAL WORD',/,
	2	  ' ENTER B TO SPECIFY AS OCTAL BYTE',/,
	3	  ' ENTER R TO SPECIFY AS ASCII TO BE DECODED INTO',
	4	  ' RAD50 ',$)
	READ   (5, 215, ERR=100, END=900) F
215	FORMAT (A1)
	IF (F.NE.'A' .AND. F.NE.'W' .AND. F.NE.'B' .AND.
	1   F.NE.'R') GO TO 100
	IF (F .NE. 'A') GO TO 250
220	WRITE  (5, 230)
230	FORMAT (/,' ENTER TWO ASCII CHARACTERS ',$)
	READ   (5, 240, ERR=220, END=900) BDUM
240	FORMAT (2A1)
	IWD1 = IDUM
	GO TO 320
250	IF (F .NE. 'W') GO TO 281
260	WRITE  (5, 270)
270	FORMAT (/,' ENTER ONE TO SIX OCTAL DIGITS ',$)
	READ   (5, 280, ERR=260, END=900) IWD1
280	FORMAT (O6)
	GO TO 320
281	IF (F .NE. 'B') GO TO 290
282	WRITE  (5, 283)
283	FORMAT (/,' ENTER TWO 1-3 DIGIT OCTAL NUMBERS SEPARATED',
	1	  ' BY COMMAS ',$)
	READ   (5, 284, ERR=282, END=900) BDUM(1), BDUM(2)
284	FORMAT (O4,O4)
	IWD1 = IDUM
	GO TO 320
290	WRITE  (5, 300)
300	FORMAT (/,' ENTER THREE RAD50 CHARACTERS ',$)
	READ   (5, 310, ERR=290, END=900) RAD
310	FORMAT (3A1)
	N = IRAD50 (3, RAD, IWD1)
	IF (N .NE. 3) GO TO 290
320	WRITE  (5, 330)
330	FORMAT (/,' DO YOU WANT TO SEARCH FOR TWO WORDS (Y OR N)? ',$)
	READ   (5, 215, ERR=320, END=900) ANS
	IF (ANS .NE. 'Y') GO TO 400
340	WRITE  (5, 350)
350	FORMAT (/,' ENTER CONTENTS OF FOLLOWING WORD IN SAME',
	1	' FORMAT ',$)
	IF (F .NE. 'A') GO TO 360
	READ   (5, 240, ERR=340, END=900) BDUM
	IWD2 = IDUM
	GO TO 400
360	IF (F .NE. 'W') GO TO 361
	READ   (5, 280, ERR=340, END=900) IWD2
	GO TO 400
361	IF (F .NE. 'B') GO TO 370
	READ   (5, 284, ERR=340, END=900) BDUM(1), BDUM(2)
	IWD2 = IDUM
	GO TO 400
370	READ   (5, 310, ERR=340, END=900) RAD
	N = IRAD50 (3, RAD, IWD2)
	IF (N .NE. 3) GO TO 340
400	WRITE  (5, 510)
510	FORMAT ('  ')
	ISEG = 0
520	ISEG = ISEG + 1
	IF (ISEG .GE. 49) GO TO 850
	IF (SEGTAB(1,ISEG) .EQ. 0) GO TO 850
	IREC = SEGTAB(1,ISEG)
	ISUB = 1
	IF (ISEG .EQ. 1) ISUB = IZRWRD
	PC = SEGTAB(2,ISEG)
	PC = (PC .AND. "177777)
	READ   (1'IREC) BLK
	IENDS = SEGTAB(3,ISEG)
	IENDS = (IENDS .AND. "177777)
600	IF (BLK(ISUB) .NE. IWD1) GO TO 800
	IF (ANS .EQ. 'Y') GO TO 605
	CALL OCTL (LOPC, LOC, Z)
	WRITE  (5, 700) ISEG, LOC
	FND = .TRUE.
	GO TO 800
605	IF ((PC+2) .GE. IENDS) GO TO 520
	ISUB = ISUB + 1
	IF (ISUB .LE. 256) GO TO 610
	IREC = IREC + 1
	CALL FILL
	RD = .TRUE.
610	IF (BLK(ISUB) .NE. IWD2) GO TO 710
	CALL OCTL (LOPC, LOC, Z)
	WRITE  (5, 700) ISEG, LOC
700	FORMAT (' FOUND IN SEGMENT ',I2,' LOCATION ',6A1)
	FND = .TRUE.
710	IF (RD) GO TO 720
	ISUB = ISUB - 1
	GO TO 800
720	IREC = IREC - 1
	CALL FILL
	ISUB = 256
	RD = .FALSE.
800	PC = PC + 2
	IF (PC .GE. IENDS) GO TO 520
	ISUB = ISUB + 1
	IF (ISUB .LE. 256) GO TO 600
	IREC = IREC + 1
	CALL FILL
	GO TO 600
850	IF (.NOT. FND) WRITE (5, 860)
860	FORMAT (' NOT FOUND')
	RETURN
900	CLOSE (UNIT=1)
	STOP
	END
