	.TITLE     ***  BDSTRT -- LOGIN TO TDV

 

 

 

 

/

/ 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

 

 

 

 

/

/ BDSTRT

/

/ COME HERE, WITH A READ OUTSTANDING, TO PROCESS A $JOB

/ WITHIN A JOB FILE.  SCAN UNTIL WE FIND EITHER A $JOB CARD

/ OR A JOB ERROR (JOBERR NON-ZERO).  THEN LOGIN TO TDV (^T),

/ UPDATE ACCOUNTING INFO, FORMAT BEGMSG, AND EXIT TO BDMAIN.

/ EXIT WITH $JOB CARD (IF FOUND) IN IN.BFR.

/

 

 

 

/
/ 100	20-AUG-76 (EAG)		MULTIACCESS BATCH, INITIAL
/				VERSION.
/
/ 101	1-SEP-76 (EAG)		FIX BUG WHEREBY BATCH WOULD	/(101)
/				CRASH TDV IF SYSTEM WAS FULL.	/(101)
/				ADD CALL TO FLUSH IN LOGIN.	/(101)
/				ALSO, ADD FLUSH SUBROUTINE	/(101)
/				(STOLEN FROM BDFINI 100).	/(101)
/								/(102)
/ 102	2-SEP-76 (RCHM)		ADD CALL TO THE FLUSH ROUTINE.	/(102)
/				(RASPBERRIES TO ED FOR GETTING	/(102)
/				ROOT'S DISEASE)			/(102)
/

	.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							/(101)

LACIX=LAC* X

 

 
 

/

/ SPECIAL INSTRUCTIONS:

/

 

.INH=705522			/ INHIBIT INTERRUPTS.

.ENB=705521			/ ENABLE INTERRUPTS.

 

 
 

/

/ 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

 

 

 
 
/								/(101)
/ REENTRANT REGISTERS USED TO INTERFACE TO REENTRANT		/(101)
/ ROUTINES:							/(101)
/								/(101)
								/(101)
R1=101								/(101)
 
 
 
/								/(101)
/ REENTRANT SYSTEM ROUTINE ENTRY POINTS:			/(101)
/								/(101)
								/(101)
NADD=107			/ ADD NODE IN R2 TO		/(101)
				/ LISTHEAD IN R1.		/(101)
								/(101)
PICK=120			/ PICK NODE FROM LISTHEAD	/(101)
				/ IN R1, RETURN IN AC & R2.	/(101)
 
 
 
/
/ TIME VALUES:

/

 

SSM=160				/ SECONDS SINCE MIDNIGHT.

 

MO=166				/ CURRENT MONTH (1 = JANUARY)

 

DA=167				/ CURRENT DAY (WITHIN MONTH)

 
YR=170				/ CURRENT YEAR (0 = 1900)

 

 
 
/
/ MULTIACCESS CONTROL REGISTERS.  USED TO INTERFACE WITH TDV:

/

 
MA.CT=226			/ ^T FLAG WORD.
 
 
 
/								/(101)
/ QUEUE LISTHEADS:						/(101)
/								/(101)
								/(101)
POOL=240			/ POOL OF EMPTY NODES.		/(101)
 
 
 
/								/(101)
/ ENTRY POINTS TO I/O HANDLER REENTRANT ROUTINES:		/(101)
/								/(101)
								/(101)
IOCD=345			/ ADJUST TRANSFER PENDING	/(101)
				/ COUNT OF I/O REQUEST IN R2.	/(101)
	.TITLE NODE FORMAT DEFINITIONS

 

 

 

 
/

/ REFERENCES TO PDVL NODES:

/
 
D.QF=6				/ I/O REQUEST QUEUE LISTHEAD.	/(101)
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 BDSTRT

 

 

 

/
/ DEFINE ENTRY POINT TO BATCH OVERLAY WHICH

/ THIS OVERLAY EXITS TO.

/

 

	.GLOBL BDMAIN

 

 

 

/

/ 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 CHKCRD		/ ROUTINE TO DETERMINE TYPE OF

				/ INPUT LINE.

 
	.GLOBL USRSTAT		/ ROUTINE TO DETERMINE LOGIN

				/ STATUS OF BATCH.

 

 

 

/

/ OTHER LOCATIONS IN BATCH CONTROL VECTOR:

/

 

	.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.JOB=004000+400000		/ JOB ATTEMPTED TO READ A $JOB

				/ CARD (JOB TERMINATES, THEN

				/ NEXT JOB IN JOB FILE IS RUN).

 

 

 

/

/ DEFINE REFERENCES TO OTHER TEXT BUFFERS IN RESIDENT:

/

 

	.GLOBL BEGMSG		/ MESSAGE PASSED TO JOB...

				/ AND END... CONTAINING

				/ ACCOUNTING INFO.

 

 

 

/

/ REFERENCES TO CPB'S AND ASSOCIATED EVENT VARIABLES:

/

 

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

				/ INTO IN.BFR.

 

 

 

/

/ REFERENCES TO OTHER WORDS IN RESIDENT:

/

 

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

 

	.GLOBL TRGGR		/ BATCH'S TRIGGER EVENT

				/ VARIABLE.

 

	.GLOBL TTYBIT		/ BIT MASK FOR BATCH'S TERMINAL

				/ NUMBER WITHIN LOCATIONS

				/ MA.CT, MA.CY, ETC.

 

	.GLOBL RUNTIM		/ LOCATION WHICH ACCUMULATES

				/ THE RUN TIME (SECONDS)

				/ (CLOCK OR REAL TIME MINUS

				/ PARTITION WAIT TIME) FOR

				/ ALL JOBS IN THE CURRENT

				/ JOB FILE.

 

	.GLOBL JOBNUM		/ LOCATION CONTAINING THE

				/ NUMBER OF THE CURRENT JOB

				/ WITHIN THE CURRENT JOB

				/ FILE.

	.TITLE BDSTRT -- ENTRY POINT & $JOB SEARCH

 

 

 

 

/

/ ENTRY POINT TO BDSTRT OVERLAY.  COME HERE FROM BDOPEN
/ OR BDFINI WITH A READ OUTSTANDING (OR PERHAPS ALREADY

/ COMPLETED), UNLESS A ERROR HAS ALREADY BEEN ENCOUNTERED.

/

/ SEARCH FOR $JOB CARD OR ERROR FLAG (IN JOBERR).  NOTE,

/ HOWEVER, THAT CHKCRD SETS BITS IN JOBERR WHEN A $JOB

/ CARD IS READ.  THEREFORE, JUST SEARCH UNTIL A FLAG

/ IN JOBERR IS SET.  WHEN FOUND, GO TO HAVJOB.  IF $JOB

/ CARD IS FOUND, GO TO HAVJOB WITH $JOB CARD IN IN.BFR.

/

 

BDSTRT	0

	.DEBUG <"BDSTRT ENTERED, JOBERR = ">,JOBERR,21

	LAC IN.EV		/ SET UP WAITFOR CPB TO WAIT

	DAC JBSR.0		/ FOR READ TO COMPLETE.

	LAC* JOBERR		/ ERROR FLAG SET PREVIOUSLY?

	SZA			/ SKIP IF NO.

	JMP HAVJOB		/ JMP IF JOB ERROR ALREADY

				/ OCCURRED -- JOB WILL BE

				/ ABORTED.

/ SEARCH FOR $JOB CARD:

JBSRCH	LAC* IN.EV		/ WAIT FOR READ TO FINISH.

	SNA

	CAL JBSR.A

	JMS* CHKCRD		/ GET CARD TYPE.

	LAC* JOBERR		/ HAVE WE REACHED A $JOB CARD

				/ OR SOME JOB TERMINATION

				/ CONDITION?

	SZA			/ SKIP IF NOT -- KEEP LOOKING.

	JMP HAVJOB		/ JMP IF YES -- GO LOGIN.

	JMS* ISSUE		/ CONTINUE SEARCH.

	  400000+IN.CPB

	JMP JBSRCH

 

 

/ CPB TO WAIT FOR INPUT READ TO COMPLETE.

 

JBSR.A	20

JBSR.0	0

	.TITLE HAVJOB -- ENSURE BATCH IS NOT LOGGED IN TO TDV

 

 

 

 

/

/ COME HERE WITH EITHER OR BOTH OF THE FOLLOWING:

/

/	1)  THE $JOB CARD IMAGE IN IN.BFR, AND JE.JOB SET IN

/	    JOBERR.

/

/	2)  AN ERROR FLAG SET IN JOBERR, INDICATING

/	    THAT THE JOB SHOULD BE TERMINATED.

/

/ THIS ROUTINE VERIFIES THAT WE ARE NOT LOGGED IN TO

/ TDV, THEN GOES TO LOGIN TO INITIATE THE JOB.

/

 

 

HAVJOB	JMS* USRSTAT		/ DETERMINE LOGIN STATUS.

	  JMP LOGIN		/ TDV NOT RUNNING.

	  JMP LOGIN1		/ USER NOT LOGGED IN.

	  NOP			/ USER PARTIALLY LOGGED IN.

	LAW -501		/ USER LOGGED IN -- SHOULD

	JMS* BDABRT		/ NEVER HAPPEN, SO GIVE

				/ BATCH SYSTEM ERROR.
	.TITLE LOGIN -- LOGIN TO TDV

 

 

 

 

/

/ COME HERE FROM HAVJOB AFTER WE HAVE VERIFIED THAT

/ WE ARE NOT YET LOGGED IN TO TDV.  ENTER AT LOGIN

/ IF TDV IS NOT RUNNING, AT LOGIN1 IF TDV IS RUNNING.

/ THIS IS USED TO DETERMINE WHETHER OR NOT TO REQUEST

/ TDV AS PART OF THE LOGIN SEQUENCE.

/

/ THIS ROUTINE SETS UP BATCH'S PDVL NODE, THEN LOGS IN

/ TO TDV, THEN TRANSFERS TO BEGJOB.

/

 

 
LOGIN	CLA!SKP			/ SET UP LOCATION LGIN.0 SO	/(101)
LOGIN1	CLA!CMA			/ THAT AN ISZ WILL SKIP IF TDV	/(101)
	DAC LGIN.0		/ IS ALREADY RUNNING, NOT SKIP	/(101)
				/ IF TDV IS NOT RUNNING (AND	/(101)
				/ THUS SHOULD BE REQUESTED).	/(101)
	LAC* PDVLND		/ POINT XR TO PDVL NODE.

	PAX
	LAC TRGGR		/ SET TRIGGER EVENT VARIABLE

	.INH			/// (TRGGR) ADDRESS INTO PDVL

	DACIX (D.TG)		/// NODE AND CLEAR ASSIGN

	LACIX (D.AI)		/// INHIBIT FLAG.  THIS ALLOWS

	AND (377777)		/// REQUESTS TO BE ISSUED TO
	.ENB			/// THE BATCH HANDLER, AND

	DACIX (D.AI)		/// ALSO LETS THE JOB ASSIGN
				/// TO THE BATCH HANDLER.

	.DEBUG <"BDSTRT:LOGIN -- SIMULATING ^T.  JOBERR = ">,JOBERR,21

	LAC* TTYBIT		/ SIMULATE ^T.

	CMA

	.INH			///

	AND* (MA.CT)		///

	XOR* TTYBIT		///

	.ENB			///

	DAC* (MA.CT)		///
	ISZ LGIN.0		/ SKIP IF TDV ALREADY RUNNING.	/(101)
	CAL LGIN.A		/ TDV NOT RUNNING -- REQUEST

				/ IT.  NOTE THAT DELAY CYCLE

				/ CHECKS FOR ERRORS, THEREFORE

				/ THERE IS NO EV AND THUS WE

				/ DON'T USE SUBROUTINE ISSUE.

	JMS DELAY		/ ALLOW TDV TO PROCESS.
	JMS* USRSTAT		/ VERIFY LOGIN HAS HAPPENED.
	  JMP LOGIN		/ TDV NOT RUNNING, TRY AGAIN.
	  JMP LOGIN2		/ NOT LOGGED IN, CLEAR I/O	/(102)
				/ QUE AND TRY AGAIN.		/(102)
	  JMP BEGJOB		/ JMP IF PARTIALLY LOGGED IN.

	LAW -502		/ LOGIN COMPLETE -- SHOULDN'T

	JMS* BDABRT		/ HAPPEN -- BATCH SYSTEM ERROR

 

 

/ REQUEST CPB TO REQUEST TDV.  NOTE THAT NO EV IS SPECIFIED,

/ AS DELAY CYCLE CHECKS THAT TDV HAS INITIALIZED WHICH

/ IMPLIES THAT THIS REQUEST SUCCEEDED.
 
LGIN.A	01

	0

	.SIXBT "TDV"

	.SIXBT "..."
	0			/ USE DEFAULT PRIORITY.
 
 
 
LGIN.0	0			/ TEMPORARY.			/(101)
								/(102)
LOGIN2	JMS FLUSH		/ CLEAR BATCH I/O REQUEST QUE.	/(102)
	JMP LOGIN1		/ TO AVOID TYING UP TDV DYNAMIC	/(102)
				/ STORAGE AREA.			/(102)
	.TITLE BEGJOB -- BEGIN BATCH JOB & FORMAT BEGMSG

 

 

 

 

/

/ COME HERE AFTER WE HAVE LOGGED IN TO TDV (ACTUALLY,

/ AFTER PARTIALLY LOGGING IN).  UPDATE ACCOUNTING INFO,
/ FORMAT BEGMSG, THEN TRANSFER TO BDMAIN.

/

 

 

BEGJOB	ISZ* JOBNUM		/ INCREMENT JOB NUMBER WITHIN

				/ CURRENT JOB FILE.

/

BGMS.A	LAC BEGMSG		/ FORMAT BEGMSG.

	JMS PCKINI

/

	LAC* (DA)		/ SAVE CURRENT DATE.

	DAC BGMS.0

/

	LAC* (YR)		/ PACK CURRENT DATE -- YEAR,

	JMS PCKNUM

	  -3

/

	LAC* (MO)		/ MONTH,

	JMS PCKNUM

	  -2

/

	LAC* (DA)		/ AND DAY.

	JMS PCKNUM

	  -2

/

	LAC* (SSM)		/ PACK CURRENT TIME (SSM).

	JMS PCKNUM

	  -5

/

	LAC* (DA)		/ HAS DATE CHANGED WHILE WE

	SAD BGMS.0		/ WERE PACKING DATE/TIME?

	SKP			/ SKIP IF IT HASN'T.

	JMP BGMS.A		/ JMP IF DATE HAS CHANGED WHILE

				/ WE WERE PACKING DATE/TIME --

				/ MUST TRY AGAIN TO ENSURE

				/ CONSISTENT TIME AND DATE.

/

	LAC* JOBNUM		/ PACK CURRENT JOB NUMBER

	JMS PCKNUM		/ WITHIN CURRENT JOB FILE.

	  -5

/

	LAC* RUNTIM		/ PACK ACCUMULATED RUN TIME OF

	JMS PCKNUM		/ ALL JOBS PRECEEDING THIS ONE

	  -6			/ IN THE JOB FILE.

/

	LAC* JOBERR		/ DETERMINE IF A $JOB CARD WAS

	AND (JE.JOB)		/ FOUND BY $JOB SEARCH (JBSRCH

	SAD (JE.JOB)		/ ABOVE), AND PACK A BOOLEAN

	CLA!SKP			/ VALUE INDICATING WHETHER OR

	LAW 106-124		/ NOT A $JOB CARD WAS FOUND.

	AAC 124

	JMS PACK57

/

	LAC (JE.JOB\777777)	/ RESET JE.JOB FLAG IN JOBERR,

	.INH			/// SO THAT INITIAL $JOB CARD

	AND* JOBERR		/// WON'T TERMINATE THE JOB.

	.ENB			/// NOTE THAT IT IS OK TO CLEAR

	DAC* JOBERR		/// JOBERR'S SIGN BIT, AS ANY

				/ OTHER ERRORS HAVE SET A BIT

				/ IN ADDITION TO THE SIGN BIT,

				/ AND THE INITIAL ERROR TEST AT

				/ LOGIN ABORTS IF JOBERR IS

				/ NON-ZERO, NOT JUST WHEN THE

				/ SIGN BIT IS SET.

/

	JMS PCKFIN		/ DONE WITH BEGMSG.

/

	JMS* BDMAIN		/ DONE -- EXIT TO BDMAIN.

 

 

 

BGMS.0	0			/ TEMPORARY USED ABOVE.
	.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 FLUSH -- SUBROUTINE TO FLUSH I/O REQUEST QUEUE
 
 
 
 
/								/(101)
/ ADDED DURING EDIT # 101.  STOLEN FROM BDFINI 100.		/(101)
/
/ 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 <"BDSTRT: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 PACK57 -- SUBR. TO PACK 5/7 ASCII CHARACTERS

 
 

 

 

/

/ THIS SUBROUTINE PACKS A CHARACTER INTO A 5/7 ASCII TEXT

/ BUFFER (I.E., AN IOPS ASCII LINE BUFFER).  SUBROUTINE

/ PCKINI MUST BE CALLED BEFORE THIS ROUTINE IS CALLED, TO

/ INITIALIZE VARIOUS POINTERS, AND SUBROUTINE PCKFIN MUST

/ BE CALLED AFTERWARDS, TO PACK A CARRAIGE RETURN AND SET UP

/ THE WORD PAIR COUNT.

/

/ THIS ROUTINE EXPECTS THE ASCII CHARACTER IN THE LOW 7 BITS

/ OF THE AC.  THE HIGH BITS OF THE AC ARE IGNORED.

/

/ CALLING SEQUENCE:

/	LAC (CHARACTER)

/	JMS PACK57

/

/ REGISTERS ALTERED:

/	AC, LINK, SC (STEP-COUNTER)

/

/ VALUES RETURNED:

/	NONE

/

 

 

PACK57	0

	AND (177)		/ MASK OUT UNWANTED BITS.

	CLL			/ CLEAR LINK FOR ALS INSTR.

	XCT* PCK5.0		/ DO CHAR. ACTION.  EITHER ALS

				/ INSTR. OR JMP TO PCK5.E OR

				/ PCK5.F.  PCK5.0 POINTS TO

				/ TABLE PCK5.C.

	XOR* PCK5.1		/ MERGE CHAR. INTO WORD.

PCK5.A	ISZ PCK5.0		/ BUMP CHAR. ACTION POINTER.

PCK5.B	DAC* PCK5.1		/ STORE WORD CONTAINING CHAR.

	JMP* PACK57		/ RETURN!

 

 

/ CHARACTER ACTION TABLE.  THE XCT INSTRUCTION ABOVE PERFORMS

/ AN INSTRUCTION FROM THIS TABLE VIA A POINTER IN PCK5.0.

/ SIMPLE CASES SHIFT CHAR. INTO POSITION, OTHERS JMP TO

/ ACTION ROUTINES.

 

PCK5.C	ALS+10			/ ACTION FOR CHAR. 4
	CLL!RAL			/ ACTION FOR CHAR. 5

PCK5.D	JMP PCK5.E		/ ACTION FOR CHAR. 1

	ALS+4			/ ACTION FOR CHAR. 2

	JMP PCK5.F		/ ACTION FOR CHAR. 3

 

 

/ ACTION FOR CHARACTER 1

 

PCK5.E	ISZ PCK5.1		/ BUMP WORD POINTER

	ALS+13			/ SHIFT CHAR. INTO POSITION.

	JMP PCK5.A		/ GO STORE CHAR.

 

 

/ ACTION FOR CHARACTER 3 (THE SPLIT CHARACTER)

 

PCK5.F	CLL!RAR			/ SHIFT FIRST PART OF CHAR.

	RTR			/ INTO POSITION.

	DAC PCK5.2		/ SAVE REST OF CHAR. FOR LATER.

	AND (17)		/ MASK OUT FIRST PART.

	XOR* PCK5.1		/ MERGE INTO WORD.

	DAC* PCK5.1

	LAC (PCK5.C)		/ RESET CHAR. ACTION POINTER.

	DAC PCK5.0

	ISZ PCK5.1		/ BUMP WORD POINTER.

	LAW 760000		/ MASK OUT REMAINDER OF CHAR.

	AND PCK5.2

	RAR			/ ROTATE INTO POSITION.

	JMP PCK5.B		/ AND GO STORE THE WORD.

 

 

 

PCK5.0	-1			/ CHARACTER ACTION POINTER.

				/ POINTS TO TABLE PCK5.C ABOVE.

 

PCK5.1	-1			/ WORD POINTER.  POINTS TO WORD

				/ CONTAINING THE LAST (LOW-

				/ ORDER) BIT OF LAST CHARACTER

				/ INSERTED.

 

PCK5.2	0			/ TEMPORARY

 

PCK5.3	-1			/ BUFFER POINTER.  POINTS TO

				/ LINE BUFFER HEADER WORD.

				/ USED BY PCKFIN.

	.TITLE     PCKINI -- INITIALIZE 5/7 ASCII PACKING

 

 

 

 

/

/ SUBROUTINE TO INITIALIZE ROUTINE PACK57 FOR 5/7 ASCII

/ PACKING.  CALL WITH ADDRESS OF LINE BUFFER HEADER IN

/ AC.  NOTE THAT A TWO WORD LINE BUFFER HEADER (AS IN

/ I/O BUFFERS) IS ASSUMED.

/

/ CALLING SEQUENCE:

/	LAC (LINE BUFFER HEADER ADDRESS)

/	JMS PCKINI

/

/ REGISTERS ALTERED:

/	AC, LINK

/

/ VALUES RETURNED:

/	NONE

/

 

 

PCKINI	0

	DAC PCK5.3		/ STORE BUFFER POINTER.

	IAC

	DAC PCK5.1		/ AND WORD POINTER.

	LAC (PCK5.D)

	DAC PCK5.0		/ SET UP CHARACTER ACTION PTR.

	JMP* PCKINI

	.TITLE     PCKFIN -- FINISH 5/7 ASCII PACKING

 

 

 

 

/

/ THIS SUBROUTINE IS CALLED WHEN 5/7 ASCII PACKING IS

/ FINISHED.  IT PACKS A CARRAIGE RETURN INTO THE TEXT BUFFER

/ FOR USE AS A LINE TERMINATOR.  THEN IT CALCULATES THE WORD

/ PAIR COUNT AND SETS THE LINE BUFFER HEADER WORD APPRO-

/ PRIATELY.  THE DATA MODE (IN THE LINE BUFFER HEADER WORD)

/ IS SET TO IOPS ASCII.

/

/ CALLING SEQUENCE:

/	JMS PCKFIN

/

/ REGISTERS ALTERED:

/	AC, LINK, SC (STEP-COUNTER)

/

/ VALUES RETURNED:

/	NONE (EXCEPT COMPLETED TEXT BUFFER)

/

 

 

PCKFIN	0

	LAC (15)		/ PACK CARRAIGE RETURN LINE

	JMS PACK57		/ TERMINATOR.

	LAC PCK5.3		/ PICK UP BUFFER ADDRESS.

	TCA

	TAD PCK5.1		/ CALCULATE WORD PAIR COUNT,

	CLL!RAR			/ POSITION IN HIGH HALF OF

	SWHA			/ WORD, THEN SET IOPS ASCII

	TAD (1002)		/ DATA MODE AND ALLOW FOR

	DAC* PCK5.3		/ HEADER WORD PAIR.

	JMP* PCKFIN

	.TITLE     PCKNUM -- PACK A DECIMAL NUMBER

 

 

 

 

/

/ THIS ROUTINE ACCEPTS A BINARY NUMBER AND A CHARACTER OR

/ DIGIT COUNT.  THE NUMBER IS CONVERTED TO A DECIMAL ASCII

/ STRING WITH THE APPROPRIATE NUMBER OF DIGITS, AND THE

/ DIGITS PACKED USING SUBROUTINE PACK57.  IF THE NUMBER

/ IS LARGER THAN THE SPECIFIED NUMBER OF DECIMAL DIGITS,

/ THE HIGH ORDER DIGITS ARE LOST.  LEADING ZEROS ARE PACKED

/ WITHOUT MODIFICATION.

/

/ THE BINARY NUMBER IS PASSED IN THE AC.  THE CHARACTER OR

/ DIGIT COUNT IS SPECIFIED BY AN INSTRUCTION WHICH IMMED-

/ IATELY FOLLOWS THE JMS.  THIS INSTRUCTION SHOULD LOAD THE

/ AC WITH THE TWOS COMPLEMENT OF THE DIGIT COUNT.  IT WILL

/ USUALLY BE A LAW INSTRUCTION.

/

/ CALLING SEQUENCE:

/	LAC (NUMBER)

/	JMS PCKNUM

/	  LAW -DIGIT COUNT

/

/ REGISTERS ALTERED:

/	AC, LINK, MQ, SC

/

/ VALUES RETURNED:

/	NONE

/

 

 

PCKNUM	0

	DAC PCKN.0		/ SAVE NUMBER TO BE PACKED.

	XCT* PCKNUM		/ FETCH DIGIT COUNT.

	DAC PCKN.1		/ SET UP DIGIT COUNTER.

PCKN.A	LAC PCKN.1		/ COPY DIGIT COUNTER TO

	DAC PCKN.2		/ DIVISION COUNTER.

	LAC PCKN.0		/ SET UP FOR DIVISION LOOP.

	LMQ!CLAC

PCKN.B	SLK!CLAC!DIV		/ DIVIDE NUMBER BY 10. THE

	  12			/ APPROPRIATE NUMBER OF TIMES,

	ISZ PCKN.2		/ LEAVING FINAL REMAINDER (THE

	JMP PCKN.B		/ DIGIT) IN THE AC.

	AAC 60			/ CONVERT DIGIT TO ASCII.

	JMS PACK57		/ PACK IT AWAY.

	ISZ PCKN.1		/ PACKED ALL DIGITS?

	JMP PCKN.A		/ JMP IF NOT -- LOOP FOR NEXT.

	JMP* PCKNUM		/ DONE -- RETURN.

 

 

 

PCKN.0	0			/ TEMPORARY TO SAVE NUMBER TO

				/ BE PACKED.

 

PCKN.1	0			/ DIGIT COUNTER.

 

PCKN.2	0			/ DIVISION COUNTER.

 

 

 

	.END
