Google
 

Trailing-Edge - PDP-10 Archives - tops20_version7_0_tools_tape_clock_tape - tools/blis10/h3assy.bli
There are 18 other files named h3assy.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,1973,1974,1977,1978 DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. 01754
!FILENAME:	H3ASSY.BLI
!AUTHOR:	M. G. MANUGIAN/FLD/KR
!DATE:		14 JANUARY 74

!FUNCTION:	THIS FILE CONTAINS THE ROUTINES WHICH ARE REQUIRED TO
!		ADAPT THE LISTING FILE GENERATED BY BLISS-10 TO MAKE
!		IT SUITABLE AS MACRO-10 INPUT.  ALL ROUTINES
!		IN THIS FILE WERE GENERATED FOR BLISS-10 CCO #2.25.


!  REVISION HISTORY :
!   7_14_77  ROUTINE MDCLOUT IS MODIFIED TO OUTPUT SREG,VREG,DREGS,
!            FREG,RESREGM INTO LISTING FILE.THE VALUES WILL
!            DEPEND ON /Z SWITCH OR DEFAULT OR DEFINED IN MODULE
!            HEAD./Z SWITCH USES LCG CONVENSION.
!
!  7-15-77   ROUTINE MEXTERNOUT IS MODIFIED SO THAT .BREG IS NOT
!            DECLARED AS INTERNAL AND EXTERNAL IN MAIN MODULE.WHEN
!            STACK IS USED .BREG IS DECLARED AS INTERNAL SYMBOL.
!
!  5-9-77   ROUTINE MPLOUT IS MODIFIED TO OUTPUT OWN OR GLOBAL
!	     AREA IN LISTINGS.THEY ARE HANDLED ALMOST SAME AS
!           PLITS.
!

!ALL ROUTINES APPEAR IN ALPHABETICAL ORDER IN THE SAME ORDER
!AS THEY APPEAR IN THE FOLLOWING FORWARD DECLARATION.

%3.43%	GLOBAL	BIND	H3ASV=12;	!MODULE VERSION NUMBER

FORWARD	MACOUT,		!OUTPUT AN AC MNEMONIC
	MBLKOUT,	!OUTPUT A BLOCK OF LABELED STORAGE
	MCODEOUT,	!OUTPUT A MACRO-10 INSTRUCTION
	MCPOUT,		!OUTPUT ALL CONSTANT POINTERS
	MDCLOUT,	!OUTPUT A MACRO-10 ASSIGNMENT
	MENDOUT,	!OUTPUT MACRO-10 END PSEUDO-OP
	METPSEARCH,	!SEARCH EXTERNAL LIST FOR SYMBOL MATCH
	MEXTERNOUT,	!OUTPUT ONE EXTERNAL NAME, IF VALID
	MEXTOUT,	!OUTPUT ALL EXTERNALS IN EXTERN STATEMENTS
	MLITOUT,	!OUTPUT THE LITERAL AREA
	MMHDOUT,	!OUTPUT TITLE AND RELOC PSEUDO-OPS
	MPLITOUT,	!OUTPUT THE PLIT AREA
	MPLOUT,		!OUTPUT ALL PLIT SUBLISTS AS CONSTANTS
	MREGOUT,	!OUTPUT A SPECIAL REGISTER DECLARATION
	MREGSOUT,	!OUTPUT ALL SPECIAL REGISTER DECLARATIONS
	MROUTSEARCH,	!DETERMINE IF A NAME HAS BEEN DECLARED AS A ROUTINE
	MXWDOUT,	!OUTPUT AN XWD CONSTANT FOR MACRO-10
	R50TOASCIZ;	!CONVERT MODULE SYMBOLS FROM R50 TO ASCIZ STRINGS
%3.19%	GLOBAL	ROUTINE MACOUT(AC)=
	!OUTPUT AN APPROPRIATE ASCIZ SYMBOL FOR THE OCTAL VALUE
	!IN AC.  IF THE VALUE CORRESPONDS TO $S, $B, $F, OR $V,
	!USE THE APPROPRIATE MNEMONIC, OTHERWISE OUTPUT A 2 DIGIT
	!OCTAL NUMBER.

	BEGIN

	  LABEL ACSELECT;

	  ACSELECT:
	  SELECT .AC OF NSET
		.SREG:	LEAVE ACSELECT WITH OUTSTR("$S",2);
		.FREG:	LEAVE ACSELECT WITH OUTSTR("$F",2);
		.VREG:	LEAVE ACSELECT WITH OUTSTR("$V",2);
%3.20%		OTHERWISE:	OUTNUM(.AC,8,2,0);
	  TESN

	END;	!OF ROUTINE MACOUT
GLOBAL ROUTINE MBLKOUT(SYMPTR,OFFST)=
	!OUTPUT THE ADDRESS TAG AT LOCATION .SYMPTR FOLLOWED BY ::.
	!THEN IF .OFFST NEQ 0, OUTPUT "BLOCK" <OFFST>.
	!THEN OUTPUT CRLF

	BEGIN

	  OUTPSTRING(.SYMPTR);		!OUTPUT THE TAG
	  OUTSTR("::",2);			!OUTPUT TAG DELIMITER
	  IF .OFFST NEQ 0		!IF NON-ZERO OFFST THEN OUTPUT BLOCK
	    THEN
	      (OUTPSTRING(PLIT(ASCIZ '	BLOCK	'));
	       OUTMOC(.OFFST);
	      );
	  NEWLINE();	!FINISH OFF THE LINE

	END;	!OF ROUTINE MBLKOUT
GLOBAL ROUTINE MCODEOUT(OP,AC,INDEX,ADDR)=
	!WRITE A MACRO-10 SOURCE LINE FOR THE CODE.
	!.OP IS ADDR OF ASCIZ OP MNEMONIC
	!.AC IS OCTAL NUM IN AC FIELD
	!.INDEX IS OCTAL NUM OF INDEX REG
	!.REG IS OCTAL ABSOLUTE ADDRESS

	BEGIN

	  OCHAR(#11);		!TO GET TO OP FIELD
	  OUTPSTRING(.OP);	!OUTPUT OPERATOR MNEMONIC
	  OCHAR(#11);		!TO GET TO AC FIELD
	  MACOUT(.AC);		!OUTPUT AC MNEMONIC
	  OCHAR(",");
	  OUTMOC(.ADDR);	!ADDRESS FIELD(MUST BE OCTAL CONSTANT)
	  IF .INDEX NEQ 0
	    THEN		!OUTPUT INDEX REGISTER FIELD
	      BEGIN
		OCHAR("(");
		MACOUT(.INDEX);
		OCHAR(")");
	      END;
	  NEWLINE();		!FINISH OFF THE LINE

	END;	!OF ROUTINE MCODEOUT
GLOBAL ROUTINE MCPOUT=
	!OUTPUT ALL CONSTANT POINTERS IN THE CORRECT ORDER

	BEGIN

%3.14% IF .MLFLG THEN	!PUT OUT CP AREA FOR MACRO-10

%3.14%    BEGIN

	  REGISTER IND;	!PT INDEX

	  NEWLINE();	NEWLINE();
	  OUTPSTRING(PLIT(ASCIZ ';Constant pointers'));
	  NEWLINE();	NEWLINE();
	  MBLKOUT(CNAME<0,0>,0);	!OUTPUT ADDRESS TAG
	  XWDOFFSET_-1;		!INIT CONSTANT OFFSET

	  !NOW OUTPUT ALL LITERALS
	  IF .PTREFNO GEQ 0 THEN
	    INCR I FROM 0 TO .PTREFNO DO
	      MXWDOUT(.PT[(IND_.PTTRANST[.I]),1],.PT[.IND]<RELOCF>);

%3.14%    END;

	END;	!OF ROUTINE MCPOUT
GLOBAL ROUTINE MDCLOUT(SYMIND,TYPE,OFFST)=
	!OUTPUT A MACRO-10 DECLARATION LINE
	!OUTPUT THE SYMBOL NAME WHICH IS IN THE STE INDEXED BY
	!.SYMIND.  THEN OUTPUT "=".  THEN IF .TYPE, OUTPUT AN
	!ADDITIONAL ":" TO MAKE IT AN INTERNAL DECLARATION
%3.9%   !THEN OUTPUT CASE .TYPE^(-1) OF SET
	!0 - NOTHING
	!1 - <NAME>.G + ;GLOBAL
	!2 - <NAME>.O +	;OWN
	!3 - <NAME>.P +	;PLIT
	!THEN OUTPUT .OFFST IN OCTAL FOLLOWED BY CRLF

	!HERE IS A CHART OF TYPE CODES:
	!.TYPE	DECLARATION	SUFFIX	GLOBAL?
	!
	!0 000	BIND INDEXES		-
	!1 001	GBIND GINDEXES	-	Y
	!2 010	-		-	-
	!3 011	GLOBAL		.G	Y
	!4 100	OWN		.O	N
	!5 101	-		-	-
	!6 110	-		-	-
	!7 111	GNAMES		.P	Y

	BEGIN

	  !FIRST OUTPUT THE SYMBOL FOLLOWED BY =
	  OUTSTN(.SYMIND); OCHAR("=");

	  !IF GLOBAL, THEN OUTPUT :
	  IF .TYPE THEN OCHAR(":");

	  !NOW OUTPUT GLOBAL SYMBOL OFFSET, IF ANY
%3.9-1%	  CASE .TYPE^(-1) OF SET
%7-14-77%     (IF .OFFST<17,1>  THEN (OCHAR("-");OUTMOC(-(.OFFST OR LEFTM)))
%3.9-1%	       ELSE  OUTMOC(.OFFST));				   !NO RELOC
%3.9-1%	    (OUTPSTRING(GNAME<0,0>);  OUTOFFSET(.OFFST));  ! GLOBAL
%3.9-1%	    (OUTPSTRING(ONAME<0,0>);  OUTOFFSET(.OFFST));  ! OWN
%3.9-1%	    (OUTPSTRING(PNAME<0,0>);  OUTOFFSET(.OFFST))   ! PLIT
		TES;

	  !NOW FINISH UP THE LINE
	   NEWLINE();

	END;	!OF ROUTINE MDCLOUT
GLOBAL ROUTINE MENDOUT=
	!OUTPUT END PSEUDO-OP LINE

	BEGIN

%3.14% IF .MLFLG THEN	!PUT END PSEUDO-OP OUT FOR MACRO-10

%3.14%    BEGIN

	  EXTERNAL FNAME;	!ASCIZ START ADDRESS TAG

	  NEWLINE();
	  OUTPSTRING(PLIT(ASCIZ '	END	'));	!END PSEUDO-OP
	  IF .STARTBLOCK THEN OUTPSTRING(FNAME);	!START ADDRESS TAG
	  OUTPSTRING(PLIT(ASCIZ '	;Pseudo-op for MACRO-10'));

%3.14% END;

	END;	!OF ROUTINE MENDOUT
ROUTINE METPSEARCH(IND)=
	!SEARCH EXTERNAL TABLE (ETP) FOR A STE WHICH MATCHES
	!THE NAME IN .IND.  IF MATCH, RETURN 1 ELSE 0.

	BEGIN

	  REGISTER CTEP,	!ETP ENTRY INDEX
		TEMP;	!EXT STE INDEX

	  CTEP_.ETP;	!INIT TO START OF EXT LIST

	  IF .CTEP NEQ #77777
	    THEN WHILE 1 DO
	      BEGIN
		IF .CT[.IND,2] EQL .CT[(TEMP_.CT[.CTEP,0]<PREVF>),2]
		  THEN
		    IF ((.CT[.IND,3] XOR .CT[.TEMP,3]) AND #774000^18) EQL 0
		      THEN RETURN(1);
	        IF (CTEP_.CT[.CTEP,0]<NEXTF>) EQL #77777 THEN RETURN(0);

	      END
	    ELSE RETURN (0);	!TO SIGNIFY NO MATCH

	END;	!OF ROUTINE METPSEARCH
ROUTINE MEXTERNOUT(IND)=
	!OUTPUT AN EXTERN STATEMENT FOR THE ID WHOSE SYMBOL TABLE
	!INDEX IS .IND.  HOWEVER, FIRST CHECK TO MAKE SURE IT ISN'T
	!ONE OF THE FOLLOWING:
	!  IF WE HAVE A STACK OR TIMER DECLARATION, DON'T REDECLARE
	!    .EXT. AND .ENT. TYPE SYMBOLS.
	!  DON'T REDECLARE IF ALSO DECLARED GLOBAL OR A ROUTINE
	!REINIT MUST INIT EXTCOUNT TO -1.

	BEGIN

	  REGISTER TT;	!WORD 1 OF ASCII SYMBOL

%3.27%	  IF .LSTART OR .PROFLG		!WE HAVE DECLARED PROLOGS AND EPILOGS
	    THEN 			!SKIP ALL .ENT. AND .EXT. TYPE SYMBOLS
	     BEGIN
	      TT_.ST[.IND,2];
	      IF .TT EQL '.ENT.'
		THEN RETURN
		ELSE IF (.TT EQL '.EXT.')
		  THEN RETURN;
	     END;
            ! DO NOT MAKE .BREG AS INTERNAL AND EXTERNAL IN MAIN MODULE (IE)
            ! MODULE A(STACK) OR MODULE A(STACK=GLOBAL(STACKK,#777))
             IF .LSTART THEN (TT_.ST[.IND,2];  %7-14-77%
                               IF .TT EQL '.BREG' THEN RETURN );

	  !IF DECLARED GLOBAL, WE WANT NO EXTERN STATEMENT
	  IF GLOBALCHECK(.IND) NEQ 0 THEN RETURN;

	  !IF A ROUTINE, GLOBAL OR NOT, IT IS DECLARED; WE DON'T WANT
	  !TO REDECLARE IT EXTERNAL.
	  IF MROUTSEARCH(.IND) THEN RETURN;

	  !NOW WE CAN OUTPUT IN GROUPS OF SIX
	  IF (EXTCOUNT_.EXTCOUNT + 1) MOD 6 EQL 0
	    THEN	!START A NEW LINE
	    (NEWLINE();  OUTPSTRING(PLIT(ASCIZ 'EXTERN	')))
	    ELSE OCHAR(",");	!CONTINUE THE CURRENT LINE

	  !NOW OUTPUT THE SYMBOL NAME
	  OUTSTN(.IND);

	END;	!OF ROUTINE MEXTERNOUT
GLOBAL ROUTINE MEXTOUT=
	!OUTPUT ALL EXTERN STATEMENTS
	!WE MUST CHECK EXT AND EXPHT
	!WE MUST AVOID DUPLICATES IN EXPHT

	BEGIN

	  LOCAL	L;

	  LABEL THISENTRY,
		 EXTERNS;

	  REGISTER CTEP,	!TEMP INDEX FOR ETP AND EXPHT ENTRIES
		TIND,		!INDEX TO EXPHT SEGMENT
		TEXTIND;	!INDEX TO EXPHT ENTRY

	  !OUTPUT THE HEADER TO THE EXTERN SECTION OF THE LISTING

	  NEWLINE();	NEWLINE();	!SKIP TWO LINES TO SET IT OFF
	  OUTPSTRING(PLIT(ASCIZ ';EXTERNAL requests'));	NEWLINE();


	  !FIRST LOOK THRU ETP

	  CTEP_.ETP;	!INIT TO FIRST ENTRY IN CHAIN

	  EXTERNS: IF .CTEP NEQ #77777
	    THEN WHILE 1 DO
	      BEGIN
		MEXTERNOUT(.CT[.CTEP,0]<PREVF>);
		IF (CTEP_.CT[.CTEP,0]<NEXTF>) EQL #77777 THEN LEAVE EXTERNS
	      END;

	  !NOW HANDLE EXPHT

	  !FIRST WE START THRU EXPHT
	  DECR I FROM EXPHTSIZE-1 TO 0
	    DO BEGIN	!THIS BLOCK LOOKS AT A SEGMENT OF EXPHT
	      IF (TIND_.EXPHT[.I]) NEQ 0
		THEN  !WE HAVE A NON-NULL SEGMENT OF EXPHT
		  !LET'S LOOP THRU THIS SEGMENT OF EXPHT
		  WHILE .TIND NEQ 0
		    DO BEGIN
		      IF NOT METPSEARCH(CTEP_.CT[.TIND,1]<LEFTHALF>)
			THEN	!IT ISN'T IN ETP LIST, SO LOOK AT TEXTHD
			  THISENTRY:  BEGIN
			    TEXTIND_.TEXTHD;
			    WHILE .TEXTIND NEQ 0
			      DO BEGIN
				IF .CTEP EQL .CT[.TEXTIND,1]
				  THEN LEAVE THISENTRY;
				TEXTIND_.CT[.TEXTIND,0];	!LOOK AT NEXT TEXT ENTRY
			      END;
			    !WE HAVEN'T FOUND IT, SO PUT IT IN
			    CT[(L_GETSPACE(1)),0]_.TEXTHD;
			    CT[.L,1]_.CTEP;
			    TEXTHD_.L;	!INSERT AT TOP OF LIST
			  END;

		      !NOW LET'S LOOK AT NEXT EXPHT ENTRY
		      TIND_.CT[.TIND,0]<NEXTF>;
		    END;	!OF SEARCH OF EXPHT SEGMENT
	    END;	!OF SEARCH OF EXPHT

	  !NOW OUTPUT THE TEXT ENTRIES AND DELETE THE LIST
	  TIND_.TEXTHD;	!START AT THE BEGINNING
	  WHILE .TIND NEQ 0
	    DO BEGIN
	      MEXTERNOUT(CTEP_.CT[.TIND,1]);
	      TIND_.CT[.TIND,0];	!GET NEXT INDEX
%3.8%         RELEASESPACE(.CTEP,1);	!RELEASE THE TEXT CELL
	    END;

	END;	!OF ROUTINE MEXTOUT
GLOBAL ROUTINE MLITOUT=
	!OUTPUT THE LITERAL AREA TO THE OUTPUT LISTING
	!SO THAT LITERALS MAY BE COMPILED SUCCESSFULLY BY MACRO-10.
	!FORMAT IS:
	!<MODULE NAME>.L:	<LIT 0>	;0
	!			<LIT 1>	;1
	!	ETC.

	BEGIN

%3.14% IF .MLFLG THEN	!PUT LITERAL AREA OUT FOR MACRO-10

%3.14%    BEGIN

	  MACRO OL(X)=OUTPSTRING(PLIT(ASCIZ X ))$;


	  NEWLINE();	!TO SET OFF LITERAL AREA
	  OL(';Literals');
	  NEWLINE();	NEWLINE();
	  MBLKOUT(LNAME<0,0>,0);	!WRITE OUT TAG FOR LITERAL AREA
	  NEWLINE();
	  XWDOFFSET_-1;			!SET LITERAL OFFSET COUNTER TO -1

	!NOW OUTPUT ALL LITERALS

	  INCR I FROM 0 TO LTNUM-1
	    DO
	      INCR J FROM .LTTBASE[.I]<RIGHTHALF> 
		TO .LTTBASE[.I]<RIGHTHALF> + .LTTBASE[.I]<LEFTHALF> - 1
		DO
		  MXWDOUT(GETLITVAL(@.J),0);	!OUTPUT THIS LIT
	  NEWLINE();	!TO SET OFF FINISHED LIT AREA

%3.14%    END;

	END;	!OF ROUTINE MLITOUT
GLOBAL ROUTINE MMHDOUT=
	!OUTPUT TITLE STATEMENT TO LISTING.
	!IF TWO SEGMENT PROGRAM, OUTPUT TWOSEG PSEUDO-OP
	!FOLLOWED BY RELOC 400000.  IF LOWSEG PROGRAM
	!OUTPUT MERELY RELOC 0.  IF HIGHSEG PROGRAM, OUTPUT
	!MERELY RELOC 400000.

	BEGIN

	  MACRO OL(X)=OUTPSTRING(PLIT(ASCIZ X))$;

	  !OUTPUT TITLE STATEMENT
	  NEWLINE();
	    OL('TITLE	');
	  OUTPSTRING(TNAME); NEWLINE();

	  !OUTPUT RELOC PSEUDO-OPS
	  IF .TWOSEGFLG OR .HGHFLG
	    THEN 
	      BEGIN
		OL('TWOSEG'); NEWLINE();
		OL('RELOC 400000'); NEWLINE();
	      END
		ELSE (OL('RELOC 0'); NEWLINE(););

	  NEWLINE();
	END;	!OF ROUTINE MMHDOUT
GLOBAL ROUTINE MPLITOUT=
	!OUTPUT THE PLIT AREA

	BEGIN

%3.14% IF .MLFLG THEN	!PUT PLIT AREA OUT FOR MACRO-10

%3.14%    BEGIN

	  REGISTER IND;	!CELL INDEX

	  NEWLINE();	NEWLINE();
	  OUTPSTRING(PLIT(ASCIZ ';PLIT area')); NEWLINE(); NEWLINE();

	  MBLKOUT(PNAME<0,0>,0);	!OUTPUT ADDRESS TAG.

	  XWDOFFSET_-1;	!INIT PLIT WORD OFFSET

	  IF .PLNEXT GTR 0 THEN MPLOUT(.PLHEAD);

%3.14%    END;

	END;	!OF ROUTINE MPLITOUT
GLOBAL ROUTINE MPLOUT(HEAD)=
	!OUTPUT ALL CONSTANT WORDS HANGING FROM PLIT HEADER .HEAD.
	!IF WE ENCOUTER A SUBHEADER, RECURSE TO OUTPUT ITS LITERALS

	BEGIN

!	  REGISTER IND;	!CELL INDEX
          LOCAL IND,TEMP;

	  INCR I FROM 1 TO .CT[.HEAD,2]<RIGHTHALF> DO
	    BEGIN
	      IND_.CT[.HEAD,1]<NEXTF>;
	      WHILE .IND NEQ .HEAD DO
		BEGIN
		  IF HEADERP(.IND)
		    THEN MPLOUT(.IND)
                    ELSE
                     BEGIN
                      IF ((.OWNBLK LSS 0 OR .GLOBLK LSS 0) AND
                       (.CT[.IND,0]<PRIORITYF> EQL OWNT OR
                        .CT[.IND,0]<PRIORITYF> EQL GLOBALT )
                        AND .CT[.IND,1]<LEFTHALF> EQL #377777 )
                       THEN BEGIN
                         IF .CT[.IND,1]<RIGHTHALF> GTR 0 THEN
                          (TEMP_IF .CT[.IND,1]<17,1> EQL 1 THEN
                                 .CT[.IND,1]+1^35
                                 ELSE .CT[.IND,1]<RIGHTHALF>;
                            XWDOFFSET_.XWDOFFSET+.TEMP;
                            IF .TEMP LSS 0 THEN 
                             BEGIN
                                OUTPSTRING(PLIT(ASCIZ 'RELOC   '));
                               OUTPSTRING(IF .OWNBLK LSS 0 THEN
                                            ONAME<0,0>
                                        ELSE GNAME<0,0>);
                               OUTSTR("+",1);
                               OUTMOC(.XWDOFFSET+1);
                              END
                             ELSE
                            (OUTPSTRING(PLIT(ASCIZ 'BLOCK   '));
                            OUTMOC(.TEMP));
                            NEWLINE();
			     )
                            END
		    ELSE MXWDOUT(.CT[.IND,1],.CT[.IND,0]<RELOCF>);
                    END;
		  IND_.CT[.IND,0]<NEXTF>
	        END;
	    END
	END;	!OF ROUTINE MPLOUT
ROUTINE MREGOUT(COMMENT,VALUE)=
	!OUTPUT A DECLARATION FOR MACRO-10 WHERE .COMMENT
	!IS THE ADDRESS OF AN ASCIZ STRING OF THE FORM
	!<SYMBOL>=	 AND .VALUE IS THE VALUE OF
	!THE SYMBOL TO BE DECLARED IN OCTAL

	BEGIN
	  OUTPSTRING(.COMMENT);
	  OUTMOC(.VALUE);
	  NEWLINE();	!FINISH OFF LINE

	END;	!OF ROUTINE MREGOUT
GLOBAL ROUTINE MREGSOUT=
	!OUTPUT SPECIAL REGISTER DECLARATIONS
	BEGIN
	  NEWLINE(); NEWLINE();	!TO SET THEM OFF
	  OUTPSTRING(PLIT(ASCIZ ';Special register declarations'));
	  NEWLINE(); NEWLINE();
	  MREGOUT(PLIT(ASCIZ '$S=:	'),.SREG);
	  MREGOUT(PLIT(ASCIZ '$F=:	'),.FREG);
	  MREGOUT(PLIT(ASCIZ '$V=:	'),.VREG);

	END;	!OF ROUTINE MREGSOUT
ROUTINE MROUTSEARCH(IND)=
	!IND IS THE INDEX OF A STE.
	!MROUTSEARCH RETURNS TRUE(1) IF THE NAME IN THE .IND
	!STE HAS BEEN DECLARED AS A ROUTINE OR GLOBAL ROUTINE.
	!IF NOT, IT RETURNS 0

	BEGIN

	  REGISTER STE,		!INDEX OF ROUTINE STE
		 FCNLIND;	!INDEX OF ROUTINE HEADER IN FCNLIST

	  FCNLIND_.CT[.FCNLIST,1]<NEXTF>;	!GET FIRST FCN HEADER

	  UNTIL .FCNLIND EQL .FCNLIST
	    DO BEGIN
	    IF .CT[.IND,2] EQL .ST[(STE_.CT[.FCNLIND,2]),2]
	      THEN
		IF ((.CT[.IND,3] XOR .CT[.STE,3]) AND #774000^18) EQL 0
		  THEN RETURN(1);	!WE HAVE A 6 CHAR MATCH
	      FCNLIND_.CT[.FCNLIND,0]<NEXTF>	!NO MATCH, LOK ON.
	    END;

	  !WE HAVE SEARCHED ENTIRE FCNLIST AND NO MATCH, SO RETURN FALSE
	  RETURN(0);

	END;
ROUTINE MXWDOUT(CP,RELOCTYPE)=
	!WE WANT TO OUTPUT A CONSTANT POINTER LITERAL FOR MACRO-10
	!IN THE FORM:
	!XWD	L,A		;.XWDOFFSET
	!WHERE L IS THE LEFTHALF OF .CP IN OCTAL
	!AND A IS A SYMBOL NAME IF .RELOCTYPE IS
	!GLORELOC OR EXTRELOC,
	!LITERAL IF RELOCTYPE IS NORELOC
	!AND SYMBOL PLUS OFFSET IS RELOCTYPE IS OWNRELOC OR PLRELOC
	!.XWDOFFSET IS THE OCTAL OFFSET FROM THE START OF THIS LIT AREA

	BEGIN
%3.38%	  EXTERNAL OUTCTREF;

	  OUTPSTRING(PLIT(ASCIZ 'XWD	'));
%3.20%	  OUTNUM(.CP<LEFTHALF>,8,6,0);	!LEFT HALF OF LITERAL

	  OCHAR(",");	!COMMA DELIMITER

	  !OUTPUT ACCORDING TO TYPE OF RIGHTHALF
	  CASE .RELOCTYPE OF SET
%3.20%	    %CONSTANT%	OUTNUM(.CP<RIGHTHALF>,8,6,0);

	    %EXTERNAL%	OUTSTN(.CP<RIGHTHALF>);

%3.38%	    %ROUT ADDR%	OUTCTREF(.CP<RIGHTHALF>);

%3.9%	    %OWN%	(OUTPSTRING(ONAME); OUTOFFSET(.CP<RIGHTHALF>));

%3.9%	    %GLOBAL%	(OUTPSTRING(GNAME); OUTOFFSET(.CP<RIGHTHALF>));

	    %EXP%	(OUTSTN(.ST[.CP<RIGHTHALF>,1]<PARSTEF>);
%3.9%			   OUTOFFSET(.ST[.CP<RIGHTHALF>,1]<OFFSETF>)-7);

	    %POINTER%	0;

	    %LITERAL%	0;

	    %LOCAL%	OUTCONOC((.CP<RIGHTHALF>-.FNSTAT) AND 1^18-1);

%3.9%	    %PLIT%	(OUTPSTRING(PNAME); OUTOFFSET(.CP<RIGHTHALF>));

	  TES;


	  OUTSTR("	;",2);
%3.20%	  OUTNUM((XWDOFFSET_.XWDOFFSET+1),8,5,0);	!OFFSET FROM START OF LIT AREA
	  NEWLINE();	!FINISH OFF THE LINE

	END;	!OF ROUTINE MXWDOUT
GLOBAL ROUTINE R50TOASCIZ(APTR,R50WD)=
	!CHANGE THE RADIX 50 SYMBOL .R50WD TO AN ASCIZ STRING
	!STARTING AT .APTR

	BEGIN

	LABEL LOOP;

	  LOCAL LIM,		!OFFSET OF LAST CHAR CONVERTED
	         ASCIICHAR[6];	!HOLDS UP TO 6 CONVERTED CHARS

	  APTR<LEFTHALF>_#440700;	!MAKE A BYTE POINTER

	  R50WD<32,4>_0;	!TURN OFF RADIX50 SYMBOL TYPE BITS

	  !NOW DO THE CONVERSION

	LIM_LOOP: DECR I FROM 5 TO 0
	  DO
	    BEGIN
	      ASCIICHAR[.I]_IF(ASCIICHAR[.I]_.R50WD MOD #50) LEQ #12
				THEN .ASCIICHAR[.I] + "0" -1
				ELSE IF .ASCIICHAR[.I] LEQ #44
			  	  THEN .ASCIICHAR[.I] + "A" - #13
				  ELSE IF .ASCIICHAR[.I] EQL #45
				    THEN "."
				    ELSE IF .ASCIICHAR[.I] EQL #46
				      THEN "$"
				      ELSE "%";
	      IF (R50WD_.R50WD/#50) EQL 0 THEN LEAVE LOOP WITH .I;
	    END;
	INCR I FROM .LIM TO 5 DO
	  REPLACEI(APTR,.ASCIICHAR[.I]);

	  REPLACEI(APTR,0);	!TO MAKE ASCIZ STRING

	END;	!OF ROUTINE R50TOASCIZ




!END OF H3ASSY.BLI