	.TITLE     ***  BDOPEN -- ASSIGN & OPEN JOB FILES

 

 

 

 

/

/ COPYRIGHT (C) 1976

/ DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

/

/ THIS SOFTWARE IS FURNISHED UNDER A LICENSE FOR USE ONLY

/ ON A SINGLE COMPUTER SYSTEM AND MAY BE COPIED ONLY WITH

/ THE INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS

/ SOFTWARE, OR ANY OTHER COPIES THEREOF, MAY NOT BE PRO-

/ VIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON

/ EXCEPT FOR USE ON SUCH SYSTEM AND TO ONE WHO AGREES TO

/ THESE LICENSE TERMS.  TITLE TO AND OWNERSHIP OF THE

/ SOFTWARE SHALL AT ALL TIMES REMAIN IN DEC.

/

/ THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE

/ WITHOUT NOTICE AND SHOULD NOT BE CONSTRUED AS A COM-

/ MITMENT BY DIGITIAL EQUIPMENT CORPORATION.

/

/ DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY

/ OF ITS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.

/

	.TITLE DESCRIPTION AND EDIT HISTORY

 

 

 

 

/

/ BDOPEN

/

/ BDOPEN ASSIGNS THE DEVICES FOR THE JOB'S INPUT AND LISTING

/ FILES, THEN OPENS THE FILES.

/

/ JOB INITIALIZATION IS COMPLETED BY THE OVERLAY BDMSSG.  THIS

/ OVERLAY (BDOPEN) EXITS TO BDMSSG WITH THE NAME OF THE LISTING

/ DEVICE (EITHER "TT" OR "LP") IN .SIXBT IN THE LOW 12 BITS

/ OF THE AC (THE HIGH SIX BITS ARE ZERO).  FOR MORE INFORMATION

/ SEE AS.LST AND BDMSSG.

/

 

 

 

 

/

/ 100	20-AUG-76 (EAG)		INITIAL VERSION FOR MULTIACCESS

/				BATCH.

/

	.TITLE MISCELLANEOUS ASSEMBLY CONSTANTS & MACROS

 

 

 

 

/

/ NOTE:  THIS PROGRAM USES NO ASSEMBLY PARAMETERS.  ALL

/	 PARAMETERIZED VALUES ARE OBTAINED FROM THE

/	 RESIDENT SECTION VIA INITIALIZATION CODE.

/

 

 

 

LP=142000			/ .SIXBT "LP@" (LEFT-

				/ JUSTIFIED).  USED TO NAME

				/ DEFAULT LISTING DEVICE.

 

TT=242400			/ .SIXBT "TT@" (LEFT-

				/ JUSTIFIED).  USED IN ASSIGN

				/ COMMANDS TO ASSIGN LISTING

				/ OUTPUT TO BATCH HANDLER, SO

				/ THAT BATCH HANDLER CAN COPY

				/ TO LISTING DEVICE.

 

 

 

/

/ INDIRECT-INDEXED INSTRUCTION MNEMONICS:

/

 

DACIX=DAC* X

DZMIX=DZM* X

LACIX=LAC* X

SADIX=SAD* X

 

 

 

/

/ SPECIAL INSTRUCTIONS:

/

 

.INH=705522			/ INHIBIT INTERRUPTS.

.ENB=705521			/ ENABLE INTERRUPTS.

 

 

 

/

/ DEFINE MACRO TO WAIT UNTIL NEXT SIGNIFICANT EVENT:

/

 

	.DEFIN WAIT

	  CAL (05)

	.ENDM

 

 

 

/

/ MACRO TO SET ERROR FLAGS IN JOBERR:

/

 

	.DEFIN ERROR FLAG

	  LAC (FLAG)

	  JMS* ERRFLG

	.ENDM

 

 

 

/

/ MACRO TO DECLARE SIGNIFICANT EVENT.

/

 

	.DEFIN .SET6

	  LAC (401000)

	  ISA

	.ENDM

 

 

 

/

/ MACRO TO RAISE OURSELVES TO API LEVEL 6, SO AS TO LOCKOUT

/ CONTEXT SWITCHES.

/

 

	.DEFIN .RTL6

	  LAC (400002)

	  ISA

	.ENDM

 

 

 

/

/ DEFINE DEBUGGING AID MACRO:

/

 

	.DEFIN .DEBUG MESSAG,WORD,FORM

	.ENDM

 

	.IFDEF %DEBUG

 

	.DEFIN .DEBUG MESSAG,WORD,FORM

	  .NOLST

	  .GLOBL .DBG

	  JMS* .DBG

	    .ASCII MESSAG@<0>

	    .DSA FORM

	    .DSA WORD

	  .LST

	.ENDM

 

	.ENDC

	.TITLE REFERENCES TO EXECUTIVE'S SCOM AREA

 

 

 

 

/

/ AUTO-INCREMENT REGISTERS:

/

 

X16=16

 

 

 

/

/ REENTRANT REGISTERS USED TO INTERFACE TO REENTRANT

/ ROUTINES:

/

 

R1=101

 

 

 

/

/ REENTRANT SYSTEM ROUTINE ENTRY POINTS:

/

 

PENP=115			/ PICK AN EMPTY NODE FROM THE

				/ POOL (SKIP IF SUCCESSFUL),

				/ RETURN NODE ADDRESS IN

				/ R1, R2, AND AC.

 

SPRI=126			/ INSERT NODE IN R2 INTO

				/ PRIORITY ORDERED LISTHEAD

				/ IN R1.

 

 

 

/

/ POINTER TO ACTIVE TASK LIST NODE OF CURRENTLY ACTIVE

/ TASK -- I.E., POINTER TO BATCH'S ACTIVE TASK LIST NODE,

/ SINCE WE WILL ONLY EXAMINE THIS WHEN BATCH IS ACTIVE.

/

 

CURTSK=135

 

 

 

/

/ POINTERS TO I/O TABLES INDEXED BY LUN NUMBER:

/

 

LUTP1=142			/ POINTER TO LUT (LOGICAL

				/ UNIT TABLE).

 

LUTP2=143			/ POINTER TO END OF LUT.

 

AFTP1=144			/ POINTER TO AFT (ATTACH

				/ FLAG TABLE).

 

 

 

/

/ QUEUE LISTHEADS:

/

 

PDVL=252			/ PHYSICAL DEVICE LIST.

 

 

 

/

/ POINTER TO I/O TABLE INDEXED BY LUN NUMBER:

/

 

LUFD1=304			/ POINTER TO LUN-UFD TABLE.

	.TITLE NODE FORMAT DEFINITIONS

 

 

 

 

/

/ REFERENCES TO ATL NODES:

/

 

A.PB=5				/ POINTER TO TASK'S PBDL NODE.

A.SN=6				/ POINTER TO TASK'S STL NODE.

 

 

 

/

/ REFERENCES TO PDVL NODES:

/

 

D.FP=0				/ FORWARD POINTER.

D.N1=2				/ DEVICE NAME.

D.UN=5				/ DEVICE UNIT NUMBER.

D.QF=6				/ I/O REQUEST QUEUE LISTHEAD.

D.TG=10				/ TRIGGER EVENT VARIABLE

				/ ADDRESS (I.E. POINTER).

D.AI=11				/ ASSIGN INHIBIT FLAG IS SIGN

				/ BIT, PLUS OTHER FLAGS.

	.TITLE REFERENCES TO BDRES AND OTHER BATCH OVERLAYS

 

 

 

 

/

/ DEFINE ENTRY POINT TO THIS OVERLAY:

/

 

	.GLOBL BDOPEN

 

 

 

/

/ DEFINE ENTRY POINTS TO BATCH OVERLAYS WHICH

/ THIS OVERLAY EXITS TO.  BDOPEN NORMALLY EXITS

/ TO BDMSSG; IT EXITS TO BDFINI WHEN A JOB HAS

/ BEEN CANCELLED.

/

 

	.GLOBL BDMSSG

	.GLOBL BDFINI

 

 

 

/

/ DEFINE ENTRY POINT TO BATCH SYSTEM ERROR PROCESSOR:

/

 

	.GLOBL BDABRT

 

 

 

/

/ DEFINE ENTRY POINTS TO ROUTINES IN RESIDENT SECTION:

/

 

	.GLOBL ISSUE		/ ROUTINE TO ISSUE CPB'S.

 

	.GLOBL ERRFLG		/ ROUTINE TO SET ERROR

				/ FLAG BITS IN LOCATION

				/ JOBERR.

 

 

 

/

/ DEFINE REFERENCES TO CURRENT JOB NODE IMAGE (PRIMARY NODE):

/

 

	.GLOBL JBNAM1		/ FIRST WORD OF JOB NAME.

 

	.GLOBL JBNAM2		/ SECOND WORD OF JOB NAME.

 

	.GLOBL JBID		/ JOB ID OR SEQUENCE NUMBER.

 

 

 

/

/ DEFINE REFERENCES TO CURRENT JOB NODE IMAGE (SECONDARY NODE):

/

 

	.GLOBL INDVU		/ INPUT DEVICE AND UNIT.

 

	.GLOBL INUFD		/ INPUT UFD.

 

	.GLOBL LSTDVU		/ LISTING DEVICE AND UNIT.

 

	.GLOBL LSTUFD		/ LISTING UFD.

 

 

 

/

/ ERROR FLAG BITS WITHIN JOBERR:

/

/	SIGN BIT -- TERMINATE JOB AT NEXT TDV READ.

/

/	ALL OTHER BITS -- INDICATE SOME SPECIFIC CAUSE OF JOB

/			TERMINATION.  MOST BITS ARE SET WHILE

/			SIMULTANEOUSLY SETTING THE SIGN BIT,

/			THUS STOPPING THE JOB AT NEXT TDV READ.

/			SOME ERRORS ALSO SIMULATE A ^Y, WHICH

/			CAUSES A TDV READ, THUS ABORTING THE

/			JOB IMMEDIATELY.  OTHER ERRORS SET A

/			BIT HERE AND SET JOBFND TO +3, CAUSING

/			A SCAN TO A $ERR CARD, THUS KILLING

/			THE JOB.  NOTE, HOWEVER, THAT A ^Y

/			SHOULD BE SIMULATED AND/OR JOBFND SET

/			TO +3 ONLY IF JOBFND IS CURRENTLY

/			+2 OR +3 (REMEMBER THAT JOBFND RANGES

/			FROM 0 TO +3).  IF JOBFND IS NOT +2

/			OR +3, ONLY THE ERROR FLAG BITS IN

/			JOBERR SHOULD BE SET.  ALSO NOTE THAT

/			ALL MANIPULATIONS OF THESE LOCATIONS

/			MUST TAKE PLACE WITH INTERRUPTS

/			INHIBITED.

/

/ THIS WORD IS PASSED TO THE JOB END PROCESSOR (END...) TO

/ TELL IT THE REASONS FOR JOB TERMINATION.

/

/ IF ANY BIT IN JOBERR IS SET BEFORE THE JOB IS LOGGED IN

/ TO TDV, THE ENTIRE JOB IS ABORTED.  THIS EVEN APPLIES TO

/ ERRORS WHICH NORMALLY CAUSE A SCAN TO A $ERR CARD.

/

/ SPECIFIC BIT DEFINITIONS:

/

 

JE.IN=200000+400000		/ ASSIGNMENT FAILURE WITH

				/ JOB INPUT FILE.

 

JE.SK=100000+400000		/ SEEK ERROR WITH JOB INPUT

				/ FILE.

 

JE.LST=040000+400000		/ ASSIGNMENT FAILURE WITH

				/ JOB LISTING OUTPUT FILE.

 

JE.NTR=020000+400000		/ ENTER ERROR WITH JOB LISTING

				/ OUTPUT FILE.

 

 

 

/

/ LOCATIONS WHICH SAVE EVENT VARIABLE VALUES PERTINENT TO

/ SPECIFIC ERRORS FLAGGED IN JOBERR:

/

 

	.GLOBL SK.EV		/ SAVE JOB COMMAND INPUT FILE

				/ SEEK EV VALUE (JE.SK ERROR).

 

	.GLOBL NTR.EV		/ SAVE LISTING OUTPUT FILE EN-

				/ TER EV VALUE (JE.NTR ERROR).

 

 

 

/

/ REFERENCES TO CPB'S AND ASSOCIATED EVENT VARIABLES:

/

 

	.GLOBL IN.CPB,IN.EV	/ CPB TO READ LINE FROM JOB

				/ INTO IN.BFR.

 

 

 

/

/ REFERENCES TO WORDS CONTAINING LUN NUMBERS:

/

 

	.GLOBL IN.LUN		/ JOB FILE INPUT LUN.

 

	.GLOBL LP.LUN		/ LISTING OUTPUT LUN.

	.TITLE BDOPEN MAIN ENTRY POINT

 

 

 

 

/

/ COME HERE WITH JOB QUEUE NODE IMAGE IN RESIDENT SECTION

/ CONTAINING JOB TO BE RUN.

/

 

 

BDOPEN	0

	.DEBUG <"BDOPEN ENTERED.">,0,0

	JMP AS.IN		/ GO ASSIGN INPUT DEVICE.

	.TITLE AS.IN -- ASSIGN INPUT DEVICE AND OPEN JOB FILE

 

 

 

 

/

/ COME HERE TO ASSIGN THE JOB INPUT DEVICE (INDVU/INUFD)

/ AND OPEN THE JOB FILE.  IF THE JOB FILE IS ASSIGNED AND

/ OPENED SUCCESSFULLY, A READ IS ISSUED TO READ THE FIRST

/ LINE OF THE JOB FILE.  ANY ERRORS ARE INDICATED WITH

/ APPROPRIATE FLAGS IN JOBERR, EXCEPT IF THE INPUT LUN IS

/ ALREADY ASSIGNED.  IF THE ASSIGN SUBROUTINE DETECTS THIS

/ CONDITION, IT DECLARES A FATAL SYSTEM ERROR AND TRANSFERS

/ TO BDABRT.

/

/ THIS ROUTINE ALSO CHECKS FOR JOB CANCELLATIONS.  IF A JOB

/ HAS BEEN CANCELLED (I.E., IF ITS JOB ID IS ZERO) THIS

/ ROUTINE ASSIGNS THE INPUT DEVICE, THEN TRANSFERS TO BDFINI

/ WHICH WILL DELETE THE JOB FILE IF NECESSARY.

/

 

 

AS.IN	JMS ASSIGN		/ ASSIGN THE INPUT DEVICE.

	  LAC* INDVU		/ DEVICE/UNIT SPECIFICATION.

	  LAC* IN.LUN		/ INPUT LUN #.

	  LAC* INUFD		/ UFD NAME.

	  JMP ASIN.A		/ ERROR RETURN.

	LAC* JBID		/ HAS JOB BEEN CANCELLED?

	SNA			/ SKIP IF NOT.

	JMS* BDFINI		/ JMP IF JOB CANCELLED.

	LAC* IN.LUN		/ SET UP SEEK CPB TO OPEN

	DAC ASIN.0		/ JOB INPUT FILE.

	LAC* JBNAM1

	DAC ASIN.1

	LAC* JBNAM2

	DAC ASIN.2

	JMS* ISSUE		/ OPEN JOB INPUT FILE.

	  ASIN.C

	CAL ASIN.D		/ WAIT FOR SEEK TO FINISH.

	.DEBUG <"BDOPEN:AS.IN -- JOB FILE SEEK EV = ">,ASIN.3,10

	LAC ASIN.3		/ FETCH E.V. VALUE.

	DAC* SK.EV		/ SAVE IN RESIDENT SECTION.

	SPA			/ SKIP IF SUCCESSFULL.

	SAD (-6)

	JMP ASIN.B		/ JMP IF SUCCESSFULL OR DEVICE

				/ NON-FILE ORIENTED.

				/ ALL OTHER VALUES ARE REAL

				/ ERRORS, SO ABORT JOB.

	ERROR JE.SK		/ SET SEEK ERROR FLAG.

	CLA!IAC			/ SET E.V. FOR READ COMPLETION,

	DAC* IN.EV		/ SINCE WE WON'T ISSUE A READ.

	JMP AS.LST		/ GO ASSIGN LISTING DEVICE.

 

 

/ COME HERE IF ASSIGN FAILS.  ABORT THE JOB.

 

ASIN.A	ERROR JE.IN		/ SET INPUT ASSIGN ERROR FLAG.

	CLA!IAC			/ SET E.V. FOR READ COMPLETION,

	DAC* IN.EV		/ SINCE WE WON'T ISSUE A READ.

	JMP AS.LST		/ GO ASSIGN LISTING DEVICE.

 

 

/ COME HERE IF SEEK IS SUCCESSFUL OR ILLEGAL FUNCTION.

 

ASIN.B	JMS* ISSUE		/ ISSUE READ TO INPUT DEVICE.

	  IN.CPB+400000

	JMP AS.LST		/ GO ASSIGN LISTING DEVICE.

 

 

/ CPB TO SEEK JOB FILE ON INPUT DEVICE.

 

ASIN.C	3200

	ASIN.3

ASIN.0	0			/ LUN.

ASIN.1	.SIXBT "@@@"		/ JOB INPUT FILE NAME --

ASIN.2	.SIXBT "@@@"		/ ALSO JOB NAME.

	.SIXBT "JOB"		/ EXTENSION ALWAYS "JOB".

 

 

/ CPB TO WAITFOR SEEK TO COMPLETE.

 

ASIN.D	20

	ASIN.3

 

 

ASIN.3	0			/ SEEK EVENT VARIABLE

	.TITLE AS.LST -- ASSIGN LISTING OUTPUT DEVICE

 

 

 

 

/

/ COME HERE TO ASSIGN THE LISTING OUTPUT DEVICE AND OPEN

/ THE JOB LISTING FILE.  IF NO LISTING DEVICE WAS SPECIFIED

/ (I.E., IF LSTDVU IS ZERO) THE LINE PRINTER IS ASSIGNED.

/ IF A LISTING DEVICE WAS SPECIFIED, IT WILL BE ASSIGNED,

/ AND THE JOB LISTING FILE WILL BE OPENED.  IF AN ERROR

/ IS DETECTED WHILE ASSIGNING A SPECIFIED LISTING DEVICE,

/ OR WHILE OPENING THE JOB LISTING FILE, THE APPROPRIATE

/ ERROR FLAG WILL BE SET IN JOBERR AND THE LINE PRINTER

/ WILL BE USED.  IF THE LINE PRINTER CANNOT BE ASSIGNED,

/ A FATAL SYSTEM ERROR IS DECLARED AND WE TRANSFER TO

/ BDABRT.  NOTE THAT IN EITHER CASE, IF THE LISTING LUN

/ IS ALREADY ASSIGNED A FATAL SYSTEM ERROR IS DECLARED.

/

/ WHEN DONE HERE, WE EXIT TO BDMSSG WITH THE AC

/ CONTAINING EITHER "TT" OR "LP" IN RIGHT-JUSTIFIED

/ .SIXBT.  "TT" IS PASSED WHEN A LISTING DEVICE IS SPEC-

/ IFIED, HAS BEEN SUCCESSFULLY ASSIGNED, AND THE

/ LISTING FILE SUCCESSFULLY OPENED.  "LP" IS PASSED

/ WHENEVER ANY OF THESE CONDITIONS ARE NOT MET --

/ I.E., WHENEVER THE DEFAULT LISTING DEVICE (THE

/ LINE PRINTER) IS USED.

/

 

 

AS.LST	LAC* LSTDVU		/ WAS A LISTING DEVICE

	SNA			/ SPECIFIED? SKIP IF YES.

	JMP ASLS.B		/ JMP IF NOT -- USE L.P.

	JMS ASSIGN		/ ASSIGN LISTING DEVICE

	  LAC* LSTDVU		/ TO LISTING LUN.

	  LAC* LP.LUN

	  LAC* LSTUFD

	  JMP ASLS.A		/ JMP IF ASSIGN ERROR.

	LAC* LP.LUN		/ SET UP ATTACH CPB TO ATTACH

	DAC ASLS.4		/ LISTING DEVICE.

	JMS* ISSUE		/ ATTACH LISTING DEVICE.

	  ASLS.G

	LAC* LP.LUN		/ SET UP ENTER CPB TO OPEN

	DAC ASLS.0		/ LISTING OUTPUT FILE.

	LAC* JBNAM1

	DAC ASLS.1

	LAC* JBNAM2

	DAC ASLS.2

	JMS* ISSUE		/ OPEN LISTING OUTPUT FILE.

	  ASLS.E

	CAL ASLS.F		/ WAITFOR ENTER TO FINISH.

	.DEBUG <"BDOPEN:AS.LST -- LST FILE ENTER EV = ">,ASLS.3,10

	LAC ASLS.3		/ CHECK COMPLETION STATUS.

	DAC* NTR.EV		/ SAVE IN RESIDENT SECTION.

	SPA			/ SKIP IF SUCCEEDED.

	SAD (-6)

	JMP ASLS.C		/ JMP IF SUCCEEDED OR DEVICE

				/ NON-FILE ORIENTED.

	LAC* LP.LUN		/ OPEN FAILURE -- DETACH

	DAC ASLS.5		/ LISTING DEVICE,

	JMS* ISSUE

	  ASLS.H

	CAL ASLS.I		/ WAITFOR DETACH TO COMPLETE.

	LAC* LP.LUN		/ THEN DEASSIGN

	JMS DEASSGN		/ LISTING DEVICE.

	ERROR JE.NTR		/ SET ENTER ERROR FLAG.

	JMP ASLS.B		/ GO ASSIGN LINE PRINTER.

 

 

/ COME HERE IF ASSIGN TO LISTING DEVICE FAILS.  SET ERROR

/ FLAG TO ABORT JOB, THEN USE LINE PRINTER FOR LISTING DEVICE.

 

ASLS.A	ERROR JE.LST		/ SET LST ASSIGN ERROR FLAG

/ COME HERE TO ASSIGN LINE PRINTER

ASLS.B	JMS ASSIGN		/ ASSIGN LINE PRINTER.

	  LAC (LP)		/ LEFT-JUSTIFIED .SIXBT "LP"

	  LAC* LP.LUN

	  CLA			/ NO UFD.

	  JMP ASLS.D		/ JMP IF ASSIGN ERROR.

	LAC (LP/100)		/ EXIT TO BDMSSG WITH "LP"

	SKP			/ RIGHT-JUSTIFIED IN AC,

ASLS.C	LAC (TT/100)		/ OR WITH "TT" RIGHT-JUSTIFIED

	JMS* BDMSSG		/ IN AC.

 

 

/ COME HERE IF CAN'T ASSIGN LINE PRINTER.  DECLARE FATAL

/ SYSTEM ERROR BY TRANSFERING TO BDABRT.

 

ASLS.D	LAW -301

	JMS* BDABRT

 

 

/ ENTER CPB TO OPEN LISTING OUTPUT FILE

 

ASLS.E	3300

	ASLS.3

ASLS.0	0			/ LUN

ASLS.1	.SIXBT "@@@"		/ JOB NAME SAME AS JOB

ASLS.2	.SIXBT "@@@"		/ INPUT FILE NAME.

	.SIXBT "LST"		/ EXTENSION ALWAYS "LST".

 

 

/ WAITFOR CPB TO WAIT FOR ENTER TO COMPLETE.

 

ASLS.F	20

	ASLS.3

 

 

ASLS.3	0			/ EVENT VARIABLE FOR ENTER.

 

 

/ ATTACH CPB TO ATTACH LISTING DEVICE.

 

ASLS.G	2400

	0

ASLS.4	0			/ LUN

 

 

/ DETACH CPB TO DETACH LISTING DEVICE IF ENTER FAILS.

 

ASLS.H	2500

	ASLS.6

ASLS.5	0			/ LUN

 

 

/ WAITFOR CPB TO WAIT FOR DETACH TO COMPLETE.

 

ASLS.I	20

	ASLS.6

 

 

/ DETACH EVENT VARIABLE.

 

ASLS.6	0

	.TITLE DELAY -- SUBROUTINE TO DELAY FOR ONE SECOND

 

 

 

 

/

/ THIS SUBROUTINE DELAYS FOR ONE SECOND VIA A MARK, WAITFOR

/ DIRECTIVE SEQUENCE.

/

/ CALLING SEQUENCE:

/	JMS DELAY

/

/ REGISTERS ALTERED:

/	ALL (CAL'S ARE ISSUED)

/

/ VALUES RETURNED:

/	NONE

/

 

 

DELAY	0

	JMS* ISSUE

	  DLY.A

	CAL DLY.B

	JMP* DELAY

 

 

/ MARK CPB FOR ONE SECOND DELAY

 

DLY.A	13

	DLY.0

	1			/ INTERVAL = 1 SECOND

	2			/ UNITS = SECONDS

 

 

/ WAITFOR CPB

 

DLY.B	20

	DLY.0

 

 

/ EVENT VARIABLE

 

DLY.0	0

	.TITLE ASSIGN -- ASSIGN A DEVICE TO A LUN

 

 

 

 

/

/ THIS SUBROUTINE ACCEPTS A DEVICE/UNIT SPECIFICATION,

/ A LUN NUMBER, AND A UFD NAME AND ASSIGNS THE DEVICE/

/ UNIT/UFD TO THE LUN.  PRIOR TO CALLING THIS ROUTINE,

/ THE LUN MUST BE ASSIGNED TO NONE, ELSE A FATAL SYSTEM

/ ERROR WILL BE DECLARED (VIA JMS* BDABRT).

/

/ THE ARGUEMENTS ARE PASSED VIA THREE INSTRUCTIONS WHICH

/ IMMEDIATELY FOLLOWS THE JMS.  THESE INSTRUCTIONS, WHEN

/ EXECUTED, LOAD THE AC WITH APPROPRIATE INFORMATION.

/ THE DEVICE/UNIT SPECIFICATION IS A SINGLE WORD WITH

/ THE DEVICE NAME (IN .SIXBT) IN THE HIGH 12 BITS AND THE

/ UNIT NUMBER (IN BINARY) IN THE LOW 6 BITS.

/

/ AS STATED ABOVE, IF THE LUN IS ALREADY ASSIGNED A FATAL

/ SYSTEM ERROR RESULTS.  IF THE ASSIGNMENT FAILS FOR ANY

/ OTHER REASON, THE ERROR RETURN IS TAKEN.  THE NORMAL RETURN

/ IS TAKEN IF AND ONLY IF THE ASSIGN SUCCEEDS.

/

/ CALLING SEQUENCE:

/	JMS ASSIGN

/	  LAC (DEVICE/UNIT SPECIFICATION)

/	  LAC (LUN #)

/	  LAC (.SIXBT UFD NAME)

/	  < ERROR RETURN >

/	< NORMAL RETURN >

/

/ REGISTERS ALTERED:

/	ALL

/

/ VALUES RETURNED:

/	NONE

/

 

 

ASSIGN	0

	XCT* ASSIGN		/ PICK UP DEVICE/UNIT SPEC.

	AND (777700)		/ MASK OUT DEVICE NAME.

	DAC ASSN.3		/ SAVE FOR PDVL SEARCH LOOP.

	AAC 56			/ APPEND "." FOR HANDLER TASK

	DAC ASSN.0		/ NAME AND STORE IN FIX,

	DAC ASSN.1		/ REQUEST, AND UNFIX CPB'S.

	DAC ASSN.2

	.DEBUG <"BDOPEN:ASSIGN -- HANDLER NAME:  ">,ASSN.0,70

	XCT* ASSIGN		/ PICK UP DEVICE/UNIT SPEC.

	AND (77)		/ MASK OUT UNIT NUMBER

	DAC ASSN.4		/ SAVE FOR PDVL SEARCH LOOP.

	.DEBUG <<11><11>"UNIT NUMBER:  ">,ASSN.4,40

	ISZ ASSIGN		/ BUMP TO LUN #.

	LAC* (PDVL)		/ SEARCH PDVL FOR DEVICE/UNIT

ASSN.A	SAD (PDVL)		/ NODE.

	JMP ASSN.E		/ JMP IF NOT FOUND -- ILLEGAL

				/ DEVICE/UNIT -- ERROR RETURN.

	DAC ASSN.5		/ SAVE PDVL NODE ADDR., IN CASE

	PAX			/ THIS IS THE ONE WE WANT.

	LAC ASSN.3		/ MATCH DEVICE NAME,

	SADIX (D.N1)

	SKP			/ (SKIP IF NAMES MATCH)

	JMP ASSN.B		/ (JMP IF NAMES DIFFERENT)

	LAC ASSN.4		/ AND MATCH UNIT NUMBER.

	SADIX (D.UN)		/ SKIP IF DIFFERENT.

	JMP ASSN.C		/ JMP IF DEVICE/UNIT FOUND.

ASSN.B	LACIX (D.FP)		/ TRY NEXT NODE.

	JMP ASSN.A

 

 

/ COME HERE WHEN WE'VE FOUND THE DESIRED PDVL NODE.

/ PDVL NODE ADDRESS IS IN ASSN.5; ASSN.3 AND ASSN.4

/ CAN NOW BE USED FOR SCRATCH STORAGE.

 

ASSN.C	.DEBUG <<11><11>"PDVL NODE ADDRESS:  ">,ASSN.5,20

	XCT* ASSIGN		/ PICK UP LUN NUMBER.

	.DEBUG <<11><11>"LUN NUMBER:  ">,-1,40

	AAC -1			/ CALCULATE LUT TABLE

	TAD* (LUTP1)		/ ENTRY ADDRESS.

	DAC ASSN.3		/ SAVE FOR LATER.

	ISZ ASSIGN		/ BUMP TO UFD NAME.

	LAW -10			/ SET UP RETRY COUNTER.

	DAC ASSN.4

/ COME HERE TO ATTEMPT TO COMPLETE ASSIGN IN ONE FELL SWOOP.

/ IF CAN'T BE DONE, GO TO ROUTINES WHICH ATTEMPT TO REMEDY THE

/ PROBLEM, THEN DELAY A WHILE TO LET THINGS HAPPEN, AND THEN

/ FINALLY COME BACK HERE TO TRY AGAIN.  THIS WHOLE PROCESS

/ WILL ONLY ATTEMPT A LIMITED NUMBER OF RETRIES BEFORE

/ DECLARING THE ASSIGN A FAILURE.

ASSN.D	LAC ASSN.5		/ POINT XR TO PDVL NODE.

	PAX

	.INH			/// DON'T LET ANYTHING CHANGE.

	LAC* ASSN.3		/// IS LUN CURRENTLY ASSIGNED

	SZA			/// NONE?  SKIP IF IT IS.

	JMP ASSN.X		/// JMP IF LUN ASSIGNED --

				/// FATAL SYSTEM ERROR.

	LACIX (D.AI)		/// IS ASSIGN INHIBIT SET?

				/// (SET DURING HANDLER EXIT).

	SPA!CLA			/// SKIP IF ASSIGN INH. CLEAR.

	JMP ASSN.F		/// JMP IF ASSIGN INHIBITED --

				/// GO DELAY TO ALLOW HANDLER

				/// TO FINISH EXITTING.

	SADIX (D.TG)		/// IS HANDLER LOADED?

	JMP ASSN.G		/// JMP IF NOT -- GO REQUEST

				/// THE HANDLER.

	PXA			/// ALL CHECKS SUCCEED --

	DAC* ASSN.3		/// STORE PDVL NODE ADDR. IN

	LAC* (LUTP1)		/// LUT TABLE ENTRY, AND

	TCA			/// STORE UFD NAME IN THE

	TAD* (LUFD1)		/// LUN-UFD TABLE.

	PAX			///

	XCT* ASSIGN		/// PICK UP UFD NAME.

	.ENB			///

	DACIX ASSN.3		/// AND STORE IT AWAY.

	ISZ ASSIGN		/ BUMP TO APPROPRIATE RETURN,

	.DEBUG <<11><11>"ASSIGN IS SUCCESSFULL.">,0,0

ASSN.E	ISZ ASSIGN

	.DEBUG <<11>"ASSIGN RETURNING TO PC = ">,ASSIGN,20

	JMP* ASSIGN		/ AND RETURN!

 

 

/ COME HERE IF ASSIGN INHIBIT FLAG IS SET.  THIS IMPLIES

/ THAT A DISCONNECT-AND-EXIT DIRECTIVE HAS BEEN SENT TO

/ THE HANDLER, SO THAT IT IS IN THE PROCESS OF EXITTING.

/ DELAY TO ALLOW THE HANDLER EXIT TO COMPLETE, THEN RETRY

/ THE ASSIGN, WHICH WILL PRESUMABLY RE-REQUEST AND RE-LOAD

/ THE HANDLER.

 

ASSN.F	.ENB			/// COME HERE WITHIN .INH !

	.DEBUG <<11><11>"ASSIGN INHIBIT FLAG SET.">,0,0

	ISZ ASSN.4		/ CHECK RETRY COUNT.

	SKP			/ SKIP IF OK TO TRY AGAIN.

	JMP ASSN.E		/ JMP IF NOT -- ERROR RETURN.

	JMS DELAY		/ ALLOW HANDLER TO EXIT.

	JMP ASSN.D		/ AND GO RETRY ASSIGN.

 

 

/ COME HERE IF HANDLER IS NON-RESIDENT.  LOAD HANDLER VIA

/ FIX-REQUEST-UNFIX SEQUENCE TO ENSURE THAT IT REALLY GETS

/ LOADED.

 

ASSN.G	.ENB			/// COME HERE WITHIN .INH !

	ISZ ASSN.4		/ CHECK RETRY COUNT.

	SKP			/ SKIP IF OK TO TRY AGAIN.

	JMP ASSN.E		/ JMP IF NOT -- ERROR RETURN.

	JMS* ISSUE		/ ATTEMPT TO FIX HANDLER IN

	  ASSN.K		/ CORE.

	.DEBUG <<11><11>"HANDLER FIXED, EV = ">,ASSN.6,10

	LAC ASSN.6		/ CHECK COMPLETION STATUS.

	SAD (1)

	JMP ASSN.H		/ JMP IF SUCCEEDED -- TRY RE-

	SAD (-207)		/ QUEST NEXT.

	JMP ASSN.H		/ JMP IF ALREADY FIXED --

	SAD (-202)		/ TRY REQUEST NEXT.

	JMP ASSN.J		/ JMP IF TASK ACTIVE -- DELAY,

				/ THEN TRY AGAIN.

	JMP ASSN.E		/ ALL OTHERS -- ERROR RETURN.

 

 

/ COME HERE AFTER HANDLER HAS BEEN FIXED IN CORE TO

/ ATTEMPT TO REQUEST HANDLER.

 

ASSN.H	JMS DELAY		/ DELAY, SO FIX CAN FINISH

				/ LOADING HANDLER.

	JMS* ISSUE		/ REQUEST THE HANDLER.

	  ASSN.L

	.DEBUG <<11><11>"HANDLER REQUESTED, EV = ">,ASSN.6,10

	LAC ASSN.6		/ CHECK REQUEST STATUS.

	SAD (1)

	JMP ASSN.I		/ JMP IF SUCCEEDED -- GO UNFIX

	ISZ ASSN.4		/ CHECK RETRY COUNT, AND RE-

	JMP ASSN.H		/ REQUEST IF NOT USED UP.

	LAW -1			/ ELSE CAUSE ERROR ON NEXT

	DAC ASSN.4		/ RETRY, THEN UNFIX.

ASSN.I	CAL ASSN.M		/ UNFIX HANDLER TASK.

ASSN.J	JMS DELAY		/ DELAY SO THINGS CAN HAPPEN

	JMP ASSN.D		/ RE-ATTEMPT ASSIGN.

 

 

/ CPB TO FIX DEVICE HANDLER TASK IN CORE.

 

ASSN.K	15

	ASSN.6

ASSN.0	.SIXBT "@@."		/ INITIALIZED TO DEVICE NAME.

	.SIXBT "..."

 

 

/ CPB TO REQUEST DEVICE HANDLER TASK.

 

ASSN.L	01

	ASSN.6

ASSN.1	.SIXBT "@@."		/ INITIALIZED TO DEVICE NAME.

	.SIXBT "..."

	0			/ USE DEFAULT PRIORITY

 

 

/ CPB TO UNFIX DEVICE HANDLER TASK.

 

ASSN.M	16

	0

ASSN.2	.SIXBT "@@."		/ INITIALIZED TO DEVICE NAME.

	.SIXBT "..."

 

 

 

/ COME HERE IF LUN IS ALREADY ASSIGNED.

 

ASSN.X	.ENB			///

	LAW -303		/ GIVE FATAL SYSTEM ERROR.

	JMS* BDABRT

 

 

 

 

ASSN.3	0			/ TEMPORARY -- DEVICE NAME OR

				/ LUT TABLE ENTRY POINTER.

 

ASSN.4	0			/ TEMPORARY -- UNIT NUMBER OR

				/ ASSIGN RETRY COUNTER.

 

ASSN.5	0			/ PDVL NODE POINTER.

 

ASSN.6	0			/ EVENT VARIABLE FOR FIX &

				/ REQUEST CPB'S.

	.TITLE DEASSGN -- SUBROUTINE TO DEASSIGN A LUN

 

 

 

 

/

/ THIS SUBROUTINE ACCEPTS A LUN NUMBER IN THE AC AND DEASSIGNS

/ THAT LUN -- I.E., IT ASSIGNS IT TO "NONE".  THE LUN/DEVICE

/ MUST NOT BE ATTACHED TO A TASK.  IF IT IS, A FATAL BATCH

/ SYSTEM ERROR IS DECLARED.  NOTE THAT IF THE HANDLER IS

/ NON-RESIDENT (TRIGGER EVENT VARIABLE ADDRESS IN PDVL NODE

/ IS ZERO) NO ERROR WILL BE DECLARED.

/

/ CALLING SEQUENCE:

/	LAC (LUN NUMBER)

/	JMS DEASSGN

/

/ REGISTERS ALTERED:

/	ALL

/

/ VALUES RETURNED:

/	NONE

/

 

 

DEASSGN	0

	.DEBUG <"BDOPEN:DEASSGN -- LUN NUMBER:  ">,-1,40

	AAC -1			/ GET OFFSET FROM TABLE BASE

	PAX			/ IN XR.

/

	LAC* (LUTP1)		/ COPY ADDRESSES OF LUT, AFT,

	DAC DSSG.0		/ AND LUN-UFD TABLES TO

	LAC* (AFTP1)		/ TEMPORARIES SO THAT WE

	DAC DSSG.1		/ CAN INDIRECT THROUGH THEM.

	LAC* (LUFD1)

	DAC DSSG.2

/

	.INH			/// .INH WHILE CHANGING TABLES.

	LACIX DSSG.1		/// VERIFY NOT ATTACHED.

	SZA			/// SKIP IF NOT ATTACHED.

	JMP DSSG.J		/// JMP IF ATTACHED -- ERROR.

	LACIX DSSG.0		/// FETCH PDVL NODE ADDRESS.

	DZMIX DSSG.0		/// ASSIGN TO NONE.

	.ENB			///

	DZMIX DSSG.2		/// ZERO UFD NAME.

/

	.DEBUG <<11><11>"OLD PDVL ADDRESS:  ">,-1,20

	SNA			/ WAS LUN ASSIGNED TO NONE?

	JMP DSSG.H		/ JMP IF YES -- RETURN TO

				/ CALLER.

	DAC DSSG.0		/ SAVE PDVL NODE ADDRESS.

/ COME HERE WITH PDVL NODE ADDRESS IN DSSG.0.  SCAN LUT,

/ AND REQUEST HANDLER EXIT IF NO OTHER LUNS ARE ASSIGNED

/ TO IT.

DSSG.A	LAC* (LUTP2)		/ CALCULATE LENGTH OF LUT.

	CMA			/ (ACTUALLY, ITS TWO'S COMPLE-

	TAD* (LUTP1)		/ MENT FOR A LOOP COUNTER).

	DAC DSSG.1

	TAD* (LUTP2)		/ AND BASE ADDRESS -1 OF LUT

	DAC* (X16)		/ FOR AUTO-INCREMENT REGISTER.

/

	LAC DSSG.0		/ POINT XR TO PDVL NODE.

	PAX

	LACIX (D.N1)		/ FETCH HANDLER NAME FOR

	DAC DSSG.2		/ SCAN LOOP.

/

	.RTL6			// DISALLOW CONTEXT SWITCHING.

	LACIX (D.TG)		// FETCH TRIGGER EV ADDRESS.

	SNA			// SKIP IF HANDLER RESIDENT.

	JMP DSSG.G		// JMP IF HANDLER NOT RESIDENT

				// -- RETURN TO CALLER.

	DAC DSSG.3		// SAVE TRIGGER ADDRESS.

/				//

DSSG.B	LAC* X16		// SCAN LUT FOR ANY LUNS WHICH

	SNA			// ARE ASSIGNED TO DEVICE WHICH

	JMP DSSG.C		// WE ARE DEASSIGNING.  IF WE

	PAX			// FIND ANOTHER LUN ASSIGNED

	LACIX (D.N1)		// TO THE SAME DEVICE, THE

	SAD DSSG.2		// DEASSIGN IS COMPLETE, SO GO

	JMP DSSG.G		// RETURN TO CALLER.

DSSG.C	ISZ DSSG.1		//

	JMP DSSG.B		//

/				//

	JMS* (PENP)		// ALLOCATE I/O REQUEST NODE.

	  JMP DSSG.I		// NONE AVAIL. -- WAIT FOR ONE.

	IAC			// SET UP X16 TO FILL NODE WITH

	DAC* (X16)		// "DISCONNECT & EXIT" REQUEST.

/				//

	LAC* (PDVL)		// SCAN PDVL FOR ALL NODES

DSSG.D	SAD (PDVL)		// ASSOCIATED WITH DEVICE

	JMP DSSG.F		// WHICH WILL EXIT.  FOR ALL

	PAX			// SUCH NODES, CLEAR THEIR

	LACIX (D.N1)		// TRIGGER EVENT VARIABLE

	SAD DSSG.2		// ADDRESS AND SET THEIR

	SKP			// ASSIGN INHIBIT FLAG.

	JMP DSSG.E		// THIS INDICATES THE HANDLER

	.INH			/// IS IN THE PROCESS OF

	DZMIX (D.TG)		/// OF EXITTING.

	LACIX (D.AI)		///

	RAL!STL			///

	RAR			///

	.ENB			///

	DACIX (D.AI)		///

DSSG.E	LACIX (D.FP)		//

	JMP DSSG.D		//

				//

				//

/ COME HERE AFTER PDVL SCAN IS COMPLETE.  FORMAT "DISCONNECT

/ & EXIT" I/O REQUEST NODE AND GIVE IT TO DEVICE HANDLER.

				//

DSSG.F	LAC* (CURTSK)		// SAY DISCONNECT & EXIT

	PAX			// IS FROM THIS TASK.

	LACIX (A.SN)		// COPY STL NODE ADDRESS.

	DAC* X16		//

	LACIX (A.PB)		// COPY PBDL NODE ADDRESS.

	DAC* X16		//

	LAC (1002)		// SET PRIORITY TO 514.

	DAC* X16		//

	LAC (777)		// SET FUNCTION CODE TO

	DAC* X16		// "DISCONNECT & EXIT".

	DZM* X16		// CLEAR EVENT VARIABLE ADDRESS

	DZM* X16		// AND THREE UNUSED PARAMETER

	DZM* X16		// WORDS.

	DZM* X16		//

/				//

	LAC DSSG.0		// POINT R1 TO REQUEST QUEUE

	AAC +D.QF		// FOR SPRI, THEN INSERT

	DAC* (R1)		// REQUEST NODE.

	JMS* (SPRI)		//

/				//

	LAC DSSG.3		// SET HANDLER'S TRIGGER EVENT

	PAX			// VARIABLE (SET BITS 0 AND

	.INH			/// 17).

	LACIX (0)		///

	AND (377776)		///

	XOR (400001)		///

	.ENB			///

	DACIX (0)		///

/				//

	.SET6			// DECLARE SIGNIFICANT EVENT.

/ COME HERE AT LEVEL 6 WHEN DEASSIGN IS COMPLETE.

DSSG.G	DBK			// DROP BACK TO MAINSTREAM.

	.DEBUG <<11><11>"HANDLER EXIT RQSTD IF ZERO:  ">,DSSG.1,10

/ COME HERE AT MAINSTREAM WHEN DEASSIGN IS COMPLETE.

DSSG.H	JMP* DEASSGN		/ RETURN TO CALLER.

 

 

/ COME HERE AT LEVEL 6 IF WE CAN'T ALLOCATE AN I/O REQUEST

/ NODE FOR THE "DISCONNECT & EXIT" REQUEST.

 

DSSG.I	DBK			// DROP BACK TO MAINSTREAM.

	WAIT			/ WAIT FOR SIGNIFICANT EVENT.

	JMP DSSG.A		/ GO BACK AND TRY AGAIN.

 

 

/ COME HERE IS LUN/DEVICE IS ATTACHED.  THIS IS A FATAL

/ BATCH SYSTEM ERROR.

 

DSSG.J	.ENB			///

	LAW -304

	JMS* BDABRT

 

 

/ TEMPORARIES.

 

DSSG.0	0			/ POINTS TO LUT TABLE, OR

				/ SAVES PDVL NODE ADDRESS.

 

DSSG.1	0			/ POINTS TO AFT TABLE, OR

				/ HOLDS LUT SCAN LOOP COUNTER.

 

DSSG.2	0			/ POINTS TO LUN-UFD TABLE, OR

				/ HOLDS DEVICE NAME.

 

DSSG.3	0			/ SAVES TRIGGER EVENT VARIABLE

				/ ADDRESS.

 

 

 

	.END
