Google
 

Trailing-Edge - PDP-10 Archives - BB-D868D-BM - language-sources/pltdcl.bli
There are 13 other files named pltdcl.bli in the archive. Click here to see a list.
MODULE PLTOVL(DREGS=6,SREG=#17,VREG=#15,FREG=#13,RESERVE(#16),START)=
BEGIN


!THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
!  OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
!
!COPYRIGHT (C) 1979 BY DIGITAL EQUIPMENT CORPORATION


!***	DECLARATIONS	***

!***	IMPLEMENTATION DEPENDENT BINDS	***

	BIND	NOCHECK = 0.60,	%SEE PHASE 2 OF BRKAPART%
		TRPCHECK = 0.30,	%SEE PHASE 3%
		ITOP = 0.75,	%AMT OF X-AX IN  LEAF POLYGON%
		ISIDE = 0.70,	%DITTO FOR Y-AX%
		IXINCR = 1.50,	%VERT DIST BETWEEN NODES%

%	SET PLTDIAG TO SHAPE YOU WANT PLOTTED TREES TO BE    %

		DIAG=0, SQAR=-1,
		PLTDIAG=DIAG
		;

	BIND 	AMTNODE=7,
		MAXST=32,	%NUMBER OF SUBTREES ACCEPTED%
		DIAMOND=100000,
		TRAPZOID=100001;

!***	MODULE WIDE REGISTERS	***

	REGISTER TMP1,TMP2;

	MACHOP	ILDB=#134,
		IDPB=#136,
		MOVEI=#201,
		MOVEM=#202,
		BLT=#251,
		JRST=#254,
		PUSH=#261,
		POP=#262,
		POPJ=#263,
		HRLM=#506;

	MACRO	HALT=JRST(4)$;

!***	PLOTTER PACKAGE ENTRY POINTS	***

	EXTERNAL ?.BREG;

	EXTERNAL	LINE, %GIVEN X,Y ARRAYS, IT PLOTS (N) STRAIGHT LINES%
			WHERE,	%THE CO-ORDS OF THE PEN%
			PLOT,	%MOVE PEN FROM CUR.LOC. TO (X,Y)%
			PLOTS,	%INIT THE PACKAGE%
			SYMBOL,	%PLOTS AN ASCII STRING FROM AN ARRAY%
			NUMBER,	%DITTO FOR FL.PT. NUM%
			LPTOUT;	%SPECIALLY FOR LINK--SIMS PLT ON LPT%

	%THE FORTRAN INTERFACE%

	EXTERNAL	PLTORIG,
			PLTINIT,
			PLTPOLY,
			PLTLINE;

	%THE LINK-10 CORE ALLOCATION INTERFACE%

	EXTERNAL	?DY.GET,
			?DY.RET,
			GETSON,
%	 <FILE>/PLOT:(LEAVES:VAL,INCHES:VAL,STPSIZ:VAL) -- RESPECTIVELY
	1) MAX LEAVES ALLOWED IN SUBTREE
	2) WIDTH OF PLOTTER IN INCHES
	3) PHYS. PLT CHARACTERISTIC IN TERMS OF STEPS/INCH
	COMBINED THEY ACT AS A SCALING MECHANISM
%
			LEAVES,
			STEPS,
			LPBUF,	%IF <FILE> IS LPT: THIS WILL PT. AT 2K BUFFER%
			ERRFND,
			INCHES;

	BIND 	MAXWT=LEAVES;	%THE FORMER WILL BE THE FL. REPR. OF THE LATTER%

!***	ROUTINE DECLARATIONS	***

	FORWARD	OVLPLT,
		SUBTREE,
		BRKAPART,
		PLTTREE,
		TRAPBRK,
		MAKTREE,
		SELTREE2P,
		FNDLEAVES,
		CLEANUP,
		TASCII;

!***	PRIMITIVE MACROS	***


	MACRO 	PLUS=FADR$,
		SUB=FSBR$,
		MUL=FMPR$,
		DVIDE=FDVR$;


!***	MACROS FOR ACCESS MNEMONICS	***

	MACRO WHOLE=0,36$,
		LEFT=18,18$,
		RIGHT=0,18$,
		ZZ=0,0$;

!***	BLT MACROS	***

    MACRO ZERO(FIRST,LAST)
=    BEGIN
	REGISTER AC;
	AC<LEFT>_FIRST<ZZ>;
	AC<RIGHT>_(FIRST+1)<ZZ>;
	FIRST_0;
	BLT(AC,LAST);
    END;$;

	MACRO SAVREGS 
=	BEGIN
		REGSAV[15]_.(#17)<WHOLE>;
		#17<WHOLE>_REGSAV<0,0>;
		BLT(#17,REGSAV[14]);
		#17<WHOLE>_.REGSAV[15];
	END;$;

	MACRO RESREGS
=	BEGIN
		HRLZI(SREG,REGSAV<0,0>);
		BLT(#17,#17)
	END;$;

!***	STRUCTURE DECLARATIONS	***

	MACRO	SIZE=0,LEFT$,	%SIZE OF STRUCT IN WORDS%
		RSERV1=0,RIGHT$,
		UNUSED=1,LEFT$,
		ASON=1,RIGHT$,
		LNKNODE=2,LEFT$,	%PTS. AT NODE IN LINK'S INTERNAL TREE%
		BROTHER=2,RIGHT$,
		NAMLEN=3,LEFT$,
		LNUM=3,RIGHT$,	%LINK NUMBER--FOR PSEUDO-NODES IS NODE TYPE, 100000 FOR DIAMOND,100001 FOR TRAPZOID%
		LNAME=4,WHOLE$,	%LINK NAME--IN ASCII AND AT MOST 10 CHAR%
		MYWT=6,WHOLE$,	% # (FLOATING) OF LEAVES BENEATH NODE%
		REST=7,WHOLE$;

	MACRO	NEXT=0,RIGHT$;	%FOR PATCHING--USES NXOFPRV%

!***	PSEUDO-ROUTINES	***

	%AMOUNT MUST BE A CONSTANT%

	MACRO ALLOC(WHERE,AMOUNT)=
	BEGIN
	    PUSH(SREG,1);
	    PUSH(SREG,2);
	    MOVEI(2,AMOUNT);
	    ?DY.GET();
	    MOVEM(1,WHERE);
	    HRLM(2,0,1);
	    POP(SREG,2);
	    POP(SREG,1);
	END;
$;

	MACRO DEALLOC(WHERE,AMOUNT)=
	BEGIN
	    PUSH(SREG,1);
	    PUSH(SREG,2);
	    MOVEI(2,AMOUNT);
	    MOVE(1,WHERE);
	    ?DY.RET();
	    POP(SREG,2);
	    POP(SREG,1);
	END;
$;

	MACRO DOABORT=HALT$;

	MACRO SELFDATA(WHO)=
	TASCII(WHO[LNAME]<ZZ>,.WHO[NAMLEN]);
$;



!***	SCALAR DECLARATIONS	***

	%THESE ARE LOCAL RATHER THAN OWNED BECAUSE OF THE
	REQUIREMENT IMPOSED BY LINK-10 OF MINIMIZING STATIC LOW SEG SP%

	LOCAL	BRKQAD,	%SEE PHASE 2 OF BRKAPART%
		LETR,	%2ND PART OF TRAP. NODE'S NAME%
! MADE A REG	MAXSON,	%SON WITH LARGEST WT. IN PH3 OF BRKAPART%
		NAME[2],%INDEX PART OF SUBTREE NAMES%
		ROOT[AMTNODE],	%NODE FOR ROOT OF TREE%
		SIDE,	%IN INCHES, HEIGHT OF NODE%
		TOP,	%WIDTH OF SAME%
		TRAPSON[AMTNODE],	%DUMMY NODE%
		XINCR,	%VERT DIST BETWEEN NODES%
		XMAX;	%FURTHEST Y PT. PLOTTED%

!***	STRUCTURES	***

	STRUCTURE BASE[J,K,L]=
	(@.BASE+.J)<.K,.L>;	%STANDARD BASED STRUCUTURE%

	STRUCTURE FIXED[J,K,L]=
	(.FIXED+.J)<.K,.L>;

	STRUCTURE ARRN2[I]=
	(.ARRN2+.I-DIAMOND)<WHOLE>;

!***	MODULE-WIDE STRUCTURE MAPPINGS	***

	MAP ARRN2 NAME;
	MAP FIXED ROOT:TRAPSON;
!	FORWARD GETSON;
!	REQUIRE PLTDEB.BLI;
	REQUIRE PLTOVL.BLI;