Google
 

Trailing-Edge - PDP-10 Archives - bb-m081w-sm_t20_v7_0_02_exec_src_mod - exec/execde.mac
There are 47 other files named execde.mac in the archive. Click here to see a list.
; Edit= 4417 to EXECDE.MAC on 12-Jan-89 by WONG, for SPR #22042
;Add code to support @SET DEFAULT PRINTER /REMOTE-PRINT: command and fix some
;bugs in routine SRPPTR: which deals with validating the arguments to the @SET
;REMOTE PRINTER command.
; Edit= 4412 to EXECDE.MAC on 13-Dec-88 by RASPUZZI
;Add new commands, features and support for security enhancements.
; UPD ID= 4132, RIP:<7.EXEC>EXECDE.MAC.11,   7-Mar-88 20:15:10 by GSCOTT
;More of TCO 7.1255 - Fix copyright macro.
; UPD ID= 4115, RIP:<7.EXEC>EXECDE.MAC.10,   7-Mar-88 18:22:41 by GSCOTT
;TCO 7.1255 - Update copyright notice.
; UPD ID= 4088, RIP:<7.EXEC>EXECDE.MAC.9,  18-Jan-88 10:07:48 by EVANS
; TCO 7.1178 - Add some new flags.
; UPD ID= 78, RIP:<7.EXEC>EXECDE.MAC.8,   1-Dec-87 15:02:14 by RASPUZZI
;TCO 7.1152 - Make WLDPAG the same as BUF0 to save storage.
; UPD ID= 73, RIP:<7.EXEC>EXECDE.MAC.7,  19-Nov-87 13:27:00 by EVANS
; TCO 7.1143 (which is really More of 7.1092) Change EMCSSW back to 0
;		and let EXECD1 set it to 1.
; UPD ID= 50, RIP:<7.EXEC>EXECDE.MAC.6,  28-Oct-87 13:57:34 by EVANS
; TCO 7.1092 - Answer EXEC Grump by setting EMCSSW to 1
; UPD ID= 20, RIP:<7.EXEC>EXECDE.MAC.5,  22-Sep-87 11:22:18 by EVANS
; More TCO 7.1061 - Fill in TCO numbers around edits and add header line.
; UPD ID= 15, RIP:<7.EXEC>EXECDE.MAC.4,  22-Sep-87 10:47:25 by EVANS
; TCO 7.1061 - Implement SET REMOTE-PRINTING CHARACTERISTIC and INFORMATION
;		(ABOUT) REMOTE-PRINTING.
; UPD ID= 1, RIP:<7.EXEC>EXECDE.MAC.3,  28-May-87 16:55:11 by EVANS
;TCO 7.1004 Remove STAT stuff - STATSW, STAT, and NOSTAT
; *** Edit 3050 to EXECDE.MAC by EVANS on 29-Oct-86, for SPR #00092
; Reset STATSW to zero to prevent mulitply defined symbols when linking with
; distributed PCL and MIC modules; remove the STAT code so we don't do the
; statistics.
; *** Edit 3033 to EXECDE.MAC by RASPUZZI on 23-Apr-86
; Fix GTJFN block (CJFNBK) so that the LOC is removed and each word in the
; GTJFN block are defined explicitly. This will remove CTRPTR, DICT, and CSBUFP
; from the GTJFN block. They are there erroneously.
; *** Edit 3021 to EXECDE.MAC by EVANS on 13-Nov-85 (TCO none)
; Default STATSW to OFF. 
; UPD ID= 257, SNARK:<6.1.EXEC>EXECDE.MAC.15,  20-Jun-85 14:22:29 by EVANS
;More TCO 6.1.1404 - Add NOSAVE - so command editor won't save certain commands
; UPD ID= 251, SNARK:<6.1.EXEC>EXECDE.MAC.14,  19-Jun-85 22:50:20 by PRATT
;More TCO 6.1.1404 - Add some buffer length definitions
; UPD ID= 246, SNARK:<6.1.EXEC>EXECDE.MAC.13,  11-Jun-85 08:54:02 by DMCDANIEL
;Update copyrights.  Make sure only one copyright gets into .EXE files.
; UPD ID= 203, SNARK:<6.1.EXEC>EXECDE.MAC.11,  24-May-85 14:13:41 by EVANS
;TCO 6.1.1404 - Add command editor stuff.
; UPD ID= 168, SNARK:<6.1.EXEC>EXECDE.MAC.10,   3-May-85 08:30:13 by DMCDANIEL
;Update copyrights for 6.1.
; UPD ID= 142, SNARK:<6.1.EXEC>EXECDE.MAC.9,  14-Mar-85 21:53:58 by PRATT
;TCO 6.1.1270 - Always define the page used by statsw
; UPD ID= 119, SNARK:<6.1.EXEC>EXECDE.MAC.8,   4-Jan-85 15:47:34 by EVANS
;TCO 6.1.1107 - Add CFGSIZ for INFO CLUSTER
; UPD ID= 107, SNARK:<6.1.EXEC>EXECDE.MAC.6,  11-Dec-84 15:23:35 by MOSER
;TCO 6.1.1077 - ADD STAT STUFF
; UPD ID= 60, SNARK:<6.1.EXEC>EXECDE.MAC.4,  12-Nov-84 03:43:47 by MERRILL
;TCO 6.1.1042 - Define FK%INV (fork is INVOKE'd) fork flag for PCL
; UPD ID= 23, SNARK:<6.1.EXEC>EXECDE.MAC.3,   1-Oct-84 20:45:45 by PRATT
;More TCO 6.1.1016 - Increase range for jfn-watching of exec pages
; UPD ID= 8, SNARK:<6.1.EXEC>EXECDE.MAC.2,  29-Sep-84 16:05:28 by PRATT
;TCO 6.1.1016 - Add interrupt stuff for SET JFN-WATCH
; UPD ID= 450, SNARK:<6.EXEC>EXECDE.MAC.24,  29-Sep-84 16:01:17 by PRATT
;Remove 6.2227 - Wait till rel 6.1 for a more permanent solution
; UPD ID= 441, SNARK:<6.EXEC>EXECDE.MAC.23,  25-Sep-84 13:44:01 by PRATT
;TCO 6.2227 - Exec does too many jsys's. Reduce MAXJFN to 100.
; UPD ID= 422, SNARK:<6.EXEC>EXECDE.MAC.22,  18-Jul-84 16:57:00 by PROBINSON
;TCO 6.2133 - XDDT changes
; UPD ID= 406, SNARK:<6.EXEC>EXECDE.MAC.21,   3-May-84 08:23:15 by SHTIL
; UPD ID= 396, SNARK:<6.EXEC>EXECDE.MAC.20,  20-Mar-84 15:26:45 by MCCOLLUM
;TCO 6.2004 - Add FN%ATT to fork name block. Fork has attributes, but don't
; preserve them when reset.
; UPD ID= 337, SNARK:<6.EXEC>EXECDE.MAC.19,  20-Nov-83 19:42:57 by PRATT
;TCO 6.1870 - Get rid of code which is under NONEWF. Remove NEWF's.
; UPD ID= 269, SNARK:<6.EXEC>EXECDE.MAC.18,  20-Apr-83 06:23:15 by FLEMMING
;TCO 6.1618 - Add support for TOPS10 PPNs
; UPD ID= 240, SNARK:<6.EXEC>EXECDE.MAC.17,  15-Jan-83 19:24:32 by CHALL
;TCO 6.1464 - UPDATE COPYRIGHT NOTICE
; UPD ID= 167, SNARK:<6.EXEC>EXECDE.MAC.15,  30-Sep-82 16:33:41 by MCINTEE
;TCO 6.1270 - Space for remote alias subcommand, node names in filespecs
; UPD ID= 158, SNARK:<6.EXEC>EXECDE.MAC.14,  15-Sep-82 13:41:27 by TSANG
;TCO 6.1254 FIX THE BUFFER SIZE
; UPD ID= 117, SNARK:<6.EXEC>EXECDE.MAC.13,  20-Apr-82 07:54:13 by CHALL
;TCO 6.1092 Move MICSW to EXECCA
; UPD ID= 91, SNARK:<6.EXEC>EXECDE.MAC.11,   8-Jan-82 15:51:05 by CHALL
;TCO 6.1052 - UPDATE COPYRIGHT NOTICE AND DELETE PRE-V4.1 EDIT HISTORY
; UPD ID= 82, SNARK:<6.EXEC>EXECDE.MAC.10,  20-Dec-81 18:48:42 by CHALL
;TCO 6.1050 DEFINE GTB MACRO (REPLACING GTB UUO)
; UPD ID= 60, SNARK:<6.EXEC>EXECDE.MAC.9,  30-Sep-81 09:55:17 by CHALL
;TCO 5.1541 TURN OFF EMCSSW, MICSW; CREATE EXECD1.MAC TO ASSM W/EXECDE ON 2102
;TCO 5.1540 DEFINE EMCSSW SWITCH FOR EMACS CODE IN EXECED; NORMALLY OFF
; UPD ID= 18, SNARK:<6.EXEC>EXECDE.MAC.8,  17-Aug-81 10:11:18 by CHALL
;TCO 5.1454 CHANGE NAME FROM XDEF TO EXECDE
; UPD ID= 13, SNARK:<6.EXEC>EXECDE.MAC.7,  20-Jul-81 11:19:19 by CHALL
;CHANGE SIZE OF ALERT TABLE (NALTS) TO 50.
;<HELLIWELL.EXEC.5>EXECDE.MAC.1, 13-May-81 14:48:26, EDIT BY HELLIWELL
;REMOVE SHIPSW, SHIP, NOSHIP DEFINITIONS
; UPD ID= 2097, SNARK:<6.EXEC>EXECDE.MAC.4,  28-May-81 09:49:49 by OSMAN
;Increase ATMLEN to 500
; UPD ID= 2031, SNARK:<6.EXEC>EXECDE.MAC.3,  19-May-81 10:46:22 by OSMAN
;Increase CBUFL to 1000
; UPD ID= 1997, SNARK:<6.EXEC>EXECDE.MAC.2,  14-May-81 15:23:34 by MURPHY
;SEARCH GALAXY UNIVERSALS IN MODULES THAT NEED THEM ONLY
; UPD ID= 1897, SNARK:<5.EXEC>EXECDE.MAC.2,  28-Apr-81 17:23:20 by MURPHY
;DESCRIPTION OF FUNCTIONS IN SUBRS CALLED VIA UUOS
;MOVE PCL AND MFRK ASSEMBLY SWITCHES OUT OF THIS FILE
;ASSEMBLY SWITCH FOR PCL FEATURES
;<4.EXEC>EXECDE.MAC.1, 21-Oct-80 19:35:23, Edit by DK32
;Programmable Command Language
; UPD ID= 1552, SNARK:<5.EXEC>EXECDE.MAC.27,  11-Feb-81 09:10:32 by OSMAN
;Remember DDT start address for fork in DDTSA
; UPD ID= 1404, SNARK:<5.EXEC>EXECDE.MAC.26,   6-Jan-81 13:29:00 by OSMAN
;Up the number of alerts allowed to 300 decimal
; UPD ID= 1396, SNARK:<5.EXEC>EXECDE.MAC.22,   6-Jan-81 10:26:43 by OSMAN
;tco 5.1225 - Implement jsys trapping and file-opening trapping!
; UPD ID= 1383, SNARK:<5.EXEC>EXECDE.MAC.21,  24-Dec-80 15:07:13 by OSMAN
;tco 5.1214 - Add SBLKLN
; UPD ID= 1239, SNARK:<5.EXEC>EXECDE.MAC.20,   6-Nov-80 15:20:48 by OSMAN
;tco 5.1189 - Add HIGHPN
; UPD ID= 1138, SNARK:<5.EXEC>EXECDE.MAC.19,   7-Oct-80 15:29:25 by OSMAN
;Increase PDL for PCL
; UPD ID= 1128, SNARK:<5.EXEC>EXECDE.MAC.18,   6-Oct-80 10:16:35 by OSMAN
;tco 5.1167 - Remove FDB autokeep feature
; UPD ID= 1026, SNARK:<5.EXEC>EXECDE.MAC.17,  22-Sep-80 10:37:57 by OSMAN
;tco 5.1150 - Add SET PROGRAM
; UPD ID= 1018, SNARK:<5.EXEC>EXECDE.MAC.16,  16-Sep-80 15:20:51 by MURPHY
;TURN MIC SWITCH ON
; UPD ID= 914, SNARK:<5.EXEC>EXECDE.MAC.15,  19-Aug-80 13:55:07 by HESS
; Fix Examine/Deposit commands for multi-forking
; UPD ID= 854, SNARK:<5.EXEC>EXECDE.MAC.14,  10-Aug-80 15:20:09 by OSMAN
;tco 5.1129 - Add symbolic address and expression support
; UPD ID= 844, SNARK:<5.EXEC>EXECDE.MAC.13,   6-Aug-80 12:06:38 by MURPHY
;Make assembly switches global to detect conflicts
;<5.EXEC>EXECDE.MAC.12, 30-May-80 17:01:06, EDIT BY MURPHY
;PUT NEW MAIL WATCH AND ALERTS UNDER NEWF
;<5.EXEC>EXECDE.MAC.11, 21-May-80 12:12:23, EDIT BY MURPHY
;SET XTND to 0
; UPD ID= 530, SNARK:<5.EXEC>EXECDE.MAC.10,  20-May-80 14:54:56 by MURPHY
;ADD NEWF CONDITIONAL FOR VARIOUS "NEW" FEATURES UNDER TEST
; UPD ID= 529, SNARK:<5.EXEC>EXECDE.MAC.9,  20-May-80 14:02:15 by MURPHY
;ADD MFRK CONDITIONAL FOR MULTI-FORK FEATURES ONLY
; UPD ID= 521, SNARK:<5.EXEC>EXECDE.MAC.8,  14-May-80 13:21:09 by OSMAN
;Add DATBIT
;<5.EXEC>EXECDE.MAC.6,  8-May-80 14:04:46, EDIT BY OSMAN
;tco 5.1034 - Turn on extended archiving features
;<5.EXEC>EXECDE.MAC.5,  8-May-80 13:58:57, EDIT BY OSMAN
;Remove R.L.5 and R.GE.5 conditionals.
;<5.EXEC>EXECDE.MAC.4, 30-Apr-80 10:06:36, EDIT BY OSMAN
;Set release 5
;<4.1.EXEC>EXECDE.MAC.9, 29-Apr-80 13:27:31, EDIT BY OSMAN
;Turn XTND to 1!!
; UPD ID= 414, SNARK:<4.1.EXEC>EXECDE.MAC.8,   4-Apr-80 17:43:09 by LYONS
;MAKE R5SW USE THE SUPPLIED VALUE, IF THERE IS ONE
; UPD ID= 343, SNARK:<4.1.EXEC>EXECDE.MAC.7,  19-Mar-80 15:10:49 by TOMCZAK
;<4.1.EXEC>EXECDE.MAC.5, 17-Mar-80 10:50:25, EDIT BY OSMAN
;ADD R.GE.5 AND R.L.5 MACROS
;<4.1.EXEC>EXECDE.MAC.4, 29-Feb-80 14:01:57, EDIT BY OSMAN
;tco 4.1.1097 - Don't say "string space exhausted" after many DELETE commands
;<4.1.EXEC>EXECDE.MAC.2, 20-Nov-79 11:25:22, EDIT BY OSMAN
;TCO 4.1.1023 - FIX TAKE STUFF

;	COPYRIGHT (c) DIGITAL EQUIPMENT CORPORATION 1976, 1988.
;	ALL RIGHTS RESERVED.
;
;	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 THAT IS NOT SUPPLIED BY DIGITAL.
;TOPS20 'EXECUTIVE' COMMAND LANGUAGE - DEFINITIONS


	UNIVERSAL EXECDE

	SEARCH MACSYM,MONSYM

;THIS FILE DEFINES VARIOUS PARAMETERS.
;SOME OF THESE ARE USED INTERNALLY AND SOME AFFECT THE LANGUAGE.

OURNAM==SIXBIT /EXEC/		;OUR PROGRAM NAME WHILE WAITING FOR A COMMAND

;MACRO TO DO COPYRIGHT STATEMENT IN .REL FILES
;[7.1255] Generate 20 octal words or less of ASCIZ text to fit in one rel
;block.  In the statement below the trailing CRLF does not fit into the first
;20 words but will in the .EXE file.

DEFINE CPYRYT,<
	LOC	0
	ASCIZ /
COPYRIGHT (c) DIGITAL EQUIPMENT CORPORATION, 1976, 1988.
ALL RIGHTS RESERVED.
/				;;[7.1255]
	RELOC>

;MACRO TO DO STANDARD STUFF AT BEGINNING OF EACH ASSEMBLY

DEFINE TTITLE (TT)<
	CPYRYT
	TITLE TT
	SEARCH MACSYM,MONSYM
	SALL
	GGLOBS>

;MACRO TO DO STANDARD STUFF (EXCEPT CPYRYT) AT BEGINNING OF EACH ASSEMBLY
DEFINE UTITLE (TT)<
	TITLE TT
	SEARCH MACSYM,MONSYM
	SALL
	GGLOBS>
;UNIVERSALS TO SEARCH FOR GALAXY STUFF

DEFINE GLXSCH <
	SEARCH QSRMAC,GLXMAC,ORNMAC>

;FORM OF OPDEF TO DO INTERNAL

DEFINE GOPDEF (NAM,VAL)<
	OPDEF NAM [<VAL>]
	INTERN NAM>

;FORM OF OPDEF TO DO .NODDT'D INTERNAL

DEFINE GSOPDEF (NAM,VAL)<
	OPDEF NAM [VAL]
	INTERN NAM
	.NODDT NAM>

;USUAL OPDEF'S

GOPDEF CALL,<PUSHJ P,0>
GOPDEF RET,<POPJ P,0>

DEFINE RETSKP <JRST RSKP>

GSOPDEF CALLRET,<JRST>

;HANDY GETAB CALL (TABLE IS PART OF CALL; INDEX IS IN RH OF AC D)

DEFINE GTB (TABLE),<
	CALL [	MOVEI A,TABLE	;;SET UP THE TABLE INDEX
		CALLRET %GTB]	;;DO THE GETAB AND RETURN (+1 ALWAYS)
>
;MACRO TO CONTROL WHETHER "EXTENDED ARCHIVING" FEATURES SHOULD BE
;INCLUDED

IFNDEF XARCSW,<XARCSW==1>
DEFINE XARC<IFN XARCSW,>

;ASSEMBLY SWITCH FOR EXTENDED EXEC FEATURES.

IFNDEF XTNDSW,<XTNDSW==:0>
DEFINE XTND<IFN XTNDSW>
DEFINE NOXTND<IFE XTNDSW>

;ASSEMBLY SWITCH FOR VARIOUS "NEW" FEATURES UNDER TEST

IFNDEF NEWFSW,<NEWFSW==:1>
DEFINE NEWF<IFN NEWFSW>
DEFINE NONEWF<IFE NEWFSW>

;ASSEMBLY SWITCH FOR SED CODE IN EXECED

IFNDEF SEDSW,<SEDSW==:1>
DEFINE SED<IFN SEDSW>
DEFINE NOSED<IFE SEDSW>

;ASSEMBLY SWITCH FOR EMACS CODE IN EXECED

;[7.1092] Set EMCSSW to 1
;[7.1143] Now reset it to 0 

IFNDEF EMCSSW,<EMCSSW==:0>
DEFINE EMCS<IFN EMCSSW>
DEFINE NOEMCS<IFE EMCSSW>

;[7.1004]Remove temporary conditionals for statistics gathering


;HERE IS A MACRO TO GENERATE ALL "GET"ABLE FILESPECS

DEFINE GETSAVE(STRING)<ASCIZ \'STRING'EXE\>

;CONTROL BITS IN TAKBTS TABLE AND TAKCUR.

TKALEF==1B0			;ON MEANS ALLOW ERRORS IN TAKE FILE
TKECOF==1B1			;ON MEANS ECHO TAKE FILE
TKTERF==1B2			;ON MEANS CURRENT TAKE FILE IS A TERMINAL

;HERE ARE THE INTERUPT CHANNEL LEVEL ASSIGNMENTS
;FOR CHANNELS WHICH REFERENCE THE PC IN PCTAB

LV.ILI==1			;ILL INST IS HIGH (PANIC)
LV.POV==1			;PUSHDOWN OVERFLOW IS HIGH
LV.DAT==1			;DATA ERROR IS HIGH (PANIC)
LV.EOF==3			;END OF FILE IS LOW
LV.ESC==2			;ADVISE ESCAPE CHAR IS MEDIUM
LV.QTA==1			;QUOTA EXCEEDED IS HIGH (PANIC)
LV.IPC==2			;IPCF INTERRUPT IS SAME AS ^C
LV.PCL==3			;PCL PTY I/O IS LOW
LV.IJW==3			;INVOKING JFN WATCH IS LOW
LV.TRP==LV.IPC			;JSYS/UUO TRAP (SAME AS ^C LEVEL SO THAT
				;TRPPSI ROUTINE DOESN'T CONTINUE FORK AFTER
				;CCPSI STOPS IT!!)

LV.CED==3			;COMMAND EDITOR IS LOW


CTRLC==3			;SUPER-PANIC PSI CHARACTER
				;AND "TERMINAL CODE" FOR SAME
CTRLO==^D15			;TERMINAL CODE FOR ^O TO FLUSH OUTPUT
CTCODE==^D20			;"TERMINAL CODE" FOR CHARACTER ASSIGNED TO PSI THAT
				;PRINT RUNTIME (^T)

ADVESC==.TICCE			;^E IS ESCAPE FOR ADVICE

BELL==7				;CHARACTER TO RING WHEN ILLEGAL ^A OR ^W INPUT,
				;OR WHEN RECOGNITION AMBIGUITY REQUIRES MORE INPUT
CTRLE==5			;CHARACTER THAT PREFIXES PRIVILEGED COMMANDS
CTRLZ==32			;EOF CHARACTER FOR "COPY" COMMAND WHEN TTY IS SOURCE

;SPECIAL BITS THAT GET PASSED IN AC2 WITH GTJFN BITS TO SPECFN ROUTINE

CF%NS==1B17			;NO SUBCOMMANDS FOLLOW LIST

;WHEN CFN1 IS COERCED INTO QUIETLY STACKING BOGUS FILESPECS, JFNSTK
;GETS BLESSED WITH AN ENTRY LOOKING HAVING AN ADDRESS IN THE LEFT HALF,
;AND FI%ERR IN THE RIGHT HALF.  THE ADDRESS POINTS TO A BLOCK WHICH HAS
;THE ERROR CODE IN WORD .FIERR, AND THE FILESPEC STRING POINTER IN WORD .FISTR

FI%ERR==0,,-2			;VALUE FOR RIGHT HALF OF STACK WORD
.FIERR==0			;ERROR CODE
.FIJFN==1			;FLAGS AND PARSE-ONLY JFN
.FISTR==2			;STRING POINTER
.FILEN==3			;NUMBER OF WORDS NEEDED FOR BLOCK

;CODES TO IDENTIFY COPY-CLASS COMMANDS

CP%COP==0			;COPY
CP%SPE==1			;^ESPEAK
CP%HEL==2			;HELP
CP%TYP==3			;TYPE
CP%APP==4			;APPEND

;NOTE!!!!!!! DO NOT USE CHANNEL 0 IN THE EXEC EVER!!!!!!
;IF YOU DO, YOU WILL GET SPURIOUS INTERRUPTS!!!!!!

IITCHN==32			;CHANNEL FOR MAIL-WATCH & ALERTS
ADVCHN==30			;^E INTERRUPT DURING ADVISE
IPCCHN==31			;COMMUNICATION CHANNEL, CATCHES ALL IPCF MESSAGES
PCLCHI==:33			;PCL Input channel for PCL PTY
PCLCHO==:34			;PCL Output channel for PCL PTY
TRPCHN==35			;JSYS/UUO TRAP CHANNEL
IJWCHN==36			;CHANNEL FOR JFN WATCH INTERRUPTS

CEDCHN==37			;CHANNEL FOR COMMAND EDITOR INTERRUPT CHAR


PDBSIZ==7		;SIZE OF PACKET

;AUTOMATIC LOGOUT PARAMETERS:
;AUTOLOGOUT OCCURS IN TOP-LEVEL EXEC WHEN JOB IS NOT LOGGED IN AND:
;	1) EXEC RETURNS TO COMMAND INPUT AND AT LEAST AUTOLO1 SECONDS
;	   HAVE ELAPSED SINCE EXEC WAS STARTED, OR
;	2) AUTOL2 SECONDS HAVE ELAPSED SINCE STARTUP AND THERE HAS
;	   BEEN NO TELETYPE ACTIVITY FOR AUTOL3 SECONDS.

AUTOL1==^D600
AUTOL2==^D300
AUTOL3==^D15
;****************** SYSTEM DEPENDENT THINGS ********************

;ASCII CHARACTERS - IF ANY ARE CHANGED, MUST ALSO CHANGE "CHRTBL"!

TAB==11				;TAB (^I ON MODEL 33 TTY)
LF==12				;LINE FEED
FORMF==14			;FORM FEED
CR==15				;CARRIAGE RETURN
ALTM==33			;ALT MODE, ESC, ETC KEY

;CALCULATE MAX VALUE FOR RFTAD/SFTAD BLOCK
TADLEN==.RSWRT+1			;START WITH THIS
IFG .RSCRV+1-TADLEN,<TADLEN==.RSCRV+1>	;BUT USE THIS IF LARGER

;WHERE DDT (UDDT) RESIDES

DDTFST==764000			;FIRST LOCATION NEEDED BY DDT
DDTORG==770000			;STARTING LOCATION OF DDT
DDTSYM==DDTORG+1		;LOCATION IN DDT THAT POINTS TO LOC WHERE
				;SYMBOL TABLE POINTER IS STORED ($I-1)

;VALUE TO USE FOR MAX JFN NUMBER (NOT SUPPLIED BY MONSYM AS YET)
MAXJFN==1000			;GOOD ENOUGH FOR TIME BEING

;HIGHEST PAGE NUMBER

HIGHPN==37777
;MNEMONIC AC'S
;CHANGED TO TOPS20 CONVENTIONS 6/10/74 - OLD MNEMONICS SHOWN AS COMMENTS

Z=:0
A=:1
B=:2
C=:3
D=:4
Q1=:5
Q2=:6
Q3=:7
  ;CBT=:7		;DESCRIPTIVE BITS FROM "CHRTBL" FOR LAST CHARACTER
P1=:10
  ;CHR=:10		;INPUT CHARACTER
P2=:11
  ;TRM=:11		;LAST INPUT FIELD TERMINATOR
P3=:12
  ;KWV=:12		;VALUE WORD RETURNED BY LAST KEYWORD TABLE LOOKUP
P4=:13
  ;KWV1=:13		;KWV SAVED AFTER FIRST KEYWORD IN COMMAND
P5=:14
  ;.BFP=:14		;COMMAND BUFFER PTR SAVED AT BEGINNING OF LAST FIELD
  ;DON'T USE AC15.  TRVAR NEEDS IT.
  ;CNT=:15		;NUMBER OF CHARACTERS IN FIELD (REQUIRED BY
			;EDITING STUFF)
CX=:16
  ;DON'T USE 16, STKVAR CLOBBERS IT
P=:17				;STACK

;FIELDS FOR PARTS OF INSTRUCTIONS

OPFLD==777B8			;OPCODE
ACFLD==17B12			;AC
INDFLD==1B13			;INDIRECT BIT
XFLD==17B17			;INDEX REGISTER
YFLD==777777B35			;Y FIELD

;MACROS TO TEST FOR BATCH MODE
DEFINE IFNBATCH(ADDR)
<	SKIPE BATCHF
	JRST ADDR
>

DEFINE IFEBATCH(ADDR)
<	SKIPN BATCHF
	JRST ADDR
>
;MACRO TO INVOKE SAVING OF TEMP AC'S (A-D) AND AUTO RESTORE ON RETURN

DEFINE ATSAVE<
	JSP CX,.SAVT>
;LOAD FLAG MACRO - LOADS FLAGS (OR ANY QUANTITY) INTO AC,
; GENERATING MOVSI, MOVEI, OR MOVE AS APPROPRIATE

DEFINE LDF (AC,FLAG)<	MOVX AC,FLAG
>
;*********** DEFINITIONS THAT ARE INTERNAL TO EXEC ***********

;UUO'S USED IN EXEC. MOST HAVE CALLING MACROS.
;NOTE: UUO DISPATCH TABLE AND DISPATCHER ARE AT BEGINNING OF EXECSU.MAC.
;      UUO ROUTINES ARE IN EXECSU.MAC.
;OTHER UUO'S ARE DEFINED WITH "FIELDS" MACRO, DEFINED ELSEWHERE IN THIS FILE

        OPDEF UERR[20B12]	;%ERR   ERROR MESSAGE
        OPDEF UTYPE[21B12]	;%ETYPE TYPE MESSAGE
	OPDEF KEYWD[22B12]	;%KEYW  KEYWORD INPUT AND LOOKUP
        OPDEF UNOI[23B12]	;%NOI   NOISE WORD INPUT/OUTPUT
	OPDEF UPROMPT[24B12]	;%$TYPE PROMPT FOR NEW LINE
	OPDEF ULERRO[25B12]	;%LERRO TYPE ERROR MESSAGE, BUT RETURN TO CALLER
;26 is available
				;0      AC "TRM" CONTAINS ALT MODE
	OPDEF U$ERR[27B12]      ;%$ERR  ERROR MESSAGE WITHOUT CR FIRST
	OPDEF UETYPE[30B12]	;%ETYPE TYPE MESSAGE AND INTERPRET % CODES
;31 is available
	OPDEF PRINT[32B12]	;%PRINT PRINT ASCII CHARACTER FROM EFF ADDR
	OPDEF UTRAP[33B12]	;%TRAP  ERROR PSI MESSAGE
	OPDEF U.$ERR[34B12]	;%.$ERR ERROR THAT DOESN'T CLEAR BUFFERS (^X)
	OPDEF USUBCO[35B12]	;%SBCOM INPUT AND DISPATCH ON SUBCOMMANDS
%%NUUO==36			;       FIRST UUO VALUE USED BY "FIELDS" MACRO
;MACROS TO CALL UUO'S AND SUBROUTINES
;*** NEED CALL SEQ FOR EACH MACRO ***

DEFINE JWARN<
	ERCAL RJWARN>		;PUT JWARN AFTER JSYS'S THAT SHOULDN'T
				;FAIL, IN ORDER TO ISSUE A WARNING IF
				;THEY DO, BUT TO OTHERWISE TRANSPARENTLY
				;CONTINUE EXECUTION

;MACRO TO INVOKE SUBCOMMANDS.  "INITIALIZATIONROUTINE" IS USED
;TO INVOKE A ROUTINE WHICH DOES INITIALIZATION THAT WANTS TO HAPPEN
;BEFORE EACH SUBCOMMAND.  FOR INSTANCE, THE "BUILD" COMMAND WANTS TO
;CLEAR A FLAG SAYING "NOT" HAS BEEN TYPED.  THEN WHEN "NOT" IS TYPED,
;THE FLAG IS SET FOR THAT SUBCOMMAND, BUT WANTS TO BE CLEARED FOR THE
;NEXT SUBCOMMAND.

DEFINE SUBCOM (TABLENAME,INITIALIZATIONROUTINE)
<	IFB <INITIALIZATIONROUTINE>,<
		USUBCO [	TABLENAME
				0]>
	IFNB <INITIALIZATIONROUTINE>,<
		USUBCO [	TABLENAME
				INITIALIZATIONROUTINE]>
>

DEFINE ERROR (TEXT)<
       UERR [ASCIZ @TEXT@]>

DEFINE LERROR (TEXT)<
	ULERRO [ASCIZ @TEXT@]>	;;LIKE "ERROR", BUT RETURN TO CALLER

DEFINE $ERROR (TEXT)<
	U$ERR [ASCIZ @TEXT@]>

DEFINE .$ERROR (TEXT)<
	U.$ERR [ASCIZ @TEXT@]>

DEFINE TYPE (TEXT)<
       UTYPE [ASCIZ TEXT]>

DEFINE PROMPT (TEXT)<
	UPROMPT [ASCIZ @TEXT@]>

DEFINE ETYPE (TEXT)<
	UETYPE [ASCIZ TEXT]>	;USE ^V AS QUOTING CHARACTER SINCE ANY OTHER MAY BE IN STRING!

DEFINE NOISE (TEXT)<
	UNOI [ASCIZ @TEXT@]>

DEFINE CONFIRM<
       CALL CONF>

DEFINE ALTYPE (TEXT)<
	UALTYP [ASCIZ @TEXT@]>

DEFINE TRAP (LEVEL,TEXT)<
	UTRAP [	LEVEL
		ASCIZ @TEXT@]>

;MACROS FOR INPUTTING FIELDS.  CALL IT LIKE THIS:

;	FOO'X <BAR>
;	ERROR RETURN (FIELD TYPED WASN'T KIND REQUESTED (TRY ANOTHER!)
;	SUCCESS RETURN, FIELD FLAVOR CORRECT

;WHERE "FOO" IS THE TYPE OF FIELD, AND "BAR" IS THE HELP MESSAGE.
;FOR INSTANCE:

;	DECX <NUMBER OF GENERATIONS TO KEEP>

;INPUTS A DECIMAL NUMBER, TYPING "NUMBER OF GENERATIONS TO KEEP" IN
;RESPONSE TO "?".

DEFINE XX (NAME)
<
OPDEF U'NAME [<%%NUUO>B12]
%%NUUO==%%NUUO+1
DEFINE NAME'X(HELP)
<	IFNB <HELP>,<	U'NAME [ASCIZ \HELP\]
>
	IFB <HELP>,<	U'NAME [0]	;;USE DEFAULT
>
>
>
DEFINE ULIST
<
XX SLASH	;;SLASH
XX BSLSH	;;BACKSLASH
XX DASH		;;HYPHEN
XX FILE		;;FILESPEC
XX CTRLE	;;CONTROL-E
XX DEC		;;DECIMAL NUMBER
XX CRR		;;END OF LINE
XX STAR		;;ASTERISK
XX WORD		;;WORD
XX DT		;;DATE AND/OR TIME
XX HELP		;;SET UP HELP STRING
XX OCT		;;OCTAL NUMBER
XX STR		;;STRUCTURE NAME
XX DEV		;;DEVICE
XX CMERR	;;COMMAND ERROR
XX DEF		;;SET DEFAULT STRING
XX USER		;;USER NAME
XX USERS	;;USER NAMES ALLOWING STARS
XX DIR		;;DIRECTORY NAME
XX DIRS		;;DIRECTORY NAMES ALLOWING STARS
XX COMMA	;;READ A COMMA
XX LINE		;;INPUT ENTIRE REST OF LINE
XX DOT		;;DOT, PERIOD, "." YOU GOT IT
XX TIME		;;TIME OF DAY (OR AMOUNT OF TIME)
XX COLON	;;COLON
XX DEXT		;;SET UP JFN BLOCK WITH DEFAULT EXTENSION
XX CHAR		;;PARSE ARBITRARY CHARACTER, PASSED IN AC1
XX QUOTE	;;QUOTED STRING
XX ACCT		;;ACCOUNT
XX DTIV		;;DATE AND TIME OR TIME OR DATE OR INTERVAL IN DAYS
XX FNODE	;;FAKE NODE, I.E. SYNTACTICALLY CORRECT ONLY
XX RNODE	;;REAL NODE, I.E. ONE THAT'S CURRENTLY KNOWN BY SYSTEM
XX DTP		;;DATE AND TIME IN THE PAST, LIKE "DIR SINCE MONDAY"
XX DTR		;;DATE AND TIME RELATIVE TO NOW.
XX ADDR		;;SYMBOLIC ADDRESS
>
ULIST

;Bits returned in AC1 by time-and-date parses.  These bits denote what the
;user really typed.  For instance, on May 5, the input "5-may-80 2:3" and
; "2:3" will yield identical internal format results in AC2.  Only by
;examining the bits in AC1 will the caller be able to tell the difference.

	DATBIT==1B0		;USER TYPED A DATE

; THE FOLLOWING SIMULATE UNIMPLEMENTED JSYS'S

;HYPOTHETICAL FUTURE JSYS TO STOP NON-INTERACTIVE JOB

DEFINE BTCHER <>
;***************************************************************************
;Here for convenience is a description of the various functions which
;can be invoked via the UUOs above.  This was all lifted directly
;out of SUBRS (EXECSU).
;****************************************************************************

; KEYW

;TO DO TABLE LOOKUP OF NEXT FIELD OF COMMAND, DO:
;
;	HELPX <THIS IS WHAT "?" TYPES OUT>
;	KEYWD TABLE		;"TABLE" IS ADDRESS OF TABLE
;	T FOO...		;APPROPRIATE "T" MACRO FORM OF DEFAULT VALUE
;	 ERROR RETURN
;	SUCCESS RETURN		;P3 HAS VALUE FROM TABLE
;				;B HAS TABLE ENTRY ADDRESS

; SUBCOM

;USUBCO UUO, INVOKED BY SUBCOM MACRO
;INPUT AND DISPATCH ON SUBCOMMANDS, USING TABLE EFFECTIVE ADDR POINTS TO
;TERMINATES ON NULL SUBCOMMAND OR ONE WITH 0 DISPATCH ADDRESS
;USES INCLUDE DIRECTORY, COPY, PRINT, CREATE, TYPE/LIST

; TYPE

;ROUTINE INVOKED BY "$TYPE <FOO>" MACRO.  IT STARTS A NEW LINE
;PART OF THE COMMAND, WITH THE PROMPT BEING "FOO".

; PRINT

;UUO TO OUTPUT SINGLE ASCII CHARACTER FROM EFFECTIVE ADDRESS

; GTB

;%GTB
;UUO TO DO A "GETAB" JSYS WITH A REASONABLE CALLING SEQUENCE.
;TABLE # IN C(Q1), INDEX IN RH OF D, ONE RETURN WITH WORD IN A.
;TYPICAL USAGE: LH D CONTAINS AOBJN COUNTER, B AND C ARE FREE
;	FOR USE IN OTHER JSYS CALLS INSIDE LOOP.

; LERROR

;ERROR UUO HANDLER. MESSAGE TEXT AT EFFECTIVE ADDRESS.
;SERVICES UUO'S UERR, U$ERR, U.$ERR (MACROS ERROR, $ERROR AND .$ERROR)

;USE "LERROR <TEXT>" TO PRINT ERROR MESSAGE AND RETURN.  SAME AS
;"ERROR <TEXT>" EXCEPT LATTER DOESN'T RETURN TO CALLER.

; ETYPE

;%ETYPE (ETYPE MACRO, UETYPE UUO)
;HANDLER FOR UUO THAT TYPES MESSAGE, INTERPRETING % CODES.
;SPECIAL CODES ARE OF FORM %NL%
;	WHERE N IS AN OPTIONAL OCTAL NUMBER SPECIFYING AN AC
;	      L IS A LETTER:
;		D: TYPE CURRENT DATE
;		J: TYPE TSS JOB #
;		O: TYPE CONTENTS OF INDICATED AC IN OCTAL
;		SEE DISPATCH TABLE %LETS ON NEXT PAGE FOR FULL LIST.

;DISPATCH TABLE FOR LETTERS AFTER %
;KEEP THIS TABLE IN ASCII ASCENDING ORDER SO IT REMAINS EASY TO SEE IF A
;CHARACTER IS IMPLEMENTED OR NOT
;(NOTE THAT EXEC DOESN'T ASSUME TABLE IS ORDERED THOUGH)

;	"#",,%NUMS		;OCTAL NUMBER AS N OR N,,N AS APPROPRIATE
;	"%",,%PER		;%% JUST PRINTS A PERCENT
;	"=",,%FLT		;SIX-COLUMN FLOATING POINT NUMBER, NN.MM
;	"@",,%LM		;GET TO LEFT MARGIN
;	"A",,%A			;CURRENT TIME
;	"B",,%B			;CPU TIME AS HH:MM:SS, OR SPECIFIC TIME IN MILLISECONDS
;	"C",,%C			;CONNECT TIME
;	"D",,%D			;CURRENT DATE(OR SPECIFIC DATE)
;	"E",,%E			;SAME TIME AS LAST %D(OR SPECIFIC TIME)
;	"F",,%F			;"FORK N " IF >1 INFERIOR
;	"G",,%G			;CONNECTED DIR NAME
;	"H",,%H			;DEVICE NAME FOR DESIGNATOR IN INDICATED AC
;	"I",,%I			;PRINT # OF USER JOBS + # OF OPR JOBS
;	"J",,%J			;TSS JOB #
;	"K",,%K			;UPTIME
;	"L",,%L			;"LINE N" OR "DETACHED"
;	"M",,%M			;NUMBER OR STRING (5B0+N OR BYTE POINTER)
;	"N",,%N			;NAME UNDER WHICH USER IS LOGGED IN (OR SPECIFIC USER NAME)
;	"O",,%O			;CONTENTS OF SPECIFIED AC IN OCTAL
;	"P",,%P			;CONTENTS OF RIGHT HALF OF SPECIFIED AC IN OCTAL
;	"Q",,%Q			;CONTENTS OF AC IN DECIMAL OR FLOATING!
;	"R",,%R			;DIRECTORY NAME FOR DIR # OR STRING POINTER IN AC
;	"S",,%S			;FILE NAME FOR JFN IN AC
;	"T",,%T			;CONTENTS OF AC AS PERCENTAGE OF UP TIME
;	"U",,%U			;DECIMAL BIT NUMBERS, separatED BY COMMAS
;	"V",,%V			;CPU TIME WITH TENTHS OF SECONDS (FORK HANDLE IN AC IF NOT 0)
;	"W",,%W			;STD FORMAT DATE AND TIME IN AC
;	"X",,%X			;TYPE ILLEG INST ERROR MSG
;	"Y",,%Y			;MEMORY ADDRESS
;	"\",,%STRNG		;TYPE STRING OR CHAR IN AC
;	"/",,%EXPR		;EXPRESSION IN AC
;	"'",,%SIX		;PRINT CONTENTS OF AC IN SIXBIT
;	"_",,%EOL		;TYPE A CRLF
;	"?",,%SYSMS		;ERROR MESSAGE (CONTENTS OF AC OR LATEST)
;COMMAND TABLE MACROS

;AN ENTRY
;ALSO USED FOR DEFAULT INFORMATION AFTER "KEYWD" MACRO

DEFINE T (TEXT,BITS,ADDR,CONBTS<0>)<
	..BITS==0
	IFNB <BITS>,<..BITS==BITS>
	IFB <ADDR>,<$FOO==.'TEXT>
        IFNB <ADDR>,<$FOO==ADDR>
IFE CONBTS,<XWD [ASCIZ @TEXT@],[..BITS!$FOO]>
IFN CONBTS,<XWD [CONBTS!CM%FW
		ASCIZ @TEXT@],[..BITS!$FOO]>
>
;SWITCH WITH COLON AFTER IT

DEFINE TV (TEXT,BITS,ADDR,CONBTS)<
IFB <ADDR>,	T <TEXT':>,BITS,.'TEXT,CONBTS

IFNB <ADDR>,	T <TEXT':>,BITS,ADDR,CONBTS
>
;INVISIBLE TABLE ENTRIES.  HEY, DON'T CHANGE THIS NAME BECAUSE MACRO
;IN EXECQU.MAC ASSUMES THIS MACRO'S NAME BEGINS WITH "I".  E.O. 3/30/77

DEFINE IT (TEXT,BITS,ADDR,CONBTS<0>)<
	T <TEXT>,BITS,ADDR,CONBTS!CM%INV>

DEFINE ITV (TEXT,BITS,ADDR,CONBTS<0>)<
	TV <TEXT>,BITS,ADDR,CONBTS!CM%INV>

;MACRO FOR DEFINING ABBREVIATIONS IN TABLES

DEFINE TA (TEXT,ADDR)<
IFNB <ADDR>,<%%X==ADDR>
IFB <ADDR>,<%%X==.'TEXT>
	[	CM%INV!CM%ABR!CM%FW
		ASCIZ /TEXT/],,%%X
>
;BEGIN TABLE.
;FIRST WORD MUST BE NUMBER OF ENTRIES

DEFINE TABLE<
	Z			;FILLED IN BY NEXT TEND
	..T==.			;USED BY NEXT TEND>

;END TABLE

DEFINE TEND<
       ..U==.
        RELOC ..T-1
	..U-..T,,..U-..T	;FILL IN FIRST WORD OF TABLE
        RELOC ..U>
;AREA SIZES

PDL==1000			;PUSHDOWN
GTDLN==1+.CDFPA			;[4412] Leave room for GTDIR% information
UGBUFL==^D41			;ALLOW UP TO 40 USER GROUP ENTRIES
DGBUFL==UGBUFL			;SAME FOR DIRECTORY GROUPS
SGBUFL==UGBUFL			;SAME FOR ALLOWABLE SUBDIRECTORY USER GROUPS
RNAUFL==^D200			;ROOM FOR REMOTE ALIASES
RNASIZ==6			;SIZE OF REMOTE ALIAS SUBBLOCK
SYSTAL==^D40			;SYSTAT ARG STORAGE, ENOUGH FOR 20 JOBS
				;STORAGE FOR TELL COMMAND ALSO

SWISIZ==8			;WORDS NEEDED TO HOLD LONGEST SWITCH
DCSSIZ==<SWISIZ*8>/5		;ALLOW 8 SWITCHES PER EXTENSION
NEXTS==20			;NUMBER OF EXTENSIONS TO ALLOW DEFAULTS FOR
NODSIZ==6			;NUMBER OF CHARACTERS IN NODE NAME

;MAXIMUM CHARS ALLOWED IN FILESPEC FIELD (*2 FOR QUOTING OF FUNNY CHARACTERS)

FFSIZ==2*^D39

;WORDS TO HOLD LONGEST FILESPEC FIELD PLUS NULL (*2 BECAUSE OF ^V'S)

EXTSIZ==<FFSIZ+1>/5+1

;NUMBER OF CHARACTERS IN LONGEST FILESPEC

FILCRS==NODSIZ+2+FFSIZ+1+1+FFSIZ+1+FFSIZ+1+FFSIZ+1+6+40+1
;        BAR   :: FOO   : <  DIR  >  NAME . EXT   . 1 (40 FOR RANDOM ATTRIBUTES)

FILWDS==FILCRS/5+1		;WORDS TO HOLD FILESPEC

BITMLN==1000/44 + 1		;WORDS NEEDED FOR 1000-BIT BIT MASK

QSLEN==200			;ARG STACK SIZE FOR QUEUE-CLASS COMMANDS
PRLEN==100			;MAXIMUM LENGTH PRARG EXPECTED FROM PROGS
NMARGS==100			;NUMBER OF MOUNT ARGS TO ALLOW
SSSLEN==3			;BLOCK SIZE FOR "SET STRUCTURE STATUS"
GSSLEN==6			;LENGTH OF DATA RETURNED BY MONITOR FOR "INFO STRUCTURE"
TAKLNX==8			;NUMBER OF NESTED COMMAND STREAMS WE CAN HANDLE
CBUFL==^D1000			;COMMAND BUFFER LENGTH. DETERMINES LENGTH OF COMMAND.
				;THIS SHOULD BE LARGE, SINCE IDIRECT FILES MAY
				;(AND SHOULD!!!!) BE WELL-COMMENTED

CETBLN==^D190			;LENGTH OF WORK COMMAND BUFFER
CEKBLN==CETBLN/2		;KILL AND PUT BUFFERS HALF SIZE 
CESBLN==^D300			;LENGTH OF COMMAND BUFFER

HSTMAX==^D25			;MAXIMUM COMMAND MEMORY (COMMAND EDITOR)

ATMLEN==^D500			;MAXIMUM SIZE FOR ONE FIELD
JBLEN==17			;[3033] JFN BLOCK SIZE
LCWBUF==^D8			;KEY WORD BUFFER
JBUFL==100			;JFN BUFFER LENGTH: ONE MORE THAN # JFNS IN A CMD.

NALTS==^D50			;MAX NUMBER OF ALERTS ALOWED (IF WE FIND THAT
				;WE WANT TO UP THIS NUMBER A WHOLE LOT, WE SHOULD
				;PROBABLY RECODE THE EXEC TO USE FREE SPACE
				;TO HOLD THE ALERT TABLE RATHER THAN STATIC
				;SPACE.)
NMWAT==^D5			;MAX NUMBER OF USERS FOR MAIL WATCH

;STRUCTURE OF PROGRAM STATE BLOCK

	TTWMOD==0		;TERMINAL MODE WORD
	TTWCOC==1		;CONTROL CHAR MODES (2 WORDS)
	TTWJTI==3		;JOB TERMINAL INTERRUPT WORD
	TTWSNM==4		;SUBSYSTEM NAME
	TTWPNM==5		;PROGRAM NAME
	TTWMSK==6		;BREAK MASK SAVE (5 WORDS)
	TTWFWT==13		;FIELD WIDTH SAVE
NTTYMD==14			;NUMBER OF WORDS
;FRKNMS is a TBLUK table, with each entry looking like this:
;
;		saddr,,faddr
;
;Saddr is an address in free space holding a fork name:
;
;		saddr/	ASCIZ -name-
;
;Faddr is the address of the fork block for that name, also in free space,
;with the following offsets defined:

DEFSTR (FKFLAG,0,35,36)		;FULL WORD OF FLAGS.  THE FOLLOWING ARE DEFINED:

	FN%NAT==1B0		;NAME HAS ATTRIBUTES, BUT NEVER FLUSH THEM
	FN%KEP==1B1		;KEEP FORK HAVING THIS NAME
	FN%EPH==1B2		;FORK BY THIS NAME IS EPHEMERAL
	FN%NEF==1B3		;DON'T ACKNOWLEDGE "SET FILE EPHEMERAL"
	FN%FOP==1B4		;TRAP FILE-OPENINGS
	FN%ATT==1B5		;NAME HAS ATTRIBUTES, BUT CAN BE FLUSHED

DEFSTR (FKHAN,1,35,36)		;0 OR FORK HANDLE OF REAL FORK HAVING THIS NAME
DEFSTR (FKRADD,2,35,36)		;WHERE TO GO TO RESTART KEPT FORK OF THIS NAME
DEFSTR (FKRMES,3,35,36)		;POINTER TO MESSAGE TO TYPE WHEN RESTARTING
DEFSTR (FKRESP,4,35,36)		;POINTER TO TEXT SAYING HOW TO RESTART

	FKTLEN==5		;NUMBER OF DEFINED WORDS IN FORK BLOCK

;FORK STATE BLOCK DEFINITIONS (DIFFERENT BLOCK THAN NAME FORK BLOCK ABOVE)

NFRKS==^D24			;MAYBE ENUF FOR NOW

FK%KPT==1B0			;KEPT FORK
FK%DBG==1B1			;DEBUGGER FORK
FK%RUN==1B2			;FORK HAS BEEN RUN
;BIT 3 AVAILABLE
FK%EDF==1B4			;EXAMINE/DEPOSIT FLAG
FK%NAM==1B5			;FORK HAS NAME
FK%BKG==1B6			;BACKGROUND FORK
FK%TTY==1B7			;BACKGROUND FORK BLOCKED FOR TTY
FK%INT==1B8			;INTERRUPTED (INVOLUNTARY TERMINATION)
FK%PRI==1B9			;PRIMARY INPUT RE-ASSIGNED
FK%PRO==1B10			;PRIMARY OUTPUT RE-ASSIGNED
FK%INV==1B11			;[PCL] Fork being INVOKE'd by PCL

;OFFSETS IN FRKTBL

.FKOWN==0			;OWNER HANDLE,,
.FKEDL==1			;EXAMINE/DEPOSIT LAST LOC
.FKPTM==2			;PROGRAM/TTY MODES
.FKNAM==.FKPTM+NTTYMD+1		;NAME POINTER TO FREE SPACE
	.FKSZE==.FKNAM+1	;ENTRY SIZE

;SPECIAL RFSTS CODE (UNDEFINED IN MONSYM)

.RFTTY==10			;FORK BLOCKED FOR TTY I/O

;SPECIAL FDB CODES IN FB%FCF (NOT YET DEFINED IN MONSYM)

.FBEPH==4			;EPHEMERAL
;BITS...

;BITS IN LEFT HALF OF VALUE WORD IN KEYWORD TABLES

WHLU==1B13			;DON'T RECOGNIZE KEYWORD IF USER LACKS WHEEL PRIV
OPRU==1B12			; " " " " " " " OPERATOR PRIVILEGE
ERRU==1B11			; " " " " " " " CONFIDENTIAL INFORMATION ACCESS PRIV
;BITS IN LH VALUE WORD IN KEYWORD TABLES...

;THE REST OF THE BITS ARE NOT TESTED BY %KEYW.
;THIS NEXT GROUP ARE USED IN THE MAIN COMMAND TABLES, AND ARE
; MOVED TO AC "KWV1" AFTER FIRST KEYWORD IS INPUT, AND
; STAY IN KWV1 THROUGHOUT COMMAND DECODING.
;SEVERAL ALSO USED IN SUBCOMMAND TABLES
;SUBROUTINE "CONF" LOOKS AT SEVERAL OF THESE.

ONEWRD==1B0			;ONE WORD COMMAND: CONFIRM BEFORE DISPATCH,
				; "EOLOK" BIT IMPLIED
NOSAVE==1B2			;DON'T SAVE THIS COMMAND FOR THE COMMAND EDITOR

NOLG==1B4			;THIS COMMAND LEGAL EVEN IF NOT LOGGED IN
				;ALSO B5 USED IN "CREATE" SUBCOMMAND TABLE
EASB==1B6			;THIS COMMAND EXAMINES, ALTERS, OR EXECUTES SUBSIDIARY
				; FORK, AND IS THUS ILLEGAL IF A PROPRIETARY
				; PROGRAM IS IN THAT FORK.

;THE FOLLOWING ARE SOME OF THE OTHER BITS USED IN VARIOUS OTHER TABLES.
;DO NOT REDEFINE THESE BITS OR THOSE IN GROUP INTERPRETED BY
; "%KEYW" IN SUCH A WAY AS TO PRODUCE A CONFLICT!
;B5 ALSO USED IN "CREATE" SUBCOMMAND TABLE (5/14/70).
;BITS...
;FLAG BITS IN AC Z LEFT HALF
;THESE FLAGS ARE CLEARED BEFORE EACH COMMAND IS DECODED

IGINV==1			;ALLOW GTJFN TO FIND INVISIBLE FILES
SETDEF==2			;FLAG FOR SETTING DEFAULT
NECHOF==40,,0			;ECHOING OFF (PASSWORD INPUT). TESTED IN %NOI.
RUNF==100			;PROG RUNNING (OR AT LEAST ITS TTY MODES IN EFFECT)
				;ALSO TELLS ^C TO FREEZE THE WORLD (5/20/70).
CTLCF1==200			;SET BY ^C TO SAY CLEAR BUFFER ON ANOTHER ^C
CTLCF2==400			;SET BY 2ND ^C TO SAY CLEAR BUFFER AFTER DEBREAK
LOGOFF==1000			;SET DURING LOGOUT MESSAGE AND LOGGING OUT PROCESS.
				;TELLS ERRORS AND ^C TO SAY "NOT LOGGED OUT".
DTACHF==2000			;INDICATES "DETACH" COMMAND.
				;DISTINGUISHES IT FROM "REDIRECT" AND OTHER COMMANDS
				;DURING EXECUTION.
F5==4000			;USED BY DIRNAM/USRNAM ROUTINES TO ALLOW STARS
GROUPF==10000			;ON IF INFG ETC INPUT A GROUP OF INPUT FILE NAMES
				;(A NAME WITH AN *, OR MORE THAN ONE NAME)
F4==20000			;FLAG AVAILABLE FOR USE IN COMMANDS,
				;NOT CLOBBERED BY UUO'S OR SUBROUTINES.
F3==40000			;ANOTHER FLAG AVAILABLE FOR USE IN COMMANDS
F2==100000			;ANOTHER FLAG AVAILABLE FOR USE IN COMMANDS
F1==200000			;FLAG AVAILABLE FOR LOCAL USE IN SUBRS AND UUO'S
F6==400000			;USED BY DIRNAM, MEANS "RETURN IF AMBIGUOUS"

;[7.1178] Add new flags (now used by DELETE subcommands)

F7==1000			;[7.1178] Another flag available for use in commands
F8==2000			;[7.1178] Another flag available for use in commands
F9==200				;[7.1178] Another flag available for use in commands
F10==400			;[7.1178] Another flag available for use in commands

 
;FLAG BITS IN AC Z RIGHT HALF ARE ALSO AVAILABLE TO COMMAND ROUTINES.

;PCL Bits in PCL flag word

PCFTRC==1B0			;TRACE GENERATED COMMANDS
PCFQDC==1B1			;DON'T CONFIRM DECLARATIONS AS A GENERAL POLICY
PCFCFM==1B2			;CONFIRM THE CURRENT DECLARATIONS
;DEFINITIONS FOR NEW COMMAND SCANNER

LFSPC==^D26			;LENGTH OF FILE SPEC BLOCK
TBLKSZ==CBUFL			;SIZE OF COMMAND BLOCK

; FOR "INFO CLUSTER" (CNFIG%)
CFGSIZ==^D50			;SIZE OF ARG BLOCK


;COMND - FUNCTION CODES

CMKEY==<.CMKEY>B8		;KEYWORD
CMNUM==<.CMNUM>B8		;NUMBER
CMNOI==<.CMNOI>B8		;NOISE WORD
CMSWI==<.CMSWI>B8		;SWITCH
CMIFI==<.CMIFI>B8		;INPUT FILE
CMOFI==<.CMOFI>B8		;OUTPUT FILE
CMFIL==<.CMFIL>B8		;GENERAL FILESPEC
CMFLD==<.CMFLD>B8		;ARBITRARY FIELD
CMCFM==<.CMCFM>B8		;CONFIRM
CMDIR==<.CMDIR>B8		;DIRECTORY NAME
CMUSR==<.CMUSR>B8		;USER NAME
CMCMA==<.CMCMA>B8		;COMMA
CMINI==<.CMINI>B8		;INIT LINE
CMFLT==<.CMFLT>B8		;FLOATING POINT NUMBER
CMDEV==<.CMDEV>B8		;DEVICE NAME
CMTXT==<.CMTXT>B8		;TEXT TO ACTION CHAR
CMTAD==<.CMTAD>B8		;TIME AND DATE
CMQST==<.CMQST>B8		;QUOTED STRING
CMUQS==<.CMUQS>B8		;UNQUOTED STRING
CMTOK==<.CMTOK>B8		;TOKEN
CMNUX==<.CMNUX>B8		;NUMBER DELIMITED BY NON-DIGIT
CMACT==<.CMACT>B8		;ACCOUNT
CMNOD==<.CMNOD>B8		;NODE

;COMND JSYS OFFSETS INTO FUNCTION BLOCK AND STATE BLOCK

DEFINE CMFLG <.CMFLG+SBLOCK>	;USER FLAGS,,REPARSE DISPATCH ADDRESS
DEFINE CMIOJ <.CMIOJ+SBLOCK>	;INJFN,,OUTJFN
DEFINE CMRTY <.CMRTY+SBLOCK>	;^R BUFFER POINTER
DEFINE CMBFP <.CMBFP+SBLOCK>	;PTR TO TOP OF BUFFER
DEFINE CMPTR <.CMPTR+SBLOCK>	;PTR TO NEXT INPUT TO BE PARSED
DEFINE CMCNT <.CMCNT+SBLOCK>	;COUNT OF SPACE LEFT IN BUFFER AFTER PTR
DEFINE CMINC <.CMINC+SBLOCK>	;COUNT OF CHARACTERS FOLLOWING PTR
DEFINE CMABP <.CMABP+SBLOCK>	;ATOM BUFFER POINTER
DEFINE CMABC <.CMABC+SBLOCK>	;ATOM BUFFER SIZE
DEFINE CMGJB <.CMGJB+SBLOCK>	;ADR OF GTJFN ARG BLOCK
DEFINE CMFNP <.CMFNP+FBLOCK>	;FUNCTION AND POINTER
DEFINE CMDAT <.CMDAT+FBLOCK>	;DATA FOR FUNCTION
DEFINE CMHLP <.CMHLP+FBLOCK>	;HELP TEXT POINTER
DEFINE CMDEF <.CMDEF+FBLOCK>	;DEFAULT STRING POINTER
DEFINE CMBRK <.CMBRK+FBLOCK>	;BREAK MASK

FBLLEN==10			;MAXIMUM SIZE NEEDED FOR COMND FUNCTION BLOCK

SBLKLN==20			;SIZE OF COMMAND STATE BLOCK

GSSLEN==6			;SIZE OF BLOCK FOR RECEIVING STRUCTURE STATUS
SSSLEN==3			;SIZE OF BLOCK FOR SETTING STRUCTURE STATUS

;ORGANIZATION OF QUEUED MOUNT BLOCK

MLNK==0			;POINTER TO NEXT BLOCK OR 0 IF THIS IS LAST BLOCK
MQID==1			;QUASAR ID FOR THIS REQUEST
MLOG==2			;POINTER TO LOGICAL NAME (IN PERMANENT FREE SPACE)
MLEN==3			;SIZE OF BLOCK

STRSIZ==CBUFL		;STRING STORAGE SPACE (MUST BE AS LONG AS COMMAND BUFFER BECAUSE USER TYPEIN IS BUFFERED WITHOUT LENGTH CHECK)

;PAGE BUFFERS

DEFINE DEFPAG (ADRNAM,PNNAM,NPAGES)
;	EXAMPLE:	DEFPAG (FOO,FOOPN,8)
;		ADRNAM==FOO	CALL THE ADDRESS FOO, EG. FOO==600000
;		PNNAM==FOOPN	CALL THE PAGE NUMBER FOOPN, EG. FOOPN==600
;		NPAGES==8	ALLOCATE 8 PAGES, EG. BLOCK 8000

<	ADRNAM==:PPTR		;PCL ALLOCATE THIS PAGE AT CURRENT PAGE POINTER
	PNNAM==PPTR_-9	;DEFINE PAGE NUMBER
	PPTR==PPTR+NPAGES*1000	;STEP TO NEXT PAGE SLOT
	IFG PPTR-DDTFST,<PRINTX ?Exec page buffers overlapping DDT
>>

PPTR==400000			;FIRST ADDRESS TO USE FOR PAGE BUFFERS

;[7.1061]
;FOR REMOTE PRINTING - CHANGEABLE BY USER IF S/HE RE-BUILDS EXEC
;250 SHOULD BE MORE THAN ENOUGH, HOWEVER

CTBLEN==^D250			;[7.1061]CHRACTERISTICS TABLE MAX LENGTH
PTBLEN==^D250			;[7.1061]REMOTE-PRINTER TABLE MAX LENGTH

CHRNUM==^D127			;[7.1061]MAX BIT NUMBER FOR CHARACTERISTICS

CHRCHR==^D14			;[7.1061]NUMBER OF ALLOWED CHARACTERS IN
				;[7.1061]CHARACTERISTICS NAME
PTRCHR==^D31			;[7.1061]NUMBER OF ALLOWED CHARACTERS IN
				;[7.1061]REMOTE PRINTER (QUEUE) NAME
CHARAC==^D7			;[7.1061]NUMBER OF WORDS OF FREESPACE TO
				;[7.1061]GET TO STORE CHARACTERISTICs (4 WORDS
				;[7.1061] FOR BIT-MASK; 3 WORDS FOR NAME STRING)
;PCL Programmable Command Language areas

PCTXLN==:40			;TEXT AREA LENGTH
DEFPAG (PCTEXT,PCTXTP,PCTXLN)	;TEXT AREA
PCGBLN==:10			;GLOBAL SYMBOL TABLE LENGTH
DEFPAG (PCGBST,PCGBSP,PCGBLN)	;GLOBAL SYMBOL TABLE
PCSTKL==:10			;EXECUTION STACK LENGTH
DEFPAG (PCSTAK,PCSTKP,PCSTKL)	;EXECUTION STACK
PCSTRL==:40			;STRING SPACE
DEFPAG (PCSTRS,PCSTRP,PCSTRL)

IPCMAX==8			;NUMBER OF IPCF MESSAGES TO BUFFER

DEFPAG (IPCBUF,IPCBPN,IPCMAX)	;IPCF BUFFERS
DEFPAG (IPCOVR,IPCOPN,1)	;OVERFLOW BUFFER FOR IPCF

DEFPAG (STBUF,STBPN,1)		;STATISTICS BUFFER
STA.RN==^D97			;RECORD NUMBER - PRIME
STA%SS==777			;SAMPLE SIZE WORD
STA%NG==776			;NO GOOD WORD
STA%FL==775			;FILE SPEC WORD
STA%FK==774			;KEPT FORK WORD

STA%FD==500			;FIRST "DATA" LOCATION NOT ASSOCIATED WITH CMD


;SET JFN-WATCH PAGES

DEFPAG (XRMPAG,XRMPPN,2)	;DEFINE 2 PAGES FOR XRMAP ARG BLOCK
JWPAGL==:^D31			;NUMBER OF SLOTS IN THE JWPAG

;BELOW HERE TILL BUFL GETS CLEARED ON ERRORS

NSMPGS==10			;NUMBER OF PAGES FOR SYMBOL WINDOW
XFREPZ==10+NSMPGS		;NUMBER OF PAGES FOR PERMANENT FREE SPACE
XFRESZ==XFREPZ_9		;WORDS OF PERMANENT FREE SPACE
DEFPAG (XFREE,XFREPN,XFREPZ)	;PERMANENT FREE SPACE

FREPZ==70			;NUMBER OF PAGES OF FREE SPACE (RELEASED AFTER EACH COMMAND)
FRESIZ==FREPZ_9			;SIZE OF FREE SPACE
DEFPAG (FREE,FREEPN,FREPZ)	;COMMAND USAGE FREE SPACE

DEFPAG (BUF0,BUF0PN,1)		;ASSUMED TO FOLLOW FREE, SEE UNMAP
IPCFP==BUF0			;PAGE FOR IPCF SEND/RCV
RLIST==BUF0			;USE BUFFER PAGE TO STORE LIST OF NUMBERS
WLDPAG==BUF0			;[7.1152] Used for SYS US* to hold strings

DEFPAG (BUF1,BUF1PN,1)		;"COPY" COMMAND SOURCE PAGE

;ALSO BUF1 AND FOLLOWING PAGES ARE USED BY "DIRECTORY"

DEFPAG (BUF2,BUF2PN,1)		;"COPY" COMMAND DESTINATION PAGE

;PAGES USED BY "COPY" COMMAND FOR PREFAULTING IN DISK PAGES.
;THESE ARE ONLY FOR COPYING DISK TO NON-DISK

NPRE==8				;NUMBER OF PAGES TO PREFAULT DURING "COPY" COMMAND
DEFPAG (BUFPRE,BUFPPN,NPRE)	;PREFAULT BUFFER
BUF3==BUFPRE

;END OF BUFFERS USED FOR DIR, ETC.

;SET JFN-WATCH EXEC-PAGES

JWEPGS==XFREPN			;1ST PAGE TO START CHECKING
JWEPGE==BUFL_-^D9    		;LAST PAGE TO CHECK

BUFL=<DDTFST-1000>&777000	;PAGE BEFORE DDT
BUFEND==BUFL+777		;LAST WORD OF BUFFER SPACE

;CRJOB/PRARG BLOCK DEFINITION:

.CJPLN==0			;LENGTH OF PRARG BLOCK
.CJPHD==1			;HEADER WORD (SEE BELOW)
.CJPLP==2			;POINTER TO FLAG WORD
.CJPKP==3			;POINTER TO FORK HANDLE,,SFRKV OFFSET

;CURRENT CRJOB/PRARG BLOCK IS AS FOLLOWS:

;.CJPLN[ 3			;3 ARGUMENTS
;.CJPHD[ 1B0+3B6+2B12+CR%PRA	;IDENT FOR EXEC (PRARG IS FROM CRJOB)
;.CJPLP[ 1B0+4			;POINTER TO FLAGS
;.CJPKP[ 1B0+5			;POINTER TO FORK HANDLE,,SFRKV OFFSET
;4[	 Flags
;	B0 - Suppress the EXEC herald
;	B1 - There is a fork handle pointed at by arg ptr 3
;	B2 - Use the SFRKV offset to start fork
;	B3 - Type out the normal LOGIN messages; i.e. system message
;		of the day, Job X on TTYn..., You have new mail, etc.

;[4417]
;These bits are in PRIFLG
PR%LFT==-1,,0			;[4417]Left half of PRIFLG
 PR%DEF==:1B0			;[4417]Filling in defaults for PRINT command
 PR%PRI==:1B1			;[4417]Doing a print command
 PR%QUE==:1B2			;[4417]Queue/Port/Service defaulted
 PR%RND==:1B3			;[4417]VMS/Server defaulted
 PR%DES==:1B4			;[4417]DESTINATION defaulted
 PR%JQN==:1B5			;[4417]Just queue name defaulted 
 PR%DER==:1B6			;[4417]Default remote printer was deleted
 PR%DSL==:1B7			;[4417]Seen /DEST in SET DEFAULT PRINT 
 PR%RML==:1B8			;[4417]Seen /REMOTE in SET DEFAULT PRINT 
 PR%QUL==:1B9			;[4417]Seen just queue in SET DEFAULT PRINT 

;Right half of PRIFLG is used to keep an account of what defaults are set for
;the print command.  These bit pertains to the process.  If PR%DDF is on then
;the node name in /DEST takes precedent over the node name in /REMOTE: and vice
;versa if PR%RDF is on.  Either PR%DDF or PR%RDF is set, both can't be set.

PR%RHT==0,,-1
 PR%DDF==:1B18			;[4417]Default to /DEST: node
 PR%RDF==:1B19			;[4417]Default to node defined in /REMOTE:

;XGLOBS FOLLOWS THIS