/CCLAT  INDIRECT COMMAND (@) PROCESSOR















/
/
/
/COPYRIGHT  (C)  1979 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.
/
/
/


/VERSION=V3A (D.H.)
/2	CCL INDIRECT COMMAND FILE PROCESSOR

	.GLOBAL AT,FUDG,DONB

	.EXTERNAL BEGLN,GETSPC,ASSIGN,SETEXT,EXTCM
	.GLOBAL SAVL
	.EXTERNAL DEFALT,LOOKUP,ASADR,LNAME
	.EXTERNAL PRMESG,MOVE
	.EXTERNAL OUTSW,OUTLIM

	XR=16
	CLXR=35
	T=20
	LXR=34
	BFR=3000

	.RSECT AT1
	FIELD 1

AT,	0
ATMORE,	TAD (BEGLN-1
	DCA LXR
ATLOOP,	JMS I (GLXR
	SNA
	JMP I AT
	TAD (-300
	SZA CLA
	JMP ATLOOP
	TAD LXR
	DCA I (SAVL
	JMS FUDG
	JMS I (GETSPC
	JMS I (ASSIGN
	DCA I (SETEXT
	TAD (EXTCM
	DCA I (DEFALT
	JMS I (LOOKUP
	SZA CLA		/V3C
	TAD I (ASADR
	SNA
	JMP I (ATERR	/IF NO FILESPEC AFTER @, ERROR
	DCA T
	TAD I (LNAME	/GET BLOCK NUMBER
	DCA BLN
	CIF 0
	JMS I T
	200		/READ 2 PAGES
NWB,	BFR+200		/INTO BUFFER
COUNT,
BLN,	0		/FROM THIS BLOCK
	JMP I (ATERR	/ I/O ERROR
	TAD (-200
	DCA COUNT
	TAD (BFR-1
	DCA XR
	TAD NWB
	DCA T
	CDF 0
L$:	TAD I T
	JMS I (P
	CLL RTR
	RTR
	DCA TEMP$
	ISZ T
	TAD I T
	JMS I (P
	CLL RTL
	RTL
	RAL
	TAD TEMP$
	JMS I (P
	CLA
	ISZ T
	ISZ COUNT
	JMP L$
	JMP I (ATOVER

TEMP$:	0

/ATFIN,	TAD LXR
/	TAD (-BEGLN
/	SZA CLA
/	JMP I AT	/LEAVE
/	JMP I (LEAVE	/LEAVE BECAUSE LINE NOW EMPTY
FUDG,	0
	DCA I (OUTSW	/LOAD HANDLER
	TAD I (OUTLIM
	CIA
	DCA CLXR
	JMP I FUDG

GLXR,	0
	CDF 0
	ISZ LXR
	TAD I LXR
	CDF 10
	JMP I GLXR

DONB,	0		/USED AS A FLAG
	JMP I DONB
	PAGE
P,	0
	AND (177
	SNA
	JMP CTZ		/END AT 0 OR ^Z
	TAD (-32
	SNA
	JMP CTZ
	TAD (32-16	/IGNORE CR,LF,FF,VT
	CLL
	TAD (16-12
	SZL
	JMP 1$
	TAD (212	/FORCE 8-BIT
	DCA I XR
1$:	CLA
	TAD I T
	AND (7400
	JMP I P
CTZ,	CDF 10
	TAD LXR
	DCA ATEND
	STA
	TAD LXR
	DCA LXR		/INCASE @ GOES TO EOL
	JMS I (GLXR	/SEARCH FOR EOL
	SZA CLA
	JMP .-2
	TAD LXR
	CMA
	TAD ATEND
	DCA ENDLEN
	TAD XR
	CMA
	TAD (BFR	/GET LENGTH OF INSERTED STUFF
	DCA NEWLEN
	CDF 0
	TAD I ATEND	/GET NEXT CHAR AFTER FILESPEC
	CDF 10		/V3C
	TAD (-"'
	SZA CLA		/IS IT AN APOSTROPHE?
	JMP .+3		/NO
	ISZ ENDLEN	/YES
	ISZ ATEND	/MAKE IT GO AWAY
	TAD ENDLEN
	JMS I (MOVE	/MOVE REST OF LINE UP
	CDF 0
ATEND,	0		/FIRST CHAR POSITION AFTER @ SPEC
	CDF 0
	BEGLN+1000
	TAD NEWLEN	/IF 0, 'MOVE' WILL IGNORE IT
	JMS I (MOVE	/MOVE IN NEW STUFF
	CDF 0
	BFR
	CDF 0
SAVL,	0		/POINTS TO @
	TAD NEWLEN
	CIA
	TAD SAVL
	DCA NEWEND
	CLL
	TAD NEWEND
	TAD MB
	SZL CLA
	JMP ATOVER
	TAD ENDLEN
	JMS I (MOVE	/MOVE BACK END
	CDF 0
	BEGLN+1000
	CDF 0
NEWEND,	0		/FIRST POSITION AFTER NEW STUFF
	JMP I (ATMORE	/LOOK FOR MORE

MB,	-BEGLN-1000
ATOVER,	JMS I (PRMESG
	OVFLOW
ENDLEN,	0		/- NO. OF CHARS AT END INCLUDING 0
NEWLEN,	0		/- NO. OF CHARS BEING INSERTED

ATERR,	CDF 10
	CLA
	JMS I (PRMESG
	ATIO
ATIO,	TEXT	/#BAD FILENAME OR ERROR READING INDIRECT FILE/
OVFLOW,	TEXT	/#COMMAND LINE OVERFLOW/
	PAGE
