perm filename WH[F,PMP] blob sn#021448 filedate 1972-10-26 generic text, type T, neo UTF8
00100	TITLE WH PREPARE AN MJW TEST FILE FROM AN RPH WIRE LIST (TST) FILE
00200	
00300	P←17 A←1 B←2 C←3 D←4 E←5 F←6
00400	G←7 H←10 J←11 J1←12 Q←13 T←14 T1←15 T2←16
00500	
00600	PRTSW←←1
00700	STRT:	CALLI
00800		INIT 1,10
00900		SIXBIT /DSK/
01000		DIB
01100		JRST 4,.
01200		MOVE P,[XWD -PDLEN,PDL-1]
01300		MOVEI A,LUP
01400		SETZM LUP
01500		FOR I←1,3 {SETZM LUP+I
01600	}
01700		MOVEI D,'TST'
01800		HRLM D,LUP+1
01900		OUTSTR [ASCIZ /INPUT /]
02000		PUSHJ P,FNAM
02100		LOOKUP 1,LUP
02200		JRST NOLUP
02300		INIT 2,10
02400		SIXBIT /DSK/
02500		XWD DOB,0
02600		JRST 4,.
02700	EC1:	SETZM ENT
02800		SETZM ENT+2
02900		SETZM ENT+3
03000		MOVEI A,'TS1'
03100		HRLZM A,ENT+1
03150		MOVE A,LUP
03175		MOVEM A,ENT
03200		MOVEI A,ENT
03500		ENTER 2,ENT
03600		JRST NOENT
03700		INBUF 1,2
03800		OUTBUF 2,2
03900		HRRZ A,JOBFF
04000		ADDI A,1
04100		TRZ A,1
04200		MOVEM A,FSTPNT#
04300		HRRZ B,JOBREL
04400		EXTERN JOBFF,JOBREL
04500		ADDI A,2
04600		MOVEM A,-2(A)
04700		CAMGE A,B
04800		JRST .-3
04900		SETZM -2(A)
05000		SETZM CEPNUM#
05100		DEFINE CLR (Q,SIZ)
05200	{	SETZM Q
05300		MOVE A,[XWD Q,Q+1]
05400		BLT A,Q+SIZ}
05500		CLR (CEPINS,=144)
05600		CLR (HTYPS,777)
05700		CLR (MTYPS,777)
05750		CLR (QTYPS,777)
05800		CLR (CEPPIN,=144)
05900		CLR (IGRF,=1299)
06000		CLR (OGRF,=1299)
06100	JRST ST
     

00100	LUP:	BLOCK 4
00200	DIB:	BLOCK 3
00300	ENT:	BLOCK 4
00400	DOB:	BLOCK 3
00500	PDLEN←4000
00600	PDL:	BLOCK PDLEN
00700	DEFINE GETFS (A)
00800	{	SKIPN A,FSTPNT
00900		JSR NOFST}
01000	DEFINE GETFST (A,B)
01100	{	SKIPN A,FSTPNT
01200		JSR NOFST
01300		MOVE B,(A)
01400		MOVEM B,FSTPNT}
01500	DEFINE FSTRET (A)
01600	{	PUSH P,FSTPNT
01700		POP P,(A)
01800		MOVEM A,FSTPNT}
01900	
02000	;TYPE FLAG BITS: (LEFT HALF OF TYPTB3)
02100	FFOK←←400
02200	FFBIT←←20
02300	FFAOI←←40
02400	SECTN←←100
02500	REPLC←←200
02520	FFSTP←←1000	;TYPE OF GATE WHICH STOPS GATE-DELAY CALC
02540	FFG1←←2000	;TYPE OF FF FOR WHICH GATE-DELAY MUST BE DONE(TYPE 1)
02560	FFG2←←4000	;TYPE OF FF FOR WHICH GATE-DELAY MUST BE DONE(TYPE 2)
02600	
02700	
02800	DEFINE TYPES 
02900	{	TYP (74S00,10010100100,FFOK+0,RTS00,S00,CTS00,CTNAND)
03000		TYP (74S10,100010100000,FFOK+2,RTS10,S10,CTS10,CTNAND)
03100		TYP (74S04,101010101010,FFOK+1,RTS04,S04,CTS04,CTINV)
03200		TYP (74S20,10100000,FFOK+2,RTS20,S20,CTS20,CTNAND)
03250		TYP (74S140,10100000,FFOK+2,RTS20,S140,CTS20,CTNAND)
03300		TYP (74S133,100000000,FFOK+2,0,S133,CTS133,CTNAND)
03400		TYP (74S64,10000000,FFOK+3,0,S64,0,CTS64)
03500		TYP (74S74,110110000,FFBIT+FFSTP,0,S74,CTS74,CTF74)
03600		TYP (74S112,101110000,FFBIT+FFSTP,0,S112,CTS112,CTF112)
03700		TYP (74H183,1010110000,SECTN+FFSTP,H183ST,H183,0,CTH183)
∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈∧␈rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. rλ∧. 	H183ST:	XWD 3,1
00200		0
00300		BYTE (6)3,4,5,0,6,0
00400		BYTE (6),,,,,1
00500	A153ST:	XWD 3,1
00600		BYTE (6)0,0,0,0,-1,0
00700		BYTE (6)4,5,6,7,00,0
00800		BYTE (6)0,0,0,1,-1,3
00900	
01000	FFITB1:	0
01100		0
01200		2
01300		XWD -2,6
01400		0
01500		0
01600		2
01700		XWD -2,4
01800		2
01900		2
02000		2
02100		XWD -2,6
02200		XWD 2,6
02300		XWD 2,4
02400		XWD 2,6
02500		XWD 3,10
02600	
02700	FFTB2:	FOR @$ I←0,4
02800	{	FF$I
02900		FF$I
03000	}
03100	
03200		DEFINE RF(A,B,C,D,E,F)
03300	{	BYTE (6)=F,=E,=D,=C,=B,=A}
03400		DEFINE R00 (A,B)
03500	{	RF (A,A,B,A,A,B)
03600		RF (0,B,A,A,B,A)
03700		RF (A,0,0,0,0,0)}
03800	RF0T00:	R00 (1,3)
03900	RF0B00:	R00 (2,4)
04000	RF1T00:	R00 (1,14)
04100	RF1B00:	R00 (16,15)
04200	RTS00:	RF0T00
04300		RF0B00
04400		RF1T00
04500		RF1B00
04600		0
04700		0
04800		0
04900		RF1B00
05000	
05100		DEFINE R (A,B,C,D)
05200	{	RF (A,B,A,B,C,D)
05300		RF (0,D,C,B,A,D)
05400		RF (C,0,0,0,0,0)}
05500	RF1T10:	R (1,2,3,14)
05600	RF1B10:	R (16,17,18,15)
05700	RTS10:	0
05800		0
05900		RF1T10
06000		RF1B10
06100		0
06200		0
06300		0
06400		RF1B10
06500	
06600	DEFINE R (A,B)
06700	{	RF (A,B,A,B,A,B)
06800		RF (0,B,A,B,A,B)
06900		RF (A,0,0,0,0,0)}
07000	
07100	RF2B04:	R (14,15)
07200	
07300	RTS04:	0
07400		0
07500		0
07600		0
07700		0
07800		RF2B04
07900	
08000		DEFINE R (A,B,C,D,O)
08100	{	RF (A,B,0,C,D,O)
08200		RF (0,O,A,B,0,C)
08300		RF (D,0,0,0,0,0)}
08400	RF1T20:	R(1,2,3,4,14)
08500	RF1B20:	R(16,17,18,19,15)
08600	
08700	RTS20:	0
08800		0
08900		RF1T20
09000		RF1B20
09100		0
09200		RF1B20
09300	
09400	 DEFINE R (A1,A2,A3,A4,B1,B2,B3,C1,C2,D1,D2,O)
09500	{	RF (A1,C1,C2,B1,B2,B3)
09600		RF (0,O,D1,D2,A2,A3)
09700		RF (A4,0,0,0,0,0)}
09800	RFATA:	R(10,11,12,13,5,6,7,8,9,1,2,14)
09900	RFATB:	R(1,2,3,4,10,11,12,5,6,8,9,14)
10000	RFATC:	R(1,2,3,4,5,6,7,10,11,8,9,14)
10100	RFATD:	R(1,2,3,4,5,6,7,8,9,10,11,14)
10200	RFABA:	R(16,17,18,19,22,23,24,20,21,25,26,15)
10300	RFABB:	R(25,26,27,28,16,17,18,22,23,20,21,15)
10400	RFABC:	R(25,26,27,28,22,23,24,16,17,20,21,15)
10500	RFABD:	R(25,26,27,28,22,23,24,20,21,16,17,15)
10600	
10700	FOR @$ QRN IN (T,B)
10800	{QRN$ATB:	0
10900		RFA$QRN$A
11000		RFA$QRN$C
11100		RFA$QRN$C
11200		RFA$QRN$B
11300		RFA$QRN$B
11400		RFA$QRN$B
11500		0
11600		0
11700		RFA$QRN$D
11800		RFA$QRN$D
11900		RFA$QRN$A
12000		RFA$QRN$A
12100		RFA$QRN$A
12200	}
12300	
12400	CTNAND:	XWD =15,=15
12500		BYTE (2)3,1,1,1,1,1,1,1,1,1,1,1,1,1,0
12600		FOO←637777777400
12700		FOR I←1,=13
12800	{	FOO+100
12900		FOO←((FOO⊗-2)+600000000000)&¬377
13000	}
13100		BYTE (2)3,2,2,2,2,2,2,2,2,2,2,2,2,2,2
13200	CTAND:	XWD 6,6
13300		BYTE (2)3,1,1,1,1,1
13400		BYTE (2)3,0,3,3,3,0
13500		BYTE (2)3,3,0,3,3,0
13600		BYTE (2)3,3,3,0,3,0
13700		BYTE (2)3,3,3,3,0,0
13800		BYTE (2)3,2,2,2,2,2
13900	CTINV:	XWD 3,3
14000		BYTE (2)3,1,0
14100		BYTE (2)3,0,1
14200		BYTE (2)3,2,2
14300	CTS64:	XWD =53,=14
14400	 RADIX 4
14500		313333330,,331110000
14600		331133330,,333330000
14700		333311130,,333330000
14800		333333330,,113330000
14900	  DEFINE R $(A,B)
15000	{FOR @D I1 IN (03,30)
15100	{FOR @E I2 IN (033,303,330)
α15200	{FOR @F I3 IN (03,30)
15300	{	3$A$DI1DEI2E31,,FI3F$B$0000
15400	}}}}
15500		R(0,333)
15600		R(3,033)
15700		R(3,303)
15800		R(3,330)
15900		322222232,,222220000
16000	
16100	RADIX =8
16200	CTF74:	XWD =16,7		;TYPE D???
16300		       ;I,C,D,R,S,Q,Q-
16400		BYTE (2)3,3,3,0,1,0,1
16500		BYTE (2)3,3,3,1,0,1,0
16600		BYTE (2)3,3,3,0,0,1,1
16700		BYTE (2)0,1,3,1,1,1,0
16800		BYTE (2)2,0,1,1,1,3,3
16900		BYTE (2)0,1,3,1,1,0,1
17000		BYTE (2)2,0,0,1,1,3,3
17100		BYTE (2)0,0,3,1,1,0,1
17200		BYTE (2)2,3,3,1,1,0,1
17300		BYTE (2)0,0,3,1,1,1,0
17400		BYTE (2)2,3,3,1,1,1,0
17500		BYTE (2)-d⊂λ\0,1,3,1,1,0,1
17600		BYTE (2)2,1,3,3,3,0,1
17700		BYTE (2)0,1,3,1,1,1,0
17800		BYTE (2)2,1,3,3,3,1,0
17900		BYTE (2)3,2,2,2,2,2,2
18000	CTH183:	XWD =9,7
18100		BYTE (2)3,0,3,0,0,0,0
18200		BYTE (2)3,0,3,0,1,0,1
18300		BYTE (2)3,0,3,1,0,0,1
18400		BYTE (2)3,0,3,1,1,1,0
18500		BYTE (2)3,1,3,0,0,0,1
18600		BYTE (2)3,1,3,0,1,1,0
18700		BYTE (2)3,1,3,1,0,1,0
18800		BYTE (2)3,1,3,1,1,1,1
18900		BYTE (2)3,2,2,2,2,2,2
19000	
19100	CTFF0:	CTFF01
19200		CTFF03
19300		CTFF02
19400		CTFF01
19500	CTFF01:	XWD =10,5			;********NAND GATE TYPE FF****???
19600		BYTE (2)3,0,3,1,3
19700		BYTE (2)3,3,0,3,1
19800		BYTE (2)3,0,1,1,0
19900		BYTE (2)3,1,0,0,1
20000		BYTE (2)3,0,0,1,1
20100		BYTE (2)0,1,1,0,1
20200		BYTE (2)2,3,3,0,1
20300		BYTE (2)0,1,1,1,0
20400		BYTE (2)2,3,3,1,0
20500		BYTE (2)3,2,2,2,2
20600	CTFF02:	XWD =12,5			;********NAND GATE TYPE FF****???
20700		BYTE (2)3,0,3,1,3
20800		BYTE (2)3,3,0,3,1
20900		BYTE (2)3,0,1,1,0
21000		BYTE (2)3,1,0,0,1
21100		BYTE (2)3,0,0,1,1
21200		BYTE (2)0,1,1,0,1
21300		BYTE (2)2,3,3,0,1
21400		BYTE (2)0,1,1,1,0
21500		BYTE (2)2,3,3,1,0
21600		BYTE (2)0,1,1,0,1
21700		BYTE (2)2,0,0,3,3
21800		BYTE (2)3,2,2,2,2
21900	CTFF03:	XWD =12,5			;********NAND GATE TYPE FF****???
22000		BYTE (2)3,0,3,1,3
22100		BYTE (2)3,3,0,3,1
22200		BYTE (2)3,0,1,1,0
22300		BYTE (2)3,1,0,0,1
22400		BYTE (2)3,0,0,1,1
22500		BYTE (2)0,1,1,0,1
22600		BYTE (2)2,3,3,0,1
22700		BYTE (2)0,1,1,1,0
22800		BYTE (2)2,3,3,1,0
22900		BYTE (2)0,1,1,1,0
23000		BYTE (2)2,0,0,3,3
23100		BYTE (2)3,2,2,2,2
23200	
23300	CTFF2:	XWD =196,=16
23400		BYTE (2)3,1,1,1,1,3,3,3,3,3,3,3,3,3,0,1
23500		BYTE (2)3,3,3,3,3,1,1,1,3,3,3,3,3,3,0,1
23600		BYTE (2)3,3,3,3,3,3,3,3,1,1,3,3,3,3,0,1
23700	 DEFINE FOO3 (A,B,C,D,O4,O5,INI,SL)
23800	{FOR I IN (<0,3,3,3>,<3,0,3,3>,<3,3,0,3>,<3,3,3,0>)
23900	{FOR J IN (<0,3,3>,<3,0,3>,<3,3,0>)
24000	{FOR K IN (<0,3>,<3,0>)
24100	{BYTE (2)INI,I,J,K,A,B,C,D,O4,O5
24200	IFDIF <SL>,<>,<BYTE (2)2,3,3,3,3,3,3,3,3,3,SL>
24300	}}}}
24400		FOO3(0,3,3,3,1,0,3)
24500		FOO3(3,0,3,3,1,0,3)
24600		FOO3(3,3,0,3,1,0,3)
24700		FOO3(3,3,3,0,1,0,3)
24800		FOO3(1,1,1,1,1,0,0,<3,3,3,3,1,0>)
24900		FOO3(1,1,1,1,0,1,0,<1,1,1,1,0,1>)
25000		BYTE (2)3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
25100	
25200	CTFF1:	CTFF11
25300		CTFF13
25400		CTFF12
25500		CTFF11
25600	
25700	CTFF11:	XWD =226,=29
25800	DEFINE FOO1 $(A,B,C,D)
25900	{	BYTE (2)A$0,3,3,3,3,3,3,3,3,3,3,3,3,B,C$D
26000		BYTE (2)A$3,0,3,3,3,3,3,3,3,3,3,3,3,B,C$D
26100		BYTE (2)A$3,3,0,3,3,3,3,3,3,3,3,3,3,B,C$D
26200		BYTE (2)A$3,3,3,0,3,3,3,3,3,3,3,3,3,B,C$D
26300		BYTE (2)A$3,3,3,3,0,3,3,3,3,3,3,3,3,B,C$D
26400		BYTE (2)A$3,3,3,3,3,0,3,3,3,3,3,3,3,B,C$D
26500		BYTE (2)A$3,3,3,3,3,3,0,3,3,3,3,3,3,B,C$D
26600		BYTE (2)A$3,3,3,3,3,3,3,0,3,3,3,3,3,B,C$D
26700		BYTE (2)A$3,3,3,3,3,3,3,3,0,3,3,3,3,B,C$D
26800		BYTE (2)A$3,3,3,3,3,3,3,3,3,0,3,3,3,B,C$D
26900		BYTE (2)A$3,3,3,3,3,3,3,3,3,3,0,3,3,B,C$D
27000		BYTE (2)A$3,3,3,3,3,3,3,3,3,3,3,0,3,B,C$D
27100		BYTE (2)A$3,3,3,3,3,3,3,3,3,3,3,3,0,B,C$D}
27200	DEFINE FOO2
27300	{FOO1(<3,>,1,0,<,1,1,1,1,1,1,1,1,1,1,1,1,1>)
27400	FOO1(<3,>,1,3,<,3,3,3,3,3,3,3,3,3,3,3,3,3>)
27500	FOO1(<3,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,>,0,0)
27600	FOO1(<3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,>,0,0)
27700	FOO1(<3,>,1,1,<,0,3,3,3,3,3,3,3,3,3,3,3,3>)
27800	FOO1(<3,>,1,1,<,3,0,3,3,3,3,3,3,3,3,3,3,3>)
27900	FOO1(<3,>,1,1,<,3,3,0,3,3,3,3,3,3,3,3,3,3>)
28000	FOO1(<3,>,1,1,<,3,3,3,0,3,3,3,3,3,3,3,3,3>)
28100	FOO1(<3,>,1,1,<,3,3,3,3,0,3,3,3,3,3,3,3,3>)
28200	FOO1(<3,>,1,1,<,3,3,3,3,3,0,3,3,3,3,3,3,3>)
28300	FOO1(<3,>,1,1,<,3,3,3,3,3,3,0,3,3,3,3,3,3>)
28400	FOO1(<3,>,1,1,<,3,3,3,3,3,3,3,0,3,3,3,3,3>)
28500	FOO1(<3,>,1,1,<,3,3,3,3,3,3,3,3,0,3,3,3,3>)
28600	FOO1(<3,>,1,1,<,3,3,3,3,3,3,3,3,3,0,3,3,3>)
28700	FOO1(<3,>,1,1,<,3,3,3,3,3,3,3,3,3,3,0,3,3>)
28800	FOO1(<3,>,1,1,<,3,3,3,3,3,3,3,3,3,3,3,0,3>)
28900	FOO1(<3,>,1,1,<,3,3,3,3,3,3,3,3,3,3,3,3,0>)
29000		BYTE (2)0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1
29100		BYTE (2)2,3,3,3,3,3,3,3,3,3,3,3,3,3,0,1,3,3,3,3,3,3,3,3,3,3,3,3,3
29200		BYTE (2)0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1
29300		BYTE (2)2,3,3,3,3,3,3,3,3,3,3,3,3,3,1,0,3,3,3,3,3,3,3,3,3,3,3,3,3}
29400	FOO2
29500		BYTE (2)3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
29600	
29700	CTFF12:	XWD =564,=29
29800	FOO2
29804	DEFINE FOO3(Q,NQ,FUD)
29808	{FOO1(<0,1,1,1,1,1,1,1,1,1,1,1,1,1,Q,NQ,1,1,1,1,1,1,1,1,1,1,1,1,1
29812	BYTE (2)2,>,3,3,<,FUD>)}
29816	DEFINE FOO4 (Q,NQ)
29820	{FOO3(Q,NQ,<0,3,3,3,3,3,3,3,3,3,3,3,3>)
29824	FOO3(Q,NQ,<3,0,3,3,3,3,3,3,3,3,3,3,3>)
29828	FOO3(Q,NQ,<3,3,0,3,3,3,3,3,3,3,3,3,3>)
29832	FOO3(Q,NQ,<3,3,3,0,3,3,3,3,3,3,3,3,3>)
29836	FOO3(Q,NQ,<3,3,3,3,0,3,3,3,3,3,3,3,3>)
29840	FOO3(Q,NQ,<3,3,3,3,3,0,3,3,3,3,3,3,3>)
29844	FOO3(Q,NQ,<3,3,3,3,3,3,0,3,3,3,3,3,3>)
29848	FOO3(Q,NQ,<3,3,3,3,3,3,3,0,3,3,3,3,3>)
29852	FOO3(Q,NQ,<3,3,3,3,3,3,3,3,0,3,3,3,3>)
29856	FOO3(Q,NQ,<3,3,3,3,3,3,3,3,3,0,3,3,3>)
29860	FOO3(Q,NQ,<3,3,3,3,3,3,3,3,3,3,0,3,3>)
29864	FOO3(Q,NQ,<3,3,3,3,3,3,3,3,3,3,3,0,3>)
29868	FOO3(Q,NQ,<3,3,3,3,3,3,3,3,3,3,3,3,0>)}
29900	FOO4(0,1)
30100	BYTE (2)3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
30200	CTFF13:	XWD =564,=29
30300	FOO2
30400	FOO4(1,0)
30600	BYTE (2)3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
30700	
30800	
30900	
31000	CTS04:	BYTE (6)1,1,2,2,3,1
31100		BYTE (6)4,2,5,1,6,2
31200		BYTE (6)9,1,8,2,=11,1
31300		BYTE (6)=10,2,=13,1,=12,2
31400		0
31500	
31600	CTS00:	BYTE (6) 1,1,2,2,3,=14
31700		BYTE (6) 4,1,5,2,6,=14
31800		BYTE (6) =10,1,=9,2,=8,=14
31900		BYTE (6) =13,1,=12,2,=11,=14
32000		0
32100	CTS133:	BYTE (6)1,1,2,2,3,3,4,4,5,5,6,6
32200		BYTE (6)7,7,=10,=10,=11,=11,=12,=12,=13,=13,=14,8
32300		BYTE (6)=15,=9,=9,=14
32400		0
32500	
32600	CTS10:	BYTE (6) 1,1,2,2,=13,3,=12,=14,3,1,4,2,5,3,6,=14,=11,1,=10,2,=9,3,=8,=14
32700		0
32800	CTS11:	BYTE (6)1,1,2,2,=13,3,=14,5,3,1,4,2,5,3,6,5,=11,1,=10,2,=9,3,=8,5
32900		0
33000	CTS20:	BYTE (6) 1,1,2,2,4,3,5,4,6,=14,=13,1,=12,2,=10,3,=9,4,=8,=14
33100		0
33200	
33300	CTS74:	BYTE (6)1,3,2,2,3,1,4,4,5,5,6,6
33400		BYTE (6)=8,6,=9,5,=10,4
33500		BYTE (6)=11,1,=12,2,=13,3
33600		0
33700	CTS112:	BYTE (6)1,3,2,5,3,4,4,1,5,6,6,7
33800		BYTE (6)7,7,=9,6,=10,1,=11,4,=12,5,=13,3
33900		BYTE (6)=14,2,=15,2
34000	
34100	CT153:	XWD =10,=15
34200		BYTE (2)3,1,3,3,3,3,3,0,3,3,3,3,3,3,3
34300		BYTE (2)3,0,0,3,3,3,0,0,3,3,3,3,3,3,0
34400		BYTE (2)3,0,0,3,3,3,1,1,3,3,3,3,3,3,0
34500		BYTE (2)3,0,0,3,3,0,3,0,3,3,3,3,3,3,1
34600		BYTE (2)3,0,0,3,3,1,3,1,3,3,3,3,3,3,1
34700		BYTE (2)3,0,1,3,0,3,3,0,3,3,3,3,3,3,0
34800		BYTE (2)3,0,1,3,1,3,3,1,3,3,3,3,3,3,0
34900		BYTE (2)3,0,1,0,3,3,3,0,3,3,3,3,3,3,1
35000		BYTE (2)3,0,1,1,3,3,3,1,3,3,3,3,3,3,1
35100		BYTE (2)3,2,2,2,3,3,3,2,3,3,3,3,3,3,2
35200	
35300	;JK FLIP-FLOPS
35400	CTF112:	XWD =24,=8
35500		BYTE(2)3,0,1,3,3,3,1,0
35600		BYTE(2)3,1,0,3,3,3,0,1
35700		BYTE(2)3,0,0,3,3,3,1,1
35800		BYTE(2)0,1,1,0,3,3,0,1
35900		BYTE(2)2,3,3,1,0,0,0,1
36000		BYTE(2)0,1,1,0,3,3,1,0
36100		BYTE(2)2,3,3,1,0,0,1,0
36200		BYTE(2)0,1,1,0,3,3,0,1
36300		BYTE(2)2,3,3,1,1,1,1,0
36400		BYTE(2)0,1,1,0,3,3,1,0
36500		BYTE(2)2,3,3,1,1,1,0,1
36600		BYTE(2)0,1,1,0,3,3,0,1
36700		BYTE(2)2,3,3,1,0,1,3,3
36800		BYTE(2)0,1,1,0,3,3,1,0
36900		BYTE(2)2,3,3,1,1,0,3,3
37000		BYTE(2)0,1,1,1,3,3,0,1
37100		BYTE(2)2,3,3,3,3,3,0,1
37200		BYTE(2)0,1,1,1,3,3,1,0
37300		BYTE(2)2,3,3,3,3,3,1,0
37400		BYTE(2)0,1,1,0,3,3,0,1
37500		BYTE(2)2,3,3,0,3,3,0,1
37600		BYTE(2)0,1,1,0,3,3,1,0
37700		BYTE(2)2,3,3,0,3,3,1,0
37800		BYTE(2)3,2,2,2,2,2,2,2
37900	
38000	S174ST:	XWD 3,5
38100		BYTE (6)0,2,3,0,0,-1
38200		BYTE (6)0,0,0,-1,0,0
38300		0
38400		BYTE (6)3,0,0,0,0,-1
38500		BYTE (6)0,0,0,-1,0,2
38600		0
38700		BYTE (6)0,0,0,0,0,-1
38800		BYTE (6)0,3,2,-1,0,0
38900		0
39000		BYTE (6)0,0,0,0,0,-1
39100		BYTE (6)2,0,0,-1,0,0
39200		BYTE (6)0,0,0,0,0,3
39300		BYTE (6)0,0,0,0,0,-1
39400		BYTE (6)0,0,0,-1,0,0
39500		BYTE (6)0,0,0,2,3,00
39600	
39700	S175ST:	XWD 3,3
39800		BYTE (6)3,4,0,0,0,-1
39900		BYTE (6)0,0,0,-1,0,2
40000		0
40100		BYTE (6)0,0,0,0,0,-1
40200		BYTE (6)4,3,2,-1,0,0
40300		0
40400		BYTE (6)0,0,0,0,0,-1
40500		BYTE (6)0,0,0,-1,0,0
40600		BYTE (6)0,0,0,2,3,4
40700	
40800	S157ST:	XWD 3,3
40900		BYTE (6)3,2,0,0,0,-1
41000		BYTE (6)0,0,0,0,0,4
41100		BYTE (6)0,0,0,-1,0,0
41200		BYTE (6)0,0,0,0,0,-1
41300		BYTE (6)0,2,3,4,0,00
41400		BYTE (6)0,0,0,-1,0,0
41500		BYTE (6)0,0,0,0,0,-1
41600		BYTE (6)4,0,0,0,0,0
41700		BYTE (6)0,0,0,-1,2,3
41800	
41900	CTS174:	BYTE (6)1,3,2,5,3,2,9,1,8,6,0,0
42000	CTS175:	BYTE (6)1,3,2,5,3,6,4,2,9,1,0,0
42100	CTS158:	BYTE (6)1,1,=15,2,2,3,3,4,4,5,0,0
42200	
42300	CTF157:	XWD 6,6
42400		;       I,A S I I O
42500		;       N D T 0 1
42600		BYTE (2)3,3,1,3,3,0
42700		BYTE (2)3,0,0,0,3,0
42800		BYTE (2)3,0,0,1,3,1
42900		BYTE (2)3,1,0,3,0,0
43000		BYTE (2)3,1,0,3,1,1
43100		BYTE (2)3,2,2,2,2,2
43200	
43300	CTF158:	XWD 6,6
43400		BYTE (2)3,3,1,3,3,1
43500		BYTE (2)3,0,0,0,3,1
43600		BYTE (2)3,0,0,1,3,0
43700		BYTE (2)3,1,0,3,0,1
43800		BYTE (2)3,1,0,3,1,0
43900		BYTE (2)3,2,2,2,2,2
44000	
44100	CTF151:	XWD =18,=16
44200		;       I D D D D O O S X C B A D D D D
44300		;       N 3 2 1 0 Y W T X       7 6 5 4
44400		BYTE (2)3,3,3,3,3,0,1,1,3,3,3,3,3,3,3,3
44500		BYTE (2)3,3,3,3,0,0,1,0,3,0,0,0,3,3,3,3
44600		BYTE (2)3,3,3,0,3,0,1,0,3,0,0,1,3,3,3,3
44700		BYTE (2)3,3,0,3,3,0,1,0,3,0,1,0,3,3,3,3
44800		BYTE (2)3,0,3,3,3,0,1,0,3,0,1,1,3,3,3,3
44900		BYTE (2)3,3,3,3,3,0,1,0,3,1,0,0,3,3,3,0
45000		BYTE (2)3,3,3,3,3,0,1,0,3,1,0,1,3,3,0,3
45100		BYTE (2)3,3,3,3,3,0,1,0,3,1,1,0,3,0,3,3
45200		BYTE (2)3,3,3,3,3,0,1,0,3,1,1,1,0,3,3,3
45300		BYTE (2)3,3,3,3,1,1,0,0,3,0,0,0,3,3,3,3
45400		BYTE (2)3,3,3,1,3,1,0,0,3,0,0,1,3,3,3,3
45500		BYTE (2)3,3,1,3,3,1,0,0,3,0,1,0,3,3,3,3
45600		BYTE (2)3,1,3,3,3,1,0,0,3,0,1,1,3,3,3,3
45700		BYTE (2)3,3,3,3,3,1,0,0,3,1,0,0,3,3,3,1
45800		BYTE (2)3,3,3,3,3,1,0,0,3,1,0,1,3,3,1,3
45900		BYTE (2)3,3,3,3,3,1,0,0,3,1,1,0,3,1,3,3
46000		BYTE (2)3,3,3,3,3,1,0,0,3,1,1,1,1,3,3,3
46100		BYTE (2)3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
46200	
     

00100	FNAM:	OUTSTR [ASCIZ/FILE = /]
00200		MOVEI B,
00300	FLOP1:	INCHWL C
00400		SUBI C,40
00500		CAIL C,100
00600		SUBI C,40
00700		CAIG C,17
00800		JRST FDON
00900		LSH B,6
01000		OR B,C
01100		JRST FLOP1
01200	FDON:	TLNE B,770000
01300		JRST .+4
01400		LSH B,6
01500		TLNN B,770000
01600		JRST .-2
01700		MOVEM B,(A)
01800		ADDI C,40
01900		CAIN C,15
02000		INCHWL C
02100		POPJ P,
02200	MATCH:	MOVE D,TYPTB1(C)
02300		CAME A,(D)
02400		JRST NOMAT
02500		TRNN A,376
02600		POPJ P,
02700		CAME B,1(D)
02800		JRST NOMAT
02900		POPJ P,
03000	NOMAT:	AOS (P)
03100		SKIPE (D)
03200		AOS (P)
03300		POPJ P,
03400	
03500	WRD:	SOSG DIB+2
03600		INPUT 1,
03700		ILDB B,DIB+1
03800		POPJ P,
03900	
04000	NOFST:	0
04100		PUSH P,A
04200		MOVE A,JOBREL
04300		ADDI A,1
04400		MOVEM A,FSTPNT
04500		ADDI A,1777
04600		CALLI A,11
04700		JRST NOCOR
04800		MOVE A,FSTPNT
04900		ADDI A,2
05000		MOVEM A,-2(A)
05100		CAMGE A,JOBREL
05200		JRST .-3
05300		SETZM -2(A)
05400		MOVE A,NOFST
05500		SUBI A,2
05600		EXCH A,(P)
05700		POPJ P,
05800	
05900	HGFIND:	HRLZS A		;GET HELLIWELLS GATE # IN LEFT
06000		MOVEI D,777	;START AT END OF TABLE
06100	HGLOP1:	CAML A,HTYPS(D)	;SEARCH BACK UNTIL TABLE IS LESS THAN WHAT WE HAVE
06200		JRST HFND1	;OK, GO THERE
06300		SUBI D,10
06400		JRST HGLOP1
06500	HFND1:	HLLZ E,HTYPS(D)	;GET TABLE ENTRY
06600		CAME E,A	;SEARCH FORWARD FOR EQUAL ENTRY
06700		AOJA D,HFND1
06800		POPJ P,
06900	
07000	LRET:	HRRZ B,A
07100	LRLP1:	SKIPN A,B
07200		POPJ P,
07300		HRRZ B,(A)
07400		FSTRET (A)
07500		JUMPN B,LRLP1
07600		POPJ P,
07700	
07800	;LCOM:	COMPARE TWO LISTS. SKIP IF LISTS CONTAIN ALL THE SAME ELEMENTS (IGNORE ORDER)
07900	LCOM:	EXCH A,B	;SWITCH LISTS
08000		MOVE C,B	;B IS USED FOR ELEMENTS, HOLD LIST IN C
08100		PUSH P,B	;SAVE B LIST
08200	LCLOP1:	TRNN C,-1
08300		JRST LD1	;LIST EXHAUSTED
08400		MOVE B,1(C)	;GET NEXT ELEMENT
08500		PUSHJ P,LECONT	;IS IT IN LIST A?
08600		JRST LNO1	;NO, NO EQUAL
08700		MOVE C,(C)	;GET NEXT
08800		JRST LCLOP1
08900	LD1:	EXCH A,(P)	;SWITCH LISTS
09000		MOVE C,(P)
09100	LCLOP2:	TRNN C,-1
09200		JRST LD2	;LIST EXHAUSTED
09300		MOVE B,1(C)	;GET NEXT ELEMENT
09400		PUSHJ P,LECONT	;IS IT IN LIST A?
09500		JRST LNO2
09600		MOVE C,(C)
09700		JRST LCLOP2	;GET NEXT
09800	LD2:	POP P,B		;EQUAL, RESTORE POINTERS
09900		AOS (P)		;SKIP
10000		POPJ P,
10100	LNO1:	MOVE B,A	;RESTORE POINTERS
10200		POP P,A		;...
10300		POPJ P,		;NOT EQUAL, RETURN
10400	LNO2:	POP P,B		;RESTORE POINTERS
10500		POPJ P,
10600	
10700	LECONT:	PUSH P,A	;SAVE POINTER
10800		TRNN A,-1
10900		JRST LEDON	;LIST EXHAUSTED
11000		CAMN B,1(A)	;IS THIS ELEMENT EQUAL?
11100		JRST LFND	;YES
11200		MOVE A,(A)	;NO, TRY NEXT
11300		JRST LECONT+1	;LOOP
11400	LEDON:	POP P,A		;RESTORE POINTER
11500		POPJ P,		;NOT EQUAL
11600	LFND:	POP P,A
11700		AOS (P)
11800		POPJ P,
11900	
12000	LEPUT:	;PUT AN ELEMENT (IN B) INTO A LIST (IN A)
12100		PUSHJ P,LECONT	;IS IT ALREADY IN THE LIST?
12200		JRST .+2	;NO
12300		POPJ P,		;YES, LEAVE
12400	LEPUT1:	GETFS (C)
12500		EXCH A,(C)	;GET NEW FSTPNT AND DEPOSIT PNTR TO REST OF LIST
12600		EXCH A,FSTPNT	;DEPOSIT NEW FSTPNT AND GET POINTER TO NEW HEAD OF LIST
12700		MOVEM B,1(A)	;DEPOSIT ELEMENT
12800		POPJ P,
12900	
13000	;LCOP:	MAKES, IN A, A COPY OF THE LIST IN D
13100	LCOP:	MOVEI A,
13200		JUMPE D,CPOPJ
13300		GETFST (A,C)
13400		PUSH P,D
13500		MOVE T,A
13600	LCLP1:	MOVE C,1(D)
13700		MOVEM C,1(T)
13800		HRRZ D,(D)
13900		JUMPE D,LCLP2
14000		GETFST (T1,T2)
14100		HRRZM T1,(T)
14200		MOVE T,T1
14300		JRST LCLP1
14400	LCLP2:	SETZM (T)
14500		POP P,D
14600		POPJ P,
14700	
14800	GDRV:	JRST @.+1
14900		GDST
15000		POPJ P,
15100	GDE:	JSR GDRV+1
15200	GDST:	HRRZ H,MTYPS(G)
15300		JUMPE  H,GDDN1
15400	GLP2:	HRRZ J,1(H)
15500		JUMPE J,GDDN2
15600	GLP1:	HRRZ B,1(J)
15700		JUMPE B,.+2
15800		JSR GDRV+1
15900		HRRZ J,(J)
16000		JUMPN J,GLP1
16100	GDDN2:	HRRZ H,(H)
16200		JUMPN H,GLP2
16300	GDDN1:	MOVEI B,
16400		JRST GDE
16500	GDRV2:	PUSHJ P,GDRV
16600		JUMPE B,CPOPJ
16700		PUSHJ P,LECONT
16800		JRST GDRV2	;NO
16900	CPOPJ:	POPJ P,		;YES
17000	GDRV1:	JRST @.+1
17100		GD1ST
17200		POPJ P,
17300	GDE1:	JSR GDRV1+1
17400	GD1ST:	PUSHJ P,GDRV2
17500		JUMPE B,GDNONE
17600		MOVEM B,GDSAV#
17700	GLP3:	PUSHJ P,GDRV2
17800		JUMPE B,GDDN3
17900		JSR GDRV1+1
18000		JRST GLP3
18100	GDDN3:	MOVE B,GDSAV
18200		HRLI B,-1
18300	GDNONE:	JRST GDE1
18400	
18500	MAKLP:	GETFST (A,C)
18600		MOVEM F,(A)
18700		MOVE F,A
18800		GETFST (A,C)
18900		HRRZM A,1(F)
19000		SETZM (A)
19100		MOVEM B,1(A)
19200	MKLP3:	SETZM DIDSW#
19300		MOVE Q,F	;GET CURRENT LOOP LIST
19400	MKLP2:	SKIPGE D,1(Q)	;THIS ONE DONE?
19500		JRST TDON1	;YES
19600		MOVE A,E
19700		HRRZ G,1(D)	;GET END-SO-FAR GATE
19800	MKLP1:	PUSHJ P,GDRV1	;GET ONE OF THE GATES DRIVEN BY IT
19900		JUMPE B,ERR1	;NONE?
20000		SETOM DIDSW
20100		JUMPL B,MKLAST	;LAST ONE?
20200		PUSHJ P,LCOP	;NO, MAKE COPY OF THIS LOOP
20300		PUSHJ P,LEPUT1	;PUT NEW THING IN IT
20400		GETFST (B,C)
20500		MOVEM F,(B)	;PUT NEW LIST ON LIST
20600		HRRZM A,1(B)	;...
20700		MOVE F,B
20800		HRRZ B,1(A)	; GET NEWEST ELEMENT
20900		HRRZ A,(A)	;GET REST OF LIST
21000		PUSHJ P,LECONT	;IS LOOP CLOSED?
21100		SKIPA		;NO
21200		HRROS 1(F)	;YES, MARK AS DONE
21300		MOVE A,E
21400		JRST MKLP1
21500	MKLAST:	MOVE A,D
21600		HRRZS B
21700		PUSHJ P,LEPUT1	;PUT NEW THIN INTO LIST
21800		HRRZM A,1(Q)	;UPDATE LIST POINTER
21900		HRRZ A,(A)	;GET REST OF LIST
22000		PUSHJ P,LECONT	;IS LOOP CLOSED?
22100		SKIPA		;NO
22200		HRROS 1(Q)	;YES, MARK AS DONE
22300	MKLP4:	HRRZ Q,(Q)	;GO TO NEXT LIST
22400		JUMPN Q,MKLP2	;LOOP
22500	MKLP5:	SKIPE DIDSW	;DID WE UPDATE ANYTHING?
22600		JRST MKLP3	;YES, TRY AGAIN
22700		HRLI C,-2	;NO, MARK AS ALL DONE
22800		HLLM C,1(F)
22900		POPJ P,
23000	TDON1:	TLNE D,1	;THIS ONE ONLY OR ALL BEYOND HERE DONE?
23100		JRST MKLP4	;THIS ONE ONLY DONE, TRY SOME MORE
23200		JRST MKLP5	;ALL BEYOND HERE DONE, TRY AGAIN.
23300	
23400	ERR1:	OUTSTR [ASCIZ /THERE IS A GATE WHO DRIVES NO-ONE IN THE LIST
23500	OF GATES WHO DRIVE SOMEONE/]
23600		JRST 4,.
23700	
23800	ISINLP:	MOVE D,F
23900		HRRZ A,1(D)
24000		PUSHJ P,LECONT
24100		JRST .+3
24200		AOS (P)
24300		POPJ P,
24400		HRRZ D,(D)
24500		JUMPN D,ISINLP+1
24600		POPJ P,
24700	
24800	LEQ:	MOVE D,B
24900	LOPP1:	MOVE G,1(D)
25000		CAME G,1(C)
25100		POPJ P,
25200		HRRZ D,(D)
25300		HRRZ C,(C)
25400		JUMPE D,.+3
25500		JUMPN C,LOPP1
25600		POPJ P,
25700		SKIPN C
25800		AOS (P)
25900		POPJ P,
26000	ANYEQ:	JUMPE A,CPOPJ
26100		PUSH P,A
26200	AEQL1:	HRRZ C,1(A)
26300		PUSHJ P,LEQ	;LISTS EQUAL?
26400		JRST AEQN1	;NO
26500		POP P,A		;YES
26600	CPOPJ1:	AOS (P)
26700		POPJ P,
26800	AEQN1:	HLRZ G,1(A)	;GET LENGTH
26900		CAIE G,2	;=2?
27000		JRST AEQN2	;NO
27100		HRRZ C,1(A)
27200		MOVE G,1(C)	;GET FIRST ELEMENT
27300		MOVE C,(C)
27400		MOVE C,1(C)	;GET SECOND ELEMENT
27500		CAME C,1(B)	;FIRST = SECOND?
27600		JRST AEQN2	;NO
27700		HRRZ D,(B)
27800		CAME G,1(D)	;SECOND = FIRST?
27900		JRST AEQN2	;NO
28000		POP P,A
28100		AOS (P)
28200		POPJ P,
28300	AEQN2:	HRRZ A,(A)
28400		JUMPN A,AEQL1
28500		POP P,A
28600		POPJ P,
28700	
28800	CONSOL:	MOVE D,F
28900	CSLOP1:	HRRZ G,1(D)	;GET A LOOP
29000		MOVEI T,1	;INI COUNT
29100		HRRZ H,1(G)	;GET FIRST GATE (LOOP CLOSING)
29200		MOVE A,G
29300		MOVE G,A
29400		HRRZ A,(G)
29500		CAME H,1(A)	;END OF LOOP?
29600		AOJA T,.-3	;NO
29700		SETZM (G)
29800		PUSHJ P,LRET	;RETURN END OF LIST TO FREE STRG.
29900		HRLM T,1(D)	;DEPOSIT COUNT
30000		HRRZ  D,(D)	;GET NEXT LOOP
30100		JUMPN D,CSLOP1
30200		MOVEI A,	;INIT NEW LIST
30300	CSLOP2:	MOVE B,1(F)	;GET NEXT LOOP
30400		PUSHJ P,ANYEQ	;IS IT ALREADY IN "A" LIST?
30500		JRST [PUSHJ P,LEPUT1  ;NO, PUT IT IN
30600			JRST CSCN1]
30700		PUSH P,A
30800		MOVE A,B
30900		PUSHJ P,LRET
31000		POP P,A
31100	CSCN1:	HRRZ C,(F)
31200		FSTRET (F)
31300		MOVE F,C
31400		JUMPN F,CSLOP2
31500		MOVE F,A
31600		POPJ P,
31700	
31800	IFN PRTSW,
31900	{PRT:	INIT 5,1
32000		SIXBIT /LPT/
32100		XWD LOB,0
32200		JRST 4,.
32300		MOVE Q,JOBFF
32400		MOVEI T1,PRTBUF
32500		MOVEM T1,JOBFF
32600		OUTBUF 5,1
32700		
32800		DEFINE PRTC (A)
32900	{	MOVEI T1,A
33000		PUSHJ P,PRT101}
33100		DEFINE PRTCRL
33200	{	PRTC (15)
33300		PRTC (12)}
33400	
33500		MOVEI A,777
33600	PRTL2:	MOVE T,A
33700		PUSHJ P,PRTOCT
33800		PRTC (40)
33900		PUSHJ P,PRT101
34000		HLRZ T,MTYPS(A)
34100		PUSHJ P,PRTOCT
34200		PRTC (11)
34300		HRRZ T1,HTYPS(A)
34400		HRRZ T,TYPTB1(T1)
34500		PUSHJ P,PRTASC
34600		PRTCRL
34700		SUBI A,1
34800		SKIPE HTYPS(A)
34900		JRST PRTL2
35000		PRTCRL
35100		MOVE A,CEPNUM
35200		SOJL A,PRTNI
35300	PRTL1:	HLRZ T,CEPINS(A)
35400		PRTC ("P")
35500		ADDI T,404020
35600		PRTC (<"(">)
35700		PUSHJ P,PRTSIX
35800		PRTC (<")">)
35900		PRTC (40)
36000		PUSHJ P,PRT101
36100		HRRZ T,CEPPIN(A)
36200		PUSHJ P,PRTOCT
36300		PRTC (11)
36400		HRRZ B,CEPINS(A)
36500		PUSHJ P,PRTIL
36600		PRTCRL
36700		SOJGE A,PRTL1
36800		PRTCRL
36900	PRTNI:	PRTCRL
37000		MOVEI A,777
37100	PRTL3:	HRRZ D,MTYPS(A)
37200		JUMPE D,PRTNO
37300	PRTL4:	MOVE T,A
37400		PUSHJ P,PRTOCT
37500		PRTC(<",">)
37600		HLRZ T,1(D)
37700		PUSHJ P,PRTDEC
37800		PRTC (40)
37900		PUSHJ P,PRT101
38000		HLRZ T,(D)
38100		PUSHJ P,PRTOCT
38200		PRTC (11)
38300		HRRZ B,1(D)
38400		PUSHJ P,PRTIL
38500		PRTCRL
38600		HRRZ D,(D)
38700		JUMPN D,PRTL4
38800	PRTNN:	PRTCRL
38900		SUBI A,1
39000		SKIPE HTYPS(A)
39100		JRST PRTL3
39200		RELEAS 5,
39300		MOVEM Q,JOBFF
39400		POPJ P,
39500	PRTNO:	MOVE T,A
39600		PUSHJ P,PRTOCT
39700		MOVEI T,[ASCIZ /, NO USED OUTPUTS/]
39800		PUSHJ P,PRTASC
39900		JRST PRTNN
40000	
40100	LOB:	BLOCK 3
40200	PRTBUF:	BLOCK 500
40300	
40400	  DEFINE PRTR $(ARG)
40500	{PRT$ARG: JUMPE T,PRTZER
40600		IDIVI T,ARG
40700		JUMPE T,.+4
40800		HRLM T1,(P)
40900		PUSHJ P,PRT$ARG
41000		HLRZ T1,(P)
41100		ADDI T1,60
41200	PRT$ARG$1: SOSG LOB+2
41300		OUTPUT 5,
41400		IDPB T1,LOB+1
41500		POPJ P,}
41600	PRTOCT:
41700		PRTR(10)
41800	PRTDEC:
41900		PRTR (12)
42000	PRTSIX:	JUMPE T,CPOPJ
42100		MOVEI T1,
42200		ROTC T,6
42300		JUMPE T1,PRTSIX
42400		ADDI T1,40
42500		PUSHJ P,PRT101
42600		JRST PRTSIX
42700	PRTASC:	HRLI T,440700
42800		ILDB T1,T
42900		JUMPE T1,CPOPJ
43000		PUSHJ P,PRT101
43100		JRST PRTASC+1
43200	PRTZER:	PRTC("0")
43300		POPJ P,
43400	PRTIL:	JUMPE B,CPOPJ
43500		HRRZ T,1(B)
43600		JUMPN T,PRTA1
43700		PRTC ("P")
43800		PRTC (<"(">)
43900		HLRZ T,1(B)
44000		ADDI T,404020
44100		PUSHJ P,PRTSIX
44200		PRTC (<")">)
44300		JRST PRTA2
44400	PRTA1:	PUSHJ P,PRTOCT
44500		PRTC(<",">)
44600		HLRZ T,1(B)
44700		PUSHJ P,PRTDEC
44800	PRTA2:	HRRZ B,(B)
44900		JUMPE B,CPOPJ
45000		PRTC (<";">)
45100		PRTC (40)
45200		JRST PRTIL+1
45300	}
45400	
45500	;REPLAC:	REPLACES ALL REFERENCES TO ONE GATE WITH ANOTHER
45600		;CALL WITH:  GATE # IN D, REPL TYPE IN E, TABLE PNTR IN F.
45700	
45800	REPLAC:	SETZM SEENSW#
45900		MOVE G,CEPNUM
46000		SOJL G,CEDON1	;NO DIRECT INPUT PINS?
46100		HRRZ A,CEPINS(G);GET LIST OF INPUT
46200		PUSHJ P,DOREPL	;CHECK AND REPLACE
46300		SOJGE G,.-2
46400	CEDON1:	MOVEI G,777
46500	RLOPP2:	SKIPN HTYPS(G)	;DONE?
46600		JRST RDON1	;YES
46700		HRRZ H,MTYPS(G)	;GET OUTPUT POINTER
46800		JUMPE H,RDON2	;NONE?
46900	RLOPP1:	HRRZ A,1(H)	;GET LIST OF INPUTS
47000		PUSHJ P,DOREPL	;DO THE REPLACE
47100		HRRZ H,(H)	;GET NEXT OUTPUT
47200		JUMPN H,RLOPP1	;LOOP
47300	RDON2:	SOJA G,RLOPP2
47400	RDON1:	HRRZ H,MTYPS(D)	;GET OUTPUT LIST FOR GATE TO REPLACE
47500		MOVEI G,MTYPS(D);POINTER TO POINTER
47600		JUMPE H,RDON3
47700	RLOPP3:	HLRZ T,1(H)	;GET OUTPUT PIN #
47800		PUSHJ P,MAKBP	;MAKE BYTE POINTER
47900		LDB T,T1	;GET REPLACEMENT PIN #
48000		JUMPE T,NORO	;DON'T REPLACE THIS ONE IF REPL. PIN # IS 0
48100		SKIPN SEENSW	;HAS A PLACE BEEN MADE?
48200		PUSHJ P,MAKPLC	;NO, MAKE ONE
48300		HRRZ Q,MTYPS(C)	;GET NEW OUTPUT POINTER LIST
48400		EXCH Q,(H)	;PUT INTO NEW LIST AND REMOVE FROM OLD
48500		HLLM Q,(H)	;...
48600		HRRM H,MTYPS(C)	;...
48700		HRRM Q,(G)	;...
48800		HRLM T,1(H)	;PUT IN NEW PIN #
48900		HRRZ H,(G)	;GET NEXT POINTER
49000		JUMPN H,RLOPP3
49100	RDON3:	POPJ P,
49200	NORO:	MOVE G,H
49300		HRRZ H,(G)
49400		JUMPN H,RLOPP3
49500		POPJ P,
49600	MAKPLC:	SETOM SEENSW
49700		MOVE C,D
49800		SKIPE HTYPS(C)	;FIND A PLACE
49900		SOJA C,.-1
50000		HRROM E,HTYPS(C)
50100		SETZM MTYPS(C)
50200		POPJ P,
50300	MAKBP:	SUBI T,1
50400		IDIVI T,6
50500		IMULI T1,6
50600		ROT T1,-6
50700		TLO T1,600+T
50800		OR T1,F
50900		POPJ P,
51000	DOREPL:	JUMPE A,CPOPJ
51100		HRRZ T,1(A)	;GET GATE #
51200		CAMN T,D	;IS IT THE ONE?
51300		JRST DRYES	;YES
51400	DRCON:	HRRZ A,(A)	;GET NEXT
51500		JUMPN A,DOREPL+1
51600		POPJ P,
51700	DRYES:	HLRZ T,1(A)	;GET PIN #
51800		PUSHJ P,MAKBP	;MAKE A BYTE POINTER
51900		LDB T,T1	;GET REPLACEMENT PIN #
52000		JUMPE T,DRCON	;DON'T REPLACE IF 0
52100		CAIE T,77	;IS IT -1?
52200		JRST DRC1	;NO
52300		GETFST (T1,T)
52400		MOVE T,(A)	;YES, MAKE NEW ENTRY AND INSTERT IT
52500		MOVEM T,(T1)	;...
52600		HRRM T1,(A)	;...
52700		HLRZ T,1(A)	;GET PIN #
52800		HRRZ A,T1	;GET POINTER TO NEW ENTRY
52900	DRC1:
53000		HRLM T,1(A)	;DEPOSIT NEW PIN #
53100		SKIPN SEENSW	;IS THERE A PLACE?
53200		PUSHJ P,MAKPLC	;NO, MAKE ONE
53300		HRRM C,1(A)	;DEPOSIT NEW GATE #
53400		JRST DRCON
53500	
53600	REMOUT:	HRRZ C,MTYPS(T1);GET T1 OUTPUT LIST
53700		SKIPE (C)	;MORE THAN ONE OUTPUT?
53800		JRST ERR2	;YES
53900		MOVEI G,1(C)
54000		HRRZ H,1(C)	;POINTER TO INPUT LIST
54100		JUMPE H,CPOPJ
54200	RELP:	HRRZ Q,1(H)	;GET GATE #
54300		CAIE Q,(T)	;SAME GATE AS T?
54400		JRST RENO	;NO
54500		HLL T,1(H)	;YES, SAVE PIN #
54600		HRRZ Q,(H)
54700		HRRM Q,(G)	;UNLINK THIS ONE
54800		FSTRET (H)
54900		MOVE H,Q	;GO TO NEXT INPUT
55000		JRST .+3
55100	RENO:	MOVE G,H	;GO TO NEXT
55200		HRRZ H,(H)
55300		JUMPN H,RELP	;DONE?
55400		HRRZ G,1(C)	;YES, ANY INPUTS LEFT?
55500		JUMPN G,CPOPJ	;YES
55600		HLLZS MTYPS(T1)	;NO, REMOVE PINTER
55700		POPJ P,
55800	ERR2:	OUTSTR [ASCIZ /GATE WITH MORE THAN ONE OUTPUT
55900	/]
56000		JRST 4,.
56100	
56200	NOENT:	OUTSTR [ASCIZ /CAN'T ENTER FILE
56300	/]
56400		JRST EC1
56500	NOLUP:	OUTSTR [ASCIZ /CAN'T FIND INPUT FILE
56600	/]
56700		JRST STRT
56800	NOCOR:	OUTSTR [ASCIZ /CAN'T GET ENOUGH CORE
56900	TYPE ANY KEY TO TRY AGAIN
57000	/]
57100		INCHRW
57200		JRST NOFST+2
57300	
57400	FCHK:	HRRZ T,1(A)	;GET GATE #
57500		HRRZ T1,HTYPS(T);GET TYPE
57600		MOVE T2,TYPTB3(T1);GET FLAGS
57700		TLNE T2,FFBIT	;IS IT A FF
57800		POPJ P,		;YES, RETURN
57900		HRRZ A,(A)	;GO TO NEXT ELEMENT
58000		JUMPN A,FCHK	;LOOP
58100		OUTSTR [ASCIZ /ILLEGAL LOOP IN THIS DRWG.
58200	I CONTINUE ANYWAY.....
58300	/]
58400		POPJ P,
58500	
58600	WOUT:	SOSG DOB+2
58700		OUTPUT 2,
58800		IDPB Q,DOB+1
58900		POPJ P,
59000	
59100	GMJW1:	AOS (P)
59200		HRRZ E,1(D)	;GET GATE #
59300		JUMPE E,.+3	;CE PIN?
59400		HLLZ E,MTYPS(E)	;GET MJW #
59500		POPJ P,
59600		HRRZ D,(D)	;CE PIN, IGNORE
59700		JUMPN D,GMJW1+1
59800		SOS (P)
59900		POPJ P,
60000	
60100	MIGAT:	MOVSS E
60200		EXCH Q,IGRF(E)	;GET CURRENT ENTRY FOR GATE
60300		JUMPE Q,.+4	;NONE SO FAR?
60400		PUSHJ P,WOUT	;OUTPUT CURRENT THING
60500		HRRZ Q,C	;GET LINK
60600		ADDI C,1
60700		HRL Q,A
60800		EXCH Q,IGRF(E)
60900		MOVSS E
61000		POPJ P,
61100	
61200	GBP:	SUBI J,1
61300		IDIVI J,=18	;CONV TO BYTE POINTER
61400		HRLI J,200
61500		ADD J,WB#
61600		LSH J1,1
61700		MOVNS J1	;...
61800		ADDI J1,=34
61900		DPB J1,[POINT 6,J,5];...
62000		POPJ P,
62100	
62200	NOU:	SOJLE T1,.+3
62300		IBP E
62400		SOJG T1,.-1
62500	NOU2:	SETZM SKPFLG
62600		MOVE T1,WB	;GET INIT BYTE
62700		HRLI T1,420200	;...
62800		LDB T1,T1	;...
62900		JUMPN T1,.+2	;INIT FOLLOWS?
63000		SETOM SKPFLG#	;YES, SKIP IT TOO
63100		PUSHJ P,MCLR
63200		JRST FWL11
63300	
63400	MOUT:	MOVE T1,WB
63500		HRLI T1,420200
63600		LDB T1,T1
63700		JUMPE T1,MOUTL1
63800		PUSH P,T
63900		MOVEI T1,WBUF
64000	MOUTL2:	MOVE Q,(T1)
64100		PUSHJ P,WOUT
64200		ADDI T1,1
64300		SOJG T,MOUTL2
64400		CAMLE T1,WB
64500		JRST .+3
64600		MOVE T,(P)
64700		JRST MOUTL2
64800		POP P,T
64900	MCLR:	MOVEI T1,WBUF
65000		MOVEM T1,WB
65100		POPJ P,
65200	MOUTL1:	ADDM T,WB
65300		POPJ P,
65400	
65500	HEDO:	MOVEI E,
65600		PUSH P,[0]
65700		MOVEI C,1
65800	HED5:	HRRZ D,1(B)	;GET FIRST ENTRY IN NODE
65900		JUMPE D,HED4
66000	HED3:	HRRZ F,HTYPS(D)	;GET GATE TYPE
66100		MOVE F,TYPTB3(F);GET FLAGS
66200		TLNE F,FFSTP	;STOP HERE?
66300		JRST HED1	;YES
66400		TLNN F,FFG1+FFG2;A FF WE ARE LOOKING FOR?
66500		JRST HED2	;NO
66600		GETFST (Q,G)
66700		MOVEM E,(Q)
66800		MOVE E,Q
66900		HLRZ Q,1(B)
67000		MOVEI G,1
67100		TLNE F,FFG2
67200		MOVEI G,=14
67300		HRLI D,1
67400		CAMG Q,G
67500		HRLI D,
67600		MOVEM D,1(E)
67700		HRLM C,(E)
67800		JRST HED1
67900	HED2:	HRL D,C	;GET LEVEL COUNT
68000		PUSH P,D
68100	HED1:	HRRZ F,(B)
68300		SKIPE B,F
68400		JRST HED5
68500	HED4:	POP P,D
68600		JUMPE D,HEDS
68700		HLRZ C,D
68800		ADDI C,1
68900		HRRZ B,MTYPS(D)
69000		JUMPE B,HED4
69100		HRRZ B,1(B)
69200		JRST HED5
69300	HEDS:	JUMPE E,CPOPJ
69400		PUSH P,E
69500		SKIPN 1(E)
69600		JRST HED13
69700		SETZB H,J
69800		SETZB F,G
69850		HRRZ D,1(E)
69900	HED12:	MOVE C,1(E)
70100		CAIE D,(C)
70200		JRST HED10
70250		SETZM 1(E)
70300		HLRZ Q,(E)
70400		TLNN C,1
70500		JRST HED8
70600		JUMPE H,HED9
70700		CAMGE Q,H
70800		MOVE H,Q
70900		CAMLE Q,J
71000		MOVE J,Q
71100		JRST HED10
71200	HED9:	MOVE H,Q
71300		MOVE J,Q
71400		JRST HED10
71500	HED8:	JUMPE F,HED11
71600		CAMGE Q,F
71700		MOVE F,Q
71800		CAMLE Q,G
71900		MOVE G,Q
72000		JRST HED10
72100	HED11:	MOVE G,Q
72200		MOVE F,Q
72300	HED10:	HRRZ E,(E)
72400		JUMPN E,HED12
72500		JUMPE H,HED13
72600		JUMPE F,HED13
72700		MOVEI Q,
72800		CAMGE J,F
72900		MOVEI Q,1
73000		CAMGE G,H
73100		MOVEI Q,2
73200		ORM Q,QTYPS(D)
73300	HED13:	POP P,E
73400		HRRZ F,(E)
73500		FSTRET (E)
73600		MOVE E,F
73700		JUMPN E,HEDS
73800		POPJ P,
73900	
     

00100	ST:	PUSHJ P,WRD
00200		JUMPE B,STDON
00300		MOVE A,B
00400		MOVEI B,
00500		TRNE A,376
00600		PUSHJ P,WRD
00700		MOVEI C,0
00800	LOP1:	PUSHJ P,MATCH
00900		JRST MAT1
01000		JRST NOTHER
01100		AOJA C,LOP1
01200	MAT1:	PUSHJ P,WRD
01300		MOVSS B
01400		HRR B,C
01500		MOVEI C,HTYPS+777
01600	LOP2:	CAML B,(C)
01700		JRST FND1
01800		SUBI C,10
01900		JRST LOP2
02000	FND1:	CAMLE B,(C)
02100		AOJA C,FND1
02200		CAMN B,(C)
02300		JRST STQ
02400		MOVE D,[XWD HTYPS+1,HTYPS]
02500		BLT D,-2(C)
02600		MOVEM B,-1(C)
02700	STQ:	PUSHJ P,WRD
02800		JRST ST
02900	NOTHER:	OUTSTR [ASCIZ /UNKNOWN GATE ID: /]
03000		OUTSTR A
03100		JRST 4,.
03200	STDON:	
03300	SLOP1:	SETZM GOTOP#
03400		SETZM GOTPIN#
03500		MOVEI H,	;INIT LIST POINTER
03600		GETFST (C,D)
03700	SLOP2:	PUSHJ P,WRD
03800		JUMPE B,SDON1
03900		HLRE A,B	;GET HELLIWELLS GATE NAME
04000		JUMPLE A,ITEPIN	;JUMP IF EDGE CON. PIN
04100		PUSHJ P,HGFIND	;GET MY GATE NAME
04200		HRRZ E,HTYPS(D)	;GET TYPE ENTRY FOR GATE
04300		MOVE F,[XWD 100+E,TYPTB2];GET BYTE POINTER INTO TYPE TABLE
04400		DPB B,[POINT 6,F,5];DEPOSIT POSITION FIELD (PIN #)
04500		LDB F,F		;GET ENTRY
04600		JUMPN F,ITOUT	;JUMP IF OUTPUT PIN
04700	SCON1:	GETFST (F,G)
04800		HRRM D,1(F)	;DEPOSIT GATE #
04900		HRLM B,1(F)	;DEPOSIT PIN #
05000		MOVEM H,(F)	;DEPOSIT POINTER TO WHAT WE HAVE SO FAR
05100		MOVE H,F	;NEW POINTER TO LIST
05200		JRST SLOP2	;GET NEXT ENTRY
05300	ITOUT:	MOVE A,MTYPS(D)	;GET CURRENT OUTPUT PIN LIST FOR THIS GATE
05400		SETOM GOTOP	;SET OUTPUT FLAG
05500		GETFST (F,G)
05600		MOVEM C,1(F)	;DEPOSIT POINTER TO LIST WE WILL HAVE AT END
05700		MOVEM F,MTYPS(D);DEPOSIT POINTER TO NEW START OF OUTPUT PIN LIST
05800		MOVEM A,(F)	;DEPOSIT POINTER TO REST OF LIST
05900		HRLM B,1(F)	;DEPOSIT PIN #
06000		JRST SLOP2	;GET NEXT ENTRY
06100	ITEPIN:	SKIPE GOTPIN	;GOT AN EDGE PIN YET?
06200		JRST GPIN1	;YES
06300		MOVEM B,GOTPIN	;NO, SAVE THIS ONE
06400		JRST SLOP2	;AND GET NEXT ENTRYY
06500	GPIN1:	MOVEI D,	;GOT ONE ALREADY,...
06600		JRST SCON1	;JUST PUT THIS ONE IN THE LIST
06700	SDON1:	SKIPE GOTPIN	;DO WE HAVE A EDGE PIN?
06800		JRST GOTED	;YES
06900		JUMPE H,SDON2	;NO NODE, ALL DONE
07000	SCON2:	MOVE A,(H)	;NO, PUT FIRST ENTRY IN LIST IN THE PLACE EVERYONE POINTS
07100		MOVEM A,(C)
07200		MOVE A,1(H)
07300		MOVEM A,1(C)
07400		FSTRET (H)
07500		SKIPN GOTOP	;WAS THERE AN OUTPUT PIN?
07600		JRST 4,.	;NO, ERROR. NO OUTPUT OR CARD EDGE PIN.
07700		JRST SLOP1	;GET NEXT NODE
07800	GOTED:	SKIPN GOTOP	;GOT AN OUTPUT PIN?
07900		JRST GNOP	;NO
08000		MOVE A,GOTPIN	;GET PIN TO PUT INTO LIST
08100		HRLZM A,1(C)	;DEPOSIT PIN #
08200		MOVEM H,(C)	;DEPOSIT POINTER TO REST OF LIST
08300		JRST SLOP1	;
08400	GNOP:	AOS B,CEPNUM	;GET POINTER TO NEXT CARD EDGE TABLE ENTRY
08500		MOVE A,GOTPIN	;GET SAVED PIN #
08600		HRLZM A,CEPINS-1(B);SAVE PIN #
08700		HRRM C,CEPINS-1(B);SAVE POINTER TO NODE
08800		SETOM GOTOP	;DON'T FIND ERRONEOUS ERROR
08900		JRST SCON2
09000	 ;AT THIS POINT WE REPLACE ALL BODIES WITH MULTIPLE SECTIONS WITH SINGLE SECTIONS
09100	SDON2:
09200		MOVEI D,777
09300		SKIPE HTYPS(D)	;LAST ONE?
09400		SOJA D,.-1	;NO, LOOP
09500		MOVEM D,DSAV1#	;SAVE END COND.
09600		MOVEI D,777
09700	RLOP1:	HRRZ E,HTYPS(D)	;GET TYPE OF GATE
09800		MOVE T2,TYPTB3(E);GET FLAGS AND ADDRS
09900		TLNN T2,SECTN	;DO A SECTION REPLACEMENT?
10000		JRST RRDON1	;NO
10100		MOVEI F,1(T2)	;GET POINTER TO REPLACEMENT TABLE
10200		MOVS T2,(T2)	;GET COUNT,,LENGTH
10300	RLOP2:	PUSHJ P,REPLAC	;DO THE REPLACEMENT
10400		ADDI F,(T2)	;GO TO NEXT TABLE
10500		SUB T2,[XWD 1,0]
10600		TLNE T2,-1	;DONE?
10700		JRST RLOP2	;NO
10800	RRDON1:	SUBI D,1	;GO TO NEXT GATE
10900		CAME D,DSAV1	;DONE?
11000		JRST RLOP1	;NO
11100	
11200		;AT THIS POINT WE FIND ALL LOOPS.
11300		;TO DO THIS, WE FIRST MAKE A SET OF ALL GATES WHICH ARE INVOLVED
11400		;IN LOOPS (PLUS A FEW EXTRANEOUS ONES)
11500		;FIRST WE MAKE A SET OF ALL GATES:
11600	
11700	MLOOP1:	MOVEI A,	;INIT POINTER
11800		MOVEI B,777
11900	SLOP4:	SKIPN HTYPS(B)	;IS THIS A GATE?
12000		JRST SLD1	;NO, QUIT
12100		PUSHJ P,LEPUT	;YES, PUT IT IN
12200		SOJA B,SLOP4	;AND LOOP
12300	; NOW ELIMINATE GATES WHICH ARE NOT DRIVEN BY OTHER GATES, AND ITERATE:
12400	SLD1:	
12500		MOVE E,A	;GET LIST SO FAR
12600		PUSH P,E
12700		MOVEI A,	;INIT NEW LIST POINTER
12800	SLOP5:	MOVE F,1(E)	;GET NEXT GATE FROM OLD LIST
12900		MOVE F,MTYPS(F)	;GET POINTER TO ITS OUTPUTS
13000		TRNN F,-1
13100		JRST SLD5
13200	SLOP6:	MOVE G,1(F)	;GET POINTER TO INPUTS FOR NEXT OUTPUT
13300	SLOP7:	TRNN G,-1	;ANY LEFT?
13400		JRST SLD3	;NO
13500		HRRZ B,1(G)	;GET GATE #
13600		JUMPE B,SLD4	;IGNORE IF CARD EDGE PIN
13700		PUSHJ P,LEPUT	;PUT INTO NEW LIST
13800	SLD4:	HRRZ G,(G)	;GET NEXT INPUT (GATE)
13900		JRST SLOP7
14000	SLD3:	HRRZ F,(F)	;GET NEXT OUTPUT PIN
14100		JUMPN F,SLOP6	;LOOP IF THERE ARE ANY MORE
14200	SLD5:	HRRZ E,(E)	;GET NEXT GATE IN OLD LIST
14300		JUMPN E,SLOP5	;LOOP IF THERE ARE ANY MORE
14400	;  NOW SEE IF LISTS ARE THE SAME:
14500		MOVE B,(P)
14600		PUSHJ P,LCOM	;ARE NEW AND OLD LISTS THE SAME?
14700		JRST [EXCH A,(P)
14800			PUSHJ P,LRET
14900			POP P,A
15000			JRST SLD1]
15100	SCON5:	;NOW REMOVE THOSE THAT DON'T DRIVE ANYTHING (AND ITERATE)
15200		MOVE E,B	;GET STARTING LIST
15300		PUSHJ P,LRET	;RETURN OTHER LIST
15400		MOVEI A,	;INIT NEW LIST
15500		PUSH P,E	;SAVE LIST POINTER
15600	SLOP15:	MOVE F,1(E)	;GET NEXT GATE #
15700		MOVE F,MTYPS(F)	;GET OUTPUT PIN LIST
15800		TRNN F,-1	;ANY LEFT?
15900		JRST SLD15	;NO
16000	SLOP16:	MOVE G,1(F)	;GET POINTER TO INPUTS FOR NEXT OUTPUT
16100	SLOP17:	TRNN G,-1	;ANY LEFT?
16200		JRST SLD13	;NO
16300		HRRZ B,1(G)	;GET GATE #
16400		JUMPE B,SLD14	;IGNORE IF CARD EDGE PIN
16500		PUSH P,A	;SAVE A
16600		MOVE A,-1(P)	;GET LIST OF CURRENT BODIES
16700		PUSHJ P,LECONT	;IS DRIVEN BODY AN INTERESTING ONE?
16800		JRST SLD144	;NO, SKIP IT
16900		POP P,A		;YES, RESTORE A
17000		MOVE B,1(E)	;GET ORRIGINAL GATE
17100		PUSHJ P,LEPUT	;PUT INTO NEW LIST
17200		JRST SLD15	;TRY NEXT GATE
17300	SLD144:	POP P,A
17400	SLD14:	HRRZ G,(G)	;GET NEXT INPUT (GATE)
17500		JRST SLOP17
17600	SLD13:	HRRZ F,(F)	;GET NEXT OUTPUT PIN
17700		JUMPN F,SLOP16	;LOOP IF THERE ARE ANY MORE
17800	SLD15:	HRRZ E,(E)	;GET NEXT GATE IN OLD LIST
17900		JUMPN E,SLOP15	;LOOP IF THERE ARE ANY MORE
18000	;  NOW SEE IF LISTS ARE THE SAME:
18100		MOVE B,A	;PUT NEW LIST IN B
18200		POP P,A		;OLD LIST IN A
18300		PUSHJ P,LCOM	;ARE NEW AND OLD LISTS THE SAME?
18400		JRST SCON5
18500		MOVE E,B	;THEY ARE EQUAL, HOLD ONE COPY
18600		PUSHJ P,LRET	;RETURN THE OTHER
18700		JUMPE E,NOLOOP	;NO LOOPS IF E IS 0
18800	;  NOW FORM A LIST OF ALL LOOPS:
18900	
19000		MOVEI F,	;INIT LIST OF LOOPS
19100		MOVE B,1(E)	;GET AN ARBITRARY GATE TO START WITH
19200	SLOP21:	PUSHJ P,MAKLP	;MAKE A LIST OF LOOPS
19300		PUSH P,E	;SAVE GATE LIST
19400	SLOP22:	MOVE B,1(E)	;GET NEXT GATE
19500		PUSHJ P,ISINLP	;IS IT IN A LOOP?
19600		JRST [POP P,E	;NO, MAKE MORE LOOPS WITH THIS GATE
19700			JRST SLOP21]
19800		HRRZ E,(E)
19900		JUMPN E,SLOP22	;YES, TRY NEXT GATE
20000		POP P,E
20100		;WE NOW HAVE ALL GATES IN SOME LOOP
20200		PUSHJ P,CONSOL	;CONSOLIDATE THE LOOP LIST
20300		MOVEI D,
20400		MOVE G,F	;MAKE A LIST OF ALL LENGTH-2 LISTS
20500	SLOP23:	HLRZ H,1(G)	;GET LENGTH
20600		CAIN H,2	;IS IT 2?
20700		JRST [ GETFST (A,B);YES
20800			MOVEM D,(A)
20900			MOVE D,A
21000			MOVE A,1(G)
21100			MOVEM A,1(D)
21200			JRST .+1]
21300		HRRZ G,(G)	;NO,GET NEXT
21400		JUMPN G,SLOP23	;LOOP IF MORE
21500		JUMPE D,NO2	;NO LENGTH-2 LOOPS?
21600		SETZM DIDSW
21700		PUSH P,F
21800		PUSH P,E
21900	FRLP1:	HRRZ G,1(D)	;GET A LOOP
22000		HRRZ H,(G)	;GET POINTER TO SECOND ELEMENT
22100		MOVE T,1(G)	;GET GATE #
22200		MOVE T1,1(H)	;GET OTHER GATE #
22300	  FOR IQ IN (T,T1)
22400	{	HRRZ Q,HTYPS(IQ);GET TYPE
22500		MOVE T2,TYPTB3(Q);GET FLAGS ETC.
22600		TLNN T2,FFOK+FFAOI;OK FOR LOOP?
22700		JRST NOKL	;NO
22800		LSH C,2
22900		TSO C,T2	;FORM TYPE OF FF INDEX
23000	}
23100		ANDI C,17	;GET TYPE OF FF INDEX
23200		PUSH P,D
23300		SKIPGE D,FFITB1(C);GET FLAGS FOR TYPE OF FF
23400		EXCH T,T1	;SWITCH TOP & BOTTOM GATES IF APPR.
23500		SETOM DIDSW
23600		EXCH T,T1	;TEMPORARILY SWITCH TOP & BOT.
23700		PUSHJ P,REMOUT	;FIND WHICH INPUT PIN ON ONE IS DRIVEN BY LOOP
23800				;AND REMOVE IT
23900		EXCH T,T1	;DO THE SAME FOR OTHER
24000		PUSHJ P,REMOUT
24100		TLNE D,2	;IS TOP GATE AOI?
24200		JRST TAOI	;YES
24300		HRRZ Q,HTYPS(T)	;GET TYPE OF TOP GATE
24400		HRRZ Q,TYPTB3(Q);GET REPLACEMENT TABLE
24500		ADDI Q,(D)	;ADD FF TYPE
24600		MOVE F,(Q)	;GET POINTER TO REPL. TABLE
24700	AOC1:	MOVE E,FFTB2(D)	;GET TYPE NAME
24800		PUSH P,D
24900		HRRZ D,T	;GET GATE #
25000		PUSH P,T1
25100		PUSHJ P,REPLAC	;DO THE REPLACEMENT
25200		POP P,T1
25300		POP P,D
25400		TLNE D,1	;IS BOTTOM GATE AOI?
25500		JRST BAOI	;YES
25600		HRRZ Q,HTYPS(T1);GET TYPE OF BOTTOM GATE
25700		HRRZ Q,TYPTB3(Q);GET REPLACEMENT TABLE
25800		ADDI Q,1(D)	;ADD FF TYPE +1
25900		MOVE F,(Q)	;GET POINTER TO REPLACEMENT TABLE
26000	AOC2:	MOVE E,FFTB2(D)	;GET TYPE NAME
26100		HRRZ D,T1	;GET GATE #
26200		PUSHJ P,REPLA