Google
 

Trailing-Edge - PDP-10 Archives - custsupcuspmar86_bb-x130b-sb - disser.mac
There are 8 other files named disser.mac in the archive. Click here to see a list.
TITLE DISSER - DISPLAY SERVICE ROUTINE FOR TYPES 340, VP10, & 30   V043
SUBTTL	R. GRUEN/CHW/RCC/DAL 010 SEP 85
	SEARCH	F,S



;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,1984,1986
;BY DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
;ALL RIGHTS RESERVED.


XP VDISSR,043
ENTRY DISSER
DISSER::
;PUT VERSION NUMBER IN GLOB LISTING AND LOADER STORAGE MAP
;		THESE ROUTINES HANDLE INTERRUPTS FROM THE DISPLAY DATA
;	CHANNEL.  THEY SEARCH THE COMMAND POINTER LIST SUPPLIED
;	BY THE USER AND OUTPUT SECTIONS OF DATA AS SPECIFIED THEREIN.
;	ALL OUTPUT IS DONE USING THE BLKO COMMAND. 

;		THE FORMAT OF THE COMMAND POINTER LIST IS AS FOLLOWS:

;	RH=0		END OF COMMAND POINTER LIST
;
;	RH=ADR	LH=0	ADR IS ADDRESS OF THE NEXT SECTION OF THE
;	RH=0	LH=N	SET INTENSITY TO N ONLY FOR VP10 & TYPE 30. N IS
;			3 BITS WIDE FOR 30 2 BITS WIDE FOR VP10.
;	RH=L-1	LH=-N	OUTPUT TO THE DISPLAY THE N WORDS OF COMMANDS
;			BEGINNING AT LOCATION L.

;	NOTE THAT THE CHECK FOR END OF LIST IS MADE FIRST.

;	ALL ADDRESSES ARE CHECKED FOR VALIDITY (I.E., THEY MUST
;	BE WITHIN USER AREA) BEFORE ANY MEM REF IS MADE.



;DIS DEVICE DATA BLOCK

DISDDB::SIXBIT	/DIS/
	XWD	6*HUNGST,0	;HUNG TIME IS 63 SECONDS
DISIOS:	0
	EXP	DISDSP
	XWD	DVDIS+DVOUT+DVIN+DVLNG,20000
	0
	0
	XWD	R,0
	0
DISSTS::0
DISSTA:	XWD	.TYDIS,0
DISXTR:	0
DISEVM:	0
DISPSI:	0
DISESE:	0
DISHCW:	0
DISCPU:	0
DISJOB:	0
PENLOC::0
DISPNT:	0
DISBKO::0
DISHI:	0
DISONE:	0
DISAV:	0
DISAV1:	0
DISREL::XWD	T1,0

XP PENDDB,0			;TO SATISFY AREQUEST IN COMMON.
				; THERE REALLY IS NO PEN DDB.
DISTAR==100	;CLOCK FINISHED BEFORE PICTURE
DISWAT==200	;PICTURE FINISHED BEFORE CLOCK
DISCKR==400	;CLOCK REQUEST IN CLOCK QUEUE
DISUUI==1000




	DEFINE	ADRCHK(A)
<
		CAILE	A,JOBPFI##
		CAMLE	A,DISHI
		JRST	EXIT2
>
	JRST	ECOD2##		;SPECIAL ERROR STATUS
	JRST	REGSIZ##	;BUFFER LENGTH CAN BE GOTTEN FROM DDB
	JRST	DISINI		;INITILIZATION
	POPJ	P,		;PRINT ERROR AND STOP JOB
DISDSP::JRST	DISSTP		;RELEASE
	JRST	DISSTP		;CLOSE
	JRST	UUOERR##	;OUTPUT
	JRST	UUOERR##	;INPUT
	JRST	CPOPJ1##	;ENTER
	JRST	CPOPJ1##	;LOOKUP
	JRST	DISOUT		;DUMP OUTPUT (THAT'S US)
	JRST	DISIN		;DUMP INPUT (AS IN PEN)
	POPJ	P,		;SETO
	POPJ	P,		;SETI
	POPJ	P,		;GETF
	JRST	CPOPJ1##	;RENAME
	POPJ	P,		;CLOSE INPUT
	POPJ	P,		;DIRECTORY CLEAR
	POPJ	P,		;MTAPE
;DISINI	IS CALLED FOR RELEASE, CLOSE, AND SUNDRY ILLEGAL CONDITIONS
;	WHICH WANT TO TURN THE DISPLAY OFF.  IT FIRST CONVINCES
;	THE INTERRUPT LEVEL ROUTINES TO GO BACK TO SLEEP AND THEN
;	TELLS THE MONITOR THAT THE DEVICE IS INACTIVE.  LASTLY,
;	IT TURNS OFF THE INTERRUPT ASSIGNMENTS OF THE DISPLAY
;	AND THE PI CHANNEL ASSOCIATED WITH THE DIS BLKO. IT RETURNS
;	WITH A POPJ , SOMETIMES TO ITS CALLING ROUTINE AND SOMETIMES
;	TO THE CHANNEL'S DISMISS ROUTINE, THE ADDRESS OF WHICH
;	WAS CLEVERLY PLACED ON THE PUSHDOWN LIST WHEN AC'S
;	WERE SAVED.  THUS IT CAN BE CALLED WITH EITHER A
;	PUSHJ P,DISINI   OR A  JRST DISINI.

DISINI:	JRST	SETCON##	;GOES OFF TO COMMON - SETS UP THE DISPLAY
				;&  RETURNS TO DISIN1

DISSTP:
DISIN1::SETOM	PENLOC
	MOVSI	S,DISWAT+DISUUI	;IGNORE FURTHER TRAPS
	HRRI	S,IOACT		;INDICATE DEVICE INACTIVE
	ANDCAB	S,DISIOS	;INTO DEVICE DATA BLOCK
				;IN I/O WAIT?
	PUSHJ	P,SETIOD##	;YES, UNWAIT HIM
DISOFF:	XCT	DISCNO##	;REMOVE THE DISPLAY'S CHANNEL ASSIGNMENTS
	HLLZS	PENINT##	;DON'T EXPECT ANY ON LITE PEN
	CONO	PI,DISPOF##	;TURN OFF DISPLAY'S BLKO CHANNEL
	POPJ	P,

DISINT::SKIPA
	JRST	.-1		;WILL BE CHANGED BY SYSINI
	XCT	DISCNI##	;STORE CONI STATUS

	JRST	DISFIN
;DISNXT	IS CALLED WITH A   JSR DISNXT.   IT SETS UP THE NEXT
;	POINTER FOR THE DISPLAY'S BLKO BY INTERPRETING A
;	COMMAND LIST SUPPLIED BY THE USER.  THIS COMMAND LIST
;	IS DESCRIBED AT THE BEGINNING OF THE PROGRAM.  IF THE
;	DATA TO BE TRANSMITTED TO THE DISPLAY WOULD VIOLATE THE
;	MEMORY PROTECTION, THEN THE ROUTINE RETURNS TO THE
;	CALLING LOCATION +1.  OTHERWISE, IF THERE
;	IS NO FURTHER DATA TO BE OUTPUT (AS INDICATED BY THE
;	USER'S COMMAND LIST) THE ROUTINE RETURNS TO THE CALLING
;	LOCATION +2.  OTHERWISE, THE NEXT POINTER FOR THE BLKO
;	IS PLACED IN DISBKO AND THE ROUTINE RETURNS TO THE CALLING
;	LOCATION +3.

DISNXT:	0			;JSR AT INTERRUPT OR UUO LEVELS
DISNX1::AOSA	T1,DISPNT	;GET NEXT POINTER FROM LIST
ILUP:	HRRZM	T1,DISPNT	;UPDATE POINTER POINTER
	ADRCHK	T1
	MOVE	T1,@DISREL	;GET NEXT WORD IN POINTER LIST
	MOVEM	T1,DISBKO	;PLACE IN BLKO POINTER
	HLROM	T1,DISAV1	;GET NEGATIVE WORD COUNT(MAKE LH NEG. TOO)
	JRST	ENDCHK##	;GOES OFF TO COMMON - CHECKS FOR END OF LIST
				;(AND INTENSITY CHANGES FOR VP10 &T30)
				;& RETURNS TO EXIT0
EXIT0::	TLZN	T1,-1		;NO. POINTER TO NEW LIST?
	JRST	ILUP		;YES.
	CAIL	T1,JOBPFI##	;NO. ADDRESS IN BOUNDS?
	CAML	T1,DISHI
	JRST	EXIT2		;NO
	SUB	T1,DISAV1	;YES, ADR. OF LAST WORD IN BLOCK.
	ADRCHK	T1
	HRRZ	T1,DISREL	;FORM ABSOLUTE ADDR
	ADDM	T1,DISBKO	;IN THE BLKO POINTER WORD
	AOS	DISNXT		;RETURN 2,4
EXIT1::	AOS	DISNXT
EXIT2:	MOVE	T1,DISAV
	JRST	2,@DISNXT	;...

;DISFIN	RECEIVES CONTROL WHEN THE DISPLAY'S BLKO POINTER REACHES
;	ZERO.  IT SAVES THE TWO AC'S WHICH DISNXT USES AND
;	DOES A JSR TO DISNXT.  ON A NORMAL RETURN IT RESTORES THE
;	AC'S AND DISMISSES THE INTERRUPT.  ON A "NO MORE DATA"
;	RETURN IT TRANSFERS CONTROL TO OVT2 FOR FURTHER
;	DECISION AS TO WHETHER OR NOT TO CONTINUE DISPLAYING.

DISFIN::MOVEM	T1,DISAV	;SAVE AC'S
	JSR	DISNXT		;SETUP NEXT BLKO POINTER
	  JRST	ADRER
	  JRST	OVT2		;RETURN HERE IF NO NEXT POINTER
	JEN	@DISCHL##	;LET THE SCOPE DO THE REST

;OVT2	RECEIVES CONTROL AT INTERRUPT LEVEL WHEN THE COMMAND LIST
;	(SUPPLIED BY THE USER) RUNS OUT.  IT SAVES THE AC'S FOR
;	THIS CHANNEL AND IN THE PROCESS ENABLES RETURNS BY POPJ
;	AND SIMILAR GOOD THINGS SINCE IT ALSO STORES THE PC FROM
;	THE JSR IN THE GENERAL PC LOCATION FOR THIS CHANNEL
;	IF THE DISPLAY IS OFF, IT DOES NOT RESTART IT.
;	IT CHECKS TO SEE IF THE CLOCK HAS RUN OUT BEFORE THE PICTURE;
;	IF SO, IT CALLS DISBEG TO RESTART THE DISPLAY WITH A NEW
;	COMMAND LIST.  IT TURNS OFF THE IO ACTIVE BIT WHICH WAS
;	TURNED ON BY THE OUTPUT ROUTINE; THIS INSURES THAT ANY
;	OUTPUT COMMAND WILL DISPLAY AT LEAST ONE PICTURE.  IF
;	THE JOB WAS IN AN IO-WAIT, IT IS RELEASED.

OVT2:	JSR	DISSAV##	;ASK EXEC TO SAVE AC'S
	MOVEI	F,DISDDB	;SETUP ACS
	LDB	J,PJOBN##
	PUSHJ	P,DISOFF
	MOVSI	T1,SHF!CMWB	;SEE IF SYSTEM WAITING TO SHUFFLE OR EXECUTE A COMMAND
	MOVSI	S,DISWAT	;INDICATE PICTURES FINISHED
	IORB	S,DISIOS	;...
	TLON	S,DISUUI	;RESUME DISPLAY, NEW UUO.
	JRST	OVT6		;YES, STAY IN IO WAIT
OVT4:	TLNE	S,DISTAR	;DID CLOCK FINISH BEFORE PICTURE?
	PUSHJ	P,CLKREQ	;YES, PUT IN CLOCK REQUEST.
OVT3:	TRZ	S,IOACT		;SIGNAL DISPLAY CAN BE CLOSED
				;IS DISPLAY CAUSING AN IO-WAIT?
	PUSHJ	P,SETIOD##	;UNWAIT THE JOB
	MOVEM	S,DISIOS	;RESTORE IO CONTROL WORD
	JRST	DISRET##	;RESTORE AC'S AND DISMISS
OVT6:	MOVEM	S,DISIOS
	TDNE	T1,JBTSTS##(J)	;DOES SYSTEM WANT TO SHUFFLE THIS JOB?
	JRST	OVT4		;YES
	PUSHJ	P,DISBEG	;START NEW COMMAND LIST
	JRST	DISRET##
;DISBEG	IS CALLED WITH A PUSHJ P,DISBEG.  IT DISABLES THE
;	DISPLAY ITSELF (BY USING DISOFF) AND ALSO DISABLES THE
;	CLOK RESTART AND RESETS THE POINTER TO THE USER'S
;	COMMAND LIST TO THAT SPECIFIED ON THE LAST OUTPUT
;	MINUS ONE.  IT ASKS DISNXT TO SET UP THE NEXT BLKO POINTER
;	IF DISNXT IS UNSUCCESSFUL (I.E., IF THE USER COMMAND LIST
;	IS NULL), THEN THE ROUTINE DOES A CLOSE.  OTHERWISE, A
;	REQUEST IS ENTERED FOR A CLOCK INTERRUPT AT THE END OF
;	AT MOST TWO JIFFIES.  THIS CLOCK QUEQUE REQUEST IS ENTERED
;	ONLY IF THERE IS NONE ALREADY IN THE QUEUE.  THE PI
;	CHANNELS FOR THE DISPLAY ARE TURNED ON AGAIN AND THE
;	DISPLAY IS INITIALIZED BY A CONO.  IT SHOULD THEN REQUEST
;	DATA AS SOON AS THE PI CHANNEL FOR THE BLKO IS TURNED ON.
;	IT TURNS THIS CHANNEL ON AND RETURNS TO ITS CALLER.

DISBEG:	MOVSI	S,DISTAR+DISWAT	;INDICATE FRESH DISPLAY
	ANDCAB	S,DISIOS	;...
	HRRZ	T2,DISONE	;GET POINTER LIST ADDR (-1)
	HRRZM	T2,DISPNT	;RESET POINTER POINTER WITH IT
	CONO	PI,DISPOF##
	JSR	DISNXT		;ASK FOR FIRST WORD FOR BLKO
	  JRST	ADRER1
	  JRST	DISSTP		;NULL LIST, CLOSE
	PUSHJ	P,CLKREQ	;ENTER CLOCK QUEUE REQUEST
	XCT	DISCNA##	;INITIALIZE THE DISPLAY
	MOVEI	T1,PENON##	;ALLOW SPECIAL PI INTERRUPTS
	HRRM	T1,PENINT##	;...
	CONO	PI,DISPON##	;ALLOW BLKO INTERRUPTS
	POPJ	P,		;RETURN

CLKREQ:	MOVSI	S,DISCKR	;IF NO CLOCK INTERRUPT REQUESTED
	MOVE	T1,CLOKRT	;RESET TIMER
	PIOFF			;INHIBIT INTERRUPTS
	TDON	S,DISIOS	;ENTER ONLY A SINGLE CLOCK REQUEST
	JRST	[IDPB T1,CLOCK## ;PLACE REQUEST IN QUEUE
		 IBP CLOCK##	;TWO ENTRIES / REQUEST
		 JRST .+1]
	IORM	S,DISIOS	;PROTECT AGAINST A DUPLICATE REQUEST
	PJRST	ONPOPD##

CLOKRT:	XWD	CLOK,2		;CONTROL FOR CLOCK QUEUE: 2 JIFFIES
				;TWO JIFFIES
;CLOK	IS CALLED AT THE CLOCK LEVEL IN RESPONSE TO A REQUEST
;	IN THE CLOCK QUEUE.  A BIT IS SET TO INDICATE THAT THE
;	CLOCL PERIOD HAS ELAPSED.  IF THE DISPLAY IS STILL IN
;	PROGRESS, CLOK RETURNS AT THIS POINT.  OTHERWISE, CLOK
;	GOES TO DISBEG TO START UP THE DISPLAY.  DISBEG RETURNS
;	WITH A POPJ P,

CLOK:	MOVSI	S,DISCKR	;INDICATE CLOCK REQUEST SERVICED
	ANDCAB	S,DISIOS	;...
	TLOE	S,DISUUI
	MOVSI	S,DISTAR	;ASK DISPLAY TO RESTART
	IORB	S,DISIOS	;...
	TLNN	S,DISWAT	;HAS DISPLAY FINISHED?
	POPJ	P,		;NO, WAIT FOR IT TO DO SO
	MOVEI	F,DISDDB
	LDB	J,PJOBN##
	MOVM	T2,FINISH##	;JOB NUMBER OF JOB BEING SWAPPED IN OR OUT
	SKIPE	T1,JBTADR##(J)	;IS THE JOB IN CORE
	CAMN	J,T2		;AND NOT ON THE WAY OUT OR IN?
	JRST	CLOK1		;NO, CANNOT RESUME DISPLAY
				; GO CAUSE IT TO BE SWAPPED IN

	HLRZM	T1,DISHI	;RESET DISHI AND DISREL AFTER SHUFFLING
	HRRM	T1,DISREL
	MOVEI	S,IOACT		;MAKE THE JOB I/O ACTIVE
	IORM	S,DISIOS	;SO IT WON'T GET SHUFFLED OR SWAPPED
	JRST	DISBEG		;RESART DISPLAY AND RETURN
CLOK1:	SKIPE	FIT##		;SOME JOB WANT TO COME IN?
	PJRST	CLKREQ		;YES, LET IT
	CAME	J,FINISH##	;DON'T BOTHER IF ALREADY COMING IN
	MOVEM	J,FIT##		;SET FIT SO THE SWAPPER WILL SWAP IT IN
	PJRST	CLKREQ		;AND PUT IN A CLOCK REQUEST FOR LATER CHECK


;ADRER	SERVICES PROTECTION VIOLATIONS DISCOVERED BY DISNXT.
;	IT DOES A CLOSE AND THEN CALLS THE MONITOR'S ERROR PRINTING
;	ROUTINES TO INFORM THE USER.

ADRER:	JSR	DISSAV##	;SAVE AC'S AGAIN
ADRER1:	PUSHJ	P,DISDSP+DCL	;DO A CLOSE
	MOVEI	F,DISDDB	;TELL ERROR ROUTINE WHO'S UNHAPPY
	JRST	ADRERR##	;GO GRIPE
;DISIN	HANDLES LITE PEN UUO (INPUT) IN A RUDIMENTARY FASHION
;	BY RETURNING (TO THE ADDR SPECIFIED BY THE ADDR FIELD
;	OF THE INPUT UUO) THE LAST PEN COORDINATES SEEN.

DISIN:	MOVNI	T1,1
	EXCH	T1,PENLOC	;GET LATEST COORDINATES.
	PJRST	PUTWDU##	;STORE AND RETURN
;DISOUT	DOES THE WORK OF THE OUTPUT UUO.  IT SETS A BIT TO
;	INDICATE THAT THE DEVICE IS ACTIVE AND INHIBITS
;	INTERUPTS WHICH MAY STILL BE IN PROGRESS.  SINCE THE
;	MONITOR CALLS WSYNCE BEFORE COMING HERE, THE USER IS 
;	GUARANTEED AT LEAST ONE PICTURE/OUTPUT.  THE USERS MEMORY
;	BOUNDS ARE STORED FOR QUICK USE AT INTERRUPT LEVEL W/0
;	SAVING AC'S.  THE LOCATION OF THE COMMAND LIST (-1) IS
;	STORED FOR USE IN SETTING UP BLKO POINTERS.  THE PI
;	LOCATIONS (40 + 2J) ARE INITIALIZED WITH A BLKO IN
;	THE EVEN LOCATION AND A JSR TO DISFIN IN THE ODD LOCATION.
;	THE NON-DATA CHANNEL CONSO IS SETUP TO BELIEVE IN THE
;	A POPJ P, IT RETURNS ON BEHALF OF THE OUTPUT UUO.

DISOUT:	XCT	DISCZA##	;DISPLAY ALREADY IN USE?
	JRST	DISOU2		;YES
DISOU1:	XCT	DISTST##	;NO,CONO DIS,DISCHN
	XCT	DISCNI##	;READ STATUS
	SKIPE	DISSTS		;IS IT REALLY THERE?
	JRST	DISOU2		;YES
	PUSHJ	P,HNGSTP##	;NO, GIVE ERROR MESSAGE
	JRST	DISOU1		;AND TRY AGAIN

DISOU2:	TLO	S,IO+DISWAT	;INDICATE OUTPUT; REQUEST START UP
	TRO	S,IOACT		;INDICATE DEVICE ACTIVE
	SUBI	M,1		;ALLOW FOR INCREMENT AT INTERRUPT
	MOVE	T1,BLKLIT##	;FEEDS WORDS TO THE DISPLAY
	MOVEM	T1,DISBLK##	;FROM EVEN NUMBERED INTERRUPT LOC
	MOVE	T1,JSRLIT	;SERVICE THE END OF BLKO
	MOVEM	T1,DISJSR##	;FROM ODD INTERRUPT LOC
	MOVEI	T1,PENON##	;SETUP CONSO BITS ON SPECIAL CHANNEL
	HRRM	T1,PENINT##	;...
	IORB	S,DISIOS	;SET IOACT ON; INDICATE OUTPUT
	HRRZM	M,DISONE	;SET NEW COMMAND LIST ORIGIN
	MOVSI	S,DISUUI
	IORM	S,DISIOS	;ALLOW DISPLAY
	XCT	DISCZA##	;DISPLAY ALREADY IN USE
	ANDCAM	S,DISIOS	;YES
	JRST	CLKREQ		;ENTER CLOCK QUEUE REQUEST AND POPJ

JSRLIT:	JSR	DISCHL##
	END

DISEND: