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

OBJANAL.FTN  	/TR:BLOCKS/WR


        C

        C

        C	OBJANAL  --  MAIN DRIVER FOR OBJECT ANALYZER

        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 IS THE MAIN DRIVER FOR THE OBJECT MODULE ANALYZER.

        C	IT PROCESSES THE COMMAND LINE, OPENS THE FILES, DOES THE INPUT,

        C	AND DRIVES THE REMAINING SUBROUTINES.

        C

        C

        C  MODIFICATIONS:

        C

        C NO.		DATE		PROGRAMMER		PURPOSE

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

        C

        C 01		15-AUG-76	K.D. MORSE		INSERT COMMAND LINE USAGE.

        C							OMIT USER QUEUES.

        C							INCLUDE SWITCHES FOR OUTPUT.

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

        C							AND TYPE VS WRITES.

        C 03		25-AUG-76	K.D. MORSE		INCLUDE LINKER STACK

        C							CHECKS, ISTACK IN COMMON.

        C 04		01-SEP-76	K.D. MORSE		ADD SWITCH FOR ANALYSING

        C							ONLY ONE TYPE OF RECORD,

        C							AND NO EOM OR EOF REPORTING.

        C 05		05-SEP-76	K.D. MORSE		INCLUDE SUB-HEADER RECORD

        C							ERRORS, SUBCNT,PROCRC,

        C							TITLRC,COPYRC IN COMMON.

        C 06		07-SEP-76	K.D. MORSE		INCLUDE NEW ERRORS ROUTINE.

        C 07		10-SEP-76	K.D. MORSE		CHANGE VERSION TO 3.1.

        C 08		07-JAN-77	K.D. MORSE		ATTACH TERMINAL.

        C 09		07-JAN-77	K.D. MORSE		FIX /TX BUG

        C 10		24-JAN-77	K.D. MORSE		FIX BUG ON COUNT

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

OBJANAL.FTN  	/TR:BLOCKS/WR


        C							OF SUBHEADERS IN

        C							CONCATENATED OBJ.

        C							MODULES WITHOUT /EO

        C 11		08-MAY-78	K.D. MORSE		LINK OPTION SPECIFI-

        C							CATION RECORD (LNK) IS

        C							CHANGED TO TYPE 6.

        C

        C 12		8-AUG-77	K.D. MORSE		CHANGE TO NEW GETCML.

        C							ADD ERRCOD PARAMETER.

        C							CHANGE SWITCH TABLE.

        C 13		13-SEP-77	K.D. MORSE		CHANGE AMAX0 TO MAX0

        C							IN VARIABLE FORMATS.

        C 14		2-FEB-78	K.D. MORSE		PROCESS TYPE 5 RECORDS

        C							LIKE TYPES 2 AND 4.

        C 15		2-FEB-78	K.D. MORSE		ADD /TB SWITCH FOR

        C							TRACEBACK RECORDS.

        C 16		22-MAR-78	K.D. MORSE		ADD /DBG SWITCH FOR

        C							DEBUG RECORDS.

        C 17		22-MAR-78	K.D. MORSE		WRITE TO UNIT 6 NOT 5

        C							ELSE BATCH JOBS FAIL.

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

        C 19		02-AUG-78	K.D. MORSE		ALLOW SUBDIRECTORIES.

        C

        C

        C

        C

        C

        C  VARIABLES:

        C

        C	CLSLNG--LENGTH OF ASCII STRING "CLOSE"

        C	CLSTYP--ASCII STRING "CLOSE"

        C	COMLIN--I/O BUFFER FOR COMMAND LINE

        C	IDFLNG--LENGTH OF THE DEFAULT INPUT FILENAME

        C	ILUN--LOGICAL UNIT NUMBER FOR OPENING INPUT FILE CHANNEL

        C	INMLNG--LENGTH OF THE INPUT FILE SPECIFICATION

        C	INPDEF--ARRAY SPECIFYING ASCII DEFAULT INPUT FILENAME

        C	INPNAM--INPUT FILE SPECIFICATION

        C	INPTYP--ARRAY SPECIFYING FILE TYPE "INPUT"

        C	ISWTCH--VALUE OF SWITCHES SPECIFIED WITH INPUT FILE SPECIFICATION

        C	ITYLNG--LENGTH OF THE STRING SPECIFYING THE FILE TYPE "INPUT"

        C	LENGTH--LENGTH OF INPUT LINE

        C	NTYPE--ARRAY FOR FILE TYPE IN ERROR

        C	NUMSW--NUMBER OF LEGITIMATE SWITCHES

        C	ODFLNG--LENGTH OF THE DEFAULT OUTPUT FILENAME

        C	OLUN--LOGICAL UNIT NUMBER FOR OPENING OUTPUT FILE CHANNEL

        C	ONMLNG--LENGTH OF THE OUTPUT FILE SPECIFICATION

        C	OPNLNG--LENGTH OF ASCII STRING "OPEN"

        C	OPNTYP--ASCII STRING "OPEN"

        C	OSTAT--STATUS OF TYPE OF CLOSE FOR OUTPUT FILE CHANNEL

        C	OSWTCH--VALUE OF SWITCHES SPECIFIED WITH OUTPUT FILE SPECIFICATION

        C	OTYLNG--LENGTH OF THE STRING SPECIFYING THE FILE TYPE "OUTPUT"

        C	OTYPE--TYPE OF OPEN FOR OUTPUT FILE (0=INPUT, 1=OUTPUT)

        C	OUTDEF--ARRAY SPECIFYING ASCII DEFAULT OUTPUT FILENAME

        C	OUTNAM--OUTPUT FILE SPECIFICATION

        C	OUTTYP--ARRAY SPECIFYING FILE TYPE "OUTPUT"

        C	PROLNG--LENGTH OF PROMPT STRING

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

OBJANAL.FTN  	/TR:BLOCKS/WR


        C	PROMPT--PROMPT STRING FOR REQUESTING A COMMAND LINE

        C	RECORD--I/O BUFFER

        C	RECSIZ--NUMBER OF CHARACTERS IN AN I/O BUFFER

        C	SWTABL--ARRAY OF LEGITIMATE ASCII SWITCHES 

        C	TYPLNG--LENGTH OF ASCII STRING FOR TYPE OF FILE IN ERROR

        C

        C

        C

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

OBJANAL.FTN  	/TR:BLOCKS/WR


         

0001    	INTEGER ONMLNG,ODFLNG,OTYLNG,TYPLNG,ERRTYP(9),ERRCOD

0002    	INTEGER OSWTCH,PROLNG,OLUN,OSTAT,OPNLNG,CLSLNG

0003    	INTEGER PROCRC,TITLRC,COPYRC,TIRCNT

0004    	INTEGER RECSIZ,OTYPE,SWITCH(6),DIRFLG

0005    	BYTE NTYPE(10),OUTTYP(6),INPTYP(5),OPNTYP(4),CLSTYP(5)

0006    	BYTE OUTNAM(42),INPNAM(42)

        C

        C	THE NEXT DECLARATION DIMENSIONS THE DEFAULT FILENAMES.  THESE VALUES

        C	SHOULD BE CHANGED ACCORDING TO THE NUMBER OF ASCII CHARACTERS

        C	SPECIFIED IN THE DEFAULT NAMES.

        C

0007    	BYTE INPDEF(4),OUTDEF(13)

        C

        C	THESE TWO ARRAYS MUST BE DIMENSIONED ACCORDING TO THE LENGTH OF

        C	THE USER'S PROMPT AND THE NUMBER OF SWITCH CHARACTERS THAT HE 

        C	SPECIFIES.  (TWO CHARACTERS/SWITCH--MAXIMUM OF 5 SWITCHES)

        C

0008    	BYTE PROMPT(5),OUTSWT(6),INPSWT(18)

        C

        C

0009    	LOGICAL*1	DUMPIT

        C

0010    	INTEGER*4	OBJ,ANL

        C

0011    	INTEGER	RECLNG,RECNUM,PSCNT,PSRGSD,PSRTIR,PRMODE

0012    	INTEGER ERRCNT,WRTERR,SUBCNT

        C

0013    	BYTE RECORD(512),RECTYP,MHD,EOM,LSTREC

0014    	BYTE ICON(3),YES,NO,COMLIN(512)

0015    	BYTE DATIME(18),ITIME(8)

0016    	BYTE ANLDEF(4),RTBRAC,LFBRAC,COLON,PERIOD

0017    	BYTE LFANGL,RTANGL

        C

0018    	COMMON	RECORD,RECLNG,RECNUM,LSTREC,DUMPIT,PSCNT,PSRGSD,PSRTIR

0019    	COMMON	MXRLNG,PRMODE,ERRCNT,WRTERR,SUBCNT,ISTACK

0020    	COMMON	PROCRC,TITLRC,COPYRC,TIRCNT

        C

0021    	EQUIVALENCE	(RECTYP,RECORD(1))

0022    	EQUIVALENCE	(ITIME(1),DATIME(11))

0023    	EQUIVALENCE (COMLIN(1),RECORD(1))

        C

0024    	DATA	ITTY/5/,IODET/O2000/,IOATT/O1400/	! ++07 DEFINE FUNCTION CODES

0025    	DATA	MHD,EOM/0,3/,MAXLNG/512/

0026    	DATA	YES,NO/'Y','N'/

0027    	DATA	ANLDEF/'.','A','N','L'/

0028    	DATA	LFBRAC,RTBRAC,COLON,PERIOD/'[',']',':','.'/

0029    	DATA	LFANGL,RTANGL/'<','>'/

        C

0030    	DATA OUTTYP/'O','U','T','P','U','T'/,OTYLNG/6/

0031    	DATA INPTYP/'I','N','P','U','T'/,ITYLNG/5/

0032    	DATA OPNTYP/'O','P','E','N'/,OPNLNG/4/

0033    	DATA CLSTYP/'C','L','O','S','E'/,CLSLNG/5/

        C

        C	THIS DATA STATEMENT INITIALIZES THE PROMPT STRING AND ITS LENGTH.

        C

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

OBJANAL.FTN  	/TR:BLOCKS/WR


0034    	DATA PROMPT/10,'A','N','L','>'/PROLNG/5/

        C

        C

        C	THE NEXT THREE DATA STATEMENTS REPRESENT THE DEFAULT FILENAMES.

        C	AND THEIR LENGTHS.  THESE DEFAULTS MAY CONSIST OF FILENAME AND/OR

        C	FILE TYPE.  THE TYPE MUST CONSIST OF FOUR CHARACTERS IF SPECIFIED.

        C	THE LENGTHS SHOULD BE SET TO SPECIFY THE NUMBER OF CHARACTERS IN

        C	THE STRING.

        C

0035    	DATA INPDEF/'.','O','B','J'/,IDFLNG/4/

        C

        C	THE SWITCH TABLE SPECIFIES THE LEGITIMATE ASCII SWITCHES TO BE

        C	ACCEPTED AS PART OF A FILE SPECIFICATION.  WHEN THE FIRST SWITCH

        C	(SPECIFIED BY THE FIRST TWO ASCII CHARACTERS IN THE TABLE)

        C	IS SPECIFIED ON A FILE SPECIFICATION, BIT ZERO IS SET IN THE 

        C	RETURNED SWITCH VALUE.  THE SECOND CAUSES BIT ONE TO BE SET AND

        C	SO ON, UP TO A MAXIMUM OF FIVE SWITCHES.  NUMSW SHOULD BE

        C	INITIALIZED TO THE NUMBER OF SWITCHES SPECIFIED IN THE SWITCH TABLE.

        C

0036    	DATA OUTSWT/'T','I',0,'S','P',0/,NUMOSW/2/ !++01,11 OUTPUT SWITCHES

0037    	DATA INPSWT/'M','H',0,'G','S',0,'T','X',0,'E','O',0,

        	1'D','B',0,'T','B',0/,NUMISW/6/		!++04,11,14 PARTIAL ANALYSIS SWITCHES

0038    	DATA SWITCH/1,2,4,8,16,32/		!++01 SWITCH VALUES

0039    	DATA ERRTYP/-1,-2,-3,-4,-5,-6,-7,-8,-9/ !++06 ERROR CODES

0040    	DATA RECSIZ/512/

        C

        C

0041    40	FORMAT(Q,255A1,255A1,2A1)

0042    50	FORMAT(/' ********** RECORD ',I3,' IS ILLEGAL - ZERO LENGTH')

0043    60	FORMAT(/' ?????????? DO YOU WISH TO CONTINUE THIS FILE? (Y OR N) '$)

0044    70	FORMAT(3A1)

0045    80	FORMAT(' ?????????? COME ON NOW - YES OR NO?  '$)

0046    110	FORMAT(/' ********** RECORD',I4,' IS RESERVED TYPE',I4,' ',28('*'))

0047    120	FORMAT(T10'RECORD CONTENT (BYTES IN HEX) FOLLOWS:'/)

0048    130	FORMAT(/' ********** RECORD ',I3,' SEEMS TOO(> ',I3,') LONG ',I5,

             1' BYTES')

0049    140	FORMAT(' ********** FILE "',<INMLNG>A1,'" DOES NOT END WITH EOM.')

0050    150	FORMAT(/' >>>>>>>>>> END OF FILE "',<INMLNG>A1,'" CONTAINING '

        	1,I4,' RECORD(S) ',<MAX0(1,19-INMLNG)>('<')) !++01 ADD MAX CHECK

0051    190	FORMAT(' **********',I3,' PSECT(S) DEFINED - GSD REFERENCES',

        	1' PSECT NUMBER ',I3)

0052    200	FORMAT(' **********',I3,' PSECT(S) DEFINED - TIR REFERENCES'

        	1,' PSECT NUMBER ',I3)

0053    210	FORMAT(' ********** NO P-SECTIONS DEFINED IN MODULE')

0054    220	FORMAT(T10'MODULE DEFINES ',I3,' P-SECTION(S)')

0055    250	FORMAT(' ********** FILE ALSO CONTAINS',I6,' DETECTED ERROR(S)')

0056    260	FORMAT(' ********************************************************'

        	1,'****************'/' ******************** OBJECT MODULE ANALYZ'

        	2,'ER VERSION 4.00 ***************'/' '

        	3,'**************************  ANALYSIS OF FILE  '

        	4,'**************************'/' '

        	5,<MAX0(1,(70-INMLNG)/2)>('*'),' ',<INMLNG>A1,' '

        	6,<MAX0(1,(70-INMLNG)/2)>('*')/' '

        	7,<25>('*'),' ',9A1,' ',9A1,' ',<26>('*')

        	8/' ***************************************************************'

        	9,'*********'/)		!++01 ADD MAX CHECK AND ++07 CHANGE VERSION

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

OBJANAL.FTN  	/TR:BLOCKS/WR


0057    270	FORMAT(' >>>>>>>>>> COMPLETED ANALYSIS IS IN FILE "',<ONMLNG>A1

        	1,'"')

0058    280	FORMAT(T13'AND',I5,' OBJECT MODULE(S)')

0059    290	FORMAT(/' >>>>>>>>>> RECORD',I4,' IS LINKER COMMAND TYPE',I4

        	1,' RECORD ',15('<'))

0060    300	FORMAT(/' >>>>>>>>>> RECORD',I4,' IS IGNORED TYPE',I4,

        	1' RECORD ',22('<'))

0061    310	FORMAT(/' >>>>>>>>>> RECORD',I4,' IS CUSTOMER/CSS TYPE',

        	1I4,' RECORD ',17('<'))

0062    340	FORMAT(/' ********* ERROR--',I4,' EXTRA SUB-HEADER RECORDS',

        	1' SPECIFIED')

0063    350	FORMAT(/' ********* ERROR--',I4,' BYTES WERE NOT PLACED ON THE '

        	1,' LINKER''S STACK'/T19,'BUT WERE REMOVED FROM IT.')

0064    360	FORMAT(/' ********* ERROR--',I4,' BYTES WERE LEFT ON THE LINK'

        	1,'ER''S STACK.')

0065    9481	FORMAT(' ANL -- ERROR--UNABLE TO SPOOL FILE AS TELETYPE OUTPUT'

        	1,' WAS REQUESTED')

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

OBJANAL.FTN  	/TR:BLOCKS/WR


         

        C++01 COMMAND LINE CHANGES START HERE

        C

        C

        C	INITIALIZE ALL PARAMETERS THAT MAY BE USED AS ERROR RETURN CODES.

        C

        C

0066    400	ONMLNG=0

0067    	INMLNG=0

0068    	ILUN=1

0069    	OLUN=2

        C

        C	ASSIGN THE COMMAND LINE INPUT CHANNEL TO THE TERMINAL.

        C	NOTE:  CHANNEL FOUR SHOULD ONLY BE USED FOR COMMAND LINE I/O.

        C

0070    	CALL ASNLUN(4,'TI',0)

        C

        C	REQUEST A COMMAND LINE.

        C

0071    	CALL WTQIO(IODET,ITTY)			! ++07 DETACH TERMINAL

0072    	CALL GETCML(COMLIN,LENGTH,PROMPT,PROLNG,ERRCOD)

0073    	IF (ERRCOD.LE.0) GOTO 9500

0074    	CALL WTQIO(IOATT,ITTY)			! ++07 ATTACH TERMINAL

        C

        C	ANALYZE THE SYNTAX OF THE COMMAND LINE.

        C

0075    	CALL SYNTX(COMLIN,LENGTH,ERRCOD)

0076    	IF (ERRCOD.LE.0) GOTO 9510

        C

        C	INITIALIZE THE INPUT SWITCH VALUES.

        C

0077    	CALL BLDSWT(NUMISW,INPSWT,ERRCOD)

0078    	IF (ERRCOD.LT.0) GOTO 9555

        C

        C	REQUEST AN INPUT FILE SPECIFICATION.

        C

0079    	CALL SCANI(COMLIN,LENGTH,ISWTCH,INPNAM,INMLNG,INPDEF,IDFLNG,ERRCOD)

0080    	IF (ERRCOD.LT.0) GOTO 9530

        C

        C	CREATE AN OUTPUT DEFAULT FILENAME (I.E., USE THE INPUT FILENAME 

        C	AND THE TYPE 'ANL'.)

        C

0081    	ODFLNG=1

0082    	DIRFLG=0

0083    	DO 450 I=1,INMLNG

0084    	IF ((INPNAM(I).NE.LFBRAC) .AND. (INPNAM(I).NE.LFANGL) .AND.

        	1    (INPNAM(I).NE.COLON)) GOTO 451

0085    	DIRFLG = 1

0086    	GOTO 460

0087    451	IF ((INPNAM(I).NE.RTBRAC) .AND. (INPNAM(I).NE.RTANGL)) GOTO 452

0088    	DIRFLG = 0

0089    	GOTO 460

0090    452	IF ((INPNAM(I).EQ.PERIOD) .AND. (DIRFLG .EQ. 0)) GOTO 470

0091    	OUTDEF(ODFLNG)=INPNAM(I)

0092    	ODFLNG=ODFLNG + 1

0093    	GOTO 450

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

OBJANAL.FTN  	/TR:BLOCKS/WR


0094    460	ODFLNG=1

0095    450	CONTINUE

0096    470	DO 480 I=ODFLNG,ODFLNG+3

0097    480	OUTDEF(I)=ANLDEF(I-ODFLNG+1)

0098    	ODFLNG=ODFLNG + 3

        C

        C	INITIALIZE THE OUTPUT SWITCH VALUES.

        C

0099    	CALL BLDSWT(NUMOSW,OUTSWT,ERRCOD)

0100    	IF (ERRCOD.LT.0) GOTO 9550

        C

        C	REQUEST AN OUTPUT FILE SPECIFICATION.

        C

0101    	CALL SCANO(COMLIN,LENGTH,OSWTCH,OUTNAM,ONMLNG,OUTDEF,ODFLNG,ERRCOD)

0102    	IF (ERRCOD.LT.0) GOTO 9520

0103    	IF ((OSWTCH.AND.SWITCH(1)) .EQ. SWITCH(1)) PRMODE=0

0104    	IF ((OSWTCH.AND.SWITCH(1)) .NE. SWITCH(1)) PRMODE=1

        C

        C++01 COMMAND LINE CHANGES END HERE

        C

        C---->		NOW TRY TO OPEN THE INPUT FILE AS LUN 1

        C		BUT ASSIGN LUN 1 TO LOGICAL DEVICE SY TO

        C		MAKE SURE WE GO TO CORRECT USER DIRECTORY

        C		RSX-11M HACK!!!!!!!!!!

        C

0105    	CALL ASNLUN(1,'SY',0)

0106    	OPEN(UNIT=1,NAME=INPNAM,ERR=9560,CARRIAGECONTROL='NONE',

        	1 TYPE='OLD',READONLY)

        C

        C---->		IF WE ARE IN LINE PRINTER MODE OPEN AN OUTPUT

        C		FILE.  USE LUN 2.

        C

0107    	IF( PRMODE .EQ. 0 ) GO TO 590

0108    	CALL ASNLUN(2,'SY',0)

0109    	OPEN(UNIT=2,NAME=OUTNAM,ERR=9600,TYPE='NEW')

        C

0110    	CALL DATE(DATIME)

0111    	CALL TIME(ITIME)

        C

0112    	WRITE(2,260,ERR=9740) (INPNAM(I) , I = 1,INMLNG),DATIME

0113    	GOTO 595

        C

        C		SET UP LUN 2 AS A TELETYPE CHANNEL.

        C

0114    590	CALL ASNLUN(2,'TI',0)

        C

        C

        C---->		NOW INITIALIZE ALL PARAMETERS

        C

0115    595	ERRCNT = 0

0116    	LSTREC = EOM

0117    	RECNUM = 1

0118    	PSCNT  =  -1

0119    	PSRGSD  =  -1

0120    	PSRTIR  =  -1

0121    	MXRLNG  =  MAXLNG

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

OBJANAL.FTN  	/TR:BLOCKS/WR


0122    	WRTERR	=  0

0123    	MODCNT  =  0

0124    	SUBCNT  =  0			!++05 SUB-HEADER EXTRA RECORD COUNTER

0125    	ISTACK  =  0			!++03 STACK COUNTER

0126    	PROCRC  =  0			!++05 LANG. PROC. SUB-HDR COUNTER

0127    	TITLRC  =  0			!++05 TITLE TEXT SUB-HDR COUNTER

0128    	TIRCNT = 0			!++16 COUNT OF TIR, DBG, & TBT RECORDS

0129    	COPYRC  =  0			!++05 COPYRIGHT SUB-HDR COUNTER

        C

        C---->		NOW LET'S READ A RECORD FROM INPUT FILE

        C

        C

0130    600	READ(1,40,END=6100,ERR=9680)RECLNG,(RECORD(I),I=1,RECLNG)

0131    	DUMPIT = .FALSE.

        C

        C---->		DETERMINE IF WE CAN PROCEED WITH THIS

        C		RECORD - AND DISPATCH IF SO

        C

0132    	IF (RECLNG .LE. 0) GO TO 5000

0133    	IF (RECLNG .LE. MXRLNG) GO TO 700

        C

        C---->		RECORD EXCEEDS ALLOWABLE LENGTH

        C

0134    	ERRCNT = ERRCNT + 1

0135    690		WRITE(2,130,ERR=9740) RECNUM,MXRLNG,RECLNG

        C

0136    700	IF (ISWTCH.EQ.0) GOTO 710	!++04 IF ANALYZE ALL RECORDS, BRANCH

0137    	ITYP=RECTYP + 1			!++04 SET SUBSCRIPT

0138    	IF ((ISWTCH.AND.SWITCH(ITYP)) .NE. SWITCH(ITYP)) GOTO 1320 !++10 ANALYZE THIS?

0139    710	GO TO (1000,1100,1200,1300,1200,1200) RECTYP + 1

        C

0140    	ITYP = RECTYP .AND. 255

0141    	IF( ITYP .GT. 10 ) GO TO 740

0142    		WRITE(2,290,ERR=9740) RECNUM,ITYP		! IGNORE LINKER TYPE RECORDS FOR NOW

0143    		GO TO 900

        C

0144    740	IF( ITYP .GT. 100 ) GO TO 780

0145    		ERRCNT = ERRCNT + 1

0146    		WRITE(2,110,ERR=9740) RECNUM,ITYP

0147    		GO TO 900

        C

0148    780	IF( ITYP .GT. 200 ) GO TO 820

0149    		WRITE(2,300,ERR=9740) RECNUM,ITYP

0150    		GO TO 900

        C

0151    820		WRITE(2,310,ERR=9740) RECNUM,ITYP

0152    		GO TO 900

        C

0153    900	DUMPIT = .TRUE.

0154    	GO TO 1600

        C

        C

        C

        C---->		RECORD TYPE DISPATCH TABLE

        C

        C

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

OBJANAL.FTN  	/TR:BLOCKS/WR


0155    1000		CALL MHDANL

0156    		IF (RECORD(2).EQ.0)MODCNT = MODCNT + 1

0157    		GO TO 1320

        C

0158    1100		CALL GSDANL

0159    		GO TO 1320

        C

0160    1200		CALL TIRANL

0161    		TIRCNT = TIRCNT + 1

0162    		GO TO 1320

        C

        C---->	LINK OPTION SPECIFICATION RECORD (LNK)

        C	  (NOT USED FOR RELEASE 1)

        C

        C1250		CALL LNKANL

        C		GO TO 1320

        C

0163    1300		CALL EOMANL

0164    1320	IF (RECTYP.NE.EOM) GOTO 1500		! ++08 FIX BUG

0165    	IF (ISWTCH.NE.0) GOTO 1490	!++04 OMIT SUMMARY ON PARTIAL ANALYSIS

        C

        C---->		SINCE THIS IS END OF MODULE CHECK THAT NO

        C			P-SECTIONS THAT ARE UNDEFINED IN

        C			THE GSD WERE REFERENCED BY SYMBOLS

        C			OR RELOCATIONS.

        C

0166    		IF(PSRGSD .LE. PSCNT) GO TO 1350

0167    			ERRCNT = ERRCNT + 1

0168    			WRITE(2,190,ERR=9740) PSCNT+1,PSRGSD

0169    1350		IF(PSRTIR .LE. PSCNT) GO TO 1370

0170    			ERRCNT = ERRCNT + 1

0171    			WRITE(2,200,ERR=9740) PSCNT+1,PSRTIR

0172    1370		IF(PSCNT)1375,1400,1400

0173    1375			ERRCNT = ERRCNT + 1

0174    			WRITE(2,210,ERR=9740)

0175    1400		WRITE(2,220,ERR=9740) PSCNT+1

0176    1430		CONTINUE

        C

        C---->	CHECK FOR EXTRANEOUS SUBHEADER RECORDS.

        C

0177    	IF (SUBCNT.EQ.0) GOTO 1460	!++05 CHECK SUB-HDR COUNTER

0178    	WRITE(2,340,ERR=9740)SUBCNT	!++05 ERROR IF NON-ZERO

        C

        C---->		CHECK THE LINKER'S STACK.

        C

0179    1460	IF (ISTACK) 1470,1490,1480	!++04 CHECK STACK OVER OR UNDER

0180    1470	WRITE(2,350,ERR=9740)-ISTACK	!++04 ERROR, TOO MUCH REMOVED

0181    	GOTO 1486			!++04 CONTINUE

0182    1480	WRITE(2,360,ERR=9740)ISTACK	!++04 ERROR, TOO MUCH LEFT ON

0183    1486	ERRCNT=ERRCNT + 1		!++04 ONE MORE ERROR

0184    1490		PSCNT = -1

0185    		PSRGSD = -1

0186    		PSRTIR = -1

0187    		MXRLNG = MAXLNG

0188    		SUBCNT = 0		!++05 RESET EXTRA # OF SUB-HDRS

0189    		PROCRC = 0		!++04 RESET EXTRA LANG. PROC. SUB-HDRS

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

OBJANAL.FTN  	/TR:BLOCKS/WR


0190    		TITLRC = 0		!++05 RESET EXTRA TITLE TEXT SUB-HDRS

0191    		COPYRC = 0		!++05 RESET EXTRA COPYRIGHT SUB-HDRS

0192    		ISTACK = 0		!++04 RESET STACK COUNTER

0193    		TIRCNT = 0		! RESET COUNT OF TIR'S

        C

0194    1500	IF(WRTERR .NE. 0) GO TO 9740

0195    	LSTREC = RECTYP

        C

        C---->		DUMP RECORD IF SUBROUTINE

        C			SAID SO

        C

0196    1600	IF (DUMPIT) GO TO 5950

0197    	GO TO 5990

        C

        C---->		RECORD LENGTH IS ZERO

        C

0198    5000	WRITE(2,50,ERR=9740) RECNUM

0199    	ERRCNT = ERRCNT + 1

0200    	GO TO 5990

        C

        C---->		DUMP THE RECORD CONTENTS

        C

0201    5950	WRITE(2,120,ERR=9740)

0202    	CALL HEXDMP(RECORD,1,RECLNG,PRMODE)

        C

        C---->		NOW INCREMENT RECORD NUMBER AND ASK IF

        C		TO CONTINUE IF WE ARE IN TERMINAL RECORD BY RECORD MODE

        C

0203    5990	RECNUM=RECNUM+1

0204    5995	IF (ISWTCH.NE.0) GOTO 600

0205    	IF (PRMODE) 5997,5997,600

0206    5997	WRITE(2,60,ERR=9740)

0207    6000	READ(2,70,ERR=9680)ICON

0208    	IF(ICON(1) .EQ. YES) GO TO 600

0209    	IF(ICON(1) .EQ. NO) GO TO 7000

0210    	WRITE(2,80,ERR=9740)

0211    	GO TO 6000

        C

        C---->		END OF FILE DETECTED, IF LAST RECORD

        C		NOT EOM - SAY SO

        C

0212    6100	IF(LSTREC .EQ. EOM) GO TO 6150

0213    		ERRCNT = ERRCNT + 1

0214    		WRITE(2,140,ERR=9740) (INPNAM(I), I=1,INMLNG)

        C

        C---->		NOW OUTPUT THE MODULE COUNT, ERROR COUNT THEN

        C			IF AND ONLY IF THE LAST RECORD WAS 

        C			NOT EOM DO THE P-SECTION SUMMARY

        C

0215    6150	WRITE(2,150,ERR=9740) (INPNAM(I), I=1,INMLNG), RECNUM-1

0216    	IF (ISWTCH.NE.0) GOTO 7000

0217    	WRITE(2,280,ERR=9740) MODCNT

0218    	IF ( ERRCNT .EQ. 0 ) GO TO 6250

0219    	WRITE(2,250,ERR=9740) ERRCNT

        C

0220    6250	IF((LSTREC .EQ. EOM) .AND. (PRMODE .NE. 0)) GO TO 6325

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

OBJANAL.FTN  	/TR:BLOCKS/WR


0221    	IF( LSTREC .EQ. EOM ) GO TO 6330

0222    	IF(PSRGSD .LE. PSCNT) GO TO 6270

0223    		ERRCNT = ERRCNT + 1

0224    		WRITE(2,190,ERR=9740) PSCNT+1,PSRGSD

0225    6270	IF(PSRTIR .LE. PSCNT) GO TO 6280

0226    		ERRCNT = ERRCNT + 1

0227    		WRITE(2,200,ERR=9740) PSCNT+1,PSRTIR

0228    6280	IF(PSCNT)6290,6300,6300

0229    6290		ERRCNT = ERRCNT + 1

0230    		WRITE(2,210,ERR=9740)

0231    6300	WRITE(2,220,ERR=9740) PSCNT+1

0232    	IF (PRMODE.EQ.0) GOTO 6330

0233    6325	WRITE(6,270,ERR=9740) (OUTNAM(I) , I = 1,ONMLNG)

0234    	WRITE(6,250,ERR=9740) ERRCNT

0235    6330	CONTINUE

        C

        C---->		FINISHED WITH THAT FILE - ANOTHER?

        C

0236    7000	CLOSE(UNIT=1,ERR=9620)

0237    7020	CLOSE(UNIT=2,ERR=9660)

        C

        C---->		CHECK WHETHER OR NOT TO SPOOL FILE.

        C

0238    	IF ((OSWTCH.AND.SWITCH(2)).EQ.SWITCH(2)) GOTO 7050

0239    	GOTO 400

        C

        C---->		SPOOL OUTPUT FILE.

        C

        C++01 NEW CLOSE FILE CHANGES

0240    7050	IF (PRMODE.EQ.0) GOTO 9480

        C

0241    	OSTAT=2

0242    	OTYPE=0

0243    	OLUN=2

0244    	CALL OPNFIL(OUTNAM,ONMLNG,OLUN,RECORD,RECSIZ,OTYPE)

0245    	IF (OLUN.LE.0) GOTO 9650

0246    	CALL CLSFIL(OLUN,OSTAT)

0247    	IF (OLUN.LE.0) GOTO 9670

0248    	GOTO 400

        C

        C++06 NEW ERROR RETURNS AND ERROR HANDLING STARTS HERE

        C

        C---->		ERROR MESSAGES

        C

        C

        C

        C---->		UNABLE TO SPOOL FILE AS TELETYPE OUTPUT REQUESTED

        C

0249    9480	WRITE(6,9481)

0250    	GOTO 400

        C

        C

        C

        C--->		MACRO ROUTINE ERRORS

        C

        C

FORTRAN IV-PLUS V02-51D		02:26:35    22-AUG-78		PAGE 13  

OBJANAL.FTN  	/TR:BLOCKS/WR


        C

        C---->		GETCML ERRORS

        C

0251    9500	IF (ERRCOD .EQ. 0) GOTO 10000

0252    	CALL ERRORS(ERRTYP(1),ERRCOD,PROMPT(2),NOBYTE,NOINTG,NOBYTE,

        	1NOINTG,NOBYTE)

0253    	GOTO 400

        C

        C

        C---->		SYNTX ERRORS

        C

        C

0254    9510	CALL ERRORS(ERRTYP(2),ERRCOD,PROMPT(2),COMLIN,LENGTH,NOBYTE,

        	1NOINTG,NOBYTE)

0255    	GOTO 400

        C

        C

        C---->		SCANO/SCANI ERRORS

        C

        C

        C

        C---->		OUTPUT ERROR

        C

0256    9520	CALL ERRORS(ERRTYP(3),ERRCOD,PROMPT(2),OUTTYP,OTYLNG,NOBYTE,

        	1NOINTG,NOBYTE)

0257    	GOTO 400

        C

        C---->		INPUT ERROR

        C

0258    9530	CALL ERRORS(ERRTYP(3),ERRCOD,PROMPT(2),INPTYP,ITYLNG,NOBYTE,

        	1NOINTG,NOBYTE)

0259    	GOTO 400

        C

        C---->		SWITCH TABLE ERRORS

        C

        C

        C---->		OUTPUT ERROR

        C

0260    9550	CALL ERRORS(ERRTYP(4),ERRCOD,PROMPT(2),SWTABL,NOINTG,NOBYTE,

        	1NOINTG,NOBYTE)

0261    	GOTO 400

        C

        C---->		INPUT ERROR

        C

0262    9555	CALL ERRORS(ERRTYP(4),ERRCOD,PROMPT(2),SWTABL,NOINTG,NOBYTE,

        	1NOINTG,NOBYTE)

0263    	GOTO 400

        C

        C

        C---->		OPEN FILE ERRORS

        C

        C

        C---->		FOR INPUT FILE

        C

0264    9560	ERRCOD=-7

0265    9570	CALL ERRORS(ERRTYP(5),ERRCOD,PROMPT(2),INPTYP,ITYLNG,INPNAM,

FORTRAN IV-PLUS V02-51D		02:26:35    22-AUG-78		PAGE 14  

OBJANAL.FTN  	/TR:BLOCKS/WR


        	1INMLNG,RECORD(1))

0266    	GOTO 7020

        C

        C---->		FOR OUTPUT FILE

        C

0267    9600	ERRCOD=-7

0268    9650	CALL ERRORS(ERRTYP(1),ERRCOD,PROMPT(2),OUTTYP,OTYLNG,OUTNAM,

        	1ONMLNG,RECORD(1))

0269    	IF (ERRCOD .EQ. -7) GOTO 7000

0270    	GOTO 400

        C

        C

        C---->		CLOSE ERRORS

        C

        C

        C

        C---->		ON INPUT FILE

        C

0271    9620	ERRCOD=-8

0272    9630	CALL ERRORS(ERRTYP(6),ERRCOD,PROMPT(2),INPNAM,INMLNG,NOBYTE,

        	1NOINTG,NOBYTE)

0273    	GOTO 7020

        C

        C---->		ON OUTPUT FILE

        C

0274    9660	IF (PRMODE .EQ. 0) ERRCOD=-7

0275    	IF (PRMODE .EQ. 1) ERRCOD=-8

0276    9670	CALL ERRORS(ERRTYP(6),ERRCOD,PROMPT(2),OUTNAM,ONMLNG,NOBYTE,

        	1NOINTG,NOBYTE)

0277    	IF (ERRCOD .LE. -7) GOTO 7020

0278    	GOTO 400

        C

        C

        C---->		READ/WRITE ERRORS

        C

        C

        C

        C---->		ON INPUT FILE

        C

0279    9680	ERRCOD=-7

0280    	CALL ERRORS(ERRTYP(7),ERRCOD,PROMPT(2),INPNAM,INMLNG,RECORD,

        	1LENINP,NOBYTE)

0281    	GOTO 5995

        C

        C---->		ON OUTPUT FILE

        C

0282    9740	ERRCOD=-6

0283    	CALL ERRORS(ERRTYP(7),ERRCOD,PROMPT(2),OUTNAM,ONMLNG,RECORD,

        	1LENINP,NOBYTE)

0284    	GOTO 7000

        C

        C++06 ERROR RETURN CHANGES END HERE

        C

0285    10000	CALL EXIT

0286    	END

FORTRAN IV-PLUS V02-51D		02:26:35    22-AUG-78		PAGE 15  

OBJANAL.FTN  	/TR:BLOCKS/WR


PROGRAM SECTIONS



NUMBER	 NAME	    SIZE		ATTRIBUTES



  1	$CODE1	005656  1495		RW,I,CON,LCL

  2	$PDATA	000046    19		RW,D,CON,LCL

  3	$IDATA	004142  1073		RW,D,CON,LCL

  4	$VARS	000456   151		RW,D,CON,LCL

  5	$TEMPS	000004     2		RW,D,CON,LCL

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





VARIABLES



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



 ANL	I*4   4-000360	 CLSLNG	I*2   4-000070	 COLON	L*1   4-000401	 COPYRC	I*2   6-001034	 DIRFLG	I*2   4-000112

 DUMPIT	L*1   6-001005	 EOM	L*1   4-000365	 ERRCNT	I*2   6-001020	 ERRCOD	I*2   4-000054	 I	I*2   4-000436

 IDFLNG	I*2   4-000420	 ILUN	I*2   4-000430	 INMLNG	I*2   4-000426	 IOATT	I*2   4-000412	 IODET	I*2   4-000410

 ISTACK	I*2   6-001026	 ISWTCH	I*2   4-000434	 ITTY	I*2   4-000406	 ITYLNG	I*2   4-000416	 ITYP	I*2   4-000442

 LENGTH	I*2   4-000432	 LENINP	I*2   4-000454	 LFANGL	L*1   4-000403	 LFBRAC	L*1   4-000400	 LSTREC	L*1   6-001004

 MAXLNG	I*2   4-000414	 MHD	L*1   4-000364	 MODCNT	I*2   4-000440	 MXRLNG	I*2   6-001014	 NO	L*1   4-000372

 NOBYTE	I*2   4-000444	 NOINTG	I*2   4-000446	 NUMISW	I*2   4-000424	 NUMOSW	I*2   4-000422	 OBJ	I*4   4-000354

 ODFLNG	I*2   4-000024	 OLUN	I*2   4-000062	 ONMLNG	I*2   4-000022	 OPNLNG	I*2   4-000066	 OSTAT	I*2   4-000064

 OSWTCH	I*2   4-000056	 OTYLNG	I*2   4-000026	 OTYPE	I*2   4-000074	 PERIOD	L*1   4-000402	 PRMODE	I*2   6-001016

 PROCRC	I*2   6-001030	 PROLNG	I*2   4-000060	 PSCNT	I*2   6-001006	 PSRGSD	I*2   6-001010	 PSRTIR	I*2   6-001012

 RECLNG	I*2   6-001000	 RECNUM	I*2   6-001002	 RECSIZ	I*2   4-000072	 RECTYP	L*1   6-000000	 RTANGL	L*1   4-000404

 RTBRAC	L*1   4-000377	 SUBCNT	I*2   6-001024	 SWTABL	R*4   4-000450	 TIRCNT	I*2   6-001036	 TITLRC	I*2   6-001032

 TYPLNG	I*2   4-000030	 WRTERR	I*2   6-001022	 YES	L*1   4-000371





ARRAYS



 NAME   TYPE  ADDRESS	    SIZE 	DIMENSIONS



 ANLDEF	L*1   4-000373	000004     2	(4)

 CLSTYP	L*1   4-000145	000005     2	(5)

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

 DATIME	L*1   4-000000	000022     9	(18)

 ERRTYP	I*2   4-000032	000022     9	(9)

 ICON	L*1   4-000366	000003     1	(3)

 INPDEF	L*1   4-000276	000004     2	(4)

 INPNAM	L*1   4-000224	000052    21	(42)

 INPSWT	L*1   4-000332	000022     9	(18)

 INPTYP	L*1   4-000134	000005     2	(5)

 ITIME	L*1   4-000012	000010     4	(8)

 NTYPE	L*1   4-000114	000012     5	(10)

 OPNTYP	L*1   4-000141	000004     2	(4)

 OUTDEF	L*1   4-000302	000015     6	(13)

 OUTNAM	L*1   4-000152	000052    21	(42)

 OUTSWT	L*1   4-000324	000006     3	(6)

 OUTTYP	L*1   4-000126	000006     3	(6)

 PROMPT	L*1   4-000317	000005     2	(5)

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

 SWITCH	I*2   4-000076	000014     6	(6)



FORTRAN IV-PLUS V02-51D		02:26:35    22-AUG-78		PAGE 16  

OBJANAL.FTN  	/TR:BLOCKS/WR




LABELS



 LABEL   ADDRESS 	 LABEL   ADDRESS 	 LABEL   ADDRESS 	 LABEL   ADDRESS 	 LABEL   ADDRESS 	



 40'	 3-000000	 50'	 3-000014	 60'	 3-000100	 70'	 3-000176	 80'	 3-000202

 110'	 3-000254	 120'	 3-000342	 130'	 3-000416	 140'	 3-000514	 150'	 3-000600

 190'	 3-000710	 200'	 3-001016	 210'	 3-001124	 220'	 3-001202	 250'	 3-001250

 260'	 3-001340	 270'	 3-002130	 280'	 3-002216	 290'	 3-002254	 300'	 3-002360

 310'	 3-002454	 340'	 3-002556	 350'	 3-002656	 360'	 3-003026	 400	 1-000020

 450	 1-000436	 451	 1-000312	 452	 1-000352	 460	 1-000422	 470	 1-000460

 480	    **   	 590	 1-001046	 595	 1-001064	 600	 1-001176	 690	    **   

 700	 1-001426	 710	 1-001506	 740	 1-001630	 780	 1-001722	 820	 1-002010

 900	 1-002064	 1000	 1-002104	 1100	 1-002136	 1200	 1-002156	 1300	 1-002202

 1320	 1-002220	 1350	 1-002342	 1370	 1-002436	 1375	    **   	 1400	 1-002504

 1430	    **   	 1460	 1-002620	 1470	    **   	 1480	 1-002702	 1486	 1-002746

 1490	 1-002760	 1500	 1-003040	 1600	 1-003066	 5000	 1-003104	 5950	 1-003156

 5990	 1-003222	 5995	 1-003234	 5997	    **   	 6000	 1-003314	 6100	 1-003440

 6150	 1-003546	 6250	 1-003776	 6270	 1-004124	 6280	 1-004220	 6290	    **   

 6300	 1-004266	 6325	 1-004344	 6330	 1-004502	 7000	 1-004510	 7020	 1-004526

 7050	 1-004572	 9480	 1-004672	 9481'	 3-003132	 9500	 1-004724	 9510	 1-004760

 9520	 1-005002	 9530	 1-005024	 9550	 1-005046	 9555	 1-005070	 9560	 1-005112

 9570	    **   	 9600	 1-005142	 9620	 1-005214	 9630	    **   	 9650	 1-005156

 9660	 1-005244	 9670	 1-005304	 9680	 1-005342	 9740	 1-005372	 10000	 1-005422





FUNCTIONS AND SUBROUTINES REFERENCED



 ASNLUN	 BLDSWT	 CLOS$	 CLSFIL	 DATE	 EOMANL	 ERRORS	 EXIT	 GETCML	 GSDANL	 HEXDMP	 MHDANL	 OPEN$	 OPNFIL	 SCANI	 SCANO

 SYNTX	 TIME	 TIRANL	 WTQIO	 $MAX0





TOTAL SPACE ALLOCATED = 013610  3012



NO FPP INSTRUCTIONS GENERATED



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

