Google
 

Trailing-Edge - PDP-10 Archives - dec-10-omona-u-mc9 - syserr.mac
There are 64 other files named syserr.mac in the archive. Click here to see a list.
	TITLE	SYSERR -- SYSTEM ERROR FILE PROCESSOR VERSION7(433)	OCT 30, 1972	SUBTTL	K. COYE/ RLD

	SUBTTL	MAINLINE PROGRAM CODE



	SEARCH	SYRUNV
	SEARCH	SYRLOW	;LOW SEG DEFINITIONS
	SEARCH	SCNMAC

	.REQUIRE SYRLIB
	;DUMALL -- DUMMY MACRO LEVEL 3
	;SUBMACRO DUMXXX
	;ARGS
	;NONE USED TO HOUSE LEVEL 2 SUBMACRO DUMXXX
	;THOSE DEFINED HERE ARE THOSE FULLY PROCESSED BY
	;THIS SEGMENT. PART OF EDIT #120.





	;EXTERNALS DEFINED HERE ARE IN SYRLIB.MAC, THE LIBRARY
	;OF COMMON ROUTINES FOR ALL PARTS OF THE SYSERR PACKAGE.

	EXTERNAL HEADRD,ABORT,CHRCHK,DATECK,FILERR,TOOBIG,MBCHAR
	EXTERNAL CNISUM,BADNAM,MASSVM,DEVCHK,ERRINT,SKIPIT,IDCHK
	EXTERNAL STRCHK,DETCHK,DMPENT,HDRLST,PAGXCD,DVCHAR,TMCHAR
	EXTERNAL SAYDAY,GETNBS,.OCTLE,.DECML,.ASCIE,.SIXBT
	EXTERNAL .HAFWD,.SPECL,.HTIME,.PPNWW,.ODECW,.UDATE,.TASCI,.PPNWT
	EXTERNAL .TDIRW,R5VSIX,MONVER,BADADD,TAB031,TYPAST,BLDPTR
	EXTERNAL ACLST,SAVE4P,RET4P,HWDUMP,TYPBCD,LSTEB,JFLOOP,CNIDCD
	EXTERNAL XORTAB,BITLST,.DVTAB,.MXBLK,.TRBLK,.SUBLK,.SECBK
	EXTERNAL WDCNT,COMPAR,SKPRTN,TYPNBS,TITLST,SKIPWD,ADVBFF
	EXTERNAL FIXBUF,STBUFF,INPWD,GOSUM,GETWD,FFPRNT,SLPRNT,CLPRNT
	EXTERNAL TBPRNT,CHROUT,TTYSIX,MDECHR,FIXNAM





	;INTERNALS DEFINED HERE ARE FOR USE BY SYRLIB
	INTERNAL KONMSK,KLEDMP,MINERB,DEVDSP,MASLTH,ALLTBL
	INTERNAL NAMLTH,TYPMES,LINE,ALLLTH,NAMTBL,DUMDAY
	INTERNAL DEVTYP,ERINDX,PCSTBL,PDLPNT,BITCHK,ERRLTH
	INTERNAL MASNAM,ERRTBL,SUMUPD,MASLT2
	



	.JBVER==137
	LOC	.JBVER

	BYTE	(3)VWHO(9)VSYSER(6)VMINOR(18)VEDIT
	SALL


	TWOSEG
LOWBEG:		;LOW SEGMENT WILL RESIDE HERE
	RELOC	400000

	;SOME DUMMY VALUES ARE DEFINED HERE TO MAKE THE PACKAGE
	;COMPILE CORRECTLY.  THEY SHOULD NEVER BY CALLED
	;PART OF EDIT 301.
SUBTAB:
BITCHK:
DEVTYP:
ERINDX:
KLEDMP:
LINE:
TYPMES:	BLOCK 1	;TO GIVE A LITTLE SPACE


	;START -- MAINLINE PROGRAM CODE BEGINS HERE
	;SETS UP DEFAULT FILE ARGUEMENTS
	;INITIALIZES PUSHDOWN LIST
	;CLEARS WORKING STORAGE LOCATIONS

START:	JFCL	;EDIT 106
	RESET

	SETZ	F,		;CLEAR STATUS AC
	TLO	F,F.LSUM	;INITIALIZE TO GIVE SUMMARY BY DEFAULT
	MOVE	P,PDLPNT	;SETUP PUSHDOWN POINTER

	MOVEI	T1,TENEND
	MOVE	T2,T1			;SAVE WHAT WE ASKED FOR
	CORE	T1,200000		;GET MINIMUM LOW SEGMENT
	 HALT		;CAN'T GET THAT MUCH??
	HRRM	T2,.JBFF##	;SETUP NEW JOB DATA AREA VALUE
	MOVE	T1,[XWD 112,11]		;SETUP
	GETTAB	T1,		;CHECK WHICH MONITOR WE ARE UNDER
	 JRST	TOPSYS		;TOPS10-PRE-507
	CAIN	T1,40000	;TOPS20?
	 SETOM	TOPMON		;YES-STORE THIS INFO
				;-1 MEANS UNDER TOPS20
	MOVE	P1,TOPMON	;HOLD MONITOR FLAG IN P1 ACROSS BLT


	;INITIALIZE THE STORAGE LOCATIONS TO 0

TOPSYS:	MOVEI	T1,TENEND	;ASSUME TOPS10
	IFN	FULSEG,<
	SKIPE	TOPMON	;IF UNDER TOPS20
	 MOVEI	T1,LOWEND
	>;END FULSEG
	MOVE	T2,T1		;SAVE WHAT WE ASKED FOR
	CORE	T1,200000
	 HALT		;CAN'T GET A LOW SEG???
	HRRM	T2,.JBFF##	;SETUP NEW JOB DATA AREA VALUE
	MOVE	T1,[XWD INPBLK,INPBLK+1]	;SETUP
	SETZM	INPBLK
	MOVEI	T2,LOWEND	;SETUP FOR FULL LOW SEG
	IFN	FULSEG,<
	SKIPN	TOPMON	;IF UNDER TOPS 20
	 MOVEI	T2,TENEND	;ELSE ONLY TEN BASED COUNTERS
	>;END FULSEG
	BLT	T1,0(T2)	;D TO EITHER LOWEND OR TEN END
	MOVEM 	P1,TOPMON	;RESTORE MONITOR FFLAG AFTER BLT
	MOVEM	11,OVRBLK	;EDIT #120-SAVE IN SIXBIT THE DEVICE
				;WE CAME FROM FOR FUTURE GETSEGS.
	MOVEM	7,OVRBLK+4	;[147]SAVE P,PN TOO
	SKIPN	11		;BUT IF 0 WAS STORED FOR TOPS20
	 PUSHJ	P,DEVFIX	;GO AND SUBSTITUTE A UNIT
	MOVEM	7,OVRBLK+4	;[147] SAVE P,PN TOO
	MOVE	T1,[XWD FLGST,FLGST+1]	;SETUP TO INITIALIZE SWITCH STORAGE LOCATIONS TO -1
	SETOM	FLGST
	BLT	T1,FLGND	;ALL NOW = -1

	MOVE	T1,[XWD	INPSPC,INPBLK]	;SETUP TO XFER DEFAULT FILE ARGS
	BLT	T1,BLTEND	; DO IT!
	SKIPN	TOPMON		;TOPS20?
	 JRST	SYSINF		;NO-DON'T CHANGE DEFAULTS
	MOVE	T1,T20DEV	;GET NEW DEFAULT
	MOVEM	T1,INPBLK+1	;AND STORE IT



	;FALL INTO SYSINF ROUTINE

	;SYSINF -- ROUTINE TO GET SYSTEM INFORMATION
	;DATE,DAYTIME
SYSINF:	SKIPE	TOPMON		;TOPS20?
	 JRST	T20INF		;YES
	MOVE	T1,[XWD 53,11]	;GET RTODAYS DATE
	GETTAB	T1,		;IN UNIV FORMAT
		FATAL	<CAN'T GET TODAY'S DATE??>
	HLRZ	T1,T1		;DATE PORTION INTO RH
	MOVEM	T1,.DATE	;STORE IT AWAY
	MSTIME	T1,		;GET TIME OF DAY IN MS
	DIVI	T1,^D1000	;CONVERT TO SECONDS
	MOVEM	T1,.TIME	;SAVE IT
	JRST	INICHR		;



	;INICHR -- ROUTINE TO INITIALIZE THE ENTRY CHARACTERISTICS TABLE

INICHR:	MOVE	T1,[XWD ENTCHR,ENTCHR+1]
	HRLZI	T2,E.LSUM	;DEFAULT TO LIST SUMMARY ONLY
	MOVEM	T2,ENTCHR
	BLT	T1,CHREND	;E.LSUM BIT SET THROUGHOUT TABLE

	PUSHJ	P,DIALOG	;GO TALK TO USER
	PUSHJ	P,SETDAT	;GO SEE IF USER TYPED /BEFORE OR /AFTER

	;FALL INTO FILACT ROUTINE
	JRST	FILACT

	;HERE SUBSTITUTE A DEV NAME FOR TOPS20 TO FIND NEXT HIGH SEG

DEVFIX:	MOVE	T1,[SIXBIT/SYS/]

	MOVEM	T1,OVRBLK		;A LOCATION FOR OVERLAY SPECS.
	SETZM	OVRBLK+4	;NO SAVED P,PN
	POPJ	P,0				;GO BACK

T20INF:	GTAD		;GET TOPS20 INTERNAL DATE/TIME AT GMT
	MOVE	T2,T1
	HLRZ	T1,T1	;SAVE DATE ONLY
	MOVEM	T1,.DATE	;STORE IT
	HRRZ	T1,T2	;NOW SECONDS SINCE MIDNIGHT
	MOVEM	T1,.TIME	;SAVE IT TOO
	JRST	INICHR	;NOW CONTINUE
	;FILACT -- ROUTINE TO PERFORM PRELIMINARY FILE ACTIVITY
	;DOES OPEN FOR INPUT, OUTPUT DEV
	;DOES LOOKUP FOR INPUT FILE
	;DOES ENTER FOR OUTPUT FILE
	;DEFAULTS
	;DEVICE-DSK
	;FILE-INPUT-ERROR.SYS
	;    -OUTPUT-ERROR.LST
	;PPN-USERS OWN

FILACT:	OPEN	INPCHN,INPBLK	;OPEN INPUT DEV SPECIFIED IN DIALOG
	JRST	[ WARN	<CAN'T OPEN INPUT DEVICE>
	JRST	START ]

	OPEN	OUTCHN,OUTBLK	;OPEN OUTPUT DEV SPECIFIED IN DIALOG
	JRST	[ WARN	<CAN'T OPEN OUTPUT DEVICE>
	JRST	START ]


	MOVEI	T1,INPCHN	;SETUP FOR DEVCHR CALL
	DEVCHR	T1,
	TLNN	T1,DV.DSK	;IS IT A DISK
	JRST	SHRTLK		;NO DO SHORT LOOKUP
LONGLK:	LOOKUP	INPCHN,INPFIL	;LOOK FOR ERROR FILE (DEFAULT IS ERROR.SYS)
	JRST	[ WARN	<LOOKUP ERROR ON INPUT FILE>
	JRST	START ]
	TLO	F,F.DISK	;REMEMBER IT WAS A DISK
	MOVE	T1,I.EXT		;(107) GET CURRENT EXT.
	MOVEM	T1,CUREXT		;AND SAVE IT
	MOVE	T1,INPFIL+.RBTIM		;GET CREATION TIME/DATE
	MOVEM	T1,FILDAT	;SAVE IT
	JRST	DOENTR		;NOW GO DO ENTER

SHRTLK:	LOOKUP	INPCHN,INPFIL+2	;FUDGE SHORT LOOKUP
					;NOTE THAT PPN WAS PUT IN .RBSIZ
					;TO ALLOW THIS
	JRST	[ WARN	<LOOKUP ERROR ON INPUT FILE>
	JRST	START ]
	SETZ	T1,
	LDB	T1,[POINT 12,INPFIL+4,35]	;GET LOW DATE
	LDB	T2,[POINT 3,INPFIL+3,20]	;GET HIGH DATE.
	DPB	T2,[POINT 3,T1,23]		;MERGE AND THEN
	HRLZ	T1,T1		;MOVE IT TO LH OF T1.
	LDB	T2,[ POINT 11,INPFIL+4,23]	; GET TIME IN MIN.
	MUL	T2,[^D60*^D1000]		;CONVERT TO MSEC.
	HRR	T1,T2				;PUT IT IN RH OF T1.
	MOVEM 	T1,FILDAT	;PUT IT AWAY SO AS TO SATISFY
						;DOENTR: !!

DOENTR:	ENTER	OUTCHN,OUTFIL	;GET READY FOR OUTPUT LISTING
	JRST	[ WARN	<ENTER ERROR ON OUTPUT FILE>
	JRST	START ]
	;NOW CLEAR THE LOGICAL NAME DEFINITION FOR TOPS20
	TRNE	F,F.REM		;/REMOTE?[417]
	 PUSHJ	P,REMENT	;INIT FIRST BLOCK
	SKIPN	TOPMON		;IF NOT TOPS20 RUNNING
	 JRST 	HEADRD		;LEAVE NOW
	MOVEI	T2,[ASCIZ/QAP/]	;PNTR TO NAME
	HRLI	T2,-1
	SETZB	T1,T3		;CODE TO REMOVE ONE LOG. NAME FROM JOB
				;WITH NO NEW DEFINITION
	CRLNM			;REMOVE THE NAME
	 WARN	<CANNOT CLEAR LOGICAL NAME FOR 'SYSTEM'??>
	JRST	HEADRD		;NOW DO SOME PROCESSING


	;ADDED WITH [417] TO WRITE FIRST WORD
REMENT:	OUT	OUTCHN,		;DUMMY TO SET BUFFERS
	HRLZI	T1,<ER.OFF>B26	;OFFSET CODE TO LEFT HALF
	HRRI	T1,1		;START AT NEXT WORD
	IDPB	T1,OBUFF+1	;PUT FIRST WORD INTO BUFFER
	POPJ	P,0		;RETURN
	;DIALOG	-- SUBROUTINE TO PROVIDE FOR DIALOG WITH USER
	;TO OBTAIN THE FOLLOWING INFO:
	;INPUT DEV,FILENAME,EXT,PPN
	;OUTPUT DEV,FILENAME,EXT,PPN
	;SELECTIVE LISTING CONTROL SWITCHES
	;THE SCAN.MAC ROUTINES ARE USED TO DO THE ACTUAL STRING
	;SCANNING AND WILL LEAVE INFO IN THE INPUT SPECIFICATIONS
	;AND OUTPUT SPECIFICATIONS BLOCK OF THIS PROGRAM
	;CHANGED WITH EDIT 225

DIALOG:	TLO	F,F.TTYO	;SAY ALL OUTPUT TO TTY TILL FURTHER NOTICE
	SKIPE	ONEPAS		;[225]BEEN HERE ONCE?
	 JRST	DIALO1		;[225]YUP
	SETOM	ONEPAS		;DONT COME BACK
	MOVEI	T1,CHROUT
	PUSHJ	P,.TYOCH##
	TYPEIT	<
FOR HELP, TYPE "/HELP"
>
	MOVE	T1,[XWD IARGLN,IARGST]	;SETUP POINTER OF LENGTH,,ADDRESS
					;POINTING TO ARG BLOCK FOR .ISCAN
	PUSHJ	P,.ISCAN	;INITIALIZE SCAN FOR INFO PICKUP

DIALO1:	SKIPN	ONEPAS		;CHECK AGAIN
	 JRST	.+3		;GO AROUND
	MOVEI	T1,CHROUT	;INIT TYPEOUT ROUTINE
	PUSHJ	P,.TYOCH##
	MOVE	T1,[XWD TARGLN,TARGST]	;SETUP POINTER SAME AS ABOVE FOR .TSCAN
	PUSHJ	P,.TSCAN	;GO DO THE ACTUAL STRING SCAN
					;FOR CUSP TYPE COMMAND STRING

	;FALL INTO SETINP ROUTINE
	;SPECIFICATION BLOCKS NOW HAVE DESIRED INFO
	;LETS UPDATE THE DEFAULT INFO PLACED IN LOOKUP
	;AND INIT BLOCKS EARLIER WITH THE BLT

SETINP:	SKIPN	TOPMON		;TOPS20 RUNNING?
	 JRST	SETINB		;NO-NO NEW LOGICAL NAMES PLEASE
	MOVEI	T2,[ASCIZ/QAP/]	;PNTR TO NAME
	MOVEI	T3,[ASCIZ/<SYSTEM>/]	;PNTR TO DEFINITION
	MOVEI	T1,4		;CODE TO CREATE A LOGICAL NAME FOR JOB
	HRLI	T2,-1
	HRLI	T3,-1
	CRLNM			;MAKE ASSIGNMENT
	FATAL	<CANNOT CREATE TOPS20 LOGICAL NAME FOR 'SYSTEM'??>
SETINB:	SKIPE	T1,I.EXT+2	;NONZERO=GO CHECK FOR DEVICE
	 PUSHJ	P,SETFIX	;GO DIDDLE
	SKIPE	T1,I.DEV	;PICKUP INPUT DEVICE, SKIP IF ZERO
	MOVEM	T1,INPBLK+1
	JUMPN	T1,SETIN1
	MOVE	T1,IDVFLT
	SKIPE	TOPMON		;TOPS20 RUNNING?
	 MOVE	T1,[SIXBIT/QAP/]	;CHANGE THE DEFAULT INPUT DEVICE
	MOVEM	T1,I.DEV
SETIN1:	SKIPE	T1,I.NAM	;FILENAME LIKEWISE
	MOVEM	T1,INPFIL+.RBNAM
	JUMPN	T1,SETIN2
	MOVE	T1,IFLFLT
	MOVEM	T1,I.NAM
SETIN2:	SKIPN	T1,I.EXT	;EXTENSION
	JRST	SETIN3		;NO EXTENSION WAS TYPED
	HLLZM	T1,INPFIL+.RBEXT	;STORE EXTENSION
	JRST	GETIPP
SETIN3:	MOVE	T1,IEXFLT
	MOVEM	T1,I.EXT
GETIPP:	SKIPE	T1,I.DIR	;PPN FOR INPUT
	MOVEM	T1,INPFIL+.RBPPN
	MOVEM	T1,INPFIL+.RBSIZ	;DUMMY TO ALLOW SHORT LOOKUP
				;AT INPFIL+2


	;NOW DO SAME FOR OUTPUT SPECIFICATIONS

SETOUT:	SKIPE	T1,O.DEV	;PICKUP OUTPUT DEVICE, SKIP IF ZERO
	MOVEM	T1,OUTBLK+1
	JUMPN	T1,SETOU1
	MOVE	T1,ODVFLT
	MOVEM	T1,O.DEV
SETOU1:	SKIPE	T1,O.NAM	;FILENAME LIKEWISE
	MOVEM	T1,OUTFIL
	JUMPN	T1,SETOU2
	MOVE	T1,OFLFLT
	MOVEM	T1,O.NAM
SETOU2:	SKIPN	T1,O.EXT	;EXTENSION
	JRST	SETOU3		;NO EXTENSION WAS TYPED
	HLLZM	T1,OUTFIL+1	;STORE EXTENSION
	JRST	GETOPP
SETOU3:	MOVE	T1,OEXFLT
	MOVEM	T1,O.EXT
GETOPP:	SKIPE	T1,O.DIR	;PPN FOR OUTPUT
	MOVEM	T1,OUTFIL+3
	MOVE	T1,[-1]		;INITIAL VALUE OF DEV
	CAME	T1,DEV		;DD USER SPECIFY /DEV
	TLO	F,F.DEV		;YES LITE THE BIT
	CAME	T1,NDEV		;[325] "/NDEV:"?
	TRO	F,F.NDEV	;YUP
	CAME	T1,REMOTE	;[417]/REMOTE?
	 PUSHJ	P,REMFIX		;YUP
	CAME	T1,ID		;DID USER SAY /ID:?
	TLO	F,F.ID		;YUP.
	CAME	T1,STR		;/STR?
	 TLO	F,F.STR
	CAME	T1,DETAIL
	 TLO	F,F.DET
	CAME	T1,RETRY		;EDIT 126
	 TLO	F,F.TRY			;USER SAID /RETRY:
	MOVEI	T1,SREDEF	;GET DEFAULT VALUE OF SRE
	MOVEI	T2,SWEDEF	;AND SWE IN CASE USER DIDNT SPECIFY.
	SKIPGE	SRE		;ALREADY SETUP?
	MOVEM	T1,SRE		;NO USE DEFAULT
	SKIPGE	SWE		;WHAT ABOUT SWE?
	MOVEM	T2,SWE		;NO GET DEFAULT.
	POPJ	P,		;RETURN



;[417]
REMFIX:	PUSH	P,T1		;SAVE T1
	TRO	F,F.REM	;SET THE FLAG IN F
	MOVE	T1,[SIXBIT/DAT/]	;NEW FILE XT
	MOVEM	T1,OUTFIL+1
	MOVEI	T1,13		;MODE 13-IMAGE BINARY
	MOVEM	T1,OUTBLK	;CHANGE FOR OPEN UUO
	POP	P,T1		;RESTORE T1
	POPJ	P,0		;AND RETURN
SETFIX:	MOVE	T1,I.EXT+1	;GET WHAT SCAN DID
	TLNN	T1,400000	;ON=NO DEV SPEC'D
	 POPJ	P,0		;SOMETHING THERE ALREADY
	SKIPE	I.DIR	;[316]P,PN CALLED OUT?
	 MOVSI	T1,'DSK'	;YES,CHANGE DEF. DEVICE
	SKIPN	I.DIR	;END [316]
	MOVE	T1,[SIXBIT/SYS/]
	SKIPE	TOPMON		;TOPS20 RUNNING?
	 MOVE	T1,T20DEV	;YES,CHANGE DEFAULT INPUT DEVICE
	MOVEM	T1,I.DEV	;FIX IT
	POPJ	P,0
	;HERE IS THE DUMMY PROCSB FOR THIS HIGH SEG
	;IT SAVES THE AC'S AND THEN CALLS OVRLAY FOR REPLACEMENT
	;WITH SYSERB.HGH

PROCSB:	MOVE	T1,[SIXBIT/SYSERB/]
	MOVEM	T1,OVRBLK+1	;INTO THE SPEC AREA
	SETZ	15,
	MOVEM	17,SAVEAC+17
	MOVEI	17,SAVEAC
	BLT	17,SAVEAC+16	;TUCK AWAY OUR AC'S
	JRST	OVRLAY		;NOW PLEASE OVERLAY US WITH PROCSB


	;HERE IS THE DUMMY PROCSC FOR THIS HIGH SEG
	;IT SAVES THE AC'S AND THEN CALLS OVRLAY FOR REPLACEMENT
	;WITH SYSERC.HGH

PROCSC:	MOVE	T1,[SIXBIT/SYSERC/]
	MOVEM	T1,OVRBLK+1	;INTO THE SPEC AREA
	SETZ	15,
	MOVEM	17,SAVEAC+17
	MOVEI	17,SAVEAC
	BLT	17,SAVEAC+16	;TUCK AWAY OUR AC'S
	JRST	OVRLAY		;NOW PLEASE OVERLAY US WITH PROCSC
	;HERE IS THE DUMMY PROCSD FOR THIS HIGH SEG
	;IT SAVES THE AC'S AND THEN CALLS OVRLAY FOR REPLACEMENT
	;WITH SYSERD.HGH

PROCSD:	MOVE	T1,[SIXBIT/SYSERD/]
	MOVEM	T1,OVRBLK+1	;INTO THE SPEC AREA
	SETZ	15,
	MOVEM	17,SAVEAC+17
	MOVEI	17,SAVEAC
	BLT	17,SAVEAC+16	;TUCK AWAY OUR AC'S
	JRST	OVRLAY		;NOW PLEASE OVERLAY US WITH PROCSC

	;HERE IS THE DUMMY PROCSA FOR THIS HIGH SEG
	;IT SAVES THE AC'S AND THEN CALLS OVRLAY FOR REPLACEMENT
	;WITH SYSERA.HGH

PROCSA:	MOVE	T1,[SIXBIT/SYSERA/]
	MOVEM	T1,OVRBLK+1	;INTO THE SPEC AREA
	SETZ	15,
	MOVEM	17,SAVEAC+17
	MOVEI	17,SAVEAC
	BLT	17,SAVEAC+16	;TUCK AWAY OUR AC'S
	JRST	OVRLAY		;NOW PLEASE OVERLAY US WITH PROCSA

	;SETDAT	-- SUBROUTINE TO LOOK AT /END AND /BEGIN
	;SWITCHES AND CONVERT THEM TO START AND END DATE
	;CALL	PUSHJ	P,SETDAT
	;
	;RETURN	CALL+1
	;BOTH BEGIN AND END ARE INITIALIZED TO -1 FOR SCAN USE
	;STDATE=0 OR VALUE OF /BEGIN SWITCH IF TYPED
	;ENDATE=377777,,-1 OR VALUE OF /END IF TYPED
	;IF USER DOES NOT SPECIFY TIME CUTOFF ASSUME 2400 HRS.
	;USES T1-T4
	;[EDIT 214] CHANGES LOCAL TIME TO GMT TIME IF UNDER TOPS20.

SETDAT:	TLZ	F,F.DATE	;ASSUME NO DATE CONSTRAINTS DEFAULT
	SETZM	STDATE		;ZAP
	SKIPGE	T1,END		;CHECK FOR /END SWITCH
	MOVE	T1,[377777777777]	;NONE TYPED-SAY ETERNITY IS CUTOFF
	TRNN	T1,-1		;DID USER SPECIFY TIME CUTOFF AS WELL
	HRRI	T1,-1		;NO-SAY 2400 FOR HIM  TO ALLOW ALL DAY AS GOOD
	MOVEM	T1,ENDATE	;STORE AS CUTOFF DATE
	SKIPL	T2,BEGIN	;/SINCE SPECIFIED
				;-1 SAYS NO SWITCH WAS STORED
	MOVEM	T2,STDATE	;STORE AS STARTING DATE
	CAMN	T1,[377777777777]	;DID USER TYPE /END?
	CAIE	T2,-1		;SKIP IF NO /BEGIN SPECIFIED
	TLO	F,F.DATE	;SAY WE SAW A TIME SWITCH


	SKIPN	TOPMON		;TOPS20 RUNNING?
	 POPJ	P,0		;NO,LEAVE NOW

	SKIPGE	END		;/END SPECIFIED?
	 JRST	SETDA1		;NO
	SETOM	T2
	SETZB	T3,T4
	ODCNV			;GET CURRENT TIME
	MOVE	T2,ENDATE
	TLNE	T4,1B19	;[306]DAYLIGHT SAVINGS?
	 SUBI	T2,25252	;YES SUB 1 HOUR
	LSH	T4,14
	ASH	T4,-36
	IMULI	T4,25252	;ONE HOURS WORTH
	ADD	T2,T4
	MOVEM	T2,ENDATE
SETDA1:	SKIPGE	BEGIN		;/BEGIN SPECIFIED?
	 POPJ	P,0		;NO-LEAVE NOW
	SETOM	T2
	SETZB	T3,T4
	ODCNV			;GET CURRENT TIME
	MOVE	T2,STDATE	;[306]
	TLNE	T4,1B19	;DAYLIGHT SAVINGS?
	 SUBI	T2,25252	;YES,SUB 1 HOUR
	LSH	T4,14
	ASH	T4,-36
	IMULI	T4,25252	;ONE HOURS WORTH
	ADD	T2,T4
	MOVEM	T2,STDATE
	POPJ	P,		;RETURN

	SUBTTL	SCAN RELATED SUBROUTINES
	;DEFINP,DEFOUT -- SUBROUTINES TO SETUP PARAMETERS FOR INPUT AND OUTPUT
	;CALL	PUSHJ	P,DEFXXX FROM SCAN CODE
	;
	;RETURN	CALL +1
	;RETURNS TO SCAN WITH T1=START OF AREA	T2=LENGTH OF AREA
	;USES T1,T2

DEFINP:	MOVEI	T1,I.ST		;PICKUP ADDRESS OF START OF INPUT AREA
	MOVEI	T2,I.LNGH	;PICKUP LENGTH OF INPUT AREA
	POPJ	P,

DEFOUT:	MOVEI	T1,O.ST		;SAME AS ABOVE FOR OUTPUT AREA
	MOVEI	T2,O.LNGH
	POPJ	P,


	;CLRFLG -- SUBROUTINE TO CLEAR SWITCH FLAG STORAGE LOCATIONS
	;CALL	PUSHJ	P,CLRFLG	FROM SCAN

CLRALL:	MOVE	T1,[XWD FLGST,FLGST+1]
	SETOM	FLGST		;SCAN LIKES -1 TO INITIALIZE
	BLT	T1,FLGND

	MOVE	T1,[XWD I.ST,I.ST+1]	;SETUP TO CLEAR INPUT FILE SPEC BLOCK
	SETZM	I.ST
	BLT	T1,I.END

	MOVE	T1,[XWD O.ST,O.ST+1]	;SAME FOR OUTPUT
	SETZM	O.ST
	BLT	T1,O.END	;ZAP OUTPUT FILE SPEC AREA
	POPJ	P,		;RETURN TO SCAN CODE


	;SETSWT -- SUBROUTINE CALLED BY SCAN TO HANDLE BIT SETTING
	;IN ENTCHR TABLE AS A RESULT OF USER SWITCHES
	;CALL	PUSHJ	P,SETSWT FROM SCAN CODE
	;
	;RETURN CALL+1
	;SETS BITS IN ENTCHR TABLE AS SPECIFIED BY BYTES FOUND
	;AT @BYTDSP(ERROR CODE)
	;BYTES ARE GROUPED INTO LIST ALL,NXM CAUSED,PAR CAUSED,PER CAUSED
	;PERFORMANCE CAUSED,SUMMATION
	;BYTE FIELDS ARE DELIMITED WITH 77

SETSWT:	TLO	F,F.OSUM	;EDIT 211-WE GOT HERE ONLY IF USER
				;SAID /MASALL, ETC AND DID NOT USE
				;DEFAULT OF /ALLSUM. SEE REVISION
				;HISTORY AND SYSERR DOCUMENTATION.
	PUSH	P,T1		;SAVE T1
	PUSH	P,T2		;LIKEWISE
	HRRZ	T1,T2		;PICKUP FLAG ADDRESS
	SUBI	T1,FLGST	;SUBTRACT STARTING ADDRESS OF FLAGS
				;RESULT IS OFFSET OF SWITCH IN TABLE
	CAILE	T1,FLGSTP	;DO WE WISH TO SET BITS IN ENTCHR FOR THIS SWITCH ?
	JRST	DONE		;NO - JUST LET SCAN STORE IT
	HRRM	T2,SWITCH	;[321]SAVE ADDRESS IN LOW SEG OF THIS SW 
				;VALUE FOR BIT CHECKING ROUTINES


	;WHILE WE'RE HERE LET'S SETUP THE DEFAULT OUTPUT
	;FILE NAME TO THAT /CPUALL OR /DSKPAR ETC THE USER
	;JUST TYPED INSTEAD OF ERROR.LST

	MOVE	T3,SWTABN(T1)	;THAT'S A NAME TABLE IN SIXBIT
	MOVEM	T3,OUTFIL	;THAT'S THE FILE NAME IN SIXBIT


	MOVSI	T2,441100	;SETUP FOR 11 BITS
	HRR	T2,BYTDSP(T1)	;SETUP TO LOOK AT BYTX WHERE X IS INDEX INTO SWITCH TABLE
	HRLZI	T4,E.LALL	;SET E.LALL BIT IN MASK
ALLCHK:	ILDB	T3,T2		;PICKUP BYTE FROM BYTXXX
	JUMPE	T3,ALLCHK	;IGNORE IT
	CAIN	T3,777		;READY TO GO TO E.LNXM CHECK
	JRST	NXMCHK		;YES DISPATCH
	IORM	T4,ENTCHR(T3)	;LIGHT THE BIT
	JRST	ALLCHK		;BACK FOR MORE

NXMCHK:	HRLZI	T4,E.LNXM	;SET THE E.LNXM BIT IN MASK
NXMCON:	ILDB	T3,T2
	JUMPE	T3,NXMCON
	CAIN	T3,777		;READY TO GO TO PARCHK
	JRST	PARCHK
	IORM	T4,ENTCHR(T3)	;LIGHT THE E.LNXM BIT IN ENTRY CHAR WORD
	JRST	NXMCON		;MORE

	;FALL INTO PARCHK ROUTINE
PARCHK:	HRLZI	T4,E.LPAR	;SET THE E.LPAR BIT IN MASK
PARCON:	ILDB	T3,T2
	JUMPE	T3,PARCON
	CAIN	T3,777		;READY TO DO PERCHK?
	JRST	PERCHK		;YES
	IORM	T4,ENTCHR(T3)	;LIGHT THE LITE
	JRST	PARCON		;LOOP

PERCHK:	HRLZI	T4,E.LPER	;LIGHT THE E.LPER BIT IN MASK
PERCON:	ILDB	T3,T2
	JUMPE	T3,PERCON
	CAIN	T3,777		;READY FOR SUMCHK
	JRST	SUMCHK		;YES
	IORM	T4,ENTCHR(T3)	;LITE THE BIT IN ENTCHR TABLE
	JRST	PERCON		;LOOP

SUMCHK:	HRLZI	T4,E.LSUM
SUMCON:	ILDB	T3,T2
	JUMPE	T3,SUMCON	;IGNORE
	CAIN	T3,777		;FINI??
	JRST 	DONE		;YES EXIT
	IORM	T4,ENTCHR(T3)	;SET THE BIT
	TLO	F,F.LSUM	;SAY SOME SUMMARY WAS REQUESTED
	JRST	SUMCON

DONE:	POP	P,T2		;RESTORE T2
	POP	P,T1		;SAME
	AOS	(P)		;SKIP RETURN TO MAKE SCAN STORE FLAG
	POPJ	P,		;BACK TO SCAN

	;SUMUPD -- SUBROUTINE TO AUTOMATICALLY UPDATE ALL PERMANENT
	;SUMMARY COUNTERS PRIOR TO SUMMARY LISTING
	;A DUMMY MACRO DUMFLG IS USED TO GENERATE
	;THE NECESSARY CODE AS FOLLOWS
	;SKIPE	T1,XXXTMP	;PICKUP TEMP COUNTER
	;ADDM	T1,XXXPER	;INCREMENT PERM COUNTER
	;DO NEXT COUNTER SAME.......
	;modified by edit #110
	DEFINE	TBLFLG(A)<
	setz	t1,
	exch	t1,a'TMP
	ADDM	T1,A'PER
>

	;NOW THE ACTUAL CODE GENERATION

;	XLIST
SUMUPD:	DUMFLG
	LIST


;NOW GENERATE THE SOFTWARE SUMMARY COUNTERS UPDATE
;also modified by edit #110
	DEFINE	DUMDV(A)<
	ZZ==0
REPEAT NUMSFB,<
	setz	t1,
	exch	t1,a'ST+zz
	ADDM	T1,A'SP+ZZ
	ZZ==ZZ+1
>>
;	XLIST
;	DUMDP
;	DUMFH
;	DUMRP
	LIST
	XLIST
	DUMDP
	DUMFH
	DUMRP
	LIST

	POPJ	P,		;RETURN



	SUBTTL	STORAGE LOCATIONS
T20DEV:	SIXBIT/QAP/	;DEFAULT FOR TOPS20 INPUT DEVICE
INPSPC:	EXP	13
	SIXBIT/SYS/
	XWD	0,IBUFF
OUTSPC:	EXP	0
	SIXBIT/DSK/
	XWD	OBUFF,0
ERRFIL:	XWD	0,35
	Z
	SIXBIT/ERROR/
	SIXBIT/SYS/
	BLOCK	32
LSTFIL:	SIXBIT/ERROR/
	SIXBIT/LST/
	Z
	Z
	;HERE IS THE CODE WHICH WILL BE BUT INTO THE LOW SEG
	;AND WILL BE CALLED TO OVERLAY HIGH SEGMENTS.
	;EDIT #120


	HRLZI	T1,1		;GET RID OF
	CORE	T1,		;CURRENT HIGH SEG
	HALT			;CAN'T DECREASE CORE!!!???
	SETZM	.JBSYM		;TO ALLOW DDT TO WORK
	SETZM	.JBUSY		;WHILE DEBUGGING VARIOUS HIGH
				;SEGMENTS. PUT A BREAKPOINT
				;AT ROUTINES WHICH CALL OVRLAY
				;THEN SET BREAKPOINT AT THE
				;RETURN FROM THE GETSEG AND OPEN
				;THE NEW SYMBOL TABLE
				;AND CONTINUE DEBUGGING.
	MOVEI	T1,OVRBLK	;SPEC BLOCK SETUP BY OUR CALLER
	GETSEG	T1,
	 HALT			;STD ERROR MESSAGES ARE OK
	MOVE	17,400006	;GET NEW SYMBOL TABLE ADDR
	MOVEM	17,116		;AND STORE IT FOR DDT SINCE DDT
				;CAN'T SEEM TO GET IT RIGHT!!
	HRLZI	17,SAVEAC	;COPY BACK
	BLT	17,17		;THE AC'S
	SKIPN	15	;[314]MAY ALREADY HOLD RETURN ADDRESS
	HRRZ	15,400000	;THAT'S THE START OF THE NEW SEG
	JRST	@15		;NOW GO THERE



IARGST:	Z
	Z
	CHROUT		;LOCATION OF TYPEOUT ROUTINE IN SYSERR
	Z
	Z
IAREND==.-1
IARGLN==<IAREND-IARGST>+1	;LENGTH OF ARG BLOCK FOR .ISCAN

TARGST:	IOWD	SWTABL,SWTABN	;DUMMY NAMES FOR USE BY SCAN
	XWD	SWTABD,SWTABM
	SWTABP
	SIXBIT/SYSERR/		;LET HELPER TYPE SYS:SYSERR.HLP FOR USER HELP
	XWD	CLRALL,0
	XWD	DEFINP,DEFOUT	;POINTER TO SUBROUTINES TO SETUP
				;INPUT AND OUTPUT FILE SPEC AREAS
	Z
	Z
	SETSWT
TAREND==.-1
TARGLN==<TAREND-TARGST>Z+1		;LENGTH OF T ARG BLOCK

DUMDAY:	121165		;DUMMY NBS DAY FOR USE BY SCAN
KONMSK:	RCMASK			;MASK FOR ERROR BITS IN RC10 TYPE DEVICE
	RPMASK			;MASK FOR ERROR BIT IN A RP10 TYPE DEVICE
	SFMASK			;SOFTWARE DETECTED ERROR MASK
	TMMASK
	RHMASK


MINERB:	MINRCB
	MINRPB
	MINSFB
	MINTMB
	MINRHB

IDVFLT:	SIXBIT/SYS/		;DEFAULT FILE SPECIFICATIONS
IFLFLT:	SIXBIT/ERROR/
IEXFLT:	SIXBIT/SYS/
ODVFLT:	SIXBIT/DSK/
OFLFLT:	SIXBIT/ERROR/
OEXFLT:	SIXBIT/LST/

PDLPNT:	IOWD	LPDL,PDLST
	SUBTTL	DUMMY MACRO EXPANSION AREA


	;THE FOLLOWING MACRO CODE UTILIZES THE PRINCIPLE OF THE DUMMY
	;MACRO USED EARLIER AND REDEFINES TBLENT TO GENERATE VAIOUS
	;NECESSARY DISPATCH TABLES

	;MACRO TO CREATE A TABLE CONTAINING OFFSET INTO OTHER TABLES
	;WHICH WERE PREVIOUSLY INDEXED BY ERROR TYPE(VER 3 & EARLIER). ALLOWS
	;HOLES TO BE IN SEQUENCE OF ERROR TYPES WHICH ARE USED.

	;THIS FIRST TABLE CONTAINS ALL THE ERROR  TYPES
	;KNOWN TO ALL SYSERR PARTS. THE SECOND IS THE TABLE
	;OF TYPES PROCESSED BY THE SEGMENT.
	;EDIT #120.
	SALL
	DEFINE	TBLENT(A,B,C,D,E)<
	XWD  0,A
	>

ALLTBL:	DUMENT

	ALLLTH=<.-1>-ALLTBL+1		;LENGTH OF ERROR INDEX TABLE

ERRTBL:	0		;FIRST FOUND MUST NOT BE 0

	ERRLTH=<.-1>-ERRTBL+1		;LENGTH OF ERROR INDEX TABLE


	;THE ENTRY PROCESSING TABLE
	;THIS TABLE MUST BE INDEXED BY THE CONTENTS OF ALLIND

	DEFINE	TBLENT(A,B,C,D,E)<
	IFIDN<D><PROCSA><
	XWD	0,D
	TYPMAX==A>
	IFDIF<D><PROCSA><
	XWD	0,D
	TYPMAX==A>
	>
PCSTBL:	DUMENT


	;SWITCH TABLES
	;THE FOLLOWING TABLES WILL BE GENERATED VIA THE DUMMY MACRO
	;DUMCH1
	;THE FIRST IS A DISPATCH TABLE TO BYTES REPRESENTING BITS TO SET
	;IN THE ENTCHR TABLE
	;NEXT IS THE ACTUAL BYTES THEMSELVES

	;TABLE FOR DISPATCH TO THE BYTE OPERANDS

	DEFINE	TBLCH1(A,B,C,D,E,F,G)<
	XWD	0,BYT'G
>

	;MAKE DISPATCH TABLE

BYTDSP:	DUMCH1
	;NOW THE BYTES THEMSELVES


	DEFINE	TBLCH1(A,B,C,D,E,F,G)<
BYT'G:	BYTE (9) B,777,C,777,D,777,E,777,F,777
>


	DUMCH1



	;SWITCH MACRO EXPANSION NEXT


	;DEFINE THE SWITCHES WE RECOGNIZE

	DEFINE	TBLCH1(A,B,C,D,E,F,G)<
	SS	(A,A',0)
>
	DEFINE	TBLCH2(A,B,C)<
	SP	(A,A',B,C)
>

	;CALL MACRO TO SET DEFAULTS
	DEFVAL

	;NOW MAKE SWTCHS MACRO FOR USE WITH DOSCAN LATER

	DEFINE	SWTCHS<
	DUMCH1
	DUMCH2
>

	DOSCAN(SWTAB)


	RADIX	8	;******DONE WITH RADIX 10******
	;GENERATE SIXBIT TABLE OF DEVICE NAMES

	DEFINE	DUMDV(A)<
	SIXBIT/A/
>
NAMTBL:	DUMDVA
NAMLTH=<.-1>-NAMTBL+1	;LENGTH OF TABLE OF SIXBIT NAMES
	
;USING SAME DEFINITION OF MACRO NOW GENERATE
	;LIST OF ONLY MASSBUS DEVICE NAMES

MASNAM:		DUMFS
	DUMRP
	MASLTH=<.-1>-MASNAM+1	;LENGTH OF THIS TABLE

MASNA2::	DUMDVB

	MASLT2=<.-1>-MASNA2+1	;LENGTH OF THIS TABLE


	;GENERATE LIST OF POINTERS TO 5 WORD SCRATCH BLOCKS


	;FOR ALL DEVICES ON THE SYSTEM
	
DEFINE	DUMDV	(A)<
	XWD	0,A'T
	>
	DUMDVB
DEFINE	DUMDV(A)<
	XWD	0,A'BK
	>
BKLOC:	DUMDVA

	;GENERATE CONI BIT ERROR DISPATCHER
	;RH = SOFT ERROR POINTER
	;LH = HARD ERROR POINTER

	DEFINE	DUMDV(A)<
	XWD	A'HD,A'SF
>

DEVDSP:	DUMDVA
DEVDS2::	DUMDVB



	DEFINE	DUMDV(A)<
	XWD	A'ST,A'SP
>
	;ST=STORAGE TEMP,SP=PERM.
SOFDSP:	DUMDVA
SOFDS2:	DUMDVB


	;HERE LIES THE START OF THE LOW SEGMENT STORAGE
	;AND VOLATILE MACRO TABLES

	END	START