

                22-Aug-1978 02:33:25	VAX-11 FORTRAN IV-PLUS V1.0-2      Page 1   

					MHDANL.FTN.7        



        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



                22-Aug-1978 02:33:25	VAX-11 FORTRAN IV-PLUS V1.0-2      Page 2   

					MHDANL.FTN.7        



        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)



MHDANL          22-Aug-1978 02:33:25	VAX-11 FORTRAN IV-PLUS V1.0-2      Page 3   

					MHDANL.FTN.7        



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



MHDANL          22-Aug-1978 02:33:25	VAX-11 FORTRAN IV-PLUS V1.0-2      Page 4   

					MHDANL.FTN.7        



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



MHDANL          22-Aug-1978 02:33:25	VAX-11 FORTRAN IV-PLUS V1.0-2      Page 5   

					MHDANL.FTN.7        



        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



MHDANL          22-Aug-1978 02:33:25	VAX-11 FORTRAN IV-PLUS V1.0-2      Page 6   

					MHDANL.FTN.7        



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



MHDANL          22-Aug-1978 02:33:25	VAX-11 FORTRAN IV-PLUS V1.0-2      Page 7   

					MHDANL.FTN.7        



PROGRAM SECTIONS



    Name                 Bytes   Attributes



  0 $CODE                 1516   PIC CON REL LCL   SHR   EXE   RD NOWRT LONG

  1 $PDATA                1100   PIC CON REL LCL   SHR NOEXE   RD NOWRT LONG

  2 $LOCAL                  48   PIC CON REL LCL NOSHR NOEXE   RD   WRT LONG

  3 $BLANK                 544   PIC OVR REL GBL   SHR NOEXE   RD   WRT LONG





ENTRY POINTS



    Address  Type Name           



  0-00000000      MHDANL         





VARIABLES



    Address  Type Name               Address  Type Name               Address  Type Name               Address  Type Name           



  2-0000000A  L*1 BLANK            3-0000021C  I*2 COPYRC           2-00000002  I*2 DATLNG           2-00000000  I*2 DATPNT         

  3-00000205  L*1 DUMPIT           2-00000007  L*1 EOM              3-00000210  I*2 ERRCNT           2-00000002  I*2 FLDLNG         

  2-00000000  I*2 FLDPNT           2-00000016  I*2 I                3-00000216  I*2 ISTACK           2-0000001A  I*2 J              

  2-00000018  I*2 K                3-00000204  L*1 LSTREC           2-00000012  I*2 MAXMHD           2-0000000C  I*2 MAXREC         

  3-00000200  I*2 MHDLNG           2-00000014  I*2 MINMHD           2-0000000E  I*2 MINREC           3-0000020C  I*2 MXINFL         

  2-00000004  I*2 MXRLNG           2-00000002  I*2 NAMLNG           2-00000010  I*2 NAMMAX           2-00000000  I*2 NAMPNT         

  2-00000009  L*1 NINE             3-0000020E  I*2 PRMODE           3-00000218  I*2 PROCRC           3-00000206  I*2 PSCNT          

  3-00000208  I*2 PSRGSD           3-0000020A  I*2 PSRTIR           3-00000202  I*2 RECNUM           3-00000002  L*1 STRLEV         

  2-00000006  L*1 STRUCT           3-00000214  I*2 SUBCNT           2-00000000  I*2 SUBPNT           3-00000001  L*1 SUBTYP         

  3-0000021E  I*2 TIRCNT           3-0000021A  I*2 TITLRC           2-00000002  I*2 VERLNG           2-00000000  I*2 VERPNT         

  3-00000212  I*2 WRTERR           2-00000008  L*1 ZERO           





ARRAYS



    Address  Type Name		       Bytes  Dimensions



  2-00000004  L*1 A                        2  (2)

  3-00000000  L*1 RECORD                 512  (512)





LABELS



    Address   Label       Address   Label       Address   Label       Address   Label       Address   Label       Address   Label   



  1-00000000  10'       1-0000004B  20'       1-0000008F  30'       1-000000C8  40'       1-000000E1  50'       1-00000128  60'     

  1-00000147  70'       1-00000190  80'       1-000001E9  90'       1-00000229  100'      1-00000248  110'      1-00000291  120'    

  1-000002E3  130'      1-00000303  140'      1-0000034E  150'      1-00000385  160'      1-000003C7  180'      1-00000405  190'    

  0-00000079  400       0-000000C6  500       0-000000F5  600           **      670       0-00000163  700       0-000001B0  800     

      **      830       0-0000020B  900       0-00000275  950       0-00000291  960       0-0000029C  970       0-000002BC  1000    

  0-00000336  1100          **      1150      0-00000391  1200      0-000003DD  1250      0-000003FD  1300      0-0000046F  1400    

      **      1430      0-000004BE  1460      0-000004E4  1500      0-00000524  1600          **      1700      0-00000590  1750    

  0-00000587  1751          **      1770      0-000005BA  1800      0-000005BB  9000    







MHDANL          22-Aug-1978 02:33:25	VAX-11 FORTRAN IV-PLUS V1.0-2      Page 8   

					MHDANL.FTN.7        



FUNCTIONS AND SUBROUTINES REFERENCED



DATTIM            FLDCHK            SUBANL         





Total Space Allocated = 3208 Bytes



                22-Aug-1978 02:33:34	VAX-11 FORTRAN IV-PLUS V1.0-2      Page 9   

					MHDANL.FTN.7        



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

0002    	BYTE	ARRAY(J+K-1)

0003    	I=0

0004    	RETURN

0005    	END



DATTIM          22-Aug-1978 02:33:34	VAX-11 FORTRAN IV-PLUS V1.0-2      Page 10  

					MHDANL.FTN.7        



PROGRAM SECTIONS



    Name                 Bytes   Attributes



  0 $CODE                   43   PIC CON REL LCL   SHR   EXE   RD NOWRT LONG

  2 $LOCAL                  40   PIC CON REL LCL NOSHR NOEXE   RD   WRT LONG





ENTRY POINTS



    Address  Type Name           



  0-00000000      DATTIM         





VARIABLES



    Address  Type Name               Address  Type Name               Address  Type Name           



 AP-00000010@ I*2 I               AP-00000004@ I*2 J               AP-00000008@ I*2 K              





ARRAYS



    Address  Type Name		       Bytes  Dimensions



 AP-0000000C@ L*1 ARRAY                   **  (*)





Total Space Allocated = 83 Bytes





COMPILER OPTIONS



/CHECK=(NOBOUNDS,OVERFLOW)

/DEBUG=(NOSYMBOLS,TRACEBACK)

/OPTIMIZE  /WARNINGS  /NOI4  /NOD_LINES  

