Google
 

Trailing-Edge - PDP-10 Archives - AP-4172F-BM - 3a-sources/lnkplt.mac
There are 38 other files named lnkplt.mac in the archive. Click here to see a list.
TITLE LNKPLT - INTERFACE TO PLOTTER MODULE
SUBTTL	D.M.NIXON/DMN/JLd/SRM/JBC/JNG	27-Feb-78

;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
;  OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
;
;COPYRIGHT (C) 1973, 1978 BY DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

ENTRY	LNKPLT,GETSON
SEARCH	LNKPAR,LNKLOW,MACTEN,UUOSYM,SCNMAC

CUSTVR==0		;CUSTOMER VERSION
DECVER==4		;DEC VERSION
DECMVR==0		;DEC MINOR VERSION
DECEVR==765		;DEC EDIT VERSION




SALL
SEGMENT
SUBTTL	REVISION HISTORY

;START OF VERSION 2
;137	INITIAL VERSION
;170	INTEGRATE WITH BLISS CODE ETC.

;START OF VERSION 2B
;261	Plot root if null structure
;263	Allow more words per level in stack size calculation
;315	FIX BUG CAUSED BY MACRO 50A
;342	INCLUDE EDIT 315 IN MAINTENANCE SOURCES

;START OF VERSION 2C
;557	Clean up listing for release.

;START OF VERSION 3A
;560	Release on both TOPS-10 and TOPS-20 as LINK version 3A(560)


;START OF VERSION 4
;731	SEARCH MACTEN,UUOSYM
;765	Release on both TOPS-10 and TOPS-20 as LINK version 4(765)
SUBTTL	BLISS CONVENTIONS

FREG==13
VREG==15





;LOCAL DEFINITIONS
PC==17			;REAL PLOTTER CHANNEL

;MATERIALIZE THESE SYMBOLS FOR PLOTTER CODE
	EXP	INCHES,LEAVES,STEPS	;
	RELOC	.-3	;
SUBTTL	DEFAULTS

P$LEAVES==^D16
L$LEAVES==^D8
P$INCHES==^D29
L$INCHES==^D12
P$STEPS==^D100
L$STEPS==^D20
L$BUFSIZ==^D2160

DEFINE	KEYMAC (A,B)<
 IFIDN <A>,<PLT>,<
   IRP B,<
    EXP P$'B
>>>
PLTTBL:	KEYWORDS
DEFINE	KEYMAC (A,B)<
 IFIDN <A>,<PLT>,<
   IRP B,<
    EXP L$'B
>>>
LPTTBL:	KEYWORDS
SUBTTL	ENTRY

LNKPLT:	JFCL			;IN CASE CCL
	ZAPTMP			;CLEAR TEMP AREA
;NOW REDUCE CORE TO A MINIMUM
	MOVE	T1,DY.AB	;WHAT WE NEED
	ADDI	T1,2000		;PLUS SPACE FOR BUFFERS
	CORE	T1,		;CUT BACK
	  JFCL			;TOO BAD
	MOVE	T1,DY.UB	;PREVIOUS UPPER BOUND
	MOVE	T2,.JBREL##	;CURRENT UPPER BOUND
	CAML	T1,T2		;REDUCED SIZE BUT NOT TOO FAR
	JRST	[CAME	T1,T2		;DID WE DO ANYTHING?
		MOVEM	T2,DY.UB	;YES, CUT BACK
		JRST	LNKPL1]		;AND CLEAR TABLES
	HRL	T1,T1
	ADDI	T1,1		;FORM BLT PTR
	SETZM	-1(T1)
	BLT	T1,(T2)		;CLEAR REST OF CORE
LNKPL1:	ADDI	T2,1		;.JBREL+1
	MOVEM	T2,.JBFF##	;STOPS SCREW UPS
	MOVE	T1,[TAB.LB+1,,TAB.LB+2]
	SETZM	TAB.LB+1	;CLEAR TABLES
	BLT	T1,TAB.LB+HG.TAB
	MOVE	T1,[TAB.AB+1,,TAB.AB+2]
	SETZM	TAB.AB+1
	BLT	T1,TAB.AB+HG.TAB
	MOVE	T1,[TAB.UB+1,,TAB.UB+2]
	SETZM	TAB.UB+1
	BLT	T1,TAB.UB+HG.TAB
	MOVE	T2,BRNMAX	;LONGEST BRANCH
	IMULI	T2,^D50		;50 WORDS PER LEVEL
	ADDI	T2,^D100	;PLUS FUDGE FACTOR
	PUSHJ	P,DY.GET##	;GET SPACE
	MOVN	T2,T2		;- LENGTH
	HRL	T1,T2		;NEW PUSHDOWN STACK
	MOVEM	T1,SAVEP	;WILL USE IT TO CALL PLOT ROUTINES WITH
	MOVEI	T1,PC		;SET REAL CHAN #
	MOVEM	T1,IO.CHN	;AS CHAN TO USE
	MOVE	T1,IO.PTR+%PC	;GET FAKE CHAN
	MOVEM	T1,IO.PTR+PC	;REAL CHAN
	SETZM	IO.PTR+%PC	;JUST IN CASE
;NOW SET THE COMMON DEFAULTS
	MOVE	T2,LODNAM	;DEFAULT NAME
	SKIPN	I.NAM(T1)	;BUT NOT IF ALREADY SETUP
	MOVEM	T2,I.NAM(T1)
	MOVSI	T2,'PLT'	;DEFAULT EXT
	SKIPN	I.EXT(T1)
	HLLZM	T2,I.EXT(T1)
	MOVSI	T2,(Z PC,)	;SET REAL CHAN
	MOVEM	T2,I.CHN(T1)
	MOVSI	T2,POB		;OUTPUT BUFFER HEADER
	MOVEM	T2,I.BUF(T1)
	MOVE	T2,VERNUM	;GET VERSION#
	SKIPN	I.VER(T1)	;ALREADY SET BY SWITCH
	MOVEM	T2,I.VER(T1)
;NOW TO SEE IF WE USE PLT OR LPT SIMULATOR
	PUSHJ	P,DVCHK.##	;GET DEVCHR WORD
	MOVE	T2,IO.CHR	;...
	TXNE	T2,DV.DSK	;TEST FOR NUL:
	JRST	.+3
	TXNE	T2,DV.LPT!DV.TTY	;NEED TO SIMULATE?
	JRST	LPTPLT		;YES
	MOVEI	T2,.IOIBN	;REAL PLOTTER USES MODE 13
	MOVEM	T2,I.MOD(T1)
	DMOVE	T1,PLTTBL	;GET DEFAULTS
	SKIPN	PLTTAB		;AND SETUP IF NOT ALREADY
	MOVEM	T1,PLTTAB	; BY SWITCHES
	SKIPN	PLTTAB+1
	MOVEM	T2,PLTTAB+1
	MOVE	T1,PLTTBL+2
	SKIPN	PLTTAB+2
	MOVEM	T1,PLTTAB+2
PLTOPN:	PUSHJ	P,DVOPN.##	;OPEN DEVICE
	PUSHJ	P,DVENT.##	;ENTER FILE NAME
	EXCH	P,SAVEP		;USE NEW, LARGER PDL
	HRRZI	FREG,1(P)	;SET UP FRAME PTR
	PUSHJ	P,PLTO.F##	;CALL PLOTTER
	EXCH	P,SAVEP		;PUT P BACK
	PUSHJ	P,DVCLS.##	;CLOSE FILE
	JRST	ENDSAV##	;AND GO BACK TO LNKXIT
SUBTTL	LPT SIMULATION SETUP
LPTPLT:	MOVEI	T2,.IOASL	;LPT USES ASCII LINE
	MOVEM	T2,I.MOD(T1)
	DMOVE	T1,LPTTBL	;GET DEFAUL