Google
 

Trailing-Edge - PDP-10 Archives - bb-kl11f-bm_tops20_v7_0_atpch1_19 - autopatch/cmnd2c.c12
There are 2 other files named cmnd2c.c12 in the archive. Click here to see a list.
 INS 28/1	;12C1
	;MJC	1601	21-JUN-85	Remove FORTRAN edit numbers
 REP 21/6	;12C2
	PRAFIL:	BLOCK	5		;[1643] Used to read EXEC args if PRARG fails
 WIT
	PRAFIL:	BLOCK	5		; Used to read EXEC args if PRARG fails
 REP 27/6	;12C3
	JOBNUM:	BLOCK	1		;[1631] Job number
 WIT
	JOBNUM:	BLOCK	1		; Job number
 REP 6/7	;12C4
		SETZM	ECHOFLG		;[1645] Assume that commands are not echoed
		SETZM	STATE+.CMFLG	;[1671] No reparse address or flags
		MOVE	T1,[XWD .PRIIN,.PRIOU] ;[1671] JFNs for command input, output
		MOVEM	T1,STATE+.CMIOJ	;[1671] Restore JFNs
		MOVE	T1,[POINT 7,BUFF] ;[1671] Pointer to command buffer
		MOVEM	T1,STATE+.CMBFP	;[1671]
		MOVEM	T1,STATE+.CMPTR	;[1671]
		MOVX	T1,5*BUFSIZ	;[1671] # Chars unused in buffer
		MOVEM	T1,STATE+.CMCNT	;[1671]
		SETZM	STATE+.CMINC	;[1671] # Chars unparsed in buffer
 WIT
		SETZM	ECHOFLG		; Assume that commands are not echoed
		SETZM	STATE+.CMFLG	; No reparse address or flags
		MOVE	T1,[XWD .PRIIN,.PRIOU] ; JFNs for command input, output
		MOVEM	T1,STATE+.CMIOJ	; Restore JFNs
		MOVE	T1,[POINT 7,BUFF] ; Pointer to command buffer
		MOVEM	T1,STATE+.CMBFP	;
		MOVEM	T1,STATE+.CMPTR	;
		MOVX	T1,5*BUFSIZ	; # Chars unused in buffer
		MOVEM	T1,STATE+.CMCNT	;
		SETZM	STATE+.CMINC	; # Chars unparsed in buffer
 REP 16/8	;12C5
		MOVE	T1,BUFF+.JIJNO	;[1631] Get job number
		MOVEM	T1,JOBNUM	;[1631] Store
 WIT
		MOVE	T1,BUFF+.JIJNO	; Get job number
		MOVEM	T1,JOBNUM	; Store
 REP 19/9	;12C6
		 JRST	DSKTMP		;[1631] Get arguments from file on disk
 WIT
		 JRST	DSKTMP		; Get arguments from file on disk
 REP 59/9	;12C7
		JUMPE	T2,PFAHLT	;[1611]If char is null, then got end of command
		JUMPN	P1,SL2		;Continue processing if more text
	PFAHLT:	HALTF%			;[1611] Through processing fork arguments
		JRST	MAIN		;[1631] User typed "CONTINUE" ...
 WIT
		JUMPE	T2,PFAHLT	;If char is null, then got end of command
		JUMPN	P1,SL2		;Continue processing if more text
	PFAHLT:	HALTF%			; Through processing fork arguments
		JRST	MAIN		; User typed "CONTINUE" ...
 REP 3/10	;12C8
		;[1631] This routine added by RVM
 WIT
		; This routine added by RVM
 REP 10/10	;12C9
		MOVX	T1,GJ%SHT+GJ%OLD+GJ%TMP	;[1643] An existing TMP file
		MOVE	T2,[POINT 7,PRAFIL+1,6]	;[1643] Filename is in PRAFIL
		GTJFN%			;[1643] Get a JFN to see if file exists
		 ERJMP	MAIN		;[1643] Can't read file--get commands from tty

		MOVE	T1,[XWD PRAFIL,BUFF] ;From PRAFIL to BUFF
		BLT	T1,BUFF+4	;[1643] Move the command string+null byte

		SETZM	TDEPTH		;No take files nested here (yet)!
		MOVEI	T1,^D20		;[1643] Number of characters in command
 WIT
		MOVX	T1,GJ%SHT+GJ%OLD+GJ%TMP	; An existing TMP file
		MOVE	T2,[POINT 7,PRAFIL+1,6]	; Filename is in PRAFIL
		GTJFN%			; Get a JFN to see if file exists
		 ERJMP	MAIN		; Can't read file--get commands from tty

		MOVE	T1,[XWD PRAFIL,BUFF] ;From PRAFIL to BUFF
		BLT	T1,BUFF+4	; Move the command string+null byte

		SETZM	TDEPTH		;No take files nested here (yet)!
		MOVEI	T1,^D20		; Number of characters in command
 REP 28/10	;12C10
		MOVX	T1,GJ%SHT+GJ%OLD+GJ%TMP ;[1643] Get a JFN on an old TMP file
 WIT
		MOVX	T1,GJ%SHT+GJ%OLD+GJ%TMP ; Get a JFN on an old TMP file
 REP 16/11	;12C11
	NOTBAT:	MOVX	T1,.FHSLF+CZ%NIF+CZ%ABT ;[1623] Abort I/O for this process
		CLZFF%			;[1623] Close open files and release all JFNs
 WIT
	NOTBAT:	MOVX	T1,.FHSLF+CZ%NIF+CZ%ABT ; Abort I/O for this process
		CLZFF%			; Close open files and release all JFNs
 REP 26/11	;12C12
	GOTBAT:	MOVX	T1,.FHSLF+CZ%NIF+CZ%ABT ;[1623] Abort I/O for this process
		CLZFF%			;[1623] Close open files and release all JFNs
 WIT
	GOTBAT:	MOVX	T1,.FHSLF+CZ%NIF+CZ%ABT ; Abort I/O for this process
		CLZFF%			; Close open files and release all JFNs
 REP 33/11	;12C13
		MOVE	T2,STATE+.CMBFP	;[1603] Disable CONTROL/H feature under batch
		MOVEM	T2,STATE+.CMPTR	;[1603] Disable CONTROL/H feature under batch
 WIT
		MOVE	T2,STATE+.CMBFP	; Disable CONTROL/H feature under batch
		MOVEM	T2,STATE+.CMPTR	; Disable CONTROL/H feature under batch
 REP 3/13	;12C14
	; [1563] /PLB
 WIT
	;  /PLB
 REP 12/13	;12C15
	; [1563] /PLB
 WIT
	;  /PLB
 REP 1/17	;12C16
	.HELP:				;[1611] Routine added
 WIT
	.HELP:				; Routine added
 REP 96/19	;12C17
		HRLZM	P2,RUNOFF	;[1611] Store the start address offset
		MOVSI	17,RUNCOD	;[1611] Load Run code into the registers
		BLT	17,13		;[1611] Move the code into the registers
		HRRM	RUNERR,RUNJFN	;[1611] Store JFN of file to run
		MOVE	RUNERR,.JBERR	;[1611] Get this fork's error count
					;[1611] Store error count for run code
		JRST	4		;[1611] Do the run code
 WIT
		HRLZM	P2,RUNOFF	; Store the start address offset
		MOVSI	17,RUNCOD	; Load Run code into the registers
		BLT	17,13		; Move the code into the registers
		HRRM	RUNERR,RUNJFN	; Store JFN of file to run
		MOVE	RUNERR,.JBERR	; Get this fork's error count
					; Store error count for run code
		JRST	4		; Do the run code
 REP 28/20	;12C18
		MOVE	P2,ECHOFLG	;[1645] Assume current value of the echo switch
 WIT
		MOVE	P2,ECHOFLG	; Assume current value of the echo switch
 REP 35/20	;12C19
		 JRST	TAKLVL		;[1673] Yes--Check that this /TAKE is not
					; too many levels deep

		HRRZ	P2,(T2)		;[1645] /ECHO or /NOECHO was given--get new
 WIT
		 JRST	TAKLVL		; Yes--Check that this /TAKE is not
					; too many levels deep

		HRRZ	P2,(T2)		; /ECHO or /NOECHO was given--get new
 REP 47/20	;12C20
		 JRST	READF		;[1673] No--It is OK to do the /TAKE
		SOS	TDEPTH		;[1673] Since we didn't really nest
 WIT
		 JRST	READF		; No--It is OK to do the /TAKE
		SOS	TDEPTH		; Since we didn't really nest
 REP 56/20	;12C21
		HRROI	T1,[ASCIZ \CMD /TAKE:\]		;[1673]
		PSOUT%			;[1673]
		MOVEI	T1,.PRIOU	;[1673] Output goes to terminal
		HRRZ	T2,P1		;[1673] Get optional JFN of source
		MOVE	T3,[FLD(.JSSSD,JS%DEV)+FLD(.JSSSD,JS%DIR)+FLD(.JSSSD,JS%NAM)+FLD(.JSAOF,JS%TYP)+JS%PAF]	;[1673]
		JFNS%			;[1673]
		HRROI	T1,[ASCIZ \ is ignored
	\]				;[1673]
		PSOUT%			;[1673]
		JRST	RET.OK		;[1673] Not an error, since we can recover
 WIT
		HRROI	T1,[ASCIZ \CMD /TAKE:\]		;
		PSOUT%			;
		MOVEI	T1,.PRIOU	; Output goes to terminal
		HRRZ	T2,P1		; Get optional JFN of source
		MOVE	T3,[FLD(.JSSSD,JS%DEV)+FLD(.JSSSD,JS%DIR)+FLD(.JSSSD,JS%NAM)+FLD(.JSAOF,JS%TYP)+JS%PAF]	;
		JFNS%			;
		HRROI	T1,[ASCIZ \ is ignored
	\]				;
		PSOUT%			;
		JRST	RET.OK		; Not an error, since we can recover
 REP 54/25	;12C22
		CAIE	T2,DESX1	;[1711] Was error "invalid source designator"?
		 PJRST	MONERR		;[1711] No--Some strange error happened

		HLRZ	T2,CMDSOU	;[1711] Get source of command
		CAIE	T2,FRMTTY	;[1711] Was source designator the terminal?
		 PJRST	MONERR		;[1711] No--Some strange error happened

		;[1711] The "error" was that the primary input JFN is illegal.  This
		;[1711] means that the compiler is being run as a background fork.
		;[1711] Since the compiler cannot get another command string, simply
		;[1711] exit.

		HALTF%			;[1711]
		JRST	RET.OK		;[1711] Try and get a new command ...
 WIT
		CAIE	T2,DESX1	; Was error "invalid source designator"?
		 PJRST	MONERR		; No--Some strange error happened

		HLRZ	T2,CMDSOU	; Get source of command
		CAIE	T2,FRMTTY	; Was source designator the terminal?
		 PJRST	MONERR		; No--Some strange error happened

		; The "error" was that the primary input JFN is illegal.  This
		; means that the compiler is being run as a background fork.
		; Since the compiler cannot get another command string, simply
		; exit.

		HALTF%			;
		JRST	RET.OK		; Try and get a new command ...
 REP 25/27	;12C23
		MOVX	T1,GJ%SHT+GJ%OLD ;[1623] Short arg block, File must exist
		HRROI	T2,INIFIL	;[1623] Filename of SWITCH.INI is in INIFIL
		GTJFN%			;[1623]
		 JRST	NOINI		;[1623] Failure return--maybe no file at all?
		HRRZ	P4,T1		;Save JFN of switch file for later use

		SETZ	P3,		;[1611] No lines yet selected from SWITCH.INI
 WIT
		MOVX	T1,GJ%SHT+GJ%OLD ; Short arg block, File must exist
		HRROI	T2,INIFIL	; Filename of SWITCH.INI is in INIFIL
		GTJFN%			;
		 JRST	NOINI		; Failure return--maybe no file at all?
		HRRZ	P4,T1		;Save JFN of switch file for later use

		SETZ	P3,		; No lines yet selected from SWITCH.INI
 REP 39/27	;12C24
		 JRST	[CAIN T1,OPNX31 ;[1672] Did open fail because file was offline?
			  JRST RET.OK	;[1672] Yes--Not an error, just return
			 JRST  IOERR]	;[1672] No--We have a real I/O error
 WIT
		 JRST	[CAIN T1,OPNX31 ; Did open fail because file was offline?
			  JRST RET.OK	; Yes--Not an error, just return
			 JRST  IOERR]	; No--We have a real I/O error
 REP 56/27	;12C25
		CAIE	T2,"N"		;[1611] Is character the optional "N"
		 JRST	DIFFER		;[1611]No--make sure char doesn't differentiate
					;[1611] compiler from some other program
		BIN%			;[1611] Get character following the "N"
		 ERJMP	EOF		;[1611]
		CAILE	T2,140		;[1611] Is character lower case?
		 SUBI	T2,40		;[1611] Yes--Convert to upper case
 WIT
		CAIE	T2,"N"		; Is character the optional "N"
		 JRST	DIFFER		;No--make sure char doesn't differentiate
					; compiler from some other program
		BIN%			; Get character following the "N"
		 ERJMP	EOF		;
		CAILE	T2,140		; Is character lower case?
		 SUBI	T2,40		; Yes--Convert to upper case
 REP 104/27	;12C26
		SETO	P3,		;[1611] At least one line has been selected
 WIT
		SETO	P3,		; At least one line has been selected
 REP 175/27	;12C27
	IOERR:	MOVEM	P2,ECHOFLG	;[1645] Restore the /ECHO flag
 WIT
	IOERR:	MOVEM	P2,ECHOFLG	; Restore the /ECHO flag
 REP 180/27	;12C28
		PSOUT%			;[1672]
 WIT
		PSOUT%			;
 REP 189/27	;12C29
	\]				;[1672]
		PSOUT%			;[1672]
		JRST	RET.ERR		;[1672] Return and signal error

	CLOSE:	MOVEM	P2,ECHOFLG	;[1645] Restore the /ECHO flag
 WIT
	\]				;
		PSOUT%			;
		JRST	RET.ERR		; Return and signal error

	CLOSE:	MOVEM	P2,ECHOFLG	; Restore the /ECHO flag
 REP 199/27	;12C30
		JUMPN	P3,RET.OK	;[1611] If at least one line was select, all OK
		SKIPN	OPTION		;[1611]If the user didn't give a /OPTION switch
		 JRST	RET.OK		;[1611] then all is OK
 WIT
		JUMPN	P3,RET.OK	; If at least one line was select, all OK
		SKIPN	OPTION		;If the user didn't give a /OPTION switch
		 JRST	RET.OK		; then all is OK
 REP 208/27	;12C31
		PSOUT%			;[1611]
 WIT
		PSOUT%			;
 REP 212/27	;12C32
	NOINI:	CAIE	T1,GJFX24	;[1623] Was file not found?
		 CAIN	T1,GJFX18	;[1623] Was there no such filename?
		  JRST	RET.OK		;[1623] Yes--no switch file exits, just return
		CAIN	T1,GJFX19	;[1623] Was there no such filetype?
		 JRST	RET.OK		;[1623] Yes--no switch file exits, just return
 WIT
	NOINI:	CAIE	T1,GJFX24	; Was file not found?
		 CAIN	T1,GJFX18	; Was there no such filename?
		  JRST	RET.OK		; Yes--no switch file exits, just return
		CAIN	T1,GJFX19	; Was there no such filetype?
		 JRST	RET.OK		; Yes--no switch file exits, just return
 REP 220/27	;12C33
		HRROI	T1,[ASCIZ \CMD Can't read SWITCH.INI -- \] ;[1623]
		PSOUT%			;[1623]
		MOVX	T1,.PRIOU	;[1623] Primary output stream
		HRLOI	T2,.FHSLF	;[1623] This process' most recent error
		SETZ	T3,		;[1623] Write all of message
		ERSTR%			;[1623]
		 NOOP			;[1623] Unknown error return
		 NOOP			;[1623] Bad call to ERSTR% return
		HRROI	T1,[ASCIZ \
	\]				;[1623]
		PSOUT%			;[1623]
		JRST	RET.OK		;[1623]
 WIT
		HRROI	T1,[ASCIZ \CMD Can't read SWITCH.INI -- \] ;
		PSOUT%			;
		MOVX	T1,.PRIOU	; Primary output stream
		HRLOI	T2,.FHSLF	; This process' most recent error
		SETZ	T3,		; Write all of message
		ERSTR%			;
		 NOOP			; Unknown error return
		 NOOP			; Bad call to ERSTR% return
		HRROI	T1,[ASCIZ \
	\]				;
		PSOUT%			;
		JRST	RET.OK		;
 REP 91/29	;12C34
		 POINT	7,[ASCIZ \command file \]		 ;[1657]
 WIT
		 POINT	7,[ASCIZ \command file \]		 ;
 SUM 53791