Google
 

Trailing-Edge - PDP-10 Archives - custsupcuspmar86_bb-x130b-sb - pltser.mac
There are 10 other files named pltser.mac in the archive. Click here to see a list.
TITLE PLTSER - PLOTTER SERVICE ROUTINE - V041
SUBTTL T. EGGERS/GBH/TNM/RCC	10 SEP 85
	SEARCH	F,S
	$RELOC
	$HIGH



;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
;  OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
;
.CPYRT<1973,1986>
;COPYRIGHT (C) 1973,1974,1975,1976,1977,1978,1979,1980,1982,1984,1986
;BY DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
;ALL RIGHTS RESERVED.
;
;
; DATE		LOAD	EDIT #
; ----		----	------
;
;
XP VPLTSR,041			;PUT VERSION NUMBER IN STORAGE MAP AND GLOB LISTING

;DATAO BITS
	PEN.UP==40		;LIFT THE PEN
	PEN.DN==20		;LOWER THE PEN
	NEG.X== 10		;ROLL DRUM BACK
	POS.X==  4		;ROLL DRUM FORWARD
	POS.Y==  2		;MOVE CARRIAGE LEFT
	NEG.Y==  1		;MOVE CARRIAGE RIGHT
;CONI BITS
	PLBUSY==20		;PLOTTER IS BUSY
	PLDONE==10		;PLOTTER DONE FLAG
	PLPICH== 7		;PI CHANNEL ASSIGNMENT
PLTUP==200000		;LIFT PEN WHEN OUTPUT FINISHED

ENTRY PLTSER
PLTSER::





;DISPATCH TABLE

	JRST	CPOPJ1##	;IF YOU'RE ASKING, IT'S ONLINE
	JRST	ECOD2##		;SPECIAL ERROR STATUS
	JRST	REGSIZ##	;BUFFER LENGTH CAN BE GOTTEN FROM DDB
	JRST	PLTINI		;INITIALIZE
	JRST	PLTHNG		;HUNG DEVICE ERROR
PLTDSP::JRST	PLTREL		;RELEAS
	JRST	PLTCLS		;CLOSE
	JRST	PLTOUT		;OUTPUT
	JRST	ILLINP##	;INPUT

PLTCLS:	TLO	S,PLTUP		;PLOTTER END FLAG SET
	MOVEM	S,DEVIOS(F)
	JRST	OUT##		;DO AN OUTPUT

PLTINI:
PLTHNG:
PLTREL:	MOVEI	T1,0
	XCT	PLTCNO##(F)	;DEASSIGN PI CHANNEL, CLEAR DONE
	HLLZS	PLTCON##(F)	;REMOVE PLOTTER FROM DEVICE CHAIN
	POPJ	P,

;HERE BEGINS THE "OUTPUT" UUO

PLTOUT:	PUSHJ	P,PLTSET	;SETUP BYTE POINTER AND COUNTER
	PUSHJ	P,SETACT##	;SET DEVICE ACTIVE BIT
	TLO	S,IO
	MOVEI	T1,10
	HRRM	T1,PLTCON##(F)	;PUT PLOTTER INTO DEVICE CHAIN
	MOVE	T1,PLTCH##(F)	;GET INTERRUPT CHANNEL
	XCT	PLTCNO##(F)	;ASSIGN PRIORITY CHANNEL
	TLZE	S,IOBEG		;FIRST OUTPUT UUO?
	TLZA	S,PLTUP		;YES, INIT "CLOSE" BIT
	TDZA	T1,T1		;NO, 1ST PLOT CHAR IS ZERO
	MOVEI	T1,PEN.UP	;START PLOT WITH PEN UP
	MOVEM	S,DEVIOS(F)
	XCT	PLTDTO##(F)	;START PLOTTER BY SENDING PEN.UP OR A NO-OP
	POPJ	P,
;FROM HERE THROUGH PLTOFF IS INTERRUPT SERVICE

PLTNXT::	;THE PLOTTER CODE IN COMDEV TAKES CARE OF PLOTTER
		;DATA INTERRUPTS THAT REQUIRE ONLY A CHARACTER THAT
		;IS READILY AVAILABLE. TO ADVANCE BUFFERS OR SHUT
		;DOWN THE PLOTTER, THE CODE HERE FOLLOWING IS CALLED.

	PUSHJ	P,IOSET##	;SETS UP R AND S
	PUSHJ	P,ADVBFE##	;ADVANCE AND LOOK AT NEXT BUFFER
	  JRST PLTOFF		;NO MORE DATA AVAILABLE
	PUSHJ	P,PLTSET	;SETUP BYTE POINTER AND COUNTER
PLT2:	PUSHJ	P,SETIOD##	;LET JOB START AGAIN
	JRST	STOIOS##	;EVENTUALLY DISMISS INTERRUPT. IF ADVBFE
				;FOUND MORE DATA (IT SKIPPED), ANOTHER
				;INTERRUPT WILL IMMEDIATELY OCCUR BUT
				;IT WILL BE HANDLED WITHOUT GOING TO PLTNXT

PLTOFF:	PUSHJ	P,PLTREL	;SHUT DOWN PLOTTER
	TRZ	S,IOACT
	MOVEI	T1,PEN.UP	;PEN UP COMMAND
	TLZE	S,PLTUP		;HAS THE "CLOSE" BEEN DONE?
	XCT	PLTDTO##(F)	;YES, LIFT PEN
	JRST	PLT2

;THIS SUBROUTINE CALCULATES A BYTE POINTER AND A BYTE COUNTER FOR
;THE BUFFER TO BE OUTPUT.

PLTSET:	MOVEI	T1,@DEVOAD(F)	;GET ADDRESS OF CURRENT BUFFER
	ADD	T1,[POINT 6,1,35]	;CONVERT TO 6 BIT BYTE POINTER WITH
				;ADDRESS OF BUFFER WORD COUNT
	TRNN	S,16		;IS THIS A TEXT DATA MODE?
	TLO	T1,(POINT 7,0,35)	;YES, CONVERT TO 7 BIT BYTE POINTER
	MOVEM	T1,PLTPTR##(F)	;SAVE BYTE POINTER
	HRRZ	T1,@T1		;GET BUFFER WORD COUNT
	MOVEM	T1,DEVCTR(F)	;SAVE AS POSITIVE WORD COUNT
	MOVEI	T1,6		;IMAGE OR BIN MODES - 6 BYTES/WORD
	TRNN	S,16		;IS OUTPUT A TEXT MODE (0 OR 1)?
	MOVEI	T1,5		;YES, 5 BYTES/WORD
	IMULM	T1,DEVCTR(F)	;CHANGE WORD COUNT TO BYTE COUNT
	POPJ	P,		;RETURN

	LIT
PLTEND:	END