/1 PTR/PTP HANDLER FOR LOW SPEED
/
/
/
/
/
/
/
/
/
/COPYRIGHT  (C)  1974,1975 BY DIGITAL EQUIPMENT CORPORATION
/
/
/
/
/
/
/
/
/
/
/THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT NOTICE
/AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
/CORPORATION.  DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY
/FOR ANY ERRORS THAT MAY APPEAR IN THIS DOCUMENT.
/
/THE SOFTWARE DESCRIBED IN THIS DOCUMENT IS FURNISHED TO THE PURCHASER
/UNDER A LICENSE FOR USE ON A SINGLE COMPUTER SYSTEM AND CAN BE COPIED
/(WITH INCLUSION OF DIGITAL'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH
/SYSTEM, EXCEPT AS MAY OTHERWISE BE PROVIDED IN WRITING BY DIGITAL.
/
/DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY FOR THE USE
/OR RELIABILITY OF ITS SOFTWARE ON EQUIPMENT THAT IS NOT SUPPLIED BY
/DIGITAL.
/
/
/
/
/
/
/
/
/
/
	*0
	-2
DEVICE KS33;DEVICE PTP;1020;0;ZBLOCK 2
DEVICE KS33;DEVICE PTR;2010;110;ZBLOCK 2

	VERSION="A&77

	*200
PTP,	VERSION
	CLA CLL CML	/SET LINK ON TO INDICATE PUNCH
	JMS PSETUP	/DO COMMON CRAP
PTPLP,	KSF
	JMP PTPCNT	/KEYBOARD FLAG OFF - DON'T WORRY ABOUT ^C
	KRS
	AND PTP177
	TAD PTPM3
	SZA CLA	/IS THERE A ^C IN THE TTY BUFFER?
	JMP PTPCNT	/NO
PTPCIF,	CDF CIF 0
	JMP I PT7600
PTPCNT,	TAD I PTPCA
	JMS PTPPCH	/FIRST CHAR IN LOW ORDER 8 BITS OF WORD 1
	DCA PTR
	ISZ PTPCA
PT7700,	7700
	TAD I PTPCA
	JMS PTPPCH	/SECOND CHAR IN LOW ORDER 8 BITS OF WORD 2
	CLL RTR
	RTR
	TAD PTR
	RTR
	RTR	/THIRD CHARACTER NOW IN AC
	JMS PTPPCH
PTPEND,	ISZ PTPCA
PT70,	70	/JUST IN CASE WERE PUNCHING PG 7600 KEEP THIS LITERAL HERE
	JMP PTPISZ
PSETUP,	0
	RDF	/GET FIELD OF CALLING PROGRAM
	TAD PTPCIF
	DCA PTPXIT	/SET UP RETURN SEQUENCE
	TAD I PTP
	AND PT70
	TAD PCDF
	DCA PTPCDF
	RAR		/GET LINK(1=PTP,0=PTR)
	TAD I PTP	/GET FUNCTION WORD
	ISZ PTP
	SPA		/CHECK CORRECT MODE
	JMP PTPERR	/SIGNAL "UNRECOVERABLE DEVICE ERROR"
	AND PT7700
	CMA		/SET UP -(WORD COUNT)/2-1
	DCA PTPWC
	TAD I PTP	/SET UP STARTING ADDRESS
	ISZ PTP
	DCA PTPCA
	TAD I PTP
PTPCDF,	0		/SET DATA FIELD TO ACCESS BUFFER
	PTPEOF=PTPCDF
	SNA CLA
	SZL
	JMP PTPISZ
	TAD PTP336	/INPUT INITIALIZATION - TYPE "^" AND WAIT
	TLS
	KSF
	JMP .-1
PT7600,	7600
PTPISZ,	ISZ PTPWC
	JMP I PSETUP	/LOOP FOR BUFFER SIZE (128 WORDS)
PTPRTN,	TAD PTPEOF
	SZA CLA		/DID WE RUN OUT OF TAPE?
	ISZ PTP
	ISZ PTP
PTPXIT,	HLT	/EXIT CDF GOES HERE
	JMP I PTP
PTPPCH,	0
	TLS
	TSF		/NOTICE THE GLORIOUS LACK OF OVERLAP
	JMP .-1
	AND PT7400
	JMP I PTPPCH
PTPCA,	0
PTR,	VERSION		/*** CORRECT ENTRY IN MAIN ASSEMBLY IF THIS IS MOVED!
	CLA CLL
	TAD PTR
	DCA PTP
	JMS PSETUP	/SET UP ADDRESS, COUNT, FIELDS
PTRLP,	JMS PTRGCH	/READ FIRST CHARACTER OF 3
	DCA I PTPCA
	JMS PTRGCH
	DCA PTPPCH
	JMS PTRGCH
	RTL
	RTL
	DCA PTR
	TAD PTR
	AND PT7400
	TAD I PTPCA
	DCA I PTPCA	/HIGH ORDER 4 BITS INTO WORD 1
	TAD PTR		/GET THE CHAR FROM THE PTR BUFFER
	RTL
	RTL
	AND PT7400
	TAD PTPPCH
	ISZ PTPCA
PT7400,	7400
	DCA I PTPCA	/LOW ORDER 4 BITS INTO WORD 2
	JMP PTPEND
PTRGCH,	0
	TAD PTPEOF
	SNA CLA
	JMP I PTRGCH
	CLA CLL CMA RTL		/-3
	DCA PTPEOF
	DCA PTR
PTTIME,	ISZ PTR		/TIMEOUT LOOP FOR LOW SPEED READER
	JMP PTP232
	ISZ PTPEOF	/TIMES OUT IN 132 MS(PDP 8/E) OR 205 MS(PDP 8)
	JMP PTP232
	TAD PTP232
	JMP I PTRGCH	/OVERFLOWED - PTPEOF IS NOW 0, RETURN ^Z
PTP232,	232		/WASTE SOME TIME
PTP177,	177
	KSF
	JMP PTTIME	/READER NOT READY - CONTINUE TIMEOUT
	KRB
	JMP I PTRGCH	/RETURN WITH CHARACTER
PTPERR,	CLA CLL CML RAR	/SIGNAL A "PERMANENT I/O ERROR" ON THE DEVICE
	JMP PTPXIT-2
PCDF,	CDF 0
PTP336,	336
PTPWC,	0
PTPM3,	-3
$$$$$$$

