	.TITLE RSX DATA CHANNEL HANDLER
/
/  12 OCT 77 (004; PDH) WE FINALLY FOUND OUT THAT THE REGISTER USAGE
/			CONVENTIONS ARE DIFFERENT BETWEEN XVM/RSX V1A AND
/			XVM/RSX V1B (MULTIACCESS).  SINCE THE SKELETON
/			ON WHICH THIS HANDLER IS BASED CAME FROM
/			MULTIACCESS, WE HAVE TO DO A LITTLE RETRO-FITTING.
/			IT MAY VERY WELL WORK AS IS WITH M/A.
/  16 JUN 77 (003; PDH) CHANGE WC TO 22 FROM 32
/  15 JUN 77 (     PDH) FINAL EDITING BEFORE INITIAL TEST
/   9 JUN 77 (     PDH) CONTINUE THE CONVERSION
/  25 MAY 77 (001; PDH) BEGIN CONVERSION FROM LP.38 HANDLER
/
	.EJECT
/ THE FOLLOWING CAL PARAMETER BLOCKS ARE USED TO QUEUE REQUESTS FOR
/ DATA CHANNEL SERVICE:

/
/	CPB	3600	HANDLER INFORMATION (HINF)
/		EVA	(300076 => I, O, NO DIRECTORY)
/		LUN

/
/	CPB	2400	ATTACH DATA CHANNEL DEVICE
/		EVA
/		LUN
/
/	CPB	2600	READ (RECEIVE DATA FROM EXTERNAL DEVICE)
/		EVA
/		LUN
/		MODE
/		BUFFER
/		COUNT
/
/	CPB	2700	WRITE (SEND DATA TO EXTERNAL DEVICE)

/		EVA

/		LUN

/		MODE
/		BUFFER
/
/	CPB	3000	GET BLOCK OF DATA
/		EVA
/		LUN
/		GCTBL	(POINTER TO 'GET' CONTROL TABLE)
/
/	  GCTBL	BUFFER
/		COUNT	(NUMBER ACTUALLY TRANSFERRED INSERTED WHEN I/O COMPLETE)
/
/	CPB	3100	PUT BLOCK OF DATA
/		EVA
/		LUN
/		PCTBL	(POINTER TO 'PUT' CONTROL TABLE)
/
/	  PCTBL	BUFFER
/		COUNT
/
/	CPB	2500	DETACH DATA CHANNEL DEVICE

/		EVA
/		LUN
/
	.EJECT
/ THE REQUESTOR'S EVENT VARIABLE IS CLEARED (ZEROED) WHEN THE REQUEST

/ IS QUEUED BY THE "QUEUE I/O" DIRECTIVE.  IF THE REQUEST CAN BE 

/ PERFORMED, THE EVENT VARIABLE IS SET TO ONE (+1) UPON COMPLETION.

/ IF THE REQUEST CANNOT BE PERFORMED, THE EVENT VARIABLE IS SET TO ONE 

/ OF THE FOLLOWING NEGATIVE VALUES:

/

/	 -6 -- ILLEGAL REQUEST FUNCTION

/	 -7 -- ILLEGAL DATA MODE

/	-16 -- ILLEGAL OUTPUT HEADER WORD-PAIR-COUNT (<1)

/	-24 -- LUN HAS BEEN REASSIGNED WHILE REQUEST WAS IN QUEUE
/	-30 -- OUT-OF-PARTITION TRANSFER (NORMAL MODE)
/	-203 - ILLEGAL TO ATTACH OR DETACH FROM OTHER THAN TASK LEVEL
/
	.EJECT

X12=12		/AUTO-INCREMENT REG 12

X13=13		/AUTO-INCREMENT REG 13
X17=17		/AUTO-INCREMENT REG 17 (USED TO SET REQUESTOR'S EV)
X10=10		/ FETCH STL NODE ADDR FOLLOWING DMTQ

R1=101		/RE-ENTRANT REGISTER ONE

R2=102		/RE-ENTRANT REGISTER TWO

R3=103		/RE-ENTRANT REGISTER THREE
R4=104		/RE-ENTRANT REGISTER FOUR

NADD=107	/NODE ADDITION ROUTINE ENTRY POINT

SNAM=123	/NAME SCAN ROUTINE ENTRY POINT

POOL=240	/LISTHEAD FOR POOL OF EMPTY NODES

PDVL=252	/LISTHEAD FOR PHYSICAL DEVICE LIST
ALAD=325	/ATTACH LUN & DEVICE ENTRY POINT
DLAD=332	/DETACH LUN & DEVICE ENTRY POINT
DQRQ=337	/DE-QUEUE REQUEST ENTRY POINT

VAJX=342	/VERIFY & ADJUST ENTRY POINT

IOCD=345	/DECLARE I/O REQUEST COMPLETE ENTRY POINT

DMTQ=361	/DETACH & EMPTY QUEUE ENTRY POINT
D.TG=10		/POSITION OF TRIGGER EVENT VARIABLE IN PDVL NODE
/
IDX=ISZ		/ INDEX POINTER (SKIP NOT EXPECTED)
SET=ISZ		/ SET FLAG TO NON-ZERO VALUE
INC=ISZ		/ INCREMENT POSITIVE COUNTER (SKIP NEVER INTENDED)
.INH=705522	/ INHIBIT INTERRUPTS
.ENB=705521	/ ENABLE  INTERRUPTS
/
/  WHEN USING A ROUTINE TO SIMULATE AN EXTERNAL DEVICE,
/  IT IS NECESSARY TO JUMPER PIN C12S TO PIN D24K SO THAT
/  THE 'DCJOG' INSTRUCTION CAN FUNCTION.
/
DCSF=702701		/ SKIP ON DATA CHANNEL DEVICE FLAG
DCCF=702721		/ CLEAR FLAG (FUTURE: AND DISABLE INTERRUPTS)
DCRD=702741		/ SELECT READ (INPUT) (FUTURE: AND ENABLE INTERRUPTS)
DCWT=702761		/ SELECT WRITE (OUTPUT) (FUTURE: AND ENABLE INTERRUPTS)
DIRD=702712		/ DIAGNOSTIC READ DATA CHANNEL BUFFER
				/ (PROBABLY DOES NOT WORK)
DIWT=702704		/ DIAGNOSTIC WRITE (LOAD) DATA CHANNEL BUFFER
DCAPI=76		/ API TRAP ADDRESS
DCWC=22			/ WORD COUNT REGISTER
DCCA=DCWC+1		/ CURRENT ADDRESS REGISTER
DCJOG=702504		/ SIMULATE EXTERNAL DEVICE
/
	.EJECT
/ HANDLER INITIALIZATION

/
DC	LAC	(PDVL	/SCAN PHYSICAL DEVICE LIST FOR NODE
	DAC*	(R1)	/FOR THIS DEVICE.
	LAC	(HNAM
	DAC*	(R2)
	JMS*	(SNAM	/(R1, R2, R6, X17, XR, & AC ARE ALTERED)
			/NODE FOUND?
	CAL	(10)	/NO -- EXIT
	DAC	PDVNA	/SAVE PDVL NODE ADDRESS
	AAC	+D.TG	/AND
	DAC	PDVTA	/TRIGGER EVENT VARIABLE ADDRESS ADDRESS.
/
	CAL	CCPB	/CONNECT INTERRUPT LINE
	LAC	EV	/CONNECT OKAY?

	SPA

	CAL	(10)	/NO -- EXIT
	LAC	(TG	/YES -- SET TRIGGER EVENT VARIABLE ADDRESS
	DAC*	PDVTA	/IN PHYSICAL DEVICE NODE
	AND	(070000	/DETERMINE "XR-ADJ"

	TCA
	DAC	XADJ
/***
/***   HERE IS WHERE ONE WOULD CLEAR THE DEVICE, IF APPROPRIATE
/***
	DCCF
/

/ WAIT FOR TASK TO BE TRIGGERED BY 'QUEUE I/O' DIRECTIVE OR BY 'ABORT'

/ TO SIGNAL THAT A REQUEST HAS BEEN QUEUED.

/
WFTGR	CAL	WFTCPB	/WAIT FOR TRIGGER EVENT VARIABLE TO BE SET
/

/ THE TASK HAS BEEN TRIGGERED -- PICK A REQUEST FROM QUEUE (IF ANY)

/

	DZM	TG	/CLEAR TRIGGER
PQ	LAC	PDVNA	/DEQUE A REQUEST
	DAC*	(R1)
	JMS*	(DQRQ)	/(R1, R2, R4, R5, R6, XR, & AC ARE ALTERED)
/			/R1 NOW CONTAINS PDVL NODE ADDR
/			/R2 NOW CONTAINS I/O REQ NODE ADDR

			/WAS A REQUEST FOUND?

	JMP	WFTGR	/NO -- WAIT FOR TRIGGER

	DAC	RN	/YES -- SAVE ADDRESS OF REQUEST NODE
	TAD	XADJ	/SETUP XR TO ACCESS NODE
	PAX
/
	.EJECT
/  THE FORMAT OF AN I/O REQUEST NODE (RN) IS AS FOLLOWS:
/
/	 (0) FORWARD LINKAGE
/	 (1) BACKWARD LINKAGE
/	 (2) REQUESTOR'S STL NODE ADDRESS
/	 (3) NORMAL/EXEC MODE INDICATOR
/	 (4) TASK PRIORITY (TO BE CHANGED!)
/	 (5) I/O FUNCTION CODE IN BITS 9-17, AND
/	     LUN IN BITS 0-8.
/	 (6) CPB WD 1 -- EVENT VARIABLE ADDRESS
/	 (7) CPB WD 3 -- (UNIQUE TO CAL)
/	(10) CPB WD 4 -- (UNIQUE TO CAL)
/	(11) CPB WD 5 -- (UNIQUE TO CAL)
/
/  IF AN I/O REQUEST IS QUEUED BY AN INTERRUPT SERVICE ROUTINE, ZERO IS
/  USED IN PLACE OF AN STL NODE ADDRESS.
/
/  IF AN I/O REQUEST IS QUEUED BY A "NORMAL MODE" TASK, ITS PARTITION
/  BLOCK ADDRESS IS SET IN THE MODE INDICATOR.  FOR AN "EXEC MODE" TASK,
/  THE MODE INDICATOR IS SET TO ZERO.
/
	LAC	5,X	/FETCH CAL FUNCTION CODE

	AND	(777)

	SAD	(017)	/ABORT REQUEST?

	JMP	ABORT	/YES -- ABORT TASK I/O

	SAD	(777)	/NO -- EXIT (DEASSIGNED) REQUEST?
	JMP	DAEX	/YES -- DETACH & EXIT
	SAD	(26	/ READ REQUEST?
	JMP	READ
	SAD	(27	/ WRITE REQ?
	JMP	WRITE	/YUP
	SAD	(30	/ GET REQUEST?
	JMP	GET
	SAD	(31	/ PUT REQUEST?
	JMP	PUT
	SAD	(36	/HINF CODE REQ?
	JMP	HINF
	SAD	(34
	JMP	CLOSE
	CLL!RAR		/SEARCH ATTACH DETACH IN COMMON
	SAD	(12	/24/2 AND 25/2  ARE 12

	JMP	ATTACH	/GO DO EITHER
ILFUNC	LAW	-6	/NO -- UNIMPLEMENTED FUNCTION -- SET
	JMP	SEV	/EVENT VARIABLE TO -6
/
	.EJECT

/ ABORT ALL I/O INITIATED BY THE INDICATED TASK.

/
ABORT	XOR	5,X	/ABORT IS AN ILLEGAL FUNCTION FOR ALL TASKS
	SZA		/ EXCEPT 'IORD' WHO SETS LUN=0
	JMP	ILFUNC
	LAC	PDVNA		/ (004) SET UP REGISTERS
	DAC*	(R1		/ (004)
	LAC	RN		/ (004)
	DAC*	(R2		/ (004)
	JMS*	(DMTQ	/ R1 AND R2 SET UP FOR THIS CALL
	JMP	SP1	/DONE.
/
/
/  ATTACH TO  OR  DETACH FROM A TASK
/
ATTACH	SNL!CLA		/ SKIP IF DETACH
	AAC	ALAD-DLAD / MAKE UP ADDR FOR ALAD OR DLAD
	AAC	DLAD	/ FOR JMS TO ACTION
	DAC	TEMP1	/ TEMPORARY FOR JMS*
	JMS*	TEMP1	/ CALL ATTACH OR DETACH
/			/ R1 AND R2 ALREADY SET UP
	JMP	SEV	/NO -- SET REQUESTOR'S EVENT VARIABLE TO -24 OR -203
SP1	CLA!IAC		/YES -- SET REQUESTOR'S EVENT VARIABLE TO +1
	JMP	SEV
/
/
/ RETURN HANDLER INFORMATION IN EVENT VARIABLE

/
HINF	LAC	(300076		/ INPUT AND/OR OUTPUT, NO DIRECTORY
	JMP	SEV
/
	.EJECT
READ	LAC	11,X
	DAC	UWC		/ SAVE USER WORD COUNT
	LAC	7,X		/ GET MODE OF I/O REQUEST
	DAC	MI		/ AND SAVE IT
	AND	(777776
	SZA
	JMP	ILMODE		/ ONLY LEGAL MODES ARE 0 AND 1
/
	LAC	10,X		/ GET LINE BUFFER ADDRESS
	DAC*	(R3
	DAC	TEMP1
	CLA!IAC
	DAC*	(R4
	JMS*	(VAJX
	JMP	ERR30
/
	LAC	TEMP1
	DAC*	(R3
	LAC	UWC
	DAC*	(R4
	AAC	-2		/ ACCOUNT FOR HEADERS
	SPA!SNA!TCA		/ SPA&SNA;TCA
	JMP	ILSIZE		/ MUST HAVE AT LEAST 1 DATA WORD
	DAC*	(DCWC
	JMS*	(VAJX
	JMP	ERR30
/
	LAC*	(R3
	IAC
	DAC*	(DCCA		/ BEGIN AT WORD 2 (AFTER HEADERS)
	AAC	-1
	TAD	XADJ
	DAC	CTBLX
	DZM	EV
	DCRD			/ START I/O
	JMS	WFAB
/
	.EJECT
/  THE DATA HAS BEEN READ.  IT IS NOW NECESSARY TO CALCULATE THE HEADERS
/  (WORD PAIRS, DATA VALIDITY, MODE, AND CHECKSUM) AND RETURN THEM TO THE USER.
/
	LAC	CTBLX		/ RESTORE XR
	PAX
	CLQ			/ ASSUME DATA VALIDITY BITS=0
	LAC*	(DCWC
	SZA			/ IF THERE IS A RESIDUAL WORD COUNT,
	CMQ			/ MQ=-1 WILL SHIFT TO BECOME SHORT LINE INDICATOR
	TAD	UWC		/ CALCULATE ACTUAL NUMBER OF WORDS IN BUFFER
	DAC	UWC		/ SAVE ACTUAL WORD COUNT
	LLS	10
	AND	(777060		/ SELECT WORD PAIRS AND DATA VALIDITY BITS
	XOR	MI		/ INCLUDE DATA MODE
	DAC	0,X		/ RETURN HEADER WORD 0 TO USER
	LAC	CTBLX
	TAD	UWC
	PAL			/ SET UP LIMIT REGISTER FOR CHECKSUM CALCULATION
	LAC	0,X		/ FETCH HEADER WORD 0 AGAIN
	AXR	2		/ THEN STEP PAST HEADERS
	TAD	0,X		/ CALCULATE CHECKSUM
	AXS	1
	JMP	.-2
	TCA
	DAC	TEMP1		/ TEMPORARILY SAVE CHECKSUM
	LAC	CTBLX
	PAX			/ RESET XR TO BEGINNING OF BUFFER
	LAC	TEMP1		/ RETRIEVE CHECKSUM
	DAC	1,X		/ RETURN IT (HEADER WORD 1)
	JMP	SP1
/
	.EJECT
WRITE	LAC	7,X		/ GET MODE OF I/O REQUEST
	AND	(777776		/ IF DATA MODE IS OTHER THAN 0 (IOPS BINARY)
	SNA			/ OR 1 (IMAGE BINARY), SET REQUESTOR'S
	JMP	MODEOK		/ EVENT VARIABLE TO -7.
ILMODE	LAW	-7
	JMP	SEV
MODEOK	LAC	10,X		/ GET USER BUFFER ADDRESS
	DAC*	(R3
	DAC	TEMP1		/ SAVE UN-ADJUSTED BASE FOR SECOND JMS
	CLA!IAC
	DAC*	(R4
	JMS*	(VAJX		/ (R3, R5, XR, AC ARE ALTERED)
				/ IS BEGINNING ADDRESS OK?
	JMP	ERR30		/ NO -- SET REQUESTOR'S EVENT VARIABLE TO -30
/
/  BEGINNING ADDRESS IS OK.  REAL (ADJUSTED TO 17-BITS) ADDRESS OF
/  LINE BUFFER IS IN R3, AND MAY BE MOVED TO APPROPRIATE LOCATION.
/
	LAC*	(R3
	DAC	SEVRN		/ HANDY TEMPORARY LOCATION
	LAC*	SEVRN
	LRS	10
	AND	(776		/ GET LINE LENGTH IN WORDS
	DAC*	(R4
	AAC	-2		/ IF FEWER THAN 3 WORDS (2 HEADERS + 1 DATA),
	SMA!SZA			/ SET REQUESTOR'S EVENT VARIABLE TO -16
	JMP	.+3
ILSIZE	LAW	-16
	JMP	SEV
	LAC	TEMP1		/ VERIFY LINE SIZE (NORMAL MODE).
	DAC*	(R3		/ R2 & R4 ARE SETUP.
	JMS*	(VAJX		/ (R3, R5, XR, AC ARE ALTERED)
				/ IS LINE SIZE OK?
	JMP	ERR30		/ NO -- SET REQUESTOR'S EVENT VARIALBE TO -30
/
/  LINE SIZE IS OK.  WORD COUNT IS IN R4 TO BE USED AS APPROPRIATE.
/  REAL (ADJUSTED TO 17-BITS) ADDRESS OF LINE BUFFER IS AGAIN IN R3.
/
	LAW	-2
	TAD*	(R4		/ RETRIEVE WORD COUNT
	TCA
	DAC*	(DCCA		/ INITIALIZE WORD COUNT REGISTER
	LAC*	(R3
	IAC
SEND	DAC*	(DCCA		/ AND CURRENT ADDRESS REGISTER
	DZM	EV		/ CLEAR INTERNAL EVENT VARIABLE
	DCWT			/ THEN START I/O
	JMS	WFAB		/ WAIT FOR I/O TO COMPLETE,
	JMP	SP1		/ THEN SET REQUESTOR'S EVENT VARIABLE TO +1
/
	.EJECT
GET	LAC	7,X		/ GET USER CONTROL TABLE ADDRESS
	DAC*	(R3
	CLA!IAC
	DAC*	(R4
	JMS*	(VAJX		/ VALIDATE AND ADJUST CONTROL TABLE ADDRESS
	JMP	ERR30
/
	LAC*	(R3		/ GET ADJUSTED ADDRESS
	TAD	XADJ
	PAX
	DAC	CTBLX		/ SAVE VALUE FOR INDEXING INTO CONTROL TABLE
	LAC	1,X
	DAC	UWC		/ FETCH USER WORD COUNT
	LAC	0,X
	DAC*	(R3
	DAC	TEMP1
	JMS*	(VAJX		/ VALIDATE BEGINNING OF BUFFER (R4 SET ALREADY)
	JMP	ERR30
/
	LAC	TEMP1
	DAC*	(R3
	LAC	UWC
	DAC*	(R4
	TCA
	DAC*	(DCWC		/ INTIALIZE WORD COUNT REGISTER FOR TRANSFER
	JMS*	(VAJX		/ VALIDATE END OF BUFFER
	JMP	ERR30
/
	LAW	-1
	TAD*	(R3
	DAC*	(DCCA		/ INITIALIZE CURRENT ADDRESS REGISTER
	DZM	EV
	DCRD			/ START I/O
	JMS	WFAB		/ WAIT FOR COMPLETION
	LAC	CTBLX
	PAX			/ RESTORE PROPER VALUE TO XR
	LAC*	(DCWC
	TAD	UWC		/ CALCULATE NUMBER OF WORDS ACTUALLY TRANSFERRED
	DAC	1,X		/ AND RETURN IT TO USER'S CONTROL TABLE
	JMP	SP1
/
	.EJECT
PUT	LAC	7,X		/ GET USER'S CONTROL TABLE ADDRESS
	DAC*	(R3
	CLA!IAC
	DAC*	(R4
	JMS*	(VAJX		/ VALIDATE CONTROL TABLE ADDRESS
	JMP	ERR30
/
	LAC*	(R3
	TAD	XADJ
	PAX
	LAC	1,X
	DAC	UWC		/ SAVE USER WORD COUNT
	LAC	0,X		/ GET USER BUFFER POINTER
	DAC*	(R3
	DAC	TEMP1
	JMS*	(VAJX		/ VALIDATE BEGIN (R4 ALREADY SET UP)
	JMP	ERR30
/
	LAC	TEMP1
	DAC*	(R3
	LAC	UWC
	DAC*	(R4
	TCA
	DAC*	(DCWC		/ INITIALIZE WORD COUNT REGISTER FOR TRANSFER
	JMS*	(VAJX		/ VALIDATE BUFFER SIZE
	JMP	ERR30
/
	LAW	-1
	TAD*	(R3
	JMP	SEND		/ JUMP INTO 'WRITE' CODE
/
	.EJECT
CLOSE	DCCF
	JMP	SP1
/
/
ERR30	LAW	-30

/

/  COMMON TERMINATION OF NON-PRINTING REQUESTS

/
SEV	JMS	SEVRN	/SET EVENT VARIABLE, DECLARE SIGNIFICANT
	JMP	PQ	/EVENT, RETURN NODE, PICK NEXT REQ.
/
/ WFAB -- SUBROUTINE TO WAIT FOR EVENT VARIABLE TO BE SET AND THEN TO

/ CHECK THE TRIGGER EVENT VARIABLE TO SEE IF AN ABORT REQUEST SHOULD

/ BE PROCESSED.

/
WFAB	0

	CAL	WFECPB	/WAITFOR EV TO BE SET.

	LAC	TG	/IS BIT 2 OF THE TRIGGER SET?

	RTL

	SMA

	JMP*	WFAB	/NO -- RETURN

/

/ DE-QUEUE THE ABORT REQUEST.

/

	DZM	TG

	LAC	PDVNA	/PHYSICAL DEVICE NODE ADR

	DAC*	(R1)

	JMS*	(DQRQ)	/(R1, R2, R4, R5, XR & AC ARE ALTERED).

			/WAS A REQUEST FOUND?

	JMP*	WFAB	/NO -- SHOULD NEVER RETURN HERE.

	DAC	RN	/YES -- SAVE NODE ADR

	DAC*	(R2)

	LAC	PDVNA	/PHYSICAL DEVICE NODE ADR

	DAC*	(R1)

	JMS*	(DMTQ)	/DETACH LUN & DEVICE, IF NECESSARY, AND THEN

			/EMPTY THE REQUEST QUEUE OF ALL I/O REQUESTS

			/MADE BY THE TASK BEING ABORTED. (R1, R2, R3,

			/R5, R6, X10, X11, X12, XR & AC ARE ALTERED).
	JMS	SEVRN	/SET REQUESTER'S ('IORD'S') EV, DECRE-

			/MENT THE I/O PENDING COUNT, AND RETURN NODE TO POOL.

	JMP*	WFAB
/
	.EJECT
/ SEVRN -- SUBROUTINE TO SET THE REQUESTOR'S EVENT VARIABLE TO

/ THE QUANTITY IN AC, DECLARE A SIGNIFICANT EVENT, DECREMENT I/O

/ TRANSFERS PENDING COUNT (NORMAL MODE), AND RETURN REQUEST NODE

/ TO THE POOL.

/

SEVRN	0

	PAL		/SAVE EV VALUE

	LAC	RN	/REQUEST NODE ADR

	TAD	XADJ

	PAX

	LAC	6,X	/REQUESTER'S EV

	SNA

	JMP	NOSET	/NONE SPECIFIED

	TAD	XADJ

	PAX

	PLA

	DAC	0,X	/SET EV

/

NOSET	LAC	RN	/DECLARE I/O REQUEST COMPLETED (DECREMENT

	DAC*	(R2)	/TRANSFERS PENDING COUNT).

	JMS*	(IOCD)	/(R5, XR, & AC ARE ALTERED)

/

	LAC	(401000)/DECLARE A SIGNIFICANT EVENT

	ISA

/

	LAC	(POOL)	/RETURN REQUEST NODE TO POOL

	DAC*	(R1)

			/(R2 IS ALREADY SETUP)

	JMS*	(NADD)

/

	JMP*	SEVRN	/EXIT 'SEVRN' SUBROUTINE

/

/ EXIT REQUEST (FROM TASK "...REA")

/
DAEX	LAC	(POOL)	/RETURN REQUEST NODE TO POOL

	DAC*	(R1)

	LAC	RN

	DAC*	(R2)
	JMS*	(NADD)
	CAL	DCPB	/DISSCCCONNECT
/
	ISZ	PDVTA	/CLEAR ASSIGN INHIBIT FLAG IN PDVL NODE

	.INH

	DZM*	PDVTA

	.ENB
	CAL	(10)	/EXIT
/
	.EJECT
/ INTERRUPT SERVICE ROUTINE

/
INT	0			/ INTERRUPT ENTRY POINT
	DBA			/ ENTER INDEX (PAGE) MODE
	DAC	ACBF		/ SAVE AC
	DCCF			/ CLEAR FLAG
	SET	EV		/ SET INTERNAL EVENT VARIABLE
	LAC	(401000		/ DECLARE A SIGNIFICANT EVENT
	ISA
	LAC	ACBF		/ RESTORE AC
	DBR			/ RETURN TO INTERRUPTED PROGRAM
	JMP*	INT

/

XADJ	0	/XR ADJUST CONSTANT TO SUBTRACT PAGE BITS

ACBF	0	/AC BUFFER
UWC		/ USER WORD COUNT HELD HERE
CTBLX		/ XR VALUE TO POINT TO CONTROL TABLE OR HEADER WORD 0

EV	0	/EVENT VARIABLE

MI	0	/MODE INDICATOR

RN	0	/ADDRESS OF REQUEST NODE PICKED FROM QUEUE

TG	0	/TRIGGER EVENT VARIABLE

/

PDVNA	0	/PHYSICAL DEVICE NODE ADDRESS

PDVTA	0	/ADDRESS OF ADR OF TRIGGER EV IN PHY DEV NODE

/

TEMP1	0

/

WFTCPB	20		/WAIT FOR TRIGGER

	TG
CCPB	11	/CONNECT CPB
	EV
	DCAPI-40
	INT
/
DCPB	12	/DISCONNECT CPB
	0
	DCAPI-40

	INT

/
WFECPB	20	/WAIT FOR EVENT VARIABLE CPB

	EV
/
HNAM	.SIXBT	'DC@@@@'	/ DEVICE NAME (HANDLER TASK NAME IS 'DC....')
	.END	DC
