/2 PDP-8 OS/8 CROSS REFERENCE
/
/
/
/
/
/
/
/
/
/COPYRIGHT  (C)  1974,1975,1977 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.
/
/
/
/
/
/
/
/
/
/

/CREF IS A CROSS REFERENCING PROGRAM FOR THE OS/8 ASSEMBLERS,
/PAL8 AND SABR. THE PURPOSE OF CREF IS:

/ 1) PROVIDE A SEQUENCE NUMBERED (DECIMAL) OUTPUT LISTING

/ 2) PROVIDE A LIST OF ALL USER DEFINED SYMBOLS AND LITERALS
/   AND THE SEQUENCE NUMBER OF THE LINES IN WHICH THEY OCCUR

/FIXES FOR MAINTENANCE RELEASE:

/1.	1975 COPYRIGHT, VERSION 4, EDIT 1
/2.	UNIFIED PAGE SIZE INTO ONE PLACE (& MADE IT WORK)
/3.	OUTPUT EXTRA FORM FEED AT END
/4.	MADE /A MEAN KEEP CREFLS.TM INSTEAD OF /E

/FIXES FOR V3D:

/INSTALLED ALL PUBLISHED PATCHES

/DETAILS OF CREF.

/CORE UTILIZED
/FIELD 0

/0-3377:	MAINLINE CREF CODE
/4200-4577:	INITIALIZATION CODE.EXECUTED ONCE AT BEGINNING
/5600-6177:	LATER OVERWRITTEN 
/DEVICE HANDLERS + BUFFERS ALLOCATED ACCORDING
/TO REQUIREMENTS OF DEVICES.
/USES 3400-5577 FOR INPUT HANDLER, OUTPUT HANDLER, + INPUT BUFFER
/7200-7577:	OUTPUT BUFFER
/5600-7174:	USED FOR REFERENCE STORAGE

/FIELD 1

/0-NSYM*4+10	NSYM=NO. OF SYMBOLS.(USER+PERMANENT+LITERALS).
/7424-7577	PSEUDO OP TABLE
/THE REMAINDER IS USED FOR REFERENCES DURING PASSES GREATER THAN ONE

/SYSTEM SCRATCH USED.
/IF CREF DECIDES THAT MORE THAN 2 PASSES ARE REQUIRED, THE SYMBOL
/TABLE IS SEGMENTED AT AN OPTIMUM POINT, AND PART IS SAVED
/IN SCRATCH BLOCKS 27-50 FOR A THIRD (OR LARGER) PASS.


/MAJOR ROUTINES AND CODE SECTIONS

/MAIN-START OF TEXT PROCESSING.CHECKS FOR VALID LINE.READS AND WRITES
		/TEXT LINES
/CVTSEQ	CONVERTS SEQUENCE NUMBERS FROM OCTAL TO DECIMAL AND
/	WRITES THEM INTO THE OUTPUT BUFFER

/GETLIN-	GET A LINE OF INPUT INTO LINE BUFFER

/WRTLIN-	WRITE A LINE OF TEXT INTO OUTPUT BUFFER

/ANALYZ-	LINE SCANNING BEGINS.ALL SYMBOLS COLLECTED HERE

/PACK-	CHARACTER PACKING ROUTINE. THE SCHEME USED MAPS LETTERS
		/A-Z AND [,],\,^ INTO 0-37. 0-9 INTO 40-51
/		THE PACKING IS: CHAR1-300^52+CHAR2-300

/SYMCHK-	BINARY SYMBOL TABLE SEARCH

/ENTRY-		MAKES ENTRIES IN USER SYMBOL TABLE

/BUMP-		BUMPS REFERENCE COUNTER OF SYMBOLS IN PASS 1

/ENDPAS-	TERMINATES A PASS THROUGH INPUT

/PASSN2-	FILLS IN REFERENCE STORAGE ARE DURING PASSES
/		AFTER PASS ONE

/DUMP-		DUMPS CREF TABLE TO OUT BUFFER


/SWITCHES IN CREF:
		/Q=INPUT IS SABR CODE
		/R=INPUT IS RALF CODE
		/P=DISABLE LISTING OUTPUT. RE ENABLE FOR CREF TABLE
		/X=DON'T CREF LITERALS
		/M=MAMMOTH FILE(2 PASSES)
		/E=DON'T ELIMINATE CREFLS.TM
		/U=/P + NO SYMBOL TABLE
	DECIMAL

	PAGLEN=66		/V3C MOST PAPER HAS 66 LINES PER PAGE

	OCTAL

	PAGLEN=PAGLEN-6		/HEADINGS


	VERSN="5
	PATCHL="A
/PAGE ZERO FOR CREF

	*10
/AUTO INDEX REGISTERS

XRLINE,	SYMTAB-1	/USED TO MOVE UP SYMBOL TABLE
XRLIT,	-1		/DITTO
XRSYM1,	0
XRSYM2,	0		/THESE ARE USED IN SEARCHING SYMBOLS
OUSAVX,	7611		/USED TO SAVE ARGS FOR /M

	*20
TXTBEG,	LINBUF+12	/TEXT STARTS HERE
MARGIN,	LINBUF-1	/LINE BUFFER
COUNT,	0		/GENERAL COUNTER
CHAR,	0		/HOLDS CHARACTER TO EXAMINE
SEQNO,	0		/SEQUENCE NO.
SAVE,	0
TEMP,	0
TEMP1,	0		/THESE THREE ARE TEMPORARY STORAGE
DSWIT,	0
RSWIT,	0		/CD SWITCH WORDS
MLF,	-212		/-LINE FEED
SYMCNT,	-6		/ALLOW 6 CHARACTER SYMBOLS
ISYM,	SYM1		/POINTER TO SYMBOL COLLECTOR
PSWCH,	0		/PACK SWITCH..LEFT OR RIGHT HALF
SYM1,	0
SYM2,	0
SYM3,	0		/COLLECT SYMBOLS HERE
USER,	0		/USER MUST FOLLOW SYM3!
	110		/INITIAL SYMBOL TABLE ENTRIES
PSEUDO,	0
	0		/THESE 2 GET FILLED IN AT INITIALIZATION
PASN2,	PASSN2		/IF NOT PASS 1 GO HERE WITH A SYMBOL
PASSG1,	-1		/=0 IF NOT PASS1
MAXFLD,	0		/-# OF FIRST NON-EXISTENT FIELD
CONST,	0		/EITHER 0 OR 96(10)
FLDPTR,	0		/POINTER TO CORE FIELD
USR,	200		/MONITOR IN CORE..CHANGED TO 7700
DOLLAR,	DOLL1
SYMFLD,	2		/FIELDS WITH SYMBOLS: BITS 5-11
MASKF,	0		/MASK FOR ABOVE WORD

/THESE ARE THE DEFAULT PARAMETERS FOR THE I/O ROUTINES
/AJUSTED ACCORDING TO REQUIREMENTS OF DEVICES REQUESTED

OUCTL=4200
OUBUF=7200
OUDEVH=4000	/VARIABLE-MAY ALSO BE 3600
OUFLD=OUCTL&70

INCTL=0400
INBUF=4600	/ALSO 4200
INDEVH=3400
INRECS=2	/ALSO 3
INFLD=INCTL&70
/(SUBJECT TO CHANGE WITHOUT NOTICE!)

SYMADD,	0		/CONTAINS SYMBOL ADDRESS
SYMNUM,	0		/ABOVE MOD 4
K0=USER
BUFFER,	0		/POINTER FOR UNPACKING
R=52
RAD=52			/RADIX FOR CONVERTING SYMBOLS

ADDER,	0
SYSM,	0
BASE,	0		/THESE ARE USED TO END A PASS
SYMLIM,	0		/UPPER LIMIT FOR SYMBOL REF TABLE
FINI,	0

IOSR,	0
	JMS I [7607
CNTROL,	4010		/THIS IS ON PAGE ZERO MAINLY
CTPTR,	4		/BECAUSE CTPTR IS USED A LOT
SCRATCH=27
	SCRATCH		/SYSTEM SCRATCH FOR OVERFLOW
	SKP		/ERROR ON SYS!!!
	JMP I IOSR
HIOERR,	JMS I	[ERROR
	HNDERR
LNPRPG,	-PAGLEN		/# LINES OF TEXT PER PAGE
LINES,	-PAGLEN		/V3C MASTER COPY
THOUS,	6030		/CONVERSION TABLE..OCTAL-DECIMAL
	7634
	7766
	7777

FPUT,	STORIT		/INITIALLY POINTS TO DCA I XRLINE

M12=THOUS+2
M1=THOUS+3

DPAT,	0
	DCA I (NOFIRM
	DCA I (NOFORM
	JMP I DPAT

	*200
	JMP I (ST1	/INITIALIZATION GETS DESTROYED
BREAK,	JMP I (CHAIN	/CHAIN ENTRY POINT
	ZBLOCK 7	/BREAK TABLE. HOLDS SYMBOL
			/NUMBERS DURING VARIOUS PASSES
			/OF CREF. THE ENTRIES ARE THE NUMBER
			/OF THE LARGEST SYMBOL
			/WHOSE REFERENCES ARE IN A PARTICULAR
			/FIELD. THE 0TH ENTRY CORRESPONDS TO
			/FIELD 0.
ERROR,	0
	CLA
	CDF	0
	TAD I	ERROR
	DCA	BUFFER
	TAD [-6
	DCA SYMCNT	/12 CHARACTER MESSAGES
	TAD TTY		/POINT TO TTY OUT ROUTINE
	DCA [OCHAR

	TAD I BUFFER
	JMS I [DIVIDE	/CONVERT AND PRINT MESSAGE
	ISZ SYMCNT
	JMP .-3
	JMP I [7605
TTY,	TTYPRT


/THE INPUT LINE IS STORED HERE. XRLINE POINTS TO VARIOUS
/PLACES THROUGHOUT THE SCAN, AND CHAR HOLDS THE CORRESPONDING
/CHARACTER WHILE WE EXAMINE IT.

	LINBUF=.
	LITBUF=.+6
	VERTST=.+4


	*251
FILEXT,	0
	CDF	10
	TAD I	(7604
	CDF	0
	SNA
	TAD	(1423
	CDF	10
	DCA I	(7604
	CDF	0
	JMP I	FILEXT
P2ADJ,	0
	TAD I	(PASS2
	SNA
	JMP I	P2ADJ
	DCA I	(OUBLK	/LAST BLOCK WRITTEN TO
	CDF	10
	TAD I	OUSAVX
	CDF	0
	DCA I	(OUELEN	/SIZE OF HOLE
	CDF	10
	TAD I	OUSAVX
	DCA	LNPRPG	/NO. LINES IN LAST BLK WRITTEN
	TAD I	OUSAVX	/NO. BLKS WRITTEN SO FAR
	CDF	0
	JMP I	(MP2	/NO ENTER
MORCOR,	0
	CLA CLL IAC
	DCA	MAXFLD	/IN CASE NOT DEFINED
	TAD I	(7777
	AND	(70
	SNA
	JMP I	MORCOR	/USE OLD WAY TO DETERMINE
	CLL RTR
	RAR		/NEED IT HI 3
	DCA	MAXFLD
	JMP I	(DONCOR

OTYPE,	0
	CDF 10
	TAD I [7600	/DETERMINE WHAT TYPE OF DEVICE
	AND [17
DCB=7760
	TAD (DCB-1
	DCA Q
	TAD I Q	/CHECK DEVICE CONTROL BLOCK
	CDF 0
	JMP I	OTYPE
Q,	0
	*400

/MAIN IS THE START OF CREF.(IF SABR, NXTLIN IS START).
/AT MAIN WE SCAN A LINE OF TEXT FOR BINARY DATA. IF NONE IS FOUND,
/THE LINE IS WRITTEN OUT AND A NEW LINE READ. IF BINARY IS FOUND,
/THE SEQUENCE NUMBER OF THE LINE IS PLACED IN THE OUTPUT
/BUFFER AND THE ANALYSIS BEGINS AT ANALYZ.

MAIN,	JMS I [FORM	/FORM FEED (CR/LF)
	JMS I [HEADER	/SKIP HEADER
	JMS I (GETLIN	/AND ONE CR/LF
NOTBIN,	JMS WRTLIN
NXTLIN,	JMS I (GETLIN
	TAD I XRLINE
	DCA CHAR
	JMS I [CHECK	/CHECK FOR ALPHA LINE
	301
	-336
	JMP NOALPH
NOFIRM,	ISZ LNPRPG	/NEED A FORM FEED YET?
	JMP NOTBIN	/NOT YET
	JMS I [FORM	/NOW!!!
	JMP NOTBIN
NOALPH,	TAD CHAR
	TAD MCTLD	/IF RUB OUT, USED /D
	SNA
	JMP I [ENDPAS	/CAN'T OUTPUT SYM TABLE
	TAD (163	/CHECK FOR FORM FEED
	SNA 
	JMP MAIN	/YES..
	TAD (-41	/IF ------, HE USED /T(DUMMY!)
	SNA CLA
	JMP MAIN	/GIVE HIM A FORM FEED
NOFORM,	ISZ LNPRPG	/=0 AFTER PASS1 NEW PAGE?
	SKP		/SKIP A FORM FEED
	JMS I [FORM
	ISZ SEQNO	/BUMP SEQUENCE
	JMP MAIN2
	TAD [140
	DCA CONST
MAIN2,	JMS I [PASTST	/STILL PASS ONE?
	JMP MAIN3
	TAD SEQNO
	JMS CVTSEQ
	TAD [-3		/3 SPACES
	JMS I [SPACE
MAIN3,	TAD CHAR
	TAD [-215
	SNA CLA 
	JMP NOTBIN
	JMP I [ANALYZ
MCTLD,	-377		/RUB OUT

/THIS ROUTINE CONVERTS SEQUENCE NUMBERS TO DECIMAL NUMBERS AND
/PUTS THEM INTO THE OUTPUT BUFFER. IT IS USED WHEN PRINTING
/THE CREF TABLE ALSO
/THE CALLING SEQUENCE IS: AC=OCTAL NUMBER TO BE CONVERTED.
/THE OUTPUT IS AUTOMATICALLY 4 DIGITS.


POSPT=TEMP1
DIGPT=MASKF

CVTSEQ,	0
	TAD CONST
	DCA SAVE	/TEMP STORE
	TAD CONST
	SZA CLA
	TAD [4
	DCA DIGIT1
	DCA DIGIT1+1
	DCA DIGIT1+2
	DCA DIGIT1+3	/ZERO CONVERSION AREA
	TAD [-4
	DCA COUNT
	TAD SAVE
	CLL		/SEE IF SEQUENCE IS ABOVE 8000(10)
	TAD CONST	/EITHER 0 OR 140(8)
	SNL
	JMP CVT2	/O.K. 
	DCA SAVE	/CORRECTED NUMBER
	TAD [10
	DCA DIGIT1	/PUT AN 8 INTO THERE FOR PRINTING
CVT2,	CLA
	TAD (DIGIT1
	DCA DIGPT
	TAD (THOUS
	DCA POSPT
	TAD SAVE
RPEAT,	CLL
	TAD I POSPT	/POINTS TO -1000,-100,-10, OR -1
	SNL		/IF LINK ON,WE DID TOO MUCH
	JMP ADDUP	/COLLECT THE CONVERTED DIGIT
	ISZ I DIGPT	/BUMP THE COUNTER DIGIT1-DIGIT1+3
	JMP RPEAT

ADDUP,	CIA		/RESTORE THE LAST ONE
	TAD I POSPT
	CIA
	ISZ POSPT
	ISZ DIGPT
	ISZ COUNT	/DONE ALL 4?
	JMP RPEAT
	TAD [-4		/YES..OUTPUT THE CONVERTED NUMBERS
	DCA COUNT
	TAD (DIGIT1
	DCA DIGPT
SPCLUP,	TAD I DIGPT
	TAD ZSPRES	/LEADING ZERO SUPPRESSION
	DCA ZSPRES
	TAD ZSPRES
	SNA CLA		/ZSPRES IS 0 UNTIL A VALID # IS FOUND
	TAD (-20
	TAD I DIGPT
	TAD [260
	JMS I [OCHAR
	ISZ DIGPT
	ISZ COUNT
	JMP SPCLUP
	DCA ZSPRES
	JMP I CVTSEQ

DIGIT1,	0
	0
	0
	0
ZSPRES,	0
	/WRTLIN TRANSFERS INPUT LINE TO OUTPUT BUFFER

WRTLIN,	0
	TAD MARGIN
	DCA XRLINE	/RESET MARGIN TO LEFT
OLINE,	TAD I XRLINE	/PICK UP TEXT CHARACTER
	DCA CHAR
	TAD CHAR
	SNA		/IF NULL,WAS PREMATURE TERMINATOR
	JMP FLUSH	/YES. READ AND WRITE THE REST
	JMS I [OCHAR	/OUTPUT THE CHARACTER
	TAD CHAR
	TAD MLF		/WAS THIS END OF LINE?
	SZA CLA
	JMP OLINE	/NO..LOOP AGAIN
	JMP I WRTLIN

FLUSH,	JMS I [HEADER
	JMP I WRTLIN	/OVERFLOW NOT IN BUFFER

	*600
/ANALYZ IS A WORK HORSE. IN IT CHARACTERS ARE EXAMINED AND
/SYMBOLS ARE BUILT UP. IF A SYMBOL OR A REFERENCE TO A
/SYMBOL IS FOUND,THE APPROPRIATE ACTION IS TAKEN;I.E.
/EITHER ENTERING A NEW SYMBOL, BUMPING THE RFERENCE COUNTER,
/OR BOTH.

ANALYZ,	TAD SEMISV	/IF #0, LAST WAS SEMICOLON
	SNA
	TAD TXTBEG	/IF=0, START NORMALLY
	DCA XRLINE

SCAN,	TAD I XRLINE
	DCA CHAR
	JMS I [CHECK	/ALPHANUMERIC CHECK
	301
	-332
	SKP		/NONE..TEST FOR SPECIAL CHARS
	JMP PAKIT	/FOUND A LETTER  PACK AWAY
	JMS I [CHECK	/TEST FOR 0-9
	260
	-271
	SKP		/NOPE..COULD BE SABR
	JMP SCAN1
SCAN3,	JMP TSTIT	/IF SABR, THIS LOC IS AND 0
	JMS I [CHECK	/TEST FOR [,],\,AND ^
	333
	-336
	SKP
	JMP PAKIT	/VALID SABR CHARACTERS

TSTIT,	JMS REPACK
	TAD CHAR	/IS THIS A ;?
	TAD (-273	/IF SO, SAVE PLACE ON LINE
	SZA CLA
	JMP .+3		/IF ; SAVE PLACE ON LINE
	TAD XRLINE
	DCA SEMISV
	TAD SYM1	/IS THERE A LEGAL SYMBOL?
	SNA CLA
	JMP TSTEND	/NO..LOOK FOR A LINE FEED
	TAD CHAR
	TAD (-257
	SNA CLA		/A COMMENT?
	IAC		/YES..NEED SPECIAL RETURN
	DCA SLSWIT

	JMS I [SYMCHK	/THIS IS EITHER A REFERENCE OR A
			/DEFINITION OR A PERMANENT SYMBOL,PSEUDO
	PSEUDO		/CHECK PSEUDOS FIRST
HC1,	JMP USSYM	/NOT A PSEUDO-OP
			/BECOMES JMP PATCH IF /M USED
	TAD SYMADD
	TAD [3
	DCA SAVE	/SYMCHK RETURNS ADDRESS OF SYMBOL IN SYMADD
	CDF 10
	TAD I SAVE
	DCA SAVE
	CDF 0
	JMS I (CLEAR	/WIPE OUT PSEUDO OP
	JMP I SAVE	/PERFORM THE NECESSARY OP FOR PSEUDO
PATCH,	TAD	SYM1
	RTL
PATCH1,	CLA SZL SPA	/LG-LH SPLIT
	JMP	B

USSYM,	JMS I [PASTST
	JMP I PASN2
	JMS I [SYMCHK
	USER		/CHECK PERMANENT AND USER SYMBOLS
	JMP NTER	/DIDN'T FIND IT; SO WE HAVE TO ENTER IT
	JMS I (TSTPRM	/FOUND;TEST FOR PERMANENT SYMBOL
	JMP B		/WAS A PERMANENT SYMBOL
	JMP BMPIT	/FOUND AND NOT PERMANENT;INCREASE THE
			/REFERENCE COUNTER BY ONE

NTER,	JMS I [ENTRY	/ENTER THE SYMBOL BY PUSHING DOWN ALL
			/THE ONES BELOW IT
BMPIT,	JMS I [BUMP	/AND INCREASE THE REFERENCE COUNT
B,	JMS I (CLEAR	/SETUP FOR NEXT
	TAD SLSWIT	/WAS LAST A /?
	SZA	CLA
	JMP I (NOTBIN
	JMP SCANER

TSTEND,	TAD CHAR
	TAD MLF		/ARE WE DONE WITH THIS LINE?
	SZA CLA
	JMP .+3		/IF LF, CLEAR OUT SEMICOLON
CLRSEM,	DCA SEMISV
	JMP I (NOTBIN
	TAD CHAR
	TAD (-257
	SNA		/COMMENT LINE?
	JMP CLRSEM
	TAD (15		/A "?
	SNA
	ISZ XRLINE	/YES..SKIP NEXT LETTER
	TAD [-2		/A $?
	SNA
	JMP I DOLLAR
	TAD [-4
	SNA		/TEST FOR (
	JMP I (LIT1
	TAD (-63
	SZA CLA		/TEST FOR [
	JMP SCANER	/NONE OF THEM  KEEP GOING
	JMP I (LIT2

SCAN1,	TAD SYM1	/IF WE DON'T HAVE A SYMBOL
	SNA CLA		/DON'T PACK THIS CHARACTER
	JMP SCAN
PAKIT,	TAD CHAR
	JMS I [PACK	/PACK A CHARACTER
	JMP SCAN

REPACK,	0		/RESET SYMBOL AREA
	TAD [-6
	DCA SYMCNT	/SYMBOL COUNTER..6 CHARS
	TAD (SYM1
	DCA ISYM
	DCA PSWCH
	JMP I REPACK

SEMISV,	0
SLSWIT,	0

SCANER,	TAD CHAR	/IF LAST WAS ; READ IN OVERLAY
	TAD (-273
	SNA CLA
	JMP I (NOTBIN
	JMP SCAN

SUB3,	0		/SUBTRACTS 3 FROM CTPTR
	TAD [-3
	TAD CTPTR
	DCA CTPTR
	JMP I SUB3
	*1000


/THE PACKING SCHEME IS THE SAME AS THAT USED IN PAL8. THAT IS
/IN EACH WORD WE HAVE 2 CHARS.  CHAR1-300^45+CHAR2-300.
/PERMANENT SYMBOLS HAVE THE FIRST WORD SET TO A NEGATIVE.

PACK,	0
	DCA BLAH
	TAD SYMCNT
	SMA CLA		/OVERFLOW PROTECT
	JMP I PACK
	TAD BLAH
	AND [77		/STRIP IT
	TAD (-37	/INCLUDE VALID SABR CHARS
	SMA SZA
	TAD (-20	/NUMBERS GET MAPPED: 40-51
	TAD (37		/LETTERS ARE MAPPED:01-37
	ISZ PSWCH	/WHICH HALF?
	JMP LEFT
	TAD I ISYM
	DCA I ISYM
	ISZ ISYM
	JMP PCKOUT
LEFT,	CLL RAL		/*2
	DCA TLOW
	TAD TLOW
	CLL RTL
	DCA SAVE	/*10
	TAD SAVE
	CLL RTL		/*40
	TAD SAVE
	TAD TLOW	/*52!!
	DCA I ISYM
	CLA CMA		/RESET FLIP FLOP
	DCA PSWCH
PCKOUT,	ISZ SYMCNT
	NOP
	JMP I PACK
BLAH,	0




/SYMCHK IS THE BINARY SEARCH ROUTINE FOR CREF. SYMBOLS
/ARE A GROUP OF FOUR ENTRIES:THE FIRST THREE WORDS ARE
/THE STRIPPED-40 REPRESENTATION OF THE SYMBOL. THE LAST
/IS THE REFERENCE COUNTER (IN THE CASE OF A USER SYMBOL) OR
/A -1 (IN THE CASE OF A PERMANENT SYMBOL). IN PSEUDO OPS
/THE FOURTH WORD DESCRIBES THE DESTINATION OR ACTION
/TO BE PERFORMED BY THAT PSEUDO OP.
/THE TABLE USER,0 HAS ENTRIES WHICH ARE THE SYMBOL NUMBER
/AND NOT THE ABSOLUTE CORE LOCATION OF A SYMBOL.

/CALLING SYMCHK:
/	JMS SYMCHK
/	TABLE	/FIRST WORD OF TWO WHICH GIVES THE LIMITS
/MOD 4 OF THE APPROPRIATE TABLE
/SYMCHK RETURNS WITH THE NUMBER OF THE SYMBOL IN SYMNUM
/AND THE CORE ADDRESS OF THE SYMBOL IN SYMADD. IF THE
/SYMBOL IS NOT FOUND, THESE WORDS CONTAIN THE PROPER LOCATION
/FOR THE SYMBOL.

SYMCHK,	0
	TAD I SYMCHK
	DCA THI
	DCA LAST
	TAD I THI	/GET LIMITS OF TABLE
	DCA TLOW	/LOW LIMIT
	ISZ THI
	TAD I THI
	DCA THI		/HIGH LIMIT

COMP,	TAD TLOW
	CIA
	TAD THI
	CLL RAR		/HALF DIFFERENCE BETWEEN THE LIMITS
	SNA		/IF THIS IS ZERO, WE'RE DONE
	ISZ LAST	/THIS WILL BE LAST TRY
	TAD TLOW	/FORM THE NUMBER OF THE ENTRY
	DCA SYMNUM	/WE ARE GOING TO TEST NOW
	JMS  SETXR	/SET UP INDICES FOR TEST
	ISZ COUNT	/WE ONLY WANT -3 IN COUNT!

S1,	CLL
	CDF 10
	TAD I XRSYM2	/SYMBOL TABLE ENTRY
	CDF 0
	AND [3777	/MASK PERMANENT SYMBOL BIT
	CMA		/USE ONE'S COMPLEMENT
	TAD I XRSYM1	/OUR COLLECTED SYMBOL
	CMA		/0 AC IF EQUAL
	SZA CLA		/WATCH THE LINK!!
	JMP COMPR	/NOW TEST FOR HI OR LOW COMPARISON
	ISZ COUNT
	JMP S1
	ISZ SYMCHK	/TAKE FOUND ENTRY
	JMP OUT1


COMPR,	TAD LAST	/LAST GASP?
	SZA CLA
	JMP OUT2	/YEP
	TAD SYMNUM	/LINK TELLS THE TALE!
	SNL
	JMP COMP-1	/ADJUST HIGH LIMIT
	DCA TLOW
	JMP COMP


OUT2,	TAD SYMNUM
	SZL
	IAC
	DCA SYMNUM
OUT1,	TAD SYMNUM	/ADDING THE FIRST ENTRY AFTER
	SZA		/AN EXPUNGE WILL CAUSE SYMNUM TO BE 0
			/AUTOMATICALLY IT HAS TO BE 1
	JMP .+3
	ISZ SYMNUM
	JMP OUT1
	CLL RTL		/FORM SYMADD FROM SYMNUM
	DCA SYMADD	/CORE ADDRESS OF THE SYMBOL
	ISZ SYMCHK
	JMP I SYMCHK

THI,	0
TLOW,	0

LAST,	0



/THESE TABLES DEFINE THE LIMITS OF CORE STORAGE IN CREF.
/BASTBL GIVES THE START LOC WHERE REFERENCES WILL BE STORED.
/LTTBL GIVES THE LO CORE LIMIT OF THOSE REFS. THERE IS ONE ENTRY FOR
/EACH FIELD

BASTBL,	7174		/THIS TABLE GIVES THE BASE
	7424		/LOCATIONS INEACH FIELD WHERE THE
	7574		/REFERENCES BEGIN
	7574		/REFS START HERE AND BUILD TOWARD LOWER
	7574		/CORE ADDRESSES
	7574
	7574
	7574
LTTBL,	DOLL1		/THIS TABLE GIVES THE LOW
	10		/CORE ADDRESS OF THE REFS IN EACH FIELD
	4		/NOTE:ENDPAS JUGGLES THESE AROUND
	4		/TO OPTIMIZE CREF STORAGE
	4
	4
	4
	4

DIVE,	0
	SNA		/IF 0, PRODUCE A SPACE
	JMP DIVSPC
	TAD (-37
	SMA SZA
	TAD [-60
	TAD [77
DIVSPC,	TAD	[240
	JMP I DIVE

SETXR,	0		/SETUP INDEX REGS FOR SEARC,ENTRY
	TAD SYMNUM	/SETUP WHEN FOUND SYMBOL
	CLL RTL		/CORE ADDRESS OF SYMBOL
	TAD M1
	DCA XRSYM2
	TAD [SYM1-1
	DCA XRSYM1
	TAD [-4
	DCA COUNT
	JMP I SETXR

	*1200
/ENTRY IS SLOW! IT ENTERS A SYMBOL BY PUSHING DOWN WHAT IS
/BELOW THE PROPER ENTRY.ENTRY CAN ONLY BE USED IN MAKING
/ENTRIES IN THE PERMANENT (USER) SYMBOL TABLE.
/ENTRY CONDITIONS:AC SHOULD BE CLEAR!
/	SYMNUM SHOULD HAVE THE SYMBOL NUMBER OF THE
/	PROPOSED ENTRY. SYMCHK RETURNS THIS WHEN THE
/	SEARCH IS UNSUCCESSFUL.

ENTRY,	0
	JMS I (SETXR	/SETUP INDEX REGISTERS
	TAD USER+1	/CHECK FOR POSSIBLE OVERFLOW
	CMA		/WE DON'T WANT TO WIPE PSEUDO TABLE
	TAD PSEUDO
	SPA SNA CLA
	JMP NMOR	/BAD!OVERFLOW HAS OCCURRED
	ISZ USER+1	/OK..BUMP SYMBOL COUNT
	TAD USER+1
	CLL RTL		/CORE ADDRESS OF ENTRY
	DCA TEMP1
	TAD TEMP1
	TAD [-4		/GIVES BOTTOM OF TABLE NOW
	DCA SAVE
	TAD SAVE	/TEST FOR AN 'ADD-ON' ENTRY
	CMA
	TAD SYMADD
	DCA COUNT	/-# OF WORDS TO MOVE

	CDF 10
NTR1,	TAD I SAVE
	DCA I TEMP1	/THE BAD LOOP!
	CMA
	TAD SAVE
	DCA SAVE	/I WISH WE HAD A DSZ!(DECREMENT &SKIP ON 0
	CMA
	TAD TEMP1
	DCA TEMP1
	ISZ COUNT	/DONE?
	JMP NTR1	/UNFORTUNATELY NOT

	CDF 0
ENTER,	CLA		/NOW PUT IN OUR ENTRY
	TAD [-4
	DCA COUNT	/THE 4TH IS A 0 WORD (USER FOLLOWS SYM3)
NTR2,	TAD I XRSYM1
	CDF 10
	DCA I XRSYM2
	CDF 0
	ISZ COUNT
	JMP NTR2
	JMP I ENTRY

NMOR,	JMS I [ERROR	/SYMBOL OVERFLOW
	SYMERR


TXT,	JMS GETC
	TAD (-240	/IGNORE SPACES
	SNA CLA
	JMP TXT
	TAD CHAR
	CIA		/STRING DELIMITER
	DCA DELMIT
TXT2,	JMS GETC
	TAD DELMIT	/REACHED END OF STRING?
	SNA CLA
	JMP I [B	/YES
	TAD CHAR	/NO..END OF LINE?
	TAD [-215
	SNA CLA
	JMP I [B
	JMP TXT2

GETC,	0
	TAD I XRLINE
	DCA CHAR
	TAD CHAR
	JMP I GETC	/GET A CHAR;STORE IT, RETURN IN AC
DELMIT,	0




BUMP,	0		/ROUTINE TO BUMP REFERENCE COUNTERS
	TAD SYMADD
	TAD [3
	DCA SAVE	/ADDRESS OF REFERENCE COUNTER
	CDF 10
	TAD I SAVE
	SPA CLA		/IF 4000 BIT ON, AN EXTRA ENTRY HAS
			/ALREADY BEEN MADE FOR THIS SYMBOL
	JMP ONEISZ
	TAD CONST
	SNA CLA		/IS SEQNO >4095?
	JMP ONEISZ	/NOT YET
	TAD [4000
	TAD I SAVE
	DCA I SAVE	/MARK IT AS BEING NOTED
	CMA
ONEISZ,	TAD M1		/EITHER -1 OR -2
	DCA COUNT
BUMP2,	TAD [3777	/THIS CODE PROTECTS AGAINST
	AND I SAVE	/>2048 REFS. IF SIGN BIT EVER BECOMES
	ISZ I SAVE	/NEG. ON THE ISZ,KILL IT!!
	NOP		/USELESS PROTECTION
	TAD [3		/IF AC GOES NEG. HE DIES!!
	SPA CLA
	JMP ERR7
	ISZ COUNT
	JMP BUMP2
	CDF 0
	JMP I BUMP

ERR7,	CDF 0
	JMS I [ERROR
	REFERR

PTRSET,	0		/THIS ROUTINE TAKES
	TAD [3		/THE SYMBOL TABLE THAT
	DCA BUFFER	/PRODUCED AND SETS UP EACH REFERENCE
	DCA SYMNUM	/AREA WITH A POINTER INTO THE AREA
	CLA CMA
	TAD USER+1	/AND A 0 LOCATION TO HOLD THE DEFINITION
	CIA		/SEQUENCE NO.
	DCA COUNT
PTRST1,	TAD [4		/START PICKING UP POINTERS
	TAD BUFFER
	DCA BUFFER
	ISZ SYMNUM	/CORRESPONDING SYMBOL NUMBER
	JMS I (GETFLD	/FORM CDF N FOR REFERENCE AREA
	DCA CDTFLD
	CDF 10
	TAD I BUFFER	/IF PERMANENT SYMBOL, THIS LOC=0
	SNA		/IF SO, SKIP IT
	JMP PTRST2
	TAD M1
	DCA SAVE
CDTFLD,	HLT
	DCA I SAVE
	ISZ SAVE	/POINT TO INDEX WORD
	TAD [2
	DCA I SAVE
PTRST2,	CDF 0
	ISZ COUNT
	JMP PTRST1
	JMP I PTRSET

	*1400
/ENDPAS IS ARRIVED AT WHEN A PASS THROUGH THE INPUT HAS BEEN
/COMPLETED.SOME COMPLICATED DIDDLING GOES ON HERE.

ENDPAS,	ISZ PASSG1
	JMP I (DUMP	/DUMP WHAT WE HAVE
	JMS I	(ENDFIX
	IAC		/POINT TO END OF NEW TABLE
	DCA USER+1	/YES..THAT BECOMES THE TOTAL NO.
		/OF SYMBOLS IN OUR NEW TABLE
	TAD [3777	/O.K...NOW READ IN A SEGMENT
	AND CNTROL	/NOW FORMING READ CONTROL
	DCA CNTROL
	TAD [4		/READ SYMBOLS INTO F1 AT LOC.4
	DCA CTPTR
	JMS IOSR	/DO THE READ
NDPS1,	DCA FLDPTR	/INITIALLY AT FIELD 0
	TAD	[6034	
	DCA I	[OUTSW
END2,	DCA ADDER	/ADDER HOLDS THE COUNT OF THE NUMBER
			/OF REFERENCES TO THE SYMBOLS THUS FAR
		/EXAMINED. THIS IS COMPARED TO THE AVAILABLE
		/CORE IN A PARTICULAR FIELD. WHEN THAT OVER-
		/FLOWS WE HAVE TO EITHER MOVE TO ANOTHER FIELD
		/FOR THE REFERENCES OR WRITE PART OF THE SYMBOL
		/TABLE ONTO SYS.
	TAD (BASTBL
	TAD FLDPTR
	DCA TEMP1	/INITIAL BASE OF REFS
	TAD I TEMP1
	DCA BASE
	TAD FLDPTR	/NOW GET MASK FOR QUESTION..
	CMA		/DOES THIS FIELD HAVE SYMBOLS?
	DCA COUNT
	CLL CML
	RAL
	ISZ COUNT
	JMP .-2
	DCA MASKF
	TAD FLDPTR	/GET ADDRESS OF UPPER LIMIT
	TAD (LTTBL	/FOR LATER
	DCA SYMLIM
	TAD FLDPTR	/SET NEW LIMIT IN FIELD 1
	TAD [BREAK
	DCA NUSER	/THE NEW LIMIT FOR REFS IS
	DCA I NUSER	/ZERO SYMBOL IN CURRENT FIELD LOC.
	TAD I SYMLIM
FUJ1,	TAD CTPTR	/IF MORE THAN 2 FIELDS EXIST
			/THIS BECOMES A NOP. THE LIMIT IN
			/FIELD 1 IS AT THE BOTTOM OF THE
			/SYMBOL TABLE
	DCA LIMIT
NDPS2,	TAD CTPTR	/CTPTR HOLD THE CORE ADDRESS OF THE
		/THE 4TH LOCATION OF A GIVEN SYMBOL. THIS
		/IS ALSO THE REFERENCE COUNTER FOR THAT SYMBOL
	CLL RTR		/FORM SYMBOL NUMBER
	AND [1777
	DCA COUNT	/SAVE FOR LATER
	TAD ADDER
	CIA
	TAD BASE	/NEXT REFERENCE AREA
	DCA SAVE	/IF IT FITS IN THIS AREA
			/USED WHEN WE MAKE ACTUAL REF ENTRIES
	CDF 10
	TAD I CTPTR	/# REFS FOR THIS SYMBOL
	DCA TEMP
	TAD [3
	TAD CTPTR
	DCA CTPTR
	TAD TEMP
	SPA CLA		/PERMANENT SYMBOL
	JMP PRMSYM	/YES
	TAD I CTPTR
	AND [3777	/MASK GT 4095 BIT
	TAD ADDER
	DCA ADDER	/SEE IF THIS SYMBOL WILL FIT IN THE
			/CURRENT FIELD HOLDING REFS
	CDF 10		/MUST ADD UP NEW REFS ALSO
	TAD I CTPTR
	AND [3777
	CDF 0
	CLL
	TAD LIMIT	/IF LINK GOES ON, REFS WON'T FIT
	SZL
	JMP CUTSYM
	CMA CLL		/WHEN UPPER MEETS LOWER,QUIT
	TAD SAVE
	SNL CLA
	JMP CUTSYM	/OK..QUIT!
	CDF 10
	TAD SAVE	/FITS..PUT IN BASE WHERE THIS SYMBOL'S
			/REFS BEGIN
	DCA I CTPTR
	ISZ ADDER
	ISZ ADDER	/2 EXTRA FOR BOOKKEEPING
PRMSYM,	CDF 0
	TAD COUNT	/SYMBOL NUMBER..REMEMBER?
	DCA I NUSER
	TAD SYMFLD	/BUT..IF THIS FIELD HAS SYMBOLS,
	AND MASKF	/LET'S REDUCE HIS AVAILABLE SPACE
	SNA CLA
	JMP .+4		/NO SYMBOLS
	TAD [4
	TAD LIMIT
	DCA LIMIT
	TAD COUNT	/SEE IF WE ARE DONE
	CMA
	TAD USER+1
	SNA
	JMP I (DONE	/YES!! PROBABLY FORGOT SOMETHING
	DCA SYSM	/BECOMES # SYMBOLS TO WRITE OUT IN CASE
			/WE RUN OUT OF ROOM
	ISZ CTPTR
	JMP NDPS2	/CYCLE FOR NEXT SYMBOL

CUTSYM,	CLA
	ISZ FLDPTR	/GO TO ANOTHER FIELD
	TAD FLDPTR	/DOES IT EXIST?
	CLL
	TAD MAXFLD
	SNL CLA
	JMP END3	/YES..GROOVY
	TAD SYSM	/NOPE..HAVE TO WRITE REMAINDER OUT
	CLL RAL		/CONVER TO PAGES
	AND (3700	/FORM CONTROL WORD FOR WRITE
	TAD [4110
	DCA CNTROL
	JMS I (SUB3	/RESET CTPTR
	TAD I NUSER
	IAC		/FUDGE LAST ENTRY IN TABLE
	DCA USER+1	/NEW END OF TABLE
	JMS IOSR	/WRITE THE SEGMENT
	CDF 10		/PUT A 7777 AT END OF CURRENT SEG.
	CLA CMA
	DCA I CTPTR
	CDF 0
	JMP I (DONE+1	/NOT DONE YET!!

END3,	JMS I (SUB3
	JMP END2	/AND RESUME THY WORK!!
NUSER,	0
LIMIT,	0
	*1600

/PASSN2 IS ENTERED WHEN WE HAVE COLLECTED SOME SORT OF A
/SYMBOL AND IT IS NOT PASS ONE. WE HAVE TO MAKE SURE IT
/IS A USER SYMBOL OR LITERAL. IF IT IS, WE HAVE TO ENTER
/THE SEQUENCE # IN THE AREA SET UP FOR REFERENCES TO THIS
/SYMBOL. ALSO, IF THE REFERENCE IS A DEFINITION, THE SECOND
/LOCATION IN THE REFERENCE AREA IS LOADED WITH THE SEQUENCE
/NO. OF THE LINE WE ARE DOING.

PASSN2,	JMS I [SYMCHK
	USER		/IS IT KNOWN TO US?
	JMP I [B	/NO..BUT IT MIGHT BE IN A SEGMENT EITHER
			/ALREADY DONE OR YET TO BE DONE!!
	JMS TSTPRM	/TEST FOR A PERMANENT SYMBOL
	JMP I [B	/PERMANENT SYMBOL
/NOTE:SAVE IS SET UP IN TSTPRM TO CONTAIN THE ADDRESS OF THE
/INDEX WORD. WE USE THIS LATER ON

	JMS GETFLD
	DCA CDFN	/DETERMINE WHAT FIELD THIS SYMBOL HAS ITS
			/REFS IN AND FORM A CDF N
	TAD CHAR
	TAD MCOMMA	/IS THIS A DEFINITION?
	SZA
	TAD MEQ		/AN= MAYBE?
	SNA CLA
	IAC		/ONE OR OTHER..MARK AS DEFINITION
	DCA DEF
	CDF 10
	TAD I SAVE	/PICK UP POINTER TO REFERENCE AREA
	DCA SAVE
	TAD CDFN
	DCA .+1
	HLT		/I HATED TO DO THIS!!!
	TAD I SAVE
	SPA CLA		/IF THIS IS NEGATIVE, IT MEANS THAT THE
		/SEQUENCE NUMBER HAS WRAPPED AROUND, BUT WE HAVE
		/ALREADY MADE A 0 ENTRY TO SHOW THAT
	JMP P2
	TAD CONST	/HAS THE SEQUENCE # WRAPPED?
	SNA CLA
	JMP P2		/NOT YET
	JMS REFENT	/YES..MAKE A 0 ENTRY
	TAD CDFN
	DCA .+1
	HLT
	TAD I SAVE	/MARK AS HAVING A 0 ENTRY
	TAD [4000
	DCA I SAVE
P2,	CDF 0
	TAD SEQNO	/NOW MAKE A REAL ENTRY
	JMS REFENT
	TAD DEF
	SNA CLA		/SHOULD WE FILL IN THE DEFINITION LOC?
	JMP I [B	/NO
	CLA CMA
	TAD SAVE	/YES..POINT TO IT
	DCA SAVE
	TAD CDFN
	DCA .+1
	HLT		/THIS IS SLOPPY, BUT SO AM I
	TAD SEQNO
	CIA
	DCA I SAVE
CDFZ,	CDF 0
	JMP I [B
DEF,	0
MEQ,	-21
MCOMMA,	-254

/REFENT, MAKES REFERENCES IN THE SYMBOLS AREA AND BUMPS THE
/FIRST LOCATION TO POINT TO THE NEXT LOC.

REFENT,	0
	DCA TEMP1	/SAVE SEQNO
CDFN,	HLT
	TAD I SAVE
	AND [3777	/MASK OFF WRAP AROUND BIT
	CIA
	TAD SAVE	/FORM ADDRESS OF THIS REFERENCE
	DCA TEMP
	TAD TEMP1
	DCA I TEMP
	ISZ I SAVE	/BUMP POINTER
	CDF 0
	JMP I REFENT

/TSTPRM TESTS THE SYMBOL WE HAVE FOUND FOR BEING A PERMANENT SYMBOL
/PERMANENT SYMBOLS ARE DISTINGUISHED BY HAVING  THE 4000 BIT ON.

TSTPRM,	0
	TAD SYMADD
	TAD [3
	DCA SAVE	/WE USE THIS ON RETURN!!
	CDF 10
	TAD I SYMADD
	CDF 0
	SMA CLA		/IS IT MINUS?
	ISZ TSTPRM
	JMP I TSTPRM

/GETFLD DETERMINES WHAT FIELD A PARTICULAR SYMBOL HAS ITS
/REFS IN. IT DOES IT BY COMPARING THE CURRENT SYMBOLS NUMBER
/WITH THE ENTRIES IN THE BREAK TABLE.

GETFLD,	0
	DCA FLDPTR
GF1,	TAD [BREAK
	TAD FLDPTR	/GET BREAK TABLE ENTRY
	DCA TEMP
	TAD I TEMP
	CIA
	TAD SYMNUM	/SYMNUM WAS SET UP WHEN WE FOUND THE SYMBOL
	SPA SNA CLA
	JMP GF2		/FIRST NEG. VALUE GIVE FLDPTR
	ISZ FLDPTR	/TRY NEXT
	JMP GF1
GF2,	JMS CHDF	/FORM THE CDF N
	JMP I GETFLD

CHDF,	0
	TAD FLDPTR
	CLL RTL
	RAL
	TAD CDFZ
	JMP I CHDF

SPACE,	0		/GENERATES AS MANY SPACES AS ARE IN AC
	DCA CHDF
	TAD [240
	JMS I [OCHAR
	ISZ CHDF
	JMP SPACE+2
	JMP I SPACE

CHECK,	0
	TAD I CHECK	/SUBROUTINE TO TEST CHAR
	CIA		/AGAINST PRESCRIBED LIMITS
	TAD CHAR
	CLL
	TAD I CHECK
	ISZ CHECK
	TAD I CHECK
	ISZ CHECK
	SNL
	SKP CLA		/VERY UNESTHETIC..BUT IT WORKS!
	SNA CLA
	ISZ CHECK
	JMP I CHECK

DONE,	ISZ FINI	/SET COMPLETION FLAG
	JMS I (IOPEN	/SET FOR REREAD
	JMS I (PTRSET	/PREPARE REFERENCE AREAS
	DCA SEQNO	/BACK TO BASICS
	DCA CONST
	JMP I (FIRST	/READ FIRST RECORDS

	*2000
/DUMP DOES A LITTLE FORMATTING OF THE OUTPUT, AND DUMPS THE
/CROSS REFERENCING TABLE ONTO THE OUTPUT DEVICE.
/ANY FIDDLING WITH THE BUFFERS OR DEVICE HANDLERS WILL HAVE TO
/BE DONE IN DUMP


COUNTR=BASE
REFBUF=IOSR
SCHAR=ADDER

DUMP,	CLA CMA
	DCA PASSG1	/FORCES ANOTHER PASS AT ENDPAS
DMP7,	SKP		/V3C
	JMP DMP8	/SKIP FIRST-TIME STUFF
	ISZ LINES	/V3C
	ISZ LINES	/DIF NO. LINES PER PAGE NOW
	JMS I [FORM	/FIRST TIME THRU GETS A FORM FEED
	DCA DMP7	/FUTURE PASSES DON'T
DMP8,	TAD USER+1
	CIA
	DCA COUNTR	/# SYMBOLS TO PROCESS NOW
	TAD [3
	DCA BUFFER	/FIRST SYMBOL IS HERE
	JMP DMP6	/GET NO. LINES RIGHT FIRST TIME
DMP5,	JMS I [CRLF	/V3C
DMP,	ISZ LNPRPG	/IS FORM FEED NEEDED?
	SKP		/NOT YET
	JMS I [FORM
DMP6,	TAD [-3
	DCA SYMCNT	/2 CHARACTERS PER PASS
	DCA CONST	/RESET FOR <4096
	TAD M12
	DCA LINENO
NXTDV,	ISZ BUFFER
	CDF 10
	TAD I BUFFER	/PICK UP PACKED WORD
	CDF 0
	SPA 		/PERMANENT SYMBOL?
	JMP DPERM	/YES
	JMS I [DIVIDE	/CONVERT 2 CHARS AND PRINT
	ISZ SYMCNT
	JMP NXTDV+1
	TAD [-4
	JMS I [SPACE	/GENERATE(AC) SPACES
	TAD BUFFER
	CLL RTR		/GET SYMBOL NUMBER
	AND [1777
	DCA SYMNUM
	JMS I (GETFLD
	DCA CDFNA	/CDF N
	CDF 10
	TAD I BUFFER
	DCA REFBUF	/BASE OF REFS FOR SYMBOL
CDFNA,	HLT
	TAD I REFBUF	/IF THIS IS NEGATIVE,
	SPA CLA		/WE LEFT A REF FOR A 0 ENTRY
	TAD M1		/IN THAT CASE,DON'T INCLUDE THAT ONE AS 
	TAD [-2		/A REAL ENTRY.
	DCA SYMCNT
	TAD I REFBUF
	AND [3777	/NOW CALCULATE REAL NO. ENTRIES
	TAD SYMCNT
	CIA
	DCA SYMCNT
	CLA CMA
	TAD REFBUF
	DCA REFBUF
	TAD I REFBUF	/SEQUENCE # OF DEF.
	DCA DEFSEQ
DMP2,	CLA CMA
	TAD REFBUF
	DCA REFBUF
	TAD CDFNA
	DCA .+1
	HLT
	TAD I REFBUF	/PICK UP A REFERENCE
	TAD DEFSEQ	/IS THIS THE DEF?
	SZA CLA
	JMP	NODEF
	DCA	DEFSEQ	/ONLY 1 DEF PER LINE
	TAD [3		/YES..PRINT # AFTER SEQ #
NODEF,	TAD [240	/IF NO, PRINT 2 SPACES
	DCA SCHAR
	TAD I REFBUF
	SZA CLA		/IF A 0, ALL FOLLOWING REFS ARE >4095
	JMP .+4
	TAD [140
	DCA CONST
	JMP DMP2	/IGNORE ZERO ENTRY!!
	TAD I REFBUF
	CDF 0
	JMS I (CVTSEQ	/WRITE THE DECIMAL SEQUENCE #
	TAD SCHAR
	JMS I [OCHAR	/EITHER # OR SPACE
	CLA CMA
	JMS I [SPACE
	ISZ SYMCNT	/MORE TO DO?
	JMP DMP0	/NO, BUT IS CR/LF REQUIRED?
GETMOR,	ISZ COUNTR	/EXHAUSTED ALL SYMBOLS?
	JMP DMP5
	TAD FINI	/YES..ARE WE ALL DONE
	SNA CLA
	JMP I [ENDPAS	/NO..READ IN NEXT SEGMENT
	JMP I (OCLOSE

DMP0,	ISZ LINENO	/A CR/LF NEEDED?
	JMP DMP2
	TAD M12
	DCA LINENO	/RESET ENTRIES PER LINE
	JMS I [CRLF	/V3C
	ISZ LNPRPG	/FORM FEED?
	SKP
	JMS I [FORM
	TAD M12		/AND INDENT NEXT LINE
	JMS I [SPACE
	JMP DMP2

DPERM,	CLA
	TAD [3		/PERMANENT SYMBOL
	TAD BUFFER
	DCA BUFFER	/LOOK AT NEXT
	ISZ COUNTR
	JMP NXTDV
	JMP GETMOR+2

FIRST,	JMS I (ASHDLR	/RESET INPUT FOR READ
	JMS I (RDREC	/AND READ SOME RECORDS
	JMP I (NXTLIN	/START READING TEXT


DEFSEQ,	0
LINENO,	-12
PASTST,	0		/SR WHICH DETERMINE IF PASS > 1
	TAD PASSG1
	SPA CLA		/IF >0=> PASS >1
	ISZ PASTST
	JMP I PASTST
	*2200

/I/O ROUTINES FOR OS/8

OUSETP,	0
	TAD (OUCTL&3700
	CIA
	DCA OUDWCT	/SIZE OF BUFF IN DOUBLEWORDS
	TAD XOUBUF
	DCA OUPTR	/INITIALIZE POINTER
	TAD OUJMPE
	DCA OUJMP	/RESET 3 WAY SWITCH
	JMP I OUSETP

OCHAR,	0
	AND (377	/CALLED WITH CHARACTER IN AC
	DCA OUTEMP
	JMS I [PASTST
	JMP I OCHAR
OUTSW,	KRS		/TEST FOR ^C WITH FLAG OR
			/JMP I OCHAR IF /P,/U OR PASS 2 /M
	TAD (-203
	SNA CLA
	KSF
	JMP .+2
	JMP I [7600	/SAVE CORE FOR SOME REASON
	ISZ OUJMP	/BUMP 3 WAY SWITCH
OUJMP,	HLT
	JMP OCHAR1
	JMP OCHAR2
OCHAR3,	TAD OUTEMP	/PICK UP CHARACTER
	CLL RTL
	RTL
	AND (7400	/3RD WORD MERGED INTO 2 BUFFER WORDS
	TAD I OUPOLD
	DCA I OUPOLD
	TAD OUTEMP
	CLL RTR
	RTR
	RAR
	AND (7400
	TAD I OUPTR
	DCA I OUPTR
	TAD OUJMPE
	DCA OUJMP	/RESET FOR NEW SET OF 3 CHARS
	ISZ OUPTR	/BUMP BUFFER POINTER

	ISZ OUDWCT
	JMP OUCOMN
	TAD OUCT	/YEP
	JMS OUTDMP	/WRITE IT
	JMS OUSETP	/RESET OUT BUFFER
	JMP I OCHAR
OCHAR2,	TAD OUPTR
	DCA OUPOLD	/FOR LATER
	ISZ OUPTR	/SECOND WORD GOES HERE
OCHAR1,	TAD OUTEMP
	DCA I OUPTR
OUCOMN,	JMP I OCHAR


OUTEMP,	0		/TEMP STORE
OUPOLD,	0		/HOLDS OLD POINTER
OUPTR,	0
OUJMPE,	JMP OUJMP
OUDWCT,	0
OUCT,	OUCTL


OOPEN,	0		/OPEN AN OUTPUT FILE;FETCH HANDLER
	TAD (OFILE
	DCA OUBLK	/POINT TO FILE NAME
	TAD XOUDEV
	DCA OUHNDL	/LEAVE ROOM FOR 2 PAGE HANDLER
	CDF 10
	TAD I [7600	/OUTPUT DEVICE #
	CDF 0
	CIF 10
	JMS I USR	/ASSIGN,FETCH HANDLER
	1
OUHNDL,	HLT		/GETS ENTRY POINT OF HANDLER
	JMP	HIOERR	/HANDLER FAILURE
OUENTR,	JMS I	(P2ADJ
	CDF 10
	TAD I [7600
	CDF 0
	CIF 10
	JMS I USR
	3		/ENTER OUTPUT FILE
OUBLK,	OFILE
OUELEN,	0		/RETURNS WITH LENGTH OF HOLE
	JMP OEFAIL
MP2,	DCA I (OUCCNT
	TAD OUBLK	/STARTING RECORD
	DCA OUREC
	JMS OUSETP	/SETUP OUTPUT AREA
	JMP I OOPEN
XOUDEV,	4001		/MAY BE ALTERED

OEFAIL,	CDF 10
	TAD I [7600
	AND (7760	/GET LENGTH PART
	SNA CLA		/WAS IT 0?
	JMP ERR3	/YEP..HE LOSES
	TAD I [7600
	AND [17		/TRY WITH INDETERMINATE LENGTH
	DCA I [7600
	JMP OUENTR

OUTDMP,	0		/WRITE ACTUAL OUTPUT
	DCA OUCTLW
	JMS I (OUNREC	/FIGURE # RECS TO WRITE
	TAD I (OUCCNT
	DCA I (OUCCNT	/UPDATE CLOSE LENGTH
	TAD I (OUCCNT
	CLL CML
	TAD OUELEN	/ROOM FOR THIS WRITE?
	SNL CLA
	JMP ERR4	/HE LOSES
	JMS I OUHNDL	/NJ WRITE IT
OUCTLW,	0
XOUBUF,	OUBUF
OUREC,	0
	JMP	HIOERR	/A HANDLER BADNESS
	JMS I (OUNREC
	TAD OUREC	/UPDATE OUTPUT RECORD #
	DCA OUREC
	JMP I OUTDMP

ERR4,	JMS I	[ERROR
	FULERR
ERR3,	JMS I	[ERROR
	ENTERR

	*2400
OCLOSE,	TAD	HCREF
	SZA CLA		/IF NOT LAST PASS
	JMP	NOVERS	/NO NEED FOR VERSION NO.
	JMS	CRLF
	TAD	("V-300^R+VERSN-"0+40
	JMS I	[DIVIDE
	TAD	(PATCHL	/PATCH NO.-ON PAGE
	JMS I	[OCHAR
	JMS	CRLF
	JMS FORM	/V3C
NOVERS,
	TAD	HCREF
	SNA	CLA	/IF /M PASS 1
	TAD (232
	JMS I [OCHAR	/NO 232
	JMS I [OCHAR
FILLIP,	JMS I [OCHAR	/FILL WITH 0'S
	TAD (177
	AND I (OUDWCT
	SZA CLA		/TO BOUNDARY YET?
	JMP FILLIP	/NO..KEEP FILLING
	TAD I (OUDWCT
	TAD (OUCTL&3700
	SNA		/FULL WRITE LEFT?
	JMP NODUMP	/YES..BUT ^Z IS OUT
	TAD (4000+OUFLD	/FORM WRITE
	JMS I (OUTDMP
NODUMP,	CIF 10
	JMS I USR
	10		/LOCK IN MONITOR
	TAD I	(OUREC	
	CDF 10
	DCA I	OUSAVX
	CDF	0
	TAD I	(OUELEN
	CDF	10
	DCA I	OUSAVX
	TAD	LNPRPG
	DCA I	OUSAVX
	TAD	OUCCNT
	DCA I	OUSAVX
	TAD I [7600
	CDF 0
	ISZ	HCREF
	JMP	NOD1
	CIF	10
	JMS I	[200
	6
BLK,	0
	0
NOD1,	CIF 10
	JMS I [200
	4		/CLOSE OUTPUT FILE
	OFILE		/POINTER TO FILE NAME
OUCCNT,	0		/CLOSING LENGTH
	JMP ERR5	/SORRY
/FOR LONG FILES(/M), IT WILL CHAIN TO ITSELF ON FIRST PASS.
/ON SECOND PASS,IT WILL DELETE FILE CREFTM.LS(IF NO E)
	ISZ	SLSWH	/DELETE TEMP FILE SWITCH
	JMP	ALDONE
	CLA IAC		/SYS
	CDF 0
	CIF 10
	JMS I	[200
	4		/DELETE CREFLS.TM
	CHANNM
	0
	CLA
ALDONE,	JMP I [7605
HCREF,	0
SLSWH,	0

ERR5,	JMS I	[ERROR
	CLSERR
ERR6,	JMS I	[ERROR
	INPERR


OFILE,	ZBLOCK 4	/OUTPUT FILE NAME GOES HERE

FORM,	0		/GENERATE 214 IF NOT TTY
	JMS I [PASTST	/IF PASS>1, NO FORM FEED
	JMP I FORM
	TAD TTYSWT
	SZA CLA
	JMP FORM2
	TAD LNPRPG	/FILL TO END OF PAGE
	SNA		/IF 0, GENERATE 8 LINE FEEDS
	TAD [-4
	DCA COUNT
	JMS CRLF	
	ISZ COUNT
	JMP CRLF1	/HA! GENERATE EXTRA LINE FEED!!
	TAD [-6
	DCA COUNT
	TAD ("-		/GENERATE ------
	JMS I [OCHAR
	ISZ COUNT
	JMP .-3
	TAD [-4
	DCA COUNT
FORM3,	JMS CRLF
	ISZ COUNT
	JMP CRLF1
	TAD LINES	/V3C
	NOP
	DCA LNPRPG	/RESET TO TOP OF PAGE
	JMP I FORM

FORM2,	CLA CMA
	DCA COUNT
	CMA
	JMP FORM3	/USE [215 TO GENERATE A 214

CRLF,	0		/GENERATE CRRIAGE RET AND LINE FEED
	TAD [215
	JMS I [OCHAR
CRLF1,	TAD [212
	JMS I [OCHAR
	JMP I CRLF

TTYSWT,	0


	*2600
IOPEN,	0
	CLA CMA
	DCA INCHCT	/FORCE READ OF NEW FILE
	ISZ INEOF
	TAD (7617
	DCA INFPTR
	JMP I IOPEN

INPTR,	INBUF

ICHAR,	0
INCHAR,	ISZ INJMP	/PACKING SWITCH
	ISZ INCHCT	/BUFFER EXHAUSTED?
INJMPP,	JMP INJMP	/NOPE
	TAD INEOF	/WAS LAST AN EOF?
	SNA CLA
	JMP INGBUF	/NO..GET NEXT INPUT
	CDF 10
	TAD I INFPTR
	CDF 0
	SNA CLA		/MORE INPUT?
	JMP I ICHAR	/NO..EOF RETURN

	JMS ASHDLR	/SET UP STRT RECORD
INGBUF,	JMS RDREC	/AND READ SOME RECORDS
	JMP INCHAR
			/THIS IS DONE TO OPTIMIZE THE DECTAPE
			/ROCKING. INITIALIZATION DOES THESE
			/THE FIRST TIME.


INJMP,	JMP .		/3 WAY SWITCH
	JMP ICHAR1
	JMP ICHAR2
ICHAR3,	TAD INJMPP
	DCA INJMP
	TAD I INPTR
	AND (7400	/CONTENTS OF BUFFER
	CLL RTR
	RTR
	TAD INCTLW
	RTR
	RTR		/GETS THIRD WORD FROM 1 AND 2
	ISZ INPTR	/NEXT BUFFER LOC
	JMP INCOMN
ICHAR2,	TAD I INPTR
	AND (7400
	DCA INCTLW	/TEMP SAVE
	ISZ INPTR
ICHAR1,	TAD I INPTR
INCOMN,	AND (177	/PARITY TEST
	SNA		/IF 200 CODE..IGNORE IT
	JMP INCHAR
	TAD [200
	TAD (-232	/IS IT ^Z?
	SNA
	JMP I ICHAR	/YES..NOMMORE!!
	TAD (232
	ISZ ICHAR	/SKIP EOF RETURN
	DCA CHAR
	JMP I ICHAR
INCHCT,	0
INFPTR,	7617
INEOF,	0
INCTR,	0
INHAND,	0

ASHDLR,	0

	CDF 10
	TAD I INFPTR
	AND (7760	/LENGTH PART OF WORD
	SZA		/0 IMPLIES .GTE. 256
	TAD [17
	CLL CML RTR
	RTR
	DCA INCTR
	ISZ INFPTR	/BUMP TO NEXT
	TAD I INFPTR	/GET STARTING RECORD
	DCA INREC
	ISZ INFPTR
	DCA INEOF
	CDF 0
	JMP I ASHDLR
XINREC,	2		/DEFAULT CONDITIONS
XINCL1,	401

RDREC,	0
	TAD INCTR
	CLL
	TAD XINRECS	/LINK ON IF OVERFLOW AND LAST READ
	SNL
	DCA INCTR	/UPDATE IF NO OVERFLOW
	SZL
	ISZ INEOF
	CLL CML CMA RTR	/CONTROL WORD FROM OVERFLOW
	RTR
	RTR
	TAD XINCL1
	DCA INCTLW
	CDF 0
	JMS I INHAND
INCTLW,	0
INBUFP,	INBUF
INREC,	0
	JMP INERRX	/FATAL OR EOF
INBREC,	TAD INREC
	TAD XINREC
	DCA INREC	/UPDATE # READ
	TAD INCTLW
	AND [7600
	CLL RAL
	TAD INCTLW
	AND [7600
	CMA
	DCA INCHCT	/NEW CHARACTER COUNT
	TAD INJMPP
	DCA INJMP
	TAD INBUFP
	DCA INPTR
	JMP I RDREC

INERRX,	ISZ INEOF	/FATAL OR EOF
	SMA CLA
	JMP INBREC	/EOF..NEXT FILE
	JMS I [ERROR
	INPERR

TTYPRT,	0		/SIMPLE TTY OUTPUT ROUTINE
	TLS
	TSF
	JMP .-1
	CLA
	JMP I TTYPRT


	*3000
HNDERR,	"H-300^R+"A-300		/HANDLER FAIL
	"N-300^R+"D-300
	"L-300^R+"E-300
	"R-300^R
	"F-300^R+"A-300
	"I-300^R+"L-300

SYMERR,	"S-300^R+"Y-300
	"M-300^R
	"O-300^R+"V-300
	"E-300^R+"R-300
	"F-300^R+"L-300
	"O-300^R+"W-300

LPTERR,	"D-300^R+"E-300		/DEV LPT BAD
	"V-300^R
	"L-300^R+"P-300
	"T-300^R
	"B-300^R+"A-300
	"D-300^R

ENTERR,	"E-300^R+"N-300
	"T-300^R+"E-300
	"R-300^R
	"F-300^R+"A-300
	"I-300^R+"L-300
	"E-300^R+"D-300

FULERR,	"O-300^R+"U-300
	"T-300^R
	"D-300^R+"E-300
	"V-300^R
	"F-300^R+"U-300
	"L-300^R+"L-300

CLSERR,	"C-300^R+"L-300
	"O-300^R+"S-300
	"E-300^R
	"F-300^R+"A-300
	"I-300^R+"L-300
	"E-300^R+"D-300

INPERR,	"I-300^R+"N-300
	"P-300^R+"U-300
	"T-300^R
	"E-300^R+"R-300
	"R-300^R+"O-300
	"R-300^R

REFERR,	2664		/2045 REFS
	3015
	"R-300
	"E-300^R+"F-300
	"S-300^R
	0

/LITERAL PROCESSORS. LITERALS ARE HANDLED ACCORDING TO THEIR
/BINARY DEFINITION. A CURRENT PAGE LITERAL AT,SAY, 0377 WILL
/BE CALLED _L0377. A PAGE ZERO LITERAL AT LOCATION 0100 WILL
/BE CALLED _L0100
/IF ASSEMBLED WITH NEW PAL8, LITERAL INCLUDES FIELD
/SO 00377 IS _00377, 10377 IS _10377

LIT2,	TAD (2540	/PAGE 0..FIRST NUMBER ALWAYS 0
	DCA SYM2	/_L GOES IN SYM1 FOR BOTH
	JMS	LCHK
	ISZ ISYM
	ISZ ISYM	/POINT TO SYM3 FOR LAST 2 DIGITS
	JMP LIT3	/COMMON CODE
LIT1,	JMS	LCHK
	ISZ ISYM	/POINT TO SECOND WORD
	TAD I XRLIT	/FIRST BINARY DIGIT
	JMS I [PACK
	TAD I XRLIT
	AND (266	/THIS KNOCKS OFF RELATIVE ADDRESS BIT
	JMS I [PACK	/GOES INTO RIGHT HALF OF SYM2
LIT3,	TAD DSWIT	/IF /D, DON'T CREF LITERALS
	SZA CLA
	JMP LITEX	/DON'T DO ANYTHING BUT CLEAR COUNTERS
	TAD (LITBUF+1	/NOW PICK UP RELATIVE ADD BIT FROM INSTRUCT.
	DCA XRLIT
	TAD I XRLIT
	AND (1
	TAD SYM2
	DCA SYM2	/FORMING ADDRESS OF LITERAL!
	TAD I XRLIT
	JMS I [PACK
	TAD I XRLIT
	JMS I [PACK	/LOAD UP SYM3
	TAD	ENDFIX	/WILL PRINT FIELD WITH LIT IF NEW PAL8
	AND	(57
	TAD	[2426
	DCA SYM1	/PUT IN _ (NEGATIVE!)
	JMS I (REPACK

	JMP I XUSSYM	/DO THE BOOKKEEPING
LITEX,	JMS I (REPACK
	JMP I [B
XUSSYM,	USSYM		/WILL BE CHANGED TO PATCH IF /L
LCHK,	0
	TAD	MARGIN
	DCA	XRLIT
	TAD I	XRLIT
	DCA	ENDFIX
	TAD	ENDFIX
	TAD	(-240
	SNA CLA
	JMP	LITEX
	JMP I	LCHK

GLIN5,	TAD	CRCNT
	SNA CLA
	JMP	CROUT	/NEED THIS CR
	ISZ	CRCNT
	JMP	CROUT	/NEED CR AFTER HEADER
	JMP I	(GETLIN
CROUT,	TAD	[212
	JMS I	FPUT
	TAD	MARGIN
	DCA	XRLINE
	JMP I	(GLIN6
CRCNT,	0
CHANNM,	FILENAME CREFLS.TM
ENDFIX,	0		/TEMP ALSO
	JMS I	(DOLOT2
	DCA	.-1	/ONCE ONLY
	TAD	SYSM
	SNA
	JMP I	(NDPS1
	JMP I	ENDFIX
	*3200
OUNREC,	0		/ESTIMATE # RECS
	TAD I	XOCTLW
	CLL RTL
	RTL
	RTL		/ITS NOT AN ESTIMATE, BUT EXACT!!
	AND [17
	JMP I OUNREC
XOCTLW,	OUCTLW

DIVIDE,	0
	DCA DIV45B
	DCA DIV45C
	JMP DIV45D	/START UP HERE

DIV45A,	ISZ DIV45C	/BUMP THE QUOTIENT
	DCA DIV45B	/NEW DIVIDEND
DIV45D,	TAD DIV45B
	TAD (-52	/DIVIDE BY 52
	SMA
	JMP DIV45A	/STILL +; KEEP LOOPING
	TAD (52		/REMAINDER IN AC AFTER ADD
	JMS I (DIVE	/LETTER OR NUMBER?
	DCA DIV45B
	TAD DIV45C
	JMS I (DIVE
	JMS I	[OCHAR
	TAD DIV45B
	JMS I [OCHAR
	ISZ BUFFER
	JMP I DIVIDE


DIV45B,	0
DIV45C,	0

GETLIN,	0		/GET A LINE OF INPUT AND STORE
	TAD MARGIN	/IT AT LINBUF
	DCA XRLINE
INLINE,	JMS I (ICHAR
	JMP EN
	TAD	RLSKIP	/IF RALF HEADER,ELIM 2 LF
	SNA CLA	
	JMP	REGULR	/NOT RALF
	ISZ	RLSKIP	/CATCH 2ND LINE
	JMP	INLINE
	TAD	[7776	/ELIM EXTRA CR AFTER HEADER
	DCA I	(CRCNT
REGULR,	TAD CHAR	/LINE FEED TERMINATES THIS ROUTINE
	TAD MLF
	SNA
	JMP INLINE	/IGNORE LF'S ON INPUT
	TAD [212-215	/LF-CR
	SNA CLA
	JMP GLIN3
	TAD XRLINE
	TAD (-375
	SMA CLA
	JMP .+3
	TAD CHAR
	JMS I FPUT
	TAD CHAR
	TAD [-214
	SZA CLA
	JMP	INLINE
GLIN3,	TAD [215
	JMS I FPUT
GLIN4,	JMP I	(GLIN5
GLIN6,	TAD	[200	/TEST FOR ^C
	KRS
	TAD (-203
	SNA CLA
	KSF
	JMP I	GETLIN
	JMP I [7605	/FOUND ^C
RLSKIP,	0

ALLOCT,	0
	JMS I	(DEVCHK
	7617		/CHECK INPUT DEVICE
	SPA CLA
	IAC		/2 PAGE HANDLER
	DCA	BUFCNT
	JMS I	(DEVCHK
	7600		/CHECK SIZE OF OUTPUT DEV HANDLER
	SPA CLA
	TAD	[2	/2 PAGES
	TAD	BUFCNT
	DCA	BUFCNT
	CLL
	TAD	BUFCNT
	RAR
	CLA
	SZL	CLL	/IF 1 OR 3,IN DEV IS 2 PGS
	TAD	[200
	TAD	(3601
	DCA I	(XOUDEV
	TAD	[-2
	TAD	BUFCNT
	SMA SZA CLA
	JMP I	ALLOCT	/2 2PAGERS IS DEFAULT
	TAD	(4200	/IF NOT 2 2PAGERS,INBUF AT 4200
	DCA I	(INBUFP
	TAD I	(INBUFP
	DCA I	(INPTR
	TAD	[3
	DCA I	(XINREC
	TAD	(601
	DCA I	(XINCL1
	JMP I	ALLOCT
BUFCNT,	0
CLEAR,	0		/ROUTINE TO CLEAN OUT OLD SYMBOL
	DCA SYM1
	DCA SYM2
	DCA SYM3
	JMP I CLEAR

EN,	JMS DPAT	/V3D
	JMP I [ENDPAS


	/THIS INITIALIZATION CODE IS DESTROYED WHEN DATA IS READ
/INTO THE BUFFER. FOR THAT REASON, CREF IS NOT RESTARTABLE

	*4200
ST1,	CDF 0
KLUD,	CIF 10
	JMS I USR
	5
	1423		/DEFAULT EXTENSION IS .LS
CHAIN,	CDF 10
	TAD I (7617	/IF NO INPUT, RESTART CD
	SNA CLA
	JMP ST1
	TAD I [7600	/IF NO OUTPUT, GIVE HIM LPT!!
	SZA CLA
	JMP ST2
	CDF 0
	CIF 10
	JMS I [200
	12		/ASSIGN-NO FETCH
	1420
DEVS,	2400
	0
	JMP ERRTWO	/DEFAULT DEVICE IS BAD
	TAD DEVS
	CDF 10
	DCA I [7600
ST2,	CDF	0
	JMS I	(SWITCH
	CDF	10
	TAD I	OUSAVX
	CDF	0
	DCA	PASS2
BLUE0,	TAD	[-4
	DCA	COUNT
BLUE,	CDF 10	
	TAD I XNAME
	CDF 0
	DCA I (OFILE
	ISZ XNAME
	ISZ (OFILE
	ISZ COUNT
	JMP BLUE
	JMS I	(ALLOCT
	JMS I (OTYPE
	AND (770	/CHECK FOR TTY AS OUTPUT	(CAN CLA IF DEBUGGING)
	DCA I (TTYSWT
	TAD I (TTYSWT	/IF LPT IS OUTPUT,
	SZA CLA		/NO INTERNAL FORM FEEDS GENERATED
	DCA I (NOFORM



/NOW WE MOVE UP THE PERMANENT AND PSEUDO-OP TABLES.
/THE Y WERE ASSEMBLED IN FIELD 0 TO SAVE DECTAPE MOTION
/WHEN LOADING.
	JMS I (FTEST	/GET MACHINE SIZE
	TAD	MAXFLD
	CIA
	DCA	MAXFLD	/- NO.FIELDS
	CDF 10		/ASSIGN THE INPUT HANDLER
	TAD I (7617
	CDF 0
	CIF 10
	JMS I USR
	1
INHNDL,	INDEVH+1
	HLT		/YECH!!!
	TAD INHNDL
	DCA I (INHAND	/SETUP ENTRY POINT
	JMS I (ASHDLR	/SET UP FIRST READ
	TAD (7700
	DCA USR	/SAVE SYMBOL TABLE
	TAD I (7746
	AND KLUD
	TAD [1000	/MARK NOT RESTARTABLE
	DCA I (7746	/SAVE CORE BIT
	TAD I XRLINE
	DCA COUNT	/INITIAL LOAD PROVIDES PARAMETERS FOR
			/THE SYMBOL TABLE. THIS IS # WORDS TO MOVE
	JMS MOVEM
	TAD RSWIT
	SNA CLA		/DETERMINE WHICH PSEUDO-OPS
	TAD (PPSEUD-SPSEUD
	TAD (SPSEUD-1
	DCA XRLINE
	TAD I XRLINE
	DCA PSEUDO	/TABLES INITIALLY HAVE A SHORT HEADER
			/WHICH CONTAINS INFORMATION ABOUT THEM
			/PSEUDO CONTAINS STARTING # OF FIRST



	TAD I XRLINE
	DCA PSEUDO+1	/LAST ENTRY #
	TAD I XRLINE
	DCA COUNT	/# ENTRIES TO MOVE
	TAD I XRLINE
	DCA XRLIT	/WHERE THEY GO IN FIELD 1
	JMS MOVEM
	JMP I (XFIRST	/READ FIRST RECORDS


MOVEM,	0
	TAD I XRLINE
	CDF 10
	DCA I XRLIT
	CDF 0
	ISZ COUNT
	JMP .-5
	JMP I MOVEM
ERRTWO,	JMS I [ERROR	/THIS IS AN IMPOSSIBLE ERROR
	LPTERR
CHANCK,	0
	CLL RTL		/CHECK FOR /C+/E
	RAL
	SNL
	JMP I	CHANCK	//C IS MINIMUM CONDITION
	RTR		/V3C USE /1 TO MEAN KEEP CREFLS.TM
	SNL	CLA
	CMA		/-1 IF NO E (I.E. DO ELIMINATE)
	DCA I	(SLSWH
	JMP I	CHANCK
XNAME,	7601	
PASS2,	0

PATCHA,	TAD (35
	DCA USER+1
	JMP BLUE0
	*4400
SWITCH,	0
	JMS I	(FILEXT
	CLA IAC
	CDF	10
	AND I (7644	/TEST FOR /X
	DCA DSWIT
	TAD I	(7643
	CDF	0
	JMS I	(CHANCK
	CDF	10
	CLA	CLL
	TAD I (7644
	AND (410	/P OR /U USED?
	SNA 
	JMP ST3
	CDF 0
	AND	[10
	SNA CLA
	JMP	TXONLY	/JUST /P
	TAD	XDOLL
	DCA I	(DOLL12	/NO SYMBOL TABLE
TXONLY,	TAD KILOUT	/YES..DISABLE PASS ONE OUTPUT
	DCA I [OUTSW
ST3,	CLA
	CDF	10
	TAD I	(7644
	CDF	0
	AND (300	/IF SABR (Q), SET RSWIT AND DSWIT
	SNA 
	JMP HCR1	/PAL8
	AND	[200	/CHECK FOR RALF
	SNA CLA
	JMP RALFCD	/Y
	ISZ RSWIT
	ISZ DSWIT
	DCA I (SCAN3	/ENABLE CHECK FOR SABR CHARS
HCR1,	CLA
	CDF	10
	TAD I	(7644	/CHECK FOR M- MAMMOTH FILE(HCREF)
	CDF	0
	SMA CLA
	JMP I	(BLUE0	/NOT LONG FILE
/PUT IN NECESSARY PATCHES
	CLL
	TAD	XPATCH
	DCA I	(HC1
	TAD	XPTCH1
	DCA I	(XUSSYM
	CDF	10
	TAD I	(7645
	RAR		/CHECK IF PASS1 OR 2 FOR /M
	SNL
	JMP	CHNPS1	/PASS 1
	RAL	CLL	/IT'S PASS 2
	DCA I	(7645	/RESTORE TBL
	CDF	0
	CIF	10
	JMS I	(7700	/RESTORE USR
	10
	TAD	KILOUT
	DCA I	[OUTSW	/NO LIST
	TAD	XDOLL
	DCA I	(DOLL12
	TAD	[7720
	DCA I	(PATCH1	/ANOTHER PATCH
	JMP I	SWITCH
CHNPS1,	CLL CML RAL
	DCA I	(7645	/SET /9 SWITCH
	CDF	0
	CLA CMA
	DCA I	(HCREF	/7777 DURING PASS1
	JMS I	(CHNSET	/LOOKUP CREF.SV
	JMP I (PATCHA
XPATCH,	PATCH&177+5200
XPTCH1,	PATCH
XDOLL,	DOLL13&177+5200
RALFCD,	TAD	[7776	/FOR 2 EXTRA LINE FEEDS
	DCA I	(RLSKIP
	JMP	HCR1
KILOUT,	OCHAR&177+5600	/JMP I OCHAR


/SUBROUTINE TO DETERMINE CORE SIZE
FTEST,	0
	JMS I	(MORCOR
COR0,	CDF	0
	TAD	MAXFLD	/GET FIELD TO TEST
	RTL
	RAL
	AND	COR70
	TAD	COREX
	DCA	.+1
COR1,	CDF		/FIELD TO TEST
	TAD I	CORLOC
COR2,	NOP
	DCA	COR1
	TAD	COR2
	DCA I	CORLOC
COR70,	70
	TAD I	CORLOC
CORX,	7400
	TAD	CORX
	TAD	CORV
	SZA CLA
	JMP	COREX	/NON-EXISTENT FIELD
	TAD	COR1
	DCA I	CORLOC
	ISZ	MAXFLD
	JMP	COR0
COREX,	CDF 0
DONCOR,	JMP I	FTEST
CORLOC,	CORX
CORV,	1400

	FIELD 0
/THESE ARE THE PERMANENT AND PSEUDO OP TABLES FOR CREF
/RAD IS THE BASE USED TO PACK THE CHARACTERS. FOR SABR IT MAY
/HAVE TO BE MOVED TO 51 RATHER THAN 45.

RAD=52

	*4600

SYMTAB,	-453		/INITIAL ENTRIES

	NOPUNCH
	*0
	ENPUNCH
	ZBLOCK 4	/DUMMY ENTRY..SYMCHK NEEDS IT


	"A-300^RAD+"N-300+4000	/AND
	"D-300^RAD
	ZBLOCK 2

	"B-300^RAD+"S-300+4000	/BSW
	"W-300^RAD
	ZBLOCK 2

	"C-300^RAD+"A-300+4000	/CAF
	"F-300^RAD
	ZBLOCK 2

	"C-300^RAD+"D-300+4000	/CDF
	"F-300^RAD
	ZBLOCK 2

	"C-300^RAD+"I-300+4000	/CIA
	"A-300^RAD
	ZBLOCK 2

	"C-300^RAD+"I-300+4000	/CIF
	"F-300^RAD
	ZBLOCK 2

	"C-300^RAD+"L-300+4000	/CLA
	"A-300^RAD
	ZBLOCK 2

	"C-300^RAD+"L-300+4000	/CLL
	"L-300^RAD
	ZBLOCK 2

	"C-300^RAD+"M-300+4000	/CMA
	"A-300^RAD
	ZBLOCK 2

R=52

	"C-300^R+"M-300+4000	/CML
	"L-300^R
	ZBLOCK 2

	"D-300^R+"C-300+4000	/DCA
	"A-300^R
	ZBLOCK 2
	"G-300^R+"L-300+4000	/GLK
	"K-300^R
	ZBLOCK 2

	"G-300^R+"T-300+4000	/GTF
	"F-300^R
	ZBLOCK 2

	"H-300^R+"L-300+4000	/HLT
	"T-300^R
	ZBLOCK 2

	"I-300^R+"A-300+4000	/IAC
	"C-300^R
	ZBLOCK 2

	"I-300^R+"O-300+4000	/IOF
	"F-300^R
	ZBLOCK 2

	"I-300^R+"O-300+4000	/ION
	"N-300^R
	ZBLOCK 2

	"I-300^R+"O-300+4000	/IOT
	"T-300^R
	ZBLOCK 2

	"I-300^R+"S-300+4000	/ISZ
	"Z-300^R
	ZBLOCK 2

	"J-300^R+"M-300+4000	/JMP
	"P-300^R
	ZBLOCK 2

	"J-300^R+"M-300+4000	/JMS
	"S-300^R
	ZBLOCK 2

	"K-300^R+"C-300+4000	/KCC
	"C-300^R
	ZBLOCK 2

	"K-300^R+"C-300+4000	/KCF
	"F-300^R
	ZBLOCK 2

	"K-300^R+"I-300+4000	/KIE
	"E-300^R
	ZBLOCK 2

	"K-300^R+"R-300+4000	/KRB
	"B-300^R
	ZBLOCK 2

	"K-300^R+"R-300+4000	/KRS
	"S-300^R
	ZBLOCK 2

	"K-300^R+"S-300+4000	/KSF
	"F-300^R
	ZBLOCK 2

	"L-300^R+"A-300+4000	/LAS
	"S-300^R
	ZBLOCK 2

	"M-300^R+"Q-300+4000	/MQA
	"A-300^R
	ZBLOCK 2

	"M-300^R+"Q-300+4000	/MQL
	"L-300^R
	ZBLOCK 2

	"N-300^R+"O-300+4000	/NOP
	"P-300^R
	ZBLOCK 2

	"O-300^R+"P-300+4000	/OPR
	"R-300^R
	ZBLOCK 2

	"O-300^R+"S-300+4000	/OSR
	"R-300^R
	ZBLOCK 2

	"P-300^R+"C-300+4000	/PCE
	"E-300^R
	ZBLOCK 2

	"P-300^R+"C-300+4000	/PCF
	"F-300^R
	ZBLOCK 2

	"P-300^R+"L-300+4000	/PLS
	"S-300^R
	ZBLOCK 2

	"P-300^R+"P-300+4000	/PPC
	"C-300^R
	ZBLOCK 2

	"P-300^R+"S-300+4000	/PSF
	"F-300^R
	ZBLOCK 2

	"R-300^R+"A-300+4000	/RAL
	"L-300^R
	ZBLOCK 2

	"R-300^R+"A-300+4000	/RAR
	"R-300^R
	ZBLOCK 2

	"R-300^R+"D-300+4000	/RDF
	"F-300^R
	ZBLOCK 2

	"R-300^R+"F-300+4000	/RFC
	"C-300^R
	ZBLOCK 2

	"R-300^R+"I-300+4000	/RIB
	"B-300^R
	ZBLOCK 2

	"R-300^R+"I-300+4000	/RIF
	"F-300^R
	ZBLOCK 2

	"R-300^R+"M-300+4000	/RMF
	"F-300^R
	ZBLOCK 2

	"R-300^R+"P-300+4000	/RPE
	"E-300^R
	ZBLOCK 2

	"R-300^R+"R-300+4000	/RRB
	"B-300^R
	ZBLOCK 2

	"R-300^R+"S-300+4000	/RSF
	"F-300^R
	ZBLOCK 2

	"R-300^R+"T-300+4000	/RTF
	"F-300^R
	ZBLOCK 2

	"R-300^R+"T-300+4000	/RTL
	"L-300^R
	ZBLOCK 2

	"R-300^R+"T-300+4000	/RTR
	"R-300^R
	ZBLOCK 2

	"S-300^R+"G-300+4000	/SGT
	"T-300^R
	ZBLOCK 2

	"S-300^R+"K-300+4000	/SKON
	"O-300^R+"N-300
	ZBLOCK 2

	"S-300^R+"K-300+4000	/SKP
	"P-300^R
	ZBLOCK 2

	"S-300^R+"M-300+4000	/SMA
	"A-300^R
	ZBLOCK 2

	"S-300^R+"N-300+4000	/SNA
	"A-300^R
	ZBLOCK 2

	"S-300^R+"N-300+4000	/SNL
	"L-300^R
	ZBLOCK 2

	"S-300^R+"P-300+4000	/SPA
	"A-300^R
	ZBLOCK 2

	"S-300^R+"R-300+4000	/SRQ
	"Q-300^R
	ZBLOCK 2

	"S-300^R+"T-300+4000	/STA
	"A-300^R
	ZBLOCK 2

	"S-300^R+"T-300+4000	/STL
	"L-300^R
	ZBLOCK 2

	"S-300^R+"W-300+4000	/SWP
	"P-300^R
	ZBLOCK 2

	"S-300^R+"Z-300+4000	/SZA
	"A-300^R
	ZBLOCK 2

	"S-300^R+"Z-300+4000	/SZL
	"L-300^R
	ZBLOCK 2

	"T-300^R+"A-300+4000	/TAD
	"D-300^R
	ZBLOCK 2

	"T-300^R+"C-300+4000	/TCF
	"F-300^R
	ZBLOCK 2

	"T-300^R+"F-300+4000	/TFL
	"L-300^R
	ZBLOCK 2

	"T-300^R+"L-300+4000	/TLS
	"S-300^R
	ZBLOCK 2

	"T-300^R+"P-300+4000	/TPC
	"C-300^R
	ZBLOCK 2

	"T-300^R+"S-300+4000	/TSF
	"F-300^R
	ZBLOCK 2

	"T-300^R+"S-300+4000	/TSK
	"K-300^R
	ZBLOCK 2
	-1
	-1
	-1
	-1		/DUMMY LOW ENTRY


/PSEUDO OP TABLES. ENTRIES ARE SAME FORMAT AS PAL8
/SYMBOLS.

	*.+SYMTAB

SPSEUD,	1706		/SABR PSEUDOS. BEGINS AT 1706*4
	1737		/ENDS AT 1737*4
	-150		/150 LOCATIONS LONG
	7427		/STARTS LOADING AT 17430

	NOPUNCH
	*7430
	ENPUNCH

	ZBLOCK 4


	"A-300^R+"B-300	/ABSYM
	"S-300^R+"Y-300
	"M-300^R
	B		/RETURN POINT

	"A-300^R+"R-300	/ARG
	"G-300^R
	0
	B

	"B-300^R+"L-300		/BLOCK
	"O-300^R+"C-300
	"K-300^R
	B

	"C-300^R+"A-300		/CALL
	"L-300^R+"L-300
	0
	B

	"C-300^R+"O-300		/COMMON
	"M-300^R+"M-300
	"O-300^R+"N-300
	B

	"C-300^R+"P-300		/CPAGE
	"A-300^R+"G-300
	"E-300^R
	B

	"D-300^R+"E-300		/DECIM
	"C-300^R+"I-300
	"M-300^R
	B

	"D-300^R+"U-300		/DUMMY
	"M-300^R+"M-300
	"Y-300^R
	B

	"E-300^R+"A-300		/EAP
	"P-300^R
	0
	B

	"E-300^R+"N-300		/END
	"D-300^R
	0
EPASS,	DOLL1	/BECOMES ENDPAS

	"E-300^R+"N-300		/ENTRY
	"T-300^R+"R-300
	"Y-300^R
	B

	"F-300^R+"O-300		/FORTR
	"R-300^R+"T-300
	"R-300^R
	B

	"I-300^R
	0
	0
	B			/I

	"I-300^R+"F-300		/IF
	0
	0
	B

	"I-300^R+"N-300		/INC
	"C-300^R
	0
	B

	"L-300^R+"A-300		/LAP
	"P-300^R
	0
	B

	"O-300^R+"C-300		/OCTAL
	"T-300^R+"A-300
	"L-300^R
	B

	"O-300^R+"P-300		/OPDEF
	"D-300^R+"E-300
	"F-300^R
FXR2,	FXMR

	"P-300^R+"A-300		/PAGE
	"G-300^R+"E-300
	0
	B

	"P-300^R+"A-300		/PAUSE
	"U-300^R+"S-300
	"E-300^R
	B

	"R-300^R+"E-300		/REORG
	"O-300^R+"R-300
	"G-300^R
	B

	"R-300^R+"E-300		/RETRN
	"T-300^R+"R-300
	"N-300^R
	B

	"S-300^R+"K-300		/SKPDF
	"P-300^R+"D-300
	"F-300^R
FXR3,	FXMR

	"T-300^R+"E-300		/TEXT
	"X-300^R+"T-300
	0
	TXT

	-1
	-1
	-1
	-1



/PAL8 PSEUDOS. SAME FORMAT AS OTHERS

	*5424
	ENPUNCH

PPSEUD,	1706
	1737
	-150
	7427

	NOPUNCH
	*7430
	ENPUNCH

	ZBLOCK 4


	"D-300^R+"E-300		/DECIMAL
	"C-300^R+"I-300
	"M-300^R+"A-300
	B

	"D-300^R+"E-300		/DEVICE
	"V-300^R+"I-300
	"C-300^R+"E-300
	B

	"D-300^R+"T-300		/DTORG
	"O-300^R+"R-300
	"G-300^R
	B

	"E-300^R+"J-300		/EJECT
	"E-300^R+"C-300
	"T-300^R
	NOTBIN		/SKIP ANY MORE TEXT

	"E-300^R+"N-300		/ENPUNCH
	"P-300^R+"U-300
	"N-300^R+"C-300
	B

	"E-300^R+"X-300		/EXPUNGE
	"P-300^R+"U-300
	"N-300^R+"G-300
XPJ,	XPUNJ

	"F-300^R+"I-300		/FIELD
	"E-300^R+"L-300
	"D-300^R
	B

	"F-300^R+"I-300		/FILENAME
	"L-300^R+"E-300
	"N-300^R+"A-300
	B

	"F-300^R+"I-300		/FIXMRI
	"X-300^R+"M-300
	"R-300^R+"I-300
FXR,	FXMR

	"F-300^R+"I-300		/FIXTAB
	"X-300^R+"T-300
	"A-300^R+"B-300
FXT,	FXTAB

	"I-300^R		/I
	ZBLOCK 2
	B

	"I-300^R+"F-300		/IFDEF
	"D-300^R+"E-300
	"F-300^R
	B

	"I-300^R+"F-300		/IFNDEF
	"N-300^R+"D-300
	"E-300^R+"F-300
	B

	"I-300^R+"F-300		/IFNZRO
	"N-300^R+"Z-300	
	"R-300^R+"O-300
	B

	"I-300^R+"F-300		/IFZERO
	"Z-300^R+"E-300
	"R-300^R+"O-300
	B

	"N-300^R+"O-300		/NOPUNCH
	"P-300^R+"U-300
	"N-300^R+"C-300
	B

	"O-300^R+"C-300		/OCTAL
	"T-300^R+"A-300
	"L-300^R
	B

	"P-300^R+"A-300		/PAGE
	"G-300^R+"E-300
	0
	B

	"P-300^R+"A-300		/PAUSE
	"U-300^R+"S-300
	"E-300^R
	B

	"R-300^R+"L-300		/RELOC
	"L-300^R+"O-300
	"C-300^R
	B

	"T-300^R+"E-300		/TEXT
	"X-300^R+"T-300
	0
	TXT

	"X-300^R+"L-300		/XLIST
	"I-300^R+"S-300
	"T-300^R
	B

	"Z-300^R		/Z
	ZBLOCK 2
	B

	"Z-300^R+"B-300		/ZBLOCK
	"L-300^R+"O-300
	"C-300^R+"K-300
	B

	-1
	-1
	-1
	-1



	*5600
/THIS CODE IS EXECUTED DURING PASS ONE ONLY. LATER PASSES
/USE THIS AREA TO BUILD A REFERENCE TABLE.


HEADER,	0	/HEADER SWITCHES FPUT TO JMS I [OCHAR
	TAD CPCHIT
	DCA FPUT	/ADDRESS OF PUNCH ROUTINE
	JMS I CGTLIN	/CALL GETLIN
	TAD CSTRIT	/RESTORE FPUT
	DCA FPUT
	JMP I HEADER
CPCHIT,	PNCHIT
CGTLIN,	GETLIN
CSTRIT,	STORIT

PNCHIT,	0
	JMS I COCHAR
	JMP I PNCHIT

STORIT,	0
	DCA I XRLINE
	JMP I STORIT
COCHAR,	OCHAR

DOLL1,	TAD (ENDPAS
	DCA DOLLAR
	JMS DPAT
DOLL12,	TAD (KRS	/BECOMES JMP .+2 IF /M PASS 2 OR /U
	DCA I (OUTSW	/RE ENABLE OUTPUT
DOLL13,	CDF 10
	TAD RSWIT
	SNA CLA
	JMP DOLL2	/PAL8 PSEUDOS
	TAD (B
	DCA I (FXR2
	TAD (B
	DCA I (FXR3
	TAD (ENDPAS
	DCA I (EPASS	/END PSEUDO NOW TO ENDPAS
	JMP DOLOUT
DOLL2,	TAD (B
	DCA I (XPJ
	TAD (B
	DCA I (FXR
	TAD (B
	DCA I (FXT
DOLOUT,	CDF 0
	JMS	DOLOT2
	JMP I (NOTBIN
FUDGE,	NOP


XPUNJ,	DCA COUNT
	CLA CMA
	TAD USER+1	/SKIP LAST ENTRY (7777)
	CLL RTL
XPUNJ3,	DCA BUFFER	/POINTER INTO SYMBOLS
	CDF 10
	TAD I BUFFER
	TAD (5336	/IS THIS A LITERAL?
	SNA CLA
	JMP XPUNJ1	/YES..NEXT ENTRY
	TAD COUNT	/NO..NOW PUSH ALL LITERALS UP
	CLL RTL		/BUT IF COUNT =0, THERE ARE NONE
	CMA
	DCA SAVE
	TAD (3
	TAD BUFFER	/SETTING UP TO DO TRANSFER. IF COUNT=0
	DCA XRSYM1	/ONLY THE 7777 GETS TRANSFERRED
	TAD (3
	DCA XRSYM2
	TAD I XRSYM1
	DCA I XRSYM2
	ISZ SAVE	/ALL COMPLETED?
	JMP .-3
	TAD COUNT
	IAC		/INCLUDE 7777 ENTRY!
	DCA USER+1
	CDF 0
	JMP I (B
XPUNJ1,	TAD (-4
	TAD BUFFER
	ISZ COUNT
	JMP XPUNJ3

XFIRST,	JMS I	(OOPEN
	JMP I	(FIRST+1

DOLOT2,	0
	STL RTL		/IF WE HAVE MORE THAN 2 FIELDS,
	TAD	MAXFLD	/WE SHALL LEAVE THE SYMBOL TABLE IN ONE
			/PIECE. THAT ALLOWS US TO USE THE UPPER
	SZL CLA		/CORE PROFITABLY
	JMP I DOLOT2
	TAD USER+1
	CLL RTL
	TAD (4		/CLEARS SYMBOL TABLE
	DCA I (LTTBL+1	/FIX PERMANENT LIMIT IN FIELD 1
	DCA SYMFLD	/AND FAKE THAT FLD 1 HAS NO SYMBOLS
	TAD FUDGE	/DISABLE RESET OF FIELD 1 LIMIT
	DCA I (FUJ1
	JMP I	DOLOT2

CHNSET,	0
	CLA IAC		/SYS DEV ONLY
	CIF 10
	JMS I	(200
	2		/LOOKUP
STBLK,	CREFNM		/GET CREF STARTING BLK
	0
	JMP I	(ERR6
	TAD	STBLK
	DCA I	(BLK
	JMP I	CHNSET
CREFNM,	FILENAME CREF.SV
	PAGE

FXMR,	TAD I XRLINE	/SHOULD CONTAIN FIRST CHAR IN INSTR.
	DCA CHAR
	JMS I (CHECK	/CHECK IT
	301
	-332
	JMP .+4		/NOPE;A NUMBER MAYBE?
FX2,	TAD CHAR
	JMS I (PACK
	JMP FXMR
	JMS I (CHECK
	260
	-271		/CHECK FOR DIGIT 0-9
	SKP		/NOPE. IF THERE IS A SYMBOL, THIS IS TERMINATOR
	JMP FX2
	JMS I (REPACK
	TAD SYM1
	SNA CLA
	JMP FXMR
	CDF	10
	TAD I	(7644	/M RULES FOR FIXMRI TOO
	CDF	0
	SMA CLA
	JMP	FXNTR	/NO M
	TAD I	(PATCH1
	DCA	PATCH2	/APPROPRIATE SWITCH
	TAD	SYM1
	RTL
PATCH2,	HLT		/SPA SZA OR SMA SNL + CLA
	JMP I	(B
FXNTR,	JMS I (SYMCHK
	USER
	JMS I (ENTRY	/ENTER AS USER SYMBOL
	JMS I (BUMP
	JMP I (B
FXTAB,	CLA CMA		/DON'T INCLUDE 7777 ENTRY
	TAD USER+1
	CIA
	DCA COUNT	/# ENTRIES TO EXAMINE
	DCA SAVE
FXTB2,	TAD (4
	TAD SAVE
	DCA SAVE
FXTB9,	CDF 10
	TAD I SAVE	/STOP AS SOON AS LITERAL FOUND
	TAD (5336
	SNA CLA
	JMP FXTB3
	TAD I SAVE	/IF ALREADY NEG. ITS A PERM SYMBOL
	SMA
	TAD (4000	/MAKE IT PERMANENT
	DCA I SAVE
	ISZ COUNT
	TAD (3
	TAD SAVE
	DCA SAVE
	DCA I SAVE
	ISZ SAVE
	JMP FXTB9	/LOOP FOR DURATION
FXTB3,	CDF 0
	JMP I (B

DEVCHK,	0
	TAD I	DEVCHK
	DCA	T2		/SAVE TBL START
	ISZ	DEVCHK
	CDF	10
	TAD I	T2		/HANDLER NUMBER
	AND	(17
	DCA	T2
	CLA CMA
	TAD I	(37		/TBL LOCN IN 10037
	TAD	T2
	DCA	T2
	TAD I	T2
	CDF	0
	JMP I	DEVCHK
T2,	0
/THAT'S ALL FOLKS!!
$$$$$$$$$$$$$$$$$$

