Google
 

Trailing-Edge - PDP-10 Archives - AP-D480B-SB_1978 - pha3.bli
There are 12 other files named pha3.bli in the archive. Click here to see a list.


!THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
!  OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.

!COPYRIGHT (C) 1972,1977 BY DIGITAL EQUIPMENT CORPORATION
!AUTHOR: S MURPHY/SJW
MODULE	PHA3(SREG=#17,VREG=#15,FREG=#16,DREGS=4,RESERVE(0,1,2,3),START) =
BEGIN

!	REQUIRES FIRST, TABLES

SWITCHES NOLIST;
REQUIRE FIRST.BLI;
REQUIRE TABLES.BLI;
SWITCHES LIST;
GLOBAL BIND PHA3V = 5^24 + 1^28 + 52;		!VERSION DATE: 14-AUG-77



%(
REVISION HISTORY

46	-----	-----	CHANGE REFERENCES TO PROGNAME

47	-----	-----	OUTPUT THE MACRO LISTING HEADING IN PHA3 SO
			THAT THE SIXBIT FUNCTION NAME WILL FOLLOW IT

48	-----	-----	IF THE "DBGTRAC" FLAG IS SET, CALL
			INIFDDT  TO OUTPUT
			"XCT FDDT."

49	-----	-----	FIX ARGUMENT BLOCKS HEADING TO ONLY BE OUTPUT
			IF MACROCODE IS REQUESTED
50	464	QA754	HANDLE HEADINGS FOR LINE-NUMBER/OCTAL-LOCATION
			  MAP IF NO MACRO LISTING REQUESTED
51	476	QA754	MAKE LINE/OCTAL MAP HEADING OPTIONAL UNDER
			  /MAP=MAPFLG

******	BEGIN VERSION 5A	******

52	607	22685	GENERATE ZERO-ARG-BLOCK ONLY IF NEEDED (IE, IF
			  NEDZER SET)

)%
GLOBAL ROUTINE MRP3=
BEGIN
%(***OVERLAY TO DO CODE GENERATION****)%
	EXTERNAL INIFDDT;	!TO GENERATE "XCT FDDT."
	EXTERNAL INIISNRLBLK;	!TO INIT  BUFFER USED FOR
					! THE LABELS INSERTED WHEN THE "DEBUG" SWITCH
					! IS SPECIFIED BY THE USER
	EXTERNAL NAMGEN;		!TO GENERATE NAMELIST ENTRIES
	EXTERNAL CSTMNT,PBFPTR,PBUFF;
	EXTERNAL ISN;			!INTERNAL SEQ NUMBER OF STMNT
	EXTERNAL DUMPDIM;	!ROUTINE TO OUTPUT ALL DIMENSION INFORMATION
				! FOR ALL PROTECTED ARRAYS (FOR ALL ARRAYS
				! WHEN THE USER SPECIFIES THE "DEBUG" SWITCH)
	MAP PPEEPFRAME PBFPTR;
	MAP BASE CSTMNT;
	MAP PEEPFRAME PBUFF;

	EXTERNAL OBUFFA;
	EXTERNAL HILOC;
	EXTERNAL CGASMNT,CGSTMNT;

	EXTERNAL CGIOARGS,CGSTPAUARGS;	!ROUTINES TO GENERATE ARG BLOCKS FOR
						! IO STMNTS AND STOP/PAUSE STMNTS

	EXTERNAL ZOUTMSG;
	EXTERNAL CGARGS;
	EXTERNAL SEGINCORE,PHAZCONTROL;
	EXTERNAL OUTMOD,OUTMDA;
	EXTERNAL DOSP,DOSTAK;
	EXTERNAL ZENDALL;
	EXTERNAL LSTFORMATS;	!TO LIST FORMAT STMNTS IN THE MACRO-EXPANDED LISTING
%[607]%	EXTERNAL NEDZER;	! FLAG TO INDICATE IF ZERO-ARG-BLOCK NEEDED
	EXTERNAL ZERBLK;
	EXTERNAL CGOPGEN,OPGRES,OPDSPIX;
	EXTERNAL GENLAB,DEFLAB;
	EXTERNAL PSYMPTR,PBOPWD,OBUFF;

	OWN STADDR;			!PROGRAM STARTING ADDRESS





	IF .FLGREG<DBGLABL> THEN INIISNRLBLK();	!IF USER SPECIFIED THE "DEBUG" SWITCH
					! INIT BUFFER USED FOR LABELS INSERTED ON EACH LINE

	IF .FLGREG<DBGTRAC> THEN INIFDDT();	!IF THE USER SPECIFIED THE "TRACE"
					! OPTION OF THE DEBUG SWITCH, INIT FOR GENERATION
					! OF "XCT FDDT."
	%(***INIT PTR TO DO-INFORMATION AREA***)%
	DOSP_DOSTAK;

	%(***DEFINE A LABEL TO CORRESPOND TO A ZERO-ARG-BLOCK FOR FOROTS - THIS
		ARGBLOCK WILL BE USED FOR A NUMBER OF STMNTS***)%
%[607]%	NEDZER _ 0;	! INITIALIZE TO "ZERO-ARG-BLOCK NOT NEEDED"
	ZERBLK_GENLAB();

!**[464] MRP3 @3227 SJW 29-SEP-76
%[464]%	IF .FLGREG<LISTING>
%[464]%	  THEN BEGIN
%[464]%	    EXTERNAL  HEADING, PAGELINE, STRNGOUT;
%[464]%	    IF .FLGREG<MACROCODE>
%[464]%	      THEN BEGIN
%[464]%		IF (PAGELINE _ .PAGELINE - 4) LEQ 0 
%[464]%		  THEN BEGIN
%[464]%		    HEADING ();
%[464]%		    PAGELINE _ .PAGELINE - 4;
%[464]%		  END;
%[464]%		STRNGOUT(PLIT ASCIZ '?M?J?M?JLINE	LOC	LABEL	GENERATED CODE?M?J');
%[464]%	      END
%[476]%	      ELSE
%[476]%		IF .FLGREG<MAPFLG>
%[476]%		THEN BEGIN
%[464]%		IF (PAGELINE _ .PAGELINE - 7) LEQ 0
%[464]%		  THEN BEGIN
%[464]%		    HEADING ();
%[464]%		    PAGELINE _ .PAGELINE - 7;
%[464]%		  END;
%[464]%		STRNGOUT (PLIT ASCIZ '?M?J?M?JLINE NUMBER/OCTAL LOCATION MAP');
%[464]%		STRNGOUT (PLIT ASCIZ '?M?J?M?J      : 0?I1?I2?I3?I4?I5?I6?I7?I8?I9?M?J');
%[464]%		STRNGOUT (PLIT ASCIZ '------:-------------------------------------------------------------------------------');
%[464]%		STRNGOUT (PLIT ASCIZ '?M?J      :?M?J00000 : ');
%[464]%	      END;
%[464]%	  END;

	CSTMNT_.SORCPTR<LEFT>;

	%(***SKIP 1ST STMNT OF PROGRAM - WHICH IS A DUMMY CONTINUE***)%
	IF .CSTMNT NEQ 0
	THEN
	CSTMNT_.CSTMNT[SRCLINK];

	PBFPTR_PBUFF;			!INIT PTR TO NEXT AVAILABLE PEEPHOLER ENTRY

	PBFPTR[PBFISN]_NOISN;		!INIT INTERNAL SEQ NO FIELD FOR 1ST INSTR

	%(****STARTING ADDRESS OF PROGRAM***)%
	STADDR_.HILOC;



	%(***GENERATE A CALL TO RESET. AT THE BEGINNING OF THE PROGRAM***)%
	%(***FOR THE MAIN PROGRAM ONLY***)%
	IF .FLGREG<PROGTYP> EQL MAPROG THEN
	BEGIN
		OPDSPIX_OPGRES;
		CGOPGEN();
	END;


	%(***GENERATE CODE FOR ALL STMNTS OF THE PROGRAM****)%

	WHILE .CSTMNT NEQ 0
	DO
	BEGIN
		ISN_.CSTMNT[SRCISN];
		CGSTMNT();
		CSTMNT_.CSTMNT[SRCLINK];
	END;



	%(***OUTPUT ANY INSTRUCTIONS STILL REMAINING IN THE PEEPHOLE BUFFER AND SET THE
		PTR TO NEXT AVAILABLE WD OF PEEPHOLE BUFFER BACK TO THE START OF BUFFER***)%
	IF .PBFPTR NEQ PBUFF
	THEN
	BEGIN
		 OUTMOD(PBUFF, (.PBFPTR-PBUFF)/PBFENTSIZE );
		PBUFF[PBFLABEL]_NOLABEL;		!INIT LABEL FIELD OF 1ST INSTR
		PBFPTR_PBUFF;
	END;




	%(***OUTPUT HEADINGS FOR ARG-BLOCKS***)%
	IF .FLGREG<LISTING>	THEN	IF .FLGREG<MACROCODE>
	THEN	( EXTERNAL  HEADING,PAGELINE,STRNGOUT;
		  IF ( PAGELINE_.PAGELINE-4) LEQ 0 
		  THEN	( HEADING(); PAGELINE_.PAGELINE-4);
		  STRNGOUT(PLIT ASCIZ '?M?J?M?J ARGUMENT BLOCKS:?M?J?M?J')
		);


	%(***OUTPUT A "ZERO-ARG-BLOCK" TO BE USED FOR EVERY FN AND SUBR CALL THAT
		HAS NO ARGS (ALSO USED BY STOP PAUSE AND END WHEN THERE IS NO ARG).
		BLOCK WILL BE 2 WDS OF 0. THE LABEL "ZERBLK" ON THE 2ND WD.
	******)%
%[607]%	IF .NEDZER NEQ 0		! IS ZERO-ARG-BLOCK NEEDED ?
%[607]%	  THEN BEGIN
	    PSYMPTR_PBF2NOSYM;
	    PBOPWD_0;
	    OBUFFA();
	    DEFLAB(.ZERBLK);
	    PSYMPTR_PBF2NOSYM;
	    PBOPWD_0;
	    OBUFFA();
%[607]%	  END;		! OF IF .NEDZER NEQ 0 THEN BEGIN


	%(OUTPUT THE ARGUMENT BLOCKS FOR ANY CALL STATEMENTS
		OR FUNCTION REFERENCES***)%
	CGARGS();



	%(***WALK THRU ALL IO STMNTS OUTPUTTING ALL ARGLISTS FOR THEM***)%
	CSTMNT_.IOFIRST;		!PTR TO 1ST IO STMNT

	WHILE .CSTMNT NEQ 0
	DO
	BEGIN
		ISN_.CSTMNT[SRCISN];
		IF .CSTMNT[SRCID] EQL STOPID OR .CSTMNT[SRCID] EQL PAUSID
		THEN
		CGSTPAUARGS()			!TO GENERATE ARG-BLOCK FOR STOP OR PAUSE

		ELSE
		CGIOARGS();			!TO GENERATE ARG-BLOCK FOR AN IO STMNT

		CSTMNT_.CSTMNT[IOLINK];
	END;

	%(****GENERATE NAMELISTS IF ANY EXIST****)%
	NAMGEN();

	%(***OUTPUT DIMENSION INFORMATION FOR ALL PROTECTED ARRAYS***)%
	DUMPDIM();

	%(***OUTPUT ANY INSTRUCTIONS STILL REMAINING IN THE  PEEPHOLE BUFFER***)%
	IF .PBFPTR NEQ PBUFF
	THEN OUTMDA(PBUFF,(.PBFPTR-PBUFF)/PBFENTSIZE);



	%(**IF USER REQUESTED A MACRO-EXPANDED LISTING, LIST THE FORMAT
		STATEMENTS***)%
	IF .FLGREG<LISTING> AND .FLGREG<MACROCODE> THEN LSTFORMATS();



	%(**TO TERMINATE THE REL FILE****)%
	IF .FLGREG<OBJECT> THEN
	ZENDALL(.STADDR);

END;			!END OF MRP3

MACHOP POPJ=#263;
MRP3();
POPJ(#17,0)