/5	MACREL VERSION OF CCL FOR OS/8 V3D
/
/
/
/
/
/
/
/
/
/COPYRIGHT  (C)  1974,1975,1976,1977,1978 BY DIGITAL EQUIPMENT CORPORATION
/
/
/
/
/
/
/
/
/
/
/THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT NOTICE
/AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
/CORPORATION.  DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY
/FOR ANY ERRORS THAT MAY APPEAR IN THIS DOCUMENT.
/
/THE SOFTWARE DESCRIBED IN THIS DOCUMENT IS FURNISHED TO THE PURCHASER
/UNDER A LICENSE FOR USE ON A SINGLE COMPUTER SYSTEM AND CAN BE COPIED
/(WITH INCLUSION OF DIGITAL'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH
/SYSTEM, EXCEPT AS MAY OTHERWISE BE PROVIDED IN WRITING BY DIGITAL.
/
/DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY FOR THE USE
/OR RELIABILITY OF ITS SOFTWARE ON EQUIPMENT THAT IS NOT SUPPLIED BY
/DIGITAL.
/
/
/
/
/
/
/
/
/
/
	MIFILE=7617
	.GLOBAL OUTLIM,OUTSW,COLSET,FNAME1
	.GLOBAL LPTDEV,TTYDEV,DMPDEV,NULDEV,PTPDEV,TVDEV
	.GLOBAL EXSUB,BLK,IOERR
	.GLOBAL LOOK
	.GLOBAL SETLPT,SETPTP,SETTTY,YFORT,YF4,YLOAD,YLOADER
	.GLOBAL DEFILE
	.GLOBAL YAT,ZOW,BATCH,FLAG,RDMON,REGO,REMD,CHAIN
	.GLOBAL DECODE,SCAN,LBEGIN
	.GLOBAL DEFALT,MOVE,TWAIT,NAMPTR
	BEGLN==1000
	XFERV==70	/LOCATION INSIDE USR WHICH IS FREE
	.EXTERNAL SWAPER
/	.EXTERNAL SEMI
	.EXTERNAL MONFIX
	.EXTERNAL TABLES
	.EXTERNAL AT,CCLBLC,PTBL,SAVL,LEAVE,VERTN,NOCCL
	.EXTERNAL SETDEV,RECALL
	.EXTERNAL CD,CCER1,REMEM,ARLOC
	.EXTERNAL PRMESG,PRINT,CCSUB
	.GLOBAL YCCL

	XR2=15
	XR=16
	AMFLAG=17
	T=20
	DELIM=32
	DEFALT=33	/POINTS TO DEFAULT EXTENSION LIST
	PTR=36
	BATSPL=7200	/JMS HERE TO PERFORM SPOOLING WITH DEFAULT EXT IN AC
	SOFSET=7747

/CCL STARTING ADDRESS:	12000
/STARTING ADDRESS:	12001
/CHAIN STARTING ADDRESS:12002

/	JOB STATUS WORD = 2003

/**************************************************
/
/		SAVING CCL
/
/		.LOAD CCL
/		.SAVE SYS CCL;12001=2103
/		.R CCL
/
/**************************************************

	OV=1375
	MSOVL2=55
	CCLTAB="H	/MUST BE UPDATED IF TABLES CHANGE
	CCLNUM="3
	CCLVER="A	/CCL VERSION #

/*** NOTE: VERSION E OF CCL WAS FOR IN-HOUSE USE ONLY.
/USE OF SEMICOLONS WITH CCL VERSION I OR LATER
/REQUIRES BATCH VERSION 7 OR LATER.
/USE OF BASIC COMMAND REQUIRES V3D BASIC OR LATER

/MEMORY ALLOCATION:

/0 0000-0777	KBM
/0 1000-1777	COMMAND LINE [EACH @ FILE RESTRICTED TO 1 BLOCK]
/0 2000-2777	LINE BUFFER EXTENSION
/0 3000-3177	PRE-EXTENSION @ BUFFER
/0 3200-3577	@ BUFFER
/0 4000-4377	REM-LINES
/0 4400-4777	INPUT HANDLER FOR CD
/		ALSO, SEMICOLON BUFFER
/0 5000-5777	LONGWORD TABLE
/0 6000-7277	MORE TABLES
/0 7300-7577	SWITCH POINTER TABLE
/	CHANGES SINCE FIELD RELEASE VERSION:

/1.	RECURSIVE 'U' BUG FIXED
/2.	INTERNAL STRUCTURE OF CCL KEYWORD TABLE CHANGED
/3.	BUG RE REWRITING BLOCK CONTAINING PTR TO CORRECT FORTRAN FIXED
/4.	.SV PARTS OF FILENAMES REMOVED FROM TABLE TO SAVE SPACE
/5.	COMPARE PASSES ALTMODE
/6.	TTY BECAME DEFAULT FOR COMPAR, DIRECT, AND MAP
/7.	BUG RE PASSING DEFAULT * FIXED
/8.	.LS FORM OF .CREF COMMAND REMOVED
/9.	BUG CONCERNING PROCESSOR SWITCHES FIXED
/10.	CCL SWITCH ALLOWED AFTER =N OPTION
/11.	BUG RE 'BAD SWITCH OPTION' MESSAGE FIXED
/12.	EXTRA SPACES NOW ALLOWED BEFORE CCL ARGUMENT
/13.	'DOES NOT EXIST' MESSAGE NOW SPELLED CORRECTLY
/14.	'BAD CCL SWITCH' MESSAGE ADDED
/15.	CCL EDIT # CHANGED TO CCL VERSION #
/16.	.EX CHAINS TO BCOMP NOT BASIC FOR .BA FILES
/17.	MUNG PTR: NOW WORKS
/18.	FIXED BUG RE MUNG <CR>
/19.	FIXED BUG RE CD FOR FILE > 2047 BLKS
/20.	FIXED BUG RE MAKE PTR:

/VERSION B FIXES:

/21.	ALLOWED 'EDIT' TO COPY FILE EXTENSION
/22.	FIXED BUG RE .CCL ON WRITE-LOCKED DEVICE
/23.	FIXED DATE PROBLEM
/24.	ALLOWED FF AND VT IN AN INDIRECT FILE TO BE IGNORED

/VERSION C FIXES:

/25.	FIXED BUG RE SPACES AND SLASHES IN MUNG TEXT ARGUMENT
/26.	ALLOWED EDIT COMMAND TO USE SAME OUT DEVICE
/	 AS IN DEVICE (IF NONE SPECIFIED)
/27.	ADDED MORE SYNTAX CHECKING TO ZERO COMMAND

/VERSION D CHANGES:

/28.	ALLOWED EDIT A<B COMMAND TO REMEMBER ONLY UP TO '<' .

/VERSION E CHANGES: (IN-HOUSE ONLY VERSION)

/29.	WARNING MSG IF SQUISH SYS: UNDER BATCH
/30.	ADDED SOME NOTES ON HOW TO ALLOW = AS WELL AS <
/31.	ADDED HOOKS FOR ; TO BE READY FOR V4
/32.	FIX BUG RE CMD STARTING WITH SPACES

/CHANGES FOR MAINTENANCE RELEASE (OS/8 V3C):

/33.	FIXED BUG ABOUT @ NOT FOLLOWED BY FILESPEC
/34.	INCORPORATED ALL PREVIOUS EDITS
/35.	ALLOWED ' TO TERMINATE AN INDIRECT REQUEST (AND BE IGNORED)
/36.	FIXED BUG ABOUT EDIT DEV1:_DEV2:FOO LOSING DEV1:
/37.	CORRECTED SPELLING OF SUPERSEDING
/38.	ADDED .LD EXTENSION TO EXECUTE TABLES [USES FRTS]

/VERSION G CHANGES:

/39.	FIXED BUG WITH HELP COMMAND
/40.	FIXED BUG CONCERNING EDIT DEV:_FILE

/VERSION H CHANGES:

/41.	ADDED MAC AND LINK COMMANDS
/42.	ADDED MACREL AND LINKER INTO COMPILE/LOAD/EXECUTE COMMANDS
/43.	ALLOWED UX COMMANDS TO CONTAIN KBM COMMANDS
/44.	ALLOWED PASSING A KBM COMMAND TO CCL ON CHAINING
/45.	ALLOWED @ AT BEGINNING OF LINE
/46.	MOVED MOST OF 'DETCOR' TO FIELD 0
/47.	WAIT ROUTINE  NOW GIVES UP IF TTY FLAG ISN'T UP WITHIN 0.1 SEC
/48.	ALLOWED EXEC .BI TO USE BATCH
/49.	TENTATIVELY ADDED SEMICOLON STUFF
/50.	PUT BACK WARNING MESSAGE IF TRY TO SQUISH UNDER BATCH
/VERSION I CHANGES:

/51.	FIRMED UP SEMICOLON STUFF

/VERSION J CHANGES:

/52.	DEFAULT DEVICE FOR COMPIL, PAL, ETC. IS NOW LOGICAL DSK: NOT SYS:
/53.	-L, -S, AND -P SWITCHES NOW SET OUTPUT NAME TO CURRENT INPUT NAME

/VERSION K CHANGES:

/54.	DATE NOW HANDLES DATE/78 ALGORITHM
/55.	TOOK OUT 'TCF' WHICH WAS CAUSING BATCH TO HANG

/VERSION 1A CHANGES:

/56.	FIXED BUG RE NULL INDIRECT CMD FILE
/57.	FIXED BUG TO NOW ALLOW DATE WITH ARGS IN INIT.CM
/58.	PRINT "OS78" FOR VERSION NAME IF APPLICABLE
/59.	ADDED -N AND -D AND REWROTE LOGIC A BIT
/60.	HELP COMMAND NOW USES HELP.SV
/61.	SET COMMAND NOW USES SET.SV
/62.	'CORE' BECOMES 'MEMORY' IN 3 MSGS AND 1 CMD
/63.	ADDED BASIC COMMAND (CHAINS TO BASIC.SV WITH Q SWITCH)
/64.	ALLOWED FOR TERMINATE COMMAND (OS78 REPLACES BACKSPACE)
/65.	ADDED DUPLICATE COMMAND (USES RXCOPY)

/V1B CHANGES:

/66.	MODIFIED FORMAT OF MAIN TABLE
/67.	GIVE ERROR MESSAGE IF NO FILENAME IS GIVEN WITH INDIRECT
/	FILE (EVEN IF NON-FS)
/68.	PRINT KBM VERSION #
/69.	ADDED TERMINATE COMMAND

/V1F CHANGE:

/70.	DUPL CALLS RXCOPY IN SPECIAL MODE

/V1G CHANGES:

/71.	SOURCE CODE IS NOW MACREL
/72	LINKER OVERLAYS ADDED
/73.	= ALLOWED IN ADDITION TO _ AND < (IF NOT FOLLOWED BY A DIGIT)
/74.	/C:NNNN ALLOWED FOR NUMERIC ARGUMENT IN ADDITION TO =
/75.	HOOKS FOR MULTIPLE CHARACTER SWITCHES ADDED
/76.	SWITCHES MAY NO LONGER BE EMBEDDED IN A FILENAME
/77.	KNOWN BUG IF SAY MAKE #
/78	A+B IS IDENTICAL TO A-NB,B
/79.	KNOWN BUG THAT /A-L USES A
/80.	TEMPORARILY REMOVED SEMICOLON STUFF
/	FORMAT OF CCL TABLE

/ENTRY	PURPOSE

/	TABLE WIDTH=7 (BUT VARIES)

/0	FLAG WORD

	/BIT	MEANING IF ON

	/0	PERFORM CD (IF 0, OMIT ENTRIES 1-6)
	/1	DON'T PERMIT SPOOLING
	/2	ALLOW .LS, .NB, .MP SWITCHES
	/3	ADD _ TO END OF COMMAND STRING
	/4	SET OUTPUT EXTENSION = INPUT EXTENSION (IF BIT 2 ON)
	/6-8	SPECIFIES AUTOMATIC INPUT REMEMBERING (REM LINE MINUS 1)
	/	0 MEANS NONE.  7 RESERVED FOR SPECIAL USE.
	/10	CAUSE -L, ETC. TO GO TO 2ND OUTPUT FILE & COPIES NAME
	/11	WANT DEFAULT ALTMODE (COMPL IF AMFLAG=1)

/1	PTR TO DEFAULT EXTENSION LIST FOR INPUT FILES.
/	IF PTS TO 0, NONE.   IF PTS TO 5200, USE SPECIAL MODE.

/2-4	DEFAULT SWITCHES TO BE OR'ED INTO THOSE
/	EXPLICITLY GIVEN.

/5	ADDRESS OF SUBROUTINE TO BE CALLED
/	AFTER C.D. HAS BEEN DONE.  0 IF NONE.

/6	PTR TO FILENAME OF PROGRAM
/	TO BE CHAINED TO.  0 IF NONE.

/	FIELD 0

/1000-1777	LINE BUFFER
/2000-2777	LINE BUFFER EXTENSION
/4000-4377	REM-LINES
/4400-4777	HANDLER
/5000-5577	BUFFER
/6000-7577	MORE CCL (7 PAGES)

	REST=5000
	.ASECT CCL
	*2000
	.JSW 2103
	.VERSION CCLNUM&77^100+<CCLVER&77>

	FIELD 1

	FAKBM=404	/PLACE TO FAKE OUT KBM

START,	JMP .+3		/START FROM MONITOR
	JMP MONF	/START FROM .RUN COMMAND
	JMP MONCHN	/START WHEN CHAINED TO
	CLA
	CDF 0		/READ IN REST OF CCL
	TAD I (CCLBLC	/GET BLOCK OF START
	DCA I (SOFSET	/ALLOW LINKER OVERLAY DRIVER TO WORK
	TAD (7607
	DCA I (7756
	TAD I (SOFSET
	CDF 10
	TAD CCLREM
	DCA CCLREM	/GET BLOCK OF REST
	CIF 0
	JMS I (7607
	1300		/READ 11 MORE PAGES
	REST
WFL,
CCLREM,	1+5+1		/SKIP CCB AND *400 STUFF
	JMP I (ERR2
	JMS FIXX
	JMS TWAIT
	CDF 0
	TAD I LVNO
	CDF 10
	TAD (-CCLTAB	/DO VERSION #'S AGREE?
	SZA CLA
	JMP I (BADVNO
	JMS I (AT
	TAD (BEGLN-1
	DCA XR
L$:	CDF 0
	TAD I XR
	CDF 10
	SNA
	JMP 2$
	TAD (-";
	SZA CLA
	JMP L$
/	JMS I (SEMI
	NOP
2$:	STA
	DCA I (REMD	/ALLOW RECURSIVE U'S
	CDF 0
	TAD I KENTRY	/GET ENTRY #
	CIF CDF 10
	TAD (PTBL	/GET ADDRESS OF PTR TO START OF ENTRY
	DCA PTR
	CDF TABLES
	TAD I PTR	/GET PTR TO START OF ENTRY
	CDF 10
	DCA PTR
	TAD PTR
BASPTR,	DCA BASPTR
	JMP I (GO

FIXX,	0
	DCA I (XFERV	/SET UP STUFF FOR OVERLAY DRIVER
	TAD (SWAPER
	DCA I (XFERV+1
	JMP I FIXX

MONF,	JMS FIXX
	JMP I (MONFIX
MONCHN,
	CIF 0
	JMS I (7607	/READ IN KBM
	1000		/4 BLOCKS
	0		/0-1777
	7		/BLOCK 7 ON SYS:
	HLT		/NO WAY TO RECOVER (EVEN 7605 DOES THIS)
	TAD (-44
	JMS I (MOVE	/ASSUME COMMAND LINE IS IN
	CDF 10		/17600-17643
	7600
	CDF 0
	1000		/MOVE TO OS/8 LINE BUFFER
	CIF CDF 0
YAT,	JMP I KFAKBM	/@ DESTROYS THIS CODE (MUST BE ONE BEFORE 'REGO')
	TAD I (SAVL	/'YAT' IS JMS'ED TO
	SNA CLA		/BY INITIAL @ COMMAND
	JMP I (LEAVE	/DO NOTHING IF NO @ GOT EXPANDED (NULL LINE)
REGO,	CIF 0
	JMS I (7607
	200		/READ ONE BLOCK
	400		/400-777
	10		/RESTORE PART OF KBM WHICH WAS DESTROYED BY OVERLAY
	HLT
	JMP I (FAKE

/REGO,	TAD KCIDF
/	CDF 0
/	DCA I (RETCIF	/ALLOW 'FINDIT' TO RETURN TO FIELD 1
/	CIF CDF 0
/	STA
/	DCA I (HALF
/	DCA I (ENTRY
/	TAD (KEYWRD
/	DCA I (KPTR
/	JMS I (FINDIT	/LOOK UP KEYWORD
/	SMA CLA
/	JMP PREGO	/FOUND IT
/CMDERR,	JMS I (PRMESG	/NOT A LEGAL KEYWORD
/	ERRCMD

	.START START+1,1
TWAIT,	0
	DCA WFL
	JMS I (BATCH
	JMP TW		/BATCH NOT RUNNING
	CLA		/WE'RE RUNNING UNDER BATCH
	JMP I TWAIT
TW,	TSF
	SKP		/WAIT FOR THINGS TO QUIET DOWN
	JMP I TWAIT
LVNO,	AND I 0		/WASTE SOME TIME
KFAKBM,	AND I 4
KENTRY,	600
	ISZ WFL
	JMP TW
	JMP I TWAIT	/CAN'T WAIT TOO LONG
FILDMY,	FILENAME DUMMY.SV
	0		/EXTRA EXTENSION WORD
	PAGE
BADVNO,	JMS I (PRINT
	BADVMS
	JMS I (VERTN
	JMP I (LEAVE	/GO AWAY
/THIS ROUTINE DETERMINES IF THE CHARACTER IN THE AC IS A LETTER OR DIGIT
/IF LETTER, RETURNS TO RET+1 WITH LETTER-"A IN AC AND LINK=0
/IF DIGIT, RETURNS TO RET+1 WITH DIGIT-"0 IN AC AND LINK=1
/IF NEITHER, RETURNS TO RET WITH CHAR-"A IN AC.
DECODE,	0
	TAD (-"9-1	/MIGHT BE CALLED WITH ANY DF
	CLL
	TAD ("9+1-"0
	SZL
	JMP YES$
	TAD ("0-"Z-1
	CLL CML
	TAD ("Z-"A+1
	SNL
YES$:	ISZ DECODE
	JMP I DECODE
LBEGIN,	0		/PTS TO 1 CHAR BEFORE COMMAND KEYWORD ARGUMENT

SCAN,	0
	TAD (BEGLN
	DCA T
	CDF 0
	JMS BLSCAN	/IGNORE INITIAL SPACES
	JMP 2$
1$:	CLA
	ISZ T
	TAD I T
2$:	SNA
	JMP 3$
	JMS I (DECODE
	SKP CLA
	JMP 1$
	JMS BLSCAN
3$:	DCA DELIM
	STA
	TAD T
	CDF 10
	DCA I (LBEGIN
	JMP I SCAN

BLSCAN,	0
	TAD I T
	TAD (-240
	SZA
	JMP 1$
	ISZ T
	JMP BLSCAN+1
1$:	TAD (240
	JMP I BLSCAN	/LEAVE CHAR IN AC
SETLPT,	0		/COULD BE ONCE ONLY
	TAD (LPTDEV
	JMS I (SETDEV
	JMP I SETLPT

SETTTY,	0
	TAD (TTYDEV
	JMS I (SETDEV
	JMP I SETTTY

SETPTP,	0
	TAD (PTPDEV
	JMS I (SETDEV
	JMP I SETPTP

FAKE,	CIF CDF 0
	TAD (MSOVL2
	DCA I (OV	/RESTORE LOC SO DATE CMD W ARGS WILL WORK
	JMP I (FAKBM
SYSER,	TEXT	\#I/O ERROR ON SYS:\
GO,	JMS I (SCAN	/ADVANCE SCAN UNTIL AFTER SPACES
GO2,	CDF TABLES
	TAD I PTR	/GET FLAG
	CDF 10
	DCA FLAG	/SAVE IT
	TAD DELIM
	SNA CLA		/IS TYPED LINE EMPTY AFTER KEYWORD?
	TAD FLAG	/AND IS SPECIAL REMEMBERING BITS ON?
	CLL RTR
	RAR		/AND HAS GOD WILLED US TO REMEMBER?
	AND (7		/AND ARE THE ZODIAK SIGNS FAVORABLE?
	SNA
	JMP I (NORM	/NO
	TAD REMD	/YES, GET REM-LINE (SUBTRACT 1)
	DCA REMD
	CDF 0
	TAD I (BEGLN
	CDF 10
	DCA I (NMPTR
	JMS I (RECALL	/RECALL LINE
REMD,	-1		/-1 MEANS DIDN'T RETRIEVE A REMEMBER LINE
	DCA DEPN	/SAVE DEPENDENT INFO
	TAD I (NMPTR
	SZA CLA		/EG COMMAND?
	JMP I (NORM	/NO
	ISZ DELIM	/YES
	TAD DEPN
	DCA PTR		/RESET PTR FROM CMD DEPENDENT WORD
	JMP GO2

DEPN,	0		/REM LINE DEPENDENT INFORMATION
	PAGE
	COLWRD		/NEEDED FOR SET TTY COL
NORM,	TAD FLAG
L7700,	SMA CLA
	JMP CHAINN	/SKIP ENTRIES IF NO CD
	ISZ PTR		/POINT TO DEFAULT INPUT EXTENSION
	CDF TABLES
	TAD I PTR	/GET DEFAULT INPUT EXTENSION PTR
	CDF 10
	DCA DEFALT	/SAVE IT
	TAD (7641
	DCA XR
	TAD FLAG
	CDF 0
	TAD I PAMFLAG	/COMBINE ALTMODE BITS
	CDF 10
	RAR		/IN POSITION 11
	CLA RAR		/PUT NEW ALTMODE BIT ALONE IN BIT 0
	DCA I XR	/STORE AWAY IN C.D. OPTION TABLE
	DCA I XR	/V3D ZERO OPTION WORDS
	DCA I XR
	DCA I XR
	DCA I XR	/ZERO L.O. =
L$:	ISZ PTR
	CDF TABLES
	TAD I PTR
	SNA
	JMP 2$
	DCA NTEMP
	ISZ PTR
	TAD I PTR	/GET VALUE
	CDF 10
	TAD I NTEMP
	DCA I NTEMP	/STORE IN SPECIFIED LOCATION
	JMP L$
2$:	CDF 10
	TAD FLAG
	AND (400
	SZA CLA
	JMS I (INSARR	/INSERT BACK ARROW IF FLAG BIT SET
	JMS I (CD	/PERFORM COMMAND DECODE IF FLAG BIT
			/0 SET
	TAD FLAG
	RAL
	SMA CLA		/IS SPOOLING PROHIBITED?
	JMS I (SPOOLIT	/NO
CHAINN,	ISZ PTR		/POINT TO AFTER CD SUBR
	CDF TABLES
	TAD I PTR	/GET SUBR ADDRESS
	CDF 10
	JMS I (JMSUB
	TAD I (DEFILE
	SZA		/IS THERE A FILENAME SET TO CHAIN TO?
	JMP ZOW		/YES
	ISZ PTR		/NO, POINT TO FILENAME
	CDF TABLES
	TAD I PTR
	CDF 10
	SNA
	JMP I (LEAVE	/NO FILE TO CHAIN TO
ZOW,	DCA NMPTR
	JMS LOOK	/LOOKUP FILE
NMPTR,	0
	JMP I (CCER1	/NOT FOUND
CHAIN,	JMS I (200	/CHAIN TO IT
	6		/CHAIN

BLK,	0
/	-----
PAMFLAG,AMFLAG
/LOOK, LOOKS UP FILE ON DEVICE .  POINTER IS IN ARG1
/	ARG2 IS ERROR RETURN IF NOT FOUND
/DEVICE NUMBER IS IN AC.  IF 0, USE SYS:

LOOK,	0
	SNA
	IAC
	DCA DEV
	TAD I LOOK	/GET PTR TO FILE NAME IN FIELD 0
	DCA HISFIL
	TAD HISFIL
	AND L7700
	SNA CLA
	JMP FLD1	/PTR LT 100 MEANS IN FIELD 1
	TAD (-3
	JMS I (MOVE	/MOVE IT UP
	CDF 0
BWORD,
HISFIL,	0
	CDF 10
PFILDMY,FILDMY
	TAD PFILDMY
SETN,	DCA NAMPTR	/STORE AWAY PTR TO FILENAME
	ISZ LOOK	/POINT TO ERROR RETURN
	TAD DEV		/GET DEVICE NUMBER
	JMS I (200
	2		/LOOKUP
NTEMP,
NAMPTR,	0
	0
	JMP I LOOK	/TAKE ERROR RETURN IF NOT FOUND
	TAD NAMPTR	/STORE STARTING BLOCK # IN 'BLK'
	DCA BLK
	ISZ LOOK	/POINT TO NORMAL RETURN
	JMP I LOOK	/RETURN
FLAG,	0
DEV,	0

FLD1,	TAD HISFIL
	JMP SETN

/SKIP IF BATCH IS RUNNING AND PUT CIF BATCH FIELD IN AC

BATCH,	0
	CDF 0
	TAD I (7777
	CDF 10
	DCA BWORD
	TAD BWORD
	RTL
	SNL CLA		/IS BATCH RUNNING?
	JMP I BATCH	/NO
	TAD BWORD	/YES
	AND (70		/ISOLATE FIELD OF BATCH
	TAD (CIF	/FORM CIF TO THE HIGHEST FIELD
	ISZ BATCH	/AND TAKE SKIP RETURN WITH IT IN AC
	JMP I BATCH
	PAGE
DEFILE,	0		/PTR TO FILENAME TO CHAIN TO

TEMP,
RDMON,	0
	CDF 10
	CIF 0
	CLA
	JMS I (7607
	0400		/READ 2 RECORD
	2000		/LOCATION 2000 FIELD 0
	7		/BLOCK 7,10
	JMP IOERR
	JMP I RDMON

ERR2,	CIF CDF 0
	JMP I (NOCCL
EXSUB,	0
	TAD BASPTR	/PUSH PTR BACK TO BEGIN OF ENTRIES
	JMS I (REMEM	/REMEMBER THIS IN DEPENDENT WORD
	2
	JMP I EXSUB

JMSUB,	0
	SNA
	JMP I JMSUB
	DCA TEMP
	JMS I (CCSUB	/LOAD OVERLAY
	JMS I TEMP
	JMP I JMSUB

SPOOLIT,0
	JMS I (BATCH	/IS BATCH RUNNING?
	JMP I SPOOLIT	/NO
	DCA CB		/YES
	CDF 0
	TAD I DEFALT
	TAD (-5200
	SNA CLA
	TAD I DEFALT	/LEAVE 5200 IN AC IF SPECIAL MODE
	CDF 10
CB,	HLT		/CIF TO FIELD OF BATCH
	JMS I (BATSPL	/ALLOW BATCH TO SPOOL STUFF
	JMP I SPOOLIT
INSARR,	0
	TAD (BEGLN
	DCA XR
	CDF 0
	TAD I XR
	SZA CLA
	JMP .-2
	STA
	TAD XR
	DCA XR
	TAD ("<
	DCA I XR
	DCA I XR
	CDF 10
	STA
	TAD XR
	DCA I (ARLOC	/REMEMBER WHERE WE INSERTED A "_"
	JMP I INSARR
/	TAD (-# OF LOCS TO MOVE
/	JMS MOVE
/	FROM CDF
/	FROM LOC
/	TO CDF
/	TO LOC

MOVE,	0
	DCA T
	TAD I MOVE	/GET FROM CDF
	DCA FRCDF
	ISZ MOVE
	STA
	TAD I MOVE	/GET FROM LOC-1
	DCA XR
	ISZ MOVE
	TAD I MOVE	/GET TO CDF
	DCA TOCDF
	ISZ MOVE
	STA
	TAD I MOVE	/GET TO LOC-1
	DCA XR2
	ISZ MOVE	/POINT TO RETURN
	TAD T
	SNA CLA
	JMP I MOVE	/V1A IGNORE 0 MOVE
FRCDF,	HLT
	TAD I XR
TOCDF,	HLT
	DCA I XR2
	ISZ T
	JMP FRCDF
	CDF 10
	JMP I MOVE
OUTSW,	-1		/-1 MEANS ON OUTPUT SIDE, 0 ON INPUT SIDE

OUTLIM,	1-MIFILE
IOERR,	JMS I (PRMESG
	SYSER
BADVMS,	TEXT	/#CCL 3X OVERLAY AND CCL INCOMPATIBLE/
	AAAA=.
	*BADVMS+3
	CCLTAB&77^100+40
	*AAAA
COLWRD,	1

COLSET,	0
/	JMS I (CCSUB
	JMS I (SETTTY
	TAD I (7646
	SNA
	TAD COLWRD
	DCA I (7646
	JMP I COLSET
	PAGE
	.ASECT CCLMOR
	FIELD 0
	*6740
YCCL,	FILENAME CCL.SV
	*.-1
YFORT,	FILENAME FORT.SV
	*.-1
YF4,	FILENAME F4.SV
	*.-1
YLOADER,FILENAME LOADER.SV
	*.-1
YLOAD,	FILENAME LOAD.SV
	*.-1
LPTDEV,	DEVICE LPT
TVDEV,	DEVICE TV
TTYDEV,	DEVICE TTY
PTPDEV,	DEVICE PTP
DMPDEV,	DEVICE DUMP
NULDEV,	DEVICE NULL
FNAME1,	ZBLOCK 5

