Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-03 - 43,50307/cofup.mac
There are no other files named cofup.mac in the archive.
TITLE	COFUP - CORE FILE UTILITY PROGRAM	V.1
SUBTTL MANIPULATES TEMPORARY INCORE FILES VIA TMPCOR UUO
SUBTTL	WILL WAGERS 7-AUG-73


REPEAT	0,<
FEEL FREE TO DIRECT COMMENTS TO:

	WILL WAGERS
	%RAPIDATA, INC.
	20 NEW DUTCH LANE
	FAIRFIELD, N.J. 07006

>;END REPEAT 0


PROGER==1	;WILL
RAPVER==1	;MANUFACTURER
RAPMVR==0	;MINOR VERSION
RAPEVR==1	;EDIT LEVEL

	LOC	<.JBVER==137>
	PROGER*1B2+RAPVER*1B11+RAPMVR*1B17+RAPEVR

RELOC

;BETTER MNEUMONICS

OPDEF SHIFT	[LSH]
OPDEF SHIFTC	[LSHC]
OPDEF PRINT	[OUTSTR]
OPDEF CALL	[PUSHJ	P,]
OPDEF RETURN	[POPJ	P,]
OPDEF LOADI	[MOVEI]
OPDEF LOADPC	[JRST]
OPDEF STORE	[MOVEM]
OPDEF LOAD	[MOVE]

;REGISTER ASSIGNMENTS

F=0		;FLAGS
T0=1		;FOUR VOLATILE AC'S
T1=T0+1
T2=T0+2
T3=T0+3
T4=T0+4
BP0==6		;BYTE POINTER FOR COMMAND FILE
DEVICE=7	;DEVICE FOR RUN UUO
EXT=10		;EXTENSION FOR RUN UUO
IWORD=11	;STOCK IOWD
NUMBER=12	;NUMBER ENTERED IF ANY
SWITCH=13	;SWITCH ENTERED
FILE=14		;FILE ENTERED IF ANY
CH=15		;LAST CHARACTER RECEIVED
BP=16		;SCANING BYTE POINTER
P=17		;PUSH DOWN LIST POINTER

;TMPCOR UUO ARGUMENTS

.TCRFS==0	;OBTAIN FREE SPACE
.TCRRF==1	;READ FILE
.TCRDF==2	;READ AND DELETE FILE
.TCRWF==3	;WRITE FILE
.TCRRD==4	;READ DIRECTORY
.TCRDD==5	;READ AND CLEAR DIRECTORY

;PARAMETERS FOR ASSEMBLY

COFLEN==10	;LARGEST COMANND BUFFER
BUFLEN==200	;LARGEST IN CORE AREA FOR SINGLE USER
PDLSIZ==50	;LENGTH OF PUSH DOWN LIST

;SCANNER FLAGS RESIDING IN F 

SWSAW==1	;SWITCH ENCOUNTERED (/)
FISAW==2	;FILE	"	    ( )
NOSAW==4	;NUMBER	"	    (#)
EXSAW==10	;EXTENSION "	    (.)
CLSAW==20	;DEVICE    "	    (:)

;COMMAND FLAGS RESIDING IN LH OF TABLE(N)

DELSW==40	;DELETE APRES PRINTING
NSAW==100	;/N 'SEEN'
NUMILL==1000	;NO NUMBER ARGUMENT ALLOWED CHECK
NFLILL==2000	;NO NFILE ARGUMENT ALLOWED
NOAILL==4000	;NO ARGUMENTS ALLOWED CHECK
STRILL==10000	;'*' ARGUMENT CHECK
NFLREQ==20000	;NFILE ARGUMENT CHECK
FILREQ==40000	;FILE ARGUMENT CHECK
NUMREQ==100000	;NUMBER ARGUMENT CHECK
RPGSW==200000	;RAPID PROGRAM GENERATION COMMAND FILE

CLRFLG==SWSAW+FISAW+NOSAW+EXSAW+CLSAW+NSAW+DELSW

;ASCII CODES

LF==12		;LINE FEED
CR==15		;CARRIAGE RETURN
ALT==33		;STANDARD ALTMODE
RUB==177	;RUBOUT (DELETE)
		PAGE

..:	604000000000		;NORMAL ENTRY POINT
	TLO	F,RPGSW		;RAPID PROGRAM GENERATION
	047000000000		;GOOD HABIT
	LOAD	IWORD,[-BUFLEN,,BUFFER-1] ;STOCK IOWD
	LOAD	P,[-PDLSIZ,,PDL-1] ;PUSH DOWN LIST SETUP
	CLEAR	T0,		;ARE WE WASTING OUR TIME?
	TMPCOR	T0,
	 LOADPC	[PRINT	[ASCIZ .? TMPCOR UUO IS NOT OPERATIVE IN THIS MONITOR
.]
		 EXIT ]
	TLNE	F,RPGSW		;RPG IN FORCE? 
	  CALL	GETCOF	;YES, SETUP INPUT
AGIN:	CLEARM	BUFFER		;INITIALIZE BUFFER ON EVERY CALL
	LOAD	T0,[BUFFER,,BUFFER+1]
	BLT	T0,BUFFER+177
	TRZ	F,CLRFLG	;INITIALIZE FLAGS
	CLEARB	SWITCH,EXT
	CLEARB	FILE,DEVICE
	CLEARB	NUMBER,NFILE	;CONTINUE HOUSEKEEPING
	LOADI	T4,6		;INITIALIZE INPUT COUNTER
	TLNE	F,RPGSW		
	  PRINT	[ASCIZ .
.]
	TLNN	F,RPGSW		;SKIP IF IF RPG
	  PRINT	[ASCIZ .
*.]				;TRADITIONAL HELLO
GETUN0:	LOAD	BP,[440600,,FILE]
GETUN:	CALL	INCHR		;GET A CHARACTER
	CAIN	CH,LF		;THOUGH WE PREFER LINEFEED
	 LOADPC	DISPAT		;DISPATCH TO SWITCH PROCESSOR
	CAIN	CH,"/"		;SWITCH NEXT? 
	 LOADPC	MESWT		;YEP, GO GET IT.
	CAIN	CH,"#"		;NUMBER COMING? 
	 LOADPC	MENUM		;YEP, GET IT.
	CAIN	CH,"."		;EXTENSION AHEAD? 
	 LOADPC	MEEXT		;YEP, FETCH IT
	CAIN	CH,":"		;DEVICE PRECEDED? 
	 LOADPC	MEDEV		;YEP, ADJUST
	SUBI	CH,40		;SIXBITIZE
	TRZE	F,NSAW		;/N SEEN? 
	 LOADPC	[LOAD	BP,[440600,,NFILE]
		 LOADI	T4,3	;START OVER FOR SECOND FILE NAME OF 3 CHARS
		 LOADPC    GETUN2 ]
GETUN2:	IDPB	CH,BP		;STORE 
	TRO	F,FISAW		;FILE SEEN
	SOJG	T4,GETUN	;GET UP TO 3 CHARACTERS
GETUN1:	CALL	INCHR		;NEXT CHARACTER MUST BE A "/"
	CAIG	CH,LF		;ANYTHING BUT / WILL BE ILLEGAL
	 LOADPC	DISPAT		;LET'S GET MOVING
	CAIN	CH,"/"
	 LOADPC	MESWT		;SUCCESS
	CAIN	CH,"."
	 LOADPC	MEEXT		;IM AN EXTENSION
CMDERR:	PRINT	[ASCIZ .? INDECIPHERABLE COMMAND
.]
	LOADPC    AGIN		;TRY AGAIN

DISPAT:	CAIN	SWITCH,"R"	;/R? 
	 LOADPC	.+3		;YEP, SIX CHARACTER FILE NAME PERMITTED
	TRNE	FILE,777777	;OTHERS ARE LIMITED TO 3 CHARACTERS
	 LOADPC	[PRINT	[ASCIZ .? FILE NAME MAY BE A MAXIMUM OF 3 CHARACTERS
.]
		 LOADPC    AGIN]
DISPA0:	LOADI	T0,-"@"(SWITCH)	;FETCH SWITCH VALUE
	TRNN	T0,77		;BETTER NOT BE ZERO, LF CR
	 LOADPC	[PRINT	[ASCIZ .% NO ACTION SPECIFIED

.]
		 LOADPC    AGIN ]
	CAILE	T0,LENGTH	;LEGAL SWITCH? 
	 LOADPC	[PRINT	[ASCIZ .? COMMAND INDEX TOO GREAT
.]
		LOADPC    AGIN]
	LOAD	T0,TABLE(T0)	;GET BITS,,DISPATCH
	TLNE	T0,NUMILL	;NUMBER ALLOWED? 
	 LOADPC	[SKIPE	NUMBER
		   LOADPC    [PRINT [ASCIZ .? NUMERIC SPECIFICATION NOT PERMITTED
.]
				LOADPC	AGIN ]
		 LOADPC    DISPA6 ]
DISPA6:	TLNE	T0,NOAILL	;NO ARGUMENTS ? 
	 LOADPC	[SKIPN	FILE	;YEP, NONE ALLOWED.
		 SKIPE	NFILE
		   TRNA
		 SKIPE	NUMBER
		   LOADPC    [PRINT	[ASCIZ .? NO ARGUMENTS ALLOWED
.]
			 LOADPC    AGIN]
		 LOADPC    DISPA5]
DISPA5:	TLNE	T0,NUMREQ	;NUMBER OK? 
	 LOADPC	[SKIPN	NUMBER	;NUMBER PRESENT? 
		   LOADPC [PRINT [ASCIZ .? NUMERIC ARGUMENT REQUIRED
.]
			   LOADPC    AGIN]
		 LOADPC    DISPA1]
DISPA1:	TLNE	T0,FILREQ	;FILE ARGUMENT PERMITTED? 
	 LOADPC	[SKIPN	FILE	;FILE PRESENT? 
		   LOADPC    [PRINT [ASCIZ .? FILE SPECIFICATION REQUIRED
.]
			 LOADPC    AGIN]
		 LOADPC    DISPA2]
DISPA2:	TLNE	T0,NFLREQ	;NFILE ARGUMENT OK? 
	 LOADPC	[SKIPN	NFILE	;NFILE PRESENT? 
		   LOADPC    [PRINT	[ASCIZ .? TWO FILE SPECIFICATIONS REQUIRED
 PERMITTED
.]
			 LOADPC    AGIN]
		 LOADPC    DISPA3]
DISPA3:	TLNE	T0,STRILL	;'*' ALLOWED? 
	 LOADPC	[CAIN	FILE,'*' ;ASTERISK FILE NAME? 
		   LOADPC    [PRINT	[ASCIZ .? WILD CARD SPECIFICATION NOT PERMITTED
.]
			 LOADPC    AGIN]
		 LOADPC    DISPA4]
DISPA4:	
	LOADPC    @T0		;DISPATCH

TABLE:	[PRINT	[ASCIZ .? NO SWITCH SPECIFIED
.]
			LOADPC    AGIN]
NUMREQ+STRILL+FILREQ,,$ALLOCATE		;/A - ALLOCATE A FILE #OCTAL IN LENGTH
 NYET					;/B - NOT YET IMPLEMENTED
NFLILL+STRILL,,$CREATE			;/C - CREATE A FILE, TERMINATED BY $ (ALTMODE)
NUMILL+NFLILL,,$DELETE			;/D - DELETE A FILE
NOAILL,,[EXIT]				;/E - EXIT TO MONITOR LEVEL
NOAILL,,$FREE				;/F - FREE WORDS REMAINING
 NYET					;/G
NOAILL,,$HELP				;/H - HELP WITH INSTRUCTIONS
NUMILL+NFLILL,,$INDEX			;/I - INDEX LISTING (DIRECTORY)
 NYET					;/J
 NYET					;/K
Z,,$LOAD				;/L - LOAD FROM DISK
 NYET					;/M
NUMILL+NFLILL+STRILL,,$NAME		;/N - NAME CHANGE (RENAME)
 NYET					;/O
NUMILL+NFLILL,,$PRINT			;/P - PRINT AND DELETE FILE
 NYET					;/Q
NUMILL+NFLILL+STRILL,,$RUN		;/R - RUN FILENAME.EXTENSION FROM CCL ENTRY POINT
NFLILL+STRILL,,$SUPERCEDE		;/S - SUPERCEDE THE FILE WITH THIS NAME
NUMILL+NFLILL,,$TYPE			;/T - TYPE FILE CONTENTS, TERMINATE WITH [EOF]
 NYET					;/U
NUMILL+NFLILL,,$VERIFY			;/V - VERIFY THIS FILENAME AS TO DEFINITION
 NYET					;/W
 NYET					;/X
 NYET					;/Y
NOAILL,,$ZERO				;/Z - ZERO INDEX (DIRECTORY)

LENGTH==.-TABLE
	PAGE

MESWT:	TROE	F,SWSAW		;FLAG SWITCH AS SEEN
	 LOADPC	[PRINT	[ASCIZ .? MULTIPLE SWITCHES ARE NOT MEANINGFUL
.]
			LOADPC    AGIN]
	CALL	INCHR		;GET THE SWITCH
	STORE	CH,SWITCH	;SAVE IT
	CAIN	CH,"N"		;/N? 
	  TRO	F,NSAW		;YES, FLAG FOR COMMAND SCANNER
	LOADPC    GETUN		;RETURN FOR MORE

MENUM:	TROE	F,NOSAW		;FLAG NUMBER AS SEEN
	 LOADPC	[PRINT	[ASCIZ .? MULTIPLE NUMERIC SPECIFICATIONS ARE NOT MEANINGFUL
.]
		 LOADPC    AGIN ]
	CLEAR	NUMBER,		;SETUP
	LOADI	T3,6		;ALLOW MAXIMUM OF 128K
MENUM0:	CALL	INCHR		;GET A CHARACTER
	CAIN	CH,LF		;LINEFEED? 
	 LOADPC	DISPAT		;YEP, EXECUTE SWITCH
	CAIL	CH,"0"		;OCTAL NUMBERS ONLY
	  CAILE CH,"7"		;
	    LOADPC [PRINT	[ASCIZ .
? IMPROPER NUMBER, OCTAL ONLY
.]
		 LOADPC	AGIN]
	SUBI	CH,60	;OCTALIZE
	SHIFT	NUMBER,3	;MAKE ROOM
	IOR	NUMBER,CH	;AND OR IT IN
	SOJG	T3,MENUM0	;BOUNDS CHECK
	PRINT	[ASCIZ .? NUMBER EXCEEDS REASONABLE LIMIT
.]
	LOADPC    AGIN

MEEXT:	TROE	F,EXSAW		;FLAG AS SEEN
	 LOADPC	[PRINT	[ASCIZ .? IMPROPER FILE SPECIFICATION
.]
		LOADPC    AGIN]
	LOADI	T4,3		;INITIALIZE REPEAT COUNTER
	LOAD	BP,[440600,,EXT] ;RESET BYTE POINTER
MEEXT0:	CALL	INCHR		;GET A CHARACTER
	IDPB	CH,BP		;STORE IT
	SOJG	T4,MEEXT0	;THREE TIMES
	LOADPC	GETUN1		;DONE, GET SWITCH

MEDEV:	TROE	F,CLSAW		;FLAG AS SEEN
	 LOADPC	[PRINT [ASCIZ .? IMPROPER DEVICE SPECIFICATION
.]
		LOADPC    AGIN]
	EXCH	DEVICE,FILE	;TRADE YOU A ZERO FOR A FILENAME
	LOADI	T4,6		;RESET COUNTER
	LOADPC	GETUN0		;GET NEXT CHARACTER


PRTOCT:	CLEAR	T4,		;SETUP
	CLEAR	T3,
	CAIN	T1,		;IF NUMBER IS ZERO
PRTOC2:	 LOADPC	[OUTCHR	["0"]
		 LOADPC    CPOPJ]
PRTOC0:	CLEAR	T0,		;GET READY
	TLNN	T1,700000		;
	 LOADPC	[SHIFT	T1,3
		 JUMPE	T1,PRTOC1
		 ADDI	T4,1
		 LOADPC    PRTOC0]
	SHIFTC	T0,3
	ADDI	T0,60
	OUTCHR	T0
	ADDI	T3,1
	LOADPC    PRTOC0
PRTOC1:	MOVNS	T4
	ADDI	T4,14		;NUMBER OF CHARACTERS 
	SUB	T4,T3		;NOW NUMBER UNPRINTED YET
PRTOC3:	SOJL	T4,CPOPJ
	OUTCHR	["0"]
	LOADPC    PRTOC3
CPOPJ:	RETURN	

GETCOF:	LOAD	BP0,[440700,,COFBUF]
	LOAD	T0,[-COFLEN,,COFBUF-1]
	STORE	T0,BLOK+1
	MOVSI	T0,'COF'
	STORE	T0,BLOK
	LOAD	T0,[.TCRRF,,BLOK]
	TMPCOR	T0,
	  TLZ	F,RPGSW		;FORGET IT
	RETURN	
		PAGE

$ALLOCATE:
	CALL	EXIST		;DOES FILE EXIST ALREADY? 
	 LOADPC	ITTHER		;YEP, REQUIRE EXPLICIT DELETE
	STORE	FILE,BLOK	;NOPE, SETUP ARGUMENT BLOCK
	MOVN	T3,NUMBER	;GET NEGATION OF NUMBER DESIRE
	HRLZS	T0
	LOADPC	$CREA2		;GO CREATE THE FILE

$CREATE:
	CALL	EXIST		;DOES IT EXIST ALREADY? 
	 LOADPC	ITTHER		;YEP, REQUIRE EXPLICIT DELETE
$SUPERCEDE:
	STORE	FILE,BLOK	;SETUP ARGUMENTS
	PRINT	[ASCIZ .#.]	;AND FETCH FILE CONTENTS
	LOAD	T3,[440700,,BUFFER]
	LOADI	T4,BUFLEN*5	;MAXIMUM NUMBER OF CHARACTERS
$CREA0:	CALL	NINCHR	;GET ANY CHAR EXCEPT ALTMODE
				;TO ENTER ALTMODE, REASSEMBLE WITH ALT CHANGED
	CAIN	CH,ALT		;ALTMODE IS THE TERMINTOR HERE
	 LOADPC	$CREA1		;GO WRITE FILE
	IDPB	CH,T3		;STORE IN BUFFER
	SOJG	T4,$CREA0	;OVERFLOW CHECK
REASM:	PRINT	[ASCIZ .? REASSEMBLE WITH LARGER VALUE OF SYMBOL BUFLEN 
.]
	LOADPC    AGIN
$CREA1:	CLEAR	CH,		;GUARANTEE NULL BYTE
	IDPB	CH,T3		;AS IN ASCIZ
	HRRZS	T3		;SETUP ARGUMENTS
	SUBI	T3,BUFFER-1	;COMPUTE NUMBER OF WORDS IN BUFFER
	SKIPE	NUMBER		;IF NUMBER SPECIFIED, USE IT INSTEAD
	  LOAD	T3,NUMBER	;
	MOVNS	T3		;IOWD FORMAT
$CREA2:	HRLZS	T3
	HRRI	T3,BUFFER-1
	STORE	T3,BLOK+1	;TMPCOR ARG BLOCK
	LOAD	T0,[.TCRWF,,BLOK]
	TMPCOR	T0,
	 LOADPC	NOCORE		;FILE SIZE EXCEEDED AVAILABLE FREE CORE

	LOADPC    AGIN		;FILE SUCCESSFULLY WRITTEN

$DELETE:
	CAMN	FILE,[SIXBIT .*.] ;ASTERISK IS REALLY /Z
	 LOADPC	$ZERO		;/Z
	STORE	FILE,BLOK	;STORE FILE NAME
	LOAD	T0,IWORD	;USE STANDARD IOWD
	STORE	T0,BLOK+1
	LOAD	T0,[.TCRDF,,BLOK]
	TMPCOR	T0,		;ATTEMPT DELETION
	 LOADPC	NOFILE		;FILE DOES NOT EXIST
	LOADPC    AGIN

$FREE:
	CLEAR	T1,		;TO BE SAFE
	TMPCOR	T1,		;GET NUMBER OF FREE WORDS REMAINING
	  HALT	.+1		;3.5.1.5
	CALL	PRTOCT		;PRINT IT
	PRINT	[ASCIZ . WORDS AVAILABLE
.]				;SUBROUTINE CALL? 
	LOADPC    AGIN		;NEW COMMAND

$HELP:
	LOAD	T0,[SIXBIT .COFUP.]
	CALL	.HELPR##	;CALL HELPER SUBROUTINE
	LOADPC    AGIN		;GIVE HIM ANOTHER CHANCE

$INDEX:
	CLEARM	BLOK		;SETUP
	STORE	IWORD,BLOK+1	;
	LOAD	T0,[.TCRRD,,BLOK] ;READ THE DIRECTORY
	TMPCOR	T0,
	  HALT	.+1		;3.5.1.5 AGAIN
	CAILE	T0,BUFLEN	;BE SURE WE GOT IT ALL
	 LOADPC	REASM		;DID NOT, THIS WOULD BE AN UNUSUAL OCCURENCE
	CLEAR	DEVICE,		;SETUP LOOP
$INDE0:	CAMN	FILE,[SIXBIT .*.]
	  CLEAR	FILE,		;ASTERISK IS SAME AS /V
	LOADI	EXT,3
	HLLZ	T1,BUFFER(DEVICE);GET FILE NAME
	JUMPE	T1,$INDE2	;NORMAL EXIT, INDEX EXHAUSTED
	SKIPE	FILE		;CHECK FOR FILENAME
	 LOADPC	[CAME	T1,FILE ;IS THIS ITS ENTRY
		   LOADPC $INDE1  ;NOPE, TRY NEXT ONE
		 CLEARM	BUFFER+1(DEVICE) ;FORCE END OF INDEX
		 LOADPC    $INDE3]
$INDE3:	CAMN	T1,[SIXBIT .   .] ;SPACES? 
	 LOADPC	[LOADI	EXT,6	  ;RESET ITERATION COUNT
		 LOAD	T1,['[SPAC]']
		 LOADPC    $INDE6 ]
$INDE6:	PRINT	[ASCIZ .
.]
$INDE4:	CLEAR	T0,
	SHIFTC	T0,6		;GET A SIXBIT CHARACTER
	CAIN T0,
	  TRNA T0,"@"
	ADDI	T0,40		;ASCIIZE
	OUTCHR	T0		;PRINT IT
	SOJG	EXT,$INDE4	;AFTER NAME IS PRINTED, GET ALLOCATION
	PRINT	[ASCIZ .   .]
	HRRZ	T1,BUFFER(DEVICE);GET ALLOCATION
	CALL	PRTOCT		;PRINT ITS ALLOCATION
$INDE1:	ADDI	DEVICE,1
	CAIL	DEVICE,BUFLEN	;BOUNDS CHECK
	 LOADPC	REASM		;EXCEEDED
	LOADPC	$INDE0		;AND FETCH NEXT ENTRY
$INDE2:	PRINT	[ASCIZ .
.]
	JUMPE	FILE,$FREE	;FULL PRINTOUT? 
	LOADPC    AGIN		;NOPE, FINIS

$LOAD:
	LOADPC	NYET

$NAME:
	EXCH	FILE,NFILE	;FIRST TIME I EVER USED THIS
	STORE	FILE,BLOK	;SETUP TMPCOR UUO
	STORE	IWORD,BLOK+1	;STOCK IOWD
	LOAD	T0,[.TCRDF,,BLOK] ;IS IT THERE? 
	TMPCOR	T0,		;
	 LOADPC	NOFILE		;NOPE, BOMB
	HRRI	T0,BUFFER-1	;NEW IOWD
	STORE	T0,BLOK+1	;SAVE AWAY
	LOAD	FILE,NFILE	;GET RENAME NAME
	STORE	FILE,BLOK	;NEW NAME
	LOAD	T0,[.TCRWF,,BLOK] ;REWRITE IT
	TMPCOR	T0,
	 LOADPC	NOCORE		;RAN OUT OF ROOM? 
	LOADPC    AGIN		;NEXT COMMAND

$PRINT:
	TRO	F,DELSW		;MARK FOR TERMINATION WITH EXTREME PREDJUDICE
	LOADPC    $TYPE		;AND LIST IT

$RUN:
	HRRZI	T0,RUNBLK	;SETUP ARGUMENT BLOCK FOR RUN UUO
	HRLI	T0,1		;CCL ENTRY POINT OFFSET
	SKIPE	EXT		;IF SPECIFIED
	STORE	EXT,RUNBLK+2	;EXTENSION
	SKIPE	FILE		;IF SPECIFIED
	STORE	FILE,RUNBLK+1	;FILENAME
	SKIPE	DEVICE	;IF SPECIFIED
	STORE	DEVICE,RUNBLK	;DEVICE
	RUN	T0,		;RUN .ARG.
	  PRINT	[ASCIZ .? RUN UUO FAILED, ERROR CODE: .]
	  LOAD	T1,T0		;PRINT RUN ERROR CODE
	  CALL	PRTOCT		;PRINT IT
	  PRINT	[ASCIZ .
.]
	  EXIT

$TYPE:
	STORE	FILE,BLOK	;STORE FILENAME
	LOAD	T0,IWORD	;USE STOCK IOWD
	STORE	T0,BLOK+1
	LOAD	T0,[.TCRRF,,BLOK]
	TMPCOR	T0,
	 LOADPC	NOFILE		;CANNOT LIST IF DOES NOT EXIST
	LOAD	T3,[440700,,BUFFER] ;ASSUME ASCII CORE FILES
	CLEAR	T4,
$TYPE0:	ILDB	CH,T3		;GET INPUT CHARACTER
	JUMPE	CH,$TYPE1	;UNTIL NULL ENCOUNTERED
	CAILE	T4,BUFLEN	;BUFFER IS MAXIMUM FILE SIZE
	 LOADPC	[PRINT [ASCIZ .? FILE PREMATURELY TERMINATED, REASSEMBLE WITH LARGER BUFLEN
.]
		LOADPC    AGIN]
	OUTCHR	CH		;PRINT IT
	ADDI	T4,1		;COUNT THE LITTLE DEVILS
	LOADPC    $TYPE0		;AND REPEAT
$TYPE1:	PRINT	[ASCIZ .[EOF].]	;SHOW EOF
	TRNN	F,DELSW		;DO WE WANT TO DELETE IT NOW
	 LOADPC	AGIN		;HARDLY
	LOADPC	$DELETE		;CERTAINLY

$VERIFY:
	CLEAR	T0,		;SETUP
	CAMN	FILE,[SIXBIT .*.]
	 LOADPC	$VERI1		; ASTERISK IS ACTUALLY NULL/V
	JUMPE	FILE,$VERI1	;NO FILE NAME MEANS FULL INDEX
$VERI0:	HLLZ	T1,TITTAB(T0)	;GET FIRST ENTRY
	CAME	T1,FILE		;IS THIS THE FILE IN QUESTION
	 LOADPC	[ADDI	T0,1	;NOPE, BUMP INDEX
		 CAIL	T0,TITLNG ;LEGAL INDEX
		   LOADPC    [PRINT [ASCIZ .? UNFAMILIAR FILE SPECIFICATION
.]
			 LOADPC   AGIN]
		 LOADPC    $VERI0]
	HRRZ	T1,TITTAB(T0)	;MUST SHAKE INDIRECT BITS
	PRINT	@T1
	PRINT	[ASCIZ .
.]
	LOADPC    AGIN		;PROCESS NEXT COMMAND
$VERI1:	HRRZ	T1,TITTAB(T0)	;PRINT ENTIRE TABLE
	PRINT	@T1		;SANS @ BIT
	PRINT	[ASCIZ .
.]
	ADDI	T0,1
	CAIL	T0,TITLNG	;BOUNDS CHECK
	 LOADPC	AGIN		;DONE
	LOADPC	$VERI1		;GET NEXT ENTRY

$ZERO:
	LOAD	T0,IWORD	;STANDARD IOWD
	STORE	T0,BLOK+1
	LOAD	T0,[.TCRDD,,BLOK]
	TMPCOR	T0,
	  HALT	.+1		;NOTEBOOK 2 SEC 3.5.1.5 ASSURES ME
	LOADPC    AGIN		;DIRECTORY CLEARED, ALL SPACE RELEASED

NOCORE:	PRINT	[ASCIZ .? INSUFFICIENT FREE CORE, SUGGEST /S OR /D SWITCH
.]
	LOADPC    $FREE		;AND PRINT FREE CORE

ITTHER:	PRINT	[ASCIZ .? SPECIFIED FILE ALREADY EXISTS, EXPLICIT DELETION REQUIRED
.]
	LOADPC	AGIN

NOFILE:	PRINT	[ASCIZ .? SPECIFIED FILE DOES NOT EXIST
.]
	LOADPC	AGIN

NYET:	PRINT	[ASCIZ .? INVALID COMMAND
.]
	LOADPC	AGIN

INCHR:	TLNE	F,RPGSW		;RPG NOW? 
	LOADPC    [ILDB	CH,BP0	;FROM TMPCOR FILE NOT TTY
		 SKIPN	CH	;NULL?
		   LOADPC    GETOUT ;YEP, BYE
		 LOADPC    INCHR0 ]
	INCHRW	CH		;GET A CHARCTER FROM TTY
INCHR0:	CAIN	CH,CR		;IGNORE CARRIAGE RETURNS
	 LOADPC	INCHR		;GET ANOTHER, FLUSH CR'S
	CAIE	CH,RUB
	  RETURN			;RETURN
	PRINT	[ASCIZ .? NO ACTION WAS TAKEN
.]
	LOADPC    AGIN		;IF RUBOUT, RESTART COMMAND

NINCHR:	TLNE	F,RPGSW		;RPG TIME? 
	 LOADPC	[ILDB	CH,BP0	;YEP, USE BUFFER
		 SKIPN	CH	;NULL? 
		   LOADPC    [GETOUT:	PRINT	[ASCIZ .
.]
			 EXIT ]
		 RETURN		];NOPE, MORE
	INCHRW	CH		;GET NEXT CHARACTER
	RETURN	

EXIST:	STORE	FILE,BLOK	;CHECK IF FILE EXISTS OR NOT
	STORE	IWORD,BLOK+1	;STOCK IOWD
	LOAD	T0,[.TCRRF,,BLOK]
	TMPCOR	T0,
	  AOS	(P)		;DOES INDEED EXIST
	RETURN			;DOES NOT EXIST

TITTAB:
	'ALG',,[ASCIZ .ALG - ALGOL COMPILER.]
	'BLI',,[ASCIZ .BLI - BLISS-10 COMPILER.]
	'COB',,[ASCIZ .COB - COBOL COMPILER.]
	'COF',,[ASCIZ .COF - COFUP: CORE FILE UTILITY PROGRAM.]
	'CRE',,[ASCIZ .CRF - CREF: CROSS REFERENCE PROGRAM.]
	'DMP',,[ASCIZ .DMP - DUMP: CORE DUMP PROCESSOR.]
	'EDS',,[ASCIZ .EDS - MOST RECENT EDIT, CREATE, TECO, OR MAKE COMMAND.]
	'EDT',,[ASCIZ .EDT - LINED OR TECO FILE EDITORS.]
	'FOR',,[ASCIZ .FOR - FORTRAN-10 COMPILER.]
	'LNK',,[ASCIZ .LNK - LINK-10: LINKING LOADER.]
	'LOA',,[ASCIZ .LOA - LOADER: LINKING LOADER.]
	'MAC',,[ASCIZ .MAC - MACRO-10 ASSEMBLER.]
	'P11',,[ASCIZ .P11 - MACX11 ASSEMBLER FOR THE PDP-11.]
	'PIP',,[ASCIZ .PIP - PIP: PERIPHERAL INTERCHANGE PROGRAM.]
	'SVC',,[ASCIZ .SVC - MOST RECENT COMPIL, LOAD, EXECUTE, OR DEBUG COMMAND.]
	'SNO',,[ASCIZ .SNO - SNOBOL COMPILER.]
	'RIT',,[ASCIZ .RIT - RITE: RAPIDATA INTERACTIVE TEXT EDITOR.]
TITLNG==.-TITTAB		;LENGTH OF TABLE

NFILE:	BLOCK	1		;OTHER NAME ARGUMENT FOR /N
PDL:	BLOCK	PDLSIZ		;PUSH DOWN LIST STORAGE
COFBUF:	BLOCK	COFLEN		;COMMAND BUFFER
BUFFER:	BLOCK	BUFLEN		;TMPCOR BUFFER
BLOK:	BLOCK	2		;TMPCOR ARGUMENT BLOCK
RUNBLK:	SIXBIT	.SYS.		;ARGUMENT BLOCK FOR RUN UUO
	SIXBIT	.COFUP.		;DEFAULT TO CCL ON SELF
	SIXBIT	.SHR.		;
	BLOCK	3
	END	..		;FINALE