Google
 

Trailing-Edge - PDP-10 Archives - bb-bt99m-bb - dnplt.p11
There are 4 other files named dnplt.p11 in the archive. Click here to see a list.
.SBTTL  DNPLT - PLOTTER ROUTINES  28 MAR 79

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

VRPLT=005			;FILE EDIT NUMBER

.IF NE PLTN

DB.PEN=DB.IDR		;LOC IN DDB TO INDICATE PEN UP/DOWN MOVEMENT

DRESET=0
	DDBGEN	PLT,XY,1,2,<DS.OUT>	;MAKE A DEVICE BLOCK FOR THE PLT

;	DB.DCS - DEVICE CONTROL STATUS BITS
;	000001	;MASTER ERROR

PLTSER:	MOV	#PLTMML,DB.MML(J)	;LARGEST SIZE WE LIKE
	MOVB	#1,DB.DVV(J)		;CONTROLLER TYPE 1
	JSR	PC,DVCCFM		;SEND CONNECT CONFIRM
	JSR	PC,DVXDCS		;SEND STATUS TO THE 10
	TST	DB.DCS(J)
	BNE	60$			;IF TROUBLE WE ARE DONE
	JSR	PC,DVXDRQ		;SEND DATA REQUESTS
	BIT	#DS.ACT,@J		;IS PLOTTER ALREADY GOING?
	BNE	50$			;IF SO WE ARE DONE
	TST	DB.OBF(J)		;IS THERE OUTPUT ?
	BEQ	64$			;IF NOT JUST WAIT
	MOVB	#-5,DB.TIM(J)		;GIVE IT 4-5 SECONDS TO PLOT
	BIS	#DS.ACT,@J		;FLAG DEVICE IS ACTIVE
	CLRB	DB.PEN(J)		;CLEAR PEN MOVEMENT INDICATOR
	BIS	#XY.INE,@DB.HDW(J)	;ENABLE INTERRUPTS
50$:	RTS	PC
60$:	MOVB	#-5,DB.TIM(J)		;CHECK PLOTTER AGAIN IN A WHILE
64$:	BIT	#DS.DSC!DS.DIE,@J	;TIME TO QUIT ?
	BEQ	50$
	JMP	DVCCFM			;SEND DISCONNECT MSG

PLTTIM:	.IF DF ADL11
	TSTB	DB.PEN(J)		;CHECK FOR PEN MOVE WAIT
	BEQ	5$			;IF EQ NO WAIT
	CLRB	DB.PEN(J)		;CLEAR PEN WAIT INDICATOR
	BIS	#XY.INE,@DB.HDW(J)	;ENABLE INTERRUPTS
	RTS	PC			;AND RETURN TO SYSTEM TIMER
5$:
.ENDC	;IF DF ADL11
	BIT	#DS.ACT,@J		;WAS PLOTTER NOT READY ?
	BEQ	20$
	TWIDDLE	@DB.HDW(J)		;COUNT TIMES THIS HAPPENS
	BIC	#DS.ACT,@J		;NO LONGER ACTIVE
	BIC	#XY.INE,@DB.HDW(J)	;DISABLE INTERRUPTS
	BIS	#1,DB.DCS(J)		;SET MASTER ERROR BIT ON (NO ERROR BIT ON HARDWARE REG
20$:	JMP	QUEDEV			;QUEUE UP THE DEVICE

DEVINT	PLT,XY

PLTINT:	.IF DF ADL11
	TSTB	DB.PEN(J)		;WAS LAST MOVE PEN UP/DOWN ?
	BEQ	5$			;IF EQ NO
	BIC	#XY.INE,@DB.HDW(J)	;DISABLE INTERRUPTS
	MOVB	#<JIFSEC*8.+99./100.+1>,DB.TIM(J) ;SET TIMER FOR 80 MSEC.
	RESTORE <J>			;RESTORE J REGISTER
	RTI				;RETURN TO INTERRUPTED CODE
5$:
.ENDC	;IF DF ADL11
	SAVE	<R0,R1>
10$:	JSR	PC,DVGBYT		;GET NEXT BYTE TO PLOT
	BR	40$			;WE GOT ONE
	BR	30$			;GOT MESSAGE TYPE
20$:	BIC	#XY.INE,@DB.HDW(J)	;DISABLE INTERRUPTS
	BIC	#DS.ACT,@J		;FLAG NOT ACTIVE
	CLRB	DB.TIM(J)		;RESET TIMER
	JSR	PC,QUEDEV
	BR	90$
30$:	DEC	R0			;DATA ?
	BEQ	10$
	DEC	R0			;DATA WITH EOR ?
	BEQ	10$
.IF EQ DGUTS
	TRAP
.IFF
	CTYMSG	NCL
35$:	JSR	PC,DVGBYT		;GET NEXT BYTE
	BR	35$			;EAT BAD MSG
	BR	30$			;TRY AGAIN WITH NEXT MSG
	BR	20$			;ALL DONE
.ENDC ;.IF EQ DGUTS
40$:					;HERE TO PROCESS DATA CHARACTER
	BIC	#^C77,R0		;ONLY WANT LOW ORDER BITS
	BEQ	10$			;FLUSH NULLS
	CMP	R0,#17			;CHECK FOR PEN UP, DOWN
	BGT	46$
	CMP	R0,#13			;CHECK FOR ILLEGAL CHARS
	BGE	10$			;BETWEEN 13 AND 17
	MOVB	PLTTAB-1(R0),R0		;MOVE CONVERSION VALUE TO PLOTTER
45$:	BMI	10$			;IGNORE ILLEGAL CODES
	MOVB	#-2,DB.TIM(J)		;RESET TIMER
	MOVB	R0,XY.DAT		;PLOT DATA
90$:	RESTORE	<R1,R0,J>
	RTI
46$:	.IIF DF ADL11	COMB	DB.PEN(J) ;SET PEN UP/DOWN MOVE INDICATOR
	CMP	R0,#20			;CHECK FOR PEN DOWN
	BNE	47$			;NOT PEN DOWN
.IIF DF ADL11,	MOV	#12,R0		;PEN DOWN CONVERSION CODE
	BR	45$			;PLOT VALUE
47$:
.IIF DF ADL11,	MOV	#11,R0		;DEFAULT TO PEN UP
.IIF NDF ADL11,	MOV	#40,R0		;DEFAULT TO PEN UP
	BR	45$			;PLOT VALUE

PLTTAB:
.IF NDF ADL11
	.BYTE	10,4,-1,1,11,5,-1,2,12,6
.ENDC ;IF NDF ADL11
.IF DF ADL11
	.BYTE	4,0,-1,2,3,1,-1,6,5,7
.ENDC ;IF DF ADL11
.ENDC;.IF NE PLTN