File: CCLSEM.MA of Disk: V50/Source/Source-Listing-MAC-1
(Source file text) 

/CCL SEMICOLONS FOR KBM V40
/
/
/
/
/
/	CCL SEMICOLON CODE
/	VERSION=4B

	.ENTRY SEMI

	.EXTERNAL ERROR,YBATCH,ZOW,GLIN

	.NOLIST
	.INCLUDE OUT:CCLDEF.MA
	.LIST

	.RSECT SEM1
	FIELD 1

ENGOA,	TAD (-5
	JMS	ZEROCD
	TAD I (BLKNO
	DCA I (MIFILE+1
	CLA IAC
	DCA I (MIFILE	/'CCBTCH' IS ON SYS:
	TAD (40		/ /S OPTION FOR SECOND LEVEL
	DCA I (MPARAM+1
	TAD (20		/  ALSO /H (HUSH) OPTION
	DCA I (MPARAM
	TAD (YBATCH
	JMP I (ZOW	/CHAIN TO BATCH

ZEROCD,	0
	TAD (-42	/AC MAY BE NON-0
	DCA T$
	TAD (MOFILE-1
	DCA XR
	DCA I XR	/ZERO THE COMMAND DECODER OUTPUT AREA
	ISZ T$
	JMP .-2
	JMP I ZEROCD
T$:	0
	.ENABLE ASCII
BATHED,	TEXT	"$JOB"<215><212>"."
BATAIL,	TEXT ".DEL SYS:CCBTCH.TM/H"<215><212>"$END"<215><212><32>
	.ENABLE SIXBIT
TEMNAM,	FILENAME CCBTCH.TM
	PAGE
BATPTR,	BATBUF-1
LCHAR,	0
SEMSWI,	-1

SEMI,	0
	CLA IAC		/SYS
	JMS I (USR
	3		/ENTER
BLKNO,	TEMNAM
BLKLEN,	0		/NEG OF LENGTH
	JMP SEMER1	/ENTER ERROR
	TAD BLKNO
	DCA BATBLK
	TAD (BEGLN-1
	DCA XR
	TAD (7600
	CDF 0
	DCA I (CTRLCK	/FORCE ^C TO GLINE TO GO TO 7600
	CDF 10
	JMS BATLST
	BATHED
S2,	CDF 0
	TAD I XR
	CDF 10
	SNA
	JMP LINEND
	DCA LCHAR	/SAVE CHAR
	TAD LCHAR
	TAD (-";
	SNA CLA
	JMP GOTSEM
	TAD LCHAR
S3,	JMS BATPUT
	DCA	SEMSWI	/INITIAL ; IS PAST
	JMP S2
LINEND,	TAD LCHAR
	TAD (-";	/LOOK AT LAST CHAR
	SZA CLA		/WAS IT SEMICOLON?
	JMP BATEND	/NO, END OF TEMP BATCH STREAM
	CIF CDF 0
	JMS I (GLIN	/YES, READ NEW LINE FROM KEYBOARD
	TAD (BEGLN-1	/**** WHAT IF WE'RE RUNNING UNDER BATCH ****
	DCA XR
	JMP S2

GOTSEM,	ISZ	SEMSWI	/WAS IT INITIAL ; ?
	SKP
	JMP S2		/YES ; DON'T PUT EXTRA '.'
	JMS KRLF
	TAD (".
	JMP S3

KRLF,	0
	TAD (215
	JMS BATPUT
	TAD (212
	JMS BATPUT
	JMP I KRLF

BATPUT,	0
	ISZ BATPTR
	CDF 0
	DCA I BATPTR
	CDF 10
	TAD BATPTR
	TAD (-BATBUF-377
	SNA CLA
	JMS BATWRIT	/WRITE OUT BUFFER IF FULL
	JMP I BATPUT
BATWRIT,0
	CIF 0
	JMS I (7607
	4200		/WRITE 1 BLOCK
	BATBUF
BATBLK,	0
	JMP SEMER2	/  I/O ERROR
	ISZ BATBLK	/POINT TO NEXT BLOCK
	ISZ BATLEN	/BUMP LENGTH
	ISZ BLKLEN
	SKP
	JMP SEMER3	/DEVICE FULL
	TAD (BATBUF-1
	DCA BATPTR
	JMP I BATWRIT

BATEND,	JMS KRLF
	JMS BATLST
	BATAIL
	JMS BATWRIT
	CLA IAC		/SYS
	JMS I (USR
	4		/CLOSE
	TEMNAM
BATLEN,	0		/LENGTH OF TEMPORARY FILE
	JMP SEMER4	/CLOSE ERROR
	JMP I (ENGOA
BATLST,	0
	TAD I BATLST
	DCA T$
	ISZ BATLST
L$:	TAD I T$
	SNA
	JMP I BATLST
	JMS BATPUT
	ISZ T$
	JMP L$

T$:	0

SEMER1,	JMS I (ERROR
	17.		/#CCBTCH Enter error
SEMER2,	JMS I (ERROR
	0.		/#I/O Error on SYS:
SEMER3,	JMS I (ERROR
	18.		/#Device full
SEMER4,	JMS I (ERROR
	19.		/#CCBTCH Close error
	PAGE