	SUBROUTINE INIT (ISEG, IBEG)
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	ADDR1,		ADDR2,		IBEG
	INTEGER*4	PC,		LEN,		I4SUB
	INTEGER*2	BLK(256),	SEGTAB(3,50),	I2SUB(2)
	INTEGER*2	LOSUB,		HISUB
	BYTE		SNAM(25)
	EQUIVALENCE	(I4SUB,I2SUB)
	EQUIVALENCE	(I2SUB(1),LOSUB),	(I2SUB(2),HISUB)
	COMMON	/TSKCOM/  BLK, IREC, ISUB, PC, SEGTAB, IZRWRD, SNAM
	ISUB = 0 !MAKE SURE IT'S GOOD COMING IN
	IF (ISEG.LT.1 .OR. ISEG.GT.49) GO TO 5
	IF (SEGTAB(1,ISEG) .EQ. 0) GO TO 5 !BEG. VBN OF SEGMENT
	GO TO 20
5	WRITE  (5, 10) 7
10	FORMAT (/,' INVALID SEGMENT NUMBER',A1)
	ISUB = -1
	RETURN
20	ADDR1 = SEGTAB(2,ISEG) !BEG. PC OF SEGMENT
	ADDR1 = (ADDR1 .AND. "177777)
	ADDR2 = SEGTAB(3,ISEG) !END. PC
	ADDR2 = (ADDR2 .AND. "177777)
	IF (IBEG.GE.ADDR1 .AND. IBEG.LE.ADDR2) GO TO 40
	WRITE  (5, 30) 7
30	FORMAT (/,' INVALID ADDRESS FOR THIS SEGMENT',A1)
	ISUB = -1
	RETURN
40	IREC = SEGTAB(1,ISEG)
	ISUB = 1
	PC   = IBEG
	IF (ISEG .EQ. 1) ISUB = IZRWRD
	IF (IBEG .EQ. ADDR1) GO TO 99
	LEN = IBEG - ADDR1 !BYTES FR. BEG. OF SEG. TO REQ. ADDR.
	LEN = LEN / 2 !WDS. TO REQ. ADDR.
	I4SUB = ISUB
	I4SUB = I4SUB + LEN
	ISUB  = LOSUB
	IF (I4SUB .LE. 256) GO TO 99
	DO 50 I = 1, 1000
	I4SUB = I4SUB - 256
	IF (I4SUB .LE. 256) GO TO 70
50	CONTINUE
	WRITE  (5, 60) 7
60	FORMAT (/,' SEGMENT A THOUSAND BLOCKS LONG',A1)
	ISUB = -1
	RETURN
70	IREC = IREC + I
	ISUB = LOSUB
99	READ   (1'IREC) BLK
	RETURN
	END
