	SUBROUTINE DOIT (MAC, LINE, LINSUB, NO, ISEG)
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,		IWRK,		IBLK
	INTEGER*4	IENDS
	INTEGER*2	BLK(256),	OCTADR,		IWRKDM(2)
	INTEGER*2	LOIWRK,		HIIWRK,		SEGTAB(3,50)
	BYTE		MAC(6),		LINE(78),	WRK(6)
	BYTE		Z,		R,		SNAM
	EQUIVALENCE	(IWRK,IWRKDM(1)),	(IWRKDM(1),LOIWRK),
	1		(IWRKDM(2),HIIWRK)
	COMMON	/TSKCOM/  BLK, IREC, ISUB, PC, SEGTAB, IZRWRD, SNAM
	OCTADR = 17
	IENDS = SEGTAB(3,ISEG)
	IENDS = (IENDS .AND. "177777)
100	IF (MAC(NO+1) .NE. '7') GO TO 150	
	IF (MAC(NO).EQ.'2' .OR. MAC(NO).EQ.'3' .OR.
	1   MAC(NO).EQ.'6' .OR. MAC(NO).EQ.'7') GO TO 1000
150	R = MAC(NO+1)
	IF (MAC(NO) .GT. '5') GO TO 600
	IF (MAC(NO) .LT. '3') GO TO 300
	IF (MAC(NO) .EQ. '4') GO TO 200
	LINE(LINSUB) = '@'
	LINSUB = LINSUB + 1
200	IF (MAC(NO) .EQ. '3') GO TO 300
	LINE(LINSUB) = '-'
	LINSUB = LINSUB + 1
300	IF (MAC(NO) .EQ. '0') GO TO 400
	LINE(LINSUB) = '('
	LINSUB = LINSUB + 1
400	CALL REG (R, LINE, LINSUB)
	IF (MAC(NO) .EQ. '0') GO TO 1800
	LINE(LINSUB) = ')'
	LINSUB = LINSUB + 1
	IF (MAC(NO).NE.'2' .AND. MAC(NO).NE.'3') GO TO 500
	LINE(LINSUB) = '+'
	LINSUB = LINSUB + 1
500	GO TO 1800
600	IF (MAC(NO) .EQ. '6') GO TO 700
	LINE(LINSUB) = '@'
	LINSUB = LINSUB + 1
700	ISUB = ISUB + 1
	PC = PC + 2
	IF (PC .LT. IENDS) GO TO 740
	WRITE  (5, 710) 7
710	FORMAT (/,' END OF SEGMENT',A1)
	LINSUB = -1
	RETURN
740	IF (ISUB .LE. 256) GO TO 750
	IREC = IREC + 1
	CALL FILL
750	Z = .TRUE.
	CALL OCTL (BLK(ISUB), WRK, Z)
	J = 1
	DO 800 I = OCTADR, OCTADR+5
	LINE(I) = WRK(J)
	J = J + 1
800	CONTINUE
	OCTADR = OCTADR + 8
	IF (BLK(ISUB) .EQ. 0) GO TO 910
	Z = .FALSE.
	CALL OCTL (BLK(ISUB), WRK, Z)
	DO 900 I = 1, 6
	IF (WRK(I) .EQ. ' ') GO TO 900
	LINE(LINSUB) = WRK(I)
	LINSUB = LINSUB + 1
900	CONTINUE
910	LINE(LINSUB) = '('
	LINSUB = LINSUB + 1
	CALL REG (R, LINE, LINSUB)
	LINE(LINSUB) = ')'
	LINSUB = LINSUB + 1
	GO TO 1800
1000	ISUB = ISUB + 1
	PC = PC + 2
	IF (PC .LT. IENDS) GO TO 1050
	WRITE  (5, 1010) 7
1010	FORMAT (/,' END OF SEGMENT',A1)
	LINSUB = -1
	RETURN
1050	IF (ISUB .LE. 256) GO TO 1100
	IREC = IREC + 1
	CALL FILL
1100	Z = .TRUE.
	CALL OCTL (BLK(ISUB), WRK, Z)
	J = 1
	DO 1200 I = OCTADR, OCTADR+5
	LINE(I) = WRK(J)
	J = J + 1
1200	CONTINUE
	OCTADR = OCTADR + 8
	IF (MAC(NO) .GT. '3') GO TO 1500
	IF (MAC(NO) .EQ. '2') GO TO 1300
	LINE(LINSUB) = '@'
	LINSUB = LINSUB + 1
1300	LINE(LINSUB) = '#'
	LINSUB = LINSUB + 1
	Z = .FALSE.
	CALL OCTL (BLK(ISUB), WRK, Z)
	DO 1400 I = 1, 6
	IF (WRK(I) .EQ. ' ') GO TO 1400
	LINE(LINSUB) = WRK(I)
	LINSUB = LINSUB + 1
1400	CONTINUE
	GO TO 1800
1500	IF (MAC(NO) .EQ. '6') GO TO 1600
	LINE(LINSUB) = '@'
	LINSUB = LINSUB + 1
1600	IBLK = BLK(ISUB)
	IWRK = PC + IBLK
	Z = .FALSE.
	CALL OCTL (LOIWRK, WRK, Z)
	DO 1700 I = 1, 6
	IF (WRK(I) .EQ. ' ') GO TO 1700
	LINE(LINSUB) = WRK(I)
	LINSUB = LINSUB + 1
1700	CONTINUE
C
C
1800	NO = NO + 2
	IF (NO .GT. 6) RETURN
	LINE(LINSUB) = ','
	LINSUB = LINSUB + 1
	GO TO 100
	END
