Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-04 - 43,50325/listc.bli
There are no other files named listc.bli in the archive.
! File:   LISTC.BLI
!
!    This work was supported by the Advanced Research
!    Projects Agency of the Office of the Secretary of
!    Defense (F44620-73-C-0074) and is monitored by the
!    Air Force Office of Scientific Research.

MODULE LISTC(TIMER=EXTERNAL(SIX12))=
BEGIN
!				LISTC MODULE
!				------------
!
!							J. APPERSON
!							S. HOBBS
!						    MODIFIED BY:
!							P. KNUEVEN
!
!
SWITCHES NOLIST;
REQUIRE COMMON.BEG;
REQUIRE PREDEF.BEG;
REQUIRE IOMACS.BEG;
REQUIRE GTST.BEG;
REQUIRE GTX.BEG;
REQUIRE ST.BEG;
REQUIRE LDSFT.BEG;
REQUIRE JBEG.BEG;
SWITCHES LIST;


EXTERNAL
	BRAK1,
	BRAK2,
	CHANGE,
	CSCNAME,
	CSDNAME,
	CSGNAME,
	CSONAME,
	CSPNAME,
	DLABEL,
        FELIST,
        FERASEDET,
        FINAL,
        FINRTNSIZE,
	IDENTFLG,
	IDENTLEX,
	NLHEAD,
NORMALVEC OPERTYPE,
	VTN;

BIND ROUTINESIZE = FINRTNSIZE;



!    THE FOLLOWING SECTION HANDLES LISTING OBJECT CODE



BEGIN


EXTERNAL FINPRINCNT;
BIND CNT=FINPRINCNT;

STRUCTURE VECTOR[I] = [I] (.VECTOR + .I)<0,36>;


MACRO	!  THESE MAY BELONG SOMEWHERE ELSE.....RJ.
	LSLENGTH=0,0,36$,
	DUPLENGTH=0,0,36$,
	LEXEMEF=0,0,36$;

FORWARD
	OUTCODE,
	OUTLAB,
        OUTNAME,
        OUTNAMOFF,
	OUTOPD,
	OUTCSECT,
	OUTPLIT,
	OUTSTORAGE,
	OUTGLBINDS,
	OUTVARS,
        OUTDLAB,
        PLACENXTDLAB,
        OUTDNUM,
        OUTDUNAME,
        ODADR,
        DTYPE,
        OUTDEBSYMTAB,
        OUTSTRNAME,
        OUTDEBNAMTAB,
	OUT11STR;

MACRO
    OUTREG(X)=OUTP(REGNAMES[X])$,
    OUTUNAME(NUM)=(OUTPUT(DOLLAR); OUTDEC(NUM,1))$;

BIND PDP11PRT=PLIT( '; UUO',
	'MOV','MOVB','CMP','CMPB','BIT','BITB',
	'BIC','BICB','BIS','BISB','ADD','SUB',
	'CLR','CLRB','COM','COMB','INC','INCB',
	'DEC','DECB','NEG','NEGB','ADC','ADCB',
	'SBC','SBCB','TST','TSTB','ROR','RORB',
	'ROL','ROLB','ASR','ASRB','ASL','ASLB',
	'JMP','SWAB','JSR','RTS','HALT','WAIT',
	'RTI','IOT','RESET','EMT','TRAP',
	'BR','BR','BNE','BEQ','BGE','BLT','BLE','BGT',
	'BPL','BMI','BHI','BLOS','BVC','BVS','BHIS','BLO',
	'NOP','CLC','00243','.WORD','.WORD',
	'MFPI','MFPD','MTPI','MTPD');


BIND REGNAMES=PLIT(
	'R$0',
	'R$1',
	'R$2',
	'R$3',
	'R$4',
	'R$5',
	'SP',
	'PC');


ROUTINE OUTCODE=
    BEGIN
    EXTERNAL STVEC BRAK1:BRAK2,VECTOR CODENAME;
    LOCAL CASEFLAG,CODE2;
    REGISTER STVEC CODEPTR;

    CASEFLAG_0;
    IF NOT .ALDON
	THEN BEGIN
	    OUTS('.TITLE '); OUTPXLIM(MODNAME,NAMESIZE); CRLF;
	      IF .IDENTFLG THEN (OUTS('.IDENT /');
				 OUT11STR(.IDENTLEX);
				 OUTS('/'); CRLF;
				 IDENTFLG_0);
	    OUTCSECT(MSG(.C)); CSFLAG_0; CRLF;
	    CRLF;
	    IF NOT .TTYLST THEN	!*****  DEBUG  *****
	    INCR I FROM 0 TO 7
		DO (OUTREG(.I); OUTS('=%'); OUTOCT(.I,1); CRLF);
	    ALDON_-1;
	    END;

    CRLF;
    IF .CSFLAG NEQ 0 THEN (OUTCSECT(MSG(.C)); CSFLAG_0; CRLF);
    CRLF;
    IF .DEBFLG AND NOT .MODDONE THEN IF .CODENAME[4] NEQ 0 THEN
	BEGIN  LOCAL GTVEC RNAME;
	RNAME_.CODENAME[4]; TAB;
	OUTDLAB(.RNAME[UNIQENAMEF]);
	CRLF;
	CODESIZE_.CODESIZE+1;
        ROUTINESIZE_.ROUTINESIZE+1;
	END;
    IF (CODE2_.CODENAME[2]) GTR 0 THEN OUTPUT(";");
    OUTPXLIM(CODENAME,NAMESIZE); OUTPUT(":"); CRLF;
    IF .CODE2 NEQ 0 THEN
	(OUTUNAME(ABS(.CODE2)); OUTPUT(":"); CRLF);
    IF .MODDONE AND .MAINDECL
	THEN BEGIN
	    IF .SSTKLEN GTR 0
		THEN (OUTS('?IMOV?I#S$TK-2,SP'); CRLF;
		      OUTS('?IMOV?I#S$TK,$BREG'); CRLF;
		      CODESIZE_.CODESIZE+5;
		      ROUTINESIZE_.ROUTINESIZE+5);
	    END;

    CODEPTR_.BRAK1[NEXTF];
    UNTIL .CODEPTR EQL .BRAK2 DO
	BEGIN
	CASE .CODEPTR[CELLTYPEF] OF
	    SET

	    ! 0 - REF
	    ;

	    ! 1 - CODE
	    IF .CODEPTR[OPF] EQL PINLINE
		THEN BEGIN
		    IF .CODEPTR[INLCOM] THEN
		      (CRLF; OUTPUT(";"));
		    OUT11STR(.CODEPTR[INLNARG]); CRLF;
		    IF .CODEPTR[INLCOM]
		      THEN CRLF
		      ELSE
			(NINLINES_.NINLINES+1;
			 CODESIZE_.CODESIZE-#201;
			 ROUTINESIZE_.ROUTINESIZE-#201)
		    END
		ELSE BEGIN
		    TAB;
		    OUTPXLIM(PDP11PRT[.CODEPTR[OPF]],5);
		    TAB;
		    CASE .OPERTYPE[.CODEPTR[OPF]] OF
		      SET
			% NOOP %
			0;

			% ONEOP %
			OUTOPD(SRCP(.CODEPTR));

			% TWOOP %
			BEGIN
                          OUTOPD(SRCP(.CODEPTR));
                          OUTPUT(",");
                          OUTOPD(DSTP(.CODEPTR))
                        END;

			% BROP %
			OUTOPD(SRCP(.CODEPTR));

			% JSROP %
			BEGIN
                          OUTREG(.CODEPTR[SRCREG]);
                          OUTPUT(",");
                          OUTOPD(DSTP(.CODEPTR))
                        END;

			% RTSOP %
			OUTREG(.CODEPTR[SRCREG]);

			% TRAPOP %
			OUTOCT(.CODEPTR[SRCOFFSET],1);

			% WORDOP %
			OUTNAMOFF(SRCP(.CODEPTR));

			% CASEOP %
			BEGIN
                          OUTNAMOFF(SRCP(.CODEPTR));
                          OUTPUT("-");
                          OUTNAMOFF(DSTP(.CODEPTR))
                        END

                      TES;
		    CRLF;
		    END;

	    ! 2 - LABEL
	    BEGIN
	    IF .SEGSW THEN
		IF CODEP(.CODEPTR[NEXTF]) THEN
		    IF CASPARAMP(.CODEPTR[NEXTF]) THEN
			(CASEFLAG_1; OUTCSECT(MSG(.G)); CRLF);
	    OUTLAB(.CODEPTR);
	    OUTPUT(":");
	    END

	    TES;
        CODEPTR_.CODEPTR[NEXTF];
	IF .CASEFLAG THEN
	    IF NOT CODEP(.CODEPTR) THEN
		(CASEFLAG_0; OUTCSECT(MSG(.C)); CRLF);
	END;

    CRLF;
    IF .SFLG THEN
	BEGIN
	LOCAL SDEV;
	SDEV_.DEVICE;
	DEVICE_TTYDEV;
	OUTPXLIM(CODENAME,NAMESIZE);
        OUTPUT(" ");
        OUTDEC(.ROUTINESIZE,1);
        CRLF;
	DEVICE_.SDEV
	END;
    IF .DEBFLG THEN BEGIN
      OUTPUT("$");
      IF .CODE2 NEQ 0
	THEN OUTUNAME(ABS(.CODE2))
	ELSE OUTPXLIM(CODENAME,NAMESIZE);
      OUTPUT(":");
      CRLF
    END;
    OUTS('; ROUTINE SIZE:  ');
    OUTDEC(.ROUTINESIZE,1);
    CRLF;

    END;


ROUTINE OUTLAB(LAB)=
    BEGIN
    MAP STVEC LAB;
    CASE .LAB[LABTYPEF] OF
	SET
	! 0 - ROUTINE EXIT LABEL
	(OUTPUT("$"); OUTPXLIM(.LAB[LABVALF],NAMESIZE-1));
	! 1 - USER LABEL
	(OUTNAME(.LAB[LABVALF]); ST[.LAB[LABVALF],LABUSEDF]_TRUE);
	! 2 - COMPILER GENERATED LABEL
	(OUTS('L$'); OUTDEC(.LAB[LABVALF],1))
	TES;
    END;


ROUTINE OUTNAME(STE) =
  BEGIN
    MAP STVEC STE;
    IF .STE[UNIQBIT] THEN
	IF ONEOF(.STE[TYPEF],BIT5(LABELT,OWNT,ROUTINET,GROUTINET,FORWT))
	    THEN OUTUNAME(.STE[UNIQENAMEF])
	    ELSE OUTPXLIM(.STE[NAMEPTR],NAMESIZE)
	ELSE OUTPXLIM(.STE[NAMEPTR],NAMESIZE);
  END;




ROUTINE OUTNAMOFF(OPRND) =
BEGIN
  MAP STVEC OPRND;
  IF .OPRND[ANAME] GTR 1 THEN BEGIN
    IF .OPRND[ANAMET] EQL NORMNAME THEN OUTNAME(.OPRND[ANAME])
    ELSF .OPRND[ANAMET] EQL LABELNAME THEN OUTLAB(.ST[.OPRND[ANAME],REFEF])
    ELSE OUTS('$TN');
    IF AOFFSETV(OPRND) EQL 0 THEN RETURN
    ELSF AOFFSETV(OPRND) GTR 0 THEN OUTPUT("+")
    ELSE OUTPUT("-");
    OUTOCT(ABS(AOFFSETV(OPRND)),1)
  END
  ELSF .OPRND[ATYPE] EQL IMMEDAT THEN OUTOCT(.OPRND[AOFFSET],1)
  ELSE BEGIN
    IF AOFFSETV(OPRND) LSS 0 THEN OUTPUT ("-");
    OUTOCT(ABS(AOFFSETV(OPRND)),1)
  END;
END;



ROUTINE OUTOPD(OPRND) =
    BEGIN
    MAP STVEC OPRND;
    LOCAL XMODE;
    IF XMODE_.OPRND[AMODE] THEN OUTPUT("@");
    XMODE_.XMODE AND NOT DEFERRED;
    IF .XMODE EQL GENREG
	THEN OUTREG(.OPRND[AREG])
	ELSF .OPRND[AREG] NEQ 7
	    THEN SELECT .XMODE OF
		    NSET
		    AUTODECR: OUTPUT("-");
		    INDEXED: OUTNAMOFF(.OPRND);
		    ALWAYS: (OUTPUT("(");
			     OUTREG(.OPRND[AREG]);
			     OUTPUT(")"));
		    AUTOINCR: OUTPUT("+");
		    TESN
	    ELSE BEGIN
		IF .XMODE EQL IMMEDIATE THEN OUTPUT("#");
                OUTNAMOFF(.OPRND)
		END;
    END;


    ROUTINE OUTNAMEDISP(S)=
	BEGIN MAP STVEC S; LOCAL STVEC B,N;
	IF .S[NAMEXP] THEN
	    BEGIN 
	    B_.S[NAMEXPTR];
	    N_.S[OFFSETF]-.B[OFFSETF];
	    IF .N NEQ 0 THEN
		BEGIN
		IF .N GTR 0 THEN OUTPUT("+") ELSE OUTPUT("-");
		OUTOCT(ABS(.N),1);
		END;
	    END;
	END;

  ROUTINE OUTCSECT(X)=
  BEGIN

    LOCAL FLAG,NAME;
    BIND SECTPLIT=PLIT ("C",CSCFLG,CSCNAME,
			"G",CSGFLG,CSGNAME,
			"O",CSOFLG,CSONAME,
			"P",CSPFLG,CSPNAME,
			"S",CSDFLG,CSDNAME,
			"N",CSDFLG,CSDNAME);


    INCR I FROM 0 TO .SECTPLIT[-1]-3 BY 3 DO
	IF .SECTPLIT[.I] EQL .(.X)<22,7>
	  THEN (FLAG_.(.SECTPLIT[.I+1]);
		NAME_.(.SECTPLIT[.I+2]);
		EXITLOOP);
    CASE .FLAG OF
	SET
	% 0 %
	  BEGIN
	  IF .CSFLG LEQ 1
	    THEN OUTS('.CSECT ')
	    ELSE OUTS('.PSECT ');
	  OUTPXLIM(CSNAME,4);
	  OUTXSTRING(.X,2,0)
	  END;

	% 1 %
	  (OUTS('.CSECT ');
	   OUT11STR(.NAME));

	% 2 %
	  (OUTS('.PSECT ');
	   OUT11STR(.NAME))

	TES;
    END;

  ROUTINE OUTPLIT(NAM,PP)=
  BEGIN
    MAP STVEC PP:NAM;
    LOCAL STVEC NL, LEXEME LEX;
    BIND CNT=FINPRINCNT;

    ROUTINE OUTSEP=
	IF (CNT_.CNT+1) GEQ 3
	    THEN (CNT_0; CRLF; OUTS('?I.WORD  '))
	    ELSE IF .CNT NEQ 0 THEN OUTPUT(",");

    IF .NAM NEQ 0 THEN
      BEGIN
	IF .NAM[COUNTED] THEN (OUTS('?I+'); OUTOCT(.PP[LSLENGTH],1); CRLF);
	OUTNAME(.NAM);
	OUTS(':?I.WORD  ');
	CNT_-1;
      END;

    NL_.PP[TOPF];
    UNTIL .NL EQL .PP DO ( IF .NL[CELLTYPEF]
      THEN INCR I FROM 1 TO .NL[DUPLENGTH] DO OUTPLIT(0,.NL)
      ELSE 
	BEGIN
	  LEX_.NL[LEXEMEF];
	  CASE .LEX[LTYPF] OF
	    SET
	      0; ! DELIMITER
	      (OUTSEP(); OUTOCT(LITVALUE(.LEX[ADDRF]),1)); ! LITERAL
	      (OUTSEP(); OUTNAME(.LEX); OUTNAMEDISP(.LEX)); ! SYMBOL
	      0; ! GRAPH TABLE NODE
	      0; ! ERROR LEXEME
	      OUTPLIT(0,.LEX[ADDRF]) ! LONG STRING
	    TES
	END;
      NL_.NL[NEXTF]);
  IF .NAM NEQ 0 THEN
    BEGIN
      LOCAL PAD;
      CRLF;
      PAD_.NAM[NCONTIGLOC]-.PP[LSLENGTH]*2;
      IF .PAD LEQ 0 THEN RETURN;
      OUTS('?I.=.+'); OUTOCT(.PAD,1); CRLF;
    END
  END;


ROUTINE OUTSTORAGE(TYPE,REGION,REGTOP,MUSTBEPLIT)=
    BEGIN
    LOCAL BYT,DOLABEL;
    REGISTER STVEC PUR;
    DOLABEL_-1;
    BYT_0;
    PUR_.PURGED;
    WHILE .PUR NEQ 0
	DO BEGIN
	    IF .PUR[TYPEF] EQL .TYPE
	      THEN IF .PUR[ITSAPLIT] EQL .MUSTBEPLIT
		THEN IF NOT .PUR[PRNF]
		  THEN BEGIN
			IF .DOLABEL
			    THEN BEGIN
				OUTCSECT(.REGION); CSFLAG_1;
				CRLF;
				DOLABEL_0;
				END;
			IF .BYT AND LITVALUE(.PUR[SIZEF]) MOD WRDSZ EQL 0
				THEN (OUTS('.EVEN'); CRLF; BYT_0);
			IF .PUR[REQINIT]
			  THEN OUTPLIT(.PUR,.PUR[INITP])
			  ELSE
			BEGIN
			OUTNAME(.PUR);
			OUTS(': .=.+');
			OUTOCT(.PUR[NCONTIGLOC],1);
			CRLF;
			END;
			BYT_.BYT+.PUR[NCONTIGLOC];
			IF .PUR[ITSAPLIT] THEN IF .PUR[COUNTED]
			  THEN BYT_.BYT+2;
			PUR[PRNF]_-1;
			END;
	    PUR_.PUR[THREAD];
	    END;
    IF .BYT THEN (OUTS('.EVEN'); CRLF);
    IF .MODDONE THEN IF .MAINDECL THEN IF @.REGION EQL ASCIZ '.G'
      THEN BEGIN
	IF .DOLABEL THEN
	  (OUTCSECT(MSG(.G)); CSFLAG_1; CRLF);
	OUTSTE(.LEXBREG);
	OUTS(': .=.+2');
	CRLF;
	END;
    END;


ROUTINE OUTGLBINDS=
    BEGIN
    REGISTER STVEC PUR;
    PUR_.PURGED;
    WHILE .PUR NEQ 0 DO
	BEGIN
	IF .PUR[TYPEF] EQL MBINDT
	  THEF .PUR[GLBIND]
	  THEN (OUTSTE(.PUR);
		OUTS(' = ');
		BEGIN
		  LOCAL LEXEME LEX;
		  LEX_.PUR[BINDLEXF];
		  IF .LEX[LTYPF] EQL LITTYP
		    THEN OUTOCT(LITVALUE(.LEX[ADDRF]),1)
		    ELSE (OUTNAME(.LEX); OUTNAMEDISP(.LEX));
		END;
		CRLF;
		OUTS('.GLOBL ');
		OUTSTE(.PUR);
		CRLF);
	PUR_.PUR[THREAD];
	END;
    END;


ROUTINE OUTVARS=
    BEGIN
    LOCAL STVEC SAVPTR;
    BIND VECTOR OUTL=
	PLIT(LEXMUL,LEXDIV,LEXMOD,LEXROT,LEXSHIFT,
		LEXCREATE,LEXEXCHJ,
		LXSIGV,LXSIGR,LXSIGL,LXSIG1,LXENAB,
		LXSAV2,LXSAV3,LXSAV4,LXSAV5,
		LXINT612,LXE612,LXX612,LXY612,
		LXHLNK,LXHLTB,LXIHLNK);
    CRLF; CRLF;
    OUTSTORAGE(OWNT,MSG(.O),.NEXTOWN,FALSE);
    IF .NEXTOWN THEN NEXTOWN_.NEXTOWN+1;
    OUTSTORAGE(GLOBALT,MSG(.G),.NEXTGLOBAL,FALSE);
    IF .NEXTGLOBAL THEN NEXTGLOBAL_.NEXTGLOBAL+1;
    OUTSTORAGE(GLOBALT,MSG(.P),NOVALUE,TRUE);	! PLITS
    OUTGLBINDS();
    SAVPTR_.PURGED;
    WHILE .SAVPTR NEQ 0
	DO BEGIN
	    IF ONEOF(.SAVPTR[TYPEF],BIT3(EXTERNALT,GLOBALT,GROUTINET))
	      THEF NOT (.SAVPTR[PRNEXF] OR .SAVPTR[ITSAPLIT] OR .SAVPTR[NAMEXP])
		THEN BEGIN
		    OUTS('.GLOBL ');
		    OUTSTE(.SAVPTR);
		    SAVPTR[PRNEXF]_-1;
		    CRLF;
		    END;
	    SAVPTR_.SAVPTR[THREAD];
	    END;
    CRLF;
    IF .MODDONE
	THEN BEGIN
	    DATASIZE_.DATASIZE+(.NEXTOWN+.NEXTGLOBAL)/2;
	    DECR I FROM .OUTL[-1]-1 TO 0
		DO BEGIN
		    SAVPTR_@(.OUTL[.I]);
		    IF .SAVPTR[PRNEXF]
			THEN BEGIN
			    OUTS('.GLOBL ');
			    OUTSTE(.SAVPTR);
			    CRLF;
			    SAVPTR[PRNEXF]_0;
			    END;
		    END;
	   IF .MAINDECL THEN
		BEGIN
		OUTS('.GLOBL ');
		OUTSTE(.LEXBREG);
		CRLF;
		END;
	    END;
    IF .MODDONE AND .MAINDECL
	THEN BEGIN
	    IF .SSTKLEN GTR 0
		THEN BEGIN
		    OUTS('.ASECT'); CRLF;
		    OUTS('.=400'); CRLF;
		    OUTS('.=.+'); OUTOCT(2*.SSTKLEN,1); CRLF;
		    OUTS('S$TK=.-2'); CRLF;
		    CRLF;
		    DATASIZE_.DATASIZE+.SSTKLEN;
		    END;
	    END;
    END;



ROUTINE OUTDLAB(L)=
    BEGIN 
    IF .L EQL 0 THEN RETURN OUTS('+0');
    OUTS('D$'); OUTOCT(.L,1);
    END;

ROUTINE PLACENXTDLAB(L)= (MAP GTVEC L;OUTDLAB(DLABEL_.L[UNIQENAMEF]); OUTPUT(":"));

ROUTINE OUTDNUM(X)= (OUTPUT(","); OUTOCT(.X AND #177777,1));

ROUTINE OUTDUNAME(X)= (OUTPUT(","); OUTUNAME(.X));

ROUTINE ODADR(X)= (OUTPUT(","); OUTNAME(.X));

ROUTINE DTYPE(L)=
    BEGIN MAP GTVEC L;
    SELECT .L[TYPEF] OF
	NSET
	ROUTINET : RETURN 2;
	GROUTINET : RETURN 2;
	OWNT : RETURN 3;
	GLOBALT : (RETURN IF .L[ITSAPLIT] THEN 0 ELSE 4);
	LOCALT : RETURN 5;
	REGT : RETURN 7;
	MBINDT :
		BEGIN LOCAL LEXEME X; X_.L[BINDLEXF];
		IF .X[LTYPF] EQL LITTYP THEN RETURN 0 % USED TO BE 8 %;
		IF .X[LTYPF] EQL GTTYP THEN RETURN 14;
		(MAP STVEC X;
		 IF .X[NAMEXP] THEN RETURN
					IF .X[REGF] EQL SP
					  THEN DTYPE(.X)+(-1)^18
					  ELSE 8);
		RETURN 0
		END;
	LABELT : (IF NOT .L[LABUSEDF] THEN RETURN 0;
		  IF .(.L[NAMEPTR])<22,7> EQL "$" THEN RETURN 0;
		  RETURN 9);
	FORMALT : RETURN 16;
	OTHERWISE : RETURN 0
	TESN
    END;



ROUTINE OUTDEBSYMTAB=
    BEGIN
    LOCAL STVEC L:M, GTVEC NAME:T, LEXEME LT, PC;
    EXTERNAL CODENAME;
    MACRO OUTLINKTB=(OUTPUT(","); OUTPXLIM(.LXHLTB[NAMEPTR],NAMESIZE))$;
	! CHANGED OUTLINKTB NOT TO CHECK HYDRASW BECAUSE C.MMP USERS
	! MUST HAVE "LINKTB" GENERATED TOO.  -TL 6/24/74
    ROUTINE BITCOUNT(WORD) =	! COUNT THE ONE BITS
	BEGIN REGISTER XWORD,COUNT;
	COUNT_0; XWORD_.WORD;
	WHILE .XWORD NEQ 0 DO (IF .XWORD THEN COUNT_.COUNT+1; XWORD_.XWORD^(-1));
	.COUNT
	END;
    IF NOT .DEBFLG THEN RETURN;
    M_L_.PURGED; PC_-1;
    WHILE .L NEQ 0 DO
	BEGIN
	IF (T_DTYPE(.L)) NEQ 0 THEN
	    BEGIN MACRO CONTINUE=EXITBLOCK$;
	    IF .L[NAMEXP] OR NOT .L[DEBUGF] THEN CONTINUE;
	    IF .T LSS 0		! LEFT HALF SET BY DTYPE
		THEN (T_.T<RIGHTPART>; L_.L[BINDLEXF]);
	    IF .PC NEQ 0 THEN (OUTCSECT(MSG(.S)); CSFLAG_1; PC_0);
	    CRLF;  PLACENXTDLAB(.M); TAB;
	    SELECT .T OF
	      NSET
		5: IF .L[SREGF] NEQ SP THEN T_6;
		14: IF .L[SREGF] EQL SP THEN T_15;
		16: IF .L[REGF] NEQ SP THEN T_17
	      TESN;
	    NAME_.M[NAMEPTR];OUTDLAB(.NAME[DCHAIN]);NAME[DCHAIN]_.DLABEL;
	    OUTDNUM(.M[UNIQENAMEF]);
	    OUTDNUM(.T); CRLF; TAB;
	    IF .MODDONE THEN OUTPUT("0") ELSE OUTDLAB(ABS(.CODENAME[3]));
	    CASE .T OF
		SET

		0;	! 0, UNUSED TYPE

		0;	! 1, MODULE NAME

		BEGIN	! 2, ROUTINE
		ODADR(.L);
		OUTLINKTB;
		CRLF; OUTS('?I$');
		OUTNAME(.L);
		OUTPUT("-");
		OUTNAME(.L);
		OUTDNUM(.L[RNPARMSF]+.L[REGSTOSAVE]^8); 
		OUTDNUM(.GT[.L[LNKGNMF],LNKGTF]);
		END;

		BEGIN	! 3, OWN
		ODADR(.L); OUTLINKTB;
		CRLF; TAB; OUTOCT(.L[NCONTIGLOCS],1)
		END;

		BEGIN	! 4, GLOBAL
		OUTPUT(","); OUTPXLIM(.L[NAMEPTR],NAMESIZE);
		OUTLINKTB; CRLF; TAB; OUTOCT(.L[NCONTIGLOCS],1)
		END;

		BEGIN	! 5, STACK LOCAL
		T_.CODENAME[4];		! POINTER TO PARENT ROUTINE'S ENTRY
		IF .T NEQ 0 THEN T_BITCOUNT(.T[REGSTOSAVE]);
			! NOTE TO WHOEVER PUT IN THAT CODE FOR
			! THE $SAV-N PC WORD: DEBSW *FORCES*
			! INLINE REGISTER SAVING. -TL
		OUTDNUM(.L[OFFSETF]-(.T+.VTN)*2);
		OUTDNUM(0);
		CRLF; TAB; OUTOCT(.L[NCONTIGLOCS],1)
		END;

		BEGIN	! 6, REGISTER LOCAL
		OUTDNUM(.L[SREGF]);
		END;

		BEGIN	! 7, REGISTER
		OUTDNUM(.L[SREGF]);
		END;

		BEGIN	! 8, SIMPLE BIND
		LT_.L[BINDLEXF];
		IF .LT[LTYPF] EQL LITTYP THEN OUTDNUM(LITVALUE(.LT)) ELSE
			BEGIN
			OUTPUT(",");
			OUTNAME(.LT);
			OUTNAMEDISP(.LT);
			END;
		END;

		BEGIN	! 9, LABEL
		ODADR(.L);
		OUTLINKTB;
		END;

		0;	! 10, UNUSED

		0;	! 11, LINKAGE

		0;	! 12, STRUCTURE

		0;	! 13, MACRO

		BEGIN	! 14, DYNAMIC BIND (IN A REGISTER)
		OUTDNUM(.L[SREGF])
		END;

		BEGIN	! 15, DYNAMIC BIND (IN A STACK TEMPORARY)
		T_.CODENAME[4];
		IF .T NEQ 0 THEN T_BITCOUNT(.T[REGSTOSAVE]);
		OUTDNUM(.L[OFFSETF]-(.T+.VTN)*2);
		END;

		BEGIN	! 16, STACK FORMAL
		OUTDNUM(.L[OFFSETF]);
		END;

		BEGIN	! 17, REGISTER FORMAL
		OUTDNUM(.L[SREGF]);
		END;


		TES;
	    END;
	M_L_.M[THREAD];
	END;
    END;


ROUTINE OUTSTRNAME(L)=
    BEGIN MAP STVEC L; LOCAL C1,C2,CP;
    OUTS('^''');
    OUTXSTRING((.L)<29,7>,9,9);
    OUTS('''');
    END;


ROUTINE OUTDEBNAMTAB=
    BEGIN LOCAL STVEC L, PC;
    IF NOT .MODDONE THEN RETURN;
    IF NOT .DEBFLG THEN RETURN;
    PC_-1; CRLF;
    INCR I FROM 0 TO 124 DO
	BEGIN
	L_.HT[.I,NAMEF];
	WHILE .L NEQ 0 DO
	    BEGIN
	    IF .L[DCHAIN] NEQ 0 THEN
		BEGIN
		IF .PC NEQ 0 THEN
 			BEGIN
			CRLF; IF NOT .LSTFLG AND NOT .TTYLST THEN	! MACRO MUST NOT CROSS PAGE
				IF .NLINES GTR 44 THEN PAGE();
			OUTCSECT(MSG(.N)); CSFLAG_1;PC_0; CRLF; CRLF;
			OUTS('.MACR $NTE X,Y'); CRLF;
			OUTS('.RAD50 /X/'); CRLF;
			OUTS('.WORD Y'); CRLF;
			OUTS('.ENDM'); CRLF; CRLF;
			OUTS('$NMTAB:');
			END;
		CRLF; TAB; OUTS('$NTE'); TAB;
		OUTSTRNAME(.L); OUTPUT(",");
		OUTDLAB(.L[DCHAIN]);
		L[DCHAIN]_0;
		END;
	    L_.L[NAMELINK];
	    END;
	END;
    END;



ROUTINE OUT11STR(LEX)=
    !
    ! ROUTINE TO OUTPUT BLIS11 STRING.
    !
    !  LEXEME ASSUMED OF TYPE LSLEXTYP OR LITTYP.
    !  NOTE:  BLIS11 CHARACTER SEQUENCE IS LOW-ORDER 8 BITS
    !  FOLLOWED BY HIGH-ORDER 8 BITS.
    !
    BEGIN
    ROUTINE OUTWRD(LEX)=
	BEGIN
	MAP LEXEME LEX;
	OUTPUT(LITVALUE(.LEX[ADDRF]) AND #177);
	OUTPUT(LITVALUE(.LEX[ADDRF])^(-8));
	END;

    MAP LEXEME LEX;
    LOCAL STVEC HEAD:CUR;
    IF .LEX[LTYPF] EQL LITTYP THEN RETURN OUTWRD(.LEX);
    HEAD_.LEX[ADDRF];
    CUR_.HEAD[TOPF];
    INCR I FROM 1 TO .HEAD[LSLENGTH] DO
	(OUTWRD(.CUR[LEXEMEF]); CUR_.CUR[NEXTF]);
    END;




GLOBAL ROUTINE FINALDRIV=
    BEGIN
    LOCAL SAVLST;
    FINAL();
    SAVLST_.LSTFLG; LSTFLG_0; !ALWAYS LIST CODE
    OUTCODE();
    FELIST(.NLHEAD);
    FERASEDET(.NLHEAD);
    FELIST(.BRAK1);
    FERASEDET(.BRAK1);
    OUTVARS();
    OUTDEBSYMTAB();
    OUTDEBNAMTAB();
    LSTFLG_.SAVLST;
    NOVALUE
    END;

END
END
END
ELUDOM