	.SYSID <	.TITLE PPC. >,< 101>
/
/COPYRIGHT (C) 1975
/DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
/
/THIS SOFTWARE IS FURNISHED UNDER A LICENSE FOR USE ONLY
/ON A SINGLE COMPUTER SYSTEM AND MAY BE COPIED ONLY WITH
/THE INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS
/SOFTWARE, OR ANY OTHER COPIES THEREOF, MAY NOT BE PRO-
/VIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON
/EXCEPT FOR USE ON SUCH SYSTEM AND TO ONE WHO AGREES TO
/THESE LICENSE TERMS.  TITLE TO AND OWNERSHIP OF THE
/SOFTWARE SHALL AT ALL TIMES REMAIN IN DEC.
/
/THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE
/WITHOUT NOTICE AND SHOULD NOT BE CONSTRUED AS A COM-
/MITMENT BY DIGITAL EQUIPMENT CORPORATION.
/
/DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY
/OF ITS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.
	.EJECT
/PPC.
/IOPS PAPER TAPE PUNCH HANDLER
/IOPS BINARY ONLY
 
/EDIT # 001	DATE OF LAST EDIT	8.13.71
/ 101	14-JUN-75 (RCHM)	MAKE XVM CHANGES.
 
/CALLING SEQUENCE:
	/CAL+.DAT SLOT (9-17)
	/FUNCTION (12-17)
	/N ARGUMENTS WHERE N IS A FUNCTION OF FUNCTION
	/(NORMAL RETURN)
.MED=3
PSF=700201
PCF=700202
PSA=700204
PLS=700206
PSB=700244
	.GLOBL PPC.
PPC.	DAC PPCAL
	DAC PPBUSY
	ISZ PPCAL
	LAC* PPCAL	/GET FUNCTION
	ISZ PPCAL
	TAD PPTABJ
	DAC PPTAB		/SETUP DISPATCH
PPTAB	XX		/JMP THROUGH TABLES
	JMP PPINIT		/1=.INIT
	SKP		/2=.DELET, .RENAM, .FSTAT
	JMP PPER06		/3=.SEEK
	ISZ PPCAL		/4=.ENTER
	JMP PPOUT		/5=.CLEAR
	JMP PPCLOS		/6=.CLOSE
	JMP PPOUT		/7=.MTAPE
	JMP PPER06		/10=.READ
	JMP PPWRT		/11=.WRITE
	JMP PPWATR	/12=.WAIT OR .WAITR
PPER06	LAW 6		/ILLEGAL FUNCTION /13=.TRAN
	JMP* (.MED+1
PPTABJ	JMP PPTAB
/INIT, WAIT, AND CLOSE PTP ROUTINE
PPINIT	LAC PPCOUJ
	DAC PPIOUT	/INTERRUPT EXIT
	DAC PPIOB	/TURN ON I/O
	ISZ PPCAL
	LAC (64
	DAC* PPCAL		/STANDARD BUFFER SIZE
	ISZ PPCAL	/TO BYPASS ARGS
	CAL		/NO API
PPWPC	16		/.SETUP - WORD PAIR COUNT
PPLBP	PSF		/FIRST DATA WORD
TPTEMP	PTPINT		/TEMP STORAGE
TPWC	LAC .+2		/-WC
TPLBH	DAC .-5		/LBH POINTER
PP5CH	JMP PPEOF		/CHAR COUNT
PPCOUT	DZM PPCLSW		/CLEAR CLOSE SWITCH
	LAC PPEMJ
	DAC TPEOF
PPOUT	ION
	DBR
	XCT .+1
	JMP* PPCAL
PPWATR	LAW 1000
	AND* PPBUSY
	SNA
	JMP PPWAIT	/.WAIT
	LAC PPBUSY	/.WAITR
	AND (700000	/L,XM,MP
	DAC PPBUSY
	LAC* PPCAL	/BUSY ADDRESS
	AND (77777
	XOR PPBUSY
	DAC PPBUSY
	ISZ PPCAL	/TO NON-BUSY
PPWAIT	LAC PPIOB
	SNA
PPOUTJ	JMP PPOUT
PPBXIT	ION
	DBR
	XCT .+1
	JMP* PPBUSY
PPCLOS	LAC PPIOB
	SZA
PPBUSJ	JMP PPBXIT		/BUSY EXIT
	LAC PPCLSW
	SZA
PPCOUJ	JMP PPCOUT		/DONE EXIT
	LAC PPBUSJ
	DAC PPIOUT		/GENERATE WAIT
	LAC PPEOFL		/EOF BUFFER
	DAC TPLBH
	LAC PPEOF		/PUNCH TRAILER
	DAC TPEOF
	LAW -3		/1'S COMP (-2)
	JMP TPSIOB		/IOPS BINARY
PPER07	LAW 7		/ILLEGAL DATA MODE
	JMP* (.MED+1
PPER67	LAW 67			/(RCHM-101) FETCH ERROR NUMBER.
	JMP* (.MED+1)		/(RCHM-101) PRINT ERROR.
PPEOFL	PPEOFB
/WRITE PTP ROUTINE
PPWRT	LAC PPIOB
	SZA
	JMP PPBXIT
	LAC PPOUTJ
	DAC PPIOUT
	LAW 7000		/DATA MODE
	AND* PPBUSY
/GET ARGUMENTS AND SET UP FOR PUNCHING
	SZA
	JMP PPER07
	LAC* PPCAL
	AND (700000)		/(RCHM-101)
	SZA			/(RCHM-101)
	JMP PPER67		/(RCHM-101)
	LAC* PPCAL		/(RCHM-101)
	ISZ PPCAL
	DAC TPLBH
	TAD (2
	DAC PPLBP	/FIRST DATA WORD
	ISZ PPCAL
	777000
	AND* TPLBH		/ZERO DATA MODE (IOPS BINARY)
	DAC* TPLBH
	CLL!CML!CMA
	RTR
	RTR
	RTR
	RTR
TPSIOB	DAC PPWPC	/WORD COUNT (1'S COMP)
	TAD (2
	DAC TPWC
PP7S	LAW -1
	DAC PPIOB		/I/O UNDERWAY.
	DAC PP5CH		/CHAR. COUNTER
PPBCK	ISZ TPWC
	JMP PPCHK
	TAD* TPLBH		/HEADER
	CMA
	ISZ TPLBH
	DAC* TPLBH		/CHECKSUM TO HEADER
	LAC TPLBH	/OUTPUT HEADER
	TAD PP7S
	DAC PPLBP	/FIRST DATA WORD
PPIOBG	IORS
	AND (400	/GET BIT
	SNA
	JMP .+5
	LAC PPIOBJ		/RETURN TO HANDLER
	DAC* (.MED
	LAC (4		/NO TAPE IN PUNCH
	JMP* (.MED+1
/BINARY CHARACTER UNPACKING ROUTINE
	LAW -7		/INIT BIT COUNTER
	DAC PPBITC
	LAC PPBHLD		/REST OF LAST WORD
	ISZ PP5CH
	JMP PPBINA	/WORD BEGUN
	LAW -3	/CHAR COUNT
	DAC PP5CH
	LAC* PPLBP	/GET WORD
	ISZ PPLBP
	ISZ PPWPC
	JMP PPBINA
	JMS PPNULL
TPEOF	JMP PPEMPT
PPEOF	LAW -334
	DAC PPCOUN	/SAVE COUNT
	JMS PPNULL
	ISZ PPCOUN
	JMP .-2
PPEMJ	JMP PPEMPT
PPCHK	TAD* PPLBP		/COMPUTER CHECKSUM
	ISZ PPLBP
	JMP PPBCK
PPBINA	RTL
	RTL
	RTL
	DAC PPBHLD	/SAVE REST OF WORD
	RAL
	AND (77	/MASK OUT CHAR
	DAC PPSAVA	/SAVE C(AC)
	DZM PPONEB
PPARCN	RAR		/NEXT BIT
	SZL
	ISZ PPONEB		/NO. OF ONE BITS
	ISZ PPBITC
	JMP PPARCN
	LAC PPONEB
	RAR	/PUT IN LINK
	LAC PPSAVA	/ORIGINAL CHAR
	SZL
	XOR (100	/PARITY BIT 7
	XOR (200	/BIT 8
	IOF
	PSA
	LAC PPIOBJ
	DAC PPNULL		/INTERRUPT RETURN
PPIOUT	XX	/JMP PTPDIS, JMP PPOUT, JMP PPBXIT
/INTERRUPT HANDLER
PTPINT	DAC PTPAC
	LAC* (0	/PIC RETURN
	DAC PTPOUT
	PCF	/CLEAR FLAG
	ION
	LAC PPTPJP
	DAC PPIOUT
PTPFLY	JMP* PPNULL		/JMP TO LAST PUNCH
PPEMPT	DZM PPIOB	/TURN OFF I/O
PTPDIS	LAC PTPAC
	ION
	DBR
	XCT .+1
	JMP* PTPOUT
PPTPJP	JMP PTPDIS
PPNULL	0	/PUNCH NULL
	IOF
	PSA+10
	XCT PPIOUT
PPIOBJ	PPIOBG
/DEVICE HANDLER REGISTERS
PPIOB	0	/I/O BEGUN INDICATOR
PPBHLD	0	/HOLD BINARY WORD
PPSAVA=TPWC	/SAVE CONTENTS OF AC
PPBITC=TPLBH	/BIT COUNTER
PPONEB=TPTEMP	/ONE BIT STORAGE
PTPAC	0	/INTERRUPT AC
PTPOUT	0	/INTERRUPT EXIT
PPCOUN=TPLBH	/NO OF TIMES PUNCHED
PPCAL	0	/ARG POINTER
PPBUSY	0	/BUSY RETURN - CAL ADDRESS
PPEOFB	001005		/EOF HEADER
PPCLSW	0	/CLOSE EXECUTED SWITCH AND CHECKSUM WORD OF EOF HEADER
	.END
