	SUBROUTINE UPDATE
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	IBEG,		PC,		IWD
	INTEGER*4	IENDS
	INTEGER*2	BLK(256),	Q,		IWDDUM(2)
	INTEGER*2	LOIWD,		HIIWD,		PCDUM(2)
	INTEGER*2	HIPC,		LOPC,		SEGTAB(3,50)
	BYTE		IN,		Z,		LOC(6)
	BYTE		MAC(6),		B,		F
	BYTE		BDUM(2),	RAD(3),		SNAM(25)
	EQUIVALENCE	(IWD,IWDDUM(1)),	(IWDDUM(1),LOIWD),
	1		(IWDDUM(2),HIIWD),	(PC,PCDUM(1)),
	2		(PCDUM(1),LOPC),	(PCDUM(2),HIPC),
	3		(IDUM,BDUM(1))
	COMMON	/TSKCOM/  BLK, IREC, ISUB, PC, SEGTAB, IZRWRD, SNAM
	Z = .TRUE.
100	IN = .FALSE.
	B = ' '
150	WRITE  (5, 200)
200	FORMAT (/,' ENTER SEGMENT, ADDRESS OF WORD TO CHANGED OR',
	1	  ' RETURN TO CHANGE MODES ',$)
	READ   (5, 250, END=800, ERR=100) Q, ISEG, IBEG
250	FORMAT (Q,I3,O6)
	IF (Q .LE. 0) GO TO 600
	IF ((IBEG.AND.1) .EQ. 0) GO TO 255
	WRITE  (5,256) 7
256	FORMAT (/,' WORD ADDRESS MUST BE EVEN',A1)
	GO TO 150
255	CALL INIT (ISEG, IBEG)
	IF (ISUB .LT. 0) GO TO 150
	IENDS = SEGTAB(3,ISEG)
	IENDS = (IENDS .AND. "177777)
	IN = .TRUE.
260	WRITE  (5, 300)
300	FORMAT (/,' RETURN TO VIEW NEXT WORD',/,
	1	  ' ENTER I TO INSERT NEW CONTENTS',/,
	2	  ' ENTER N TO GO TO NEW LOCATION',/,
	3	  ' ENTER X TO CHANGE MODES',/)
400	CALL OCTL (LOPC, LOC, Z)
	CALL OCTL (BLK(ISUB), MAC, Z)
490	WRITE  (5,500) LOC, MAC
500	FORMAT (X,6A1,2X,6A1,2X,$)
	READ   (5, 501, ERR=260, END=800) Q, B
501	FORMAT (Q,A1)
	IF (Q .LE. 0) GO TO 560
	IF (B .EQ. 'N') GO TO 600
	IF (B .EQ. 'X') GO TO 600
	IF (B .EQ. 'I') GO TO 503
	WRITE  (5, 502) 7
502	FORMAT (/,' ???',A1,/)
	GO TO 490
503	WRITE  (5, 504)
504	FORMAT (/,' ENTER A TO SPECIFY NEW CONTENTS 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'
	4	  ' INTO RAD50 ',$)
	READ   (5, 505, ERR=503, END=800) F
505	FORMAT (A1)
	IF (F.NE.'A' .AND. F.NE.'W' .AND. F.NE.'B' .AND.
	1   F.NE.'R') GO TO 503
	IF (F .NE. 'A') GO TO 508
5050	WRITE  (5, 506)
506	FORMAT (/,' ENTER TWO ASCII CHARACTERS ',$)
	READ   (5, 507, ERR=5050, END=800) BDUM
507	FORMAT (2A1)
	BLK(ISUB) = IDUM
	GO TO 550
508	IF (F .NE. 'W') GO TO 512
509	WRITE  (5, 510)
510	FORMAT (/,' ENTER ONE TO SIX OCTAL DIGITS ',$)
	READ   (5, 511, ERR=509, END=800) IWD
511	FORMAT (O6)
	BLK(ISUB) = LOIWD
	GO TO 550
512	IF (F .NE. 'B') GO TO 520
513	WRITE  (5, 514)
514	FORMAT (/,' ENTER TWO 1-3 DIGIT OCTAL NUMBERS SEPARATED',
	1	  ' BY COMMAS ',$)
	READ   (5, 515, ERR=513, END=800) BDUM(1), BDUM(2)
515	FORMAT (O4,O4)
	BLK(ISUB) = IDUM
	GO TO 550
520	WRITE  (5, 525)
525	FORMAT (/,' ENTER THREE RAD50 CHARACTERS ',$)
	READ   (5, 530, ERR=512, END=800) RAD
530	FORMAT (3A1)
	N = IRAD50 (3, RAD, LOIWD)
	IF (N .NE. 3) GO TO 520
	BLK(ISUB) = LOIWD
550	WRITE  (5, 555)
555	FORMAT ('  ')
560	PC = PC + 2
	IF (PC .LT. IENDS) GO TO 563
	WRITE  (5, 562) 7
562	FORMAT (/,' END OF SEGMENT',A1)
	RETURN
563	ISUB = ISUB + 1
	IF (ISUB .LE. 256) GO TO 400
	WRITE  (1'IREC) BLK
	IREC = IREC + 1
	CALL FILL
	GO TO 400
600	IF (IN) WRITE (1'IREC) BLK
	IF (B .EQ. 'N') GO TO 100
700	RETURN
800	CLOSE (UNIT=1)
	STOP
	END
