	.TITLE     ***  BDFINI -- FINISH BATCH JOB

 

 

 

 

/

/ 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

 

 

 

 

/

/ BDFINI

/

/ BDFINI IS CALLED FROM BDLGOF AFTER THE "OFF" COMMAND HAS

/ BEEN SENT TO TDV.  WE VERIFY THAT THE LOGOFF COMPLETES,

/ THEN CHECK JOBFND.  IF JOBFND=+1, GO TO BDSTRT TO RUN NEXT

/ JOB IN SAME JOB FILE.  IF JOBFND=0, CLOSE JOB AND LISTING

/ FILES, DEASSIGN DEVICES, THEN GO TO BDSLCT TO SELECT NEXT

/ JOB FILE.

/

/ BDFINI IS ALSO CALLED FROM BDOPEN WHEN A JOB HAS BEEN

/ CANCELLED.  THIS IS CHARACTERIZED BY JBID (THE JOB ID)

/ BEING ZERO.  IF THIS OCCURS WE MERELY DELETE THE JOB FILE

/ IF APPROPRIATE.

/

 

 

 

/
/ 100	20-AUG-76 (EAG)		MULTIACCESS BATCH INITIAL
/				VERSION.
/
/ 101	19 APR 78 (PDH)		MUST INDEX RETURN ADDRESS IN 'TYPE'

/

	.TITLE MISCELLANEOUS ASSEMBLY CONSTANTS & MACROS

 

 

 

 

/

/ NOTE:  THIS PROGRAM USES NO ASSEMBLY PARAMETERS.  ALL

/	 PARAMETERIZED VALUES ARE OBTAINED FROM THE

/	 RESIDENT SECTION VIA INITIALIZATION CODE.

/

 

 

 

/

/ INDIRECT-INDEXED INSTRUCTION MNEMONICS:

/

 

DACIX=DAC* X

DZMIX=DZM* X

LACIX=LAC* X

 

 

 

/

/ SPECIAL INSTRUCTIONS:

/

 

.INH=705522			/ INHIBIT INTERRUPTS.
.ENB=705521			/ ENABLE INTERRUPTS.
IDX=ISZ				/ INDEX POINTER, NEVER SKIP	/(101)

 

 

 

/

/ MACRO TO WAIT UNTIL NEXT SIGNIFICANT EVENT:

/

 

	.DEFIN WAIT

	  CAL (05)

	.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

 

 

 

/

/ MACRO TO DEFINE A TEXT BUFFER WITH CORRECT HEADER

/ WORD PAIR COUNT.

/

 

	.DEFIN TEXT TXT,?LBL

	  .NOLST

	  LBL-.*400+2

	  0

	  .ASCII TXT

LBL=.

	  .LST

	.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:

/

 

NADD=107			/ ADD NODE IN R2 TO

				/ LISTHEAD IN R1.

 

PENP=115			/ PICK AN EMPTY NODE FROM THE

				/ POOL (SKIP IF SUCCESSFUL),

				/ RETURN NODE ADDRESS IN

				/ R1, R2, AND AC.

 

PICK=120			/ PICK NODE FROM LISTHEAD

				/ IN R1, RETURN IN AC & R2.

 

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:

/

 

POOL=240			/ POOL OF EMPTY NODES.

 

PDVL=252			/ PHYSICAL DEVICE LIST.

 

 

 

/

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

/

 

LUFD1=304			/ POINTER TO LUN-UFD TABLE.

 

 

 

/

/ ENTRY POINTS TO I/O HANDLER REENTRANT ROUTINES:

/

 

IOCD=345			/ ADJUST TRANFER PENDING

				/ COUNT OF I/O REQUEST IN R2.

	.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.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.

 

 

 

/

/ REFERENCES TO I/O REQUEST NODES ARE CODED USING NUMERIC

/ CONSTANTS.

/

	.TITLE REFERENCES TO BDRES AND OTHER BATCH OVERLAYS

 

 

 

 

/

/ DEFINE ENTRY POINT TO THIS OVERLAY:

/

 

	.GLOBL BDFINI

 

 

 

/

/ DEFINE ENTRY POINTS TO BATCH OVERLAYS WHICH

/ THIS OVERLAY EXITS TO.  BDFINI EXITS TO BDSTRT

/ TO PROCESS ADDITIONAL JOBS IN THE SAME JOB FILE.

/ IT EXITS TO BDSLCT WHEN THE JOB FILE IS COMPLETED.

/

 

	.GLOBL BDSLCT

	.GLOBL BDSTRT 

 

 

/

/ 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 CTRL.Y		/ ROUTINE TO SIMULATE A ^Y.

 

	.GLOBL USRSTAT		/ ROUTINE TO DETERMINE LOGIN

				/ STATUS OF BATCH.

 

 

 

/

/ 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.

 

	.GLOBL JBFLGS		/ JOB FLAGS WORD. (SEE BELOW)

 

 

 

/

/ DEFINE BIT MASKS WITHIN JOB FLAGS WORD (JBFLGS):

/

 

DLTFLG=400000			/ DELETE JOB FILE AFTER RUNNING

				/ JOB.

 

 

 

/

/ OTHER LOCATIONS IN BATCH CONTROL VECTOR:

/

 

	.GLOBL JOBFND		/ JOB FOUND & EXECUTING FLAG.

				/ 0 => NO JOB BEING EXECUTED.

				/	(I.E., CURRENT JOB NODE

				/	IMAGE IS INVALID).

				/ 1 => JOB BEING EXECUTED,

				/	START-UP SEQUENCE OR

				/	END-OF-JOB SEQUENCE

				/	IN PROGRESS.

				/ 2 => JOB IS RUNNING.

				/ 3 => BATCH IS SCANNING TO

				/	$ERR CARD (JOB HAS

				/	BEEN KILLED).

 

	.GLOBL JOBERR		/ JOB ERROR FLAGS WORD.  (SEE

				/ BELOW).

 

 

 

/

/ 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.WRT=000200+400000		/ I/O WRITE ERROR ENCOUNTERED

				/ ON LISTING FILE.  ^Y ALSO

				/ SIMULATED.

 

 

 

/

/ LOCATIONS WHICH SAVE EVENT VARIABLE VALUES PERTINENT TO

/ SPECIFIC ERRORS FLAGGED IN JOBERR:

/

 

	.GLOBL WRT.EV		/ SAVE LISTING OUTPUT FILE

				/ WRITE EV VALUE (JE.WRT

				/ ERROR).

 

 

 

 

/

/ REFERENCES TO CPB'S AND ASSOCIATED EVENT VARIABLES:

/

 

	.GLOBL TT.CPB,TT.EV	/ CPB TO PRINT LINE IN TT.BFR

				/ ON OPERATOR TTY.

 

 

 

 

/

/ REFERENCES TO WORDS CONTAINING LUN NUMBERS:

/

 

	.GLOBL IN.LUN		/ JOB FILE INPUT LUN.

 

	.GLOBL LP.LUN		/ LISTING OUTPUT LUN.

 

	.GLOBL TT.LUN		/ OPERATOR TTY LUN.

 

 

 

/

/ REFERENCES TO OTHER WORDS IN RESIDENT:

/

 

	.GLOBL PDVLND		/ ADDRESS OF BATCH'S PDVL NODE.

	.TITLE FLUSH -- SUBROUTINE TO FLUSH I/O REQUEST QUEUE

 

 

 

 

/

/ THIS SUBROUTINE ZEROS THE TRIGGER EVENT VARIABLE ADDRESS

/ IN BATCH'S PDVL NODE SO THAT NO MORE REQUESTS WILL BE

/ QUEUED, THEN REMOVES ALL REQUESTS IN THE QUEUE AND SETS

/ THEIR EVENT VARIABLES TO -103.  THIS MAKES THE BATCH

/ HANDLER APPEAR NON-RESIDENT (NOT IN CORE YET) AND

/ INDICATES THE APPROPRIATE ERROR TO ALL CURRENT AND FUTURE

/ I/O REQUESTS.

/

/ THIS SUBROUTINE ALSO SETS THE ASSIGN INHIBIT FLAG IN

/ BATCH'S PDVL NODE SO THAT NO ONE MAY ASSIGN TO THE BATCH

/ HANDLER.

/

/ CALLING SEQUENCE:

/	JMS FLUSH

/

/ REGISTERS ALTERED:

/	ALL

/

/ VALUES RETURNED:

/	NONE

/

 

 

FLUSH	0

	.DEBUG <"BDFINI:FLUSH -- I/O REQUEST QUEUE BEING FLUSHED.">,0,0

	LAC* PDVLND		/ POINT XR TO PDVL NODE,

	PAX

	.INH			/// AVOID TIMING HACKS.

	DZMIX (D.TG)		/// THEN ZERO TRIGGER EV ADDR.

	LACIX (D.AI)		/// SET ASSIGN INHIBIT FLAG.

	RAL!STL			///

	RAR

	.ENB			///

	DACIX (D.AI)		///

FLSH.A	LAC* PDVLND		/ POINT R1 TO REQUEST QUEUE

	AAC D.QF		/ (IN PDVL NODE) FOR PICK.

	DAC* (R1)

	JMS* (PICK)		/ PICK FIRST REQUEST FROM QUEUE

	  JMP* FLUSH		/ QUEUE IS EMPTY -- RETURN TO

				/ CALLER.

	PAX			/ POINT XR TO REQUEST NODE.

	LACIX (6)		/ PICK UP EVENT VARIABLE ADDR.

	SZA			/ POINT XR TO EV OR TO FIRST

	PAX			/ WORD OF REQUEST NODE (IF NO

	LAW -103		/ EV), THEN SET EV TO -103.

	DACIX (0)

	JMS* (IOCD)		/ ADJUST TRANSFER PENDING

	LAC (POOL)		/ COUNT AND RETURN REQUEST

	DAC* (R1)		/ NODE TO FREE POOL.

	JMS* (NADD)

	JMP FLSH.A		/ AND GO FLUSH NEXT REQUEST.

	.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 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 <"BDFINI: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 -1101

	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.

	.TITLE BDFINI -- MAIN ENTRY POINT & LOGOFF CHECK

 

 

 

 

/

/ COME HERE AFTER "OFF" COMMAND HAS BEEN SENT TO TDV.

/ DISCONNECT FROM PDVL NODE AND FLUSH ANY QUEUED REQUESTS.

/ THEN CHECK FOR NORMAL OR CANCELLED JOB ENTRY.  IF NORMAL

/ ENTRY, VERIFY LOGOFF HAS COMPLETED.

/

 

 

BDFINI	0

	.DEBUG <"BDFINI ENTERED, JOBID = ">,JBID,41

	JMS FLUSH		/ FLUSH I/O REQUESTS &

				/ DISCONNECT FROM PDVL NODE.

	LAC* JBID		/ CHECK FOR CANCEL.

	SNA			/ SKIP IF NOT CANCEL.

	JMP CANCEL		/ JMP IF CANCEL -- JUST GO

				/ DELETE JOB FILE.

	LAW -10			/ SETUP RETRY COUNTER TO LIMIT

	DAC BDFN.0		/ LOGOFF COMPLETION WAIT.

BDFN.A	JMS DELAY		/ ALLOW TDV TO PROCESS.

	JMS* USRSTAT		/ CHECK IF WE'RE LOGGED IN.

	  JMP NXTJOB		/ JMP IF NOT LOGGED IN.

	  JMP NXTJOB		/ JMP IF NOT LOGGED IN.

	  NOP			/ PARTIALLY LOGGED IN.

	JMS* CTRL.Y		/ STILL LOGGED IN -- SIMULATE

				/ ^Y JUST IN CASE.

	ISZ BDFN.0		/ RETRIES ALL USED UP?

	JMP BDFN.A		/ NO -- GO TRY AGAIN.

	LAW -1102		/ YES -- BATCH SYSTEM ERROR --

	JMS* BDABRT		/ CAN'T LOGOFF FROM TDV.

 

 

 

BDFN.0	0			/ LOGOFF RETRY COUNTER

	.TITLE NXTJOB -- CHECK FOR MORE JOBS, CLOSE FILES

 

 

 

 

/

/ COME HERE AFTER LOGOFF IS COMPLETE.  CHECK FOR MORE JOBS

/ IN CURRENT JOB FILE, AND GO TO BDSTRT IF THERE ARE MORE.

/ OTHERWISE CLOSE THE JOB INPUT FILE AND THE LISTING

/ OUTPUT FILE.

/

 

 

NXTJOB	LAC* JOBFND		/ CHECK IF MORE JOBS IN FILE.

				/ (NOTE THAT BDDONE SETS JOBFND

				/ TO 0 IF NO MORE JOBS TO

				/ PROCESS, +1 IF MORE JOBS.)

	SZA			/ SKIP IF NO MORE JOBS.

	JMS* BDSTRT		/ JMS IF MORE JOBS -- RUN THEM.

	LAC* JOBERR		/ CHECK IF LISTING FILE WRITE

	AND (JE.WRT&377777)	/ ERROR OCCURED DURING END...

	SNA			/ SKIP IF IT DID.

	JMP NXTJ.A		/ JMP IF NO ERROR OCCURED.

	LAC* WRT.EV		/ PRINT ERROR MESSAGE ON TTY.

	JMS ERRMSG

	  .ASCII "LISTING DEVICE WRITE"<0>

NXTJ.A	LAC* IN.LUN		/ CLOSE JOB INPUT FILE.

	DAC NXTJ.0

	JMS* ISSUE

	  NXTJ.D

	CAL NXTJ.E		/ WAITFOR CLOSE TO COMPLETE.

	.DEBUG <"BDFINI:NXTJOB -- INPUT FILE CLOSED, EV = ">,NXTJ.1,10

	LAC NXTJ.1		/ WAS IT SUCCESSFUL?

	SPA			/ SKIP IF YES.

	SAD (-6)		/ SKIP IF REAL ERROR.

	JMP NXTJ.B		/ JMP IF CLOSE SUCCESSFUL OR

				/ NON-FILE ORIENTED.

	JMS ERRMSG		/ PRINT ERROR MESSAGE ON TTY.

	  .ASCII "JOB FILE CLOSE"<0>

NXTJ.B	LAC* LP.LUN		/ CLOSE LISTING OUTPUT FILE.

	DAC NXTJ.0

	JMS* ISSUE

	  NXTJ.D

	CAL NXTJ.E		/ WAITFOR CLOSE TO COMPLETE.

	.DEBUG <"BDFINI:NXTJOB -- LISTING FILE CLOSED, EV = ">,NXTJ.1,10

	LAC NXTJ.1		/ WAS IT SUCCESSFUL?

	SPA			/ SKIP IF YES.

	SAD (-6)		/ SKIP IF REAL ERROR.

	JMP NXTJ.C		/ JMP IF CLOSE SUCCESSFUL OR

				/ NON-FILE ORIENTED.

	JMS ERRMSG		/ PRINT ERROR MESSAGE ON TTY.

	  .ASCII "LISTING FILE CLOSE"<0>

NXTJ.C	LAC* LP.LUN		/ DETACH LISTING DEVICE.

	DAC NXTJ.2

	JMS* ISSUE

	  NXTJ.F

	CAL NXTJ.G		/ WAITFOR DETACH TO COMPLETE.

	JMP DELETE		/ GO CHECK DELETE FLAG.

 

 

/ CPB TO CLOSE FILES:

 

NXTJ.D	3400

	NXTJ.1

NXTJ.0	0

 

 

/ WAIFOR CPB TO WAIT FOR CLOSE TO COMPLETE:

 

NXTJ.E	20

	NXTJ.1

 

 

 

NXTJ.1	0			/ CLOSE EVENT VARIABLE.

 

 

/ DETACH CPB TO DETACH LISTING DEVICE.

 

NXTJ.F	2500

	NXTJ.3

NXTJ.2	0			/ LUN

 

 

/ WAITFOR CPB TO WAIT FOR DETACH TO COMPLETE.

 

NXTJ.G	20

	NXTJ.3

 

 

/ DETACH EVENT VARIABLE.

 

NXTJ.3	0

	.TITLE CANCEL -- CANCEL A JOB FILE REQUEST

 

 

 

 

/

/ COME HERE WHEN A JOB HAS BEEN CANCELLED.  PRINT A MESSAGE

/ IDENTIFYING THE CANCELLED JOB, THEN GO DELETE THE

/ JOB FILE (IF APPROPRIATE).

/

 

 

CANCEL	LAC* JBNAM1		/ INSERT FILE NAME INTO

	CLL			/ IDENTIFYING MESSAGE.

	LMQ!CLAC!LLS+6

	CLL!RAL

	LLS+3

	XOR (40*20+4)

	TAD (40*200+40*20+4)

	DAC CNCL.0

	CLAC!LLS+3

	CLL!RAL

	LLS+6

	DAC CNCL.0+1

	LAC* JBNAM2

	LMQ

	LAC CNCL.0+1

	CLL!RAL

	LLS+6

	CLL!RAL

	XOR (40*200+40*200+40*2)

	TAD (40*200+40*200+40*2)

	DAC CNCL.0+1

	CLAC!LLS+6

	CLL!RAL

	LLS+6

	ALS+4

	XOR (40*200+40*20)

	TAD (40*200+40*20+4)

	DAC CNCL.0+2

	JMS TYPE		/ PRINT THE MESSAGE.

	  CNCL.A

	JMP DELETE		/ GO DELETE JOB FILE.

 

 

/

/ MESSAGE TO IDENTIFY THE CANCELLED JOB:

/

 

CNCL.A	CNCL.B-.*400+2

	0

	.ASCII '                    '

	.ASCII 'BATCH -- CANCELLING JOB FILE "'

CNCL.0	.ASCII ' FILNAM JOB ".'<15>

CNCL.B=.

	.TITLE DELETE -- DELETE JOB FILE (IF FLAG IS SET)

 

 

 

 

/

/ COME HERE TO CHECK JOB FILE DELETE FLAG AND DELETE THE JOB

/ FILE IF APPROPRIATE.

/

 

 

 

 

DELETE	LAC* JBFLGS		/ PICK UP AND MASK OUT JOB

	AND (DLTFLG)		/ FILE DELETE FLAG.

	SNA			/ SKIP IF DELETE FLAG IS SET.

	JMP LUNS		/ JMP IF DELETE FLAG NOT SET.

	LAC* IN.LUN		/ SETUP DELETE CPB.

	DAC DLT.0

	LAC* JBNAM1

	DAC DLT.1

	LAC* JBNAM2

	DAC DLT.2

	JMS* ISSUE		/ DELETE THE FILE.

	  DLT.A

	CAL DLT.B		/ WAITFOR DELETE TO FINISH.

	.DEBUG <"BDFINI:DELETE -- JOB FILE DELETED, EV = ">,DLT.3,10

	LAC DLT.3		/ CHECK FOR ERRORS.

	SPA			/ SKIP IF SUCCESSFULL.

	SAD (-6)		/ SKIP IF REAL ERROR.

	JMP LUNS		/ JMP IF SUCCESSFULL OR NON-

				/ FILE ORIENTED.

	JMS ERRMSG		/ PRINT ERROR MESSAGE ON TTY.

	  .ASCII "JOB FILE DELETE"<0>

	JMP LUNS

 

 

/ CPB TO DELETE JOB INPUT FILE:

 

DLT.A	3500

	DLT.3

DLT.0	0			/ LUN NUMBER.

DLT.1	.SIXBT "@@@"		/ JOB FILE NAME CHAR. 1 - 3

DLT.2	.SIXBT "@@@"		/ JOB FILE NAME CHAR. 4 - 6

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

 

 

/ CPB TO WAITFOR DELETE TO COMPLETE:

 

DLT.B	20

	DLT.3

 

 

 

DLT.3	0			/ DELETE EVENT VARIABLE.

	.TITLE LUNS -- DEASSIGN LUNS

 

 

 

 

/

/ COME HERE TO DEASSIGN THE INPUT AND LISTING LUNS.

/ FROM HERE WE GO TO BDSLCT TO SELECT THE NEXT JOB

/ FILE TO BE EXECUTED.

/

 

 

LUNS	JMS TYPE		/ PRINT BLANK LINE ON TTY.

	  LUNS.A

	LAC* IN.LUN		/ DEASSIGN INPUT LUN.

	JMS DEASSGN

	LAC* LP.LUN		/ DEASSIGN LISTING LUN.

	JMS DEASSGN

	JMS TYPEWT		/ WAIT FOR TYPE TO COMPLETE.

	JMS* BDSLCT		/ GO SELECT NEXT JOB.

 

 

/ BLANK LINE:

 

LUNS.A	TEXT <<15>>

	.TITLE ERRMSG -- ROUTINE TO PRINT ERROR MESSAGE

 

 

 

 

/

/ THIS ROUTINE PRINTS AN ERROR MESSAGE ON THE OPERATOR TTY.

/ THE MESSAGE IS OF THE FORM:

/

/	...***** BATCH -- XXXXX ERROR.  EV = -NNNNNN

/

/ "XXXXX" IS A TEXT STRING PASSED TO THIS SUBROUTINE FOLLOWING

/ THE JMS, AND "NNNNNN" IS AN EVENT VARIABLE VALUE PASSED IN

/ THE AC.

/

/ CALLING SEQUENCE:

/	LAC EV

/	JMS ERRMSG

/	  .ASCII "XXXXX"<0>

/

/ REGISTERS ALTERED:

/	ALL

/

/ VALUES RETURNED:

/	NONE

/

 

 

ERRMSG	0

	TCA			/ GET ABS. VALUE OF EV VALUE.

	LMQ!CLAC!LLSS+3		/ CONVERT EV VALUE TO OCTAL AND

	ALS+4			/ STORE INTO MESSAGE TRAILER.

	LLS+3

	ALS+4

	TAD (60*200+60*20+6)

	DAC ERRM.0

	CLAC!LLS+3

	ALS+4

	LLS+3

	ALS+4

	LLS+3

	CLL!RAL

	TAD (60*200+60*200+60*2)

	DAC ERRM.0+1

	CLAC!LLS+3

	ALS+4+3+4

	TAD (60*200+15*20)

	DAC ERRM.0+2

	DZM ERRM.0+3

	CLX			/ COPY "XXXXX" FROM JMS TO BODY

ERRM.A	LAC* ERRMSG		/ OF MESSAGE.

	ISZ ERRMSG

	DAC ERRM.2,X

	LAC* ERRMSG

	ISZ ERRMSG

	DAC ERRM.2+1,X

	AXR +2

	AND (376)		/ END IS FLAGGED BY NULL CHAR.

	SZA

	JMP ERRM.A

	PXL			/ COPY MESSAGE TRAILER TO BODY

	AXR ERRM.C-ERRM.0-4	/ OF MESSAGE.

	LAC (ERRM.C-1)

	DAC* (X16)

ERRM.B	LAC* X16

	DAC ERRM.2-ERRM.C+ERRM.0+4,X

	AXS +1

	JMP ERRM.B

	PXA			/ CALCULATE WORD PAIR COUNT.

	AAC ERRM.0+4-ERRM.C+ERRM.2-ERRM.1

	CLL!RAR

	SWHA

	DAC ERRM.1		/ STORE IN HEADER WORD.

	JMS TYPE		/ PRINT THE MESSAGE.

	  ERRM.1

	JMP* ERRMSG		/ AND RETURN.

 

 

/ THE ERROR MESSAGE TRAILER:

 

ERRM.C	.ASCII " ERROR.  EV = -"

ERRM.0	.ASCII "NNNNNN"<15>

 

 

/ THE ERROR MESSAGE HEADER AND BODY:

 

ERRM.1	0			/ HEADER WORD.

	0

	.ASCII "******************* BATCH -- "

ERRM.2	.BLOCK 50

	.TITLE TYPE, TYPEWT -- PRINT MESSAGE ON OPERATOR TTY

 

 

 

 

/

/ TYPE IS A SUBROUTINE TO PRINT A MESSAGE ON THE OPERATOR

/ TTY.  TYPEWT WAITS FOR THE PRINTING OF SAID MESSAGES TO

/ COMPLETE.

/

/ TYPE IMPLICITLY CALLS TYPEWT, TO ENSURE ANY PREVIOUS

/ MESSAGES HAVE COMPLETED.  THUS TYPEWT NEED ONLY BE

/ CALLED ONCE, JUST BEFORE THIS OVERLAY EXITS.

/

/ CALLING SEQUENCE:

/	JMS TYPE

/	  < MESSAGE BUFFER POINTER >

/	< RETURN >

/	 .

/	 .

/	 .

/	JMS TYPEWT

/

/ REGISTERS ALTERED:

/	ALL

/

/ VALUES RETURNED:

/	NONE

/

 

 
TYPE	0

	JMS TYPEWT		/ WAIT FOR PREVIOUS MESSAGES

				/ TO COMPLETE.
	LAC* TT.LUN		/ STORE LUN NUMBER INTO CPB.

	DAC TYPE.0

	LAC* TYPE		/ STORE BUFFER ADDRESS INTO
	DAC TYPE.1		/ CPB.
	IDX	TYPE		/ INDEX TO RETURN POINT		/(101)

	JMS* ISSUE		/ PRINT THE LINE.

	  TYPE.A

	JMP* TYPE		/ THEN RETURN.

 

 

/ WRITE CPB TO PRINT THE LINE:

 

TYPE.A	2700

	TYPE.2

TYPE.0	0			/ LUN

	2			/ IOPS ASCII.

TYPE.1	0			/ BUFFER POINTER.

 

 

/ EVENT VARIABLE:

 

TYPE.2	1

 

 

 

/

/ TYPEWT -- WAIT FOR TYPE TO COMPLETE AND CHECK FOR ERRORS:

/

 

TYPEWT	0

	LAC TYPE.2		/ CHECK IF MESSAGE COMPLETED.

	SNA

	CAL TYPE.B		/ WAIT FOR IT.

	LAC TYPE.2		/ CHECK FOR ERRORS.

	SMA

	JMP* TYPEWT		/ NO ERRORS -- RETURN.

	DAC* TT.EV		/ SAVE EV FOR BDABRT.

	LAW -1103		/ BATCH SYSTEM ERROR -- I/O

	JMS* BDABRT		/ ERROR ON OPERATOR TTY.

 

 

/ WAITFOR CPB TO WAIT FOR TYPE TO COMPLETE:

 

TYPE.B	20

	TYPE.2

 

 

 

	.END
