	.TITLE     ***  BDLGOF -- BATCH LOGOFF SEQUENCE

 

 

 

 

/

/ 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

 

 

 

 

/

/ BDLGOF

/

/ THIS OVERLAY IMPLEMENTS THE BATCH LOGOFF SEQUENCE, USED

/ TO TERMINATE A JOB.  THIS OVERLAY IS VERY SIMILAR TO

/ BDMAIN.

/

 

 

 

/

/ 100	20-AUG-76 (EAG)		MULTIACCESS BATCH, INITIAL

/				VERSION.

/

	.TITLE MISCELLANEOUS ASSEMBLY CONSTANTS & MACROS

 

 

 

 

/

/ NOTE:  THIS PROGRAM USES NO ASSEMBLY PARAMETERS.  ALL

/	 PARAMETERIZED VALUES ARE OBTAINED FROM THE

/	 RESIDENT SECTION VIA INITIALIZATION CODE.

/

 

 

 

TDV=240426			/ .SIXBT "TDV".  USED TO

				/ DETERMINE WHETHER AN I/O

				/ REQUEST IS FROM TDV... OR

				/ FROM SOME OTHER TASK.

 

...=565656			/ .SIXBT "...".  USED TO

				/ DETERMINE WHETHER AN I/O

				/ REQUEST IS FROM TDV... OR

				/ FROM SOME OTHER TASK.

 

HINFO=300021			/ FUNNY EV VALUE RETURNED

				/ BY HINF REQUEST.

 

 

 

/

/ INDIRECT-INDEXED INSTRUCTION MNEMONICS:

/

 

DACIX=DAC* X

LACIX=LAC* X

XORIX=XOR* X

TADIX=TAD* X

ISZIX=ISZ* X

SADIX=SAD* X

 

 

 

/

/ SPECIAL INSTRUCTIONS:

/

 

.INH=705522			/ INHIBIT INTERRUPTS.

.ENB=705521			/ ENABLE INTERRUPTS.

 

 

 

/

/ MACRO TO DECLARE SIGNIFICANT EVENT.  SINCE BATCH IS AN I/O

/ HANDLER, WE ASSUME ALL TASKS ISSUEING REQUESTS TO IT ARE AT

/ LOWER PRIORITIES.  THEREFORE BATCH WILL NEVER DECLARE A

/ SIGNIFICANT EVENT FOR I/O REQUEST COMPLETION, WHICH IS

/ THE ONLY REASON FOR WHICH BDLGOF (THIS OVERLAY) MIGHT

/ DECLARE A SIGNIFICANT EVENT.  WE PREVENT BDLGOF FROM

/ DECLARING SIGNIFICANT EVENTS BY MAKING THIS A NULL MACRO.

/

 

	.DEFIN .SET6

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

/

 

X15=15

X16=16

 

 

 

/

/ REENTRANT REGISTERS USED TO INTERFACE TO REENTRANT

/ ROUTINES:

/

 

R1=101

R2=102

R3=103

R4=104

 

 

 

/

/ REENTRANT SYSTEM ROUTINE ENTRY POINTS:

/

 

NADD=107			/ ADD NODE IN R2 TO

				/ LISTHEAD IN R1.

 

SPRI=126			/ INSERT NODE IN R2 INTO

				/ PRIORITY ORDERED LISTHEAD

				/ IN R1.

 

 

 

/

/ QUEUE LISTHEADS:

/

 

POOL=240			/ POOL OF EMPTY NODES.

 

 

 

/

/ ENTRY POINTS TO I/O HANDLER REENTRANT ROUTINES:

/

 

DQRQ=337			/ DEQUEUE AN I/O REQUEST

				/ FROM PDVL NODE IN R1 AND

				/ RETURN IT IN AC, R2.

 

VAJX=342			/ VERIFY AND ADJUST I/O

				/ BUFFER IN R3, R4, R2.

 

IOCD=345			/ ADJUST TRANFER PENDING

				/ COUNT OF I/O REQUEST IN R2.

 

DMTQ=361			/ PROCESS ABORT REQUEST IN R2

				/ FOR PDVL NODE IN R1.

	.TITLE NODE FORMAT DEFINITIONS

 

 

 

 

/

/ REFERENCES TO STL NODES:

/

 

S.N1=2				/ FIRST WORD OF TASK NAME.

S.N2=3				/ SECOND WORD OF TASK NAME.

 

 

 

/

/ REFERENCES TO PDVL NODES:

/

 

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

 

 

 

/

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

 

 

 

/

/ DEFINE ENTRY POINT TO BATCH OVERLAY WHICH

/ THIS OVERLAY EXITS TO:

/

 

	.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 PRINT		/ ROUTINE TO PRINT A LINE

				/ ON THE LISTING DEVICE.

 

	.GLOBL ECHOWT		/ ROUTINE TO WAIT FOR LISTING

				/ ACTIVITY TO FINISH.

 

 

 

/

/ DEFINE REFERENCES TO ASSIGN COMMAND LINES IN RESIDENT:

/

 

	.GLOBL ASS4OPR		/ LUN 4 TO OPERATOR TTY.

 

	.GLOBL ASS13ACCT	/ LUN 13 TO ACCOUNTING FILE.

 

	.GLOBL ASSLP		/ LUNS 4, 13, AND 16 TO

				/ LISTING DEVICE.

 

 

 

/

/ DEFINE REFERENCES TO OTHER TEXT BUFFERS IN RESIDENT:

/

 

	.GLOBL QJBINF		/ TEXT BUFFER CONTAINING INFO.

				/ FROM JOB QUEUE NODE.

 

	.GLOBL BEGMSG		/ MESSAGE PASSED TO JOB...

				/ AND END... CONTAINING

				/ ACCOUNTING INFO.

 

	.GLOBL ENDMSG		/ MESSAGE PASSED TO END...

				/ TO DESCRIBE CAUSE OF JOB

				/ TERMINATION.

 

 

 

/

/ DEFINE REFERENCES TO DYNAMIC LINE BUFFER POINTERS.  THERE

/ ARE TWO LINE BUFFERS IN THE RESIDENT SECTION.  THE TWO

/ LOCATIONS IN.BFR AND LP.BFR EACH POINT TO ONE OF THESE

/ BUFFERS.  WHEN A LINE NEEDS TO BE EXCHANGED, ONLY THE 

/ BUFFER POINTERS ARE PHYSICALLY EXCHANGED.

/

 

	.GLOBL IN.BFR		/ JOB FILE INPUT BUFFER.

 

	.GLOBL LP.BFR		/ LISTING OUTPUT BUFFER.

 

 

 

/

/ REFERENCES TO CPB'S AND ASSOCIATED EVENT VARIABLES:

/

 

	.GLOBL LP.MOD,LP.LEN	/ CPB TO PRINT LINE IN LP.BFR

				/ ON LISTING DEVICE.

 

 

 

/

/ REFERENCES TO OTHER WORDS IN RESIDENT:

/

 

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

 

	.GLOBL TRGGR		/ BATCH'S TRIGGER EVENT

				/ VARIABLE.

 

	.GLOBL WAITFR		/ A WAITFOR CPB TO WAIT FOR THE

				/ TRIGGER EVENT VARIABLE

				/ (TRGGR) TO BE SET.

	.TITLE MISCELLANEOUS LOCATIONS USED BY BDLGOF

 

 

 

 

/

/ TEXT BUFFERS CONTAINING CERTAIN COMMON CONSTANT MESSAGES:

/

 

EOFBFR	1005			/ END-OF-FILE.

	0

 

 

 

/

/ OTHER LOCATIONS:

/

 

STATE	0			/ CURRENT STATE POINTER.

				/ USED BY STATE TABLE DRIVEN

				/ READ REQUEST PROCESSOR.  SEE

				/ COMMENTS UNDER HEADING "READ

				/ REQUEST PROCESSOR".

 

RQSTND	0			/ PLACE TO SAVE CURRENT REQUEST

				/ NODE ADDRESS.  SET BY MAINLP,

				/ USED BY RD.FIN AND OTHERS.

	.TITLE BDLGOF -- MAIN ENTRY POINT, INITIALIZATION.

 

 

 

 

/

/ COME HERE TO TERMINATE A JOB.  INITIALIZE THE READ REQUEST

/ PROCESSOR STATE VALUE TO THE LOGOFF SEQUENCE.

/

 

 

BDLGOF	0

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

	LAC (ST.EOJ)		/ SET STATE TO END-OF-JOB

	DAC STATE		/ SEQUENCE.

	JMP MAINLP		/ ENTER MAIN REQUEST

				/ PROCESSING LOOP.

	.TITLE NORQST, MAINLP -- MAIN REQUEST PROCESSING LOOP

 

 

 

 

/

/ COME HERE WHEN NO REQUESTS ARE OUTSTANDING TO

/ WAIT FOR TRIGGER EVENT VARIABLE TO BE SET.  NOTE

/ THAT THE TRIGGER EVENT VARIABLE IS SET BY ANY OF

/ THE FOLLOWING:

/

/	1.  AN I/O REQUEST BEING RECEIVED.

/

/	2.  THE TIME LIMIT PROCESSORS MARK TIME REQUEST.

/

/	3.  A HINF ISSUED TO THE LISTING OR INPUT DEVICES,

/	    WHEN WE ARE WAITING FOR I/O TO COMPLETE ON THAT

/	    DEVICE.

/

 

 

NORQST	LAW 777775		/ MASK OUT THE BIT WHICH WE

	.INH			/// SET OURSELVES.

	AND* TRGGR		///

	.ENB			///

	DAC* TRGGR		///

	SNA			/ HAS ANYONE ELSE SET A BIT

				/ IN THE TRIGGER?

	CAL* WAITFR		/ NO -- WAIT FOR IT.

/ MAIN PROCESSING LOOP -- COME HERE WHENEVER WE ARE FINISHED

/ WITH A REQUEST.  FIND A NEW REQUEST TO PROCESS, AND GO

/ PROCESS IT.

MAINLP	LAC (2)			/ SET TRIGGER NON-ZERO TO AVOID

	DAC* TRGGR		/ REDUNDANT SIGNIFICANT EVENTS.

	LAC* PDVLND		/ OBTAIN AN I/O REQUEST FROM

	DAC* (R1)		/ THE REQUEST QUEUE.

	JMS* (DQRQ)

	  JMP NORQST		/ JMP IF QUEUE EMPTY -- WAIT

				/ FOR A REQUEST.

	DAC RQSTND		/ SAVE ADDRESS OF REQUEST NODE.

	PAX			/ POINT XR TO REQUEST NODE.

	LACIX (5)		/ FETCH I/O FUNCTION CODE.

	AND (777)

	SAD (26)		/ AND DISPATCH ON I/O FUNCTION.

	  JMP READ

	SAD (27)

	  JMP WRITE

	SAD (17)

	  JMP ABORT

	SAD (36)

	  JMP HINF

	SAD (24)

	  JMP ATTACH

	SAD (25)

	  JMP DETACH

/

	LAW -6			/ ILLEGAL FUNCTION -- SET EV

	JMS RQSTFN		/ TO -6, AND TRY FOR ANOTHER

	JMP MAINLP		/ REQUEST.

	.TITLE MISCELLANEOUS I/O REQUEST PROCESSORS

 

 

 

 

/

/ ATTACH -- ALWAYS SUCCEEDS, BUT OTHERWISE DOES NOTHING.

/

 

 

ATTACH	CLA!IAC			/ SET EV TO +1

	JMS RQSTFN

	JMP MAINLP

 

 

 

 

/

/ DETACH -- SAME AS ATTACH

/

 

 

DETACH=ATTACH

 

 

 

 

/

/ HINF -- SET EV TO THE MAGIC CONSTANT

/

 

 

HINF	LAC (HINFO)

	JMS RQSTFN

	JMP MAINLP

 

 

 

 

/

/ ABORT -- PROCESS THE ABORT (VIA DMTQ), THEN RETURN EV = +1.

/

 

 

ABORT	JMS* (DMTQ)

	CLA!IAC

	JMS RQSTFN

	JMP MAINLP

	.TITLE RQSTFN -- SUBROUTINE TO FINISH I/O REQUEST



 

 

 

/

/ ROUTINE TO FINISH I/O REQUEST.  COME HERE WITH EV VALUE

/ IN AC.  AFTER CALLING HERE, MUST JMP TO MAINLP TO GET

/ NEXT REQUEST.

/

/ THIS ROUTINE SETS THE REQUESTOR'S EVENT VARIABLE,

/ ADJUSTS HIS TRANSFERS PENDING COUNT, AND RETURNS THE

/ REQUEST NODE TO THE FREE POOL.  IT ALSO DECLARES A

/ SIGNIFICANT EVENT.

/

/ BEFORE CALLING THIS ROUTINE, LOCATION RQSTND MUST BE

/ SET TO THE REQUEST NODE ADDRESS.  THIS IS OF NO CONCERN

/ TO NORMAL REQUEST PROCESSORS, AS THE MAIN I/O REQUEST

/ LOOP (MAINLP) DOES THIS BEFORE DISPATCHING TO THE REQUEST

/ PROCESSING ROUTINE.

/

/ CALLING SEQUENCE:

/	< STORE REQUEST NODE ADDRESS IN RQSTND >

/	LAC (EV VALUE)

/	JMS RQSTFN

/

/ REGISTERS ALTERED:

/	ALL

/

/ VALUES RETURNED:

/	NONE

/

 

 

RQSTFN	0

	PAL			/ SAVE EV VALUE IN LR

	LAC RQSTND		/ PUT REQUEST NODE ADDR. IN

	DAC* (R2)		/ R2 FOR IOCD & NADD, THEN

	PAX			/ POINT XR TO REQUEST NODE.

	LACIX (6)		/ FETCH EV ADDRESS.

	SZA			/ SKIP IF NO EV.

	PAX			/ POINT XR TO EV.

	PLA			/ GET EV VALUE BACK IN AC.

	DACIX (0)		/ STORE VALUE INTO EV.  IF NO

				/ EV, CLOBBERS FIRST WORD OF

				/ REQUEST NODE.

	JMS* (IOCD)		/ ADJUST TRANSFER PENDING COUNT

	LAC (POOL)		/ RETURN NODE TO FREE POOL.

	DAC* (R1)

	JMS* (NADD)

	.SET6			/ DECLARE SIGNIFICANT EVENT.

	JMP* RQSTFN

	.TITLE RQSTWT -- DELAY AN I/O REQUEST

 

 

 

 

/

/ ROUTINE TO DELAY AN I/O REQUEST.  IF, FOR ANY REASON, AN

/ I/O REQUEST CANNOT BE SATISFIED IMMEDIATELY, ARRANGE FOR

/ TRGGR TO BE SET AT AN APPROPRIATE TIME IN THE FUTURE

/ (USUALLY BY ISSUEING A HINF) AND JMP HERE.  THIS ROUTINE

/ REPLACES THE I/O REQUEST BACK ON THE I/O REQUEST QUEUE,

/ THEN TRANSFERS TO NORQST TO WAIT FOR TRGGR TO BE SET.

/ AT THAT TIME THE I/O REQUEST WILL BE RETRIED.

/

/ NOTE THAT THIS ROUTINE MUST ONLY BE USED BY I/O REQUEST

/ PROCESSORS CALLED FROM THE MAIN I/O REQUEST LOOP (MAINLP).

/

 

 

RQSTWT	LAC RQSTND		/ PUT REQUEST NODE ADDR. IN

	DAC* (R2)		/ R2 FOR SPRI & NADD.

	PAX			/ POINT XR TO IT.

	LAC* PDVLND		/ POINT R1 TO REQUEST QUEUE

	AAC D.QF		/ IN PDVL NODE.

	DAC* (R1)

	CLA!CMA!CLL		/ SUBTRACT ONE FROM PRIORITY,

	TADIX (4)		/ SO SPRI WILL INSERT NODE AT

				/ ITS FORMER POSITION.

	SNL			/ SKIP IF NO OVERFLOW.

	JMP RQWT.A		/ JMP IF OVERFLOW -- SPECIAL CASE

	DACIX (4)

	JMS* (SPRI)		/ INSERT NODE IN QUEUE.

	LAC RQSTND		/ RESTORE PRIORITY TO ITS

	PAX			/ FORMER VALUE.

	ISZIX (4)

	JMP NORQST		/ GO WAIT FOR TRGGR.

 

 

/ COME HERE IF PRIORITY DECREMENT OVERFLOWS -- I.E., IF

/ PRIORITY IS ZERO.  SINCE PRIORITY IS ZERO, INSERT AT

/ FRONT OF QUEUE -- I.E., USE NADD, NOT SPRI!

 

RQWT.A	JMS* (NADD)

	JMP NORQST		/ GO WAIT FOR TRGGR.

	.TITLE WRITE -- ECHO WRITE REQUESTS TO LISTING DEVICE

 

 

 

 

/

/ THIS ROUTINE ECHOS ALL WRITE REQUESTS TO THE LISTING DEVICE,

/ EXCEPT WHEN THE SIGN BIT IS SET IN THE FIRST WORD OF THE

/ LINE BUFFER (BIT 0 OF THE WORD CONTAINING THE WORD PAIR

/ COUNT).  THIS BIT WAS PREVIOUSLY UNUSED, EXCEPT TO IGNORE

/ CHECKSUMS DURING BINARY INPUT.  THUS IT SEEMS SAFE TO

/ ASSUME THAT THE STATE OF THIS BIT WILL BE IGNORED BY

/ HANDLERS (I HAVE PERSONALLY VERIFIED THE LINE PRINTER AND

/ TELETYPE HANDLERS, THE ONLY TWO WHICH SHOULD MATTER) AND

/ THAT IT WILL BE CLEARED BY ALL TASKS WHICH ARE IGNORANT OF

/ THIS BATCH FEATURE.  THIS FEATURE IS USED BY TDV... (AND

/ PERHAPS OTHER TASKS) TO CAUSE "NOISE" MESSAGES TO BE

/ SUPPRESSED ON THE JOB LISTING (I.E., COMMAND PROMPTS WON'T

/ BE PRINTED) WHILE STILL PRINTING ERRORS.

/

/ NOTE THAT THIS ROUTINE MODIFIES LP.MOD (THE DATA MODE USED

/ BY PRINT) WITHOUT CHECKING IF PREVIOUS OUTPUT HAS COM-

/ PLETED.  THIS IS PERMISSABLE, SINCE CPB DATA IS COPIED

/ TO THE I/O REQUEST NODE WHEN THE REQUEST IS ISSUED, AND

/ NOT REFERENCED LATER.

/

 

 

WRITE	LACIX (7)		/ COPY DATA MODE.

	DAC* LP.MOD

	CLL!RAR			/ VERIFY IT IS EITHER IOPS

	SAD (1)			/ OR IMAGE ASCII.

	JMP WRT.A		/ JMP IF IT IS.

	LAW -7			/ ILLEGAL DATA MODE --

	JMP WRT.F		/ RETURN ERROR.

 

 

/ COME HERE IF DATA MODE IS OK -- EITHER IOPS OR IMAGE ASCII.

 

WRT.A	LACIX (10)		/ FETCH BUFFER ADDRESS.

	DAC* (R3)		/ PREPARE TO VERIFY W/ VAJX.

	DAC WRT.0		/ ALSO SAVE FOR LATER.

	CLA!IAC			/ LENGTH = ONE WORD, JUST

	DAC* (R4)		/ CHECK HEADER WORD.

	JMS* (VAJX)		/ VERIFY LEGAL HEADER WORD.

	  JMP WRT.D		/ JMP IF ILLEGAL ADDRESS.

	LAW -1			/ SET UP X16 TO FETCH FROM

	TAD* (R3)		/ LINE BUFFER.

	DAC* (X16)

	LAC* X16		/ FETCH HEADER WORD.

	.IFUND %DEBUG

	SPA!SWHA		/ SKIP IF LINE SHOULD BE ECHOED

	JMP WRT.C		/ JMP IF SIGN BIT SET -- IGNORE

				/ THIS LINE.

	.ENDC

	.IFDEF %DEBUG

	SWHA			/ IF %DEBUG, ALWAYS PRINT LINE.

	.ENDC

	AND (377)		/ MASK OUT WORD PAIR COUNT.

	AAC -1			/ VERIFY W.P.C. > 1.

	SPA!SNA!IAC		/ SKIP IF OK & RESTORE.

	JMP WRT.E		/ JMP IF ILLEGAL W.P.C.

	CLL!RAL			/ CONVERT TO # OF WORDS.

	DAC* (R4)		/ STORE FOR VAJX.

	CLL!TCA			/ COMPARE AGAINST MAXIMUM

	TAD* LP.LEN		/ SIZE (= LENGTH OF OUR BUFFER

	SNA!SPA!TCA		/ MINUS 2).  IF TOO BIG, USE

	LAW -2			/ OUR BUFFER LENGTH MINUS 2.

	TAD* LP.LEN		/ (MUST ALLOW FOR CARRIAGE

				/ RETURN WHICH WE WILL APPEND

				/ TO RECORD).

	PAL			/ SAVE LENGTH FOR COPY LOOP.

	LAC WRT.0		/ RESTORE UNRELOCATED BUFFER

	DAC* (R3)		/ ADDRESS FOR VAJX.

	JMS* (VAJX)		/ VERIFY BUFFER IS OK.

	  JMP WRT.D		/ JMP IF ILLEGAL BUFFER.

	JMS* ECHOWT		/ WAIT FOR PRIOR OUTPUT TO 

	  JMP RQSTWT		/ FINISH.

	LAC* LP.BFR		/ INITIALIZE FOR COPY LOOP.

	DAC WRT.0

	CLX

	PLA			/ FORMULATE HEADER WORD.

	CLL!RAR

	SWHA!SKP		/ SKIP SINCE HAVE ALREADY

				/ FETCHED HEADER WORD.

WRT.B	LAC* X16		/ COPY LINE BUFFER TO OUR

	DACIX WRT.0		/ LISTING BUFFER.

	AXS 1

	JMP WRT.B

	LAC (15*200*20+15)	/ APPEND A CARRAIGE RETURN

	DACIX WRT.0		/ TO LINE (ALLOW FOR BOTH

				/ IOPS AND IMAGE ASCII).

	JMS* PRINT		/ PRINT THE LINE.

	  JMP RQSTWT		/ SHOULD NEVER HAPPEN.

	  LAC* LP.BFR

WRT.C	CLA!IAC!SKP		/ RETURN EV = +1.

/ COME HERE IF USER'S BUFFER IS OUTSIDE HIS PARTITION.

WRT.D	LAW -30

	SKP

/ COME HERE IF WORD PAIR COUNT IS NOT > 1.

WRT.E	LAW -16

/ COME HERE TO RETURN EV = VALUE IN AC.

WRT.F	JMS RQSTFN

	JMP MAINLP

 

 

 

WRT.0	0			/ TEMPORARY.

	.TITLE READ REQUEST PROCESSOR

 

 

 

 

/

/ THIS ROUTINE PROCESSES READ I/O REQUESTS USING A STATE

/ TABLE.  LOCATION STATE POINTS TO A TWO WORD ENTRY OF

/ THE FOLLOWING FORM:

/

/	STATE --> < ACTION IF TDV READ >

/		  < ACTION IF NON-TDV READ >

/

/ A STATE TABLE ENTRY CONSISTS OF TWO WORDS.  THE FIRST

/ WORD SPECIFIES THE ACTION TO TAKE IF THE READ REQUEST

/ WAS ISSUED BY THE TDV DISPATCHER.  THE SECOND WORD

/ SPECIFIES THE ACTION TO TAKE IF THE READ REQUEST IS FROM

/ ANY OTHER TASK.

/

/ ACTION WORDS HAVE THE FOLLOWING FORM:

/

/		[NXT+]ACTION ADDRESS

/

/ AN ACTION WORD CONSISTS OF AN ACTION TYPE FIELD AND AN

/ ADDRESS FIELD.  THE CODE "NXT" MAY BE OPTIONALLY ADDED

/ TO ANY OF THE ACTION TYPE CODES.  THE MEANING TO THE

/ ACTION TYPE CODES IS AS FOLLOWS:

/

/	NXT	ADVANCE TO NEXT STATE -- I.E., ADD TWO

/		TO LOCATION STATE.

/

/	MSG	"ADDRESS" IS THE ADDRESS OF A TEXT BUFFER.

/		USE THE CONTENTS OF THE TEXT BUFFER TO

/		SATISFY THE READ.

/

/	GLBMSG	"ADDRESS" IS A GLOBAL SYMBOL USED TO

/		REFERENCE THE TEXT BUFFER, WHICH RESIDES

/		IN THE RESIDENT SECTION.  NOTE THAT THIS

/		IS IDENTICAL TO "MSG" WITH ONE LEVEL OF

/		INDIRECTION SPECIFIED.

/

/	GLBIND	"ADDRESS" IS A GLOBAL SYMBOL USED TO

/		REFERENCE A POINTER TO THE TEXT BUFFER.

/		NOTE THAT THIS IS IDENTICAL TO "MSG"

/		WITH TWO LEVELS OF INDIRECTION SPECIFIED.

/

/	GOTO	"ADDRESS" IS THE ADDRESS OF A STATE TABLE

/		ENTRY.  CHANGE STATE TO THAT ENTRY, THEN

/		PERFORM THE ACTION INDICATED BY THAT ENTRY.

/		NOTE THAT IT IS INAPPROPRIATE TO COMBINE

/		"NXT" WITH "GOTO".

/

/	CALL	"ADDRESS" IS THE ADDRESS OF A ROUTINE.  JMP

/		TO THAT ROUTINE.  THE ROUTINE MUST RETURN

/		IN ONE OF THE WAYS DESCRIBED BELOW.

/

/ ALTERNATIVELY, AN ACTION WORD MAY CONTAIN THE SYMBOL

/ "ILLEGAL".  THIS INDICATES THAT AN EV VALUE OF -6 SHOULD BE

/ RETURNED.  "NXT" MAY BE COMBINED WITH "ILLEGAL" IF DESIRED.

/

/ NOTE:  THE "CALL" ACTION ROUTINE HAS BEEN MODIFIED, FOR

/	THIS VARIATION OF THE READ REQUEST PROCESSOR, FROM

/	THE PRIMARY VERSION IN BDMAIN.  THE MODIFICATION

/	HAS BEEN DONE BY COMMENTING OUT APPROPRIATE CODE,

/	RATHER THAN ACTUALLY DELETING ANYTHING.  THE DESC-

/	RIPTION BELOW REFLECTS THE MODIFIED "CALL" PROCESSING.

/

/ THE ROUTINE INVOKED BY A "CALL" ACTION MUST RETURN VIA

/ ONE OF THE FOLLOWING PATHS:

/

/  JMP RD.CONT	THE READ REQUEST HAS NOT YET BEEN SATISFIED.

/		THE STATE MUST HAVE CHANGED, EITHER VIA

/		A "NXT" VARIATION OR BY THE ROUTINE MANUALLY

/		CHANGING LOCATION STATE; OTHERWISE AN INFINITE

/		LOOP WILL RESULT.  A NEW ACTION IS PERFORMED,

/		BASED UPON THE NEW STATE VALUE.

/

/  JMP RD.FIN	THE READ REQUEST CAN BE SATISFIED.  THE AC

/		CONTAINS THE ADDRESS OF A TEXT BUFFER.  THE

/		CONTENTS OF THIS TEXT BUFFER WILL BE USED

/		TO SATISFY THE READ REQUEST.

/

/ SPECIAL CASE PROCESSING IS AVAILABLE TO HANDLE EXITS FROM

/ STATE DRIVEN PROCESSING.  THIS IS USED BY THE JOB END/LOGOFF

/ PROCESSING.  A "CALL" ACTION IS USED TO INVOKE A ROUTINE.

/ THIS ROUTINE CALLS SUBROUTINE RD.XFER TO SATISFY THE READ

/ REQUEST, THEN EXITS HOWEVER IT DESIRES.

/

 

 

 

 

NXT=400000

 

MSG=000000

GOTO=100000

GLBMSG=200000

GLBIND=240000

CALL=300000

 

ILLEGAL=CALL RDILLGL

	.TITLE     ENTRY FROM I/O FUNCTION DISPATCH

 

 

 

 

/

/ READ REQUEST PROCESSOR -- MAIN ENTRY FROM I/O DISPATCH.

/ ENTER WITH REQUEST NODE ADDRESS IN RQSTND.

/

 

 

READ	LACIX (7)		/ FETCH DATA MODE

	SAD (2)			/ MUST BE IOPS ASCII.

	JMP RD.B		/ JMP IF IT IS

	LAW -7			/ IT ISN'T -- ERROR.

	SKP

RDILLGL	LAW -6			/ "CALL" ENTRY FOR ILLEGAL READ

	SKP

RD.A	LAW -30			/ COME HERE IF ILLEGAL BUFFER

	.DEBUG <"BDLGOF:READ -- READ REQUEST ERROR, EV SET TO ">,-1,10

	JMS RQSTFN		/ SET EV TO NEG. VALUE & FINISH

	JMP MAINLP		/ REQUEST, THEN GO GET ANOTHER.

 

 

/ COME HERE IF DATA MODE IS INDEED IOPS ASCII

 

RD.B	LACIX (10)		/ FETCH BUFFER ADDRESS

	DAC* (R3)		/ SAVE FOR VAJX

	LACIX (11)		/ FETCH BUFFER LENGTH

	DAC* (R4)		/ SAVE FOR VAJX

	DAC RDBFRL		/ SAVE FOR RD.XFER

	LACIX (2)		/ FETCH STL OF REQUESTOR

	PAX			/ POINT XR TO IT.

	.DEBUG <"BDLGOF:READ -- READ REQUEST FROM TASK ">,-2,111

	LAC (TDV)		/ LOAD AC WITH ZERO IF

	SADIX (S.N1)		/ REQUESTOR'S TASK NAME IS

	LACIX (S.N2)		/ "TDV...", +1 OTHERWISE.

	SAD (...)

	CLA!SKP

	CLA!IAC

	DAC RDTDV		/ SAVE TDV SWITCH IN RDTDV.

	JMS* (VAJX)		/ VERIFY I/O BUFFER IS OK.

	  JMP RD.A		/ JMP IF NOT OK -- ERROR.

	LAC* (R3)		/ SAVE REQUEST BUFFER ADDRESS

	DAC RDBFRA		/ FOR RD.XFER.

	LAC STATE		/ SAVE INITIAL STATE, IN CASE

	DAC RDSTATE		/ RD.WAT MUST UNWIND ALL MODS.

	JMP RD.CONT		/ GO PROCESS ACTION FOR CURRENT

				/ STATE.

 

 

 

RDTDV	0			/ TDV/NON-TDV READ SWITCH.  SET

				/ TO 0 FOR TDV READS, 1 FOR

				/ NON-TDV READS BY ABOVE CODE.

				/ USED BY RD.CONT TO INDEX

				/ INTO STATE TABLE ENTRY.

 

RDSTATE	-1			/ SAVED STATE VALUE.  SET TO

				/ INITIAL STATE BY ABOVE

				/ CODE, USED BY RD.WAT TO

				/ UNWIND STATE TRANSITIONS.

 

RDADDR	-1			/ ADDRESS FIELD OF STATE TABLE

				/ ENTRY.  SET TO ADDRESS FIELD

				/ OF STATE TABLE ENTRY BY

				/ RD.CONT, REFERENCED BY

				/ RD.CONT AND RD.NEXT.

 

RDBFRA	-1			/ REQUESTOR'S BUFFER ADDRESS.

				/ SET TO ABSOLUTE BUFFER

				/ BY ABOVE CODE, USED BY

				/ RD.XFER.

 

RDBFRL	0			/ REQUESTOR'S BUFFER LENGTH.

				/ TO BUFFER LENGTH BY ABOVE

				/ CODE, USED BY RD.XFER.

	.TITLE     RD.CONT -- INVOKE CURRENT STATE ACTION

 

 

 

 

/

/ THIS ROUTINE SELECTS THE APPROPRIATE WORD FROM THE

/ CURRENT STATE TABLE ENTRY (POINTED TO BY LOCATION STATE).

/ THE ACTION WORD IS DECODED AND APPROPRIATE STEPS TAKEN

/ TO OBEY IT.

/

 

 

RD.CONT	LAC RDTDV		/ GET TDV SWITCH IN XR (0 IF

	PAX			/ TDV, +1 OTHERWISE).

	LAC STATE		/ COMPUTE ADDRESS FIELD OF

	XORIX STATE		/ ACTION.  ACTION WORD CON-

	AND (770000)		/ TAINS OFFSET WITHIN PAGE,

	XORIX STATE		/ MUST USE PAGE BITS FROM

	DAC RDADDR		/ CURRENT STATE POINTER.

	LACIX STATE		/ PICK UP ACTION WORD.

	SPA			/ SKIP IF NOT "NXT"

	ISZ STATE		/ "NXT" -- BUMP STATE

	SPA!RAL			/ SKIP IF NOT "NXT"

	ISZ STATE		/ "NXT" -- FINISH STATE BUMP.

	SPA!RTL			/ SKIP IF "MSG" OR "GOTO"

	JMP RDCN.A		/ JMP IF "GLBMSG", "GLBIND", 

				/ OR "CALL"

	LAC RDADDR		/ FETCH ACTION WORD ADDR. FIELD

	SNL			/ SKIP IF "GOTO"

	JMP RDCN.B		/ JMP IF "MSG" -- GO DO IT.

	DAC STATE		/ "GOTO" -- UPDATE STATE,

	JMP RD.CONT		/ THEN GO FIND NEW ACTION.

 

 

/ COME HERE IF ACTION IS "GLBMSG", "GLBIND", OR "CALL"

 

RDCN.A	SZL!RAL			/ SKIP IF "GLBMSG" OR "GLBIND".

	JMP RD.NEXT		/ JMP IF "CALL" -- GO DO IT.

	LAC* RDADDR		/ INDIRECT THROUGH GLOBAL SYM.

	SNL			/ SKIP IF "GLBIND".

	JMP RDCN.B		/ JMP IF "GLBMSG".

	DAC RDADDR		/ INDIRECT THROUGH POINTER TO

	LAC* RDADDR		/ PICK UP TEXT BUFFER ADDRESS.

/ COME HERE ON "MSG", "GLBMSG", OR "GLBIND" WITH TEXT BUFFER

/ ADDRESS IN AC.

/ CAN'T USE RD.FIN, BECAUSE IT MIGHT READ A NEW INPUT LINE.

RDCN.B	JMS RD.XFER		/ TRANSFER TEXT TO REQUEST

	JMP MAINLP		/ GO FIND ANOTHER  REQUEST.

	.TITLE     RD.NEXT, RD.WAT -- PROCESS "CALL" ACTION

 

 

 

 

/

/ COME HERE TO PROCESS "CALL" REQUEST.  ALSO COME HERE IF

/ "CALL" ROUTINE READS A NEW INPUT LINE AND WANTS TO MAKE

/ SURE ITS IN THE INPUT BUFFER.

/

/ THIS ROUTINE CHECKS IF INPUT HAS COMPLETED -- IF NOT,

/ DO RD.WAT.

/

/ NOTE:  THE ROUTINE PRESENTED HERE (AND THE DESCRIPTION ABOVE)

/	IS TAKEN FROM BDMAIN.  EXTENSIVE PORTIONS HAVE BEEN

/	DELETED BY COMMENTING THEM OUT.  THE REVISED ROUTINE

/	MERELY INVOKES THE "CALL" ROUTINE -- I.E., IT JUST

/	DOES AN INDIRECT JMP THROUGH RDADDR.

/

 

 

RD.NEXT=.

/	LAC* IN.EV		/ IS INPUT COMPLETE?

/	SZA			/ SKIP IF NOT.

	JMP* RDADDR		/ JMP IF IT IS -- INVOKE

				/ "CALL" ROUTINE.

/	JMS* ISSUE		/ ISSUE HINF TO INPUT DEVICE.

/	  IN.HINF+400000	/ SO WE WILL WAKEUP WHEN I/O

/				/ IS DONE.

/	.DEBUG <"BDLGOF:RD.NEXT -- IN.HINF ISSUED.">,0,0

// COME HERE TO WAIT FOR I/O TO FINISH, THEN RETRY REQUEST.

// THIS ROUTINE UNWINDS ANY STATE TRANSITIONS WHICH HAVE

// OCCURED DURING THIS REQUEST.

/RD.WAT	LAC RDSTATE		/ RESTORE SAVED STATE.

/	DAC STATE

/	JMP RQSTWT		/ AND DEFER REQUEST.

	.TITLE     RD.FIN -- FINISH A READ REQUEST

 

 

 

 

/

/ RD.FIN -- ROUTINE TO FINISH A READ REQUEST.  COME HERE

/ WITH TEXT BUFFER ADDRESS IN AC TO SATISFY CURRENT READ

/ REQUEST.  TEXT BUFFER CONTAINS TEXT TO SATISFY THE READ.

/ IF THE TEXT BUFFER IS THE INPUT BUFFER (ADDRESS IN IN.BFR),

/ A NEW INPUT LINE WILL BE READ.

/

/ NOTE:  ABOVE DESCRIPTION FOR RD.FIN IN BDMAIN.  THIS VERSION

/	HAS HAD THE INPUT BUFFER CHECKING COMMENTED OUT, SO

/	THAT A NEW INPUT LINE WILL NEVER BE READ.

/

 

 

RD.FIN	JMS RD.XFER		/ TRANSFER TEXT TO READ &

				/ FINISH READ & PRESERVE AC.

/	SAD* IN.BFR		/ IS IT THE INPUT BUFFER?

/	SKP			/ SKIP IF YES.

/	JMP RDFN.A		/ JMP IF NO.

/	JMS* ISSUE		/ IT IS THE INPUT BUFFER --

/	  IN.CPB+400000		/ READ NEW INPUT LINE.

RDFN.A	JMP MAINLP		/ GO FETCH NEXT REQUEST.

	.TITLE     RD.XFER -- SUBR. TO TRANSFER TEXT BUFFER

 

 

 

 

/

/ ROUTINE TO TRANSFER TEXT BUFFER TO THE READ

/ REQUEST BUFFER.  ENTER WITH AC CONTAINING ADDRESS OF

/ TEXT BUFFER.  THE TEXT BUFFER IS COPIED TO THE REQUESTOR'S

/ BUFFER, HIS EV IS SET TO +2, AND THE I/O REQUEST IS

/ FINISHED (VIA JMS RQSTFN).

/

/ NOTE THAT THE HEADER WORD PAIR IS ALWAYS COPIED, REGARDLESS

/ OF THE WORD PAIR COUNT OR BUFFER LENGTH.

/

/ THE AC IS PRESERVED.

/

/ CALLING SEQUENCE:

/	LAC (TEXT BUFFER ADDRESS)

/	JMS RD.XFER

/

/ REGISTERS ALTERED:

/	ALL EXCEPT AC

/

/ VALUES RETURNED:

/	NONE

/

 

 

RD.XFER	0

	.DEBUG <"BDLGOF:RD.XFER -- READ SATISFIED, BUFFER:  ">,-1,51

	DAC RDXF.0		/ SAVE TEXT BUFFER ADDRESS

	DAC* (X15)		/ SET UP X15 TO FETCH FROM IT

	LAW -1			/ SET UP X16 TO STORE INTO

	TAD RDBFRA		/ REQUESTOR'S BUFFER.

	DAC* (X16)

	LAW 777000		/ FETCH HEADER WORD PAIR COUNT

	AND* RDXF.0

	SWHA

	PAL			/ PUT IN LR FOR LOOP CONTROL

	CLX			/ ALSO CLEAR XR.

	CLL!RAL			/ CALC. NEGATIVE LENGTH IN

	CLL!TCA			/ WORDS OF TEXT BUFFER.

	TAD RDBFRL		/ AND COMPARE WITH REQUESTOR'S

	SZL!CLA			/ SKIP IF BUFFER OVERFLOW

	JMP RDXF.A		/ JMP IF TEXT WILL FIT.

	LAC RDBFRL		/ TRANSFORM REQUESTOR'S BUFFER

	CLL!RAR			/ LENGTH TO WORD PAIR COUNT.

	PAL			/ PUT IN LR FOR LOOP CONTROL.

	SWHA			/ FORMULATE HEADER WORD WITH

	AAC 60			/ BUFFER OVERFLOW BITS SET.

	XOR* RDXF.0		/ MERGE INTO EXISTING HEADER

	AND (777060)		/ WORD.

RDXF.A	XOR* RDXF.0		/ PICK UP HEADER WORD, REVISED

				/ AS APPROPRIATE.

	DAC* X16		/ SAVE IT AWAY.

	LAC* X15		/ PICK UP NEXT WORD.

	AXS 1			/ CHECK FOR WORD PAIR COUNTS

	SKP			/ OF ZERO OR ONE.

	JMP RDXF.C		/ JMP IF WPC ZERO OR ONE.

RDXF.B	DAC* X16		/ COPY TEXT BUFFER TO

	LAC* X15		/ REQUESTOR'S BUFFER,

	DAC* X16		/ LEAVING FINAL WORD IN AC.

	LAC* X15

	AXS 1

	JMP RDXF.B

	DAC RDXF.1		/ SAVE FINAL WORD.

	AND (177*2)		/ MASK OUT LAST CHAR.

	SAD (175*2)		/ IS LAST CHAR. AN ALT MODE?

	CLA!SKP			/ IS ALT MODE -- DON'T ALTER

	XOR (15*2)		/ OTHERWISE, FORCE TO CR

	XOR RDXF.1

RDXF.C	DAC* X16		/ STORE LAST WORD.

	LAC (2)			/ SET EV TO +2.

	JMS RQSTFN		/ AND FINISH REQUEST.

	LAC RDXF.0		/ RESTORE AC,

	JMP* RD.XFER		/ AND RETURN.

 

 

RDXF.0	0			/ TEXT BUFFER ADDRESS OR SAVED

				/ AC VALUE.

 

RDXF.1	0			/ TEMPORARY USED TO SAVE LAST

				/ WORD OF TEXT BUFFER.

	.TITLE ST.EOJ -- STATE TABLE FOR END-OF-JOB SEQUENCE

 

 

 

 

/

/ STATE IS SET TO ST.EOJ BY THE BDLGOF INITIALIZATION CODE.

/ THIS STATE TABLE CONTROLS THE LOGOFF SEQUENCE.

/

 

 

ST.EOJ	NXT+GLBMSG ASSLP	/ ASSIGN 4, 13, AND 16 TO

	ILLEGAL			/ LISTING DEVICE.

/

	NXT+GLBMSG ASS13ACCT	/ ASSIGN 13 TO ACCT. FILE

	ILLEGAL

/

	NXT+GLBMSG ASS4OPR	/ ASSIGN 4 TO OPR TTY

	ILLEGAL

/

	NXT+MSG PARCMD		/ RESTORE DEFAULT PARTITION

	ILLEGAL			/ PARAMETERS.

/

	NXT+MSG ENDCMD		/ INVOKE END...

	ILLEGAL

/

	GOTO ST.OFF		/ IF END... FINISHED, LOGOFF

	NXT+GLBMSG ENDMSG	/ SEND JOB TERMINATION INFO.

				/ TO END...

/

	GOTO ST.OFF		/ IF END... FINISHED, LOGOFF

	NXT+GLBMSG BEGMSG	/ SEND ACCOUNTING INFO TO

				/ END...

/

	GOTO ST.OFF		/ IF END... FINISHED, LOGOFF

	NXT+GLBMSG QJBINF	/ SEND JOB QUEUE INFO LINE

/

	GOTO ST.OFF		/ IF END... FINISHED, LOGOFF

	NXT+GLBIND IN.BFR	/ SEND INPUT LINE, WHICH MAY

				/ BE $JOB OR $END CARD.

/

ST.OFF	CALL LOGOFF		/ IF END... FINISHED, LOGOFF

	MSG EOFBFR		/ SEND END-OF-FILE UNTIL

				/ END... FINISHES.

 

 

 

PARCMD	TEXT <"PAR +1400"<15>>	/ TDV COMMAND TO RESTORE

				/ DEFAULT PARTITION

				/ PARAMETERS.

 

ENDCMD	TEXT <"END"<15>>	/ TDV COMMAND TO INVOKE END...

	.TITLE LOGOFF -- LOG OFF FROM TDV, EXIT MAIN RQST LOOP

 

 

 

 

/

/ THIS ROUTINE SENDS THE "OFF" COMMAND TO TDV, LOGGING

/ OFF THE BATCH USER.  THIS ROUTINE THEN GOES TO BDFINI

/ WHICH ENSURES THAT THE LOGOFF HAS COMPLETED, AND THEN

/ STARTS THE NEXT JOB IF THE CURRENT INPUT LINE (IN IN.BFR)

/ (I.E., THE CAUSE OF JOB TERMINATION) IS A $JOB CARD.

/

/ NOTE THAT THIS ROUTINE EXITS FROM THE MAIN REQUEST

/ PROCESSING LOOP.

/

 

 

LOGOFF	LAC (LGOF.A)		/ SEND "OFF" COMMAND TO

	JMS RD.XFER		/ TDV.

	SKP			/ SKIP WAITFOR FIRST TIME.

LGFF.A	CAL* WAITFR		/ WAIT FOR TRIGGER TO SET.

	JMS* ECHOWT		/ IS LISTING ACTIVITY COMPLETE?

	  JMP LGFF.A		/ NO -- GO WAIT FOR IT.

	JMS* BDFINI		/ GO VERIFY LOGOFF COMPLETE.

 

 

/ "OFF" COMMAND TO LOGOFF FROM TDV

 

LGOF.A	TEXT <"OFF"<15>>

 

 

 

	.END
