Google
 

Trailing-Edge - PDP-10 Archives - dec-10-omona-u-mc9 - pltser.mac
There are 10 other files named pltser.mac in the archive. Click here to see a list.
TITLE PLTSER - PLOTTER SERVICE ROUTINE - V034
SUBTTL T. EGGERS/GBH/TNM/RCC	28 SEP 76
	SEARCH	F,S
	$RELOC
	$HIGH
;***COPYRIGHT 1973,1974,1975,1976,1977 DIGITAL EQUIPMENT CORP., MAYNARD, MASS.***
XP VPLTSR,034			;PUT VERSION NUMBER IN STORAGE MAP AND GLOB LISTING

PLTUP==200000		;LIFT PEN WHEN OUTPUT FINISHED

ENTRY PLTSER
PLTSER:


EXTERNAL OUT,SETACT,IOSET,ADVBFE
EXTERNAL SETIOD,STOIOS,CLRACT,ILLINP

INTERN PLTDSP,PLTNXT


;DISPATCH TABLE

EXTERN REGSIZ
	POPJ	P,0		;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,40		;START PLOT WITH PEN UP
	MOVEM	S,DEVIOS(F)
	XCT	PLTDTO##(F)	;START PLOTTER BY SENDING 0 OR 40
	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,40		;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