C FUNCTION IOS8 (V1A) - READS OR WRITES ABSOLUTE BLOCKS IN OS8 FORMAT
C
	FUNCTION IOS8(ICODE,WCNT,BUFF,IBLK,CHAN)
	INTEGER WCNT,BUFF(1),BLK,CHAN,TRACK(4),SECTOR(4),LBUFF(65)
C DECODE BLOCK ADDRESS
	BLK=IBLK
	MYWCNT=1
10	CALL OS8BLK(BLK,SECTOR,ITK1,ITK2)
C ASSIGN TRACK ARRAY
	TRACK(1)=ITK1
	TRACK(2)=ITK1
	TRACK(3)=ITK2
	TRACK(4)=ITK2
C TRANSFER 4 SECTORS
	DO 11 N=1,4
C SET LBUFF INDEX
	J=1
C SET LIMIT
	LIMIT=MIN0(MYWCNT+64,WCNT)
C FILL LBUFF IF READ
	IF(ICODE.EQ."377)GOTO 15
	DO 16 M=MYWCNT,LIMIT
	J=J+1
16	LBUFF(J)=BUFF(M)
15	I=ISPFNW(ICODE,CHAN,TRACK(N),LBUFF,SECTOR(N))
C ABORT ON ERROR
	IF(I.NE.0)GOTO 12
C EMPTY LBUFF IF READ
	IF(ICODE.EQ."376)GOTO 17
	DO 14 M=MYWCNT,LIMIT
	J=J+1
14	BUFF(M)=LBUFF(J)
17	MYWCNT=MYWCNT+64
	IF(MYWCNT.GE.WCNT)GOTO 13
11	CONTINUE
C INCREMENT BLOCK NUMBER
	BLK=BLK+1
	GOTO 10
12	IOS8=-I
	RETURN
13	IOS8=0
	RETURN
	END
