	.TITLE PIP-9/15
/COPYRIGHT 1968, 1969, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
/M. SIFNAS, J. WOLFBERG 12-26-69
/
/ V9A   (EDIT2)
/
/MACRO-9/15 P OPTION MUST BE USED WHEN ASSEMBLING PIP-9/15.
/PARAMETERS TO BE DEFINED: 
/BANK=N			/N=0     - BULK STORAGE VERSION
/			/N=0     - 8K PAPER TAPE VERSION
/			/N=1 -16K PAPER TAPE
/			/N=2 -24K PAPER TAPE
/			/N=3 -32K PAPER TAPE
/
/PDP7			/DEFINE (0) ONLY IF PDP7 DECTAPE SYSTEM
/
/PTP			/DEFINE (0) ONLY IF PAPER TAPE SYSTEM
/			/EITHER PDP7 OR PDP9 OR PDP-15
/ORIGIN=M			/M IS NORMALLY NOT DEFINED
/
/BF			/DEFINE(0) ONLY IF B/F SYSTEM (BACKGROUND).
/BFR			/DEFINE (0) ONLY IF B/F SYSTEM (FOREGROUND).
			/(FOR A RELOCATABLE VERSION).
/
/PDP15			/DEFINE (0) IF PDP-15 VERSION.
/
/TO SEGMENT TO 6 PAPER TAPES (USE PIP):
/S /TAP2,/TAP3,/TAP4,/TAP5,/TAP6
/T PP ,,,,, (AY)_DTN PIPV8A
/
/
	.IFDEF BFR
	.IODEV 1,2,3,4,5,6,7,10
	.IODEV -2,-3
	.ENDC
	.IFUND BFR
	.ABS
	.ENDC
	.IFUND BANK
BANK=0
	.ENDC
	.IFUND BFR
	.IFUND ORIGIN
ORIGIN=10051
	.ENDC
	.LOC BANK*20000+ORIGIN
	.IFDEF PDP7
	.LOC 7600
	.ENDC
	.ENDC
IDX=ISZ			/USE FOR INDEXING
.SCOM=100
	.IFUND BF
	.IFUND BFR
DEVSZE=10			/SIZE OF POSITIVE .DAT TABLE.
.DAT=135
	.ENDC
	.ENDC
/
/
/STARTING ADDRESS OF PIP-9/15.
Z1BUF=.
	.IFUND BFR
BEGIN	JMP INIT		/GO RELOCATE ALL 15-BIT ADDRESSES TO MEMORY BANK OF PIP
	.ENDC
	.IFDEF BFR
BEGIN	JMP RESTRT	/NO NEED TO RELOCATE IF RELOCATABLE VERSION
	.ENDC		/AND FOREGROUND ASSUMES 1ST LOC = STARTING LOC.
	.BLOCK	377
Z2BUF	.BLOCK 400
ALLOUT=.-126		/POINTER FOR NEXT CHARACTER.
VALOUT=.-125		/POINTER FOR NEXT VALID CHAR.
CMDOUT=.-124		/COMMAND STRING ECHO BUFFER.
CMECHO=.-121		/A SPACE (40) AT CHECHO-1 IS NECESSARY
			/TO LINE UP ECHO WITH THE ORIGINAL.
RSTRTP	0		/0 IF RESTART ON ^P;NON0 IF NEW MEDIUM ON ^P
RESTRT	DZM RSTRTP	/RESTART ON ^P.
	DZM YEOFSW
/	.INIT -2,0,NUORRE	/.INIT TELETYPE IN AND OUT
	CAL+776		/CAUSES CR/LF TO
	1		/TELEPRINTER.
MOD01	NUORRE		/CONTROL ON ^P
	0
	ISZ PIPAGN
	JMP AROUND	/NO INTERMEDIATE TTY OUTPUT
/	.WRITE -3,2,OUTPIP,6	/OUTPUT PIP VXX<CR><LF>
	CAL+2775		/IOPS ASCII
	11
MOD02	OUTPIP
	-6
/
	.EJECT
/INITIALIZATION
AROUND	LAC* (.SCOM+1	/STARTING ADDRESS OF
	DAC DEVBGN	/PIP .DEV TABLE, WHICH
	DAC TEMP1		/IS SAME SIZE AS POSITIVE .DAT
	.IFDEF BF
	IDX TEMP1		/POINT TO .DEV DATA
	LAC* (.SCOM+17	/.DATB POINTER
	DAC DATB
	LAC* DEVBGN	/GET .DEV SIZE
	.ENDC
	.IFDEF BFR
	IDX TEMP1
	LAC* (.SCOM+16		/.DATF POINTER.
	DAC DATF
	LAC* DEVBGN
	.ENDC
	.IFUND BF
	.IFUND BFR
	LAW -DEVSZE	/2'S COMPLEMENT OF
	.ENDC
	.ENDC
	DAC TEMP2		/SIZE OF .DEV TABLE
	LAC LITJMP
	DAC ERRJMP
	CLC
	DAC ZECHO		/RESET INPUT MESG ECHO SWITCH
	DAC ZSPACE		/SET TO IGNORE SPACES
SETBK1	LAC* TEMP1		/CLEAR IN USE BIT
	AND MASK1		/OF ALL .DEV ENTRIES (MASK1=737777)
	DAC* TEMP1
	IDX TEMP1
	ISZ TEMP2		/ARE ALL ENTRIES INITIALIZED
	JMP SETBK1	/NO
	LAC (DAC* ALLOUT
	DAC VALSW
	LAC LIT40
	DAC CMECHO-1		/SET SPACE TO LINE UP ECHO.
	LAW -2
	TAD LPSNAM		/INIT SPLIT STRING POINTER
	DAC SNAMPT
	JMS INITPT		/INIT FILE POINTERS AND COUNTS
	DZM DESTSW	/CLEAR DEST BLK SW
	DZM SRCDEV		/CLEAR SOURCE DEVICE CODE.
	DZM QUSTON		/IF NON-0, SOURCE DEVICE MUST BE BULK STORAGE (FOR S/Z OPTIONS)
	DZM DATAMD		/INITIALIZE
	DZM WSWTCH		/SWITCH
	DZM CETSW		/OPTIONS
	DZM FSWTCH
	DZM GSWTCH
	DZM BSWTCH
	DZM YSWTCH
	DZM VSWTCH
	DZM DIRSWH		/REGISTERS
	DZM QSWTCH
	DZM PAPER
	DZM CARD
	DZM DMPSW
	LAC LITCLS	/(JMS ZCLOS
	DAC ZEOF2
	LAC CNOP
	DAC ZILCH
	DAC ZCEXIT	/CLEAR COPY SWITCH
	LAW -400
	DAC MODN05+1	/INIT COPY WORD COUNTS
	DAC MODN06+1
	DAC COMPCT
	LAC Z1BUFL
	DAC Z1BUFP
	LAC Z2BUFL
	DAC Z2BUFP
	LAC LITSKP	/SET COMMAN DECODER (SKP)
	DAC COMSW		/IN PROGRESS SWITCH
	LAW -72		/SET OUTPUT LINE COUNT TO 57
	DAC LINCNT
	LAW -31		/INITIALIZE
	DAC INROOM		/FILE BLOCK
	DAC OTROOM		/COUNTS(24)
	JMS LFOUT		/OUTPUT LF >, READ TTY, GET 1ST CHAR
GTFUNC	SAD (15		/CR
	JMP RESTRT
	SAD LITT		/T -- TRANSFER FILE (0)
	LAW 0
	SAD (114		/L -- LIST DIRECTORY (2)
	LAW 2
	SAD LITD		/D -- DELETE FILE (4)
	LAW 4
	SAD LITC		/C -- COPY FILE (6)
	LAW 6
	SAD (122		/R -- RENAME FILE (10)
	LAW 10
	SAD LITB		/B -- BLOCK COPY (12)
	LAW 12
	SAD LMODE		/S -- SEGMENT FILE (14)
	LAW 14
	SAD (126		/V -- VERIFY FILE (16)
	LAW 16
	SAD LITN		/N -- NEW DIRECTORY (20)
	LAW 20
	SPA
	JMP .+4		/LEGAL FUNCTION CHAR.
	CLA		/ERROR MESSAGE # 0
	JMS ECHOCS	/ILLEGAL FUNCTION CHAR.
	JMP GTFUNC	/ECHO VALID PORTION
	AND (77
	DAC FUNCDE	/SAVE FUNCTION CODE
	LAC ALLOUT	/UPDATE VALID COMMAND
	DAC VALOUT	/STRING POINTER
	LAC FUNCDE		/T?
	SNA
	JMP GTFNC3		/YES-DO NOT CLEAR SPLIT FILE COUNT
	DZM STRCNT	/CLEAR STRING COUNT
	XOR (14			/S?
	SZA			/YES-EXAMINE COMMAND STRING
	JMP GTFNC3		/CLEAR STRCNT
/SPLIT (S) FUNCTION COMMAND DECODER
/
	LAW -21			/INIT SPLIT STRING COUNT TO 16
	DAC SPROOM
	LAC LPSNAM
	DAC PUTP			/SET UP KLPUT
	DZM PUTCT
	DZM PUTC
/NEXT STRING
SNEXST	ISZ SPROOM
	SKP
	JMP SNOROM		/STRING CAPACITY EXCEEDED
	LAC PTLIT			/(JMS KLPUT
	DAC STRSW
LM5	LAW -5
	DAC TEMP3
	DAC ZSPACE		/IGNORE SPACES
SNEXC	JMS GETCHR
	DZM ZSPACE		/DO NOT IGNORE SPACES
	SAD (15			/CR
	JMP STREND		/END OF COMMAND STRING
	SAD LIT40			/SP
	LAC (54
	SAD (54			/COMMA
	JMP STREND
STRSW	XX			/JMS KLPUT OR NOP
	ISZ TEMP3
	JMP SNEXC			/NEXT CHAR
	LAC CNOP
	DAC STRSW
	JMP SNEXC
/END OF STRING
STREND	DAC TEMP2			/SAVE CHAR (CR OR,)
	LAC TEMP3			/5 CHAR'S
	SMA!CLA			/NO-PAD WITH NULLS
	JMP SENDCK-1		/CHECK FOR CR
	JMS KLPUT			/OUTPUT NULL
	ISZ TEMP3
	JMP .-2
	ISZ STRCNT		/INDEX STRING COUNT FOR Y OPTION
/CR CHECK
SENDCK	LAC TEMP2
	SAD (15			/CR=END
	JMP RESTRT
	JMP SNEXST		/NEXT STRING
/STRING COUNT OVERFLOW
SNOROM	LAC (26			/16 STRING LIMIT-FIRST 16 ACCEPTED
	JMS ECHOCS		/MSG #22
	JMP RESTRT
/ALL FUNCTIONS EXCEPT S
/
GTFNC3	DZM DIRECT	/0 INDICATES DESTINATION DEVICE
	JMS GETDEV		/PICK UP DEVICE CODE AND CHECK ITS VALIDY.
DESDEV	0		/DESTINATION DEVICE CODE. (2.SIXBIT CHARS.)
DESDAT	0		/DESTINATION .DAT SLOT.
	LAC DESDEV	/IF DEST DEV = LP, SET F SWITCH
	XOR LPDEV		/TO ISSUE FF AFTER .EJECT OR EVERY 57 LINES
	XOR FUNCDE	/IF T OPERATION
	SNA!CLC		/NOT LP
	DAC FSWTCH
	LAC FUNCDE	/SET DIRECT TO 1
	SAD (20		/NEWDIR (N)
	JMP NEWDIR
	SAD (16		/VERIFY (V)
	LAC (4
	XOR (4		/(SOURCE) IF FUNCTION= VERIFY(V) OR
	SZA		/DELETE FILE (D). THIS
	JMP GTFILE
	LAC (1		/CAUSES CHECKING OF PRESENCE
	DAC DIRECT	/OF FILE NAMES VIA .FSTAT
	LAC DESDAT
	DAC SRCDAT
	LAC DESDEV
	DAC SRCDEV
GTFILE	JMS FILECK	/PICK UP FILE NAME(S) AND EXT(S)
	LAC TMPCHR	/CHAR. THAT TERMINATED FILE NAMES
	SAD (50		/OPEN PAREN
	JMP OPENPR
	SAD (137		/LEFT ARROW
	JMP LFTARO
ALLDNE	DZM XITFLG
	SAD (15		/CARRIAGE RETURN
	ISZ XITFLG
/CARRIAGE RETURN OR ALT MODE
/PERFORM SPECIFIED OPERATION AND
/THEN EITHER .EXIT (XITFLG=0)
/OR GO TO RESTRT (XITFLG=1)
/
ZFCHEK	LAC STRCNT
	CMA
	DAC STRCNT		/1'S COMP OF STRING COUNT.
ZFCHK1	LAC LITCLA	/CLEAR COMMAND DECODER SWITCH
	DAC COMSW
	DZM ZECHO
	CLC
	TAD SRFCNT		/2'S COMP OF
	CMA
	DAC SRFCNT		/SOURCE FILE COUNT
	CLC
	TAD DSFCNT
	CMA
	DAC DSFCNT
	LAC FUNCDE		/DISPATCH TO FUNCTION
	SNA
	JMP ZTGO		/T = 0
	SAD (2
	JMP ZLDIR		/L = 2
	SAD (4
	JMP ZDELET		/D = 4
	SAD (6
	JMP ZCOPY		/C = 6
	SAD (10
	JMP ZRENAM		/R = 10
	SAD (16		/V=16
	JMP VERIFY
/BLOCK TRANSFER FUNCTION	/B=12
/
ZBLT	DAC BSWTCH	/SET BLOCK SWITCH
	LAC DESTSW	/DEST SW SET?
	SNA!CLC		/YES,USE DEST BLOCK COUNT
	JMP ZBLT1
	TAD DSFCNT	/CHANGE BLOCK COUNT TO 1'S COMP
ZBLT2	DAC DSFCNT
	JMS BSETUP	/INIT BLOCK COUNT AND POINTER
	JMP ZCOPY
ZBLT1	TAD SRFCNT
	JMP ZBLT2
/BLOCK COPY SETUP SUBR
/
BSETUP	0
	LAC DSFCNT	/BLOCK COUNT (2'S COMP)
	DAC BCOUNT
	LAC LDFPTR	/DEST BLOCK LIST POINTER
	DAC BDPNT
	LAC LSFPTR	/SRC LIST POINTER
	DAC BPOINT
	JMP* BSETUP
BCOUNT	0
BPOINT	0
BDPNT	0
	.EJECT
/NEW DIRECTORY OPERATION
/
NEWDIR	LAW 2		/SET DIRSWH FOR N OPTION
	DAC DIRSWH
	LAC TEMP6		/CHECK TERMINATOR
	SKP
NEWDR1	JMS GETCHR
	DZM XITFLG	/EXIT TO MONITOR IF XITGLG=0.
	SAD (50		/(
	JMP NEWSW
NEWDR2	SAD (175		/ALT MODE
	JMP NGO
	XOR (15		/CR
	SZA!CLC
	JMP NEWDR1	/KEEP LOOKING FOR GOOD TERM
	DAC XITFLG	/EXIT TO PIP IF XITFLG NOT=0.
NGO	JMS ZINSUB	/SET UP AND INIT DEST DEV
	JMS ZSCODE	/OUTPUT NEW DIRECTORY
	LAC DESDAT	/CLOSE DEST DEV
	JMP CLOUT		/CLOSE
NEWSW	JMS GETCHR
	SAD LMODE		/S
	SKP
	JMP NEWDR2
	LAW 1		/SET FOR S OPTION
	DAC DIRSWH
	JMP NEWDR1
/
/INIT DEST DEV SUBR
/
ZINSUB	0
	LAC DESDAT	/DEST DAT SLOT
	XOR (1000		/OUTPUT BIT
	DAC ZIFILD	/INIT SUBR
	JMS ZIFIL
	JMP* ZINSUB
	.EJECT
/COPY ROUTINE
/
DELBLK=INS1
ZCOPY	JMS ZINSUB	/SET UP AND INIT DEST DEV
	JMS ZSCODE	/CHECK FOR N OR S OPTION
	LAC SRCDAT
	STL		/L = 1 FOR INPUT
	JMS ZSETTR		/SET UP ZTRAN
	DAC ZIFILD
	JMS ZIFIL		/INIT SRC DEV
	LAC (1		/# BLOCKS TO RRANSFER AT ONCE FOR
	DAC DELBLK	/B OR (INITIALLY) C FUNCTIONS.
	LAC BSWTCH	/B OPERATION?
	SZA
	JMP ZSYSDB
	LAC DATAMD		/H SWITCH SET?
	SAD (2
	JMP HCOPY		/YES
/TRAN IN SRC DEV DIRECTORY
/
DIRPT=AMODCK
COPCNT=SYSCT
	LAC Z1B040
	DAC DIRPT
	JMS ZTRANS	/BRING IN SRC DIRECTORY
	JMS ZFIL56	/CHECK FOR 24 OR 56 FILES
	TAD LM1
	DAC COPCNT
	SKP
ZCOPY1	JMS ZTRANS	/BRING IN DIRECTORY
	LAC COPCNT		/SET UP TO DO SECOND AND THIRD SETS OF FILES.
	TAD LM1
	DAC COPCNT
	JMS INITPT		/INIT FILE POINTERS AND COUNTS
	LAC SRFPTR		/SOURCE FILE POINTER
	DAC TEMP2
	LAC DSFPTR		/DEST FILE POINTER
	DAC TEMP3
	LAW -30		/24 FILE COUNT
	DAC ZCT
	LAC DIRPT		/SET UP DIRECTORY ENTRY SECT POINTER
ZCOPY2	ISZ COPCNT
	JMP ZCOPY7
	LAC CNOP		/DONE - NO MORE FILES SO EXIT.
	JMP ZCOPY8
ZCOPY7	DAC TEMP1
	TAD (3
	DAC TEMP4		/POINTER TO WD. 4 OF ENTRY
	LAC* TEMP4		/FILE COMPLETE BIT SET?
	IDX TEMP4		/UPDATE TO POINT TO NEXT ENTRY
	SPA
	JMP ZCOPY5	/YES, PLACE ENTRY ON SRC AND DEST LISTS
ZCOPY3	LAC TEMP4		/NO, GET ANOTHER ENTRY.
	JMP ZCOPY2
ZCOPY5	LAW -3		/PUT 3 WORDS IN SRC AND DEST LISTS.
	DAC ZCOUNT
ZCOPY4	LAC* TEMP1		/DIR. ENTRY POINTER
	DAC* TEMP2		/SRC FILE LIST POINTER
	DAC* TEMP3		/DEST FILE LIST POINTER
	IDX TEMP1
	IDX TEMP2
	IDX TEMP3
	ISZ ZCOUNT
	JMP ZCOPY4
	IDX SRFCNT	/INDEX SRC AND DEST FILE COUNTS
	IDX DSFCNT
	ISZ ZCT
	JMP ZCOPY3
ZCOPY6	LAC CNOP		/ALL 30 FILES ENTERED.
	ISZ COPCNT
	LAC (JMP ZCOPY1		/MORE THAN 30 FILES TOTAL - SET UP TO RETURN
ZCOPY8	DAC ZCEXIT		/TO PROCESS THE REMAINDER.
	LAC SRFCNT	/EXIT IF 0 FILE COUNT
	SNA
	JMP ZCEXIT
/SET SWITCHES TO ENTER TRANSFER (T) FUNCTION CODE
	DZM FUNCDE		/FUNCTION SWITCH = T
	LAC TEMP4		/SAVE FILE POINTER FOR NEXT PASS
	DAC DIRPT
	LAC (5
	DAC DATAMD		/DATA MODE = DUMP
	JMP ZFCHK1		/BACK TO FUNCTION CHECK
/IMAGE MODE BLOCK BY BLOCK COPY
/
CURBLK=ZIFIL
NEWBLK=ZCLOS
HCOPY	LAC (400		/INIT FOR BLOCK BY BLOCK COPY
	DAC TEMP7		/INITIAL BUFFER SIZE = 400.
	LAW -2		/COMPUTE AVAILABLE CORE IN 256 WD UNITS
	TAD* (.SCOM+2	/TO ENABLE USE OF ALL CORE
	CMA		/FOR TRANSFER BUFFERS RATHER
	TAD* (.SCOM+3	/THAN JUST Z1BUF AND Z2BUF.
	AND (777000	/THERE MUST BE AT LEAST 512(1000 OCTAL).
	SNA
	JMP HCOPY1	/USE Z1BUF AND Z2BUF,1 BLOCK AT A TIME
	TAD (1000		/ADD IN Z1BUF, Z2BUF SPACE
	CLL!RAR		/DIVIDE BY 2
	DAC TEMP7		/SIZE OF Z1BUF, Z2BUF
	JMS BLROT		/3 RIGHT
	JMS BLROT
	RTR
	DAC DELBLK	/# OF BLKS TO TRANSFER AT ONE TIME
	LAC* (.SCOM+2
	DAC Z1BUFP
	TAD TEMP7
	DAC Z2BUFP
HCOPY1	CLC
	TAD TEMP7		/COMPUTE TRAN WORD COUNT
	CMA
	DAC MODN05+1	/SET UP WORD COUNT
	DAC MODN06+1	/IN .TRAN MACROS (IN ZTRANS).
	DAC COMPCT	/READ COMPARE W.C.
	DZM CURBLK	/INIT CURRENT BLOCK #
	JMP ZSYSDB	/GO
/GET NEXT BLK # SUBR
DTMAP	0
	LAC CURBLK	/CURRENT BLK #
	SPA		/IF (-), LAST BLOCK
	JMP* DTMAP
	DAC NEWBLK
	TAD DELBLK
	DAC CURBLK
	CMA
	TAD (1100		/CHECK FOR GREATER THAN 1077
	SMA!CLL		/L=0 FOR EXIT WITH LEGAL BLK #
	JMP MAPOUT
/LAST BLOCK TRANSFER CODE.
	DAC CURBLK	/SET TO (-) FOR NEXT PASS
	CMA
	JMS R8L		/CONVERT EXTRA BLKS(BEYOND 1077) TO # WORDS.
	TAD MODN05+1
	DAC MODN05+1	/DEDUCT FROM .TRAN WORD COUNT.
	DAC MODN06+1
	DAC COMPCT	/DEDUCT FROM READ-COMPARE COUNT.
MAPOUT	LAC NEWBLK
	JMP* DTMAP
/SUBROUTINE TO INIT SRC., DEST. FILE POINTERS AND COUNTS
/
INITPT	0
	DZM DSFCNT		/DEST. FILE COUNT
	DZM SRFCNT		/SOURCE FILE COUNT
	LAC LDFPTR
	DAC DSFPTR		/DEST. FILE BLOCK (24 ENTRIES) POINTER
	LAC LSFPTR
	DAC SRFPTR		/SOURCE FILE BLOCK (24 ENTRIES) POINTER
	JMP* INITPT
/
ZSYSDB	LAC DESDAT		/DEST DAT SLOT
	DAC YTRWAT		/INTO DEST DEV WAIT
	DAC ZCLOSD	/SET UP DEST. CLOSE
LASTBK=PFILE
	LAC (JMP FECHOK	/SET UP TO PRINT HEADER.
	DAC RCMPSW
	DAC LASTBK	/DUMMY VALUE FOR READ/COMP ERROR ROUTINE.
ZSYSD3	LAC Z2BUFP	/INIT DEST BUF POINTER
	DAC MODN05	/IN TRAN
	DAC MODN06	/TRAN
	LAC (1000		/INIT TO PASS 1 (TRANSFER PASS)
	DAC ZPASS		/PASS 1=1000, PASS 2=0
ZSYSDD	LAW -3
	DAC TEMP5		/READ-COMPARE COUNT (TRY 3 TIMES).
ZSYSD4	LAC BSWTCH	/B?  YES = NON-ZERO.
	SNA
	JMP ZSYSD6	/NO.
	LAC SRFCNT	/SOURCE BLOCK COUNT = 0?
	SZA!CLC		/YES, USE DEST COUNT, AC=0 IN CASE OF COUNT OVERFLOW
	JMP .+4
	LAC* BDPNT	/PICK UP DEST BLOCK
	DAC* BPOINT
	CLC
	ISZ BCOUNT
	LAC* BPOINT	/NEXT BLOCK TO TRANSFER
	SKP!STL		/SET LINK TO INDICATE B FUNCTION
ZSYSD6	JMS DTMAP		/GET NEXT BLOCK TO TRANSFER
	ISZ BPOINT	/FOR HMODE: DUMMY COUNTER, WILL NEVER OVERFLOW.
	SPA		/DONE?
	JMP TEMP61	/YES, CLOSE FILES
	DAC ZBLNUM		/GET THIS BLOCK FROM SOURCE TAPE
	SZL		/L=0 ON H MODE COPY.
	LAC* BDPNT	/DEST BLK POINTER
	ISZ BDPNT		/WILL NEVER OVERFLOW ON H MODE COPY.
	DAC YBLNUM	/GET OR PUT ON DEST DEV
ZSYSD9	JMS ZTRANS	/BRING IN SOURCE BLOCK
	JMP ZSYSD8
ZSYSD7	LAC Z1BUFP
	DAC MODN05
ZSYSD8	LAC YTRWAT
	XOR ZPASS		/SET I/O BIT (8) = 1 ON PASS 1
	DAC YTRANZ	/FOR OUTPUT, 0 ON PASS 2 FOR INPUT.
YTRANZ	XX		/DEST DEV TRAN CAL
	13
YBLNUM	XX		/BL#
MODN05	XX		/Z2BUF ON PASS 1, Z1BUF ON PASS 2
	-400
YTRWAT	XX		/WAIT ON DEST DEV
	12
	LAC ZPASS
	DZM ZPASS
	SZA		/PASS 2 - READ/COMPARE
	JMP ZSYSD7		/GET DATA BLOCK FOR COMPARE.
	LAC Z1BUFP		/COMPARE BLOCKS
	DAC ZTEMP1
	LAC Z2BUFP
	DAC ZTEMP2
	LAC COMPCT	/COMPARE COUNT
	DAC ZCOUNT
YTRCK	LAC* ZTEMP1
	XOR* ZTEMP2
	SZA!CLA
	JMS RCOMP		/READ COMPARE ERROR
	IDX ZTEMP1
	IDX ZTEMP2
	ISZ ZCOUNT
	JMP YTRCK
	JMP ZSYSD3		/NEXT BLOCK
ZTEMP1	0		/TEMP
ZTEMP2	0		/TEMP
COMPCT	0		/COMPARE COUNTER
/
/TAP2 OF 6: PIP.
/READ-COMP SUBR
/
RCOMP	0
	CLC
	ISZ TEMP5		/3 TRIES?
	JMP RESET		/TRY AGAIN
	DAC TEMP5		/INSURE OVERFLOW NEXT TIME
	LAC (JMP RCRET	/SET UP PRINTOUT RETURN
	DAC ERRJMP
	CLA
RCMPSW	XX		/JMP FECHOK (1ST TIME) OR NOP
RCRET	LAC CNOP
	DAC RCMPSW		/CLEAR PRINT READ-COMP SWITCH
	LAC LITJMP		/RESTORE
	DAC ERRJMP
	LAC LPSNA2	/(SNAMES+2
	JMS SETPUT		/SET UP KLPUT
	LAC LIT40		/SPACE
	JMS KLPUT
	CLC
	TAD YBLNUM	/BLOCK NUMBER.
	TAD DELBLK	/# BLOCKS TO BE TRANSFERRED AT ONE TIME.
	DAC KLFOCT	/LAST BLOCK NUMBER IN CURRENT GROUP.
	CMA
	TAD (1100		/CHECK FOR GREATER THAN 1077.
	SMA
	JMP RCRET1
	LAC (1077
	DAC KLFOCT
RCRET1	LAC ZCOUNT	/READ-COMPARE COUNT AT TIME OF ERROR.
	TAD (400		/DECREMENT TO FIND ACTUAL BLOCK IN ERROR.
	SMA
	JMP RCRET2	/ERROR BLOCK FOUND.
	DAC R8L
	CLC
	TAD KLFOCT	/DECREMENT LAST BLK IN CURRENT GROUP BY 1.
	DAC KLFOCT
	LAC R8L		/PICK UP TEMP. WORD COUNT.
	JMP RCRET1+1	/CONTINUE DECREMENTING.
RCRET2	LAC KLFOCT	/BLOCK # IN ERROR.
	SAD LASTBK	/FIRST ERROR FOUND IN THIS BLOCK, PRINT.
	JMP* RCOMP	/ALREADY PRINTED - DON'T PRINT AGAIN.
	DAC LASTBK	/SET TO AVOID PRINTING THIS BLK # MORE THAN ONCE.
	JMS KLFOCT		/OCTAL TO ASCII
	LAC (15		/CR
	JMS KLPUT
	LAC OUTPIP		/WPC = 3
	DAC SNAMES		/INTO HEADER
	JMS PRSET		/SET UP PROUT
	LAC LPSNAM		/(CMECHO
	JMS PROUT		/PRINT ONE BLOCK #.
	JMP* RCOMP
RESET	LAC (1000		/SET UP TO READ SOURCE BLOCK AGAIN.
	DAC ZPASS
	JMP ZSYSD9
/VERIFY FUNCTION
/
VERIFY	CLC
	DAC VSWTCH	/SET V SWITCH
	LAC SRFCNT	/SOURCE FILE COUNT INTO
	DAC DSFCNT	/DEST FILE COUNT
/VERIFY FUNCTION FALLS INTO T FUNCTION
/
/INSERT NO CODE HERE
/
/TRANSFER (T) FILE ROUTINE
ZTGO	LAC DESDAT	/SET UP DEST DAT SLOTS
			/IN I/O MACROS
	DAC ZEFILE	/ENTER
	DAC ZXFILE
	DAC ZWTWAT	/WAIT
	XOR (1000		/OUTPUT BIT
	DAC ZIFILD		/INIT
	LAC VSWTCH	/VERIFY?
	SZA
	JMP ZTGO2		/YES, DO NOT INIT DEST FILE
	JMS ZIFIL		/INIT DEST FILE
	JMS ZSCODE		/Z OR S SWITCH CHECK
ZTGO2	LAC LSFPTR	/INIT SOURCE
	DAC ZSFILP	/FILE POINTER
	LAC LDFPTR	/DEST FILE POINTER
	DAC ZEFILP
	DAC BLMASK	/T STORE
	DAC ZXFILP
ZTFIL2	JMP ZTFIL3
ZTFIL1	LAC ZSFILP		/UPDATE SOURCE
	TAD (3		/FILE POINTER
	DAC ZSFILP
	LAC BLMASK		/UPDATE DEST.
	TAD (3		/FILE POINTER
	DAC BLMASK
	DAC ZEFILP
	ISZ SRFCNT		/UPDATE INPUT
	JMP ZTFIL3		/FILE COUNT
	CLA		/TOO MANY DEST. FILES #17
	JMP FECHOH
ZTFIL3	LAC VSWTCH	/V?
	SZA
	JMP ZTFIL5	/YES, DO NOT ENTER
	LAC DESDAT	/INIT DEST DEV
	XOR (1000
	DAC ZIFILD
	JMS ZIFIL
	LAC* ZEFILP	/CHECK ABSENCE OF
	SZA		/DEST FILE
	JMP ZEFILX
	LAC ZSFILP	/ENTER
	DAC ZEFILP	/SOURCE FILE NAME
ZEFILX	LAC ZEFILP	/DO EXT CHECK
	JMS EXTCK1
ZEFILE	XX		/ENTER DEST FILE
	4
ZEFILP	XX		/FILE ENTRY POINTER
ZTFIL5	LAC SRCDAT	/SET UP SOURCE DAT SLOTS
	DAC ZIFILD	/IN I/O MACROS-INIT
	DAC ZSFILE	/SEEK
	DAC ZRDWAT	/WAIT
	JMS ZIFIL		/INIT SOURCE FILE - 1ST TIME THROUGH
ZSFILX	LAC ZSFILP	/DO EXT CHECK
	JMS EXTCK1
ZSFILE	XX		/SEEK SOURCE FILE
	3
ZSFILP	XX		/FILE ENTRY POINTER
ZTRAN	LAC Z1BUFP	/SET UP BUF POINTER
	DAC MODN02	/IN READ, WRITE MACROS
	TAD DMPSW		/0, OR 2 IF PR+DUMP
	DAC MODN03
	LAC Z2BUFP
	DAC MODN04
	LAC DATAMD	/DUMP MODE?
	XOR DMPSW
	XOR (5
	SZA!CLC		/YES, USE WC=377
LITCLA	CLA		/NO,USE WC=376
	TAD LM376		/(-376
	DAC MODN02+1
	DAC MODN04+1
	TAD DMPSW		/0 OR 2 IF DUMP AND PR.
	DAC MODN03+1
	JMS YSPLIN	/SET UP FOR SEGMENT(Y) OPTION
	LAC DMPSW		/PR + DUMP?
	SZA!CLC
	LAW -4		/YES, SET FOR READ IN H
	TAD DATAMD	/VALUES AND SHIFT TO (6-8)
	CLL!RAL
	JMS R8L
	XOR ZRDWAT
	DAC ZRDCAL	/CAL+D.M.(6-8)+DATSLOT(9-17)
	DAC ZRDCL2
	CLC
	TAD DATAMD
	CLL!RAL
	JMS R8L
	XOR ZWTWAT
	DAC ZWTCAL
	LAC VSWTCH	/V?
	SNA		/YES, SUPPRESS OUTPUT
	JMP ZRDCAL
	LAC LITSKP	/(SKP
	DAC ZWTWAT
	LAC LITZR		/(JMP ZREST
	DAC ZWTCAL
ZRDCAL	XX		/READ I/O MACRO
	10
MODN02	XX		/BUF. ADDR.
	-376
ZRDWAT	XX		/WAIT FOR READ
	12
ZWTWAT	XX
	12
	DZM DELSW		/CLEAR DELETE LINE SW.
	LAC DATAMD	/DUMP MODE?
	XOR DMPSW
	SAD (5
	JMP ZDUMCK	/YES
	CLC		/SET UP HEADER POINTER FOR LATER EXAM
	TAD DMPSW		/0 OR 2 IF PR+DUMP
	CMA
	TAD MODN03
PNTTMP=DEVCHK
	DAC PNTTMP
	LAC* PNTTMP	/HEADER POINTER
HTEMP=GETDEV
	DAC HTEMP
	AND (7
	SAD (5		/EOF CHECK
	JMP ZPTRCK
	SAD (6		/EOM CHECK
	JMP ZEOM
	LAC* PNTTMP	/HEADER POINTER
	AND (60		/CHECK VALIDITY
	SZA
	JMP RFAIL		/ERROR MESSAGE 13, 14
ZLINCK	JMS FCHECK	/F SWITCH CHECK
ZRDCL2	XX		/2ND READ
	10
MODN04	XX
	-376
	LAC DELSW		/DELETE LINE?
	SZA
LITZR	JMP ZREST		/YES
	LAC DATAMD	/DUMP MODE?
	XOR DMPSW
	SAD (5
	JMP DEOFCK	/YES, SCAN FOR EOF
	JMS ZEOTCK		/CHECK W SWITCH
	JMS QCHEK		/Q CHECK MUST PRECEDE E,C,T CHECK
	JMS CECHEK		/CHECK E,C,T SWITCH
	JMS YCHECK	/CHECK Y SWITCH
ZWTCAL	XX
	11
MODN03	XX		/BUFF. ADDR.
	-376		/FOR IMAGE MAX ON DTA
ZREST	LAC DATAMD	/DUMP MODE?
	XOR DMPSW
	SAD (5
	JMP ZREST1	/YES,SKIP EOM CHECK
	LAC HTEMP		/HEADER  WD 1
	AND (7
	SAD (6
	JMP ZEOM1
ZREST1	LAC MODN04
	DAC MODN02
	CLC		/CALC CORRECT HEADER POINTER
	TAD DMPSW		/0 OR 2 IF PR+DUMP
	CMA
	TAD MODN03
	DAC MODN04
	LAC MODN02
	TAD DMPSW		/0 OR 2 IF PR+DUMP
	DAC MODN03
	JMP ZRDWAT
ZEOM	LAC* PNTTMP	/HEADER
	AND (7
	SAD (5
	JMP ZEOM1		/DON'T OUTPUT EOF HEADER AS LINE
	LAC DMPSW		/PR+DUMP?
	SNA		/YES, EQUIVALENT TO H INPUT
	LAC DATAMD	/CHECK FOR I OR H MODE
	SAD (2
	JMP ZWTCAL
	SAD (4		/I
	JMP ZEOM5		/SEE IF LAST FRAMES ARE TO BE DELETED
ZEOM1	LAC SRFCNT	/LAST SOURCE FILE
	TAD (1
	DAC RSTRTP
	DZM YEOFSW	/CLEAR NEW OUTPUT MEDIUM SW
	SNA		/NO
	JMP ZEOF		/YES
	LAC DSFCNT
	TAD (1
	SNA
	JMP ZEOM4
ZEOM2	LAW 2		/IF OUTPUT TO PP, CLOSE DEV FOR TRAILER.
	SAD PAPER
	SKP
	LAC (3		/BOTH PR AND PP?
	SAD PAPER
	SKP		/YES
	JMP ZEOM3
	LAC DESDAT
	DAC ZCLOSD
LITCLS	JMS ZCLOS
	LAC CNOP
	DAC ZEOF2
ZEOM3	JMS CONTLP	/OUTPUT ^P
	JMP .		/NEW MEDIUM REQUIRED
ZEOM4	LAW 1
	SAD PAPER		/PR?
	SKP
	LAC (3		/BOTH PR AND PP?
	SAD PAPER
	JMP ZEOM3		/YES, WAIT
	JMP ZEOF
ZEOM5	LAC CARD
	SZA		/NOT THE CARD READER
	JMP ZWTCAL	/OUTPUT LAST BUFF
	LAW 1		/PR?
	SAD PAPER
	SKP		/YES
	LAC (3		/PR+PP?
	SAD PAPER
	SKP
	JMP ZWTCAL	/NO, WAIT
	LAW 17000		/PR INPUT+EOM, STRIP LAST FRAMES
	TAD* PNTTMP	/DECR HEADER WPC (6 FRAMES)
	DAC* PNTTMP
	JMP ZWTCAL	/NOW, WAIT
/DUMP MODE EOF CHECK
DEOFCK	LAW -377		/SET WRITE WORD COUNT
	DAC MODN03+1
	DAC CHRTAB+1
	LAC MODN03	/SET UP BUFF POINT FOR EOF SCAN
	DAC CHRTAB
	DZM CHRTAB+3	/ACTUAL DATA COUNT
DEOF1	LAC* CHRTAB
	ISZ CHRTAB+3	/INDEX DATA COUNT
	ISZ CHRTAB	/INDEX DATA POINTER
	SAD (1005		/EOF, 1ST HALF?
	JMP DEOF2		/FOUND
DEOF3	ISZ CHRTAB+1	/NEG DATA COUNT
	JMP DEOF1		/TRY NEXT
	JMP ZWTCAL	/NOT FOUND, OUTPUT BLOCK
DEOF2	LAW 16773		/CHECK 2ND HALF OF EOF
	XOR* CHRTAB
	SZA
	JMP DEOF3		/NO MATCH
	ISZ CHRTAB+1
	SKP		/DUMP MODE EOF FOUND
	JMP ZWTCAL	/OVERFLOW OF BUFF,OUTPUT BLOCK
	LAW -2		/EXCLUDE EOF ITSELF FROM COUNT
	TAD CHRTAB+3
	CMA
	DAC MODN03+1	/MODIFY WORD COUNT FOR ACTUAL # OF DATA WORDS
	SZA		/EOF ONLY IN BLOCK
	JMP ZWTCAL	/OUTPUT LAST BLOCK
	JMP ZPTRCK
ZEOF	LAC SRCDAT	/SOURCE DAT SLOT
	DAC ZCLOSD
	JMS ZCLOS		/CLOSE SOURCE FILE
	LAC WSWTCH	/W SWITCH SET
	SZA		/NO - CLOSE OUTPUT FILE
	JMP ZEOFCK	/YES
ZEOF1	LAC DESDAT
	DAC ZCLOSD
	LAC VSWTCH	/V?
	SNA		/YES, DO NOT CLOSE DEST FILE
ZEOF2	XX		/CLOSE DEST FILE OR NOP IF CLOSED AT ZEOM2
	LAC LITCLS	/RESTORE
	DAC ZEOF2
	ISZ DSFCNT	/DEST FILE COUNT
	JMP ZTFIL1	/TRANSFER NEXT FILE
	ISZ SRFCNT
	SKP!CLA
	JMP ZCEXIT	/DONE - CHECK EXIT OR RSTART
	JMP FECHOI		/TOO MANY SOURCE FILES #18
ZEOFCK	LAC DSFCNT	/DOES DEST FILE COUNT
	SAD SRFCNT	/DIFFER FROM SOURCE COUNT
	JMP ZEOF1		/MAP FILES ONE TO ONE
	TAD (1
	SZA
	JMP ZEOF1		/NOT THE LAST - STILL ONE FOR ONE
	LAC ZSFILP		/UPDATE SOURCE
	TAD (3		/FILE POINTER
	DAC ZSFILP
	ISZ SRFCNT		/CHECK SOURCE COUNT
	JMP ZSFILX	/COMBINE REMAINING SOURCE
	CLA!CMA		/.CLOSE OUTPUT
	DAC SRFCNT		/FILE AND
	JMP ZEOF1		/TERMINATE FUNCTION
ZDUMCK	LAW -377		/DUMP MODE EOF?
	SAD MODN03+1
	JMP ZLINCK	/NO
ZPTRCK	LAC PAPER		/PR OR PP?
	SNA
	JMP ZEOF		/EOF
	JMP ZEOM		/YES, ACT LIKE EOM CODE
	.EJECT
/OUTPUT ^P SUBR
/
CONTLP	0
/.WRITE -3,2,ZOUTCP,4
	CAL+2775		/OUTPUT LF ^P CR
	11		/IOPS ASCII
MOD11	ZOUTCP
	-4
	JMP* CONTLP
/.EOT, .END CHECK SUBROUTINE (W SWITCH)
/
ZEOTCK	0
	LAC WSWTCH		/W SWITCH SET
	SNA
	JMP* ZEOTCK	/NO - OUTPUT LINE
	LAC DATAMD
	SAD (1		/IOPS BIN?
	JMP* ZEOTCK	/YES, EXIT - CHECKED ELSEWHERE
	LAC DSFCNT	/DOES DEST FILE COUNT DIFFER
	SAD SRFCNT	/FROM SOURCE COUNT?
	JMP* ZEOTCK	/NO, MAP FILES 1 TO 1 AND OUTPUT .END OR .EOT
	TAD (1		/LAST (OR ONLY 1) FILE?
	SZA		/YES, CHECK .EOT AND .END
	JMP* ZEOTCK	/STILL 1 TO 1
	LAC ZEOTP		/.EOT TABLE POINTER
	DAC ZENTP
	DZM ZSPACE		/CLEAR IGNORE SPACE SWITCH
	LAW -4		/CHAR COUNT
	JMS ZENTC		/.EOT CHECK
	DAC ZSPACE		/SET OR CLEAR SPACE SWITCH
	SZA		/.EOT NOT FOUND
	JMP ZREST		/DO NOT OUTPUT .EOT, READ NEXT LINE
	LAC ZENDP		/.END TABLE POINTER
	DAC ZENTP		/STRIP .END IF FOUND
	LAW -4		/CHAR COUNT
	JMS ZENTC		/.END CHECK
	ISZ ZSPACE
	SZA		/.END NOT FOUND
	JMP ZREST		/FOUND - STRIP
	JMP* ZEOTCK
/
	.EJECT
/EXAMINE LINE SUBROUTINE
/
ZENTC	0
	DAC ZENTC4	/SET CHAR COUNT FROM AC AT ENTRY
	LAC MODN03		/INPUT BUF. HEADER POINTER
	TAD (2
	JMS ZSET		/SET UP GETCHR ROUTINE
GTLIT	JMS GETCHR		/GET AN ASCII CHAR
	SAD (15
	JMP ZENTC5		/NOT FOUND
	SAD LIT40		/SPACE
	JMP ZENTC4		/YES
	SAD (11		/HT
	SKP		/YES - CHECK SPACE SWITCH
	JMP GTLIT
ZENTC4	XX
	DAC ZSPACE
	DAC ZSPW		/NOW USED AS COUNT
ZENTC3	JMS GETCHR		/NOW LOOK FOR .EOT
	XOR* ZENTP
	DZM ZSPACE
	SZA
	JMP ZENTC5		/NOT .EOT
	ISZ ZENTP		/INDEX TABLE POINTER
	ISZ ZSPW
	JMP ZENTC3
	JMS GETCHR		/FOUND - NOW NEXT CHAR
	SAD LIT40		/MUST BE SP,HT,CR OR;
	JMP* ZENTC		/
	SAD (11		/HT
	JMP* ZENTC		/
LSAD15	SAD (15		/CR
	JMP* ZENTC
	SAD (73		/;
	JMP* ZENTC
ZENTC5	CLA		/NOT FOUND
	JMP* ZENTC
/
ZSPW	0		/SPACE SWITCH, NOT 0 = SP OR HT FOUND
	.EJECT
/F (FORM FEED) SWITCH SUBR
/
FCHECK	0
	LAC FSWTCH	/IS F SWITCH SET?
	SNA		/F SWITCH IS SET
	JMP* FCHECK	/NOT, EXIT
	LAC MODN03	/CHECK FOR FF IN CHAR POSITION 1 OF LINE
	TAD (2
	DAC ZENTC
	LAW 14000
	AND* ZENTC	/FF?
	XOR (60000
	SZA		/YES
	JMP FCH2		/NO, CHECK FOR .EJECT
	LAW -72
	DAC LINCNT
	JMP* FCHECK
FCH2	LAC ZEJEPT	/SET UP POINTER TO .EJECT TABLE
	DAC ZENTP
	DZM ZSPACE	/CLEAR IGNORE SPACE SWITCH
	LAW -6		/CHAR COUNT
	JMS ZENTC		/EXAMINE LINE SUBR
	SZA		/NOT FOUND
	LAW -3		/.EJECT FOUND, SET -2 INTO LNCNT
	TAD (1
	SPA
	DAC LINCNT	/.EJECT FOUND, SET LINE COUNT TO OVERFLOW
	DAC ZSPACE	/SET IGNORE SPACE SWITCH
FCH4	ISZ LINCNT
	JMP* FCHECK
	JMS FFOUT		/INSERT FF, CR
	JMP* FCHECK
ZEJTAB=.
	56		/.
	105		/E
	112		/J
	105		/E
	103		/C
	124		/T
/FF,CR OUTPUT SUBR
/
FFOUT	0
	LAC ZWTCAL	/WRITE CAL
	DAC FFWRIT
	AND (777		/AND OFF DATA MODE.
	DAC FFWT
FFWT	XX
	12		/WAIT
FFWRIT	XX
	11
MOD15	FFLIN
LM376	-376
	LAW -71		/RESET LINE COUNT TO -57 (ACTUALLY 56 SINCE ONE LINE
	DAC LINCNT	/READY TO GO NOW- SAME EFFECT AS -72 AND 'JMP FCH4'.').
	JMP* FFOUT
	.EJECT
/Y SWITCH SUBR
/
YCHECK	0
	LAC YSWTCH	/Y SWITCH SET?
	SNA
	JMP* YCHECK	/NO
	LAC MODN03
	TAD (2
	JMS ZSET		/SET UP GETCHR ROUTINE
	LAW -5
	DAC ZSPW		/CHARACTER COUNT
	LAC CHARPT	/(CHRTAB
	DAC ZENTP
YCHNEX	DZM ZSPACE	/CLEAR IGNORE SPACE SW
	JMS GETCHR
	SAD (12		/IGNORE FORM CONTROL (LF)
	JMP YCHNEX
	SAD (13		/VT
	JMP YCHNEX
	SAD (14		/FF
	JMP YCHNEX
	DAC ZSPACE	/SET IGNORE SPACE SW
	LAC* ZENTP
	SZA
	SAD ZSPACE
	SKP
	JMP* YCHECK	/NO MATCH
	ISZ ZENTP
	ISZ ZSPW
	JMP YCHNEX
/SPLIT LINE FOUND - OUTPUT .EOT, CLOSE OUTPUT FILE, ENTER NEW FILE
/
YLNFND	LAC ZWTCAL
	DAC .+1
	XX		/WRITE CAL FOR .EOT
	11
MOD12	EOTLIN
	-376
	LAC DESDAT	/CLOSE OUTPUT FILE
	DAC ZCLOSD
	XOR (1000
	DAC ZIFILD
	JMS ZCLOS
	CLA
	ISZ DSFCNT
	SKP
	JMP YECHOE	/MSG 16, TOO FEW DEST FILES
	LAC ZXFILP
	TAD (3
	DAC ZXFILP
	LAW -1		/SET UP FOR ^P FOR NEW OUTPUT MEDIUM
	DAC RSTRTP
	DAC YEOFSW
	JMS CONTLP	/OUTPUT ^P
	JMP .
/INIT NEXT OUTPUT FILE
/
NEWOUT	JMS ZIFIL
	LAC ZXFILP
	JMS EXTCK1	/CHECK EXT
/ENTER NEXT OUTPUT FILE
ZXFILE	XX
	4
ZXFILP	XX
	JMS YSPLIN	/SET UP FOR NEXT SPLIT
	JMP* YCHECK
/
YECHOE	DZM STRCNT	/CLEAR STRING COUNT
	JMP FECHOG
/SET UP FOR SPLIT (Y) OPTION
/
YSPLIN	0
	ISZ STRCNT
	JMP YSP1
	DZM YSWTCH	/SPLITS COMPLETE
	LAW -1
	DAC STRCNT	/INSURE ISZ NEXT TIME THRU
	JMP* YSPLIN
YSP1	LAC SNAMPT
	TAD (2
	DAC SNAMPT
	JMS ZSET		/SET UP GETCHR
	LAW -5		/COUNT TO GET 5 CHAR'S
	DAC ZSPW
	LAC CHARPT	/INIT STRING AREA POINTER (CHARTAB
	DAC ZENTP
YSPNCH	JMS GETCHR	/PICK UP AND STORE 5 CHAR'S IN CHRTAB
	DAC* ZENTP
	ISZ ZENTP
	ISZ ZSPW
	JMP YSPNCH
	JMP* YSPLIN
/
/
/CHAR STRING AREA
CHRTAB	0
	0
	0
	0
	0
	0
SNAMPT	0		/(SNAMES
/
	.EJECT
/TAP3 OF 6: PIP.
/SUBROUTINE TO SET UP PROUT
/
PRSET	0
	LAC (2775
	DAC PRDAT		/PROUT DAT SLOT = -3, IOPS ASCII
	XOR ZOUTCP		/(2000
	DAC PRWAT
	JMP* PRSET
ZEOTTB=.
	56	/.
	105	/E
	117	/O
	124	/T
/
ZENDTB=.
	56	/.
	105	/E
LITN	116	/N
	104	/D
/
RFAIL	DAC TEMP1		/T. STORE VALIDITY BITS
RIOPS	LAC GSWTCH		/G OPTION ONOR VERIFY ON?
	TAD VSWTCH
	SNA
	JMP RFAIL1		/NO
	LAC (JMP RFRET
	DAC ERRJMP
RFAIL1	LAC TEMP1		/PRINT PARITY OR CHKSUM ERR
	JMP FECHOD
/
RFRET	LAC LITJMP		/RESTORE
	DAC ERRJMP
	LAC DATAMD
	SAD (1		/IOPS BIN?
	JMP ZRDCL2	/KEEP READING
	JMS PRSET		/SET UP PROUT
	LAC MODN03		/OUTPUT LINE POINTER
	JMS PROUT		/OUTPUT BAD LINE ON TTY
	LAC VSWTCH	/V SWITCH SET?
	SZA		/NO, ALLOW CORRECTION
	JMP ZRDCL2	/KEEP READING
	JMS LFOUT		/OUTPUT LF > AND READ KEYBOARD
	SAD (15		/CHAR IN AC ON RET
	JMP ZLINCK		/LINE OK, CONTINUE
	SAD LITD		/D = DELETE LINE
	JMP RDCEK
/
/INSERT NEW LINE IN Z1BUF OR Z2BUF
INSERT	LAC MOD04		/(BUFFER
	JMS INS1
	JMP ZLINCK		/CONTINUE TRANSFER
/
	.EJECT
RDCEK	JMS GETCHR
	SAD (15		/CR?
	SKP
	JMP INSERT		/D NOT FOLLOWED BY CR
/
DELINE	DAC DELSW		/SET DELETE LINE SWITCH
	JMP ZRDCL2		/CONTINUE
/
/
/SUBROUTINE TO OUTPUT LF>, READ KEYBOARD, GET 1ST CHAR
/
LFOUT	0
/          .WRITE -3, 3, OUTBRK, 4	/OUTPUT LF >
	CAL+3775		/IMAGE ALPHA
	11
MOD03	OUTBRK
	-4
	JMS READTT		/READ KEYBOARD
	JMS GETCHR		/PICK UP 1ST CHAR
	JMP* LFOUT
/E,C,T SWITCH CHECK SUBROUTINE
/
CECHEK	0
	LAC CETSW		/E=1, C=2, T=4
	SNA
	JMP* CECHEK	/NONE SET
	JMS CSET		/INIT GET ,PUT
	DZM TEMP5		/IN CASE OF T
	LAC CETSW
	RTR
	SMA		/E SWITCH SET
	JMP CSW
/E SWITCH: TABS TO SPACES
/
CECHL	LAW -10		/8 CHARACTER TAB SET.
	DAC TEMP5
GETSW	JMS GETCHR		/JMS GETCHR 
ECRSWT	SAD (15
	JMP CECEND		/END LINE ROUTINE
	SAD (11		/HT?
	JMP VTCON		/CONVERT TO SPACES
PUTSW	JMS KLPUT
	SAD (12		/LF
	JMP ENEXT
	SAD (13		/VT
	JMP ENEXT
	SAD (14		/FF
	JMP ENEXT
	ISZ TEMP5
ENEXT	JMP GETSW		/NEXT CHAR
	JMP CECHL
	.EJECT
/Q SWITCH SUBR
/
QCHEK	0
	LAC QSWTCH	/Q SWITCH SET?
	SZA		/NO, FALL THRU TO EXIT
	LAC* MODN03	/EXAM WPC
	AND (377000
	TAD (757000		/GREATER THAN 72 CHAR'S? 
	SPA		/YES, TRUNCATE TO 72, CR AS 73RD
	JMP* QCHEK	/NO, EXIT
	LAC (377000
	CMA
	AND* MODN03
	XOR (20000	/WPC FOR 73 CHAR'S
	DAC* MODN03
	LAC MODN03	/BUFF POINTER
	TAD (36
	DAC QSWTCH	/TEMP
	LAW 17760		/AND OUT 1ST 2 CHAR'S OF 5/7 PAIR
	AND* QSWTCH
	TAD (1		/BUILD 3RD CHAR=CR
	DAC* QSWTCH
	ISZ QSWTCH
	LAC LITCR		/2ND HALF
	DAC* QSWTCH
	JMP* QCHEK
/HT TO SP ROUTINE
/
VTCON	LAC LIT40
	JMS KLPUT
	ISZ TEMP5
	JMP VTCON
	JMP CECHL		/NEXT CHAR-RESET CHAR COUNT
/
/C SWITCH: SPACES TO TABS
/
CSW	SNL		/C SWITCH
	JMP TSW		/T SWITCH SET
VTCONE	LAW -10		/SET TAB STOP
	DAC TEMP5
	.EJECT
/T SWITCH: DELETE TRAILING BLANKS
/
TSW	DZM CSET		/INIT SPACE COUNT TO 0
VTCONX	JMS GETCHR
	SAD LIT40		/SPACE?
	JMP SPCON		/YES
	SAD (15		/CR?
	JMP CECEND	/YES, EXIT
	DAC KLFOCT		/T. STORE
HTSP	LAC CSET		/# OF SPACES TO OUTPUT
	CMA
	DAC CSET
HTSP1	ISZ CSET
	SKP
	JMP VTCONK		/OUTPUT CURR CHAR
	LAC LIT40
	JMS KLPUT
	JMP HTSP1
VTCONK	LAC KLFOCT		/NOW OUTPUT CURR. CHAR.
	SNA
	JMP VTCONX
VTCONP	JMS KLPUT
	SAD (12		/LF
	JMP VTCONX
	SAD (13		/VT
	JMP VTCONX
	SAD (14		/FF
	JMP VTCONX
VTCONZ	ISZ TEMP5
	JMP VTCONX
/OUTPUT TAB IF SPACES HAVE ACCUMULATED UP TO TAB STOP
	LAW -12		/RESET TAB STOP
	DAC TEMP5
	LAW -2
	TAD CSET
	DZM KLFOCT		/SET NOT TO OUTPUT
	SPA
	JMP HTSP		/OUTPUT 0 OR 1 SP
	LAC (11		/SUBSTITUTE HT (TAB)
	JMS KLPUT
	JMP VTCONE
/SPACE TO HORIZONTIAL TAB ROUTINE.
/
SPCON	ISZ CSET		/INDEX SPACE COUNT
	JMP VTCONZ
	.EJECT
/END LINE ROUTINE
/
CECEND	JMS KLPUT		/OUTPUT CR
	LAC LTECHO	/(CMECHO
	JMS INS1		/SUBSTITUE MODIFIED LINE
	LAC (DAC* ALLOUT	/RESET SWITCH FOR
	DAC VALSW		/COMMAND STRING ECHO
	JMP* CECHEK	/EXIT
/
/INSERT LINE SUBR (TO Z1BUF OR Z2BUF)
/ON ENTRY: AC=NEW LINE BUFFER POINTER
/
INS1	0
	DAC ZLSAV1		/(BUFFER
	LAW -42
	DAC TEMP1
	LAC GSWTCH
	SPA
	JMP FIXWPC
	LAW -3		/COMPUTE WPC ('CLC' AND 'TAD (2' FOR HEADER PAIR.)
	TAD ZLSAV1
	CMA
	TAD PUTP
	JMS R8L
	SKP
FIXWPC	LAC* ZLSAV1		/WPC ALREADY CONSTRUCTED.
	AND (377000
	DAC* ZLSAV1	/HEADER
INS	LAC* ZLSAV1
/MODN10 MUST HAVE BEEN SET TO POINT TO Z1BUF OR Z2BUF
	DAC* MODN10
	IDX ZLSAV1
	IDX MODN10
	ISZ TEMP1
	JMP INS
	JMP* INS1
/INIT GET PUT SUBR
/
CSET	0
	LAC PECHO2		/(CMECHO+2
	DAC PUTP		/INIT KLPUT
	DZM PUTC
	DZM PUTCT
	LAC MODN03
	DAC MODN10	/INIT MODN10 FOR LINE SWAP
	TAD (2			/INIT GETCHR (INPUT BUF POINTER)
	JMS ZSET
	DZM ZSPACE		/CLEAR IGNORE SPACE SWITCH
	LAC CNOP		/FAKE GETCHR TO NOT SET UP ECHO
	DAC VALSW
	JMP* CSET		/AC MUST BE NON 0 ON EXIT
	.EJECT
/INIT SUBR.
ZIFIL	0
ZIFILD	XX		/DAT SLOT (MODIFIED)
	1
MOD10	NUORRE		/CONTROL ON ^P
	0		/BUF. SIZE RETURNED
	JMP* ZIFIL
/SUBR. TO PROCESS S OR N OPTION
ZSCODE	0
	LAC DIRSWH
	SNA!STL		/BIT 17 (S=1) INTO LINK
	JMP* ZSCODE		/NEITHER N OR S. EXIT
	LAC DESDAT		/DEST. DAT SLOT
	JMS ZSETTR	/TRAN SETUP
ZCLEAR	XX		/CLEAR (BE SURE INIT EXECUTED FOR THIS DAT SLOT.)
	5
	LAC DIRSWH
	DZM DIRSWH	/ONCE ONLY
	RAR
	SNL!CLC		/S SWITCH
	JMP* ZSCODE	/N SWITCH, DONE
	JMS ZTRANS
	LAC (077777	/DIR WD 3=077777 IN ALL CASES
	DAC* Z1B003
	LAC Z1B003
	TAD (1
	DAC ZENTP		/SET UP POINTER FOR REST OF SAVE AREA
	LAC* (.SCOM	/FIND #OF K(CORE) IN SYSTEM.
	CLL!RAL
	JMS R6L
	AND (7
	DAC ZEROB		/T STORE BANK VALUE(1,3,5.7)+POINTER
	.IFDEF PDP15
	LAC* (.SCOM+20	/EXTRA 4K?
	SPA!CLA			/NO.
	IDX ZEROB		/YES - MUST ADJUST ^Q DUMP AREA.
	LAC ZEROB
	.ENDC
	TAD LM5		/FOR 24, 28 AND 32K,  THE NO. OF -1
	SMA!CLC		/WORDS IS ONE LESS THAN BITS 3-5 OF .SCOM.
	CLL!RAL		/THE OTHERS CORRESPOND EXACTLY.
	TAD ZEROB
	CMA
	DAC ZCT		/#OF -1 WORDS
	LAC ZEROB
	TAD DSFADR	/(DSFPTR
	DAC ZEROB		/ADDRESS OF LAST BIT MAP CONSTANT.
LM1	LAW -1		/32 BLOCKS = 8K (1 -1 WORD)
			/48 BLOCKS = 12 K 82 -1 WORDS)
ZCLER2	DAC* ZENTP	/64 BLOCKS = 16 K (3 -1 WORDS).
			/80 BLOCKS = 20K. (4 -1 WORDS).
	IDX ZENTP		/96 BLOCKS = 24 K (4 -1 WORDS).
			/112 BLOCKS= 28K. (5 -1 WORDS).
	ISZ ZCT		/128 BLOCKS = 32 K (6 -1 WORDS).
	JMP ZCLER2
	LAC* ZEROB	/PICK UP LAST BIT MAP CONSTANT FROM
	DAC* ZENTP		/TABLE STARTING AT DSFPTR+1.
	CLL
	LAC DESDAT
	JMS ZSETTR
	JMS ZTRANS	/OUTPUT NEW DIRECTORY
	JMP* ZSCODE		/EXIT
/
/SUBR. TO STORE DAT SLOT IN ZCLEAR, ZTRWAT, ZTRANZ
/ON ENTRY:
/AC=DAT SLOT#
/L=0=OUTPUT, L=1=INPUT
/ON EXIT:
/AC=C(ZTRANZ)
/LINK UNTOUCHED
ZSETTR	0
	DAC ZCLEAR		/CLEAR
	DAC ZTRWAT		/TRAN WAIT
	SNL		/INPUT
	XOR (1000		/OUTPUT
	DAC ZTRANZ		/TRAN
	LAC (100		/DIR BL#
	DAC ZBLNUM		/TRAN. BL#
	LAC Z1BUFP
	DAC MODN06
	LAC ZTRANZ		/DEST. DAT SLOT + I/O BIT IN AC ON EXIT
	JMP* ZSETTR
/TRAN SUBROUTINE, INCLUDES .WAIT
/
ZTRANS	0		/ALSO USED AS TEMP. STOR.
ZTRANZ	XX
	13
ZBLNUM	100
MODN06	XX		/NORMALLY Z1BUF
	-400
ZTRWAT	XX			/WAIT
	12
	JMP* ZTRANS
/ZERO BUF. SUBR
/AC=-COUNT ON ENTRY
/
ZEROB	0
ZCT=ZSPW				/TEMP. COUNT
	DAC ZCT			/CLEAR COUNT
	LAC Z1BUFP
	DAC ZENTP			/USED ALSO IN SUBR. ZENTC
ZEROB1	DZM* ZENTP
	ISZ ZENTP
	ISZ ZCT
	JMP ZEROB1
	JMP* ZEROB
	.EJECT
/CLOSE SUBR
/
ZCLOS	0
	LAC FSWTCH	/IS F SWITCH SET?
	SNA
	JMP ZCLOSD
	LAC ZCLOSD	/OUTPUT CLOSE?
	XOR DESDAT
	SZA
	JMS FFOUT		/YES, ISSUE FF,CR
ZCLOSD	XX
	6
	JMP* ZCLOS
/RENAME FILE ROUTINE
/
ZRENAM	LAC LDFPTR	/DEST FILE POINTER
	DAC DSFPTR	/SET UP FOR RENAME
	LAC ZOUTCP		/RE. SW=2000
	SKP
/DELETE FILE ROUTINE
/
ZDELET	LAC (1000		/DEL. SW=1000
	DAC ZDRSW		/REN/DEL SWITCH
	CLL		/LINK=0 1ST TIME THRU
	LAC LSFPTR	/SOURCE FILE POINTER
ZDLMOR	AND (77777
	SZL
	TAD (3
	DAC SRFPTR
	DAC MODN01		/.OPER ENTRY POINTER
	LAC ZDRSW		/CHECK FOR RENAME (2000)
	SAD ZOUTCP		/TO SET UP
	JMS ZDRENS		/NEW FILE NAME
	XOR SRCDAT		/SET UP CAL
	DAC ZDFILD
	.EJECT
/DELETE OR RENAME I/O MACRO
/
ZDFILD	XX		/DAT SLOT (MODIFIED)
	2
MODN01	XX		/SOURCE FILE POINTER
	SNA!STL		/SET LINK TO UPDATE SRC FILE ENTRY POINTER
	JMP FECHO6		/ERROR MESSAGE #6
	LAC ZDRSW
	SAD ZOUTCP		/IF RENAME (2000)
	JMS DRENRS		/RESET POINTERS AND FILE NAMES
	LAC MODN01		/SOURCE FILE POINTER
	ISZ SRFCNT
	JMP ZDLMOR		/MORE FILES TO DELETE OR RENAME
	JMP ZCEXIT		/DONE - CHECK EXIT OR RESTART
ZSAVPT=TMPFLP
/
/SUBR TO PLACE DEST FILE NAME IN SRC FILE LIST
/
ZDRENS	0
	LAW -3
	DAC ZCT
	LAC ZSAVPT
	DAC ZENTP
	LAC SRFPTR		/SET UP TEMP POINTER
	TAD (3		/TO PLACE DEST FILE
	DAC ZEROB		/IN SRC LIST
DRENS1	LAC* ZEROB
	DAC* ZENTP
	LAC* DSFPTR
	DAC* ZEROB
	ISZ SRFPTR
	ISZ DSFPTR
	ISZ ZENTP
	ISZ ZEROB
	ISZ ZCT
	JMP DRENS1
	LAC ZOUTCP
	JMP* ZDRENS	/(2000 MUST BE IN AC ON EXIT
/RESET SUBR. AFTER RENAME
/
DRENRS	0
	LAW -3
	DAC ZCT
	LAC SRFPTR
	DAC ZEROB
	LAC ZSAVPT		/SAVE AREA POINTER
	DAC ZENTP
DRENR1	LAC* ZENTP
	DAC* ZEROB
	ISZ ZENTP
	ISZ ZEROB
	ISZ ZCT
	JMP DRENR1
	JMP* DRENRS
	.EJECT
/LIST (L) DIRECTORY ROUTINE
/
ZLDIR	LAC DESDEV		/SAVE DEST. DEV. NAME
	DAC ZLSAV1		/AND DAT SLOT TO CHECK S OR N SWITCH
	LAC DESDAT		/ON SOURCE DEV.
	DAC ZLSAV2
	LAC SRCDAT
	DAC DESDAT
	XOR (1000		/SET UP OUTPUT INIT ON SRC DEV.
	DAC ZIFILD
	JMS ZIFIL
	LAC SRCDEV
	DAC DESDEV
	JMS ZSCODE		/CHECK S OR N SWITCH
	LAC ZLSAV1		/RESTORE DEST. DEV AND .DAT SLOT
	DAC DESDEV
	LAC ZLSAV2
	DAC DESDAT
	DAC PRWAT		/OUTPUT WAIT
	DAC ZCLOSD		/OUTPUT CLOSE
	XOR ZOUTCP		/(2000
	DAC PRDAT		/SET UP OUTPUT DAT SLOT FOR IOPS ASCII
	STL
	LAC SRCDAT
	JMS ZSETTR		/SET UP ZTRAN FOR INPUT
	LAW -7
	DAC ZCOUNT	/FILE BIT MAP BLOCK COUNT
	LAC Z2BUFP
	DAC TEMP3		/STORAGE AREA FOR FILE BLK COUNTS
	LAC (71		/INIT FILE BIT MAP BLOCK
	DAC ZBLNUM
ZNXBLK	JMS ZTRANS	/BRING IN FILE BIT MAP BLK
/
/
/ROUTINE TO COUNT FILE BLOCKS OCCUPIED
/
ZLDBLK	LAW -10
	DAC ZCT		/FILE BIT MAP PER BLOCK COUNT
	CLC
	TAD Z1BUFP		/FILE BIT MAP POINTER
	DAC* (12		/AUTO 12
ZLDMAP	LAC (SPA!RAL	/COUNT BLOCK OCCUPIED
	JMS BITCNT		/COUNT OCCUPIED BLOCKS FOR THIS FILE
	IDX TEMP3		/UPDATE COUNT POINTER
	ISZ ZCT		/FILE BIT MAP PER BLOCK COUNT
	JMP ZLDMAP
	IDX ZBLNUM		/INDEX BL.# (71-77)
	ISZ ZCOUNT
	JMP ZNXBLK
	.EJECT
/ROUTINE TO COUNT FREE BLOCKS.
/
	STL
	LAC SRCDAT
	JMS ZSETTR		/SET UP TO BRING IN DIR.
	JMS ZTRANS
	CLC
	TAD Z1BUFP		/DIR BIT MAP POINTER
	DAC* (12
	LAC (SMA!RAL	/COUNT FREE BLOCKS
	JMS BITCNT
	LAC* TEMP3		/SAVE # OF FREE BLKS
	DAC TEMP6
	LAC DESDAT
	XOR (1000
	DAC ZIFILD
	JMS ZIFIL		/INIT OUTPUT DEV  (TTY OR LPT)
	LAC PLHEAD
	JMS PROUT		/PRINT HEADER:  DIRECTORY LISTING
	JMS ZFIL56	/CHECK FOR 24 OR 56 FILES
	DAC FILNUM
	DAC ZCT		/NON-ZERO TO
	JMP FILOUT	/COUNT NUMBER OF USER FILES.
/
/PRINT # OF FREE BLOCKS.
PUSPR	DZM ZCT
	LAC PLFREE	/(LFREE+2
	JMS PRCOMP
TEMP6	0
/
/PRINT # OF USER FILES
/
	LAC PLUSER	/(LUSER+2
	JMS PRCOMP	/SUBR TO SET UP OUTPUT LINE
TEMP7	0		/TEMP STOR,;#OF USER FILES
/PRINT # OF SYSTEM PGM BLOCKS.
/
	LAW -1101		/1100-(FREE+USER)=SYS PGM BLKS
	TAD TEMP2		/USER BLKS
	TAD TEMP6		/FREE BLKS
	CMA
	DAC SYSCT
	SPA!SNA		/ILLEGAL # SYSTEM BLOCKS? (MINUS OR 0)
	JMP SYSER1	/YES - APPEND 'ILLEGAL COUNT' TO PRINT OUT.
	CMA
	TAD (1101		/CHECK NOT GREATER THAN 1100 BLOCKS.
	SPA		/NO PROBLEM.
SYSER1	DZM LSYSND-1		/STRIP CARRIAGE RETURN FROM 'LSYS'SO
				/ERROR MESSAGE GOES ON THE SAME LINE.
	LAC PLSYS		/(LSYS+2
	JMS PRCOMP
SYSCT	0			/RESTORE ASCII CR TO LSYS.
	LAC TEMP2+2		/006400.
	DAC LSYSND-1
/PRINT FILE NAMES.
/
FILOUT	LAC Z2BUFP	/INIT BLOCK COUNT TABLE.
	DAC TEMP3		/POINTER TO (BUFFER
	DAC BLPRNT	/SET BLOCK PRINT SWITCH
	DZM TEMP2		/TOTAL USER PGM. BLOCK COUNT
	DZM TEMP7		/USER FILE COUNT
	LAC Z1B040
	JMS PFILE		/PRINT FILE NAMES
FILNUM	XX
	DZM BLPRNT	/CLEAR BLK PRINT SWITCH
	LAW -70
	SAD FILNUM
	JMP TEMP61	/NON SYSTEM TAPE
	LAC Z1B200
	TAD LIT40
	JMS PFILE		/PRINT SYS. PGM. NAMES
	LAW -30
TEMP61	JMS ZCLOS		/CLOSE OUTPUT DEV
	LAC SRCDAT		/CLOSE SOURCE DEV
CLOUT	DAC ZCLOSD
	JMS ZCLOS
	JMP ZCEXIT
/
/SUBR TO INSERT VARIABLE IN OUTPUT LINE AND PUT OUT THE LINE
/CALLING SEQ.:
/	(AC=DATA POINTER,E.G., LBUF+2)
/	JMS PRCOMP
/COUNT	N		/N=# TO BE INSERTED
PRCOMP	0
	DAC ZCLOS		/DATA POINTER
	JMS SETPUT	/SET UP KLPUT ROUTINE
	LAC* PRCOMP	/VARIABLE FOR INSERTION
	ISZ PRCOMP	/INDEX TO EXIT
	JMS KLFOCT	/INSERT IN OUTPUT LINE
	LAW -2
	TAD ZCLOS		/LINE BUFF POINTER
	JMS PROUT		/OUTPUT LINE
	JMP* PRCOMP	/EXIT
/SUBR TO CHECK FOR 24 OR 56 FILES
/
ZFIL56	0
	CLC
	XOR* Z1B203	/WD 3OF SYS DIR BIT MAP
	SNA!CLA		/56 FILES
	LAW -30		/24 FILES
	SMA
	LAW -70
	JMP* ZFIL56
	.EJECT
/SUBROUTINE TO COUNT BLOCK OCCUPIED OR FREE.
/AC = SPA!RAL (OCCUPIED COUNT) OR
/AC = SMA!RAL (FREE COUNT)
BITCNT	0
	DAC ZLDBIT		/SWITCH
	DZM* TEMP3		/CLEAR FILE BLOCK COUNT
	LAW -40		/FILE BITMAP COUNT
	DAC TEMP1
ZLDWRD	LAW -22		/1 WD BIT COUNT
	DAC TEMP2
	LAC* 12		/NEXT BIT MAP WD
ZLDBIT	XX		/SPA!RAL OR SMA!RAL
	IDX* TEMP3		/BLOCK COUNT
	ISZ TEMP2
	JMP ZLDBIT		/NEXT BIT
	ISZ TEMP1
	JMP ZLDWRD		/NEXT WORD
	JMP* BITCNT
/
/SUBROUTINE TO PRINT FILE NAMES
/AC = DIR ENTRY SECT. POINTER
/
PFILE	0
	DAC KLDIRF
	XCT* PFILE	/LAW -30 OR LAW -70
	ISZ PFILE		/INDEX TO EXIT
	DAC KLCNTD	/NUMBER OF FILE ENTRIES.
KLNXTF	LAC KLDIRF
	TAD (3
	DAC KLDIRT
	LAC* KLDIRT	/GET FILE COMPLETE BIT
	SPA
	JMP KLFILE		/GOOD FILE
KLNXT	LAC KLDIRT
	TAD (1
	DAC KLDIRF	/NEXT FILE
	ISZ TEMP3		/UPDATE TO NEXT BLOCK COUNT
	ISZ KLCNTD
	JMP KLNXTF
	LAC ZCT		/RETURN TO PUSPR
	SZA		/IF ONLY COUNTING FILES
	JMP PUSPR
	JMP* PFILE		/DONE
KLFILE	IDX TEMP7		/USER FILE COUNT
	LAC* TEMP3	/BLOCK COUNT
	TAD TEMP2		/TALLY NON-SYSTEM BLOCK COUNT
	DAC TEMP2
	LAC ZCT
	SZA
	JMP KLNXT		/ONLY COUNTING FILES
	LAC PECHO2
	JMS SETPUT		/SET UP KLPUT
	LAC* KLDIRF	/1ST PART OF NAME
	ISZ KLDIRF
	JMS KLFSIX		/FROM SIXBT
	LAC* KLDIRF	/LAST PART OF NAME
	ISZ KLDIRF
	JMS KLFSIX		/FROM SIXBT
	LAC LIT40		/SPACE
	JMS KLPUT
	LAC* KLDIRF	/EXTENSION
	ISZ KLDIRF
	JMS KLFSIX		/FROM SIXBT
	LAC* KLDIRF	/START BL #
	AND (1777
	JMS KLFOCT		/OCTAL TO 7BIT ASCII
	LAC BLPRNT	/BLK PRINT SWITCH SET?
	SNA
	JMP KLCR		/NO - OUTPUT CR
	LAC* TEMP3		/BLOCK COUNT - CURRENT FILE
	JMS KLFOCT
KLCR	LAC (15		/CR
PTLIT	JMS KLPUT
	JMS COMWPC		/COMPUTE W.P.C.
	LAC LTECHO
	JMS PROUT		/OUTPUT LINE SUBR.
	JMP KLNXT		/NEXT FILE.
/
/TAP4 OF 6: PIP.
/
/SUBROUTINE TO COMPUTE OUTPUT HEADER W.P.C.
/
COMWPC	0
	LAC PUTCT
	TAD (2		/ADD 2 FOR HEADER
	CLL!RAL
	JMS R8L
	DAC* LTECHO	/(CMECHO
	JMP* COMWPC
/
	.EJECT
/OCTAL (AC) TO ASCII SUBROUTINE USING  KLPUT.
/KLSUPR = 40 FOR 0 SUPPRESSION;
/
KLFOCT	0
	DAC KLCHAR		/OCTAL VALUE TEMP STORE
	SZA
	JMP KLNTZO
	LAW -5		/ZERO LOC
	DAC KLCNT		/OCTAL PLACE COUNT
	LAC KLSUPR		/SUPPRESS
	JMS KLPUT
	ISZ KLCNT
	JMP .-3
	LAC (60		/PRINT ZERO
	JMS KLPUT
	JMP KLSET
/
KLNTZO	LAC CNOP
	DAC KLZERO
	LAW -6
	DAC KLCNT
KLNXTD	LAC KLCHAR		/GET WORD
	RCL
	RTL
	DAC KLCHAR		/SAVE WORD
	RAL
	AND (7
	DAC KLCHR2
KLZERO	NOP
	SNA
	JMP KLOCTZ
	LAC .+3
	DAC KLZERO
	LAC KLCHR2
	JMP KLNZRO
KLOCTZ	LAC KLSUPR
LITSKP	SKP
KLNZRO	XOR (60		/MAKE ASCII
	JMS KLPUT		/OUTPUT CHAR
	ISZ KLCNT
	JMP KLNXTD		/NEXT DIGIT
KLSET	LAC LIT40
	DAC KLSUPR
	JMP* KLFOCT
/
	.EJECT
/IOPS 5/7 ASCII PACKING ROUTINE
/INITIALIZE:
/          PUTC TO 0
/          PUTP TO 1ST WORD
/          PUTCT TO 0
KLPUT	0
	AND (177
	DAC PUT1		/TSTORE CHAR
	CLL
	LAC PUTC		/CHAR POSITION
	TAD (JMP* PUTJ
	DAC .+2
	LAC PUT1		/PICK UP CHAR
	XX		/MODIFIED JMP
MOD52=.
PUTJ	PUT571		/CHAR 1
MOD53	PUT572		/CHAR 2
MOD54	PUT573		/CHAR 3
MOD55	PUT574		/CHAR 4
MOD56	PUT575		/CHAR 5
/
PUT571	RTR		/8 RIGHT
	JMS BLROT		/3 RIGHT
	JMS BLROT
PUT57A	DZM* PUTP		/CLEAR DATA WORD
	JMP PUTEND
/
PUT572	RTL		/4 LEFT
	RTL
	JMP PUTEND
/
PUT573	JMS BLROT		/3 RIGHT - 1ST HALF
	AND (17
	XOR* PUTP
	DAC* PUTP
	ISZ PUTP		/LAST WORD OF PAIR
	LAC PUT1
	RTR		/4 RIGHT - 2N  HALF
	RTR
	AND LH7		/(700000
	JMP PUT57A
/
PUT574	JMS R8L		/8 LEFT
	JMP PUTEND
/
	.EJECT
PUT575	RAL		/1 LFT
	DZM PUTC		/RESET 5/7 COUNTER
	SKP
PUTEND	ISZ PUTC
	XOR* PUTP
	DAC* PUTP
	LAC PUTC
	SZA		/2ND WD COMP
	JMP .+3
	ISZ PUTCT		/WD. PR. CT.
	ISZ PUTP		/2ND WD COMPLETE
	LAC PUT1
	JMP* KLPUT		/RETURN
/SIXBIT TO 7 BIT ASCII
/AC = 3 SIXBIT CHAR'S
/SUBR. USES KLPUT
/
KLFSIX	0		/FROM SIXBT
	DAC TVCNT
	LAW -3
	DAC KLCNT		/SETUP 3 CHAR CT.
KLFSXT	LAC TVCNT
	JMS R6L
	DAC TVCNT		/NEXT CHAR
	RAL
	AND (77
	SNA
	LAC LIT40		/SPACE INSTEADD OF RO
KLCNTB=PUT1		/TEMP STORE FOR SPACE CHAR.
	DAC KLCNTB		/SAVE - TEMP.
	AND LIT40
	SNA!CLL
	STL
	LAC KLCNTB
	SZL		/NO BIT 7
	XOR (100		/BIT 7
	JMS KLPUT
	ISZ KLCNT
	JMP KLFSXT		/NEXT CHAR
	JMP* KLFSIX	/EXIT
	.EJECT
/
/SUBROUTINE TO SET UP KLPUT ROUTINE
/AC = POINTER TO OUTPUT BUFFER DATA AREA ON ENTRY
/
SETPUT	0
	DAC PUTP		/DATA AREA POINTER
	DZM PUTC		/CHAR POSITON COUNT
	DZM PUTCT		/WORD PAIR COUNT
	LAC LIT40		/START LINE WITH SPACE
	DAC KLSUPR	/SWITCH TO SUPPRESS LEADING 0'S
	JMS KLPUT
	JMP* SETPUT
/
/OUTPUT LINE SUBROUTINE
/AC = LINE HEADER POINTER ON ENTRY
/
PROUT	0
	DAC MODN10
PRDAT	XX		/OUTPUT DAT SLOT
	11
MODN10	XX		/L.B. POINTER
	LAW -376
PRWAT	XX		/OUTPUT DAT SLOT
	12
	JMP* PROUT
/
/
ZCEXIT	XX		/COPY SWITCH(JMP ZCOPY1 FOR COPY OF 25 OR MORE FILES
	DZM STRCNT	/CLEAR SEGMENT STRING COUNT
	LAC XITFLG
	SZA
	JMP RESTRT
/	.EXIT		/RETURN TO MONITOR
	CAL
	15
	.EJECT
/LEFT ARROW AFTER CLOSE PAREN.
LFTROW	LAC ALLOUT	/UPDATE VALID PORTION OF
	DAC VALOUT	/COMMAND STRING POINTER
LFTARO	LAC (1		/SET DIRECTION INDICATOR
	DAC DIRECT	/TO SOURCE
	JMS GETDEV	/GET DEVICE AND UNIT
SRCDEV	0		/SOURCE DEVICE CODE
SRCDAT	0		/SOURCE .DAT SLOT.
	JMP GTFILE	/PICK UP FILE NAME (EXT)
OPENPR	JMS GETCHR	/CHECK SWITCH OPTIONS
	DAC TEMP2
	SAD TMODE		/A
	LAW 3
	SAD LITB		/B
	LAW 1
	SAD LITI		/I
	LAW 4
	SAD CMODE		/H
	JMP FOUNDH
	SAD LITD		/D
	LAW 5
	SPA
	JMP DATAOP	/DATA MODE OPTION
	SAD LITW		/W
	JMP FOUNDW
	SAD LITC		/C
	JMP FOUNDC
	SAD LMODE		/S
	JMP FOUNDS
	SAD LITN		/N
	JMP FOUNDZ
	SAD LITE		/E
	JMP FOUNDE
	SAD LITT		/T
	JMP FOUNDT
	SAD LITF		/F
	JMP FOUNDF
	SAD LITG		/G
	JMP FOUNDG
	SAD LITQ		/Q
	JMP FOUNDQ
	SAD LITY		/Y
	JMP FOUNDY
	SAD (51		/CLOSE PAREN ())
	JMP CLSPAR
ZOPER7	LAC (7		/ERROR MESSAGE # 7
	JMP OPERR		/INVALID SWITCH OPTION
FOUNDH	LAC FUNCDE
	XOR (6
	SZA
	JMP DATAOP-1
	LAC DIRSWH		/FUNCTION IS C
	SZA
	JMP CNFLCT		/S OR Z RULES OUT H
	LAW 2
/DATA MODE SWITCH OPTION
/
DATAOP	AND (77
	DAC TEMP3		/DATA MODE CODE
	JMS VALOPT	/SWITCH OPTION VS. FUNCTION CHECK
	LAC WSWTCH		/HAS W BEEN REQUESTED
	SNA
	JMP WITHW		/NO
	LAC TEMP3
	SAD (3		/IOPS ASCII (A)
	JMP WITHW
	SAD (1		/IOPS BINARY (B)
	JMP WITHW
	JMP CNFLCT
WITHW	LAC CETSW		/HAS E,C OR T BEEN REQUESTED
	SNA
	LAC FSWTCH	/HAS F BEEN REQUESTED?
	SNA
	LAC GSWTCH	/HAS G BEEN REQUESTED?
	SNA
	LAC QSWTCH	/HAS Q BEEN REQUESTED?
	SNA
	LAC YSWTCH	/HAS Y BEEN REQUESTED
	SNA		/YES
	JMP WITHC		/NO
	LAC TEMP3
	SAD (3		/IOPS ASCII (A)
	JMP WITHC
	JMP CNFLCT
WITHC	LAC DESDEV		/DESTINATION DEVICE
	SAD LPDEV		/L.P.
	JMP TSTAL1
	SAD DOUTPT		/T.T.
	JMP TSTAL2
	SAD VOUTPT	/PP
	JMP TSTAL3
	LAC SRCDEV		/SOURCE DEVICE
	SAD DOUTPT
	JMP TSTAL2
WITHAI=.
STDATA	LAC TEMP3		/SET DATA MODE SWITCH
	DAC DATAMD
SWCHOK	LAC ALLOUT		/UPDATE VALID COMMAND
	DAC VALOUT	/POINTER
	JMP OPENPR	/CHECK FOR MORE OPTIONS
CNFLCT	LAC (10		/ERROR MESSAGE # 8
	JMP OPERR
/
/Y SWITCH ENCOUNTERED
FOUNDY	JMS VALOPT	/FUNCTION VS OPTION CHECK
/Y IS VALID ONLY WITH A DATA MODE
/Y VALID ONLY IF S FUNCTION IMMEDIATELY PRECEDES
/Y CONFLICTS WITH W
	LAC STRCNT	/STRING COUNT
	SNA
	JMP ZSNOT		/IF 0 , S FUNCTION NOT PERFORMED
	LAC WSWTCH	/W SW SET?
	SZA		/NO, ALL OK
	JMP CNFLCT
	JMS AMODCK	/CHECK FOR I.A. DATA MODE
	DAC YSWTCH	/OK TO SET Y SW
	JMP SWCHOK
/
/S NOT PERFORMED PRIOR TO USING Y SWITCH
/MSG# 15: S OPERATION NOT PERFORMED
ZSNOT	DZM ZECHO		/SET TO GO TO RESTRT AFTER MSG
	JMP FECHOF
/F OPTION ENCOUNTERED
FOUNDF	JMS VALOPT	/FUNCTION VS OPTION CHECK
/F IS VALID ONLY WITH A DATA MODE
	JMS AMODCK
	DAC FSWTCH
	JMP SWCHOK
/Q OPTION ENCOUNTERED
FOUNDQ	JMS VALOPT
/Q IS VALID ONLY WITH A DATA MODE
	JMS AMODCK
	DAC QSWTCH
	JMP SWCHOK
/SUBR TO CHECK FOR IOPS ASCII DATA MODE OR NO MODE (0)
AMODCK	0
	LAC DATAMD
	SZA
	SAD (3		/(A)
	SKP!CLA!CMA
	JMP CNFLCT
	JMP* AMODCK	/SWITCH OK
/W SWITCH OPTION ENCOUNTERED
FOUNDW	JMS VALOPT	/FUNCTION VS. OPTION CHECK
/
/W IS ONLY VALID WITH A OR B DATA MODES
/W CONFLICTS WITH Y
	LAC YSWTCH	/Y SW SET?
	SNA!CLC		/YES - DROP THRU TO 'CNFLCT'
	LAC DATAMD
	SZA
	SAD (3		/IOPS ASCII (A).
	SKP
	SAD (1		/IOPS BINARY (B)
SETW	SKP!CLA!CMA
	JMP CNFLCT
	DAC WSWTCH	/SET TO NON-0
	JMP SWCHOK
/
/E SWITCH OPTION ENCOUNTERED
/
FOUNDE	JMS CETCOM		/FUNCTION VS. OPTION CHECK
/
/E IS VALID ONLY WITH A DATA MODE
/E CONFLICTS WITH C AND T
	LAW 1		/SET TO 1
SETCET	DAC CETSW
	JMP SWCHOK
/G OPTION ENCOUNTERED
/
FOUNDG	JMS VALOPT		/FUNCTION VS. OPTION CHECK
/
/G IS VALID ONLY WITH A DATA MODE
	JMS AMODCK
	DAC GSWTCH		/SET TO NON-0
	JMP SWCHOK
/T SWITCH OPTION ENCOUNTERED
/T IS VALID ONLY WITH A DATA MODE
/T CONFLICTS WITH C AND E
/
FOUNDT	JMS CETCOM	/FUNCTION VS OPTION CHECK
	LAW 4		/SET SWITCH TO 4
	JMP SETCET
CETCOM	0
	JMS VALOPT	/FUNCTION VS OPTION CHECK
	LAC CETSW
	SZA
	JMP CNFLCT
	JMS AMODCK	/MUST BE A DATA MODE
	JMP* CETCOM
/C SWITCH OPTION ENCOUNTERED
/
FOUNDC	JMS CETCOM	/FUNCTION VS. OPTION CHECK
/
/C IS ONLY VALID WITH A DATA MODE
/C CONFLICTS WITH E AND T
	LAW 2		/SWT SWITCH TO 2
	JMP SETCET
TSTAL3	LAC SRCDEV	/A,I,B = ONLY LEGAL OPTIONS: PR TO PP
	SAD TOUTPT	/PR?
	SKP		/YES
	JMP WITHAI
	LAC TEMP3
	SAD (1		/B
	JMP WITHAI	/OK
TSTAL2	LAC TEMP3		/TELETYPE
	SAD (4		/IMAGE ALPHA (I)
	JMP WITHAI
TSTAL1	LAC TEMP3		/LINE PRINTER
	SAD (3		/IOPS ASCII (A)
	JMP WITHAI
	JMP ERR12
/S SWITCH OPTION ENCOUNTERED
/
FOUNDS	JMS VALOPT	/FUNCTION VS. OPTION CHECK
	LAC (1
	DAC TEMP3
	LAC DIRSWH
	SAD TEMP3
	JMP STDIRT		/DIRECTORY OPTION ALIKE
	SZA		/NO PREVIOUS DIRECTORY OPTION.
	JMP CNFLCT
STDIRT	LAC FUNCDE
	XOR (6
	SZA
	JMP STDIRZ		/NOT C FUNCTION
	LAC DATAMD		/S OR N ARE ILLEGAL
	SZA		/IF H ALREADY SPECIFIED
	JMP CNFLCT
/FOR S AND N OPTIONS, THE TWO DEVICES
/CANNOT BOTH BE NON-FILE STRUCTURED
/
STDIRZ	LAC DESDEV		/DESTINATION DEVICE CODE
	JMS FNDBLK
	SNL
	JMP SZOK		/ONE, FILE ORIENTED
	LAC FUNCDE	/L?
	SAD (2
	SKP		/YES, MAY BE OK
	JMP ERR12		/ILLEG DEST DEV FOR N OR S
	LAC SRCDEV		/SOURCE DEVICE CODE
	SNA
	JMP SZOK-1
	JMS FNDBLK
	SNL
	JMP SZOK
ERR12	LAC (14		/ERROR MESSAGE # 12
	JMP OPERR
	.EJECT
/SUBROUTINE TO CHECK FILE STRUCTURING OR NOT
/EXITS WITH LINK = 0 IF AC CONTAINED THE
/CODE OF A FILE ORIENTED DEVICE.
/OTHERWISE THE LINK = 1 ON EXIT.
/
FNDBLK	0
	DAC FNDTMP		/SAVE DEVICE CODE
	LAC BULK		/LAC LINPUT
	DAC .+1
FNDMOD	XX		/NON-FILE STRUCTURED DEVICE TABLE
	SAD FNDTMP
	SKP!CLL!CML		/FILE ORIENTED
	SPA!CLL
	JMP* FNDBLK	/END OF TABLE
	ISZ FNDMOD
	JMP FNDMOD
FNDTMP	0
	ISZ QUSTON		/QUESTIONABLE OPTION
SZOK	LAC TEMP3		/SET DIRECTORY OPTION
	DAC DIRSWH	/INDICATOR.
	JMP SWCHOK
/Z SWITCH OPTION ENCOUNTERED.
FOUNDZ	JMS VALOPT		/FUNCTION VS. OPTION CHECK
	LAC (2
	JMP FOUNDS+2
QUSTON	0		/NON-0 IF S OR Z SWITCH IN DOUBT
	.EJECT
/CLOSE PARENTHESIS ENCOUNTERED.
/
CLSPAR	LAC DIRECT
	SNA
	JMP MDESET		/DESTINATION INFO.
	LAC DATAMD	/SOURCE INFO.
	SZA
	JMP MDESET
	LAC FUNCDE
	SNA
	JMP OPERRB		/NO DATA MODE YET FOR T FUNCTION.
MDESET	LAC ALLOUT		/UPDATE VALID
	DAC VALOUT	/COMMAND POINTER.
	JMS BLCOMP
	JMS GETCHR	/GET NEXT CHAR.
LSTCAR	DAC TEMP1
	LAC DIRECT
	SZA
	JMP SRCEND	/SOURCE INFO.
	LAC TEMP1
	SAD (137		/DESTINATION INFO.
	JMP LFTROW
ERR1O	LAC (12		/ERROR MESSAGE # 10
	JMS ECHOCS
	JMP LSTCAR
SRCEND	LAC TEMP1
	SAD (15
	JMP ALLDNE
	SAD (175
	JMP ALLDNE
	JMP ERR1O
OPERRB	LAC (13		/ERROR MESSAGE # 11
	JMP OPERR
/
/SUBROUTINE TO CHECK IF A SWITCH OPTION
/IS VALID FOR A PARTICULAR FUNCTION.
/
VALOPT	0
	LAC FUNCDE	/FUNCTION CODE.
	CLL!RAR		/DIVIDE BY 2
	TAD LMODES	/START OF VALID MODES DISPATCH.
	DAC TEMP1
	LAC* TEMP1	/PICK UP LAC OF
	DAC MODTST	/PROPER TABLE.
MODTST	XX
	SAD TEMP2		/OPTION CHARACTER
	JMP* VALOPT
	ISZ MODTST
	SMA		/TABLE IS TERMINATED WITH
	JMP MODTST	/A LAW INSTRUCTION.
	LAC (11		/ERROR MESSAGE #9 - SWITCH OPTION INVALID
OPERR	JMS ECHOCS	/PRINT VALID PORTION OF
	JMP OPENPR+1	/COMMAND STRING.
	.EJECT
/TABLE OF POINTERS TO LISTS OF SWITCH OPTIONS
/THAT ARE VALID FOR A PARTICULAR FUNCTION.
/
MODES	LAC TMODE		/T
	LAC LMODE		/L
	LAC DMODE		/D
	LAC CMODE		/C
	LAC RMODE		/R
	LAC BMODE		/B
	LAC SMODE		/S
	LAC VMODE		/V
	LAC NMODE		/N
/TABLES OF VALID SWITCH OPTIONS FOR
/THE PARTICULAR FUNCTIONS. EACH TABLE IS
/TERMINATED BY A LAW INSTRUCTION.
	/TRANSFER FILE (T)
TMODE	101		/A IOPS ASCII
LITB	102		/B IOPS BINARY
LITI	111		/I IMAGE ALPHA
LITD	104		/D DUMP
LITW	127		/W STRIP EOT OR EOF
LITC	103		/C SPACES TO TABS
LITT	124		/T DELETE TRAILING BLANKS
LITE	105		/E TABS TO SPACES
LITF	106		/F INSERT FF,CR
LITG	107		/G PARITY CHECK
LITQ	121		/Q DELETE SEQUENCE #'S (73-80)
LITY	131		/Y SEGMENT FILE
CMODE	110		/H IMAGE BINARY
/S AND Z ARE ONLY LEGAL FOR FILE STRUCTURED DEVICES.
/BLOCK TRANSFER (B)
BMODE=.
/NEWDIR (N)
NMODE=.
/LIST DIRECTORY (L)
LMODE	123		/S NEW SYSTEM DIRECTORY
	116		/N NEW DIRECTORY
/RENAME (R)
RMODE=.
/SEGMENT (S)
SMODE=.
/DELETE (D)
DMODE	LAW
/VERIFY FILE (V)
VMODE	101		/A IOPS ASCII
	102		/B IOPS BIN
	LAW
	.EJECT
INIT=.			/THIS ROUTINE RELOCATES ALL 15-BIT
			/ADDRS SO THAT THEY COMPLY WITH
			/CURRENT RESIDENCE OF PIP. IT
			/IS ONCE ONLY CODE AND
			/IS SUBSEQUENTLY USED AS
			/AN I/O LINE BUFFER FOR
BUFFER	JMS BUFFER	/THE KEYBOARD COMMAND STRING.
	LAC BUFFER
	AND (60000	/RUN TIME BANK BITS.
	XOR (BANK*20000	/ASSEMBLY TIME BANK BITS.
	DAC BNKBTS	/0 IF RUN AND ASSEMBLY TIME EQUIVALENT.
	LAC (LOWER-1	/SET UP AUTO INDEX
	XOR BNKBTS	/REGISTERS FOR
	DAC* (10		/RELOCATION LOOP.
	DAC* (11
NXTADR	LAC* 10		/RELOCATE BLOCK OF 15-BIT ADDRS.
	XOR BNKBTS	/SOLVES: LAC A.
	DAC* 11		/        DAC LOC
	ISZ RELCNT	/        LAC* LOC
	JMP NXTADR	/      A     B
NXTAD2	LAC* MOD00
	XOR BNKBTS
	DAC RELCNT	/TEMPORARY STORAGE.
	LAC* RELCNT
	XOR BNKBTS	/SOLVES: CAL+3
	DAC* RELCNT	/        10
	ISZ MOD00		/MOD01   LBUFAD
	ISZ MODCNT	/     WORDCT
	JMP NXTAD2
	JMP RESTRT
/15-BIT ADDRESSES THAT POINT TO 15-BIT ADDRESSES THAT
/MUST BE RELOCATED BY THE CONTENTS OF BNKBTS.
BOTTOM=.
	MOD01
	MOD02
	MOD03
	MOD04
	MOD05
	MOD06
	MOD07
	MOD10
	MOD11
	MOD12
	MOD15
	MOD52
	MOD53
	MOD54
	MOD55
	MOD56
TOP=.
RELCNT	UPPER-LOWER\777777+1	/2'S COMP NO. OF ENTRIES IN LOWER
MODCNT	TOP-BOTTOM\777777+1		/2'S COMP NO. OF ENTRIES IN BOTTOM
/ALL CODING FROM BUFFER TO MODCNT INCLUSIVE IS OVERLAYED.
BNKBTS	0		/15-BIT ADDRESSES' RELOCATION FACTOR.
PIPAGN	777777		/777777 IF "PIP" TO BE OUTPUT.
/TAP5 OF 6: PIP.
/15-BIT ADDRESSES THAT MUST BE RELOCATED BY THE CONTENTS OF BNKBTS.
LOWER=.			/LOWER BOUNDARY.
MOD00	BOTTOM		/START OF INDIRECT 15-BIT ADDRESS TABLE.
LTECHO	CMECHO		/POINTER TO ECHO BUFFER.
LDEVAL	DEVALD		/START OF VALID DEVICE FOR FUNCTION TABLE.
LDFPTR	DESFLS		/START OF DESTINATION FILE (EXT) BLOCK.
LSFPTR	SRCFLS		/START OF SOURCE FILE (EXT) BLOCK
LPSNAM	SNAMES		/START OF SPLIT STRING BLOCK
LPSNA2	SNAMES+2
LTPEXT	TMPEXT		/TEMPORARY EXTENSION REGISTER.
LMODES	MODES		/VALID MODES TABLE.
Z1BUFL	Z1BUF		/TRANSFER BUF.
Z2BUFL	Z2BUF
Z1B003	Z1BUF+3		/BIT MAP INIT VALUE
Z1B203	Z1BUF+203		/POINTERS (DECTAPE)
Z1B200	Z1BUF+200
Z1B040	Z1BUF+40		/DIRECTORY ENTRY SECTION POINTER
PECHO2	CMECHO+2		/OUTPUT BUF POINTER FO LFUNCT
PLHEAD	LHEAD		/POINTER TO "DIRECTORY LISTING"
PLSYS	LSYS+2		/POINTER TO "SYS PGM BLOCKS"
PLFREE	LFREE+2		/POINTER TO "FREE BLOCKS"
ZEOTP	ZEOTTB		/.EOT TABLE POINTER
ZENDP	ZENDTB		/.END TABLE POINTER
ZEJEPT	ZEJTAB		/.EJECT TABLE POINTER
PLUSER	LUSER+2		/POINTER TO "USER FILES"
TMPFLP	TMPFLE		/TEMP FILE TABLE POINTER
CHARPT	CHRTAB		/SPLT FILE STRING AREA
DSFADR	DSFPTR		/POINTER TO S SWITCH TABLE
ERRMSP	ERRMSG
FULLRP	FULLER
ERMSGS	ERMSG0
	ERMSG1
	ERMSG2
	ERMSG3
	ERMSG4
	ERMSG5
	ERMSG6
	ERMSG7
	ERMSG8
	ERMSG9
	ERMSGA
	ERMSGB
	ERMSGC
	ERMSGD
	ERMSGE
	ERMSGF
	ERMSGG
	ERMSGH
	ERMSGI
	ERMSGJ
	ERMSGK
	ERMSGL
	ERMSGM
UPPER=.			/UPPER BOUNDARY
/
/
/SUBROUTINE TO READ KEYBOARD FOR COMMAND
/STRING INPUT, WAIT FOR ITS COMPLETION, AND
/INITIALIZE ALL PERTINENT REGISTERS.
/
READTT	0
/	.READ -2,2,BUFFER,34
	CAL 2776			/READ KEYBOARD FOR
	10			/PIP COMMAND STRING
MOD04	BUFFER			/IN IOPS ASCII MODE.
	-42
/	.WAIT -2
	CAL 776			/WAIT FOR COMPLETION OF
	12			/COMMAND STRING
/
/ROUTINE TO INITIALIZE POINTERS AND COUNTERS
/FOR COMMAND STRING EXAMINATION AND ECHOING. CALLED AFTER
/STRING IS IN BUFFER.
/
	LAC (BUFFER+2	/1ST DATA WORD OF COMMAND STRING.
	.IFUND BFR
	XOR BNKBTS	/CORRECT 15-BIT ADDRESS.
	.ENDC
	JMS ZSET		/INIT GETCHR
	JMP* READTT
/
/CONTROL COMES HERE ON ^P TO THE
/TELETYPE KEYBOARD.
/
NUORRE	LAC RSTRTP
	DZM RSTRTP	/SET UP FOR RESTART ON NEXT ^P.
	SNA
	JMP RESTRT	/RESTART.
/	.INIT,-2,0,NUORRE
	CAL 776		/INIT TTY FOR
	1		/CR,LF AFTER ^P
MOD06	NUORRE
	0
	ISZ YEOFSW	/777777 IF YSWITCH ON
MEDIUM	JMP ZEOF		/NEW MEDIUM-INPUT
	JMP NEWOUT	/NEW OUTPUT MEDIUM FOR SEGMENT FILE
ZSET	0		/INIT GETCHR.
	DAC CMDPTR
	LAC LTECHO	/INITIALIZE BUFFER FOR ECHOING OF VALID
	DAC VALOUT	/PORTION OF COMMAND STRING.
	DAC ALLOUT
	LAW -1
	DAC PAIRCT	/CHAR. COUNTER IN 5/7 PAIR.
	LAW -32		/DATA WORD PAIR COUNTER (1'S COMP.).
	DAC WORDCT
	JMP* ZSET
/
	.EJECT
/SUBROUTINE TO GET THE NEXT 7-BIT ASCII CHAR.
/FROM THE 5/7 COMMAND STRING BUFFER AT
/BUFFER. IT RETURNS WITH IT RIGHT JUSTIFIED
/IN AN OTHERWISE CLEAR AC.
/SPACES ARE IGNORED IF ZSPACE IS NON 0
GETCHR	0
	ISZ PAIRCT
	JMP NUCHAR	/CURRENT 5/7 PAIR NOT EXHAUSTED.
	ISZ WORDCT
	JMP NUPAIR
COMSW	SKP		/SKP OR CLA IF COMMAND DECODER NOT IN PROGRESS
	JMP FECHOJ		/ASCII INPUT LINE TOO LONG
	CAL 775		/.CLOSE -3: CAUSES CR/LF
	6
	DZM ZECHO		/OUTPUT ERROR - COMMAND STRING
	LAC ERRMSP		/BUFFER EXHAUSTED PREMATURELY.
	JMP LACALB+1
NUPAIR	LAC* CMDPTR	/PICK UP NEXT WORD PAIR
	DAC LFHALF	/AND PLACE IN 5/7
	ISZ CMDPTR	/TWO WORD AC.
	LAC* CMDPTR
	DAC RTHALF
	ISZ CMDPTR
	LAW 17773		/RESET CHAR. COUNTER
	DAC PAIRCT	/FOR NEW PAIR
NUCHAR	LAW 17770		/GO THROUGH SHIFT LOOP
	DAC TEMP1		/7 1/2 TIMES.
GETBCK	LAC RTHALF
	RAL
	ISZ TEMP1
	JMP GETMRE
	AND (177		/GOT CHARACTER.
VALSW	XX		/PLACE IN (DAC* ALLOUT) OR (NOP)
	ISZ ALLOUT	/ECHO BUFFER.
	SAD LIT40		/IGNORE
	SKP		/SPACES
	JMP* GETCHR	/EXIT
	XOR ZSPACE		/SPACE SWITCH (0 = DO NOT IGNORE)
	SAD LIT40
	JMP* GETCHR	/EXIT WITH SPACE IN AC
	JMP GETCHR+1
GETMRE	DAC RTHALF
	LAC LFHALF
	RAL
	DAC LFHALF
	JMP GETBCK
LFHALF	0		/5/7 TWO WORD
RTHALF	0		/BUFFER FOR EXTRACTING 7-BIT CHARS.
CMDPTR	0		/CURRENT DATA WORD OF COMMAND STRING.
PAIRCT	0		/CHAR. COUNTER IN 5/7 PAIR.
WORDCT	0		/DATA WORD PAIR COUNTER (1'S COMP.)
	.EJECT
/SUBROUTINE TO CHECK IF A DEVICE AND UNIT
/(IF APPLICABLE) REQUEST IN A USER COMMAND
/STRING CAN BE SATISFIED BY ONE OF THE
/POSITIVE .DAT SLOTS. IT ALSO CHECKS THAT IT IS NOT
/INVALID FOR THIS FUNCTION AND DIRECTION.
/CALLING SEQUENCE:
/
/	JMS DEVCHK	WITH TEMP1 CONTAINING
/			DEVICE CODE AND UNIT
/			NO. IN THE FOLLOWING
/			FORMAT:
/			BITS 0-2	UNIT NO.
/			BITS 3-5		0
/			BITS 6-11		1ST LETTER OF
/					DEVICE CODE IN
/					6-BIT ASCII.
/			BITS 12-17 2ND LETTER
/	ON EXIT, THE AC WILL CONTAIN THE CORRESPONDING .DAT
/SLOT NO. RIGHT JUSTIFIED IN AN OTHERWISE CLEAR AC. WHEN A
/.DAT SLOT NO. IS RETURNED, THE RESPECTIVE ENTRY IN THE .DEV TABLE
/HAS BIT 3 SET TO 1 TO PREVENT MULTI-USAGE OF THE SAME .DAT SLOT.
DEVCHK	0
	LAC DEVBGN
	DAC TEMP5		/START OF .DEV TABLE.
	.IFDEF BF
	IDX TEMP5
	LAC* DEVBGN
	.ENDC
	.IFUND BF
	.IFUND BFR
	LAW -DEVSZE
	.ENDC
	.ENDC
	.IFDEF BFR
	IDX TEMP5
	LAC* DEVBGN
	.ENDC
	DAC TEMP3		/2'S COMP .DEV TABLE SIZE.
	LAC (1
	DAC TEMP4		/.DAT SLOT NO.
	LAC TEMP1		/REQUESTED DEVICE AND UNIT.
	AND (7777
	SAD DOUTPT	/IF TTY, SKIP CHECK
	SKP
DEVBCK	SAD* TEMP5		/DOES IT MATCH ENTRY IN .DEV.
	JMP DEVFND	/YES.
	IDX TEMP5		/CHECK NEXT ENTRY.
	IDX TEMP4		/INCREMENT .DAT SLOT NO.
	ISZ TEMP3		/IS TABLE EXHAUSTED.
	JMP DEVBCK	/NO
	JMP BASGN
DEVOUT	LAC TEMP1
	SAD DOUTPT		/TT
	SKP!CLA!CMA	/INTERMEDIATE TTY I/O
	JMP DEVQ
	DAC PIPAGN
	LAC FALTMD	/(775)=.DAT SLOT-3 FOR TTY
	DAC TEMP4
DEVQ	LAC QUSTON		/QUESTION
	SNA		/ON S OR Z
	JMP .+4		/OPTION.
	DZM QUSTON	/CHECK IF
	LAC BULK		/DEVICE FILE
	JMP LACMOD-1	/ORIENTED.
	LAC* GETDEV	/DEVICE CODE
	SAD DOUTPT		/TT
	SKP
	JMP FINALY
	LAC DATAMD
	SAD (3		/IOPS ASCII (A)
	JMP TTFIN
	SAD (4		/IMAGE ALPHA (I)
	JMP TTFIN
	SZA
	JMP ERR4
TTFIN	LAC TEMP4
	JMP* DEVCHK		/IF TTY, EXIT.
FINALY	LAC FUNCDE	/BYPASS MULTI-
	SAD (10		/USAGE PREVENTION
	JMP FINALZ		/IF RENAME
	LAC* TEMP5		/PREVENT MULTI-USAGE OF
	XOR (40000
	DAC* TEMP5		/SAME .DAT SLOT.
FINALZ	LAC TEMP4
	.IFDEF BF
	TAD DATB
	.ENDC
	.IFUND BF
	.IFUND BFR
	TAD (.DAT		/SET UNIT IN BITS 0-2 OF .DAT SLOT
	.ENDC
	.ENDC
	.IFDEF BFR
	TAD DATF
	.ENDC
	DAC TEMP1A
	LAC TEMP1		/EXTRACT UNIT
	AND LH7
	.IFDEF BF
	CLL			/UNIT IN B/F
	RTR			/IS IN BITS 2-4
	.ENDC
	.IFDEF BFR
	CLL
	RTR
	.ENDC
	DAC TEMP1
	LAC* TEMP1A	/BITS 3-17 OF .DAT SLOT
	.IFDEF BF
	AND (617777		/BITS 0,1 AND 5-17
	.ENDC
	.IFDEF BFR
	AND (617777
	.ENDC
	.IFUND BF
	.IFUND BFR
	AND (77777
	.ENDC
	.ENDC
	XOR TEMP1
	DAC* TEMP1A
	LAC TEMP4		/.DAT SLOT NO.
	JMP* DEVCHK	/EXIT.
DEVFND	LAC FUNCDE	/FUNCTION CODE
	TAD DIRECT	/DIRECTION CODE (0=DEST., 1=SOURCE)
	TAD LDEVAL		/START OF VALID DEVICE
	DAC TEMP1A		/FOR FUNCTION DISPATCH TABLE.
	LAC* TEMP1A	/PICK UP LAC OF PROPER TABLE.
	DAC LACMOD
LACMOD	XX
	SAD* GETDEV	/DEVICE CODE FROM COMMAND STRING.
	JMP ERR4		/INVALID.
	SPA
	JMP DEVOUT	/TABLE EXHAUSTED (NEG. REGISTER ENCOUNTERED)
	ISZ LACMOD
	JMP LACMOD
ERR4	LAC (4		/ERROR MESSAGE # 4
	JMP BDUNIT+1
DEVBGN	0		/STARTING ADDRESS OF .DEV TABLE.
TEMP1A	0		/TEMP
/TABLE OF POINTERS TO LISTS OF DEVICES THAT ARE INVALID
/FOR A PARTICULAR FUNCTION AND DIRECTION.
/NEGATIVE CHECKING IS DONE TO ALLOW FOR NON-STANDARD DEVICES.
			/CODE - FUNCTION - DIRECTION
DEVALD	LAC TOUTPT		/0 T (D) DESTINATION
	LAC TINPUT		/1 T (S) SOURCE
	LAC LOUTPT		/2 L DEST
	LAC LINPUT		/3 L SRC.
BULK	LAC DOUTPT		/4 D DEST.
	LAC DINPUT		/5 D SRC.
	LAC COUTPT		/6 C DEST.
	LAC CINPUT		/7 C SRC.
	LAC ROUTPT		/10 R DEST.
	LAC RINPUT		/11 R SRC.
	LAC BOUTPT		/12 B DEST
	LAC BINPUT		/13 B SRC
	LAC SOUTPT		/14 S DEST
	LAC SINPUT		/15 S SRC
	LAC VOUTPT		/16 V DEST
	LAC VINPUT		/17 V SEC
	LAC NOUTPT		/20 N DEST
	LAC NINPUT		/21 N SRC
/
/TABLES OF INVALID DEVICES FOR FUNCTIONS
/AND DIRECTION. EACH TABLE IS TERMINATED
/BY A NEGATIVE REGISTER.
/
/L SOURCE; R,C,B SOURCE AND DEST; D AND N DEST.
DOUTPT	2424		/TT - TELETYPE (PRINTER)
	2022		/PR - PAPER TAPE READER.
	0304		/CD - CARD READER.
VOUTPT	2020		/PP - PAPER TAPE PUNCH.
LPDEV	1420		/LP - LINE PRINTER.
MASK1	737777		/END OF THIS TABLE.
/
/L, DEST.
LOUTPT	0424		/DT - DECTAPE
	1524		/MT - MAGNETIC TAPE.
	0422		/DR - DRUM
	0413		/DK - DISK.
	2020		/PP - PAPER TAPE READER.
/T, DEST.
TOUTPT	2022		/PR
	0304		/CD
MASK2=.
DINPUT	700000		/END OF THIS TABLE.
SOUTPT=DINPUT
SINPUT=DINPUT
VINPUT=DINPUT
NOUTPT=DOUTPT
NINPUT=DINPUT
COUTPT=DOUTPT
CINPUT=DOUTPT
ROUTPT=DOUTPT
RINPUT=DOUTPT
BINPUT=DOUTPT
BOUTPT=DOUTPT
LINPUT=DOUTPT
TINPUT=VOUTPT
	.EJECT
/SUBROUTINE TO PICK UP DEVICE AND UNIT CODE AND CHECK
/ITS PRESENCE IN POSITIVE .DAT TABLE AND ITS
/LEGALITY FOR THIS FUNCTION AND DIRECTION.
/CALLING SEQUENCE:
/	JMS GETDEV
/	0		/RETURN DEV. CODE (2 6-BIT CHARS.)
/	0		/RETURN .DAT SLOT NUMBER
/	(RETURN)
GETDEV	0
	CLC
	DAC ZSPACE		/IGNORE SPACE
	JMS GETCHR
GTDEV2	JMS GTDEV1		/CHECK IF CHAR IN 100-177 RANGE
	LAC TEMP1		/CHARACTER.
	JMS R6L
	AND (7700
	DAC* GETDEV
	JMS GETCHR
	JMS GTDEV1	/CHECK IF CHAR IN 100-177 RANGE
	LAC TEMP1		/CHARACTER
	AND (77
	XOR* GETDEV
	DAC* GETDEV
	DZM ZSPACE		/DO NOT IGNORE SPACE
GTDEV5	JMS GETCHR
	DAC TEMP6		/T STORE FOR LATER CR CHECK
	DAC TEMP2		/PRESERVE CHARACTER.
	JMS TERMCK	/CHECK FOR CR OR , OR SP OR: OR_OR ALTMODE
	XOR (72
	SNA		/NOT A TERMINATOR
	JMP GTDEV3	/: (COLON) NO UNIT NO.
	LAC TEMP2		/NUMERIC?
	AND (100
	SZA		/YES
	JMP GTDEV5	/KEEP LOOKING
	JMS GETCHR	/BYPASS COLON
	DAC TEMP6		/T STORE FOR LATER CR CHECK
	JMS TERMCK	/CHECK FOR CR OR , OR SP OR: OR_OR ALTMODE
	SAD (72		/:(COLON)
	JMP GTDEV4	/TERMINATOR
	LAC (2
	JMP BDUNIT+1	/CHARACTER NOT :
GTDEV4	LAC TEMP2		/UNIT NUMBER.
	AND (170
	SAD (60
	SKP
	JMP BDUNIT	/CHAR. NOT OCTAL NUMBER.
	LAC TEMP2
	RTR
	RTR
	AND MASK2		/UNIT NO. IN BITS 0-2 (MASK2=700000)
	.EJECT
GTDEV3	XOR* GETDEV	/DEVICE CODE IN BITS 6-17
	DAC TEMP1		/WILL BE USED BY DEVCK
	AND (7777
	SAD TOUTPT	/PR?
	LAW 1
	SAD TOUTPT+1	/CD?
	DAC CARD		/SET CARD SWITCH TO NON 0
	SAD TOUTPT+1	/CARD READER?
	LAW 1		/=PR
	SAD VOUTPT	/PP?
	LAW 2
	SMA
	JMP GTDEV9
	XOR PAPER
	DAC PAPER		/LAW 1=PR; LAW 2=PP; 3=BOTH
GTDEV9	JMS DEVCHK		/CHECK PRESENCE IN .DAT TABLE
	ISZ GETDEV		/AND RETURN
	DAC* GETDEV	/.DAT SLOT NUMBER
	ISZ GETDEV
	LAC TEMP6		/TERMINATOR
	XOR (15		/CR?
	SNA!CLA
	CLC		/YES - SUB 1 FROM ECHO POINTER
	TAD ALLOUT
	DAC VALOUT
	DAC ZSPACE		/IGNORE SPACE
	JMP* GETDEV
/CHECK IF CHARACTER IN 100-177 RANGE. OTHERWISE
/COMMAND STRING IS IN ERROR.
GTDEV1	0
	DAC TEMP1		/PRESERVE CHARACTER.
	AND (100
	SZA
	JMP* GTDEV1
BDUNIT	LAC (1		/ERROR MESSAGE # 1
	JMS ECHOCS		/ECHO VALID PORTION OF COMMAND
	JMP GTDEV2
BASGN	LAC (3		/ERROR MESSAGE # 3
	JMP BDUNIT+1
/SUBR TO CHECK FOR CR OR , OR SP
/ENTRY: AC=CHAR TO BE CHECKED
/EXIT:  AC=72(:) IF MATCH
/       AC=ORIGINAL CHAR IF NO MATCH
TERMCK	0
	SAD (15		/CR
	LAC (72		/:
	SAD (175		/ALT MODE
	LAC (72
	SAD LIT40		/SP
	LAC (72
	SAD (54		/,
	LAC (72
	SAD (137			/_ (LEFT ARROW)
	LAC (72
	JMP* TERMCK
/ROUTINE TO PICK UP FILE NAME AND EXTENSION
/AND CHECK ITS VALIDITY IF SOURCE FILE.
/EXIT WITH NEXT 7-BIT CHARACTER IN TMPCHR.
FILECK	0
	LAC TEMP6		/IF LAST CHAR
	SAD (15		/CR
	JMP FLEA
	SAD (175		/ALT MODE
	JMP FLEA		/DO NOT GET NEXT CHAR
	SAD (54		/COMMA (,)
	JMP FLEA
	SAD (137		/_
	JMP FLEA
FLEAM1	JMS GETCHR
FLEA	DAC TMPCHR
	DZM TMPFLE	/CLEAR OUT TEMPORARY
	DZM TMPFLE+1	/FILE AND EXT
	DZM TMPEXT	/WORDS.
	DZM CHRPOS	/INITIALIZE CHR. POSITION CTR.
	LAC TMPFLP		/INITIALIZE FILE (EXT)
	DAC TMPPTR		/WORD POINTER.
	LAC TMPCHR
	SKP
FLEBCK	JMS GETCHR
	DAC TMPCHR		/SAVE FOR EXIT.
	SAD (73		/SEMI COLON (;)
	JMP FSEMIC
	SAD LIT40		/SPACE (=;)
	JMP FSEMIC
	SAD (50		/OPEN PAREN (()
	JMP FOPARN
	SAD (54		/COMMA (,)
	JMP FCOMMA
	SAD (137		/LEFT ARROW
	JMP FLARRO
	SAD (15		/CARRIAGE RETURN
	JMP FCRRET
	SAD (175		/ALT MODE (ESC)
	JMP FALTMD
	AND (77
	DAC TMPCHR
	LAC CHRPOS	/DISPATCH TO
	TAD (JMP WRDPOS	/APPROPRIATE
	DAC FILEC2		/CHARACTER
/CHECK FOR BLOCK FUNCTION
	LAC FUNCDE		/B?
	XOR (12
	SZA		/YES
	JMP FILEC1
	LAC TMPCHR		/CHECK FOR OCTAL DIGIT
	AND (170
	SAD (60
	JMP FILEC1		/OK
BLBAD	LAC (25		/ILL. BLK.# (MSG#21)
	JMP FECHO+1
FILEC1	LAC TMPCHR		/HANDLER
	DZM ZSPACE		/DO NOT IGNORE SPACE
FILEC2	XX
WRDPOS	JMP FRSTCH		/1ST CHAR. OF WORD
	JMP SECNCH		/2ND CHAR. OF WORD
	JMP THRDCH		/3RD CHAR. OF WORD
FECHO	LAC (5		/ERROR MESSAGE # 5
	JMS ECHOCS		/ECHO VALID PORTION
	DZM DATAMD
	JMP FLEA
FRSTCH	CLL!RAR		/1ST CHAR. POSITION
	JMS BLROT
	JMS BLROT		/3 RIGHT
DPSITC	DAC* TMPPTR
	IDX CHRPOS
	JMP FLEBCK
SECNCH	CLL		/2ND CHR. POSITION
	JMS R6L
	XOR* TMPPTR
	JMP DPSITC
THRDCH	XOR* TMPPTR	/THIRD CHAR POSITION
	DAC* TMPPTR
	LAC TMPPTR
	SAD TMPFLP		/IF 1ST WORD OF
	SKP		/FILE NAME, MORE
	JMP DPSITC+1	/CHARS. MAY
	IDX TMPPTR	/FOLLOW.
THROUT	DZM CHRPOS
	JMP FLEBCK
FSEMIC	LAC LTPEXT	/SEMI-COLON
	DAC TMPPTR	/SET UP TO PICK
	DAC ZSPACE		/IGNORE SPACE
	JMP THROUT	/UP EXTENSION
FLARRO	JMS BLCOMP
	LAC DIRECT		/VALID TERMINATOR (LEFT ARROW)
	SZA!CLC		/IF DESTINATION
	JMP FECO		/INFO.
FOPARN	DAC ZSPACE	/IGNORE SPACE
	LAC FUNCDE
	SAD (2		/L FUNCTION?
	SKP		/YES, EXIT
	SAD (6		/C FUNCTION?
	SKP		/YES -EXIT
	SAD (12			/B FUNCTION?
	SKP			/YES - EXIT
	JMS FSTAT		/CHECK PRESENCE OF GOOD FILE AND EXTENSION.
	LAC ALLOUT
	DAC VALOUT
ZILCH	XX		/NOP OR JMP FCREZ IF CR
	JMP* FILECK	/SOURCE FILES.
FCOMMA	DAC ZSPACE	/IGNORE SPACE
	JMS BLCOMP
	LAC FUNCDE
	SAD (12			/B FUNCTION?
	SKP			/YES - EXIT
	JMS FSTAT		/CHECK PRESENCE OF SOURCE FILES
	LAC ALLOUT
	DAC VALOUT
	JMP FLEAM1	/GET NEXT FILE
/
/SUBR TO ROTATE 8 LEFT
/
R8L	0
	JMS R6L
	RTL
	JMP* R8L
/SUBR TO ROTATE 6 LEFT
/
R6L	0
	RTL
	RTL
	RTL
	JMP* R6L
/
/TAP6 OF 6: PIP.
/
/.CLOSE -3
FALTMD	CAL+775		/FOR CR AFTER ALT MODE
	6
	CLC
FCRRET	DAC ZSPACE	/IGNORE SPACE
	JMS BLCOMP	/CHECK B FUNCT AND CONVERT BL #'S
	LAC DIRECT	/CR OR ALT MODE
	SNA		/ARE VALID TERMINATORS
	JMP FECO		/IF SOURCE INFO.
	LAW -2
	DAC ECHOCS	/COUNT FOR PASSES THROUGH FOPARN
FCREZ	LAC DATAMD	
	SZA		/NO DATA MODE SPECIFIED.
	JMP ZPRCHK		/ALREADY HAVE DATA MODE.
	LAC FUNCDE
	SNA		/0=T FUNCTION
	JMP FCRREM
	SAD (16		/16=V FUNCTION
	SKP
	JMP FOPARN
FCRREM	LAC (JMP FCREZ
	DAC ZILCH
	ISZ ECHOCS
	JMP FOPARN
	CLC
	TAD ALLOUT	/GET RID OF CR IN ECHO MSG
	DAC VALOUT
	LAC (13		/ERROR MESSAGE # 11-DATA MODE NEEDED
	JMS ECHOCS
	DAC TMPCHR	/SAVE NEW CHAR
	JMP* FILECK
FECO	LAC (12		/#10 - ILL. TERMINATOR
	JMP FECHO+1
/ROUTINE TO CHECK H OR D MODE FOR T FROM PR TO PP
/
ZPRCHK	SAD (5		/D?
	JMP DMICK		/CHECK FOR DUMP+PR
	SAD (2		/H?
ZPR1	LAC FUNCDE	/T?
	SZA		/YES
	JMP FOPCK
	LAC PAPER		/PR OR PP?
	SAD (3		/BOTH  BAD
	SNA!CLA		/YES, BAD DATA MODE
	JMP FOPCK
	DAC DATAMD
	LAC (14		/MSG #12 - SWITCH ILL. FOR DEV
	JMP FECHO+1
DMICK	LAW 1		/PR+DUMP?
	XOR PAPER
	SNA!CLA
	LAC (2
	DAC DMPSW
	JMP ZPR1
FOPCK	LAC ZILCH		/IF ZILCH=NOP,
	SAD CNOP
	JMP FOPARN	/GO THRU FOPARN TO DO FSTAT
	JMP* FILECK	/OTHERWISE, ALL OK, EXIT
	.EJECT
TMPCHR	0		/6-BIT  CHARACTER
CHRPOS	0		/POSITION OF NEXT CHAR. IN NAME
TMPFLE	0		/TEMPORARY STORAGE OF
	0		/FILE NAME AND
TMPEXT	0		/EXTENSION
TMPPTR	0		/POINTER TO TEMP. FILE STORAGE
/SUBROUTINE TO CONVERT 6-BIT ASCII BL# ANTO OCTAL
/BL# (4 DIGITS) IN TMPFIL AND BITS 0-5 OF TMPFIL+1
/BL#'S STORED IN DEST FILE AREA
/
BLCOMP	0
	LAC FUNCDE	/B FUNCTION
	XOR (12
	SZA
	JMP* BLCOMP	/NO - EXIT
	LAC TMPFLE
	SNA
	JMP* BLCOMP	/NO BLOCK #
	LAC TMPFLE+1	/THERE SHOULD BE NO MORE
	AND (7777		/THAN 4 OCTAL DIGITS
	TAD TMPEXT
	SZA!CLL
	JMP BLBAD		/ILL. BL#
BLSAV=TMPEXT
	LAW -5		/INIT SHIFT COUNTER
	DAC CHRPOS
	LAC TMPFLE	/HIGH ORDER DIGIT
	JMS BLROT		/3 RIGHT
	DAC PUT1
	LAW 7000
	JMS BLMASK	/OR IN DIGIT
	LAC TMPFLE
	DAC PUT1
	LAW 700
	JMS BLMASK	/OR IN DIGIT
	LAC TMPFLE
	RTL
	RAL
	DAC PUT1
	LAW 70
	JMS BLMASK	/OR IN DIGIT
	LAC TMPFLE+1	/LOW ORDER DIGIT
	JMS R6L
	RAL
	DAC PUT1
	LAW 7
	JMS BLMASK	/OR IN DIGIT
	SKP!CLL
	JMS BLROT		/ROTATE RIGHT 3
	ISZ CHRPOS
	JMP .-2
	DAC BLSAV		/CORR. BL #
	TAD (-1100
	SMA
	JMP BLBAD		/ILL. BL#
	LAC DIRECT
	SNA!CMA
	JMP BLDEST	/DEST BLOCKS
	LAC DESTSW	/SRC BLOCKS
	SNA!STL		/DEST BLKS PRESENT, SET SRC ONLY
	CLL		/PLACE SRC BLKS IN DEST LIST ALSO
	ISZ INROOM
	JMP BLSRC
	JMP NOROOM	/OVERFLOW, TOO MANY BLK #'S
BLDEST	DAC DESTSW	/SET DEST BLKS PRESENT SW
	ISZ OTROOM
	SKP
	JMP NOROOM	/TOO MANY BL #'S IN COMM. STRING
	LAC BLSAV
	DAC* DSFPTR
	ISZ DSFPTR
	ISZ DSFCNT
	JMP* BLCOMP
BLSRC	LAC BLSAV
	SNL		/SRC ONLY
	DAC* DSFPTR
	DAC* SRFPTR
	ISZ SRFPTR
	SNL		/SRC ONLY
	ISZ DSFPTR
	ISZ SRFCNT
	JMP* BLCOMP
	.EJECT
/SUBR TO XOR DIGIT INTO ACCUMULATED BLOCK NUMBER
/
BLMASK	0
	XOR DMODE		/(LAW
	DAC BLROT		/T STORE
	RAL!CLL
	RTL
	AND PUT1
	SZA		/NO - DO NOT INDEX CHRPOS
	ISZ CHRPOS
	LAC PUT1
	AND BLROT		/MASK
	XOR BLSAV
	DAC BLSAV
	JMP* BLMASK
/
/
/ROTATE SUBR FOR BLOCK #
/
BLROT	0
	RTR
	RAR
	JMP* BLROT
/FSTAT SUBR - USED BY BOTH COMMAND DECODER AND
/COMMAND PROCESSOR
/ENTER WITH DAT SLOT #IN AC
/EXIT: AC=0=FILE NOT FOUND, AC=NOT 0=FOUND
/
FSTATZ	0
	DAC INITMD
	XOR OUTPIP	/(3000
	DAC FSTATM
/
/	.INIT XX,0,NUORRE
INITMD	XX		/CAL + .DAT SLOT NO.
	1
MOD07	NUORRE
	0
	LAC MODN07
	AND (77777
	DAC MODN07
/
/	.FSTAT XX, TMPFLE
FSTATM	XX
	2
MODN07	XX
	JMP* FSTATZ
	.EJECT
/SUBROUTINE TO CHECK VALIDITY OF FILE NAME
/AND EXTENSON IF SOURCE FILE (EXT).  ENTER FILE (EXT)
/IN APPROPRIATE TABLE.  AND UPDATE FILE COUNTER
/
FSTAT	0
	LAC DIRECT
	SNA
	JMP DFSTAT	/DESTINATION FILE
	LAC TMPFLP
	DAC MODN07
	JMS EXTCK
	DAC BLCOMP	/TMPEXT
	LAC TMPFLP
	JMS EXTCK1
	LAW -3
	DAC EXTCK1	/COUNT FOR # OF FSTAT PASSES
/INITIALIZE .DAT SLOT OF SOURCE DEVICE.
FST	LAC SRCDAT
	JMS FSTATZ
	SZA		/FILE NOT ON DEV
	JMP FILEOK
	LAC MODN07
	AND MASK2		/MASK2 = 700000
	SZA		/SKIP IF DEVICE NOT FILE ORIENTED
	JMP MOREF		/DOUBLE CHECK FILE THERE
FILEOK	LAC BLCOMP	/ORIGINAL EXT
	DAC TMPEXT	/RESTORE
	ISZ INROOM
	JMP ISROOM
NOROOM	CAL 775		/.CLOSE
	6
	DZM ZECHO		/OUTPUT ERROR - TOO MANY FILES OR BLOCKS.
	LAC FULLRP
	JMP LACALB+1
ISROOM	LAC TMPFLE		/O.K
	DAC* SRFPTR	/PLACE FILE AND EXT
	IDX SRFPTR	/IN BLOCK FOR THIS PURPOSE
	LAC TMPFLE+1
	DAC* SRFPTR
	IDX SRFPTR
	LAC TMPEXT
	DAC* SRFPTR
	IDX SRFPTR
	IDX SRFCNT		/INDEX COUNT
	JMP FSTATO
/IF FILE NOT FOUND WITHOUT EXT, TRY SRC AND BIN
MOREF	LAC BLCOMP	/ORIG EXT
	SZA
	JMP FECHO6	/FILE REALLY NOT THERE
	LAC TMPEXT
	SAD BIN
	JMP MORSRC	/TRY SRC
	LAC BIN		/TRY BIN
MOREG	DAC TMPEXT
	ISZ EXTCK1
	JMP FST		/KEEP TRYING
	JMP FECHO6	/NOT EVEN SRC OR BIN IS THERE
MORSRC	LAC SRC
	JMP MOREG
/DESTINATION FILE
DFSTAT	ISZ OTROOM
	SKP
	JMP NOROOM		/NO MORE ROOM FOR DES. FILES IN BLOCK
	LAC TMPFLE		/DESTINATION FILE
	DAC* DSFPTR	/PLACE FILE AND EXT
	IDX DSFPTR	/IN BLOCK FOR THIS PURPOSE.
	LAC TMPFLE+1
	DAC* DSFPTR
	IDX DSFPTR
	JMS EXTCK
	DAC* DSFPTR
	IDX DSFPTR
	IDX DSFCNT	/INDEX COUNT
FSTATO	LAC ALLOUT	/UPDATE VALID
	DAC VALOUT	/COMMAND POINTER
	JMP* FSTAT
FECHO6	LAC (6		/ERROR MESSAGE # 6
	JMP FECHO+1
FECHOK	TAD (1		/READ-COMPARE ERROR #20
FECHOJ	TAD (1		/ASCII INPUT LINE TOO LONG #19
FECHOI	TAD (1		/TOO MANY SOURCE FILES #18
FECHOH	TAD (1		/TOO MANY DEST FILES #17
FECHOG	TAD (1		/TOO FEW DEST FILES (S) #16
FECHOF	TAD (1		/S OPERATION NOT PERFORMED #15
	JMP FECHOE
FECHOD	XOR LIT40
	SZA!CLA		/PARITY ERROR # 14
FECHOE	TAD (1
	TAD (15		/CHECKSUM ERROR # 13
	JMS ECHOCS
	.EJECT
/EXTENSION CHECK SUBR
/IF EXT=SRC OR BIN AND NO DATA MODE AS YET, SET DATA MODE
/TO A IF SRC, B IF BIN
/
EXTCK	0
	LAC DATAMD
	SZA
	JMP EXTEND	/ALREADY HAVE DATA MODE, EXIT
	LAC TMPEXT
	SAD SRC
	JMP SRCPUT	/SET DATA MODE TO A
	SAD BIN
	JMP BINP		/SET DATA MODE TO B
EXTEND	LAC TMPEXT	/MUST BE IN AC ON EXIT
	JMP* EXTCK
SRCPUT	LAC (3
	SKP
BINP	LAC (1
	DAC DATAMD
	JMP EXTEND
/EXTENSION CHECK SUBR #2
/IF THERE IS NO EXT, AND DATA MODE = A OR B,
/THEN SET EXT TO SRC FOR A, BIN FOR B
/AC ON ENTRY: FILE NAME POINTER
/
EXTCK1	0
	TAD (2		/POINT TO EXT
	DAC EXTCK
	LAC* EXTCK
	SZA
	JMP* EXTCK1	/EXT ALREADY PRESENT
	LAC DATAMD
	SAD (1
	JMP BINSET	/SET EXT = BIN
	SAD (3
	JMP SRCSET	/SET EXT = SRC
	JMP* EXTCK1
SRCSET	LAC SRC
	SKP
BINSET	LAC BIN
	DAC* EXTCK
	JMP* EXTCK1
SRC	.SIXBT /SRC/
BIN	.SIXBT /BIN/
	.EJECT
/SUBROUTINE TO OUTPUT DESCRIPTIVE ERROR MESSAGE AND THEN ECHO
/COMMAND UP TO BUT NOT INCLUDING ERRONEOUS CHARACTER OR ELEMENT
/FOLLOWED BY A QUESTION MARK (?).
/ENTER WITH ERROR MESSAGE NUMBER IN AC.
/EXITS WITH 1ST NEW CHARACTER IN THE AC
/
ECHOCS	0
	TAD (LAC ERMSGS	/PICK UP ADDRESS
	DAC .+1		/OF ERROR MESSAGE LINE BUFFER
LACALB	XX
	DAC ERRLNE
	DZM PIPAGN		/SUPPRESS 'PIP'
	LAW 77		/?
	DAC* VALOUT
	ISZ VALOUT
	LAW 177
	DAC* VALOUT	/RUBOUT - IN CASE CHAR. COUNT UNEVEN
	LAC LTECHO	/COMPUTE WORD PAIR
	CMA		/COUNT AND PLACE
	TAD VALOUT	/IN LINE BUFFER
	TAD (5		/HEADER
	JMS R8L
	AND (377000
	DAC CMDOUT
/
/	.WRITE -3,2,XX,34	/OUTPUT APPROPRIATE
	CAL+2775		/ERROR MESSAGE IN IOPS
	11		/ASCII MODE
ERRLNE	XX
	-42
	ISZ ZECHO
ERRJMP	JMP RESTRT		/NO ECHO (MODIFIED)
/
/	.WRITE -3,3,CMDOUT,84	/ECHO VALID PORTION
	CAL 3775		/OF ERRONEOUS
	11		/COMMAND STRING
MOD05	CMDOUT		/IMAGE ALPHA MODE
	-124
	.IFUND PTP
	.IFUND BF
	.IFUND BFR
	LAC 17777		/CHECK BATCH
	AND LH7
	SZA		/NOT BATCH, WAIT FOR CORRECTION
	JMP RESTRT	/BATCH, RESTART
	.ENDC
	.ENDC
	.ENDC
	JMS READTT	/GO READ KEYBOARD
LITLAW	LAW -1		/REPLACE
	DAC ZECHO
	TAD VALOUT		/QUESTION MARK
	DAC LACALB		/WITH
	LAW 40		/SPACE.
	DAC* LACALB		/
	JMS GETCHR
	SAD (15		/IS 1ST CHAR. CARRIAGE RETURN
LITJMP	JMP RESTRT		/YES --- COMMAND TO BE RETYPED
LITOUT	JMP* ECHOCS	/NO --- COMMAND TO BE CONTINUED
PAPER	0		/LAW 1=PR OR CR; LAW 2=PP ;3=BOTH
CARD	0		/NON 0 = CARD READER INPUT
DMPSW	0		/DUMP+PR SW = 2
FUNCDE	0		/FUNCTION CODE: T=0
			/               L=2
			/               D=4
			/               C=6
			/	     R=10
			/		B=12
			/		S=14
			/		V=16
			/		N=20
DESFLS	.BLOCK 110		/FILE NAMES AND EXTENSIONS (24 MAX)
SRCFLS	.BLOCK 110		/FILE NAMES AND EXTENSIONS (24 MAX)
SNAMES	.BLOCK 40		/SPLIT STRINGS (16 MAX)
/ORDER OF DSFPTR THROUGH DATAMD MUST NOT CHANGE!!!!
DSFPTR	0		/INITIALLY DESFLS
	774000		/CORE BANK 0 (S SWITCH)  8K
	760000		/CORE BANK 0.5.	12K
LH7	700000		/CORE BANK 1	16K
	400000		/CORE BANK 1.5.	20K
	777776		/CORE BANK 2	24K
	777770		/CORE BANK 2.5.	28K
	777740		/CORE BANK 3	32K
DATAMD	0		/DATA MODE SWITCH OPTION:
			/1 = IOPS BINARY   (B)
			/2 = IMAGE BINARY  (H)
			/3 = IOPS ASCII    (A)
			/4 = IMAGE ALPHA   (I)
			/5 = DUMP          (D)
ZDRSW	0		/DELETE(1000);RENAME(2000) SW.
	.IFDEF BF
DATB	0		/BACKGROUND .DAT POINTER
	.ENDC
	.IFDEF BFR
DATF	0		/FOREGROUND .DAT POINTER.
	.ENDC
LINCNT	0		/LINE COUNT
LIT40	40		/SPACE 
CNOP	740000		/CONSTANT NOP
ZECHO	0		/ECHO MSG. SWITCH: -1=ECHO, 0=NO ECHO.
SRFPTR	0		/INITIALLY SRCFLS.
STRPTR	0		/INITIALLY SNAMES.
	.EJECT
OUTPIP	003000		/WORD PAIR COUNT OF 3 (ALSO LIT 3000)
TEMP1	0
	.IFUND BF
	.IFUND BFR
	.ASCII 'PIP V9A'<15>
	.ENDC
	.ENDC
	.IFDEF BF
	.ASCII 'PIPBF V9A'<15>
	.ENDC
	.IFDEF BFR
	.ASCII 'PIPBF V9A'<15>
	.ENDC
ZOUTCP	002000		/WPC=2
TEMP2	0
	.ASCII	<12><136>'P'<15>	/LF ^P CR
				/WARNING: IF 'TEMP2+2 (ASSEMBLED) CHANGES FROM
				/006400, 'SYSCT+1' MUST BE ADJUSTED.
OUTBRK	002000		/WORD PAIR COUNT OF 2
PUTC	0		/5/7 CHAR POSITION COUNT
	12		/L.F
	76		/>
EOTLIN	EOTEND-EOTLIN/2*1000
	0
	.ASCII <11>'.EOT'<15>
DIRSWH=.-1		/S,N SWITCH:1=S,2=N
EOTEND=.
FFLIN	FFEND-FFLIN/2*1000	/FF,CR
	0
	.ASCII <14><15>
QSWTCH=.-1			/Q SWITCH* NON-0 = Q OPTION.
FFEND=.
/
LHEAD	LHEND-LHEAD/2*1000
	0		/MAY NOT BE USED AS TEMP
	.ASCII ' DIRECTORY LISTING'<15>
LHEND=.
/
LUSER	LUSND-LUSER/2*1000
	0			/MAY NOT BE USED AS TEMP
	.ASCII	<0>
	.ASCII	<0>
	.ASCII	' USER FILES'<15>
Z1BUFP=.-1		/Z1BUF POINTER (DYNAMIC)
LUSND=.
LSYS	LSYSND-LSYS/2*1000
	0		/MAY NOT BE USED AS TEMP
	.ASCII <0>
	.ASCII <0>
	.ASCII ' SYSTEM BLKS '<15>
LSYSND=.
	.ASCII ' ILLEGAL COUNT'<15>
/
LFREE	LFREND-LFREE/2*1000
	0		/MAY NOT BE USED AS TEMP
	.ASCII <0>
	.ASCII <0>
	.ASCII ' FREE BLKS'<15>
Z2BUFP=.-1		/Z2BUF POINTER(DYNAMIC)
LFREND=.
/
ERRMSG	NDERR-ERRMSG/2*1000		/WORD PAIR COUNT OF 9 /-2
ZCOUNT	0		/GEN PURP COUNTER
	.ASCII ' COMM STRING TOO LONG'<15>
XITFLG=.-1		/0=ALT MODE;1=CARRIAGE RETURN
NDERR=.
FULLER	NDFULL-FULLER/2*1000	/-1
DESTSW	0		/NON0=DEST BLKS IN COMM STRING
	.ASCII ' TOO MANY FILES OR BLKS'<15>
NDFULL=.
/COMMAND STRING ERROR MESSAGES.
/
ERMSG0	MSG0ND-ERMSG0/2*1000	/0
GSWTCH	0	/NON0= G SWITCH ENCOUNTERED
	.ASCII ' ILL FUNCTION'<15>
MSG0ND=.
ERMSG1	MSG1ND-ERMSG1/2*1000	/1
KLCNTD	0		/FILE ENTRY COUNTER
	.ASCII ' ILL DEV OR UNIT'<15>
ZSPACE=.-1		/GETCHR SPACE SWITCH(NON0=IGNORE SPACE
MSG1ND=.
ERMSG2	MSG2ND-ERMSG2/2*1000	/2
STRCNT	0		/SPLIT STRING COUNT
	.ASCII ' ILL DEV TERMINATOR'<15>
MSG2ND=.
ERMSG3	MSG3ND-ERMSG3/2*1000	/3
KLDIRT	0		/FILE COMPLETE WD(4) POINTER
	.ASCII ' DEV NOT IN +.DAT TABLE'<15>
MSG3ND=.
ERMSG4	MSG4ND-ERMSG4/2*1000	/4
KLDIRF	0		/DIRECTORY ENTRY SECTION POINTER
	.ASCII ' DEV ILL FOR OPTION OR FUNCTION'<15>
FSWTCH=.-1		/NON0= F SWITCH ENCOUNTERED
MSG4ND=.
ERMSG5	MSG5ND-ERMSG5/2*1000	/5
SPROOM	0		/SPLIT COUNT
	.ASCII ' FILE NAME TOO LONG'<15>
MSG5ND=.
/
ERMSG6	MSG6ND-ERMSG6/2*1000	/6
PUTCT	0		/WORD PAIR COUNT
	.ASCII ' FILE NOT ON DEV'<15>
ZENTP=.-1			/TEMP POINTER
MSG6ND=.
ERMSG7	MSG7ND-ERMSG7/2*1000	/7
YSWTCH	0		/NON0=Y SWITCH ON
	.ASCII ' ILL SWITCH'<15>
WSWTCH=.-1		/NON0 = W SWITCH ENCOUNTERED
MSG7ND=.
ERMSG8	MSG8ND-ERMSG8/2*1000	/8
TEMP3	0
	.ASCII ' SWITCH CONFLICT'<15>
YEOFSW=.-1		/0=NEW INPUT;NON0=NEW OUTPUT MEDIUM
MSG8ND=.
ERMSG9	MSG9ND-ERMSG9/2*1000	/9
TEMP4	0
	.ASCII ' SWITCH ILL FOR FUNCTION'<15>
MSG9ND=.
ERMSGA	MSGAND-ERMSGA/2*1000	/10
BSWTCH	0		/NON0= B SWITCH ON
	.ASCII ' ILL TERMINATOR'<15>
DIRECT=.-1		/0=DEST DEV;1=SRC DEV
MSGAND=.
ERMSGB	MSGBND-ERMSGB/2*1000	/11
ZLSAV1	0		/T. STORE
	.ASCII ' DATA MODE NEEDED'<15>
LITCR=.-1
MSGBND=.
ERMSGC	MSGCND-ERMSGC/2*1000	/12
ZLSAV2	0		/T. STORE
	.ASCII ' SWITCH ILL FOR DEV'<15>
MSGCND=.
/
ERMSGD	MSGDND-ERMSGD/2*1000	/13
DELSW	0		/DELETE OUTPUT LINE SWITCH (NON 0 = DEL)
	.ASCII ' INPUT CKSUM ERR'<15>
PUTP=.-1		/5/7 DATA AREA POINTER
MSGDND=.
ERMSGE	MSGEND-ERMSGE/2*1000	/14
TEMP5	0
	.ASCII ' INPUT PARITY ERR'<15>
MSGEND=.
ERMSGF	MSGFND-ERMSGF/2*1000	/15
BLPRNT	0		/BLOCK PRINT SWITCH (0=CLEAR, NOT 0=SET)
	.ASCII ' S FUNC NOT DONE'<15>
PUT1=.-1		/5/7 TEMP STORE
MSGFND=.
ERMSGG	MSGGND-ERMSGG/2*1000	/16
KLCNT	0		/OCTAL PLACE COUNT
	.ASCII ' TOO FEW DEST FILES'<15>
MSGGND=.
ERMSGH	MSGHND-ERMSGH/2*1000	/17
KLCHAR	0		/OCTAL TEMP STOR.1
	.ASCII ' TOO MANY DEST FILES'<15>
DSFCNT=.-1		/DEST FILE COUNT
MSGHND=.
/
ERMSGI	MSGIND-ERMSGI/2*1000	/18
KLCHR2	0		/OCTAL TEMP STOR. 3
	.ASCII ' TOO MANY SRC FILES'<15>
MSGIND=.
ERMSGJ	MSGJND-ERMSGJ/2*1000	/19
KLSUPR	0		/0 SUPPRESS SWITCH (0=SUPP.,40=NO)
	.ASCII ' INPUT LINE TOO LONG'<15>
SRFCNT=.-1		/SRC FILE COUNT
MSGJND=.
ERMSGK	MSGKND-ERMSGK/2*1000	/20
TVCNT	0		/SIXBT TEMP STOR.
	.ASCII ' READ-COMP ERR ON BLK:'<15>
MSGKND=.
ERMSGL	MSGLND-ERMSGL/2*1000	/21
CETSW	0		/1=E, 2=C, 4=T
	.ASCII ' ILL BLK #'<15>
INROOM=.-1		/BLOCK COUNTER (FILES)
MSGLND=.
ERMSGM	MSGMND-ERMSGM/2*1000	/22
VSWTCH	0		/NON0 = VERIFY ON
	.ASCII ' STRINGS 1 TO 16 ACCEPTED'<15>
OTROOM=.-1		/BLOCK COUNTER(FILES)
MSGMND=.
ZPASS=ZEOTCK		/S SWITCH PASS #(1000=PASS1,0=PASS2)
ZCT=ZSPW			/GENERAL COUNTER
ZSAVPT=TMPFLP		/FILE NAME SAVE AREA POINTER
KLCNTB=PUT1		/SPACE CHAR. TEMP STORE
/
/END TAPE FOR PIP ASSEMBLIES.
	.IFUND BFR
	.IFDEF PTP
	.END BANK*20000+17720
	.ENDC
	.IFUND PTP
	.END
	.ENDC
	.ENDC
	.IFDEF BFR
	.END BEGIN
