Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-02 - decus/20-0043/lpt8.pal
There are 2 other files named lpt8.pal in the archive. Click here to see a list.
/LPT-PLT
/PROGRAM TO CONTROL THE LP08 LINE PRINTER AND PLOTTER
/WHEN SWITCH  0 IS SET, ALL ASCII CHARACTERS GO TO THE LINE PRINTER
/WHEN SWITCH 1 IS SET, ALL CHARACTERS ARE DECREMENTED BY 40 AND THE
/LOW ORDER 6 BITS ARE USED AS COMMANDS FOR THE PLOTTER.
/	1 = PEN RIGHT
/	2 = PEN LEFT
/	4 = DRUM DOWN
/	10= DRUM UP
/	20= PEN DOWN
/	40= PEN UP

/IF SWITCH 11 IS SET, THEN THE PROGRAM INITIALIZES ALL DEVICES AND TMSR
/ AND WAITS FOR A RELOAD COMMAND.

/WHEN LOADING LPT8 FROM THE PDP-10 WITH LOAD8, MAKE SURE SWITCH 11 IS
/ SET. IF SWITCH 1 IS NOT SET THE MONITOR MAY BE OVERWRITTEN.
	LSR=6663	/SKIP ON LPT NOT READY
	LSF=6661	/SKIP ON DEMAND CHARACTER FLAG
	LPC=6666	/LOAD LPT BUFFER FROM AC AND CLEAR FLAG

	CHAR=175	/CHAR TO BE SENT OUT
	SEND10=174	/SEND A CHAR TO PDP-10
	TYPE8=173	/TYPE A CHAR ON THE PDP-8
	DISMIS=172	/DISMISS INTERRUPT
	CHAIN=171	/INTERRUPT CHAIN

*100
	JMP I 170
*170
	100

*200

LPINIT,	CLA CLL
	TAD M80
	DCA COLUMN
	DCA CHRCNT	/CLEAR CHARACTER COUNT
	TAD CHRIPT
	DCA CHROPT	/INITIALIZE BUFFER POINTERS
	TAD CPTINT	/SET UP PT08 CHARACTER INTERCEPT
	DCA 177
	PLCF
	DCA PLTFLG
	TAD CPLTIN
	DCA CHAIN
	LPC
LPWAIT,	JMS CHKST	/SEE IF ITS TIME TO EXIT
	CLA OSR		/READ SWITCHES
	AND C6000
	SNA		/SWITCH 0 ON?
	JMP LPW1	/NO, SEND ALL OUTPUT TO TTY
	AND C4000
	SNA CLA
	JMP PLTWAT	/THIS IS DATA FOR THE PLOTTER
	LSR		/ERRORS?
	LSF		/WAITING FOR DATA?
	JMP LPWAIT	/NO
LPW1,	JMS GETCHR	/GO GET A CHARACTER
	JMP CHKESC
GETCHR,	0		/ROUTINE TO GET A CHARACTER FROM PDP-10
GETCH1,	CLA CLL		/OR WAIT FOR ONE TO ARRIVE
	TAD CHRCNT
	SNA CLA		/WAIT FOR A CHARACTER TO ARRIVE
	JMP GETCH1	/NO CHARACTERS IN BUFFER
	IOF		/NO INTERRUPTS HERE
	CLA CMA		/-1
	TAD CHRCNT
	DCA CHRCNT	/DECREMENT CHARACTER COUNT
	TAD MXONCT	/CHECK IF XON NEEDED
	TAD CHRCNT
	SNA CLA
	JMP SNDXON	/YES, GO SEND ONE
RETXON,	ISZ CHROPT
	TAD CHROPT
	TAD MCHEND
	SZA CLA		/TIME TO WRAP AROUND?
	JMP .+3
	TAD CHRBEG	/YES GET BEGINNING OF BUFFER
	DCA CHROPT
	TAD I CHROPT	/GET CHAR
	DCA CHAR
	JMS CHKST
	OSR CLA
	AND C6000
	SNA CLA		/STILL GOING TO LPT?
	JMP TTYOUT	/NO
	TAD CHAR
	ION
	JMP I GETCHR

TTYOUT,	JMS I TYPE8	/GO SEND OUT CHAR
	NOP
	ION
	JMP GETCH1	/WAIT FOR ANOTHER CHARACTER

SNDXON,	TAD C21
	DCA CHAR	/LOAD CHAR WITH A XON
	JMS I SEND10
	NOP
	CLA CLL
	JMP RETXON
STOCHR,	0		/ROUTINE TO STORE A CHARACTER
	CLA CLL
	TAD CHRCNT
	TAD MCHMAX	/OVERFLOW?
	SMA
	JMP I STOCHR	/YES, IGNORE IT
	TAD XOFFCT
	SMA CLA		/TIME TO SEND XOFF
	JMP SNDXOF	/YES
RETXOF,	ISZ CHRIPT
	TAD MCHEND
	TAD CHRIPT
	SZA CLA		/WRAP AROUND TIME
	JMP .+3		/NO
	TAD CHRBEG
	DCA CHRIPT
	TAD CHR		/GET CHAR
	DCA I CHRIPT	/STORE IT IN BUFFER
	ISZ CHRCNT
	JMP I STOCHR

SNDXOF,	TAD C23		/GET XOFF
	DCA CHAR
	JMS I SEND10
	NOP
	CLA CLL
	JMP RETXOF

CHRCNT,	0
MCHMAX,	-CHBFLN
XOFFCT,	10
MXONCT,	-10
CHRIPT,	CHRBUF-1
CHROPT,	CHRBUF-1
MCHEND,	-CHRBUF-CHBFLN
CHRBEG,	CHRBUF
CHR,	0
C177,	177
C40,	40
C21,	21
C4000,	4000
CPTINT,	PTYINT
CPLTIN,	PLTINT

CHRBUF=1000
CHBFLN=200
*400
PARCHK,	0		/CHECK THE PARITY
	CLA CLL
	DCA BITCNT
	TAD M8
	DCA PLCNT
	TAD CHAR
PLOOP,	RAR
	SZL
	ISZ BITCNT
	ISZ PLCNT
	JMP PLOOP
	CLA CLL
	TAD BITCNT
	RAR
	SZL CLA
	ISZ PARERR	/BAD PARITY, COUNT ERROR WORD
	NOP
	JMP I PARCHK

M8,	-10
BITCNT,	0
PLCNT,	0
PARERR,	0

CHKST,	0		/CHECK FOR SWITCH 11 BEING TURNED ON
	CLA OSR		/IF ON INITIALIZE DEVICES AND TMSR
	RAR
	SNL CLA
	JMP I CHKST
	DCA 177
	ION
LOOP,	CLA OSR
	RAR
	SZL CLA
	JMP LOOP
	PLCF
	TAD DISMIS	/INIT CHAIN LOCATION
	DCA CHAIN
	JMP I 170

LPSTRT,	CLA CLL
	TAD CLPINI
	DCA 170
	JMP LOOP

CLPINI,	LPINIT
CHKESC,	TAD M24		/ASCII 24 IS AN ESCAPE, DONT SEND IT OR NEXT TO LPT
	SNA
	JMP ESCAPE
	IAC
	SNA
	TAD M11
	TAD C23
	LPC		/SEND IT OUT
	JMP LPWAIT

M24,	-24
M11,	-11
C23,	23
C13,	13
M177,	-177

ESCAPE,	JMS GETCHR
	TAD M177
	SNA
	JMP ESCAPE
	TAD C177
	IOF
	DCA CHAR
	JMS I TYPE8
	NOP
	ION
	JMP LPWAIT

PTYINT,	TAD CHAR	/READ CHAR, CONVERT TO UPPER CASE, THEN STORE IN BUFFER
	AND C177
	DCA CHR
	TAD CHR
	TAD M140
	SPA
	JMP UCC
	TAD M35
	SMA SZA CLA
	JMP UCC
	TAD CHR
	TAD M40
	DCA CHR
UCC,	CLA CLL
	JMS PARCHK	/CHECK PARITY
	JMS COLCNT	/IF COLUMN COUNT IS OVER 80, ADD CR-LF
	JMS STOCHR	/STORE CHARACTER IN BUFFER
	JMP I DISMIS

M40,	-40
M35,	-35
COLCNT,	0		/COUNT COLUMNS
	CLA CLL
	TAD CHR
	TAD M12
M140,	SZA CLA
	JMP .+3
COLCN1,	TAD M80
	DCA COLUMN
	ISZ COLUMN
	JMP I COLCNT
	TAD CHR		/OVERFLOWED COLUMN, ADD CR-LF
	DCA TEMP
	TAD C15
	DCA CHR
	JMS STOCHR
	NOP
	CLA
	TAD C12
	DCA CHR
	JMS STOCHR
	NOP
	CLA
	TAD TEMP
	DCA CHR
	JMP COLCN1

TEMP,	0
COLUMN,	0
M80,	-120
C12,	12
C15,	15
M12,	-12

*600
/PLOTTER ROUTINES

	PLSF=6501
	PLCF=6502
	PLPU=6504
	PLPR=6511
	PLDU=6512
	PLDD=6514
	PLPL=6521
	PLUD=6522
	PLPD=6524

PLTWAT,	JMS PLTW	/GO GET A CHARACTER FOR PLOTTER
PLTWT1,	JMS GETCHR
	TAD M177
	SNA
	JMP PLTWT1
	TAD C177
	TAD M24
	SNA
	JMP ESCAPE
	TAD C24
	TAD M40
	SPA
	JMP PLTWT1	/IGNORE CONTROL CHARACTERS
	AND C77
	RAR
	SZL
	JMS PR		/PEN RIGHT
	RAR
	SZL
	JMS PL		/PEN LEFT
	RAR
	SZL
	JMS DD		/DRUM DOWN
	RAR
	SZL
	JMS DU		/DRUM UP
	RAR
	SZL
	JMS PD		/PEN DOWN
	RAR
	SZL
	JMS PU		/PEN UP
	JMP PLTWAT
PLTW,	0		/WAIT FOR PLOTTER TO FINISH COMMAND
	DCA TEMP
PLTW1,	JMS CHKST
	CLA OSR
	AND C6000
	SNA
	JMP PLTWT1
	AND C4000
	SZA CLA
	JMP LPWAIT
	TAD PLTFLG
	SZA CLA
	JMP PLTW1	/IGNORE NULLS
	TAD TEMP
	JMP I PLTW

PLTINT,	CLA CLL		/CLEAR PLOTTER FLAG AND DISMISS
	DCA PLTFLG
	PLCF
	JMP I DISMIS
PR,	0
	ISZ PLTFLG
	PLPR
	JMS PLTW
	JMP I PR

PL,	0
	ISZ PLTFLG
	PLPL
	JMS PLTW
	JMP I PL

DD,	0
	ISZ PLTFLG
	PLDD
	JMS PLTW
	JMP I DD

DU,	0
	ISZ PLTFLG
	PLDU
	JMS PLTW
	JMP I DU

PD,	0
	ISZ PLTFLG
	PLPD
	JMS PLTW
	JMP I PD

PU,	0
	ISZ PLTFLG
	PLPU
	JMS PLTW
	JMP I PU

PLTFLG,	0
C77,	77
C24,	24
C6000,	6000

*170
	LPSTRT
$