Google
 

Trailing-Edge - PDP-10 Archives - bb-bt99g-bb - direct.c12
There are no other files named direct.c12 in the archive.
 REP 1/1	;12C1
		TITLE	DIRECT %6(450) DIRECTORY LISTING CUSP
 WIT
		TITLE	DIRECT %6A(470) DIRECTORY LISTING CUSP
 REP 25/2	;12C2
	DRTMIN==0		;DEC MINOR VERSION
	DRTEDT==450		;DEC EDIT VERSION
 WIT
	DRTMIN==1		;DEC MINOR VERSION
	DRTEDT==470		;DEC EDIT VERSION

 INS 140/10	;12C3
	;451	SPR 10-33907	RDH	3-Jan-84
	;	/TITLE misaligned if /WORDS specified.
	;
	;452	SPR 10-33368	RDH	3-Jan-84
	;	/PRDIR/PRDEV confuses multi-column listing (/WIDTH) if /HDSDIR
	;
	;453	SPR 10-34256	AQH/RDH	3-Jan-84
	;	/MVOLUME doesn't work with MDA-controlled tapes (/LABEL:USER-EOT)
	;
	;454	SPR 10-32532	RDH	12-Jan-84
	;	/FNDBLD of a BACKUP/INTERCHANGE tape writes garbage for directories.
	;
	;455	No SPR		RDH	12-Jan-84
	;	Add new DEVOP. error codes
	;
	;456	RDH	20-Mar-84	SPR 10-34253
	;	/MVOLUME confused by multiple save-set names on continuation tapes
	;
	;DIRECT %6A
	;
	;462	RDH	2-Feb-85	SPR 10-35076
	;	Issue the "Attributes May be Wrong" message no more than once
	;	per tape save set.
	;
	;463	RDH	13-Feb-85	SPR 10-34249
	;	Spurious "%Tape mark..." messages
	;
	;464	RDH	13-Feb-85	SPR 10-34253
	;	Inform user of BACKUP file which crosses volume boundry, and
	;	list the file only when actual EOF is reached.
	;
	;465	RDH	14-Feb-85	No SPR
	;	BACKUP doesn't light GF$RPT for repeater records, so look for
	;	record number being repeated (otherwise reported file checksum
	;	is wrong). Add DRTSBR Skipping record message to indicate that
	;	a BACKUP/FRS repeater record was encountered. Add /SBRMSG to
	;	control issuance of said message (default is no message).
	;
	;466	RDH	15-Feb-85	SPR 10-34255
	;	/MVOLUME may fail for INTERCHANGE tapes.
	;
	;467	RDH	8-JUN-85	QAR 868067
	;	/DETAIL heading for .RBIDT wrong.
	;
	;470	RDH	25-Jul-85	SPR 10-35230
	;	/ACCOUNT doesn't work for listing BACKUP-format tapes - the
	;	account string is not copied from the file attributes block
	;	on tape into the "LOOKUP" block for typeout. Also setup .RBIDT.
	;
 REP 34/13	;12C4
	DQ PRD;	PREVIOUS STR
 WIT
	DQ IDT; BACKUP INCREMENTAL DATE/TIME
 INS 15/14	;12C5
	G$SEQN==1	;[465] RECORD SEQUENCE NUMBER
 INS 34/14	;12C6
	A$ACCT==11	;[470] ACCOUNT STRING (BYTE POINTER)
 INS 40/14	;12C7
	A$BKDT==24	;[470] LAST BACKUP DATE/TIME
 INS 8/29	;12C8
		SKIPLE	S.HDSD		;[452] DOING /HDSDIR FORMAT LISTING?
		JRST	GLDEW6		;[452] YES, THEN /PRDIR/PRDEV DON'T COUNT
 INS 21/29	;12C9
		SKIPLE	S.HDSD		;[452] DOING /HDSDIR FORMAT LISTING?
		JRST	GLDEW4		;[452] YES, THEN /PRDIR/PRDEV DON'T COUNT
 INS 25/29	;12C10
	GLDEW4:				;[452]
 INS 16/68	;12C11
		TLNE	F,L.BPOP	;[464] IN MIDST OF DATA FILE?
		PUSHJ	P,[MOVEI M,[ASCIZ\ reading file \]  ;[464] YES
			PUSHJ	P,LSTR		;[464] SO TELL USER
			PUSHJ	P,LSTFNM	;[464] LIST THE FILE NAME
			PUSHJ	P,LDOT		;[464] SEPARATE NAME AND EXTENSION
			HLLZ	T2,FEXT		;[464] EXTRACT THE EXTENSION
			PJRST	LSIXN]		;[464] AND LIST IT TOO
 REP 20/68	;12C12
		MTUNL.	DC,		;[412] YES - UNLOAD OLD TAPE
 WIT
	;[453]	MTUNL.	DC,		;[412] YES - UNLOAD OLD TAPE
		CLOSE	DC,		;[463] BLAST THE "EOF" I/O STATUS
 REP 6/69	;12C13
	MTFEO2:	MOVEI	T1,[ASCIZ/$Mount next volume, type "C" to continue, "E" to exit: /]
 WIT
	MTFEO2:	TLNN	F,L.MLBP	;[453] CONTROLLED BY MDA?
		JRST	MTFEO4		;[453] NO, ASK USER TO MANUALLY MOUNT NEW TAPE
		MOVEI	T1,[ASCIZ\"Asking MDA for automatic volume-switch . . .
	\]				;[453] NICE INFORMATIVE TEXT
		PUSHJ	P,.TSTRG##	;[453] TO TELL THE USER WHAT IS HAPPENING
		MOVEI	T3,DC		;[453] TAPE CHANNEL
		MOVEI	T2,.TFFEV	;[453] TAPOP. FUNCTION
		MOVE	T1,[2,,T2]	;[453] AND TAPOP. ARG POINTER TO
		TAPOP.	T1,		;[453] ASK MONITOR/MDA TO SWITCH VOLUMES
		 SKIPA	P3,T1		;[453] FAILED!
		JRST	MTFEO5		;[453] CONTINUE PROCESSING NEXT TAPE VOLUME
		N$FAIO	(CGN,Couldn't get next volume, error )

	MTFEO4:	MTUNL.	DC,		;[453] PUNT CURRENT TAPE VOLUME
		MOVEI	T1,[ASCIZ/$Mount next volume, type "C" to continue, "E" to exit: /]
 REP 23/69	;12C14
		POP	P,T1		;[412] RESTORE ADDRESS OF TYPEOUT
 WIT
	MTFEO5:	POP	P,T1		;[412] RESTORE ADDRESS OF TYPEOUT
 REP 5/72	;12C15
	MTFCSS:	MOVEI	T1,[ASCIZ /continue/]
		SKIPA
	MTFSSS:	MOVEI	T1,[ASCIZ /start/]
 WIT
	MTFSSS:	MOVEI	T1,[ASCIZ /start/]  ;[462] INDICATE START OF SAVE SET
		SETOM	AMWCNT		;[462] INIT AMW COUNTER ONLY ON "START"
		CAIA			;[462] JOIN COMMON START/CONTINUE CODE
	MTFCSS:	MOVEI	T1,[ASCIZ /continue/]  ;[462] INDICATE CONTINUATION
 INS 25/72	;12C16
		SETZM	B$HRTN		;[456] CLEAR NEW-TAPE-VERIFICATION FLAG
 REP 42/79	;12C17
		PUSHJ	P,[N$WARN (AMW,<File attributes may be wrong, proceeding . . .>)  ;[417]
 WIT
		PUSHJ	P,[AOSE	AMWCNT		;[462] FIRST TIME THIS SAVE SET?
			POPJ	P,		;[462] NO, IGNORE FURTHER JUNK
			N$WARN (AMW,<File attributes may be wrong, proceeding . . .>)  ;[417]
 REP 24/81	;12C18
		MOVE	T1,B$BATT+A$PCAW;GET PRIV USER WORD
		MOVEM	T1,FPCA		;STORE
 WIT
		MOVE	T1,B$BATT+A$BKDT;[470] BACKUP DATE/TIME
		MOVEM	T1,FIDT		;[470] STORE AS BACKUP INCREMENTAL DATE/TIME
		MOVE	T1,B$BATT+A$PCAW;GET PRIV USER WORD
		MOVEM	T1,FPCA		;STORE
		SKIPN	T1,B$BATT+A$ACCT;[470] ACCOUNT STRING BYTE POINTER
		JRST	MTFDFL		;[470] NONE
		MOVE	T2,[POINT 7,FACT]  ;[470] PROTOTYPE .RBACT STRING POINTER
		MOVEI	T4,<<.RBAC8-.RBACT+1>*5>-1  ;[470] MAXIMUM CHARACTER COUNT
		PUSHJ	P,MTGTST	;[470] GET (AND COPY) ACCOUNT STRING
 INS 40/97	;12C19
	;[470] MTGTST -- ROUTINE TO COPY ASCIZ ATTRIBUTE STRING
	;CALL:	T1/ RELATIVE BYTE POINTER TO ATTRIBUTE BLOCK
	;	T2/ DESTINATION BYTE POINTER
	;	T3/ SCRATCH
	;	T4/ MAXIMUM BYTE COUNT
	;
	;	PUSHJ	P,MTGTST
	;	RETURN
	;
	;<MAXIMUM> BYTES WILL BE COPIED (NULL FILLED WHEN ATTRIBUTES STRING
	;TERMINATES), THEN A NULL WILL BE APPENDED.

	MTGTST:	CAIE	T1,0		;NULL POINTER?
		ADDI	T1,B$BATT	;NO, RELOCATE POINTER INTO ATTRIBUTES BLOCK
		SKIPA	T3,T1		;SKIP INTO LOOP
	MTGTS1:	IDPB	T3,T2		;STORE NEXT STRING CHARACTER
		CAIE	T3,0		;NO MORE CHARACTERS AFTER A NULL
		ILDB	T3,T1		;FETCH NEXT STRING CHAR FROM ATTRIBUTES BLOCK
		SOJGE	T4,MTGTS1	;LOOP FOR ALL CHARACTERS
		SETZ	T3,		;FORCE A NULL CHARACTER
		IDPB	T3,T2		;TO TERMINATE THE COPIED ASCIZ STRING
		POPJ	P,		;ALL DONE, RETURN
 REP 16/103	;12C20
	VERNOF:	TLNE	F,L.SVST!L.BKSS!L.FRSS  ;SEE IF MAG TAPE	[230]
		JRST	FILEND		;YES--SKIP THE CLOSES
		TRZN	F,R.ACCS	;SEE IF ACCESS NEEDED
 WIT
	VERNOF:	TLNN	F,L.SVST!L.BKSS!L.FRSS  ;[464] SEE IF MAG TAPE
		JRST	FILCLS		;[464] NO, CLOSE OFF DATA FILE THEN
	VERNOM:	PUSHJ	P,NEXDTW	;[464] READ A FILE DATA WORD
		 JRST	FILEND		;[464] AT EOF, TIME TO LIST FILE
		SETZM	BFHD+.BFCTR	;[464] TOSS REST OF RECORD
		JRST	VERNOM		;[464] GO 'TILL EOF

	FILCLS:	TRZN	F,R.ACCS	;[464] SEE IF ACCESS NEEDED
 REP 48/108	;12C21
		MOVEI	C,"."		;YES--USE DOT (IT'S FASTER)
 WIT
	LDOT:	MOVEI	C,"."		;[464] YES--USE DOT (IT'S FASTER)
 REP 7/115	;12C22
	DLPRVS:	SKIPN	T2,FPRD		;GET PREVIOUS STR
		JRST	DLPCAR
		MSG	<Previous structure>
		PUSHJ	P,LSIXN
 WIT
	DLPRVS:	SKIPN	T2,FIDT		;[467] GET BACKUP INCREMENTAL DATE/TIME
		JRST	DLPCAR
		MSG	<"BACKUP" incremental date, time>
		PUSHJ	P,.CNTDT##	;[467] CONVERT TO EASY FORMAT
		PUSHJ	P,LDATIM	;[467] LIST DATE/TIME
 REP 29/122	;12C23
		JRST	[CAIE	T1,T$FIL;[412] NO, FILE RECORD?
 WIT
		JRST	[CAIN	T1,T$FIL;[466] NO, FILE RECORD?
 REP 10/125	;12C24
		MOVE	T1,@BFHD+.BFADR	;GET POINTER TO NEXT BUFFER
		SKIPL	.BFHDR-1(T1)	;MAKE SURE IT IS FULL
		JRST	FRSLHG		;NO--ASSUME ALL OK
		SKIPL	B$GTYP		;IS IT FRS OR BACKUP
		SKIPA	T1,.BFCNT+G$FLAG(T1) ;BACKUP--GET FLAGS		[302]
		HRLZ	T1,.BFCNT(T1)	;FRS--GET FLAGS
		TXNN	T1,GF$RPT	;IS IT A REPEAT			[302]
		JRST	FRSLHG		;NO--OK TO RETURN
		POP	P,(P)		;DISCARD OLD RECORD
		SETZM	BFHD+.BFCTR	; ..
		PUSHJ	P,NEXDT		;GET NEXT
		  TLO	F,L.FKEF	;EOF!
		JRST	FRSLAH		;AND TRY AGAIN

	FRSLHG:	POP	P,T1		;RESTORE FIRST WORD
		POPJ	P,		;RETURN
 WIT
		PUSH	P,T2		;[465] AND T2 TOO
	FRSLA1:	MOVE	T1,@BFHD+.BFADR	;[465] GET POINTER TO NEXT BUFFER
		SKIPL	.BFHDR-1(T1)	;MAKE SURE IT IS FULL
		JRST	[WAIT	DC,		;[465] LET THE TAPE CATCH UP
			SKIPL	.BFHDR-1(T1)	;[465] GOT THE NEXT BUFFER NOW?
			JRST	FRSLA9		;[465] NO, JUST GIVE UP THEN
			JRST	.+1]		;[465] YES, CHECK FOR REPEATER
		SKIPL	B$GTYP		;IS IT FRS OR BACKUP
		SKIPA	T2,.BFCNT+G$FLAG(T1) ;BACKUP--GET FLAGS
		HRLZ	T2,.BFCNT(T1)	;FRS--GET FLAGS
		TXNE	T2,GF$RPT	;[465] IS IT A REPEAT
		JRST	FRSLA5		;[465] DEFINITELY A REPEATER
		SKIPGE	B$GTYP		;[465] BACKUP OR FRS?
		JRST	FRSLA9		;[465] FRS, ASSUME OK
		MOVE	T2,.BFCNT+G$SEQN(T1)  ;[465] BACKUP, GET NEXT RECORD NUMBER
		MOVE	T1,BFHD+.BFADR	;[465] POINT BACK TO CURRENT BUFFER
		CAME	T2,.BFCNT+G$SEQN(T1)  ;[465] RECORD NUMBER REPEATED?
		JRST	FRSLA9		;[465] NO, THIS BUFFER/RECORD IS OK

	FRSLA5:	PUSHJ	P,FRSSBR	;[465] TELL USER OF WOES
		SETZM	BFHD+.BFCTR	;[465] DISCARD CURRENT (REPEATED) RECORD
		PUSHJ	P,NEXDT		;GET NEXT
		  TLO	F,L.FKEF	;EOF!
		MOVEM	T1,-1(P)	;[465] SET NEW "FIRST" WORD
		JRST	FRSLA1		;[465] AND TRY AGAIN

	FRSLA9:	POP	P,T2		;[465] RESTORE TRASHED AC
		POP	P,T1		;RESTORE FIRST WORD
		POPJ	P,		;RETURN


	;[465] TELL USER OF REPEATER RECORDS BEING SKIPPED (IF HE CARES)

	FRSSBR:	SKIPG	S.SBRM		;[465] USER CARE (/SBRMSG)?
		POPJ	P,		;[465] NO, DON'T MESS UP HER LISTING
		PUSHJ	P,.PSH4T##	;[465] YES, PROTECT THE TEAS
		N$WRNX	(SBR,<Skipping for BACKUP/FRS repeater record>)  ;[465]
		MOVE	T1,BFHD+.BFADR	;[465] ADDRESS OF [TO BE PITCHED] BUFFER
		MOVE	T1,.BFCNT+G$SEQN(T1)  ;[465] GET THE [REPEATED] RECORD NUMBER
		PUSHJ	P,LDEC		;[465] AND LIST IT TOO
	X$$SBR:	PUSHJ	P,.TCRLF##	;[465] CAP OFF WITH A <CR><LF>
		PUSHJ	P,.POP4T##	;[465] GET THE TEAS BACK
		POPJ	P,		;[465] ADVANCE TO NEXT RECORD
 INS 37/128	;12C25
		-1,,	[ASCIZ\ (IOLRA% (23) - Labeler request aborted by RESET)\]
		-1,,	[ASCIZ\ (IOVPF% (24) - Volume protection failure)\]
		-1,,	[ASCIZ\ (IOFPF% (25) - File protection failure)\]
		-1,,	[ASCIZ\ (IOUEF% (26) - Unexpired file)\]
 INS 30/136	;12C26
		TLNN	T4,-1		;[454] PPN OR PATH POINTER?
		SKIPE	.PTPPN(T4)	;[454] PATH POINTER, ANYTHING THERE?
		CAIA			;[454] VALID DIRECTORY, TYPE IT OUT
		POPJ	P,		;[454] NULL DIRECTORY, DON'T LIST "[0]"
 INS 33/148	;12C27
	SN SBRMSG,S.SBRM,FS.NFS
 INS 9/152	;12C28
		TRNE	F,R.WORDS	;[451] /WORDS SPECIFIED?
		PUSHJ	P,LSPC4		;[451] YES, ALLOW FOR WIDER COLUMN
 REP 38/173	;12C29
		MOVE	T1,UFDPPN	;UFD/PATH POINTER
		TLNN	T1,-1		;UFD OR PATH POINTER?
		JRST	DOFND2		;PATH POINTER
		PUSHJ	P,DFPUT		;WORD 2
 WIT
		SKIPN	T1,UFDPPN	;[454] UFD/PATH POINTER
		JRST	DOFND1		;[454] BLANK, WRITE OUT 0'S
		TLNN	T1,-1		;UFD OR PATH POINTER?
		JRST	DOFND2		;PATH POINTER
	DOFND1:	PUSHJ	P,DFPUT		;[454] WORD 2
 INS 32/179	;12C30
	AMWCNT:	BLOCK	1		;[462] COUNT OF SILLY FILES THIS SAVE SET
 INS 27/185	;12C31
	S.SBRM:	BLOCK	1		;[465] /SBR MESSAGE(S) DESIRED
 SUM 139662