/1	CCL OVERLAY TABLE

	.EXTERNAL BEGLN,PRQMRK
	.GLOBAL CCLBLC,NOCCL
	CCLTAB="H

/CCL.SV (THE IMPORTANT PART) MUST BE A SINGLE CORE-LOAD
/CONTIGUOUS LOAD, BECAUSE OF THE WAY THE MONITOR LOADS IT.
/FORTUNATELY, FIELD 0 STUFF OCCURS AFTER FIELD 1 STUFF IN THE
/OS/8 CORE-IMAGE FORMAT.
/FOR VERSION OF THE MONITOR BEFORE LEVEL A,
/THE TOTAL LENGTH OF CCL.SV MUST BE LESS THAN14 BLOCKS
/OR IT READS OVER 7600.
/BUT NOW CCL COMES IN AND READS THE REMAINDER OF ITSELF
/INTO FIELD 0.  400-777 IS IGNORED BY SKIPPING A BLOCK,
/THEN THER REST OF CCL (7 PAGES) IS READ IN.

	.ASECT TABLE0
	FIELD 0

	*400

/IT LOADS OVER THE SAVE, DATE OVERLAY
/AND STARTS AT LOCATION 600

/KEYWORD TABLE IN 400-

/CONSISTS OF COMMANDS 2 CHARS PER LOCATION
/IN 5-BIT ASCII (ONLY LETTERS ARE LEGAL)
/SEPARATED FROM EACH OTHER BY 6-BIT 00'S.
/EACH ENTRY STARTS ON A WORD BOUNDARY, BUT IF YOU
/NEED THE ROOM, THEY NEED NOT WITH A SIMPLE FIX
/BIT 40 ON MEANS THAT THE CHARACTER ISN'T REQUIRED
/BUT IF THE USER DOES TYPE A LETTER, IT MUST MATCH.
VNO,	CCLTAB
KEYWRD,
0530	/EX ECUT
4543
6564
0002	/BA CKSP OR TER MIN
0143
5363
6000
0201	/BAS IC
2351
4300
0425	/DU PLICATE
6054
5143
4164
4500
0217	/BO OT
5764
0003	/CCL
0314
0003	/COMPA R
1715
2001
6200
0317	/COM PIL
1560
5154
0003	/COP Y
1720
7100
1505	/MEM ORY
1557
6271
0003	/CREA TE
2205
0164
4500
0322	/CREF
0506
0004	/DA TE
0164
4500
0405	/DEL ETE
1445
6445
0004	/DE A
0541
0004	/DIR ECT
1122
4543
6400
0504	/ED IT
5164
/0005	/EO F
/1746
0010	/HE LP
0554
6000
1411	/LIN K
1653
0015	/MAC R
0103
6200
1411	/LI ST
6364
0014	/LO AD
1741
4400
1501	/MAK E
1345
0015	/MAP
0120
0015	/MUNG
2516
0700
2001	/PAL
1400
2022	/PRI NT
1156
6400
2025	/PU NCH
5643
5000
2205	/REN AME
1641
5545
0022	/RES
0523
/0022	/REW IND
/0527
/5156
/4400
0003	/CA NCEL
0156
4345
5400
2305	/SET
2400
2313	/SK IP
5160
0023	/SQ UISH
2165
5163
5000
2325	/SU BMIT
4255
5164
0024	/TE CO
0543
5700
2431	/TY PE
6045
/0025	/UN LOAD
/1654
/5741
/4400
0022	/REQ U
0521
6500
2165	/Q UEUE
4565
4500
2501	/UA
0025	/UB
0200
2503	/UC
0026	/VE R
0562
0032	/ZERO
0522
1700
4000	/@
	ZBLOCK 600-.
	IFDEF XYZMCR <

THIS IS THE TECO MACRO WHICH WAS USED TO CREATE THE ABOVE TABLE:


HKGYJ2SR0,.KHXAHKMA
TYPE COMMANDS, SPACE SEPARATES MANDATORY PART FROM
OPTIONAL PART, CR TERMINATES COMMANDS, ^Z TERMINATES ALL.
**  NO EDITING **
HKHXYHXN0UO0UB0UN
!CHLP!^TULQL-32"EOBLANK'QL-13"EOCR'QL-26"EOEND'
!CHLP0!QL&63+QBUT QT/8UXQX+48IQT-(8*QX)+48I
QL"NZJ.UZGNQLIQZJXNK%N'
%O&1"NOCHLP' QN-3"LZUH'I
OCHLP
!BLANK! 32UBZJ.UZGNQLIQZJXNK%NOCHLP
!CR! 
QHJ	/GNZJXN0UN0UB0ULOCHLP0
!END!I00



	>
	*600

	JSBITS=7746
	SYSTEM=22
	PRMES=330
	ERRET=33	/THESE ARE LOCATIONS FROM OS/8 MONITOR

/RUNS IN FIELD 0 ONLY.

ENTRY,	0		/INITIALLY 0 MEANS 'EX' COMMAND
LINPTR,	JMP ENTREE	/OS/8 JUMPS HERE (ACTUALLY TO 600)
TEMM,
TEKLDG,	ISZ CCLNHR	/TECO 'EG' JUMPS HERE
	DCA I (BEGLN	/ZERO COMMAND LINE
	JMP TEGO	/FIRST WE DISABLE CALLS TO MONITOR
ENTREE,	TAD (7605
	DCA ERRET
	TAD SYSTEM
	DCA MYSYS
	JMS FINDIT	
	SPA CLA		/WAS IT A LEGAL COMMAND?
	JMP I (PRQMRK	/NO
TEGO,	TAD (6003	/YES
	DCA I (JSBITS
	CIF 10
	JMS I MYSYS	/CALL USR AND LOCK IN CORE
	10
	CLA IAC
	CIF 10
	JMS I (200
	2
CCLBLC,	CCLSV
CCLEN,	0
CCLNHR,	JMP NOCCL	/ISZ'ED IF KBM NOT IN MEMORY
	CLA IAC
	TAD CCLBLC
	DCA CCLRDB
	JMS I (7607
CCLCCW,	2711		/READ 27 PAGES OF CCL.SV
CCLSTR,	2000
MYSYS,
CCLRDB,	7700		/INITIALLY POINTS TO USR
	JMP NOCCL
	CIF CDF 10
	JMP I CCLSTR
CCLSV,	FILENAME CCL.SV

NOCCL,	CLA SKP
	JMP I (7605	/GO BACK TO MON IF CCL NOT FOUND ON TECO EG COMMAND
	JMS I (PRMES	/PRINT ERROR MESSAGE OTHERWISE
	TEXT	/NO CCL!/
	0
/FINDS IF INPUT LINE STARTS WITH A COMMAND
/LEAVES ENTRY # IN AC, -1 IF NOT FOUND
/ENTRIES START AT ENTRY 0.
/CALLABLE FROM ANY FIELD

FINDIT,	0
MORE,	TAD (BEGLN-1
	DCA LINPTR
	ISZ LINPTR
	TAD I LINPTR
	TAD (-240
	SNA CLA
	JMP .-4
	JMS GETKAR
	JMP ENDOFT	/NO MATCH
	JMP INTO
FNLUP,	TAD I LINPTR
	TAD (-301
	STL
	TAD (-32
	SNL CLA
	JMP NOLET	/NOT A LETTER
	JMS GETKAR
	JMP MATCH
INTO,	CIA
	TAD I LINPTR
	AND (37		/5-BIT ASCII
	ISZ LINPTR
	SNA CLA		/DO THEY MATCH?
	JMP FNLUP	/YES
NOMT,	JMS GETKAR
	SKP
	JMP .-2		/SCAN TO NEXT ENTRY
	ISZ ENTRY
	JMP MORE

NOLET,	JMS GETKAR
	JMP MATCH
	CLA
	ISZ SIGNIF
	JMP NOMT
MATCH,	TAD ENTRY
	SKP
ENDOFT,	STA
RETCIF,	CDF 0		/RETURN TO CALLING FIELD (MAY BE OVERLAID)
	JMP I FINDIT
KPTR,	KEYWRD
HALF,	-1		/0 MEANS LEFT HALF
SIGNIF,	0		/1 MEANS 40 BIT ON WHICH MEANS CHAR IS SIGNIF ONLY IF PRESENT

/GETKAR GETS NEXT 5-BIT CHAR, LEAVES IT IN AC
/SETS SIGNIF TO -1 IF 40 BIT WAS PRESENT
/TAKES RETURN 1 IF CHAR IS 0
/TAKES RETURN 2 OTHERWISE

GETKAR,	0
	ISZ HALF
	JMP RTHALF
	TAD I KPTR
	RTR
	RTR
	RTR
	JMP INSIDE
RTHALF,	STA
	DCA HALF
	TAD I KPTR
	ISZ KPTR
INSIDE,	AND (77
	DCA TEMM
	TAD TEMM
	AND X40
X40,	SZA CLA
	STA
	DCA SIGNIF
	TAD TEMM
	SZA
	ISZ GETKAR
	AND (37
	JMP I GETKAR
	PAGE

