File: CCLAT.MA of Disk: V50/Source/Source-Listing-2
(Source file text) 

/CCL INDIRECT COMMANDS FOR KBM V40
/
/
/
/
/
/COPYRIGHT  (C)  1979 BY DIGITAL EQUIPMENT CORPORATION
/		 AND 1979 BY DATAPLAN GMBH
/
/
/
/
/
/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.
/
/
/

/2	CCL INDIRECT COMMAND FILE PROCESSOR
/	VERSION=4A

	.ENTRY AT

	.EXTERNAL SAVL,FUDG
	.EXTERNAL GETSPC,ASSIGN,SETEXT,EXTCM
	.EXTERNAL LOOKUP,ASADR,LNAME
	.EXTERNAL ERROR,MOVE

	.NOLIST
	.INCLUDE OUT:CCLDEF.MA
	.LIST

	.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 I	(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	P
	CLL RTR
	RTR
	DCA	TEMP$
	ISZ	T
	TAD I	T
	JMS	P
	CLL RTL
	RTL
	RAL
	TAD	TEMP$
	JMS	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
GLXR,	0
	CDF 0
	ISZ	LXR
	TAD I	LXR
	CDF 10
	JMP I	GLXR

P,	0
	AND	(177
	SNA
	JMP I	(CTZ	/END AT 0 OR ^Z
	TAD	(-32
	SNA
	JMP I	(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
	PAGE
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 I	(SAVL
	DCA	XSAVL
	TAD	NEWLEN	/IF 0, 'MOVE' WILL IGNORE IT
	JMS I	(MOVE	/MOVE IN NEW STUFF
	CDF 0
	BFR
	CDF 0
XSAVL,	0		/POINTS TO @
	TAD	NEWLEN
	CIA
	TAD I	(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
ENDLEN,	0		/- NO. OF CHARS AT END INCLUDING 0
NEWLEN,	0		/- NO. OF CHARS BEING INSERTED

ATOVER,	JMS I	(ERROR
	15.		/#Command line overflow
ATERR,	JMS I	(ERROR
	16.		/#Bad filename or error reading indirect file
	PAGE