FORTRAN IV-PLUS V02-51D		02:26:00    22-AUG-78		PAGE 1   

MHDANL.FTN   	/TR:BLOCKS/WR


        C

        C

        C	MHDANL  --  MODULE HEADER ANALYSER

        C

        C

        C

        C	COPYRIGHT (C) 1976,1977,1978

        C	DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

        C

        C	THIS SOFTWARE IS FURNISHED UNDER  A LICENSE FOR USE ONLY  ON  A

        C	SINGLE COMPUTER SYSTEM AND MAY BE  COPIED ONLY WITH  THE INCLU-

        C	SION OF  THE  ABOVE  COPYRIGHT NOTICE.  THIS SOFTWARE,  OR  ANY

        C	OTHER COPIES THEREOF, MAY NOT BE  PROVIDED  OR  OTHERWISE  MADE

        C	AVAILABLE TO ANY OTHER PERSON EXCEPT  FOR  USE  ON  SUCH SYSTEM

        C	AND TO  ONE WHO AGREES  TO  THESE LICENSE  TERMS.  TITLE TO AND

        C	OWNERSHIP OF THE SOFTWARE SHALL AT ALL TIMES REMAIN IN DEC.

        C

        C	THE INFORMATION IN THIS SOFTWARE  IS  SUBJECT TO CHANGE WITHOUT

        C	NOTICE AND SHOULD NOT BE CONSTRUED  AS  A COMMITMENT BY DIGITAL

        C	EQUIPMENT CORPORATION.

        C

        C	DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS

        C	SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.

        C

        C

        C	T.J. PORTER 	01-AUG-76

        C

        C

        C	THIS SUBROUTINE ANALYSES THE VALIDITY AND CONTENT

        C	OF MODULE HEADER RECORDS.

        C

        C

        C

        C  MODIFICATIONS:

        C

        C

        C NO.		DATE		PROGRAMMER		PURPOSE

        C --		----		----------		-------

        C

        C 01		20-AUG-76	K.D. MORSE		OMIT PRMODE CHECKS

        C							AND TYPE VS WRITES.

        C 02		01-SEP-76	K.D. MORSE		CHANGE MHD RECORD FORMAT

        C							TO INCLUDE SUB-HEADER 

        C							TYPE.  ADD SUBANL.

        C 03		12-NOV-76	K.D. MORSE		ADD OCTAL VALUE TO

        C							ILLEGAL NAME CHARACTER

        C							OUTPUT.

        C 04		15-NOV-76	K.D. MORSE		ADD OCTAL OUTPUT ON

        C							ILLEGAL VERRSION CHAR.

        C 05		13-SEP-77	K.D. MORSE		FIX IDENT BUG FOR '-'.

        C 06		08-MAY-78	K.D. MORSE		CHANGE TIME/DATE FIELD

        C							TO 17 CHARACTERS.

        C 07		09-MAY-78	K.D. MORSE		ADD TIRCNT TO COMMON.

        C

        C

        C

FORTRAN IV-PLUS V02-51D		02:26:00    22-AUG-78		PAGE 2   

MHDANL.FTN   	/TR:BLOCKS/WR


        C

0001    	SUBROUTINE	MHDANL

        C

        C

0002    	LOGICAL*1	DUMPIT

        C

0003    	INTEGER	RECNUM,PSCNT,PSRGSD,PSRTIR,PRMODE,ERRCNT,WRTERR

0004    	INTEGER	FLDLNG,FLDPNT,VERPNT,DATPNT

0005    	INTEGER	VERLNG,DATLNG,SUBPNT,SUBCNT

0006    	INTEGER PROCRC,TITLRC,COPYRC,TIRCNT

        C

0007    	BYTE	RECORD(512),LSTREC,STRLEV,STRUCT,EOM,ZERO,NINE

0008    	BYTE	BLANK,SUBTYP

0009    	BYTE	A(2)

        C

0010    	COMMON	RECORD,MHDLNG,RECNUM,LSTREC,DUMPIT,PSCNT,PSRGSD,PSRTIR

0011    	COMMON	MXINFL,PRMODE,ERRCNT,WRTERR,SUBCNT,ISTACK

0012    	COMMON	PROCRC,TITLRC,COPYRC,TIRCNT

        C

0013    	EQUIVALENCE (SUBTYP,RECORD(2))

0014    	EQUIVALENCE (STRLEV,RECORD(3)),(MXRLNG,A(1))

0015    	EQUIVALENCE (NAMPNT,FLDPNT),(NAMLNG,FLDLNG)

0016    	EQUIVALENCE (VERPNT,FLDPNT),(VERLNG,FLDLNG)

0017    	EQUIVALENCE (DATPNT,FLDPNT),(DATLNG,FLDLNG)

0018    	EQUIVALENCE (SUBPNT,FLDPNT)

        C

0019    	DATA STRUCT/0/,MAXREC,MINREC/512,2/,NAMMAX/15/

0020    	DATA ZERO,NINE/'0','9'/,EOM/3/,BLANK/' '/

0021    	DATA MAXMHD,MINMHD/71,43/

        C

0022    10	FORMAT(/' >>>>>>>>>> RECORD ',I5,' IS A MODULE HEADER '

        	1,I4,' BYTES LONG <<<<<<<<<<<<')

0023    20	FORMAT (T5,'*****INVALID SEQUENCE - MHD SHOULD',

        	1' NOT FOLLOW TYPE',I2,' RECORD')

0024    30	FORMAT (T5,'*****ILLEGAL STRUCTURE LEVEL - ONLY',

        	1I2,' IS SUPPORTED')

0025    40	FORMAT (T10,'STRUCTURE LEVEL = ',I2)

0026    50	FORMAT (T5,'*****ILLEGAL MAXIMUM RECORD LENGTH -',

        	1' MUST BE BETWEEN ',I3,' AND ',I3)

0027    60	FORMAT (T10,'MAXIMUM RECORD LENGTH = ',I3)

0028    70	FORMAT (T5,'*****MODULE NAME LENGTH ILLEGAL',

        	1I5,/T10,'SHOULD BE 1 TO 'I3,' CHARACTERS')

0029    80	FORMAT (T5,'*****MODULE NAME CONTAINS ILLEGAL CHARACTER'

        	1,/,T15,'CHARACTER',I3,' IS ',1A1,'   (',I3,' OCTAL)') !++03 OCTAL TOO

0030    90	FORMAT (T5,'*****FIRST CHARACTER OF MODULE NAME IS'

        	1/,T15,'NUMERIC OR BLANK')

0031    100	FORMAT (T10,'MODULE NAME IS "',<NAMLNG>A1,'"')

0032    110	FORMAT (T5,'*****IDENT LENGTH (',I5,' ) ILLEGAL'

        	1/,T15,'SHOULD BE 1 TO ',I3,' CHARACTERS')

0033    120	FORMAT (T5,'*****IDENT CONTAINS ILLEGAL CHARACTER'

        	1/,T15,'CHARACTER',I3,' IS ',1A1,'  (',O3,' OCTAL)') !++04 OCTAL TOO

0034    130	FORMAT (T10,'MODULE IDENT IS "',<VERLNG>A1,'"')

0035    140	FORMAT (T5,'*****DATE/TIME FIELD CONTAINS ILLEGAL CHARACTER'

        	1/,T15,'CHARACTER',I3,'IS '1A1)

0036    150	FORMAT (T5,'****ILLEGAL SYNTAX FOR DATE/TIME',

        	1' FIELD'/,T15,<I+1-K>A1)

FORTRAN IV-PLUS V02-51D		02:26:00    22-AUG-78		PAGE 3   

MHDANL.FTN   	/TR:BLOCKS/WR


0037    160	FORMAT (T10,'CREATION DATE/TIME WAS ',17A1,/

        	1,T10'LAST PATCH DATE/TIME WAS ',17A1)

0038    180	FORMAT (T5,'*****ILLEGAL RECORD LENGTH ',I4,' - NOT BETWEEN ',

        	1I3,' AND ',I3)

0039    190	FORMAT (T5,'*****INCOMPLETE RECORD - NEXT FIELD (',

        	1'AT BYTE ',I4,') BEYOND RECORD')

        C

        C---->		CALL SUBHEADER ANALYSER IF THIS IS A SUBHEADER RECORD

        C

0040    	IF (SUBTYP .GT. 0) GOTO 1751		!++02 CHECK FOR SUB-HEADER RECORD

        C

        C---->		ANNOUNCE MODULE HEADER RECORD AND

        C			DETERMINE VALID SEQUENCE

        C

0041    	WRITE(2,10,ERR=9000) RECNUM,MHDLNG

0042    	IF (LSTREC .EQ. EOM) GO TO 400

        C

0043    		ERRCNT = ERRCNT + 1

0044    		WRITE(2,20,ERR=9000) LSTREC

        C

        C---->		CHECK THAT THE RECORD IS BETWEEN THE CORRECT LIMITS

        C			OF LENGTH

        C

0045    400	IF(MHDLNG .GE. MINMHD .AND. (MHDLNG .LE. MAXMHD)) GO TO 500

        C

0046    		ERRCNT = ERRCNT + 1

0047    		WRITE(2,180,ERR=9000) MHDLNG,MINMHD,MAXMHD

        C

        C---->		VALIDATE THE STRUCTURE LEVEL AND PRINT IT

        C

0048    500	IF (STRLEV .EQ. STRUCT) GO TO 600

        C

0049    		ERRCNT = ERRCNT + 1

0050    		WRITE(2,30,ERR=9000) STRUCT

        C

0051    600	WRITE(2,40,ERR=9000) STRLEV

        C

        C---->		CHECK AND PRINT MAX RECORD LENGTH

        C			FIELD

        C

0052    670	A(1)=RECORD(4)

0053    	A(2)=RECORD(5)

0054    	IF (MXRLNG .GE. MINREC .AND. (MXRLNG .LE. MAXREC)) GO TO 700

        C

0055    		ERRCNT = ERRCNT + 1

0056    		WRITE(2,50,ERR=9000) MINREC,MAXREC

0057    700	WRITE(2,60,ERR=9000) MXRLNG

0058    	MXINFL = MXRLNG

        C

        C---->		NOW ANALYSE AND PRINT MODULE

        C		NAME FIELD

        C

0059    	NAMPNT  =  7

0060    	NAMLNG  =  RECORD(NAMPNT-1)

0061    	IF(FLDPNT .GT. MHDLNG) GO TO 1750

        C

FORTRAN IV-PLUS V02-51D		02:26:00    22-AUG-78		PAGE 4   

MHDANL.FTN   	/TR:BLOCKS/WR


0062    	J  =  NAMLNG

0063    	K  =  NAMPNT

0064    800	CALL FLDCHK (J,K,RECORD,I)

0065    	IF (I) 830,950,900

        C

        C---->		NAME FIELD HAS INVALID LENGTH

        C			SET LENGTH TO MAXIMUM, PRINT ERROR.

        C

0066    830		ERRCNT = ERRCNT + 1

0067    		WRITE(2,70,ERR=9000) NAMLNG,NAMMAX

0068    		NAMLNG  =  NAMMAX

0069    		J  = NAMMAX

0070    		DUMPIT  =  .TRUE.

0071    		GO TO 800

        C

        C---->		NAME FIELD CONTAINS ILLEGAL CHARACTER

        C		PRINT IT AND GO TO NEXT

        C

0072    900		ERRCNT = ERRCNT + 1

0073    		WRITE(2,80,ERR=9000) I-NAMPNT+1,RECORD(I),RECORD(I) !++03 OCTAL TOO

0074    		K  =  I+1

0075    		J  =  NAMLNG+NAMPNT-K

0076    		IF (K .LT. NAMPNT+NAMLNG) GO TO 800

        C

        C---->		ALL CHARACTERS OF FIELD ARE CHECKED. NOW

        C			SEE IF FIRST IS NUMERIC OR BLANK

        C

0077    950	IF (RECORD(NAMPNT) .LT. ZERO .OR. (RECORD(NAMPNT) .GT. NINE))

        	1 GO TO 960

        C

0078    		GO TO 970

0079    960	IF (RECORD(NAMPNT) .NE. BLANK) GO TO 1000

        C

0080    970		ERRCNT = ERRCNT + 1

0081    		WRITE(2,90,ERR=9000)

        C

        C---->		NOW PRINT THE NAME

        C

0082    1000	WRITE(2,100,ERR=9000) (RECORD(I), I=NAMPNT,NAMPNT+NAMLNG-1)

        C

        C---->		IF MODULE NAME FIELD HAD INVALID LENGTH, RETURN.

        C

0083    	IF (DUMPIT) RETURN

        C

        C

        C---->		NOW ANALYSE THE VERSION NUMBER FIELD

        C

0084    	VERPNT  =  NAMPNT+NAMLNG+1

0085    	VERLNG  =  RECORD(VERPNT-1)

0086    	IF (FLDPNT .GT. MHDLNG) GO TO 1750

0087    	J  =  VERLNG

0088    	K  =  VERPNT

0089    1100	CALL FLDCHK(J,K,RECORD,I)

0090    	IF (I) 1150,1300,1200

        C

        C---->		VERSION NUMBER FIELD HAS ILLEGAL LENGTH

FORTRAN IV-PLUS V02-51D		02:26:00    22-AUG-78		PAGE 5   

MHDANL.FTN   	/TR:BLOCKS/WR


        C

        C

0091    1150		ERRCNT = ERRCNT + 1

0092    		WRITE(2,110,ERR=9000) VERLNG,NAMMAX

0093    		VERLNG  =  NAMMAX

0094    		J = NAMMAX

0095    		DUMPIT  =  .TRUE.

0096    		GO TO 1100

        C

        C---->		VERSION NUMBER FIELD HAS INVALID CHARACTER

        C

0097    1200		IF (RECORD(I) .EQ. '-') GOTO 1250

0098    		ERRCNT = ERRCNT + 1

0099    		WRITE(2,120)I-VERPNT+1,RECORD(I),RECORD(I) !++04 OCTAL OUTPUT TOO

0100    1250		K  =  I+1

0101    		J  =  VERLNG+VERPNT-K

0102    		IF (K .LT. VERPNT+VERLNG) GO TO 1100

        C

        C

        C---->		ALL CHARACTERS OF IDENT ARE CHECKED

        C		NOW PRINT IT ALL

        C

0103    1300	WRITE(2,130,ERR=9000) (RECORD(I),I=VERPNT,VERPNT+VERLNG-1)

        C

        C---->		IF LENGTH OF IDENT FIELD INVALID - EXIT NOW

        C

0104    	IF (DUMPIT) RETURN

        C

        C

        C---->		NOW VALIDATE AND PRINT THE DATE

        C

        C		FIELDS

        C

0105    	DATPNT  =  VERPNT+VERLNG

0106    	DATLNG  =  34

0107    	IF (FLDPNT .GT. MHDLNG) GO TO 1750

0108    	J  =  DATLNG

0109    	K  =  DATPNT

0110    	I  =  K

0111    1400	CALL DATTIM(J,K,RECORD,I)

0112    	IF(I)1500,1600,1430

        C

        C---->		DATE TIME FIELD HAS ILLEGAL CHARACTER

        C

        C

0113    1430		WRITE(2,140,ERR=9000) I-DATPNT+1,RECORD(I)

0114    1460		K  =  I+1

0115    		J  =  DATLNG+DATPNT-K

0116    		ERRCNT = ERRCNT + 1

0117    		IF (K .LT. DATPNT+DATLNG) GO TO 1400

0118    		GO TO 1600

        C

        C

        C---->		DATE/TIME FIELD HAS ILLEGAL SYNTAX

        C

0119    1500		I  =  -I

FORTRAN IV-PLUS V02-51D		02:26:00    22-AUG-78		PAGE 6   

MHDANL.FTN   	/TR:BLOCKS/WR


0120    		WRITE(2,150,ERR=9000) (RECORD(K),K = DATPNT,I)

0121    		GO TO 1460

        C

        C---->		DATE/TIME FIELDS ARE ANALYSED, PRINT THEM.

        C

        C

0122    1600	WRITE(2,160,ERR=9000) (RECORD(I),I=DATPNT,DATPNT+16),

        	1(RECORD(I), I = DATPNT+17,DATPNT+33)

0123    	GOTO 1800

        C

        C---->		ANALYSE SUBHEADER RECORDS

        C

0124    1700	SUBCNT  =  RECORD(SUBPNT)

0125    	GOTO 1800

0126    1751	CALL SUBANL			!++01 ANALYZE SUB-HEADER RECORDS

0127    	GO TO 1800			!++01 DONE

        C

        C---->		HERE WHEN NEXT FIELD IS BEYOND END OF RECORD

        C

0128    1750	ERRCNT = ERRCNT + 1

0129    	WRITE(2,190,ERR=9000) FLDPNT

0130    1770	CONTINUE

0131    1800	RETURN

        C

        C---->		HERE IF AN ERROR WRITING OUTPUT FILE

        C

0132    9000	WRTERR = 1

0133    	RETURN

        C

0134    	END

FORTRAN IV-PLUS V02-51D		02:26:00    22-AUG-78		PAGE 7   

MHDANL.FTN   	/TR:BLOCKS/WR


PROGRAM SECTIONS



NUMBER	 NAME	    SIZE		ATTRIBUTES



  1	$CODE1	003034   782		RW,I,CON,LCL

  3	$IDATA	002132   557		RW,D,CON,LCL

  4	$VARS	000034    14		RW,D,CON,LCL

  5	$TEMPS	000002     1		RW,D,CON,LCL

  6	.$$$$.	001040   272		RW,D,OVR,GBL





ENTRY POINTS



 NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS   



 MHDANL	      1-000000





VARIABLES



 NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS   



 BLANK	L*1   4-000012	 COPYRC	I*2   6-001034	 DATLNG	I*2   4-000002	 DATPNT	I*2   4-000000	 DUMPIT	L*1   6-001005

 EOM	L*1   4-000007	 ERRCNT	I*2   6-001020	 FLDLNG	I*2   4-000002	 FLDPNT	I*2   4-000000	 I	I*2   4-000026

 ISTACK	I*2   6-001026	 J	I*2   4-000032	 K	I*2   4-000030	 LSTREC	L*1   6-001004	 MAXMHD	I*2   4-000022

 MAXREC	I*2   4-000014	 MHDLNG	I*2   6-001000	 MINMHD	I*2   4-000024	 MINREC	I*2   4-000016	 MXINFL	I*2   6-001014

 MXRLNG	I*2   4-000004	 NAMLNG	I*2   4-000002	 NAMMAX	I*2   4-000020	 NAMPNT	I*2   4-000000	 NINE	L*1   4-000011

 PRMODE	I*2   6-001016	 PROCRC	I*2   6-001030	 PSCNT	I*2   6-001006	 PSRGSD	I*2   6-001010	 PSRTIR	I*2   6-001012

 RECNUM	I*2   6-001002	 STRLEV	L*1   6-000002	 STRUCT	L*1   4-000006	 SUBCNT	I*2   6-001024	 SUBPNT	I*2   4-000000

 SUBTYP	L*1   6-000001	 TIRCNT	I*2   6-001036	 TITLRC	I*2   6-001032	 VERLNG	I*2   4-000002	 VERPNT	I*2   4-000000

 WRTERR	I*2   6-001022	 ZERO	L*1   4-000010





ARRAYS



 NAME   TYPE  ADDRESS	    SIZE 	DIMENSIONS



 A	L*1   4-000004	000002     1	(2)

 RECORD	L*1   6-000000	001000   256	(512)





LABELS



 LABEL   ADDRESS 	 LABEL   ADDRESS 	 LABEL   ADDRESS 	 LABEL   ADDRESS 	 LABEL   ADDRESS 	



 10'	 3-000000	 20'	 3-000114	 30'	 3-000220	 40'	 3-000312	 50'	 3-000344

 60'	 3-000454	 70'	 3-000514	 80'	 3-000626	 90'	 3-000760	 100'	 3-001060

 110'	 3-001114	 120'	 3-001226	 130'	 3-001350	 140'	 3-001406	 150'	 3-001522

 160'	 3-001610	 180'	 3-001710	 190'	 3-002006	 400	 1-000154	 500	 1-000264

 600	 1-000344	 670	    **   	 700	 1-000516	 800	 1-000640	 830	    **   

 900	 1-000764	 950	 1-001140	 960	 1-001176	 970	 1-001220	 1000	 1-001260

 1100	 1-001462	 1150	    **   	 1200	 1-001606	 1250	 1-001720	 1300	 1-001772

 1400	 1-002200	 1430	    **   	 1460	 1-002310	 1500	 1-002370	 1600	 1-002476

 1700	    **   	 1750	 1-002714	 1751	 1-002674	 1770	    **   	 1800	 1-002764

 9000	 1-002766



FORTRAN IV-PLUS V02-51D		02:26:00    22-AUG-78		PAGE 8   

MHDANL.FTN   	/TR:BLOCKS/WR




FUNCTIONS AND SUBROUTINES REFERENCED



 DATTIM	 FLDCHK	 SUBANL





TOTAL SPACE ALLOCATED = 006264  1626



NO FPP INSTRUCTIONS GENERATED

FORTRAN IV-PLUS V02-51D		02:26:33    22-AUG-78		PAGE 9   

MHDANL.FTN   	/TR:BLOCKS/WR


         

FORTRAN IV-PLUS V02-51D		02:26:33    22-AUG-78		PAGE 10  

MHDANL.FTN   	/TR:BLOCKS/WR


         

0001    	SUBROUTINE DATTIM(J,K,ARRAY,I)

0002    	BYTE	ARRAY(J+K-1)

0003    	I=0

0004    	RETURN

0005    	END

FORTRAN IV-PLUS V02-51D		02:26:33    22-AUG-78		PAGE 11  

MHDANL.FTN   	/TR:BLOCKS/WR


PROGRAM SECTIONS



NUMBER	 NAME	    SIZE		ATTRIBUTES



  1	$CODE1	000060    24		RW,I,CON,LCL

  3	$IDATA	000020     8		RW,D,CON,LCL





ENTRY POINTS



 NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS   



 DATTIM	      1-000000





VARIABLES



 NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS   



 I	I*2   F-000010*	 J	I*2   F-000002*	 K	I*2   F-000004*





ARRAYS



 NAME   TYPE  ADDRESS	    SIZE 	DIMENSIONS



 ARRAY	L*1   F-000006*	     **     	(*)





TOTAL SPACE ALLOCATED = 000100    32



NO FPP INSTRUCTIONS GENERATED

FORTRAN IV-PLUS V02-51D		02:26:34    22-AUG-78		PAGE 12  

MHDANL.FTN   	/TR:BLOCKS/WR


         



OBJ$:MHDANL.OBI,LIS$:MHDANL.LST/-SP=SRC$:MHDANL

