Google
 

Trailing-Edge - PDP-10 Archives - bb-d868c-bm_tops20_v4_2020_distr - language-sources/batmac.mac
There are 38 other files named batmac.mac in the archive. Click here to see a list.
UNIVER	BATMAC		;PARAMETER FILE FOR BATCON
SUBTTL	Murray  Berkowitz 11-Mar-78

;
;
;                COPYRIGHT (c) 1975,1976,1977,1978,1979
;                    DIGITAL EQUIPMENT CORPORATION
;
;     THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY  BE  USED
;     AND COPIED ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE
;     AND WITH THE INCLUSION OF THE ABOVE COPYRIGHT NOTICE.   THIS
;     SOFTWARE  OR ANY OTHER COPIES THEREOF MAY NOT BE PROVIDED OR
;     OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON.  NO  TITLE  TO
;     AND OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
;
;     THE INFORMATION  IN  THIS  SOFTWARE  IS  SUBJECT  TO  CHANGE
;     WITHOUT  NOTICE  AND SHOULD NOT BE CONSTRUED AS A COMMITMENT
;     BY DIGITAL EQUIPMENT CORPORATION.
;
;     DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY
;     OF  ITS  SOFTWARE  ON  EQUIPMENT  WHICH  IS  NOT SUPPLIED BY
;     DIGITAL.


	SEARCH	GLXMAC		;CHECK GALAXY LIBRARY
	SEARCH	QSRMAC		;CHECK QUASARS LIBRARY
IFN	FTUUOS,<
	IF1,<PRINTX BUILDING A GALAXY-10 BATMAC>
		SEARCH	UUOSYM>
IFN	FTJSYS,<
	IF1,<PRINTX BUILDING A GALAXY-20 BATMAC>
		SEARCH	MONSYM>
	SUBTTL	Assembly Parameters (Define the Options)

	SYSPRM	FILEMK,<0,,777>,RHMASK	;MASK FOR FILE MAPPING
DEFINE	PARMS<

;;TYPE 1 OPTIONS - DEFINE STATIC PARAMETERS

	X	PTYBFR,1	;;NUMBER OF PTY BUFFERS IN THE RING

;;TYPE 3 OPTIONS - DEFINE OTHER PARAMETERS

	X	TPSIZE,100	;;SIZE OF THE TOP LEVEL PUSH DOWN LIST
	X	.JPSIZ,100	;;SIZE OF THE STACK FOR EACH SUBJOB
	X	%EXTRA,^D10	;;PERCENTAGE OF EXTRA TIME GIVEN TO A JOB
	>

DEFINE	X(A,B)<IFNDEF A,<A==B>> ;;DEFINE THE SYMBOL IF NOT ALREADY DEFINED

	PARMS			;EXPAND THE ASSEMBLY PARAMETERS


;	-10 Job maximum is dependent on new FILOP otherwise max should be 5.
;	-10 maximum is 15 till PTY uses new FILOP.
	SYSPRM	DEFMJB,^D15,^D9	;JOB MAX ON EITHER SYSTEM
	SYSPRM	MONCHR,".","@"	;MONITOR PROMPT CHARACTER
				;USED AS FIRST CHARACTER OF INPUT LINE TO
				;DIRECT LINE TO THE MONITOR
	SYSPRM	OPRPST,<ASCIZ /B/>,<ASCIZ /B-/>  ;OPR PROMPT STRING
;CONSISTENCY CHECK FOR ASSEMBLY PARAMETERS

	IFLE	DEFMJB,<
		PRINTX DEFMJB.LT.1, 1 ASSUMED
		DEFMJB==1>
	IFN	FTJSYS,<
	IFG	<DEFMJB-^D9>,<
		PRINTX	DEFMJB GREATER THAN 9 ON -20 ..9 ASSUMED
		DEFMJB==^D9
		>>;END FTJSYS
	IFN	FTUUOS,<
	IFG	<DEFMJB-^D15>,<
		PRINTX	DEFMJB GREATER THAN 15 ON -10 ..15 ASSUMED
		DEFMJB==^D15
		>>;END FTUUOS


	IFLE	PTYBFR,<
		PRINTX PTYBFR.LT.1, 1 ASSUMED
		PTYBFR==1>

	IFL	<%EXTRA-^D10>!<^D100-%EXTRA>,<
		PRINTX BAD VALUE FOR THE PERCENTAGE OF EXTRA TIME, 10% ASSUMED
		%EXTRA==^D10>
	SUBTTL	Other Definitions (Bits, AC's, Macros, etc...)

;ACCUMULATOR DEFINITIONS (MUST BE IN THE ORDER DISTRIBUTED)
;THESE DEFINITIONS PARALLEL QUASAR-10 DEFINITIONS

;AC BLOCK 0-13 IS SAVED FOR EACH STREAM IN .JREGS(R)
;AC 17 IS ALSO SAVED

IO1==7		;REGISTERS USED BY THE I/O HANDLER
IO2==10

F==11		;ONE OF THE FLAG WORDS FOR THE STREAM (AC R IS THE OTHER)

J==12		;JOBSTS FOR THE STREAM

CH==13		;RANDOM CHARACTER HOLDER (QUASAR AC 'AP')

;END OF SAVED AC'S FOR EACH STREAM

G==14		;GLOBAL BATCON FLAGS
S==15		;STREAM INDEX
R==16		;RELOCATION FOR THE STREAM (LH ARE STREAM FLAGS)

P==17		;PUSH DOWN LIST POINTER
		;IS USED FOR BOTH TOP LEVEL PDL
		;AND INDIVIDUAL STREAM LISTS

	FULLCT==4			;COUNT OF FULL RETRIES
	PTYNCH==6	;NUMBER OF INTERRUPT CHANNEL GROUPS
	INT.PI==0			;INTERRUPT LEVEL 0
	INT.P1==1			;INTERRUPT LEVEL 1
	INT.P3==3			;INTERRUPT LEVEL 3


;DEFINE SOME CONSTANTS AFTER CONSISTENCY CHECKS (PS. DON'T EVER CHANGE THESE)


;	DO NOT CHANGE THE NUMBER OF WORDS SINCE IT WILL CAUSE PROBLEMS
;	ON THE -20 IF SIZE IS TOO BIG.

	SYSPRM	PTYBLK,^D30,23		;30. ON -10 23 ON -20
;FLAGS SETTINGS FOR BATCH STREAMS

;AC R (LH FLAGS ONLY)

RL.ACT==400000	;STREAM IS ACTIVE (MUST BE THE SIGN BIT)
RL.MES==200000	;OPERATOR MESSAGE LIST SETUP...
RL.JNA==100000	;JOB NUMBER IS EVER ASSIGNED
RL.OPR==040000	;WAITING FOR OPERATOR RESPONSE
RL.JIE==020000	;JOB IS IN ERROR STATE
RL.FCI==010000	;FIRST CHARACTER OF INPUT FROM CTL FILE
RL.KJB==004000	;AUTO KJOB LINE HAS BEEN SENT
RL.IGN==002000	;DONT SAVE CHARS FOR THE OPERATOR LINE
RL.MSP==001000	;A MESSAGE IS READY TO PROCESS..SCHEDULE JOB
RL.LGI==000400	;JOB IS LOGGING IN NOW
RL.QTS==000200	;QUOTES SEEN
RL.DIA==000100	;USER IS IN DIALOGUE MODE
RL.STP==000040	;JOB IS STOPPED BY THE OPERATOR
RL.NLG==000020	;NO LOG FILE AVAILABLE
RL.MIP==000010	;OPERATOR MESSAGE BEING PROCESSED
RL.FLS==000004	;REQUEST TO FLUSH JOB
RL.CKP==000002	;REQUEST TO CHECKPOINT THE JOB

;INITIAL SETTINGS FOR R

RL.INI==RL.ACT!RL.LGI	;FOR A NEW JOB SET ACTIVE, LOGIN IN PROGRESS
;AC F (LH)

FL.PER==400000	;MONITOR LEVEL LINE STARTED WITH A PERIOD
FL.NER==200000	;NOERROR IS IN EFFECT
FL.PLS==100000	;DOING A PLEASE COMMAND
FL.SUP==040000	;SUPPRESS THE NULL LINE (=MODE)
FL.LAB==020000	;FOUND A LABEL ON THIS LINE
FL.SIL==010000	;SILENCE THE LOG FILE
FL.UPA==004000	;DOING UPARROW PROCESSING
FL.ACC==002000	;NEED TO CHECK READ PRIVLEGES FOR THE CTL FILE
FL.TLE==001000	;TIME LIMIT WAS EXCEEDED
FL.%XT==000400	;%EXTRA TIME HAS BEEN GIVEN
FL.CRS==000200	;CARRIAGE RETURN SEEN
FL.ERR==000100	;SEND ERROR DATA WITH MESSAGE
FL.SPL==000040	;SPECIAL PROCESSING TO ADD MORE DATA TO MESSAGE
FL.NOP==000020	;NO OPERATOR INTERVENTION ALLOWED

;AC F (RH)

FR.RSC==400000	;WANT COMMAND SCANNER TO RE-GET LAST CHARACTER
FR.%SG==200000	;A % SIGN IS A LEGAL SIXBIT CHARACTER
FR.BAK==100000	;BACKTO IN PROGRESS
FR.LSL==040000	;LIST LINES SKIPPED IN LABEL SEARCHES
FR.FIN==020000	;THIS LABEL SEARCH CAN PASS A %FIN::
FR.UHE==010000	;AN UNHANDLED ERROR OCCURRED
FR.NBL==004000	;IN GETRDX, A NON-BLANK HAS BEEN FOUND
FR.CTO==002000	;CONTROL FILE IS OPEN BIT
FR.SLF==001000	;FLAG FOR SUPPRESSING LF TO PTY
FR.STS==000400	;STATUS UPDATE FIELD FOR INTERRUPT FLAGS
FR.LFO==000200	;LOG FILE OPEN FLAG
FR.LFE==000100	;LOG FILE ERROR ON OPEN
FR.CHK==000040	;SEND CHECKPOINT DATA AND UPDATE
FR.SCC==000020	;SENT ^C TO STOP THE JOB
FR.JLI==000010	;SET TO INITIALIZE PTY WITH ^C..(-20 ONLY)
FR.TBL==000004	;MONITOR LEVEL PROBLEM FLAG

;INITIAL SETTINGS FOR F

FL.INI==FL.ACC		;FOR A NEW JOB NEED A CHECK
FR.INI==0		;FIRST LOOK AT THE LOG FILE
;FLAGS RETURNED BY THE JOBSTS UUO

JL.UJA==400000	;USER JOB NUMBER ASSIGNED
JL.ULI==200000	;USER LOGGED IN
JL.UML==100000	;USER IS AT MONITOR LEVEL
JL.UOA==040000	;USER OUTPUT IS AVAILABLE
JL.UDI==020000	;USER CAN DO INPUT
JL.UJC==010000	;USER HAS JACCT

;CHARACTERS

CHR.CC==3	;CONTROL C
CHR.CG==7	;CONTROL G
CHR.HT==11	;HORIZONTAL TAB
CHR.LF==12	;LINE FEED
CHR.VT==13	;VERTICAL TAB
CHR.FF==14	;FORM FEED
CHR.CR==15	;CARRIAGE RETURN
CHR.CZ==32	;CONTROL Z
CHR.A1==33	;STANDARD ALTMODE
CHR.OA==74	;OPEN ANGLE BRACKET
CHR.CA==76	;CLOSE ANGLE BRACKET
CHR.QT==42	;QUOTE CHARACTER
CHR.CA==54	;COMMA CHARACTER

	;SYMBOLS FOR CHECKPOINT REQUEUE INFORMATION
BA.JOB==1B0		;SEEN THE JOB FLAG
BA.ORQ==1B1		;JOB REUEUED BY OPERATOR
BA.URQ==1B2		;USER REQUEUED THE JOB
BA.CHK==1B3		;CHECKPOINT JOB BY USER


	;SYMBOLS FOR MESSAGE PROCESSING

B.DEFR==400000		;FLAG TO PROCESS BY STREAM
B.STCN==200000		;STOP AND CONTINUE OPERATOR MESSAGE
;GETTAB TABLES

.GTSTS==0	;USER JOB STATUS
	ST.RUN==1B0	;JOB IS RUNNABLE NOW
	ST.CMW==1B1	;COMMAND IS WAITING FOR CORE
	ST.SWP==1B7	;JOB IS SWAPPED OR BEING SWAPPED
	ST.CLK==1B18	;JOB HAS A CLOCK REQUEST
	ST.JDC==1B20	;WAITING FOR DUMP
	ST.IRQ==1B22	;WAITING FOR OPERATOR INTERVENTION

.GTPRG==3	;USER PROGRAM NAME
.GTWSN==25	;TABLE OF SIXBIT NAMES FOR WAIT CODES

;OPCODE DEFINITIONS

OPDEF	TXTLOG	[001000,,0]	;BATCON UUO - TEXT TO THE LOG FILE
OPDEF	TXTJOB	[002000,,0]	;BATCON UUO - TEXT TO THE JOB
OPDEF	SIXLOG	[003000,,0]	;BATCON UUO - SIXBIT TEXT TO THE LOG FILE
OPDEF	IDENT	[004000,,0]	;BATCON UUO - OUTPUT LINE IDENTIFIER
	SUBTTL	Data Base for Each Batch Stream
	PHASE	0
	;QUEUE ENTRY SYMBOLS FROM NEXTJOB MESSAGE
.JQITN:! BLOCK	1			;INTERNAL NAME FROM QUASAR
.JQJBB:! BLOCK	JIBSIZ			;SIZE OF JOB INFO BLOCK
.JQLIM:! BLOCK	EQLMSZ			;LIMIT WORDS FOR JOB
.JQACT:! BLOCK	10			;ACCOUNTING STRING FOR JOB


	;SYSTEM DEPENDENT INFO
IFN	FTUUOS,<
.JQPPN:! BLOCK	1			;USERS PPN
.JQPAT:! BLOCK	6			;JOB PATH INFORMATION
>;END FTUUOS

IFN	FTJSYS,<
.JQNAM:! BLOCK	10			;USER NAME STRING
.JQCON:! BLOCK	12			;CONNECTED DIRECTORY STRING
.JQSIS:! BLOCK	1			;SPOOLED FILE INFO
>

.JQCFP:! BLOCK	2			;SAVE CTL FP WORDS (2 OF 5)
.JQCFD:! BLOCK	FDXSIZ			;CTL FILE FD
.JQLFP:! BLOCK	2			;SAVE CTL FP WORDS (2 OF 5)
.JQLFD:! BLOCK	FDXSIZ			;LOG FILE FD
.JQBYT:! BLOCK	1			;BYTE POINTER FOR FD CREATE
.JQTYP:! BLOCK	1			;BATCH STREAM TYPE
.JQSTR:! BLOCK	1			;BATCH STREAM NUMBER
.JQNOD:! BLOCK	1			;BATCH STREAM NODE LOCATION

	.JQOBJ==.JQTYP			;OBJECT BLOCK POINTER

;;; END OF AREA BUILT FROM THE "NEXT JOB" FUNCTION

;;; THE JOB DATA BASE IS CONTINUED ON THE NEXT PAGE
.JREGS:! BLOCK	15	;JOB PROCESSOR REGS 0-13,17
.JPLST:! BLOCK	.JPSIZ	;PUSH DOWN LIST FOR JOB PROCESSOR
IFN FTUUOS,<
.JPTYI:! BLOCK	PTYBLK*PTYBFR	;SPACE FOR PTY BUFFER RING
>  ;END IFN FTUUOS
.JPTYO:! BLOCK	PTYBLK*PTYBFR	;SPACE FOR PTY BUFFER RING
.JPINP:! BLOCK	3	;RING HEADER FOR INPUT
.JPOUT:! BLOCK	3	;RING HEADER FOR OUTPUT
.JPCHN:! BLOCK	1	;SAVED 'IO1' WITH PTY CHANNEL NUMBER (PERMANENT ASSIGNMENT)
.JLABL:! BLOCK	1	;LABEL BEING SEARCHED FOR
.JOPER:! BLOCK	2	;LENGTH AND ADDRESS OF WTOR RESPONSE
.JBAKP:! BLOCK	1	;LOCATION OF THE CURRENT BACKTO COMMAND
.JINFO:! BLOCK	EQCKSZ	;CHECKPOINT/REQUEUE INFORMATION
	.JCHRQ==.JINFO ;WORD 0 IS THE CHECKPOINT/REQUEUE LABEL
.JREQI:! BLOCK	1	;REQUEUE INFORMATION FLAG WORD
.JQLOC:! BLOCK	1	;LOCATION OF THE JOB
.JJOBN:! BLOCK	1	;JOB NUMBER SAVED FOR RELEASE MESSAGE
.JCJFN:! BLOCK	1	;CONTROL FILE JFN
.JLJFN:! BLOCK	1	;LOG FILE JFN
	;LOG PAGE DATA BASE
.JLFOB:! BLOCK	FOB.SZ	;FILE OPEN BLOCK FOR LOG
.JLPAG:! BLOCK	1	;LOG FILE PAGE FOR INITIAL DATA
.JLPCT:! BLOCK	1	;LOG FILE PAGE COUNTER WORD
.JLPTR:! BLOCK	1	;LOG FILE POINTER PAGE FOR INIT DATA

.JCFOB:! BLOCK	FOB.SZ	;FILE OPEN BLOCK FOR CTL FILE
.JCUSI:! BLOCK	1	;USETI/USETO COUNT (-1 IF END OF FILE)
.JLCNT:! BLOCK	1	;BYTE COUNT
.JLUSI:! BLOCK	1	;USETI/USETO COUNT
.JERCD:! BLOCK	1	;BYTE (9).ERROR CHAR, .OPERATOR CHAR  (18)ERROR CODE
.JSTAT:! BLOCK	1	;SAVE RESULT OF JOBSTS UUO, FOR BATOPR
.JRUNT:! BLOCK	1	;JOBS RUNTIME, USED BY BACKTO
.JOBCT:! BLOCK	1	;NUMBER OF THIS JOB FOR BATCON
.JSPTR:! BLOCK	1	;STATUS POINTER WORD
.JWCNT:! BLOCK	1	;WTO MESSAGE COUNTER
.JWPTR:! BLOCK	1	;WTO MESSAGE BYTE POINTER
.JWADR:! BLOCK	1	;ADDRESS OF WTO PAGE
.JWTOF:! BLOCK	1	;WTO FLAG..WTO IN PROGRESS
.JERRO:! BLOCK	1	;ERROR CODE FOR OUTPUT END MESSAGE
.JMESC:! BLOCK	1	;COUNT OF OPR MESSAGES PENDING
.JMLST:! BLOCK	1	;LINK LIST FOR OPERATOR MESSAGES
.JREOL:! BLOCK	1	;END OF LINE SENT FLAG
.JRTIM:! BLOCK	1	;TIME STAMP NEEDED FLAG
.JPSIE:! BLOCK	1	;PTY SETUP WORD FOR INTERRUPT SYSTEM
.JFLAG:! BLOCK	1	;STREAM FLAGS FOR PTY
.JINPI:! BLOCK  1	;COUNT OF INPUT READY INTERRUPTS
.JOUTI:! BLOCK  1	;COUNT OF OUTPUT READY INTERRUPTS
.JOBST:! BLOCK	1	;COUNT OF JOBSTS FOR JOB
.JWAIT:! BLOCK	1	;COUNT OF WAITS DURING LOGIN/LOGOUT


IFN FTJSYS,<
.JPLSO:! BLOCK	1	;LINK LIST FOR PTY OUTPUT
.JPTTY:! BLOCK 	1	;PTYS TERMINAL NUMBER
.JJOBS:! BLOCK	.JIT20+1	;BLOCK FOR GETJI INFO
.JLOGI:! BLOCK	1	;COUNT OF LOGIN TRIES FOR ?FULL
>  ;END OF IFN FTJSYS

.JARG1:! BLOCK	1	;ARGUMENT ONE FOR ERROR PROCESSING
.JARG2:! BLOCK	1	;ARGUMENT TWO FOR ERROR PROCESSING
.JSIZE:!		;SIZE OF THE DATA BASE FOR EACH STREAM
	DEPHASE
	RELOC 0			;START AT 0 TO SAVE SPACE

.JPAGS==1+<<.JSIZE-1>/1000>	;NUMBER OF PAGES NEEDED FOR THE DATA BASE

	PHASE	0

	;FORMAT OF THE MESSAGE QUEUE FOR EACH STREAM

IPC.RT:! BLOCK	1	;ROUTINE TO PROCESS THE MESSAGE
IPC.TX:! BLOCK	1	;ASCIZ OF THE NAME OF MESSAGE
IPC.AR:! BLOCK	1	;ADDRESS OF NEXT ARGUMENT IN MESSAGE
IPC.CD:! BLOCK	1	;CODE FOR QUASAR STATUS
IPC.DA:!		;START OF IPCF MESSAGE IN QUEUE

	DEPHASE
	RELOC	0
;MACRO DEFINITIONS

DEFINE	LSTOFF<			;MACRO TO TURN OFF THE LISTING
	IFE	LSTING,<
		.XCREF
		XLIST>
	LSTING==LSTING+1	;COUNT XLIST DEPTH
	>

DEFINE	LSTON<			;MACRO TO TURN THE LISTING BACK ON
	LSTING==LSTING-1	;DECREMENT XLIST LEVEL
	IFE	LSTING,<	;DON'T TURN IT ON IF STILL NESTED
		.CREF
		LIST
		SALL>
	>
	SUBTTL	INTERRUPT DATA BASE FLAGS

	INT.IN==3		;INPUT INTERRUPT LEVEL
	INT.OU==1		;OUTPUT INTERRUPT LEVEL
	INT.AL==1		;ALL LEVELS



	ALCSIZ==^D25		;MINIMUM MEMORY ALLOCATION
	SUBTTL	MSGBLD--BUILD ERROR MESSAGE TABLE

	DEFINE	MSGBLD,<
	XLIST
	X	(E.NORM,NORMALLY)
	X	(E.RUSR,Requeued by User)
	X	(E.ROPR,Requeued by Operator)
	X	(E.TLMT,Time Limit Exceeded)
	X	(E.CUSR,<Canceled by User ^P/.JARG1(R)/>)
	X	(E.COPR,Aborted by Operator)
	X	(E.JLOG,Logged Out..COMMAND IGNORED)
	X	(E.UERR,Terminated by User Error)
	X	(E.LFOE,Terminated from Log File Open Error)
	X	(E.LFIO,<Terminated from Log File I/O Error>)
	X	(E.NSTR,<No Free Batch Streams .. Job Requeued>)
	X	(E.NPTY,<No Free PTY's on the SYSTEM .. Job Requeued>)
	X	(E.STRA,<Stream Already Started>)
	X	(E.NJOB,<No Job Slots Available .. Job Requeued>)
	X	(E.JLOF,<Terminated from LOGIN Failure>)
	X	(E.SHTD,<Shutdown>)
	X	(E.STAR,<Started>)
	X	(E.NOPA,<Canceled  No Operator Intervention Allowed>)

	LIST
	SALL
	>

	DEFINE	X(A,B),<
	XLIST
	A==$$			;ASSIGN VALUE TO SYMBOL
	$$==$$+1		;INCREMENT COUNTER
	LIST
	SALL
	>;END X

	$$==0			;SET TO 0
	MSGBLD			;ASSIGN THE VALUES
	MSGTSZ==$$		;COUNT OF MESSAGES
	END