Trailing-Edge
-
PDP-10 Archives
-
decuslib20-04
-
decus/20-0125/getbyt.lst
There is 1 other file named getbyt.lst in the archive. Click here to see a list.
GETBYT GETBYT.FOR FORTRAN V.5A(621) /KI 1-FEB-81 11:37 PAGE 1
00001 INTEGER FUNCTION GETBYT(CSUM)
00002
00003 C THIS FUNCTION IS USED TO RETRIEVE FOUR
00004 C EIGHT BIT BYTES FROM ONE THIRTY SIX
00005 C BIT WORD AND SUM INTO CHECKSUM
00006 C THIS ROUTINE RETURNS ONE BYTE FOR EACH CALL
00007
00008 INTEGER CSUM, DSK, LOG, POS, WORD36, GFIELD
00009 DATA DSK, LOG, POS /20, 21, 0/
00010
00011 1 FORMAT(' ? PREMATURE END OF FILE')
00012
00013 POS = MOD(POS, 4)
00014 IF(POS .GT. 0) GO TO 10
00015 READ(DSK, END = 1000) WORD36
00016 10 POS = POS + 1
00017 IF(POS .EQ. 1) GETBYT = GFIELD(WORD36, 10, 8)
00018 IF(POS .EQ. 2) GETBYT = GFIELD(WORD36, 2, 8)
00019 IF(POS .EQ. 3) GETBYT = GFIELD(WORD36, 28, 8)
00020 IF(POS .EQ. 4) GETBYT = GFIELD(WORD36, 20, 8)
00021 CSUM = CSUM + GETBYT
00022 RETURN
00023 1000 WRITE(LOG, 1)
00024 CLOSE(UNIT=LOG)
00025 STOP
00026 END
SUBPROGRAMS CALLED
MOD.
GFIELD
SCALARS AND ARRAYS [ "*" NO EXPLICIT DEFINITION - "%" NOT REFERENCED ]
GETBYT 1 POS 2 LOG 3 DSK 4 CSUM 5
WORD36 6
TEMPORARIES
.A0016 15 .A0002 16 .A0003 17
GETBYT [ NO ERRORS DETECTED ]