Google
 

Trailing-Edge - PDP-10 Archives - bb-kl11c-bm_tops20_v6_1_atpch1_16 - autopatch/alglib.c07
There are 14 other files named alglib.c07 in the archive. Click here to see a list.
 REP 25/135	;07C1
		.CH=4
		REP	DECL,5,3

	LIBENT(412,READ,.V1)
		XWD	0,3*PRMMAX+4
		XWD	$PRO!$N!$SIM,PRMMAX+1
		REP	PAR,5,3
 WIT
		REP	DECL,4,3	;[345]

	LIBENT(412,READ,.V1)
		XWD	0,3*PRMMAX+3	;[345]
		XWD	$PRO!$N!$SIM,PRMMAX+1
		REP	PAR,4,3		; [345]
 DEL 36/136	;07C2
		MOVEM	A13,.CH(DL)	; SAVE TERMINATOR

 REP 46/136	;07C3
		JRST	READ15
 WIT
		JRST	.EXIT(DL)	; [345]
 REP 31/137	;07C4
	READ8:	SETZM	.CH(DL)		; [E1017] Don't gobble a CR in this case
		SKIPN	A2,A1		; GET COUNT OF CHARACTERS
 WIT
	READ8:	SKIPN	A2,A1		; [345] GET COUNT OF CHARACTERS
 DEL 53/137	;07C5
	READ15:	MOVE	A13,.CH(DL)	; GET TERMINATOR
		CAIN	A13,15		; AND IF <CR>
		JSP	AX,INCHAR	; IGNORE <LF>
 DEL 29/151	;07C6

 REP 43/151	;07C7
		PUSH	SP,A2		; AND SAVE IT
		SKIPE	.I(DL)		; IF HE GAVE A STATUS-WORD
		XCT	1,.I(DL)	; EVALUATE ITS ADDRESS
		PUSH	SP,A2		; AND SAVE THAT
		MOVE	A2,.LU(DL)	; [324] GET ADDR. OF STRING
		MOVEI	A2,@A2		; [324] STATICISE IT
 WIT
		MOVEM	A2,A01TMP(DB)	; [346] SAVE IT
		SKIPE	.I(DL)		; IF HE GAVE A STATUS-WORD
		XCT	1,.I(DL)	; EVALUATE ITS ADDRESS
		MOVEM	A2,A01TMP+1(DB)	; [346] SAVE IT
		MOVE	A2,.LU(DL)	; [324] GET ADDR. OF STRING
		MOVEI	A2,@A2		; [324] STATICISE IT
 REP 7/152	;07C8
		PUSHJ	SP,GETCHR	; [324] GET FIRST BYTE OF FILESPEC
		 PUSHJ	SP,OPFERR	; [324] ERROR IF STRING EOF IS FOUND
		CAIG	A2,'Z'		; [324] FIRST CHR. MUST BE ALPHANUMERIC
		CAIGE	A2,'0'		; [324]
		 PUSHJ	SP,OPFERR	; [324] ISN'T, CHR. CAN'T APPEAR HERE
		JRST	OPFNM1		; [324] NO, BEGIN BUILDING FILENAME
 WIT
	SPC1:	PUSHJ	SP,GETCHR	; [346] GET FIRST BYTE OF FILESPEC
		 JSP	A0,OPFERR	; [346] ERROR IF STRING EOF IS FOUND
		CAIN	A2,' '		; [346] SPACE?
		 JRST	SPC1		; [346] YES, IGNORE
		CAIG	A2,'Z'		; [324] FIRST CHR. MUST BE ALPHANUMERIC
		CAIGE	A2,'0'		; [324]
		 JSP	A0,OPFERR	; [346] ISN'T, CHR. CAN'T APPEAR HERE
		JRST	OPFNM1		; [324] BEGIN BUILDING FILENAME
 INS 21/152	;07C9
		CAIN	A2,','		; [346] COMMA IN FILENAME?
		 JSP	A0,OPFERR	; [346] YES, ILLEGAL
		CAIN	A2,' '		; [346] SPACE IN FILENAME?
		 JRST	SPCDO		; [346] YES, GO EXPECT EOF OR OPEN-BRACKET
 REP 26/152	;07C10
		CAIN	A2,'['		; [324] BEGINNING OF PPN SPEC.?
		 JRST	OPFPPN		; [324] YES, GO PARSE IT
		CAIE	A2,'.'		; [324] NO, POINT?
		 PUSHJ	SP,OPFERR	; [324] NO, FILESPEC IS BAD
 WIT
		CAIE	A2,'.'		; [346] DOES EXTENSION FOLLOW?
		 JRST	SPCDO1		; [346] NO, GO CHECK SPACES/EOF/OPEN-BRACKET
 INS 38/152	;07C11
		CAIN	A2,','		; [346] NO, COMMA IN EXTENSION?
		 JSP	A0,OPFERR	; [346] YES, ERROR
		CAIN	A2,' '		; [346] NO, SPACE?
		 JRST	SPCDO		; [346] YES, GO EXPECT EOF OR OPEN-BRACKET
 REP 41/152	;07C12
		PUSHJ	SP,GETCHR	; [324] GET NEXT CHR.
		 JRST	OPFNOW		; [324] GO OPEN FILE IF STRING EOF IS FOUND
		CAIE	A2,'['		; [324] BEGINNING OF PPN SPEC?
		 PUSHJ	SP,OPFERR	; [324] NO, BAD FILESPEC
 WIT
	SPCDO:	PUSHJ	SP,GETCHR	; [346] GET NEXT CHR.
		 JRST	OPFNOW		; [324] GO OPEN FILE IF STRING EOF IS FOUND
	SPCDO1:	CAIN	A2,' '		; [346] SPACE?
		 JRST	SPCDO		; [346] YES, IGNORE IT RIGHT NOW
		CAIE	A2,'['		; [324] BEGINNING OF PPN SPEC?
		 JSP	A0,OPFERR	; [346] NO, BAD FILESPEC
 REP 48/152	;07C13
		 JRST	[JUMPE	A3,OPFERR	; [324] DON'T ALLOW EOF AFTER BRACKET
			MOVEI	A2,']'		; [324] OK, FAKE OURSELVES OUT
			JRST	.+1]		; [324] AND CONTINUE
		HRLZ	A7,A3		; [324] SAVE PROJECT NUMBER IN A7 LEFTHALF
		CAIN	A2,']'		; [324] END OF ENTIRE FILESPEC?
		 JRST	OPFPP1		; [324] YES, GO BUILD PPN AND OPEN FILE
		PUSHJ	SP,GETPP	; [324] NO, GET PROGRAMMER NUMBER
		 MOVEI	A2,']'		; [324] EOF, FAKE OURSELVES OUT
		HRR	A7,A3		; [324] MAKE COMPLETE PPN
 WIT
		 JSP	A0,OPFERR	; [346] EOF, DON'T ALLOW IT AFTER OPEN-BRACKET
		CAIE	A2,']'		; [346] WAS DELIMITER A CLOSE-BRACKET OR
		CAIN	A2,' '		; [346] A SPACE?
		 JSP	A0,OPFERR	; [346] YES, BAD FILESPEC
		HRLZ	A7,A3		; [324] SAVE PROJECT NUMBER IN A7 LEFTHALF
		SETZ	A2,		; [346] NO, CLEAR DELIMITER
		PUSHJ	SP,GETPP	; [346] GET PROGRAMMER NUMBER
		 JRST	OPFPP0		; [346] EOF, GO PARSE WHAT WE HAVE
		CAIE	A2,']'		; [346] WAS DELIMITER CLOSE-BRACKET OR
		CAIN	A2,' '		; [346] SPACE?
		TRNA			; [346] YES, LOOK FOR EOF
		 JSP	A0,OPFERR	; [346] NO, BAD FILESPEC
	SPEOF0:	PUSHJ	SP,GETCHR	; [346] ALLOW SPACES UNTIL EOF BUT NOTHING ELSE
		 JRST	OPFPP0		; [346] FOUND EOF, GO OPEN FILE
		CAIN	A2,' '		; [346] MORE SPACES?
		 JRST	SPEOF0		; [346] YES, LOOP
		JSP	A0,OPFERR	; [346] NO, BAD FILESPEC

	OPFPP0:	HRR	A7,A3		; [346] MAKE COMPLETE PPN
 REP 73/152	;07C14
		MOVE	A5,.PP(DL)	; [324] GET PATH BLOCK ADDR.
		PUSHJ	SP,OPFILE	; [324] AND GO OPEN FILE
		POP	SP,A2		; [324] GET ADDR. OF I (OR 0)
		JUMPE	A0,[POP	SP,(SP)		; [324] RESTORE LABEL ADDR.
			JRST	.EXIT(DL)]	; [324] AND EXIT
		SUBI	A0,100		; [324] ERROR CODE HAS 100 ADDED TO IT BY OTS
		SKIPE	.I(DL)		; [324] HAVE ANYPLACE TO PUT ERROR CODE?
		XCT	.I+1(DL)	; [324] YES, PLANY CODE
		POP	SP,A2		; [324] GET LABEL ADDRESS
		JUMPN	A2,(A2)		; [324] TAKE ERROR EXIT IF ONE EXISTS
 WIT
		MOVE	A5,.PP(DL)	; [346] GET PPN
		PUSHJ	SP,OPFILE	; [324] AND GO OPEN FILE
		 JUMPE	A0,.EXIT(DL)	; [346] AND EXIT
		SUBI	A0,100		; [324] ERROR CODE HAS 100 ADDED TO IT BY OTS
		MOVE	A2,A01TMP+1(DB)	; [346] GET ADDR. OF I (OR 0)
		SKIPE	.I(DL)		; [324] HAVE ANYPLACE TO PUT ERROR CODE?
		 XCT	.I+1(DL)	; [324] YES, PLANT CODE
		MOVE	A2,A01TMP(DB)	; [346] GET ADDR. OF LABEL, OR 0
		 JUMPN	A2,(A2)		; [324] TAKE ERROR EXIT IF ONE EXISTS
 REP 87/152	;07C15
	; [324] GET UP TO SIX OCTAL NUMBERS IN A3 RIGHTHALF.  USED IN BUILDING PPN.
	; [324] DELIMITING CHR. IS LEFT IN A2.
 WIT

	;[346] SUBROUTINES

	; GET UP TO SIX OCTAL NUMBERS IN A3 RIGHTHALF.  USED IN BUILDING PPN.
	; DELIMITING CHR. IS LEFT IN A2.
 INS 93/152	;07C16
		CAIE	A2,' '		; [346] SPACE OR
 REP 99/152	;07C17
		 PUSHJ	SP,OPFERR	; [324] NO, BAD SPEC.
 WIT
		 JSP	A0,OPFERR	; [346] NO, BAD SPEC.
 REP 106/152	;07C18
		 JRST	AOSRET		; [324] YES, END OF PROJECT NUMBER
 WIT
		 JRST	AOSRET		; [324] END OF PROJECT NUMBER IF EOF
 REP 111/152	;07C19
		PUSHJ	SP,OPFERR	; [324] NO, BAD FILESPEC

	; [324] GET SIXBIT BYTE SUBROUTINE - RETURNS THE NEXT SIXBIT CHARACTER OF
	; [324] THE FILESPEC IN A2.  THE CHR. IS GUARANTEED TO BE A LEGITIMATE
	; [324] SIXBIT FILESPEC-TYPE CHR. (UPPERCASE, ALPHANUMERIC, COMMA, OPEN
	; [324] OR CLOSE BRACKET, OR PERIOD).
	; [324]
	; [324]	RETURN:	+1	END OF FILESPEC STRING
	; [324]		+2	NORMAL, A2/ SIXBIT CHR.
	; [324]
	; [324]
 WIT
		JSP	A0,OPFERR	; [346] NO, BAD FILESPEC


	; GET SIXBIT BYTE SUBROUTINE - RETURNS THE NEXT SIXBIT CHARACTER OF THE
	; FILESPEC IN A2.  THE CHR. IS GUARANTEED TO BE A LEGITIMATE SIXBIT
	; FILESPEC-TYPE CHR. (UPPERCASE, ALPHANUMERIC, COMMA, OPEN OR CLOSE BRACKET,
	; OR PERIOD).  REPEATED CALLS CAN BE MADE AFTER EOF IS DETECTED - GETCHR WILL
	; CONTINUE TO TAKE THE EOF RETURN.
	;
	;	RETURN:	+1	END OF STRING
	;		+2	NORMAL, A2/ SIXBIT CHR.
	;
	;
 REP 129/152	;07C20
		 TRNA			; [324] SKIP IF GOOD SO FAR
		 PUSHJ	SP,OPFERR	; [324] ELSE BAD CHR.
 WIT
		TRNA			; [324] SKIP IF GOOD SO FAR
		 JSP	A0,OPFERR	; [346] ELSE BAD CHR.
 REP 134/152	;07C21
		CAIGE	A2,"0"		; [324] NO, BELOW ASCII ZERO?
		 PUSHJ	SP,OPFERR	; [324] YES, BAD CHR.
 WIT
		CAIN	A2,11		; [346] NO, TAB?
		 MOVEI	A2," "		; [346] YES, TURN IT INTO A SPACE
		CAIN	A2," "		; [346] SPACE?
		 JRST	GETCH1		; [346] YES, GOOD CHR. TOO
		CAIGE	A2,"0"		; [324] NO, BELOW ASCII ZERO?
		 JSP	A0,OPFERR	; [346] YES, BAD CHR.
 REP 139/152	;07C22
		 PUSHJ	SP,OPFERR	; [324] YES, CHR. IS BAD
 WIT
		 JSP	A0,OPFERR	; [346] YES, CHR. IS BAD
 REP 144/152	;07C23
	OPFERR:	MOVE	A1,.N(DL)	; [324] BAD FILESPEC, GET CHANNEL NUMBER BACK
 WIT
	OPFERR:	MOVEI	A0,^D346	; [346] SAY WE GOT ERROR 346. (BAD FILESPEC)
		MOVE	A2,A01TMP+1(DB)	; [346] GET ADDR. OF I (OR 0)
		SKIPE	.I(DL)		; [346] HAVE ANYPLACE TO PUT ERROR CODE?
		XCT	.I+1(DL)	; [346] YES, PLANT CODE
		MOVE	A2,A01TMP(DB)	; [346] GET ADDR. OF LABEL, OR 0
		 JUMPN	A2,(A2)		; [346] TAKE ERROR EXIT IF ONE EXISTS
		MOVE	A1,.N(DL)	; [346] ELSE GET CHANNEL NUMBER BACK
 SUM 79839