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

/
/	MCR FUNCTION OPR
/
/ EDIT HISTORY:
/
/   1	30-JAN-74 (GARY COLE)
/
/   9	3-JUN-76 (SCR)		CHANGES FOR MULTIACCESS.
/
/ 011	22-JUL-76 (SCR)		UPDATE INTERFACE TO BATCH.
/
/ 012	29-JUL-76 (EAG)		ADD PRIORITY WORD TO CPB TO
/				REQUEST BATCH HANDLER (BUG
/				FIX).  ALSO MODIFY MEANING OF
/				LOCATION "JOBFND" IN BATCH
/				CONTROL VECTOR.
/
/ 013	28-JUL-76 (RCHM)	FIX A PROBLEM IN ROOT'S		/(013)
/				WAIT FOR BATCH TO LOAD LOOP.	/(013)
/ 014	4-AUG-76 (SCR)		DECIML RANGE;JOB DAY
/ 015	24-AUG-76 (SCR)		CANODE REFERNCE;ABORT BITS
/ 016	1-SEPT-76 (SCR)		FIX TLE EQUATE
/
/
/	THE USER'S INPUT IS ONE LINE CONSISTING OF:

/	'OPR' FOLLOWED BY A SPACE, FOLLOWED BY A

/	COMMAND FOLLOWED

/	IF NECESSARY BY AN ARGUMENT.

/	THE COMMAND IS IDENTIFIED BY THE FIRST 2 CHARACTERS

/	AND IS DELIMITED BY A SPACE(OR STRING OF SPACES)

/

/	WHEN THE COMMAND HAS BEEN PROCESSED, PREHAPS WITH ERROR
/	MESSAGES TO THE USER, OPR WILL EXIT.

/

	.EJECT

/DEFINE PRINT MACRO:

	.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 RAISE TO LEVEL 6 MACRO

/

	.DEFIN	.RTL6

	LAC	(400002

	ISA

	.ENDM

/
/
/DEFINE PARAMETERS

	.IFUND	TTYLUN

TTYLUN=3

	.ENDC

BCV=147	/LOCATION OF VECTOR TO BATCH CONTROL VECTOR

NADD=107	/ROUTINE TO ADD NODES TO LIST

IDX=ISZ

X10=10

X11=11

TTYS=205		/# OF TTYS IN SYSTEM

MA.CY=227		/CONTROL Y REGISTER
MCRRI=171		/CONTROL C REGISTER
ATL=244			/ACTIVE TASK LIST DEQUE
LUT=142		/LOGICAL UNIT TABLE ADDDR

.INH=705522

.ENB=705521

POOL=240	/POOL OF FREE NODES

NDEL=112	/REMOVE NODE FROM LIST

FAC=174		/FETCH A CHAR FOR MCR

R1=101

R2=102		/REENTRANT REGISTERS

MJOB1=323	/LOCATION OF HEADER FOR BATCH JOB QUEUE

TTLUN=TTYLUN

/
/  EQUATES WITHIN THE JOB NODE
/
JBID=5
JBFLGS=6
JBDATE=10
/
/  EQUATES WITHIN THE BATCH CONTROL VECTOR, CHANGED ON EDIT 010
/
OPON=3
TLEACT=32
PAUSW=37
TIMLIM=33
JOBERR=35
EXJOB=36
JOBFND=34
EQUATE=6	/POINT TO NODE DATA IN BCV
JE.ABRT=000004	/(015)ABORT BITS
JE.STP=400002	/STOP BITS
JE.KIL=1	/KILL BITS
/
	.EJECT

START	NOP	/ENTRY POINT 

	JMS	GETC	/GET FIRST CHAR
	JMP	SRPRO	/PRINT STATUS REPORT

	CLL!RTL; RTL; RTL; RAL	/SHIFT 7

	DAC	CMD

	JMS	GETC

	JMP	FMTERR	/FORMAT ERROR

	TAD	CMD		/ADD IN FIRST CHAR

	CLL!RTL; RTL		/SHIFT 4(HALF OF NEXT CHAR

	AAC	4	/ADD IN THE 

				/TOP HALD OF A SPACE

	DAC	CMD

 

SCANOF	JMS	GETC		/GOTO FIRST BLANK OR EOL

	JMP	DECODE

	SAD	(40)	/BLANK?

	JMP	DECODE

	JMP	SCANOF		/DELETES ALL BUT FIRST TWO CHAR IN CMD

	.EJECT

DECODE	LAC	CMD		/GET USER COMMAND(TWO CHAR)

	SAD	EXCMD

	JMP	EXPRO		/EXIT COMMAND

	SAD	PRCMD

	JMP	PRPRO		/PROCEED COMMAND

	SAD	GOCMD

	JMP	PRPRO		/GO AND PROCEED ARE THE SAME

	SAD	WACMD

	JMP	WAPRO		/WAIT COMMAND

	SAD	ONCMD

	JMP	ONPRO		/ON STATION COMMAND

	SAD	OFCMD

	JMP	OFPRO		/OFF STATION COMMAND

	SAD	SCCMD

	JMP	SCPRO		/SCHEDULE COMMAND

	SAD	KICMD
	JMP	KIPRO		/KILL COMMAND

	SAD	FOCMD

	JMP	FOPRO		/FORCE COMMAND

	SAD	JOCMD

	JMP	JOPRO		/JOBS COMMAND

	SAD	CACMD

	JMP	CAPRO		/CANCEL COMMAND

	SAD	STCMD

	JMP	STPRO		/STOP COMMAND

	SAD	BACMD		/BATCH STARTUP?

	JMP	BAPRO		/YUP

	SAD	HOCMD	

	JMP	HOPRO		/HOLD JOB COMMAND

	SAD	RECMD

	JMP	REPRO		/RELEASE JOB COMMAND

	SAD	MOCMD

	JMP	MOPRO		/MORE TIME ALLOWED COMAND
	SAD	TLCMD		/TLE ACTION COMMAND
	JMP	TLPRO

	SAD	ABCMD

	JMP	ABPRO		/ABORT TASK AND STOP JOB COMMAND

	PRINT	TTLUN,UNKNOWN,COMMAND

	JMP	DONE

	.EJECT

/

/CONSTANTS FOR COMMAND DECODER

/ONLY ONE WORD IS USED, HENCE THE OVERWRITE

/

EXCMD	.ASCII	/EX /

	.LOC	.-1

 

PRCMD	.ASCII	/PR /

	.LOC	.-1

GOCMD	.ASCII	/GO /

	.LOC	.-1

 

WACMD	.ASCII	/WA /

	.LOC	.-1

 

ONCMD	.ASCII	/ON /

	.LOC	.-1

 

OFCMD	.ASCII	/OF /

	.LOC	.-1

 

SCCMD	.ASCII	/SC /

	.LOC	.-1

 

KICMD	.ASCII	/KI /

	.LOC	.-1

 

FOCMD	.ASCII	/FO /

	.LOC	.-1

 

JOCMD	.ASCII	/JO  /

	.LOC	.-1

 

CACMD	.ASCII	/CA /

	.LOC	.-1

  

STCMD	.ASCII	/ST /

	.LOC	.-1

 

BACMD	.ASCII	/BA /

	.LOC	.-1

HOCMD	.ASCII	/HO /

	.LOC	.-1

RECMD	.ASCII	/RE /

	.LOC	.-1

MOCMD	.ASCII	/MO /

	.LOC	.-1

TLCMD	.ASCII	/TL /

	.LOC	.-1

ABCMD	.ASCII	/AB /

	.LOC	.-1

/

/	END OF COMMAND LIST

WAIT	20

	EV

EV	0

CMD	0	/HOLDS COMMAND NAME

/

/FETCH A CHAR SUBROUTINE, USES MONITOR SUBROUTINE FAC

GETC	0

	JMS*	(FAC	/(008) GRAB A CHAR

	SAD	(15)	/TEST FOR CR

	JMP*	GETC	/RTN TO CALL + 1 ON EOL

	SAD	(175)

	JMP*	GETC

	ISZ	GETC

	JMP*	GETC	/RTN WITH CHAR IN AC

/

/THE FAC SUBROUTINE EXTRACTS CHARACTERS FROM A 5/7 ASCII

/FROM THE MCR BUFFER

/ONCE END OF LINE IS REACHE, IT IS RETURNED INDEFINITELY

/

	.EJECT

DONE	JMS	GETC	/(008) SCAN TO TERMINATOR

	SKP		/(008) GOT ONE

	JMP	DONE	/(008) NOPE, KEEP GOING

	SAD	(15	/(008) CR

	JMP	REQMCR	/(008) YES, GO REQUEST MCR

	DZM*	(MCRRI	/(008) ALT, JUST CLEAR

	CAL	(10	/(008) AND EXIT

/

REQMCR	CAL	MCRIT	/(008) WAKE UP MCR

	CAL	(10	/(008)

MCRIT	1		/(008) CAL CODE

	0		/(008) NO EV

	.SIXBT	'...MCR'

	0		/(008)   ??

 

FMTERR	PRINT	TTLUN,FORMAT,ERROR

	JMP	DONE	/(008) ON MESSAGE , FOR CR EXIT!

ILLERR	PRINT	TTLUN,ILLEGAL,ARGUMENT

	JMP	DONE

/

/

/COMMAND PROCESSING SECTION

/

/

EXPRO	LAC*	(BCV)	/GET TO BCV

	SNA!SPA		/(004) - IS ERROR CODE

	JMP	BNRERR	/BATCH NOT RUNNING

	AAC	EXJOB	/(002)

	DAC	TEMP

	LAW	-1

	DAC*	TEMP

	JMP	DONE	/SET EXJOB TO -1 WILL CAUSE BATCH TO EXIT

			/AT THE END OF THE NEXT JOB
TEMP	0	/GENERAL TEMPORARY CELL
TEMP1	0	/AND ANOTHER

TEMP2	0	/AND ANOTHER

BNRERR	SZA!CLL!CMA!IAC	/(005) SKIP IF NOT ACTIVE

	JMP	BATERR	/(005) NEGATIVE, BATCH IN ERROR

	PRINT	TTLUN,BATCH,NOT,RUNNING

	JMP	DONE

/
BATERR	LRSS	11	/(010) TOP OF FOUR OCTAL DIGITS IN AC
	SNA		/(010) SKIPIF NON ZERO
	LAW	-20	/(010) CONVERT LEADING BLANK TO SPACE
	ALS	4	/(010) EXPAND 3 BITS TO 7 FOR ASCII
	LLS	3	/(010) NEXT OCTAL DIGIT
	CLL!RAL		/(010) BIT IN BOTTOM OF WORD PAIR
	TAD	(30140	/(010) ASCII 60,60 FOR ZERO'S
	DAC	ERRLOC	/(010) PUT IN MESSAGE
	LLS	3	/(011) LINK STILL MUST BE 0!
	ALS	4	/(010) SPACE IT OUT
	LLS	3	/(010) FINAL OCTAL DIGIT
	ALS	4	/(010) IN POSITION FOR FIRST 2 CHARS OF PAIR
	TAD	(301404	/(010) 60,60,40 ASCII
	DAC	ERRLOC+1 /(010)
	DZM*	(BCV	/(008)
ERRMSG	PRINT	TTLUN,OPR,BATCH,SYSTEM,ERROR,0000

ERRLOC=ERRMSG+26

	JMP	DONE

/

/	PROCEED COMMAND

PRPRO	LAC*	(BCV)

	SNA!SPA		/(004)

	JMP	BNRERR	/BATCH NOT RUNNING, EXIT

	AAC	EXJOB	/(002) POSITION IN VECTOR

	DAC	TEMP	/EXJOB FLAG

	CAL	RESBAT	/ATTEMP TO RESUME BATCH

	LAC	EV

	SPA		/(002) SKIP IF PAUSED

	DZM*	TEMP	/SET 0 TO GOTO NEXT JOB

	JMP	DONE

RESBAT	07

	EV
BATNM1	.SIXBT	/BAT/
BATNM2	.SIXBT	/CH@/

	0		/RESUME AFTER CURRENT PAUSE

/

/

/	MORE COMMAND

/		MORE IS USED TO ALLOW A JOB MORE TIME

/		BY CANCELING THE REQUEST FOR TLE... WHICH

/		JOB... HAS MADE. THIS NORMALLY WILL BE

/		USED WHEN A JOB HAS EXCEEDED ITS TIME ESTIMATE

/		BUT BEFORE IT EXCEEDS ITS TIME LIMIT.

/

 
MOPRO	LAC*	(BCV)	/IS BATCH RUNNING?
	SNA!SPA		/(004)

	JMP	BNRERR	/NO

	AAC	TIMLIM	/(003) MAKE POINTER TO TIME WORD

	DAC	TEMP	/(003)

MOPRO1	JMS	GETC	/(002) CHECK FOR ARGUMENT

	JMP	MOPRO2	/(002), NONE, DOUBLE TIME

	SAD	(40	/(002) SCAN THRU BLANKS

	JMP	MOPRO1	/(002) KEEP FETCHING
	JMS	DECIML	/(003) RETURNING INCREASE IN AC
	MUL		/(011) MIN. TO SEC.
	74
	SNA!CLA!CMA!CLL	/(011) OVERFLOW IF AC NONZERO
	LACQ
	SNA!CLL!CMA!IAC	/(010) MAKE NEGATIVE (TIMLIM STORED AS -)

	JMP	ILLERR	/(003) ARGUMENT ERROR

	TAD*	TEMP	/(003) ADDING IN PRESENT VALUE
MOPRO3	SNL		/(010) SKIP IF NO OVERFLOW
	CLA		/(010) OVERFLOW; 0 RUNS FOREVER
	DAC*	TEMP	/(003) NEW VALUE

	JMP	DONE	/(003) THAT'S IT

/

MOPRO2	LAC*	TEMP	/(003) IF NO ARG, DOUBLE TIME

	CLL!RAL		/(003)

	JMP	MOPRO3	/(003) FINISH UP WITH OTHER SIDE

	.EJECT

/

/

/	WAIT COMMAND

WAPRO	LAC*	(BCV)

	SNA!SPA		/(004)

	JMP	BNRERR	/BATCH NOT RUNNING , EXIT

	AAC	EXJOB	/(003) SYMBOLIC

	DAC	TEMP	/EXJOB FLAG

	CLA!IAC

	DAC*	TEMP	/SET EXJOB TO 1 TO HOLD BETWEEN JOBS

	JMP	DONE

/

/

/	ON STATION COMMAND

ONPRO	LAC*	(BCV)

	SNA!SPA

	JMP	BNRERR

	AAC	OPON	/(003) SYMBOLIC

	DAC	TEMP	/OPON FLAG IN BATCH

	CLA!IAC

	DAC*	TEMP	/SET OT SAY OPERATOR READY

	JMP	DONE

/

/

/	OFF STATION COMMAND

OFPRO	LAC*	(BCV)

	SNA!SPA

	JMP	BNRERR

	AAC	OPON	/(003)

	DAC	TEMP	/OPON FLAG

	DZM*	TEMP	/SET TO SAY OPERATOR NOT HERE

	JMP	DONE

/

/
/	KILL COMMAND - CAUSES CURRENT JOB TO SCAN TO $ERR
/			SUBSEQUENT JOBSIN SAME FILE NOT RUN
/
/	KILL AND STOP REDEFINED ON EDIT #010
/
KIPRO	LAC*	(BCV
	SNA!SPA
	JMP	BNRERR
	AAC	JOBERR	/POINTER TO ERROR BITS WORD
	DAC	TEMP
	AAC	JOBFND-JOBERR /AND TO STATE WORD
	DAC	TEMP1
	LAC	(-1\JE.KIL	/SET KILL BITS
	.INH
	AND*	TEMP	/CLEAR BITS
	XOR	(JE.KIL	/FORCE ALL TO SET
	DAC*	TEMP
	LAC*	TEMP1	/FORCE STATE 2 TO STATE 3
	SAD	(2
	ISZ*	TEMP1
	.ENB		/SYSTEM BACK IN

	JMP	DONE
/
/	STOP IS LIKE KILL EXCEPT NO SCAN TO $ERR
/
STPRO	LAC*	(BCV)
	SNA!SPA
	JMP	BNRERR
	AAC	JOBERR	/(008) POINT TO JOB ERROR WORD
	DAC	TEMP
	.INH
	LAC*	TEMP	/(008) DATA WORD
	AND	(-1\JE.STP /(008) FORCE OFF THE STOP BIT
	TAD	(JE.STP	/(008) MAKE SURE IT'S ON
	.ENB
	DAC*	TEMP	/(008) REPLACE DATA
	JMP	DONE	/(008) THAT'S IT
	.EJECT

/

/

/

/

/	PROCESS THE STARTUP BATCH COMMAND

/
BAPRO	LAC*	(BCV	/(008)
	SZA		/(008) SHOLD ALREADY BE OFF
	JMP	BPRERR	/(008) NOPE, ERROR
	CAL	FIX	/(009) TRY TO FIX BATCH
	LAC	EV	/(009) WHAT HAPPENED?
	SAD	(-207	/(009) ALREADY FIXED??
	JMP	SCNATL	/(010) ALREADY FIXED IS OK, I GUESS
	SAD	(-202	/(009) ALREADY ACTIVE

	JMP	BATACT	/((009) ERROR

	SPA		/(009) SKIP IF OK

	JMP	BATAVA	/(009) NOT AVAILABLE ???

/

SCNATL	.INH		/(009) SCAN FOR FIX TO CLEAR ATL

FIX0	LAC*	(ATL	/(009) ADDR OF FIRST NODE
FIX1	DAC	TEMP	/(009) SAVE

	SAD	(ATL	/(009) DONE

	JMP	REQTSK	/(009) YES, SO REQUEST

	IAC		/)009) NODE +1

	DAC*	(X10	/(009) TO FETCH NODE+2

	LAC*	X10	/(009) TO MATCH ON NAME
	SAD	BATNM1	/(009) FIRST HALF OF BATCH NAME
	SKP		/(009) YUP, CHECK SECOND HALF
	JMP	FIX2	/ NO, GO TO NEXT ELEMENT IN THE ATL.	/(013)
	LAC*	X10	/(009) PART 2

	SAD	BATNM2	/(009)

	JMP	FIXWAT	/(009) STILL THERE, WAIT AGAIN

FIX2	LAC*	TEMP	/(009) NEXT NODE

	.ENB		/(009) SYSTEM IN, ONCE PER CYCLE

	DAC	TEMP2	/(009) SAVE CONTENTS

/

/  SYSTEM CAN COME IN HERE, IF ANYONE IMPORTANT IS WAITING

/

	.INH		/(009) NOW WE GRAB SYSTEM AGAIN

	LAC*	TEMP	/(009) DID NODES IN QUESTION MOVE??

	SAD	TEMP2	/(009)

	JMP	FIX1	/(009) NO, KEEP GOING

	JMP	FIX0	/(009) YES, START SCAN OVER AGAIN

/

FIXWAT	.ENB		/(009) SYSTEM BACK IN WHILE WE WAIT

	CAL	(5	/(009) WAIT FOR ANY SIGN EVENT
	JMP	SCNATL	/(009) AND TRY LIST AGAIN

/

REQTSK	.ENB		/(009) CAN WORK AT REGULAR LEVEL

	CAL	REQBAT	/(009) REQUEST BATCH

	CAL	UNFIX	/(009) AND UNFIX IT

	JMP	DONE	/(009) WHEW, DONE

/

/
FIX	15		/(009) FIX BATCH TO SEE IF IT HAS THE CORE

	EV

	.SIXBT	'BATCH@'

/

UNFIX	16		/(009) UNFIX BATCH

	0

	.SIXBT	'BATCH@'

/
REQBAT	1

	0
	.SIXBT	'BATCH@'
	0

/
//

BPRERR	SPA!CLL!CMA!IAC	/(008) MAKE - TO PLUS

	JMP	BATERR	/(008) BATCH IN ERROR

BATACT	PRINT	TTLUN,BATCH,ALREADY,ACTIVE

	JMP	DONE	/(008)

BATAVA	PRINT	TTLUN,BATCH,RESOURCE,FAILURE

	JMP	DONE

/
/
/
/
	.EJECT

/
/	TLE COMMAND

/		USED TO SET THE ACTION TO BE TAKEN WHEN TIME

/		LIMIT EXCEEDED OCCURS.

/
/	OPR>TLE XXXX
/		   XXXX=ABORT,STOP,KILL,REPORT,IGNORE
/
/	EDIT (010) MAKE FIVE STATES , NOT THREE
/
/	ONLY THE FIRST CHAR INS USED IN THE SCAN

/
/	FORMAT ERROR IF NO ARG GIVEN

/	ILLERR IF NOT A,S,OR R

/

 
TLPRO	LAC*	(BCV	/(003 THRU .EJECT)
	SNA!SPA
	JMP	BNRERR
	AAC	TLEACT	/(016) WRONG EQUATE, TLEACT NOT TIMLIM

	DAC	TEMP

TLPRO1	JMS	GETC	/FETCH NEXT CHAR

	JMP	FMTERR	/END OF LINE FORMAT ERR

	SAD	(40	/SCAN OVER BLANKS

	JMP	TLPRO1
	SAD	(101	/'A' COMMAND START WITH A
	LAW	-1	/CODE (MINUS) FOR VECTOR
	SAD	(123	/(010) 'S'
	LAW	-2
	SAD	(113	/(010) 'K' FOR KILL
	LAW	-3
	SAD	(122	/'R'
	LAW	-4	/ITS CODE
	SAD	(111	/(010)'I' FOR IGNORE
	LAW	-5
	SMA!CMA!IAC	/SKIP IF FOUND, MAKE CODE +
	JMP	ILLERR	/ARGUMENT ERROR
	DAC*	TEMP	/PLACE CODE TO VECTOR
	JMP	DONE	/THRU, ALSO FINISH (003)

	.EJECT

/

/

/	SCHEDULE COMMAND

/		THIS COMMAND INVOKES THE SCHOPR

/		TASK TO SET A NEW SCHEDULE INTO THE SYSTEM

/		IT IS OTHERWISE IDENTICAL TO THE QUEUE FUNCTION

/

/	OPR>SCH

/

/

 

SCPRO	CAL	REQSCH	/

	LAC	EV

	SMA

	JMP	DONE

	PRINT	TTLUN,TASK,NOT,AVAILABLE

	JMP	DONE

/

REQSCH	1

	EV

	.SIXBT	/SC.OPR/

	0

	.EJECT

/

/

/	ABORT COMMAND

/

/	SETS A BIT IN BCV, SETS EV IN BCV

/	GENERATES A SIGNIFICANT EVENT TO WAKE BATCH

/
ABPRO	LAC*	(BCV	/(006) BATCH ALIVE

	SNA!SPA		/(006)

	JMP	BNRERR	/(006) NOPE

	AAC	JOBERR	/(008) POINT TO ERROR BITS
	DAC	TEMP	/(006)
	AAC	JOBFND-JOBERR	/(010) NEW POINTER
	DAC	TEMP1		/(010)
	LAC*	(TTYS	/(008) BATCH IS THE NTH TTY

/			/(008) WHERE 0 TO N-1 ARE LEGAL TTYS

	TAD	(LRS 0	/(008) MAKE SHIFT INSTRUCTION

	DAC	ABPRXX	/(008) MAKE CORRECT BIT SHORTLY

	CLA!CLL!CML	/(008) SET UP

	RAR		/(008) TO MAKE LINK 0, AC 400000

ABPRXX	XX		/(008) MAKE CORRECT BIT SETTTING

	LMQ		/(008) SAVE BIT SETTING
	.INH		/(008) BOTH MUST BE SET
	LAW	-2	/(010) CHECK FOR STATES 2 AND ABOVE
	TAD*	TEMP1	/(010) 
	SNA		/(015)
	ISZ*	TEMP1	/(015)
	SPA		/(010) SKIP IF >=2 ORIGINALLY
	JMP	ABFOO	/(010) NOPE, MISS NEXT
	LAC*	(MA.CY	/(008) CONTROL Y BIT FIRST
	OMQ		/(008) SET FROM SAVED SETTING
	DAC*	(MA.CY	/(008)
ABFOO	LAC*	TEMP	/(008) AND BTCH ABORT BIT
	AND	(-1\JE.ABRT /(008) CLEAR ABORT BIT
	TAD	(JE.ABRT	/(008) AND SET IT

	.ENB		/(008) SYSTEM BACK IN AFTER 1 INSTRUC

	DAC*	TEMP	/(008) WHEW, DONE

	JMP	DONE

	.EJECT

/

/JOBS COMMAND: PRINTOUT OF THE WAITING JOB LIST

/

/THE FORMAT OF THE PRINTOUT IS:

/  XXXXXX(DD)  NNNNN [OPR] [SEQ] [SPN]

/

/    XXXXXX IS THE JOB "NUMBER" FOR CANCEL OR FORCE

/	DD IS THE DATE, OPTIONAL JOB # SPECIFIER

/    NNNNNN IS THE JOB NAME

/    OPR,SEQ SPN ARE OPTIONAL AND INDICATE THOSE CHARACTERISTICS.

/

/

JOPRO	LAC*	(BCV)	/GET TO BCV

	DZM	TEMP	/TEMP IS A SWITCH ALSO

	SNA

	JMP	JOSCN

	AAC	EXJOB	/(003) EXJOB WORD IN THE VECTOR

	DAC	TEMP

	AAC	EQUATE-EXJOB /(005) POINT TO 'NODE' OF RUNNING JOB

	DAC	JOBND	/(005)PRINT OUT JUST LIKE A WAITING JOB

	LAC*	TEMP

	DAC	SAVEXJ	/SAVE CURRENT VALUE

	CLA!IAC

	DAC*	TEMP	/SET TO 1 -- WAITING

	PRINT	TTLUN,RUNNING JOB

	.RTL6		/(008) PRINTJ ENTERED AT 6

	JMS	PRINTJ	/(005) PRINT OUT THE RUNNING JOB

/

/

JOSCN	.RTL6		/(005) PREVENTRACE

JOSCN2	LAC*	(MJOB1+1)

	SAD	(MJOB1)	/TEST FOR EMPTY LIST

	JMP	JONONE	/TRUE!!

	DAC	JOBT2	/(005) SET TO ENTER LOOP

	LAC	(MJOB1+1 /(005)

	DAC	JOBND	/(005)

	JMP	JOLOE	/(005) JOIN BACKWARDS SCAN LOOP

/

JOLOOP	.RTL6		/(005) PREVENT BREAKIN NOW

	IDX	JOBND	/(005) TO THE BACKWARDS POINTER

JOLOE	LAC*	JOBND	/(005) NEXT NODE

	SAD	(MJOB1	/(005) DONE

	JMP	JOELO	/(005) END OF LOOP

	SAD	JOBT2	/(005) Q DISTURBED IN OUR ABSENCE?

	SKP		/(005) NO

	JMP	JOSCN2	/(005) YES, START OVER

	DAC	JOBND	/(005) THE 'PRESENT' NODE

	IDX	JOBT2	/(005) FIND THE NEXT NODE

	LAC*	JOBT2	/(005)

	DAC	JOBT2	/(005) SAVE FOR COMPARE NEXT TIME

	JMS	PRINTJ	/(005) OUTPUT JOB DATA

	LAC*	(MCRRI	/(008) CONTROL C QUIT

	SPA		/(008) SKIP IF NOT

	JMP	CNTLC	/(008) YES, STOP

	JMP	JOLOOP	/(005) NEXT NODE

JONONE	DBK		/(005) MAINSTREAM

	PRINT	TTLUN,NONE,WAITING

JODONE	LAC	TEMP	/CHECK SWITCH

	SNA

	JMP	DONE

	LAC	SAVEXJ	/RESET EXJOB IF INIT SET

	DAC*	TEMP

	JMP	DONE	/COMMAND PROCESSING FINISHED

JOELO	DBK		/(006) END OF LOOP

	JMP	JODONE	/(006)

/

CNTLC	PRINT	TTLUN,^C,EXIT

	JMP	DONE

	.EJECT

/PRINTJ THE SUBROUTINE THAT PRINTS OUT THE JOB DATA!!

/ALL THIS IS JUST EDITING OUT THE OUTPUT LINE

/LINE FORMAT IS IN IMAGE MODE FOR SIMPLICITY AND SPEED

/ROUTINE ENTERED AT LEVEL 6
PRINTJ	0

	LAC	JOBND	/ADDRESS OF JOB NODE

	DAC*	(10)	/INTO AUTOINDEX

	AND*	10	/SKIP BACK LINK

	LAC*	10

	DAC	JOBFL1	/GET FILE NAME

	LAC*	10

	DAC	JOBFL2
	AND*	10	/SKIP SECONDARY NODE POINTER

	LAC*	10	/(004)GET JOBID

	DAC	JOBIDN

	LAC*	10

	DAC	JINFO

	LAC*	10

	DAC	SP1

	LAC*	10	/(004) GET DAY

	AND	(37	/(004)

	DAC	DAY	/(004)

	LAC*	10

	DAC	JOTIME	/TIME WHEN QUEUED

	DBK		/(008) BACK TO MAINSTREAM, WE HAVE DATA

	JMP	PUTNUM

JOBFL1	0

JOBFL2	0

JOTIME	0

JOBIDN	0		/(004)

DAY	0		/(004)

JINFO	0

SP1	0

JOBND	0

SAVEXJ	0

JOBT2	0		/(006) TEMPORARY

	.EJECT
PUTNUM	LAC	(OUTBF+1)

	DAC*	(10)	/AUTO 10 IS POINTER TO OUTPUT LINE

			/USED EVERYWHERE..

/

/DEFINE LOCAL MACRO  PUTC

	.DEFIN	PUTC,ZA

	LAC	(ZA)

	DAC*	10

	.ENDM

//

//

	PUTC	40
	LAC	JOBIDN	/(004) PRINT OUT IDENTIFIER #
	JMS	CONVTD	/(004)
	PUTC	50	/(004)  (DATE)
	LAC	DAY	/(014) DAY OF MONTH INSIDE PARENS
	JMS	CONVTD	/(004)
	PUTC	51	/(004)

	.EJECT

	PUTC	40

	PUTC	40	/PUT OUT SPACES BEFORE OPTIONS

/

/OUTPUT TIME,CLASS,AND MEMORY SPECIFICATIONS

/FORMAT IS T=XXX C=X M=XX  ARGUMENT NOT PRINTED

/			IF VALUE IS ZERO.

 

JOPT	LAC	JINFO	/GET TIME ESTIMATE

	AND	(177)

	SNA

	JMP	JOPC	/NOT NON-ZERO SO DONT PRINT IT

	PUTC	124	/T

	PUTC	75	/=

	LAC	JINFO	/GET TL AGAIN

	AND	(1777)

	JMS	CONVTD	/CONVERT TO DECIMAL AND SUPRESS LEADING DIGITS

	PUTC	40	/SPACE

 

JOPC	LAC	SP1	/EXTRACT JOB CLASS FORM TOP 3 BITS OF SP1

	CLL!RTL; RTL

	AND	(7)	/ONE DIGIT

	LMQ		/SAVE CLASS IN MQ

	SNA

	JMP	JOPM	/CLASS IS ZERO, TRY MEMORY SIZE

	PUTC	103

	PUTC	75	/OUTPUT C=

	LACQ

	JMS	CONVTD	/CONVERT DIGIT TO DECIMAL AND OUTPUT

	PUTC	40	/SPACE

 

JOPM	LAC	SP1	/EXTRACT MEMORY SIZE

	AND	(177)

	LMQ		/SAVE IN MQ

	SNA

	JMP	JOP0	/NO NEED FOR M PRINTOUT

	PUTC	115

	PUTC	75	/M=

	LACQ

	IAC	/ADD ONE TO GET CORRECT SIZE

	JMS	CONVTD

	PUTC	40

 

 

JOP0	LAC	JINFO

	AND	(200000)

	SNA

	JMP	JOP1

 

	PUTC	117	/PUT OUT "OPR"

	PUTC	120

	PUTC	122

	PUTC	40

 

JOP1	LAC	JINFO

	AND	(40000)

	SNA

	JMP	JOP2

 

	PUTC	123	/PUT OUT "SEQ"

	PUTC	105

	PUTC	121

	PUTC	40

 

JOP2	LAC	JINFO

	AND	(20000)

	SNA

	JMP	JOP3

 

	PUTC	123	/PUT OUT "SPN"

	PUTC	120

	PUTC	116 

	PUTC	40

JOP3	LAC	JINFO	/TEST FOR HOLDING BIT

	AND	(10000)

	SNA

	JMP	JOP4

	PUTC	110

	PUTC	117

	PUTC	114

	PUTC	104

	PUTC	40

JOP4	LAC	JINFO	/TEST FOR CCL FORMAT JOB

	AND	(4000)

	SNA

	JMP	JOP5

	PUTC	103

	PUTC	103

	PUTC	114

	PUTC	40

JOP5	PUTC	15	/PUT OUT LF CHAR

	PUTC	12	/PUT OUT CR

	PUTC	0	/PUTOUT ANOTHER  CHAR SO ROUNDDOWN WORKS

	LAC	(OUTBF)

	TCA

	TAD*	(10)	/COMPUTE WORD TO PRINT

	IAC

	RAR!CLL		/DIVIDE BY 2

	SWHA

	AAC	3

	DAC	OUTBF	/HEADER WORD

 

	CAL	WRIJOB

	CAL	WAIT

	JMP*	PRINTJ 

WRIJOB	2700

	EV

	TTLUN

	3

	OUTBF

OUTBF	120003

	0

	.BLOCK	116

REMDR	0

GDIG	0	/EXTRACT DIGIT FROM MQ

	CLA!CLL

	LLS	3

	TAD	(60)

	DAC*	10

	JMP*	GDIG

 

GCHR	0

	CLA!CLL		/EXTRACT SIXTBT CHAR AND OUT ASCII CHAR

	LLS	6

	SNA

	AAC	40	/MAKE NULLS TO SPACES

	AAC	-40

	SPA

	AAC	100	/IF CHAR 0-37

	AAC	40	/ALWAYS

	DAC*	10

	JMP*	GCHR

	.EJECT

/

/

/	FORCE COMMAND

/		THIS IS USED TO SET THE "OPERATOR PRIORITY"

/		INDICATOR FOR THE JOB, FORCING BATCH TO RUN IT

/		NEXT(IF OTHER CONDITIONS PERMIT)

/

/

/	FORM OF COMMAND IS:

/

/	OPR>FORCE  XXXXXX [DD]

/

/			XXXXXX IS THE JOB NUMBER LISTED BY THE

/					JOBS COMMAND.

/			AND DD IS THE DATE OF SUBMISSION, TO BREAK TIES.

/

/

FOPRO	JMS	CASUB	/(004) USE CANCELL SUBROUTINE (NEVER RETURN)

	AAC	JBFLGS	/(004) XCT FROM CASUB, RELATIVE ADDR OF WORD

	AND	(677777	/(004) XCT FROM CASUB, MASK BITS

	TAD	(100000	/(004) XCT FROM CASUB, DATA BITS

	.EJECT

/

/

/	HOLD COMMAND

/		THIS IS USED TO KEEP A JOB FROM RUNNING

/		EVEN IF OTHER CONDITIONS ARE FAVORABLE

/		IT DOES THIS BY SETTING THE HOLD BIT IN THE NODE

/

/

/	THE FORMAT OF THE HOLD COMMAND IS:

/

/	OPR>HOLD XXXXXX [DD]

/

/			HERE XXXXXX IS THE JOB IDENT FROM THE JOBS

/				PRINTOUT

/			AND DD IS THE DATE TO BREAK TIES

HOPRO	JMS	CASUB	/(004) NEVER RETURN; CANCELL ROUTINE

	AAC	JBFLGS	/(004) RELATIVE WORD ADDR IN NODE

	AND	(667777	/(004) XCT FROM CASUB; MASK

	TAD	(10000	/(004) XCT FROM CASUB; DATA BITS

	.EJECT

/

/

/	RELEASE COMMAND

/		THIS COMMAND IS USED TO CONTERACT THE AFFECT OF

/		A HOLD COMMAND FOR A JOB.

/

/

/	THE FORMAT OF A RELEASE COMMAND IS:

/

/	OPR>RELEASE XXXXXX [DD]

/

/		HERE XXXXXX IS THE JOB IDENT FROM THE JOBS PRINTOUT

/		AND DD IS THE DATE TO BREAK TIES

/

REPRO	JMS	CASUB	/(004) CALCELL SUB; NEVER RETURN

	AAC	JBFLGS	/(004) XCT FROM CASUB; RELATIVE WORD POSITION

	AND	(767777	/(004) XCT FROM CASUB; MASK

	NOP		/(004) XCT FROM CASUB; DATA BITS

	.EJECT

/

/

/	CANCEL COMMAND

/

/	THE CANCEL COMMAND ALLOWS THE OPR TO ELIMINATE ONE

/		OR ALL OF THE QUEUED JOBS FROM THE JOB LIST

/

/	THE FORMAT IS 

/

/	OPR>CANCEL XXXXXX [DD]

/

/	OR

/

/	OPR>CANCEL ALL

/

/	XXXXXX IS THE JOB NUMBER PRINTED BY THE JOBS COMMAND.

/	AND DD IS THE DATE TO BREAK TIES

/

/

/

	.EJECT

CAPRO	JMS	CASUB	/(004) NEVER RETURN, COMMON SUB

	AAC	JBID	/(004) XCT FROM CASUB; OFFSET WITHIN NODE

	CLA		/(004) XCT FROM CASUB; MASK

	NOP		/(004) XCT FROM CASUB ; DATA

/
/  SUBROUTINE ACTION
/
/  CALLED FROM CASUB AT LEVEL 6 TO SET AND CLEAR BITS

/

ACTION	0

	LAW	-1	/SET UP X11 TO XCT*

	TAD	CASUB	/POINTER TO THREE LOC'S TO XCT

	DAC*	(X11

	LAC	CANODE	/ADDR OF NODE

	XCT*	X11	/ADDING IN OFFSET OF WORD TO SET

	DAC	ACTMP	/TEMPORARY

	LAC*	ACTMP	/FETCH DATA WORD

	XCT*	X11	/CLEAR BITS

	XCT*	X11	/SET BITS

	DAC*	ACTMP	/PLACE WORD

	JMP*	ACTION

/

ACTMP	0

/

/  SUBROUTINE CASUB

/

/  SCAN INPUT LINE FOR ALL, OR JOBID, OR JOBID DATE

/  AND TAKE ACTION ON QUEUE

/

CASUB	0

	LAW	-1	/DEFAULT SETTING CAVAL, CAVAL1

	DAC	CAVAL	/FOR ALL, AND NO SECOND SPECIFIER

	DAC	CAVAL1

CASUB2	JMS	GETC

	JMP	FMTERR	/MUST GET TO AN ARGUMENT

	SAD	(40)

	JMP	CASUB2	/LOOP THRU SPACES

	SAD	(101)	/LOOK FOR LAETTER A

	SKP

	JMP	CANUM	/IF NOT AND A, ASSUME A NUMBER

	LAC	CASUB	/(004)

	SAD	(FOPRO+1 /(004) FORCE COMMAND

	JMP	ILLERR	/YES!!

	JMS	GETC	/GET NEXT

	JMP	ILLERR	/MUST BE EXACTLY "ALL"

	SAD	(114)

	SKP

	JMP	ILLERR

	JMS	GETC

	JMP	ILLERR	/TEST FOR SECOND L

	SAD	(114)

	SKP

	JMP	ILLERR

			/SUCESS, THIS IS A CANCEL ALL COMMAND

	JMP	CAXCT	/PROCESS COMMAND

	.EJECT

CANUM	JMS	DECIML	/(004) MAKE UP DECIMAL INPUT

	SNA!SPA		/(005) MUST BE + AND >0

	JMP	ILLERR	/(005) ARGUMENT ERROR

	DAC	CAVAL	/(004) JOB #

	JMS	GETC	/(004) MORE CHAR'S?

	JMP	CAXCT	/(004) END OF LINE

	JMS	DECIML	/(004) GRAB DATE

	DAC	CAVAL1	/(004) INTO SECOND SPECIFIER

	AAC	-40	/(004) RANGE 1-31 DECIMAL LEGAL

	TAD	(37	/(004) SETTING LINK IF LEGAL

	SNL!CLL		/(004) OK?

	JMP	ILLERR	/(004) NO, ARGUMENT ERROR

	JMP	CAXCT	/(004) GO SCAN

/

/LOCAL VARIABLES TO CANCEL

CATEMP	0

CAVAL	0	/HOLDS JOB NUMBER

CAVAL1	0	/(004) HOLDS DATE, OPTIONAL SPECIFIER

CANODE	0	/HOLDS NODE ADDRESS

CAXT1	0		/(006) TEMPORARIES

CAXT2	0		/(006)

CAFLAG	0		/(006)

	.EJECT

CAXCT	.RTL6		/(005) TO LEVEL 6 SO NO INTERFERENCE

	LAC*	(MJOB1+1 /(005) SCAN IN ORDER OF INCREASING 'TIME'

CAXL0	SAD	(MJOB1	/(005) END OF LIST

	JMP	CANOFN	/(005) YES, FINISHED

CAXL	DAC	CANODE	/(005) PRESENT NODE

	AAC	JBID	/(005) POINTER TO ID

	DAC	CAXT1	/(005) HOLD

	AAC	JBDATE-JBID /(005) POINTER TO DATE

	DAC	CAXT2

	LAC	CAVAL	/(005) COMPARE WORD

	SAD	(-1	/(005) ARE WE AN 'ALL'

	JMP	CAX3	/(005) YES

	SAD*	CAXT1	/(005) JOB ID'S MATCH

	JMP	CAF1	/(005) YES, FURTHER CHECKING

CAX2	IDX	CANODE	/(005) BACKWARD POINTER FOR NEXT NODE

	LAC*	CANODE	/(005) COONTENTS

	JMP	CAXL0	/(005) GO CHECK OUT END

/

CAX3	JMS	ACTION	/(005) SET BITS

	JMP	CAX2	/(005) NEXT NODE

/
CAF1	LAC	CAVAL1	/(005) GOT ID MATCH, HOW ABOUT DATE
	SAD	(-1	/(005) -1 SAYS NOT SUPPLIED
	JMP	CAF2	/(014) NO DATE; CHECK MULTIPLE JOBS SAME #
	XOR*	CAXT2	/(005) XOR IN DATE FROM NODE

	AND	(37	/(005) ONLY INTEREST IN DAY

	SZA		/(005) SKIP IF NATCH

	JMP	CAX2	/(005) DATE MISSED, KEEP SCANNING

CDOUT	JMS	ACTION	/(005) BOTH HIT, SET BITS

CDONE	DBK		/(005) BACK TO MAINSTREAM

	JMP	DONE	/(005) DONE!

/

CAF2	LAC	CAFLAG	/(005)ALREADY HAVE THIS ID?

	SZA		/(005)SKIP IF NOT

	JMP	CAMBIG	/(005) YES, PRINT AMBIGUOUS MESSAGE

	LAC	CANODE	/(005) NO, BUT WE DO NOW

	DAC	CAFLAG	/(005)

	JMP	CAX2	/(005) KEEP CHECKING FOR DUPLICATE

/
CANOFN	LAW	-1	/(005) CHECK WHO FOUND WHAT
	SAD	CAVAL	/(005) WAS IT AN ALL
	JMP	CDONE	/(005) NO PROBLEM

	SAD	CAVAL1	/(005) DATE PROVIDED

	JMP	CANOF2	/(005)NO, FURTHER CHECKING
CAMISS	DBK		/(005) MAINSTREAM
	PRINT	TTLUN,NOT,QUEUED

	JMP	DONE

/
CANOF2	LAC	CAFLAG	/(005) ANY FOUND
	SNA		/(005) SKIP IF YES
	JMP	CAMISS	/(005) NOPE
	DAC	CANODE	/(015) UPDATE NODE POINTER
	JMP	CDOUT	/(005) YES, GO DO IT

/

CAMBIG	DBK		/(006) TWO THERE, PRUINT MESSAGE

	PRINT	TTLUN,TWO,JOBS,SAME,NUMBER

	JMP	DONE

	.EJECT

/
/	STATUS REPORT 
/	INITIATED BY A EMPTY LINE TO OPR
/
/	PRINTS OUT THE STATUS OF THE BATCH SYSTEM
/
/	OUTPUT FORMAT IS A CODE PAIR FOLLOWD BY THE NUMBER OF
/	JOBS QUEUED
/
/	CODES ARE:	FIRST CODE - SLASH - SECOND CODE
/	RUN			RUN
/	PAUSE			WAIT
/	IDLE			EXIT
/
/
/	JOBS QUEUED COUNT IS IN DECIMAL WITH LEADING ZEROS

/	SUPRESSED.

/
/
/	OPR>
/	RUN/RUN  24 QUEUED

/

/

	.EJECT
SRPRO	LAC*	(BCV)
	SNA!SPA		/(004)
	JMP	BNRERR	/IF BATCH INACTIVE
	AAC	EXJOB	/(003)
	DAC	TEMP	/GOTO EXJOB
	AAC	JOBFND-EXJOB /(010) TO JOBFND
	DAC	TEMP1
	AAC	PAUSW-JOBFND	/(010) TO PAUSW
	DAC	TEMP2
	DZM	SRCNT
/
/	COUNT THE NODES IN THE BATCH JOB QUEUE
/
	.RTL6		/(010) KEEP BATCH FROM INTERFERING
	LAC*	(MJOB1)
SRLOOP	SAD	(MJOB1)	/TEST FOR END
	JMP	SRDON

	ISZ	SRCNT	/COUNT

	DAC	SRTMP

	LAC*	SRTMP
	JMP	SRLOOP	/CYCLE TILL END
SRDON	DBK		/(010) BACK TO MAINSTREAM
	LAC	(OUTBF+1)	/SETUP PRINT BUFFER
	DAC*	(10)	/USES SAME TECHNIQUE AS JOBS ROUTINE
	PUTC	40
	.EJECT
	LAC*	TEMP1	/(010) CHECK FOR IDLE
	SNA		/(010) SKIP IF NOT IDLE
	JMP	SR.IDL	/(010) IDLE FOR FIRST HALF STATUS
	LAC*	TEMP2	/(010) CHECK FOR PAUSED
	SZA		/(010)SKIP IF NOT PAUSED
	JMP	SR.PAU	/(010) PAUSED
/
/  MUST BE RUNNING
/
	PUTC	122	/(010)   R
	PUTC	125	/(010)   U
	PUTC	116	/(010)   N
SLASH	PUTC	57	/(010)   /   JOIN TO DO SECOND HALF
	LAC*	TEMP	/(010)
	SNA		/(010)
	JMP	SRRUN	/(010)   GO DO RUN FOR SECOND HALF
	SMA		/(010)
	JMP	SRWAIT	/(010)   ;GO DO WAIT FOR SECOND HALF
	PUTC	105	/(010) EXIT
	PUTC	130
	PUTC	111
	PUTC	124
	JMP	SRNUM	/(010)
/
SRRUN	PUTC	122	/(011) RUN FOR SECOND HALF
	PUTC	125
	PUTC	116
	JMP	SRNUM
SR.PAU	PUTC	120
	PUTC	101
	PUTC	125
	PUTC	123
	PUTC	105
	JMP	SLASH	/(010) PAUSE AND GO DO / AND SECOND HALF
	.EJECT
SR.IDL	PUTC	111

	PUTC	104

	PUTC	114

	PUTC	105
	JMP	SLASH
SRWAIT	PUTC	127

	PUTC	101

	PUTC	111

	PUTC	124
	JMP	SRNUM
	.EJECT
SRNUM	PUTC	40

	PUTC	40

/

/CONVERT COUNT TO DECIMAL AND OUTPUT SUPRESSING LEADING ZEROS

/

	LAC	SRCNT

	SNA	/TEST FOR 0

	JMP	SRNDON	/PRINT OUT "NONE QUEUED"

	JMS	CONVTD	/ELSE OUTPUT THE NUMBER QUEUED

	JMP	SRNQ	/PRINT OUT "QUEUED"

/

/

/CONVTD SUBROUTINE, CONVERTS NUMBER TO DECIMAL AND SUPRESSES

/	LEADING ZEROS. DIGITS ARE DEPOSITED THROUGH AUTO 10.

/	ROUTINE COURTESY OF EAG, EDIT 004

/

CONVTD	0

	LMQ		/SAVE ORIGINAL NUMBER

	LAW	-5	/ PRINT 5 LEADING, 1 FINAL

	DAC	CONVC	/ISZ ON COUNT

	CLA!CLL!CML	/SET TO MAKE LINK 0

	RTR		/AND AC 200000

	MUL-13000	/DIVIDE BY 100000 DECIMAL

	517427

	LRS	20	/LEAVING FIRST DIGIT IN AC, REST IN MQ

CONV1	AAC	60	/MAKE ASCII

	SAD	CONVND	/IS IT A LEADING 0

	JMP	CONV2	/YES

	DZM	CONVND	/NO, DESTROY LEADING ZERO COMPARE

	DAC*	X10	/PLACE IN OUTPUT LINE

CONV2	CLL!CLA		/CLEAR FOR SETTING UP MULTIPLY

	MUL-13000	/12*MQ+AC

	12

	ISZ	CONVC	/DONE YET

	JMP	CONV1	/NO

	AAC	60	/YES, FORCE LAST CHAR OUT

	DAC*	X10

	LAC	(60	/SET UP LEADING CHECK AGAIN

	DAC	CONVND

	JMP*	CONVTD	/OUT

/

CONVC	0		/COUNTER

CONVND	60		/LEADING ZERO CHECK

/

/  ROUTINE DECIML,  EDIT 004

/

/

/  RETURNS DECIMAL NUMBER IN AC, LINK CLEARED

/

/  IF NUMBER 2 ^ 18 OR LARGER, GO TO ILLERR , ARGUMNET ERROR

/

DECIML	0		/ CALL WITH FIRST DIGIT IN AC

	DZM	DECIT	/CLEAR ACCUMULATED RESULT

DECIM2	CLL
	AAC	-72	/(014) RANGE CHECK
	TAD	(12	/CARRIES TO LINK IF OK

	SNL!CLL		/SKIP IF OK

	JMP	ILLERR	/ARGUMENT ERROR

	DAC	DECIT2	/SAVE PRESENT CHAR

	LAC	DECIT	/FETCH WHAT WE HAVE SO FAR

	MUL		/*10 DECIMAL

	12

	SZA!CLL		/SKIP IF NO OVERFLOW

	JMP	ILLERR	/OVERFLOW IS ERROR

	LACQ		/RESULT WITHOUT PRESENT DEGIT

	TAD	DECIT2	/WITH PRESENT DIGIT

	SZL		/SKIP IF NO OVERFLOW

	JMP	ILLERR

	DAC	DECIT	/SAVE

	JMS	GETC	/FETCH NEXT CHAR

	SKP!CLL		/GO TO DECIZ

	SAD	(40	/BLANK OK

	SKP!CLL		/GO TO DECIZ

	JMP	DECIM2	/LOOP

DECIZ	LAC	DECIT	/RETURN RESULT IN AC

	JMP*	DECIML

DECIT	0		/TEMPORARIES

DECIT2	0

	.EJECT
SRNDON	PUTC	116

	PUTC	117	/PUT OUT "NONE" IF ALL ZERO

	PUTC	116

	PUTC	105
SRNQ	PUTC	40	/SPACE

	PUTC	121

	PUTC	125

	PUTC	105

	PUTC	125

	PUTC	105

	PUTC	104

	.EJECT

SRPRT	PUTC	12

	PUTC	15	/SAME SEQUENCE AS IN THE JOP3 SECTION

	PUTC	15

	LAC	(OUTBF)

	TCA

	TAD*	(10)

	IAC

	RAR!CLL

	SWHA

	AAC	3

	DAC	OUTBF

	CAL	WRIJOB

	CAL	WAIT

	JMP	DONE	/PRIT OUT STATUS REPORT AND QUIT!!
SRTMP	0

SRMSG	0

SRCNT	0

	.END	START
