Google
 

Trailing-Edge - PDP-10 Archives - BB-4170G-SM - sources/lpfedv.mac
There are 49 other files named lpfedv.mac in the archive. Click here to see a list.
;<3A.MONITOR>LPFEDV.MAC.1, 24-Mar-78 14:36:07, EDIT BY MILLER
;USE MSTRDT FOR ALL DTE NUMBERS
;<3.SM10-RELEASE-3>LPFEDV.MAC.13, 22-Feb-78 18:44:34, EDIT BY MILLER
;ADD RESCD SO MOST OF CODE IS RESIDENT
;<3.SM10-RELEASE-3>LPFEDV.MAC.12, 12-Feb-78 23:30:56, Edit by MCLEAN
;<1MCLEAN>LPFEDV.MAC.11,  8-Feb-78 22:48:37, Edit by MCLEAN
;<1MCLEAN>LPFEDV.MAC.10,  8-Feb-78 16:09:36, Edit by MCLEAN
;<1MCLEAN>LPFEDV.MAC.7,  7-Feb-78 15:25:38, Edit by MCLEAN
;ADD ANOTHER DEVICE DEPENDENT DISPATCH
;<3.SM10-RELEASE-3>LPFEDV.MAC.3,  8-Feb-78 15:46:33, Edit by MCLEAN
;<3.SM10-RELEASE-3>LPFEDV.MAC.2,  8-Feb-78 15:45:32, Edit by MCLEAN
;<3.SM10-RELEASE-3>LPFEDV.MAC.1,  8-Feb-78 15:41:10, Edit by MCLEAN
;<3-MONITOR>LPFEDV.MAC.6,  7-Nov-77 13:03:40, EDIT BY KIRSCHEN
;MORE COPYRIGHT UPDATING...
;<3-MONITOR>LPFEDV.MAC.5, 12-Oct-77 13:55:51, EDIT BY KIRSCHEN
;UPDATE COPYRIGHT FOR RELEASE 3
;<3-MONITOR>LPFEDV.MAC.4,  4-May-77 22:49:07, Edit by MCLEAN
;ADD PRINTX AND TWO NEW VECTOR ENTRIES
;<3-MONITOR>LPDRFE.MAC.3, 12-Mar-77 20:24:04, Edit by MCLEAN
;<1MCLEAN>LPDRFE.MAC.2, 12-Mar-77 13:23:01, Edit by MCLEAN


;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 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
   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
	 JFCL			;SHOULD NOT FAIL
	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
	 JFCL			;SHOULD NOT HAPPEN
	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
	 JFCL			;SHOULD NOT FAIL
	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
	 JFCL			;WILL GO
	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