Google
 

Trailing-Edge - PDP-10 Archives - BB-Y393I-SM - monitor-sources/lpfedv.mac
There are 49 other files named lpfedv.mac in the archive. Click here to see a list.
;<4-1-FIELD-IMAGE.MONITOR>LPFEDV.MAC.2, 25-Feb-82 20:29:16, EDIT BY DONAHUE
;UPDATE COPYRIGHT DATE
; UPD ID= 400, FARK:<4-WORKING-SOURCES.MONITOR>LPFEDV.MAC.2,  15-Feb-81 17:35:33 by ZIMA
;Edit 1832 - move 1824 into device dependent code.
;<4.MONITOR>LPFEDV.MAC.4,  3-Jan-80 08:09:28, EDIT BY R.ACE
;UPDATE COPYRIGHT DATE
;<4.MONITOR>LPFEDV.MAC.3, 12-Apr-79 21:02:17, Edit by MCLEAN
;IF DTEQ FAILS SET HARD ERROR
;<4.MONITOR>LPFEDV.MAC.2,  4-Mar-79 18:15:21, EDIT BY KONEN
;UPDATE COPYRIGHT FOR RELEASE 4


;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
;  OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
;
;COPYRIGHT (C) 1976,1977,1978,1979,1980,1981,1982 BY DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

; FRONT-END DEVICE DEPENDENT CODE FOR THE LINE PRINTER
; (LP20 - DTE20 SERVICE) SPECIFIC CODE.




; LINE PRINTER DEVICE DISPATCH TABLE

FELPVT:	IFIW!FESFLO		;SEND FLUSH
	IFIW!FESLOP		;PAGE COUNTER
	IFIW!FESACK		;ACK
	IFIW!FESDTA		;SEND DATA
	IFIW!FESEOF		;EOF
	IFIW!FESNDS		;STRING DATA
	IFIW!FETGLP		;SEND STATUS
	IFIW!R			;RESTART
	IFIW!R			;INITALIZE
	IFIW!R			;INTERRUPT CHECK
;**;[1832] Add one line at FELPVT: +10L	JGZ	15-FEB-81
	IFIW!R			;[1832] OPEN
   IFN <.-FELPMX>-FELPVT,<PRINTX %%INVALID DEVICE DEPENDENT TABLE SIZE>

; Line printer dispatch table

;FIRST THE  PROTOCOL VECTOR

	RESCD
LPTDTV::0			; NO STRING DATA
	LPTDON			; ACK
	LPTTLS			; STATUS
	LPTSLA			; SET LINE ALLOCATION
	LPTSER			; SYSERR ENTRY
	LPTRLD			; -11 RELOAD
	SWAPCD
; ROUTINE TO SEND A FLUSH TO THE -11

FESFLO:	HRRZ A,MSTRDT		;GET MASTER DTE NUMBER
	MOVE B,[.DFFDO,,.FELPT]	;FUNCTION IS FLUSH OUTPUT, DEVICE IS LPT
	SETZM C			;LOCAL DATUM IS LINE NUMBER
	MOVEI D,(U)		;GET UNIT NUMBER
	CALL DTEQ		;ASK -11 TO FLUSH LPT OUTPUT
	 JRST [	SETONE LPTHE,(U) ;ERROR IF THIS FAILS
		RET]
	RET			;RETURN
	RESCD
FESLOP:	HRRZ A,MSTRDT		;GET MASTER DTE NUMBER
	MOVE B,[.DFSDO,,.FELPT]	;FUNCTION IS SPECIAL OPERATION, DEVICE IS LPT
	MOVSI C,(U)		;GET UNIT NUMBER
	HRRI C,4		;FOUR BYTES OF INFORMATION
	MOVSI D,(POINT 8,)	;GET SIZE AND POSITION PART OF POINTER
	HRRI D,PGDATA(U)	;GET ADDRESS FIELD OF POINTER TO DATA PACKET
	CALLRET DTEQ		;SEND PAGE COUNTER STUFF TO -11, AND RETURN
; ROUTINE TO SEND AN ACK TO THE FRONT-END

FESACK:	HRRZ A,MSTRDT		;GET DTE NUMBER OF MASTER DTE
	MOVE B,[.DFLBE,,.FELPT]	;ACK FUNCTION, TO LINE PRINTER
	SETZM C			;CLEAR COUNT
	MOVEI D,(U)		;UNIT NUMBER
	CALL DTEQ		;GO SEND ACK TO FRONT-END
	 JRST [	SETONE LPTHE,(U) ;ERROR IF THIS FAILS
		RET]
	RET			;RETURN
FESDTA:	HRRZ A,MSTRDT		;GET  MASTER DTE NUMBER
	HRLI A,LODDON		;GET POSTING ADDRESS
	HRRI B,.FELPT		;GET DEVICE CODE (LPT)
	MOVSI C,(U)		;GET UNIT NUMBER
	HRR C,D			;GET COUNT FROM SIN
	HRLI D,(POINT 8,)	;GET SIZE, POSITION PART OF POINTER
	HRR D,LPTRLP(U)		;GET ADDRESS PART OF POINTER
	OPSTR <SKIPN>,ALTP,(U)	;USING ALTERNATE BUFFER FOR LPT DATA ?
	ADDI D,NLPBF		;NO, SO VFU OR RAM DATA IS IN ALTERNATE BUFFER
	CALLRET DTEQ		;SEND DATA TO -11 FOR LPT
FESEOF:	HRRZ A,MSTRDT		;GET MASTER DTE NUMBER
	MOVE B,[.DFSTS,,.FELPT]	;SET DEVICE STATUS
	MOVSI C,0(U)		;UNIT
	HRRI C,2		;COUNT OF BYTES
	MOVE D,[POINT 8,[BYTE (16) .DVFEF]]
	CALL DTEQ		;DO IT
	 JRST [	SETONE LPTHE,(U) ;ERROR IF THIS FAILS
		RET]
	RET			;RETURN
FESNDS:	MOVSI A,LPTINT		;POSTING ADDRESS
	MOVE B,[.DFHSD,,.FELPT]	;STRING DATA TO THE LPT
	MOVSI C,0(U)		;UNIT
	HRR C,F			;GET COUNT
	TXO C,DTBYTM		;GUARANTEE BYTE MODE TRANSFERS
	MOVE D,LPTCCW(U)	;BUFFER ADDRESS
	CALLRET DTEQ		;GO DO RETUEST
;ROUTINE TO ASK FOR THE LPT STATUS

FETGLP:	MOVE A,MSTRDT		;THE MASTER
	MOVE B,[.DFRDS,,.FELPT]	;SEND STATUS
	MOVSI C,0(U)		;UNIT NUMBER. DIRECT
	MOVEI D,0(U)		;THE UNIT
	CALL DTEQ		;REQUEST STATUS
	JRST [	SETONE LPTHE,(U) ;ERROR IF IT FAILS THIS WILL UNHANG ANY WAITS
		RET]
	RET			;DONE
; ROUTINE TO INDICATE THAT A HARD ERROR OCCURRED WHEN AN -11 IS RELOADED
; CALLED FROM DTE SERVICE

LPTRLD:	CAME A,MSTRDT		;IS THIS THE MASTER -11?
	RET			;NO.
	SAVET			;PRESERVE TEMPORARY ACS
	MOVSI A,-LPTN		;GET # OF PRINTERS TO DO

LPTRL2:	SETONE LPRLD,(A)	;MARK THAT THIS FRONT END WAS RELOADED
	MOVEI B,(A)		;GET UNIT NUMBER
	CALL SETER2		;TURN ON HARD ERROR FOR THIS PRINTER
	AOBJN A,LPTRL2		;LOOP OVER ALL PRINTERS
	RET			;RETURN TO DTE SERVICE


;ROUTINE CALLED BY THE PROTOCOL SERVICE TO DETERMINE THE OWNING
;PROCESS FOR A LPT. CALL IS:
;	B/ UNIT,,DEVICE-CODE
;RETURN IS:
;	+1/ WON'T HAPPEN FOR THIS DEVICE
;	+2/ WITH A=OWNING PROCESS ID (OR -1 IF UNASSIGNED)

LPTSER:	HLRZS B			;GET UNIT
	JE LPOPN,(B),[		;OPNENED?
		MOVEI A,-1	;NO. SAY IS UNASSIGNED
		RETSKP]		;AND DONE
	LOAD A,LPFRK,(B)	;YES. GET ID OF OWNER
	RETSKP			;AND DONE

	RESCD
;ROUINE TO SET LPT ALLOCATION
;	B/ALLOCATION
;	C/UNIT

LPTSLA::EXCH B,C		;SET UP ARGS
	JSP CX,CHKLPT		;GO VERIFY ARGS
	STOR C,LPTMX,(B)	;SET IT
	RET			;AND DONE
;ROUTINES TO DO DTE POSTING

;ROUTINE TO HANDLE ACK

LPTDON::JSP CX,CHKLPT		;MAKE SURE IS VALID LPT
	JUMPL B,DONALL		;IF NEGATIVE, GO ACK THEM ALL
	SETZRO LPTFE,(B)	;CLEAR BYTE COUNT
	JE LPTBL,(B),R		;DID A DTEQ FAIL?
	SETZRO LPTBL,(B)	;CLEAR BLOCK INDIACTOR
	SETZ A,			;FAKE INT WITH NO CHARS SENT
	CALL LPTINT		;TRY SENDING IT AGAIN
	RET			;AND DONE

;HERE IF WE ARE TO ACK ALL LPTS

DONALL:	STKVAR <SAVEE>
	MOVSI C,-LPTN		;DO ALL LPTS
DONAL1:	MOVEM C,SAVEE
	MOVEI B,0(C)		;UNIT
	CALL LPTDON		;GO ACK THIS GUY
	MOVE C,SAVEE
	AOBJN C,DONAL1		;DO ALL OF THEM
	RET			;AND DONE
	TNXEND
	END