	.TITLE	SCHED  --  SCHEDULE SETUP PROGRAM FOR RSX/BATCH

/ 

/ 
/                   FIRST PRINTING, FEBRUARY 1974

/ 

/ THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO 

/ CHANGE WITHOUT NOTICE AND SHOULD NOT BE CONSTRUED

/ AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.

/ DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPON-

/ SIBILITY FOR ANY ERRORS THAT MAY APPEAR IN THIS

/ DOCUMENT.

/ 

/ THE SOFTWARE DESCRIBED IN THIS DOCUMENT IS FUR-

/ NISHED TO THE PURCHASER UNDER A LICENSE FOR USE ON

/ A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH

/ INCLUSION OF DIGITAL'S COPYRIGHT NOTICE) ONLY FOR 

/ USE IN SUCH SYSTEM, EXCEPT AS MAY OTHERWISE BE PRO-

/ VIDED IN WRITING BY DIGITAL.

/ 

/ DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY

/ FOR THE USE OR RELIABILITY OF ITS SOFTWARE ON EQUIP-

/ MENT THAT IS NOT SUPPLIED BY DIGITAL.

/ 
/ COPYRIGHT (C) 1976, BY DIGITAL EQUIPMENT CORPORATION

/ 

/ 

        .EJECT

/

/	SCHED FUNCTION TASK
/	EDIT #1  1/30/74  G. COLE
/	EDIT #2-4	6/9/76	SCR
/	EDIT #5		7/22/76 SCR UPDATE INTERFACE
/	EDIT #6		8/4/76 SCR  READ FROM LUN 2 TT , NOT LUN 3 !

/

/

/	SCHED IS CALLED BY OPR TO SETUP A SCHEDULE TABLE

/		FROM A FILE OR FROM THE OPERATOR AT THE TERMINAL.

/

/	THIS TASK IS INDENDED TO BE NAMED SC.OPR

/		AND MUST RUN IN EXEC MODE.

/

/	TYPICAL SEQUENCE IS:

/

/	MCR>OPR SCH

/	*NAME

/	TF=23 CF=2 WF=1 TM=2 CM=0 WM=60

/

/	NAME IS THE NAME OF THE SCHEDULE FILE WHOSE EXTENSION IS

/	SCH( IE, IN THE EXAMPLE FILE NAME SCH WOULD BE READ)

/

/	ANOTHER EXAMPLE:

/

/	MCR> OPR SCH

/	*  TM=25

/

/	HERE THE USER SET THE MAXIMUM EXTIMATED JOB TIME TO 25 MIN

/	THE PRESENCE OF AN = IN THE EXPRESSING SIGNALS THAT THIS IS 

/	A DIRECT COMMAND AND NOT A FILE NAME. THUS FILE NAMES

/	MAY NOT BE USED WHICH HAVE EMBEDDED = SIGNS.

/

/

/

/	THE THIRD LINE IS THE CONTENETS OF THE SCHEDULE FILE

/	(ONE LINE ONLY IS USED).

/

/

/	IN A NORMAL ENVIRONMENT THERE WOULD BE

/	A FILE CORESPONDING TO EACH MAJOR PERIOD OR MODE OF 

/	SYSTEM OPERATION.(IE. MORN SCH,NOON SCH,WEEK SCH   ETC)

/

/	THE SCHEDULE MAY BE SE AT ANY TIME THAT BATCH IS RUNNING

/	BY INVOKING THIS TASK.

/

/

	.EJECT

/DEFINE THE PRINT MACRO USED HERE AND IN QUEUE AND OPR

	.DEFIN PRINT,ZLUN,ZA,ZB,ZC,ZD,ZE,ZF

	CAL	.+3

	CAL	.+10

ZTMP2=.

	HLT

	2700

	.+4

	ZLUN

	2

	.+4

	0

	20

	.-2

ZTMP=.

	0

	0

	.ASCII	"ZA ZB ZC ZD ZE ZF"<015>

ZTMP1=.

	.LOC	ZTMP

	ZTMP1-ZTMP/2*1000+2

	.LOC	ZTMP2

	JMP	ZTMP1

	.LOC	ZTMP1

	.ENDM

/

/	DEFINE PARAMETERS

	.IFUND	TTYLUN

TTYLUN=3		/DEFAULT TO MCR TTY OUT

	.ENDC
	.IFUND	SCHLUN
SCHLUN=10
	.ENDC		/LUN 8 IS THE SCHED LUN
BCV=147
TTLUN=TTYLUN

/

/  EQUATES FOR BCV ADDRESSING

/

WFACTR=0

TFACTR=1

CFACTR=2
CLSMIN=6
WAIMAX=4
TIMMAX=5

/

	.EJECT

/

/CODING TO GET THE USER TO INPUT A LINE

/

/PROMPT THE USER WITH AN ASTERICK AND WAIT

START	CAL	PROMPT

	CAL	WAITLL	/PRINT AN *

	LAC	EVL

	SPA		/WAS THAT OK

	JMP	CMDERR

	CAL	RCMDL	/READ COMMAND LINE

	CAL	WAITLL

	LAC	EVL

	SPA

	JMP	CMDERR

/

/	PREPARE THE LINE TO BE SCANNED

/

	LAC	(FETCH1	/SET UP FETCHER

	DAC	FETCHX

	LAC	(LINBF

	DAC	FETCHP

	JMP	SCPRO	/PROCESS THE COMMAND

/

/DEFINE NECESARY ROUTINES AND CPBS

/

/

PROMPT	2700	/WRIT

	EVL

	TTLUN

	3

	.+1

	002003

	0

	15

	52		/CPB TO PRINT CR,ASTERICK

WAITLL	20

	EVL

EVL	0

USRF	0	/SET TO ALLOW USER INPUT

/
RCMDL	2600		/CPB TO READ AL INE INTO LINBF
	EVL
	2		/(006)
	2
	LINBF

	60

LINBF	.BLOCK	60	/LINE BUFFER FOR COMMAND

/

CMDERR	PRINT	TTLUN,I/O,ERROR,TO,TERMINAL

	CAL	(10)

	.EJECT

/

/

/

SCPRO	LAC*	(BCV)	/IS BATCH RUNNING

	SNA!SPA		/(002) - IS ERROR, 0 NOT RUNNING

	JMP	BNRERR	/NO, TELL OPR AND QUIT

	LAC	(SNB-1)	/SETUP BUFFER FOR FILE NAME

	DAC*	(10)

	LAW	-6

	DAC	SCCNT	/COUNT FOR CHAR IN FILE NAME

	ISZ	USRF	/SET USER FLAG, WILL CAUSE USER INPUT

			/IF NULL LINE

 

SCSHR	JMS	GETC

	CAL	(10)	/EXIT IF EMPTY COMMAND

	SAD	(40)	/SCAN OFF BLANKS

	JMP	SCSHR

 

SCLOOP	SAD	(075)	/TEST FOR =

	JMP	SCUPK	/REPROCESS LINE AS A DIRECT SPECIFICATION

	DAC*	10	/STORE CHAR IN FILE NAME BUFFER

	JMS	GETC	/GET NEXT CHR

	JMP	SCASM	/GOT LAST ONE

	ISZ	SCCNT	/IS THIS 6

	JMP	SCLOOP	/NO

 

SCASM	LAC	SNB+5	/ASSEMBLE FILE NAME

	LRS	6

	LAC	SNB+4

	LRS	6

	LAC	SNB+3

	LLS	14	/SECOND HALF

	DAC	SCFIL2

	DAC	SCCFL2

 

	LAC	SNB+2	/ASSEMBLE FILE NAME

	LRS	6

	LAC	SNB+1

	LRS	6

	LAC	SNB

	LLS	14	/FIRST HALF

	DAC	SCFIL1

	DAC	SCCFL1	/INTO APPROPRIATE CPBS

 

	CAL	SCOPN	/OPEN THE FILE

	CAL	WAITLL

	LAC	EVL		/TRY TO GET THE SCHEDULE FIE

	SPA

	JMP	SCFNF		/ERROR IF NOT OK

	JMP	SCANL		/ANALYZE THE LINE

	.EJECT

SCANL	CAL	SCREAD		/READ THE LINE

	CAL	WAITLL

	LAC	EVL

	SPA			/TEST FOR OK

	JMP	SCRERR	/READ ERROR

	CAL	SCWRIT	/WRITE LINE TO USER

	CAL	WAITLL

 

SCUPK	LAC	(FETCH1	/SET UP FETCHER

	DAC	FETCHX

	LAC	(LINBF

	DAC	FETCHP

SCSCN	JMS	GETC

	JMP	SCDONE		/IF EMPTY LINE 

	SAD	(40)		/IGNORE SAPCES AND COMMAS

	JMP	SCSCN

	SAD	(54)

	JMP	SCSCN

	DAC	SNB

	JMS	GETC

	JMP	SCFERR		/ERROR IF NOT HERE

	DAC	SNB+1

	JMS	GETC

	JMP	SCFERR

	DAC	SNB+2

	LAC	SNB

	LRS	6

	LAC	SNB+1

	LRS	6

	LAC	SNB+2

	LLS	14

	DAC	SCNAM

	DZM	SCVAL		/PROPARE TO READ IN A NUMBER

	.EJECT

SCDIS	JMS	GETC	/GET FIRST CHAR

	JMP	SCFERR 

	AAC	-60	/TEST FOR DIGIT

	SPA

	JMP	SCFERR

	DAC	SCDIG	/SAVE, MAY BE GOOD

	AAC	-12

	SMA

	JMP	SCFERR	/NO ... ALAS IT IS NOT A DIGIT

 

	LAC	SCVAL	/MUL VAL*10 ADD DIG TO VAL

	LMQ

	MUL; 12

	LACQ

	TAD	SCDIG

	DAC	SCVAL	/SAVE VALUE AS RUNNING VALUE

 

	JMS	GETC	/GET NEXT DIGIT

	JMP	SCSTR	/STORE VALUE IF END

	SAD	(40)

	JMP	SCSTR	/STORE VALUE

	SAD	(54)

	JMP	SCSTR	/STORE VALUE

	JMP	SCDIS+2	/PROCESS NEXT AS A DIGIT

	.EJECT

/

/

/AT THIS POINT WE HAVE SCNAM CONTAINING THE TYPE OF THE ITEM

/AND SCVAL CONTAINING THE VALUE OF THE ITEM.

/

/PUT THE ITEM INTO ITS PLACE INT THE BCV.

/

SCSTR	LAC	SCNAM

	SAD	SCTF

	LAC	(TFACTR	/(002) OFFSET IN BCV, WHICH IS +

	SAD	SCWF

	LAC	(WFACTR	/(002) WAIT FACTOR

	SAD	SCCF

	LAC	(CFACTR	/(002) CLASS FACTOR

	SAD	SCTM

	LAC	(TIMMAX	/(002) MAX TIME

	SAD	SCWM

	LAC	(WAIMAX	/(002) MAXIMUM WAIT

	SAD	SCCM

	LAC	(CLSMIN	/(002) MINIMUM CLASS

		/IF YOU NEED TO ADD NEW FUNCTIONS PUT THEM IN HERE

	SPA		/(002) FOUND GIVES + VECTOR OFFSET

	JMP	SCTERR	/(002) AND - IS ERROR, NOT FOUND

SCSTV	DAC	SCTEMP

	LAC*	(BCV)

	SNA!SPA		/(002) BATCH STILL THERE

	JMP	BNRXXX

	TAD	SCTEMP

	DAC	SCTEMP

	LAC	SCVAL

	DAC*	SCTEMP

	JMP	SCSCN	/GET NEXT ITEM AND PUT IT AWAY

 

BNRXXX	DAC	ERRTMP	/(002) ERROR TYPE

	CAL	SCCLS

	CAL	WAITLL

	LAC	ERRTMP	/(002) TYPE BACK TO AC

	JMP	BNRERR	/CLOSE FIE AND PRINT ERROR

 

/

ERRTMP	0

/

SCDONE	CAL	SCCLS

	CAL	WAITLL

	CAL	(10)	/QUIT AFTER CLOSING FILE

	.EJECT

/DEFINE VARIABLES AND TABLES

SCVAL	0	 /HOLD PARAMETER VALUE

SCDIG	0

SCTEMP	0

SCNAM	0	/HOLDS PARAMTER NAME

 

/LIST OF PARAMETER NAMES

 

SCTF	.SIXBT	/=FT/

SCWF	.SIXBT	/=FW/

SCCF	.SIXBT	/=FC/

SCTM	.SIXBT	/=MT/

SCWM	.SIXBT	/=MW/

SCCM	.SIXBT	/=MC/

 

/DEFINE FILES CPBS

 

SCOPN	3200	/SEEK FILE

	EVL
	SCHLUN

SCFIL1	0

SCFIL2	0

	.SIXBT	/SCH/

 

SCCLS	3400	/CLOSE FILE

	EVL
	SCHLUN

SCCFL1	0

SCCFL2	0

	.SIXBT	/SCH/

 
SCREAD	2600	/READ LINE
	EVL
	SCHLUN
	2

	LINBF

	60

 

SCWRIT	2700

	EVL

	TTLUN

	2

	LINBF

 

SCCNT	0

SNB	0

	0	/FILE NAME BUFFER

	0

	0

	0

	0

	0

	.EJECT

/

/  GETC

/

/  THIS ROUTINE IS CALLED TO FETCH EACH CHARACTER

/  CHARACTER IS RETURNED IN THE AC RIGHT JUSTIFIED, LINK=0.

/

/  MODIFIED REGISTERS, AC LINK

/

/  ANY CALLS MADE BEYOND THE TERMINATORS <CR> AND <ALT>

/  WILL AGAIN RETURN THE TERMINATOR. <CR> AND <ALT> RETURN

/  AT CALL+1, OTHERS AT CALL+2

/

IDX=ISZ

/

/  INITIALIZE BY PLACING THE ADDRESS FETCH1 INTO LOCATION FETCHX

/  AND BY PLACING THE BUFFER ADDRESS IN FETCHP.

/

GETC	0

	LAC*	FETCHP	/FIRST STEP OF ALL ACTIONS

	JMP*	FETCHX	/DISPATCH TO ACTION FOR THIS CHAR

FETCHX	XX		/DISPATCH VECTOR

	AND	(177	/STRIP TO 7 BITS

	SAD	(15	/<CR>

	JMP	FETCHE	/SET TO RETURN FOREVE

	SAD	(175	/<ALT>

	JMP	FETCHE	/SET TO RETURN FOREVER

	IDX	GETC	/RETURN AT CALL+2 WITH NON-TERM.

FETCHY	CLL		/CLEAR LINK FOR CALLER

	JMP*	GETC

/

FETCHL	JMS	FETCHX	/LEAVING POINTER TO ACTION #1

/

FETCH1	SWHA		/POSITION CHAR #1

	RTR

	JMS	FETCHX	/LEAVING POINTER FOR SECOND CHAR

/

FETCH2	RTR		/POSITION CHAR #2

	RTR

	JMS	FETCHX	/LEAVING POINTER TO THIRD

/

FETCH3	RAR		/MOVE TOP HALF DOWN TO TOUCH BOTTOM

	IDX	FETCHP	/TO GET OTHER PORITION OF CHAR

	XOR*	FETCHP	/DOUBLE XOR MERGE

	AND	(7	/MASK CONTROLS WHICH BITS ARE KEPT

	XOR*	FETCHP

	RTL		/POSITION COMPBINED VHAR

	RTL

	JMS	FETCHX	/LEAVING POINTER TO #4

/

FETCH4	RAL		/POSITION

	SWHA

	JMS	FETCHX	/LEAVING POINTER FOR #5

/

FETCH5	RAR		/POSITION

	IDX	FETCHP	/MOVE TO NEXT PAIR

	JMP	FETCHL	/GO TO LEAVE POINTER TO #1

/

FETCHE	DAC	FETCHP	/SAVE TERMINATOR

	LAC	(FETCHZ	/FORCE DISPATCH TO FETCH TERMINATOR

	DAC	FETCHX

FETCHZ	LAC	FETCHP	/NOW IS TERMINATOR, NOT POINTER

	JMP	FETCHY	/FINISH UP WITH OTHER CODE

/

FETCHP	0		/POINTER

/

/  WARNING, EXEC MODE ONLY

/

/  BECAUSE OF DUMMY LOADS OF LOC'S 15 AND 175

/

FMTERR	PRINT	TTLUN,COMMAND,FORMAT,ERROR

	CAL	(10)

SCFNF	PRINT	TTLUN,SCH,FILE,NOT,FOUND

	CAL	(10)

SCRERR	PRINT	TTLUN,SCH,READ,ERROR

	JMP	SCDONE

SCFERR	PRINT	TTLUN,SCH,FORMAT,ERROR

	JMP	SCDONE

SCTERR	PRINT	TTLUN,INCORRECT,PARAMETER,TYPE

	JMP	SCDONE

BNRERR	SZA!CLL!CMA!IAC	/(002) SKIP ON NOT RUNNING

	JMP	BATER1	/(002) IT HAS AN ERROR

	PRINT	TTLUN,BATCH,NOT,RUNNING

	CAL	(10)
BATER1	LRSS	11	/(005) 3 CHARS TO MQ, 1 TO AC
	SNA		/(005) CHECK FOR LEADING 0
	LAW	-20	/(005) ELIMINATE IT
	ALS	4	/(005) SPACE OCTAL TO ASCII
	LLS	3	/(005)
	CLL!RAL		/(005) FINAL POSITIONING
	TAD	(30140	/(005) ASCII 60,60 FOR ZEROS
	DAC	CODADD	/(005) PLACE IN MESSAGE
	LLS	3	/(005) NEXT OCTAL TO AC
	ALS	4	/(005) SPACE IT OUT
	LLS	3	/(005) LAST OCTAL
	ALS	4	/(005)
	TAD	(301404	/(005) ASCII 60,60,40
	DAC	CODADD+1 /(005) REST OF STRING INSERTED
	DZM*	(BCV	/(003) BATCH NO LONGER WITH US
BATERR	PRINT	TTLUN,SCH,BATCH,SYSTEM,ERROR,0000

CODADD=BATERR+26

	CAL	(10

	.END
