Google
 

Trailing-Edge - PDP-10 Archives - BB-F494Z-DD_1986 - 10,7/ptrser.mac
There are 6 other files named ptrser.mac in the archive. Click here to see a list.
TITLE PTRSER - PAPER TAPE READER SERVICE ROUTINE FOR PDP-10 - V045
SUBTTL	/GBH/TNM/RCC/DAL  10 SEP 85
	SEARCH	F,S
	$RELOC



;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 VPTRSR,045
		;PUT VERSION NUMBER IN GLOB LISTING AND LOADER STORAGE MAP


ENTRY PTRSER
PTRSER::


;PARAMETER ASSIGNMENTS
;   PTR CONTROL REGISTER
	PTRDON==10		;DONE FLAG
	PTRBSY==20		;BUSY FLAG
	PTRBIN==40		;BINARY READ MODE
	POW==:400		;POWER.  ON==1

;   SPECIAL IO STATUS WORD ASSIGNMENTS
	IODISC==400000
	PTRPOW==100000
;   SPECIAL ASCII CHARACTERS
	RUBOUT==177

;PTR SERVICE DISPATCH TABLE
	JRST	CPOPJ1##	;IF YOU'RE ASKING, IT'S ONLINE
	JRST	ECOD2##		;SPECIAL ERROR STATUS
	JRST	REGSIZ##	;BUFFER LEN CAN BE GOTTEN FROM DDB
	JRST	PTRINI		;INITILIZE
	JRST	PTRREL		;HUNG DEVICE TIME-OUT ERROR.
PTRDSP::JRST	PTRREL		;RELEASE
	JRST	ILLOUT##	;CLOSE CALLED ONLY ON ILLEGAL OUTPUT
	JRST	ILLOUT##	;OUTPUT
PTRIN:	TLNN	S,IOBEG		;INPUT. VIRGIN DEVICE?
	JRST	PTRIN1		;NO
	TLO	S,IOFST		;IOFST:=1. NEXT ITEM WILL BE FIRST ITEM OF A BUFFER
	TLZ	S,PTRPOW+IODISC
	PUSHJ	P,SETBYT##	;TAC0-5:=TAC12-13:=0,TAC6-11:=BYTE SIZE
	MOVEM	T1,PTRPTR##(F)	;PTRPTR:=C(T1)
	XCT	PTRPWR##(F)	;IS POWER ON?
	JRST	[PUSHJ  P,HNGSTP##	;NO - INFORM USER
		JRST	PTRIN]
				;ALWAYS GO ON EVEN IF POW NOT ON IN CASE
				;NULL FILE IS TO BE READ (A FEATURE)
				;NOTE: POW=1 SIGNALS PTR READY FOR INPUT
				;WHEREAS LATER POW=0 SIGNALS END-OF-TAPE & EOF.
	TLO	S,PTRPOW	;YES.  PTRPOW:=1
PTRIN1:	MOVEI	U,PTRBSY
	TLZN	S,IOBEG		;VIRGIN?
	MOVEI	U,PTRDON	;NO
	TLNN	S,PTRPOW
	MOVEI	U,0
	ADD	U,PTRCH##(F)
	LDB	T2,PIOMOD##
	CAIE	T2,IB		;IMAGE BINARY?
	CAIN	T2,B		;OR BINARY?
	IORI	U,PTRBIN
	HRLI	U,PTRDON
	CONO	PI,PI.OFF	;BETTER NOT INTERRUPT (IODISC=1)
	TRO	S,IOACT		;TELL PI-LEVEL THE PTR IS GOING
	MOVEM	S,DEVIOS(F)
	XCT	PTRCNO##(F)	;START IT
	HLRM	U,PTRCON##(F)
	CONO	PI,PI.ON	;TURN ON PI'S
	PJRST	SETHNG##	;SET HUNG TIME AND RETURN
PTRINT::
	XCT	PTRXST##(F)	;STORE CONI STATUS

	SKIPL	DEVIOS(F)	;DISCONNECT REQUEST? (IODISC=1?)
	XCT	PTRDS1##(F)	;PTRSV1:=DATA ITEM
	JSR	PTRSVE##(F)	;SAVE ACCUMULATORS AND ESTABLISH P
	PUSHJ	P,IOSET##	;J=C(DEVCTR)
				;S:=C(PTRIOS)
	MOVE	U,PTRSV1##(F)	;U:=DATA ITEM
	XCT	PTRPWR##(F)	;PTR POWER ON?
	JRST	PTREND		;NO
	TLON	S,PTRPOW	;PTRPOW=1?  PTRPOW:=1
	JRST	PTREX1		;NO
	TLZE	S,IODISC	;DISCONNECT REQUEST?
	JRST	PTREXT		;YES
PTRIN0:	TRNE	S,B		;MODE=BINARY?
	JRST	PTRI0		;YES
	ANDI	U,177		;MASK OUT PARITY BIT
	CAIN	U,RUBOUT	;LAST CHAR A RUBOUT?
	JRST	DPOPJ##		;YES, STORE STATUS(IOS) AND DISMISS INIT
				;DO NOT RESET HUNG TIME OUT
	JUMPE	U,DPOPJ##	;NULL CHAR - DO NOT RESET HUNG TIME OUT

PTRI0:	PUSHJ	P,STODAT##	;NO STORE DATA WORD.
	  JFCL			;CHECKSUM ERROR
	  JRST	PTRI1		;BLOCK FULL OR BLOCK COMPLETE
	JRST	PTREX1		;DATA STORED CORRECTLY.

PTRI1:	PUSHJ	P,ADVBFF##	;ADVANCE BUFFER
	  TRZA	S,IOACT
PTRI2:	TLOA	S,IOFST		;IOFST:=1.  NEXT ITEM IS FIRST ITEM OF A BUFFER.
	TLO	S,IODISC+IOFST	;NEXT BUFFER IS FULL.  IODISC:=1
	PUSHJ	P,SETIOD##	;IOWS:=1
	JRST	PTREX1
;COME HERE WHEN THE READER IS SHUT OFF


PTREND:	TLZ	S,PTRPOW	;PTRPOW:=0
	TRZN	S,IOACT		;SHUTTING DOWN PTR?
	JRST	PTREI1		;YES, JUST GO AWAY
	LDB	T1,PIOMOD##
	TLO	S,IOEND+IOBEG
	CAIE	T1,B		;CHECKSUM BINARY BLOCK MODE?
	JRST	PTREI		;NO.
	TLNN	S,IOFST		;IOFST=1?
	TRO	S,IOIMPM	;NO. BINARY BLOCK INCOMPLETE.
	JRST	PTREI1
PTREI:	PUSHJ	P,STOSQD##	;FINISH THIS BUFFER, STORE WORD COUNT
	  JFCL
	PUSHJ	P,ADVBFF##	;ADVANCE BUFFER
	  JFCL
PTREI1:	PUSHJ	P,PTRREL	;CLEAR PTR AND CONSO FLAG
	PUSHJ	P,RTEVMI##	;RETURN ANY EVM WE MAY OWN
	JRST	PTRI2
;DISCONNECT PTR

PTREXT:	TRNN	S,IOACT		;DEVICE GOING (NEW INPUT DONE)?
	JRST	PTREX0		;NO, SHUT DOWN
	XCT	PTRDTI##(F)	;YES, KEEP ON GOING
	JRST	PTRIN0
PTREX0:	PUSHJ	P,SETIOD##	;JOB IN AN IO WAIT FOR PTR?
				;YES, WAKE UP JOB
	PUSHJ	P,PTRREL	;CLEAR PTR AND CONSO FLAG
	TRZ	S,IOACT		;IOACT:=0

PTREX1:	MOVEM	J,PTRCTR##(F)	;PTRCTR:=C(J)
	JRST	STOIOS##	;STORE S,RESET HUNG DEVICE
				;TIMEOUT COUNT AND DISMISS.

PTRINI:
PTRREL:	MOVEI	U,0		;CLEAR PTR CONTROL
	XCT	PTRCNO##(F)
	HLLZS	PTRCON##(F)	;CLEAR CONSO FLAG
	POPJ	P,

	END