	.TITLE DDT
/
/  26 APR 71	MOD BY P. HENDERSON TO ADVANCE CURRENT ADDRESS BY
/		TWO WHEN IN TEXT OUTPUT MODE
PDP9=0	/ASSEMBLY PARAMETER FOR UNIVERSITY OF WATERLOO
/
/ EDIT #3	4-30-70
/
/COPYRIGHT 1969, DIGITAL EQUIPMENT
/CORP., MAYNARD, MASS.
/
/VERSION V6A
/
/16 APRIL 1969
/
/PARAMETER ASSIGNMENTS
	.IFUND	PDP9
PDP15=0
	.ENDC
	.IFUND	.DAT
	.IFDEF	PTP
.DAT=136
	.ENDC
	.IFUND	PTP
.DAT=141
	.ENDC
	.ENDC
.COMTB=.DAT+11
.SCOM=100
BASE=14210
ANOPAT=122
APDP15=-56
RES=707742
LACQ=641002
LMQ=652000
/.LOC FOR PAPER TAPE VERSIONS
	.IFDEF	PTP
	.IFDEF	BF
	.END
	.ENDC
	.IFUND	PDP15
	.ABS	NLD
	.ENDC
	.IFDEF	PDP15
	.ABSP	NLD
	.ENDC
	.IFUND	PAGE
PAGE=1
	.ENDC
BANK=PAGE-1/2
BANK1=PAGE/2
	.IFNZR	BANK1*2-PAGE
APAGE=PAGE-1*10000
	.ENDC
	.IFZER	BANK1*2-PAGE
APAGE=PAGE-1*10000+57
	.ENDC
	.IFUND	NOPAT
	.IFUND	PDP15
	.LOC	APAGE+BASE
	.ENDC
	.IFDEF	PDP15
	.LOC	APAGE+BASE+APDP15
	.ENDC
	.ENDC
	.IFDEF	NOPAT
	.IFUND	PDP15
	.LOC	APAGE+BASE+ANOPAT
	.ENDC
	.IFDEF	PDP15
	.LOC	APAGE+BASE+ANOPAT+APDP15
	.ENDC
	.ENDC
/PAPER TAPE INTERFACE
PRE	LAC	PRESTT
	DAC*	PRE105
	LAC	PREVCH
	.IFNZR BANK1*2-PAGE
	DAC* PRE103
	.ENDC
	.IFZER BANK1*2-PAGE
	XOR XCTN+1
	DAC* PRE120
	.ENDC
	LAC*	PRE106
	DAC	.+2
	JMP*	.+1
	XX
PRESTT	START
PRE105	105
PREVCH	ACH-1
	.IFDEF PRE103
PRE103	103
	.ENDC
	.IFDEF PRE120
PRE120	120
	.ENDC
PRE106	106
	.ENDC
/DECTAPE SYSTEMS HAVE NO PATCH FILE CAPACITY
	.IFUND	PTP
NOPAT=0
	.ENDC
/SPECIAL DDT REGISTERS
ACH	RES			/AC - FIRST ADDRESS OF DDT
LKH	0			/LINK STORED IN BIT 17
MQH	0			/MQ STORED HERE IF EAE AVAILABLE
LRH	0		/LIMIT REGISTER STORED HERE
XH	0		/INDEX REGISTER STORED HERE
MKH	-1			/DEFAULT SEARCH MASK
LOH	.SCOM+6+620000		/LOWER LIMIT SEARCHES
HIH	LKH			/UPPER LIMIT SEARCHES
RGH	.BLOCK	4		/REGISTER TO BE TYPED OUT ON BREAK
INH	.BLOCK	4		/INSTRUCTION TO BE EXECUTED ON BREAK
	.BLOCK	4		/TRANSFER VECTOR STORAGE
PRH	-1			/PROCEED COUNT
LIM1	LIM1-1			/FIRST UNMODIFIABLE REGISTER IN DDT
/FLAGS WHICH HAVE INITIAL VALUES
SUP	1			/ZERO SUPPRESSION
XCTF	0			/EXECUTE FLAG
MODE	JMS	INSPR		/MODE INSTRUCTION
AXH	17			/DDT AUTO-INDEX REGISTER
TABC	0			/TAB COUNTER (TELETYPE)
/POINTERS
TAB2P	TAB2			/BEGINNING OF Q# SYMBOL TABLE ENTRY (USED ONLY ON INPUT)
TAB4P	TAB4			/BEGINNING OF INST. MNEMONICS TABLE (USED ON OUTPUT)
TAB1P	TAB1			/BEGINNING OF ADDRESS TABLE (USED ON INPUT ONLY)
TAB3P	TAB3			/BEGINNING OF ADDRESS TABLE (USED ON OUTPUT ONLY)
TAB3M	PAH+1			/CURRENT END+1 OF DDT SYMBOL TABLE
TAB3M1	PAH+1			/FIRST MODIFIABLE SYMBOL TABLE ENTRY
TABMAX	FIRST			/ADDRESS+1 OF MAXIMUM DDT TABLE ENTRY
HEAD	PAH-1			/HEAD ADDRESS OF CURRENT PROGRAM SYMBOL TABLE ENTRIES
LOWSYM	STARE			/INITIALIZED TO FIRST ADDRESS OF USER SYMBOL TABLE
TOP	0		/INITIALIZED TO BE 2S COMP FIRST NON-EXISTENT MEMORY LOCATION
/DATA REGISTERS
	.IFUND	BF
	.IFUND	PDP7
APIMSG	4311			/API
	.ENDC
	.ENDC
	.IFDEF	BF
BFMSG	006560	/BF
	.ENDC
M3100	774700			/-50**2
	777730			/-50
	777777			/-1
LIMIT	-100			/LIMIT OF RELATIVE ADDRESSING
/
/DDT SYMBOL TABLE
/
TAB2	070130			/Q#
QH	0			/CONTENTS OF MOST RECENTLY OPENED STORAGE WORD
/MNEMONIC INSTRUCTION TABLE
TAB4	011364;	CAL
DACN	014453;	DAC
JMSN	040233;	JMS
DZMN	016435;	DZM
LACN	045453;	LAC
	114152;	XOR
ADDN	003344;	ADD
	076454;	TAD
XCTN	113214;	XCT
	035522;	ISZ
ANDN	004164;	AND
SADN	073354;	SAD
JMPN	040230;	JMP
EAEN	017555;	EAE
IOTN	035254;	IOT
	062100;	721000	/PAX
	062064;	722000	/PAL
AACN	003153;	723000	/AAC
	063701;	724000	/PXA
AXSN	005023;	725000	/AXS
	063714;	726000	/PXL
	062741;	730000	/PLA
	062770;	731000	/PLX
	012270;	735000	/CLX
	412254
	070200;	736000	/CLLR
AXRN	005022;	737000	/AXR
	060122;	OPR
NOPN	054750;	NOP
	012311;	CMA
	012324;	CML
	070264;	RAL
	070272;	RAR
	034153;	740030	/IAC
	074311;	SMA
SZAN	075321;	SZA
	074374;	SNL
SKPN	074210;	SKP
	074501;	SPA
SNAN	074361;	SNA
	075334;	SZL
	071654;	RTL
	071662;	RTR
	475140
	003100;	742030	/SWHA
	012254;	CLL
	074754;	STL
	070404;	RCL
	070412;	RCR
	012241;	CLA
	012243;	CLC
	026653;	GLK
LAWN	045477;	LAW
/BEGINNING OF INPUT ADDRESS TABLE
TAB1	171700			/#
H	0			/RELOCATION FACTOR FOR CURRENT PROGRAM
	127400			/.
P	0			/ADDRESS OF MOST RECENTLY OPENED WORD
	073417			/SA#
SAH	0			/STARTING ADDRESS OF USER PROGRAM
	010527			/B1#
B1H	0			/ADDRESS OF BREAKPOINT 1
	010577			/B2#
B2H	0			/ADDRESS OF BREAKPOINT 2
	010647			/B3#
B3H	0			/ADDRESS OF BREAKPOINT 3
	010717			/B4#
B4H	0			/ADDRESS OF BREAKPOINT 4
/BEGINNING OF OUTPUT ADDRESS SYMBOL TABLE
TAB3	006130			/A#
	ACH			/ADDRESS OF REGISTER IN DDT WHERE AC STORED
	050430			/L#
LKH1	LKH			/ADDRESS OF REGISTER IN DDT WHERE LINK STORED
	052017			/MQ#
	MQH			/ADDRESS OF REGISTER IN DDT WHERE MQ STORED
	046767		/LR#
	LRH		/LIMIT REGISTER STORED IN THIS ADDRESS
	116030		/X#
	XH		/INDEX REGISTER STORED IN THIS ADDRESS
	053530			/M#
	MKH			/ADDRESS IN DDT OF DEFAULT SEARCH MASK
	046577		/LO#
	LOH		/LOWER LIMIT SEARCH OPERATIONS STORED IN THIS ADDRESS
	031617		/HI#
	HIH		/UPPER LIMIT SEARCH OPERATIONS STORED IN THIS ADDRESS
	073230			/R#
	RGH-1			/ADDRESS IN DDT CONTAINING REGISTER TO BE DISPLAYED ON BKPT1
	037130			/I#
	INH-1			/ADDRESS IN DDT CONTAINING INSTRUCTION TO BE EXECUTED ON BKPT1
	107630		/V#
	INH+3		/ADDRESS OF FIRST TRANS. VECTOR - 1 STORED HERE
	014330		/C#
	PRH			/ADDRESS IN DDT CONTAINING PROCEED COUNT
	265030			/P#'
PAH	.COMTB+2		/FIRST PATCH ADDRESS
/INITIALIZATION OF DDT-OVERLAID BY SYMBOL TABLE
/
START=.
	.IFDEF	BF
	STARET+300000	/^T RETURN ADDR+MP+EM
	JMS	CRLF	/STOP TT AND GIVE CR LF
			/BUT DO NOT CHANGE STATE OF ^P
	.ENDC
	.IFUND	BF
	JMS	CRLF
	CLC			/SET UP ILLEGAL CAL RETURN TO STARE
	.IFDEF	PTP
	.IFDEF	PDP15
	.LOC	.-1
	LAW	-2
	.ENDC
	.ENDC
	TAD*	PAH
	DAC	PAH
	.IFDEF	PTP
	.IFDEF	PDP15
	LAC	ACH
	DAC*	PAH
	ISZ	PAH
	.ENDC
	.ENDC
	LAC	LOH
	DAC*	PAH
	.ENDC
	LAC*	SHOT3		/SET UP SA#
	AND (77777
	DAC	SAH
	.IFUND	BF
	LAC	LOWSYM
	DAC*	SHOT3
	.ENDC
	.IFDEF	BF
	LAC*	(.SCOM
	.ENDC
	.IFDEF	PDP15
	AND	(70000
	XOR	(7777
	.ENDC
	.IFUND	PDP15
	AND (60000
	XOR (17777
	.ENDC
	CMA
	DAC TOP
	LAC*	SHOT1		/.SCOM+1 POINTS TO BEGINNING OF LOADER SYMBOL TABLE
	AND	(77777		/TRIM EXTRANEOUS BITS
	.IFDEF	BF
	DAC	SHOT3
	.ENDC
	DAC	PAH
	DAC	LOWSYM
	.IFUND	BF
	JMS	TWOCMA
	TAD*	TYI
	SMA
	JMP	OK1
	LAC	CH	/.LO
	JMS	SQPR
	LAC	QUASH	/AD
	JMS	SQPR
	LAW	40	/SPACE
	JMS	TYO
	LAW	61	/1
	JMS	TYO
	.EXIT
OK1	LAC*	TAB
	DAC	SHOT3
	.ENDC
UGLOOP	LAC	SHOT3		/POINTER TO BEG. OF NEXT SYMBOL
	SAD*	SHOT2		/IS THIS THE END OF THE SYMBOL TABLE?
	JMP	BALGO		/YES
	LAC*	SHOT3		/TEMPORARILY STORE VALUE OF
	DAC	SHOT1		/NEXT SYMBOL
	ISZ	SHOT3
	AND	IOTN+1		/700000
	SAD	ADDN+1		/300000
	JMP	COMBAT		/COMMON BLOCK
	SAD	JMPN+1		/600000
	JMP	FILNM		/FILE NAME
	SAD	XCTN+1		/400000
	JMP	VCOM		/VARIABLE IN COMMON
ADSYM	JMS	ADDSYM		/ADD TO SYMBOL TABLE
	SPA
	JMS	ADDSYM
	LAC	SHOT1
	AND	(77777		/CLEAN ADDRESS
	DAC*	PAH		/ADDRESS FOLLOWS SYMBOL
	ISZ	PAH
	JMP	UGLOOP
COMBAT	JMS	IGNORE		/COMMON BLOCKS ARE DELETED
	ISZ	SHOT3		/COMMON BLOCKS TAKE UP 2 MORE WORDS
	ISZ	SHOT3
	JMP	UGLOOP
VCOM	JMS	IGNORE		/IGNORE COMMON VARIABLE ENTRIES
	JMP	UGLOOP
FILNM	LAC*	SHOT3		/MARK FILE NAME
	XOR	LACN+1		/200000
	DAC*	SHOT3
	JMP	ADSYM
/IGNORE THIS SYMBOL
IGNORE	0
	LAC*	SHOT3
	SPA
	ISZ	SHOT3		/BIT 0=1 FOR BOL
	ISZ	SHOT3
	JMP*	IGNORE
/COPY THIS SYMBOL INTO COMPRESSED TABLE
ADDSYM	0
	LAC*	SHOT3
	DAC*	PAH
	ISZ	SHOT3		/INCREMENT FOR NEXT ELEMENT
	ISZ	PAH
	JMP*	ADDSYM
/COME HERE ON COMPLETION OF INITIALIZATION OF SYMBOL TABLE
BALGO	CLL!CLC
	660000			/AC0 TO LINK IF EAE PRESENT
	SZL
	JMP	BALGO1		/EAE PRESENT
	LAC	NOPN+1	/EAE ABSENT NOP EAE INSTRUCTIONS
	DAC	IEAE1
	DAC	IEAE2
BALGO1	LAC	PAH
	DAC	LOH		/INITIALIZE LO# AND HEADER
	DAC	H		/RELOCATION FACTOR
	.IFUND	BF
	JMS	TWOCMA
	TAD*	TYI
	SMA
	JMP	STARE+1
	LAC	TYO
	JMS	SQPR	/NS
	LAC	LOWSYM
	DAC	PAH
	DAC	H
	DAC	LOH
	SKP
	.ENDC
/VARIABLES IN OVERLAY AREA
A=.-34
FIRST=A				/FIRST ARGUMENT OF 2
ARG=A+1				/MOST RECENT ARGUMENT
UMIF=A+2			/UNARY MINUS FLAG
SYM=A+3				/SYM HOLDER
BOL=A+4				/BOL HOLDER
NUM=A+5				/NUMERICAL ARGUMENT HOLDER
MODF=A+6			/-1 MEANS REGISTER MAY BE MODIFIED
SYMT=A+7			/TEMPORARY FOR SYM
BOLT=A+10			/TEMPORARY FOR BOL
TRIAL=A+11			/VALUE OF SYMT BOLT
BEST=A+12			/BEST VALUE SO FAR
NECES=A+13			/TEST WORD FOR OPERATE INSTRUCTION OUTPUT
QUOTF=A+14			/-1 MEANS SYMBOL IS ADDRESS
CHA=A+15			/POINTER FOR POSITION OF CHARACTER IN SYMBOL
VALUE=A+16		/THAT WHICH IS TO BE OUTPUT
B1I=A+17			/BKPT 1 INSTRUCTION
B2I=A+20			/BKPT 2 INSTRUCTION
B3I=A+21			/BKPT 3 INSTRUCTION
B4I=A+22			/BKPT 4 INSTRUCTION
BPNO=A+23			/BREAKPOINT NUMBER-1
BPHOLD=A+24			/ADDRESS OF BREAKPOINT
PFLG=A+25			/PROCEED FLAG
DIFF=A+26			/ABSOLUTE DIFFERENCE BETWEEN VALUE AND TRIAL
PCS=A+27			/PROGRAM COUNTER SAVED ON BREAK
CT=A+30				/CONTROL T FLAG
SPACF=A+31			/NORMALLY-1 BUT SET TO 17777 WHEN SPACE HAS OCCURED
TABP=A+32			/POINTER TO SYMBOL LOCATION IN TABLE
CUR=A+33			/CURRENT REGISTER
/IOPS ERRORS AND OTHER SERIOUS ERRORS RETURN HERE
STARE=.
	.IFUND	BF
	CAF			/CLEAR ALL FALGS
	ION			/TURN PI ON
	.ENDC
	JMS	CRLF		/GIVE CR LF
	LAC	DDTMSG		/WRITE DDT
	JMS	SQPR
	LAW	40		/SPACE
	JMS	TYO
	.IFDEF	BF
	LAC	BFMSG
	JMS	SQPR
	LAW	40
	JMS	TYO
	.ENDC
	LAC	VERMSG		/WRITE VERSION SYMBOL
	JMS	SQPR
	LAC	SAH
	JMS	PADJ
CNTRLT	JMS	INFUJ
	CLC
	DAC	CT
/COMMANDS RETURN HERE ON COMPLETION
LLQ	JMS	CRLF		/TYPE CR LF
	LAW	76		/TYPE >
	JMS	TYO
LLR	DZM	FIRST		/FIRST ARG. SET TO 0
	LAC	NOPN+1
	DAC	FARGF		/FIRST ARG. NOT PRESENT YET
LLP	DZM	ARG		/CURRENT ARG. SET TO 0
	LAC	NOPN+1
	DAC	ARGF		/CURRENT ARG. NULL SO FAR
	CLC
	DAC	SPACF		/SPACE HAS NOT OCCURRED YET
	LAC	OPSP		/INITIALLY + OPERATOR ASSUMED
LLO	DAC	EVEN		/SET OPERATOR BRANCH
	LAC	SKPN+1
	DAC	ALTF		/ALT MODE NOT LAST CHARACTER
	DZM	UMIF		/UNARY MINUS NOT SEEN YET
	DZM	SYM		/NO SYM BOL YET
	DZM	SYMT
	DZM	BOL
	LAC	NOPN+1
	DAC	DATF		/NO. CHAR. IN SYLLLABLE YET
	DAC	LETF		/NO LETTER IN SYLLABLE YET
	DZM	NUM		/NUMBER IS 0 SO FAR
	LAC	(LDIST		/FIRST CHAR. IN SYMBOL
	DAC	CHA
	DZM	QUOTF		/SYLLABLE IS NOT NECESSARILY AN ADDRESS SYMBOL
LL	JMS	TYI		/FETCH NEXT CHARACTER
	LAW	-140		/CALCULATE DISPATCH ADDRESS
	TAD	CH		/SYMBOL (7 BIT ASCII) IN CH
	SAD	(37
	JMP	RUB		/177 = RUB-OUT
	SAD	(35
	JMP	ALT		/175 = ALT MODE
	SMA!CLL
	JMP	ERR		/OTHER CHAR. ABOVE 137 ILLEGAL
	TAD	(140-12
	SPA!CLL
	JMP	ERR		/CHAR. BELOW 12 ILLEGAL
	.IFDEF	BF
	SAD	(3
	JMS	CRLF
	.ENDC
	SZA			/(12) LINE FEED
	SAD	(3		/(15) CHAR. RET
	JMP	FIR		/FIRST AND FOURTH ENTRIES IN DISPATCH TABLE AND SKIP IN BETWEEN
	SAD	(13
	JMP	RUB		/25 IS ^U TREAT LIKE RUB-OUT
	SAD	(21
	JMP	ALT		/33 ESC TREAT AS ALT MODE
	TAD	(-26
	SPA!CLL
	JMP	ERR		/OTHER CHAR. BELOW 40 ILLEGAL
	TAD	(4		/START WITH 5TH DISPATCH ENTRY
FIR	TAD	(DTB
	DAC	TYI
	LAC*	TYI		/FETCH DISPATCH ENTRY
	SAD	NUMBER
	JMP	DIGIT		/OCTAL DIGIT
	DAC	TYI		/SET UP FOR DISPATCH
	SMA!RAL
	JMP	LETTER		/LETTER ENTRIES POSITIVE
LEVEL	SPA
	JMS	EVAL		/BIT 1=1 MEANS SYLLABLE TERM.
	JMP*	TYI		/DISPATCH TO COMMAND HANDLER
LETTER	XCT	ALTF
	JMP	LEVEL		/LETTERS PRECEDED BY ALT MODE ($) ARE COMMANDS
	LAC	SKPN+1
	DAC	LETF		/LETTER HAS OCCURRED
SYMQ	LAC	SKPN+1
	DAC	DATF		/ARGUMENT EXISTS
	LAC	CH		/TRANSLATE ASCII TO SQOZE
	SAD	(43
	LAW	47		/#
	SAD	(45
	LAW	33		/%
	SAD	(56
	LAW	34		/.
	AND	(77
	SAD	CH
	TAD	(-23		/NUMBERS
	ISZ	CHA
LDIST	JMP*	CHA
	JMP	C1		/FIRST ALPHANUMERIC
	JMP	C1+1		/SECOND "
	JMP	C1+2		/THIRD "
	JMP	C2		/FOURTH "
	JMP	C2+1		/FIFTH  "
	JMP	C2+2		/SIXTH  "
	CLC			/IGNORE BEYOND SIX
	TAD	CHA
	DAC	CHA
	JMP	LL
C1	JMS	M50
	JMS	M50
	TAD	SYM
	DAC	SYM
	JMP	LL
C2	JMS	M50
	JMS	M50
	TAD	BOL
	DAC	BOL
	JMP	LL
/MULTIPLY AC BY 50 OCTAL
M50	0
	RCL
	RTL
	DAC	CH
	RTL
	TAD	CH
	JMP*	M50
/NUMBERS COME HERE
DIGIT	TAD	CH
ALTF	XX			/HAS ALT MODE OCCURRED?
	JMP	BPT		/YES, MANIPULATE BREAKPOINTS
	DAC	SHOT		/NO, ADD TO NUM
	LAC	NUM
	AND	(77777		/LAST 6 DIGITS FORM NUMBER
	RCL			/MULTIPLY BY 8
	RTL
	TAD	SHOT		/ADD DIGIT
	DAC	NUM		/STORE
	JMP	SYMQ		/NOW TREAT AS SYMBOL CONSTITUENT
/BREAKPOINT COMMAND HANDLER
BPT	SNA
	JMP	D0		/SET AUTO-INDEX REGISTER
	TAD	MINUS		/TAD (-1
	AND	(3		/CLEAN OFF BPT #
	TAD	(DAC RGH
	DAC	BPT2		/SET UP DAC REG TO BE PRT. ON BREAK
	TAD	(4
	DAC	BPT1		/SET UP DAC REG. CON. COND.EX. IN.
	JMS	EVAL
	XCT	ARGF
	LAC	TAB3+1		/LAC (ACH
BPT2	XX
	LAC	FIRST
	AND	(1
	XCT	FARGF
	LAC	NOPN+1		/N=NULL _ NOP
	SNA
	LAC	SKPN+1		/N=0 _ SKP
	SMA
	LAC	(JMP BPR2+3	/N=1 _ JMP .+3
BPT1	XX
	JMP LLQ
DB	SZA			/$B - SET BREAKPOINT
	JMP	DB6
	XCT	FARGF
	XCT	ARGF
	SKP
	JMP	CBPT		/0$B - CLEARS ALL BREAKPOINTS
DB6	XCT	FARGF
	JMP	DB2		/K$B - GET NEXT AVAILABLE BREAKPOINT
	LAC FIRST
	TAD MINUS		/TAD (-1
DB3	AND	(3		/CLEAN OFF BKPT #
	DAC	SHOT
	RCL
	TAD	(DAC B1H
	DAC BPSTR
	LAC	SHOT
	TAD	(DAC RGH
	DAC	DB4
	TAD	(4
	DAC	DB5
	LAC ARG
DATF	XX
	LAC	P		/DEFAULT BKPT INST. IS LAST OPENED ADDRESS (.)
	SNA
	JMP	BPSTR		/0 MEANS CLEAR BREAKPOINT
	JMS	ADRES		/TEST IF ADDRESS IS LEGAL
	JMS	MEMPRT		/ILLEGAL ADDRESS
BPSTR	XX			/STORE ADDRESS IN BREAKPOINT REGISTER
	LAC	NOPN+1	/INITIALLY SET TO DECREMENT PROCEED COUNT
DB5	XX
	LAC	TAB3+1		/INITIALLY SET TO TYPE AC ON BREAK
DB4	XX
	JMP	LLQ
DB2	CLA			/LOOK FOR FIRST FREE BKPT
	SAD	B1H
	LAW	61
	SAD	B2H
	LAW	62
	SAD	B3H
	LAW	63
	SAD	B4H
	LAW	64
	SMA
	JMP	ERR		/NO FREE BPT
	JMS	TYO		/TYPE BKPT NO. FOUND
	LAC	SHOT3
	JMP	DB3-1
CBPT	DZM	B1H		/CLEAR BREAKPOINTS
	DZM	B2H
	DZM	B3H
	DZM	B4H
	JMP	LLQ
/EVALUATE EXPRESSIONS TYPED IN
EVAL	0
	LAC	ARG		/0 IS VALUE OF NULL EXPRESSION
	XCT	DATF
	JMP*	EVAL		/OMIT EVALUATION OF NULL SYLLABLE
	LAC	SKPN+1		/ARGUMENT EXISTS (NON NULL)
	DAC	ARGF
LETF	XX			/SKIP IF LETTER HAS OCCURRED IN SYL.
	JMP	NUMB		/SYLLABLE IS OCTAL NUMBER
	LAC	SPACF
	SMA!CLC
	DAC	QUOTF		/NEVER SEARCH INST. MNEMONICS AFTER SPACE HAS OCCURRED
	LAC	TAB1P
	ISZ	QUOTF
EVAL1	LAC	TAB2P		/SEARCH INSTRUCTION MNEMONICS
	DAC	TAB		/TAB CONTAINS STARTING ADDRESS OF SYMBOL TABLE SEARCH
	LAC	NOPN+1		/HEADER TABLE HAS NOT BEEN SEARCHED
	DAC	SEFLG
SCAN	JMS	GETSYM		/GET NEXT SYMBOL
	JMP	LOSE		/END OF TABLE REACHED
	LAC	SYMT
	XOR	SYM
	AND	(377777
	SZA
	JMP	SCAN		/SYM NOT = SYMT
	LAC	BOLT
	XOR	BOL
	AND	(377777
	SZA
	JMP	SCAN		/BOL NOT = BOLT
	LAC	TRIAL		/SYMBOL FOUND
	DAC	NUM		/VALUE IN NUM
NUMB	LAC	NUM
	TAD	UMIF		/IF UMIF = 0 NOTHING HAPPENS
	XOR	UMIF		/IF UMIF = -1 FORM 2S COMP. OF NUM
EVEN	TAD	ARG		/COMBINE WITH ARG
SPAC	XOR	ARG		/IF SPACF = -1 NOTHING HAPPENS
	AND	SPACF		/IF SPACE = 17777 ONLY ADDRESS PART OF ARG CHANGES
SPAC1	XOR	ARG		/USED AS LITERAL
	DAC	ARG
	LAC	SYMT
	SAD	AACN
	JMP	REG1
	SAD	AXSN
	JMP	REG1
	SAD	AXRN
	JMP	REG1
	SAD	LAWN
	JMP	REG3
REG2	LAC	ARG
	JMP*	EVAL
REG1	LAC	SPACF
	SPA
	AND	(777
REG4	DAC	SPACF
	JMP	REG2
REG3	LAC	SPACF
	SPA
	LAC	(17777
	JMP	REG4
LOSE	LAW	125		/SYLLABLE UNDEFINED-TYPE U
	JMP	RUB+1
OPMI	TAD	MINUS		/SUBTRACT (-)
	CMA
OPSP	TAD	ARG		/USED AS LITERAL
	JMP	SPAC
OPOR	AND	ARG		/INCLUSIVE OR (!)
	XOR	NUM
	XOR	ARG
	JMP	SPAC
RUB	LAW	100		/@ RUBOUT STARTS OVER
	JMS	TYO
	JMS	TAB
	JMP	LLQ+1
MEMPRT	0
ALTERF	SKP
	JMP*	MEMPRT
ERR	LAW	77		/GENERAL ERROR-TYPE ? AND
	JMS	TYO		/START OVER
	JMP	LLQ
SPACE	LAC	SPACF
	SPA
	.IFDEF	PDP15
	LAC	(7777
	.ENDC
	.IFUND	PDP15
	LAC	(17777		/SPACE OCCURED IN EXPRESSION
	.ENDC
	JMP	LLO-2
MINUS	LAW	-1		/-OCCURED IN EXPRESSION USED AS LITERAL
	DAC	UMIF
	XCT	DATF
	JMP	LL		/UNARY MINUS
	LAC	(JMP OPMI	/ORDINARY MINUS
	JMP	LLO
CLAM	LAC	(JMP OPOR	/INCLUSIVE OR (!) HAS OCCURED IN EXPRESSION
	JMP	LLO
BKSLS	LAC	SPAC1		/EXCLUSIVE OR (BACKSLASH) HAS OCCURRED IN EXPRESSION
	JMP	LLO
	.IFDEF	PDP15
COMMA	LAC	ARG		/ADD INDEX BIT
	XOR	(10000
	DAC	ARG
	JMS	TYI
	LAC	CH
	SAD	(130
	JMP	LL		/IGNORE POSSIBLE FOLLOWING X
	JMP	LL+1
	.ENDC
AMPER	LAC	OPOR		/AND (&) HAS OCCURED IN EXPRESSION
	JMP	LLO
SEMI	DAC	FIRST		/SEMICOLON MEANS SECOND ARG. COMING
	LAC	SKPN+1		/SET FIRST ARGUMENT PRESENT FLAG
	JMP	LLP-1
ALT	LAW	44		/ALT MODE ECHOES $
	JMS	TYO
DOLL	LAC	NOPN+1		/$ HAS OCCURED
	DAC	ALTF		/SET ALT MODE FLAG
	JMP	LL
INDIRE	LAC	ARG		/ADD INDIRECT BIT (*)
	XOR	(20000
	DAC	ARG
	JMP	LLO-1
DQUOTE	CLC			/"MEANS SKIP SEARCHING INSTRUCTION TABLE
	DAC	QUOTF
	JMP	LL
APO	LAC	SYM		/FILE NAME (')
	XOR	LACN+1		/SET FLAG BIT (200000)
	DAC	SYM
	JMP	LL
/GET NEXT SYMBOL FROM SYMBOL TABLE
GETSYM	0
	LAC	TAB
	SAD	PAH
	JMP	GET3		/END OF USER SYMBOL TABLE REACHED
	SAD	TAB3M
	JMP	GET4		/END OF DDT SYMBOL TABLE REACHED
SEFLG	XX			/SKIP IF HEAD TABLE IS BEING SEARCHED
	JMP	GET1		/FETCH NEXT SYMBOL
	LAC*	TAB
	RAL
	SMA
	JMP	GET1		/FETCH NEXT SYMBOL
GET2	LAC	LOWSYM		/FINISHED SEARCHING HEAD TABLE
	DAC	TAB		/SEARCH WHOLE USER TABLE NEXT
	LAC	NOPN+1		/RESET SEARCH HEAD TABLE FLAG
	DAC	SEFLG
	JMP	GETSYM+1
GET1	LAC	TAB		/SET UP POINTER TO BEGINNING OF NEXT SYMBOL ENTRY
	DAC	TABP
	LAC*	TAB
	DAC	SYMT
	ISZ	TAB
	SMA!CLA			/BIT 0=1 INDICATES 6 LETTER SYMBOL
	JMP	.+3
	LAC*	TAB
	ISZ	TAB
	DAC	BOLT		/BOLT IS 0 IF ONLY 3 LETTER SYMBOL
	LAC*	TAB
	DAC	TRIAL		/VALUE OF SYMBOL IN TRIAL
	ISZ	TAB
	ISZ	GETSYM		/SKIPS ON FINDING A SYMBOL
	JMP*	GETSYM
GET3	XCT	SEFLG		/NO MORE SYMBOLS?
	JMP*	GETSYM		/YES
	JMP	GET2		/NO,ONLY SEARCHING HEADER TABLE
GET4	XCT	SEFLG
	SKP			/END OF INSTRUCTION TABLE REACHED
	JMP	GET2		/END OF HEADER TABLE REACHED
	LAC	HEAD		/SEARCH CURRENT HEAD TABLE FIRST
	DAC	TAB
	LAC	SKPN+1		/SET FLAG TO INDICATE SEARCHING
	DAC	SEFLG		/HEAD TABLE
	JMP	GET1		/HEAD TABLE ALWAYS HAS AT LEAST 1 MEMBER
/DISPATCH TABLE
DTB	JMP+LINEF		/(12) LINE FEED
DDTMSG	14664			/DDT (HOLE IN DISPATCH TABLE)
VERMSG	107371			/V6A HOLE IN DISPATCH TABLE
	JMP+RETURN		/(15) CR
	JMP+SPACE		/(40) SPACE
	JMP+CLAM		/(41) !
	XCT+DQUOTE		/(42) "
	ERR			/(43) # TREAT LIKE LETTER
	XCT+DOLL		/(44) $
	ERR			/(45) % TREAT LIKE LETTER
	JMP+AMPER		/(46) &
	XCT+APO			/(47) '
	JMP+SEMI		/(50) (
	XCT+CLOSEP		/(51) )
	JMP+INDIRE		/(52) *
	JMP+LLO-1		/(53) +
	.IFDEF	PDP15
	XCT+COMMA		/(54) ,
	.ENDC
	.IFUND	PDP15
	XCT+ERR			/(54) ,
	.ENDC
	JMP+MINUS		/(55)-
	ERR			/(56) . TREAT LIKE LETTER
	JMP+SLASH		/(57) /
NUMBER	-60			/(60) 0
	-60			/(61) 1
	-60			/ (62) 2
	-60			/(63) 3
	-60			/(64) 4
	-60			/(65) 5
	-60			/(66) 6
	-60			/(67) 7
	ERR			/(70) 8 TREAT LIKE LETTER
	ERR			/(71) 9 TREAT LIKE LETTER
	JMP+COLON		/(72) :
	JMP+SEMI		/(73) ;
	JMP+LT			/(74) <
	JMP+EQUAL		/(75) =
	XCT+ERR			/(76) >
	JMP+QUES			/(77) ?
	XCT+DAT			/(100) @
	DA			/(101) A
	LAC+DB			/(102) B
	.IFUND	NOPAT
	DC			/(103) C
	DD			/(104) D
	.ENDC
	.IFDEF	NOPAT
	ERR			/(103) C
	ERR			/(104) D
	.ENDC
	LAC+ADRS		/(105) E
	DF			/(106) F
	LAC+GO			/(107) G
	LAC+DH			/(110) H
	.IFUND	NOPAT
	DI			/(111) I
	.ENDC
	.IFDEF	NOPAT
	ERR			/(111) I
	.ENDC
	LAC+DJ			/(112) J
	LAC+DK			/(113) K
	LAC+DL			/(114) L
	LAC+DM			/(115) M
	LAC+NOT			/(116) N
	LAC+DO1			/(117) O
	LAC+REGO		/(120) P
	.IFUND	NOPAT
	LAC+DQ			/(121) Q
	.ENDC
	.IFDEF	NOPAT
	ERR			/(121) Q
	.ENDC
	DR			/(122) R
	DS			/(123) S
	DT			/(124) T
	LAC+DU			/(125) U
	DV			/(126) V
	LAC+WORD		/(127) W
	LAC+DO			/(130) X
	LAC+DY			/(131) Y
	LAC+DZ			/(132) Z
	JMP+OBRAK		/(133) [
	JMP+BKSLS		/(134) \
	JMP+CBRAK		/(135) ]
	JMP+UPAR		/(136) ^
	JMP+BAKAR		/(137) _
/^T RETURNS HERE
STARET	ISZ	INFUJ
	JMP	LLQ
	.IFUND	BF
	LAC* (117		/117 CONTAINS AC
	DAC ACH
	LAC* (116		/116 CONTAINS PC
	.ENDC
	.IFDEF	BF
	DAC	ACH
	LAC*	(107
	.ENDC
	JMP	CNTRLT
/BREAKPOINTS COME HERE
BPRET1	0
	DAC	ACH	/SAVE AC
	LAC	BPRET1
	JMS	INFUJ	/REMOVE BREAKPOINTS
	CLC
	TAD	P
	DAC	BPHOLD	/ADDRESS OF BREAKPOINT STORED BPHOLD
	DAC	P	/.=ADDRESS OF BREAKPOINT
	DAC	CUR
	SAD	B1H	/COMPUTE BKPT #-1
	LAW
	SAD	B2H
	LAW	1
	SAD	B3H
	LAW	2
	SAD	B4H
	LAW	3
	SMA
	JMP	STARE	/NOT LEGAL BKPT
	AND	(3
	DAC	BPNO	/BKPT #-1 STORED BPNO
	TAD	(XCT INH	/COMPUTE INST. TO BE EXECUTED ON BREAK
	DAC	BPR2
	JMS	RESET	/RESTORE AC AND LINK
BPR2	XX		/EXECUTE INSTRUTION
	ISZ	PRH	/NOP MEANS TEST PROCEED COUNT
	JMP	PROGO	/SKP MEANS ALWAYS PROCEED
	.IFUND	BF
	IORS		/BREAK ON DOUBLE SKIP OR 0 PROCEED COUNT
	SMA
	JMP	STARE	/REINITIALIZE DDT IF PI OFF
	.IFUND	PDP7
	705512		/READ API STATUS
	DAC	SHOT1
	SMA
	JMP	SAFE	/API OFF
	AND	(377
	SNA
	JMP	SAFE
	LAW	17770	/API ERROR
	DAC	SHOT2
BPR3	DBK		/RETURN TO MAIN STREAM
	ISZ	SHOT2
	JMP	BPR3
	CLC
	TAD*	(.DAT-3
	DAC	SHOT2
	DZM*	SHOT2	/CLEAR TT BUSY SWITCH
	ION
	JMS	CRLF
	LAC	APIMSG	/TYPE ERROR MESSAGE
	JMS	SQPR
	JMS	TAB	/TYPE TAB
	LAC	SHOT1
	JMS	OINSPR	/DISPLAY API STATUS REGISTER
	JMS	CRLF
	JMP	.+3
	.ENDC
	.ENDC
SAFE	CLC
	DAC	PFLG	/ENABLE PROCEED FLAG
	.IFDEF	BF
	JMS	CRLF
	.ENDC
	LAC	BPNO
	TAD	(LAC RGH
	DAC	BPR1
	LAC	BPNO	/CALCULATE BKPT #
	TAD	(1
	JMS	OADRPR	/TYPE BKPT #
BPR1	XX
	SNA
	JMP	LLQ	/IF REGISTER TO BE TYPE IS 0 OMIT TYPING IT
	JMS	PADJ	/ADJUST HEADER
	JMS	TAB	/PRINT TAB
	LAC*	P
	DAC	QH	/MAKE Q#=CONTENTS OF .
	XCT	OUTMOD	/PRINT REGISTER IN CURRENT MODE
	JMP	LLQ
REGO	LAC	ARG	/$P - PROCEED
	SZA!SMA!CMA	/PROCEED COUNT MAY NEVER BE MINUS
	XCT	ARGF
	LAW	-2	/DEFAULT PROCEED COUNT IS 1
	TAD	(1
	DAC	PRH	/SET PROCEED COUNT
	ISZ	CT
	SKP
	JMP	GOX	/^T HAS OCCURRED OR DDT HAS BEEN INITIALIZED
	ISZ	PFLG
	JMP	ERR	/MAY NOT GIVE $P AFTER API ERROR
	JMS	CRLF
PROGO	LAC	PROOF+3	/PREINITIALIZE INST. FOLLOWING BKPT. INST.
	DAC	PROOF+1
	LAC	BPRET1	/SET UP PROGRAM COUNTER
	DAC	NUM
	LAC	BPHOLD	/SET UP EFFECTIVE ADDRESS OF BKPT.INST.
	DAC	FIRST
	LAC*	BPHOLD
PROGO1	DAC	PROOF	/DEPOSIT INST. TO BE EXECUTED OUT OF PLACE
	AND	NOPN+1	/740000
	SZA
	SAD	XCTN+1
	JMP	CFIX	/CAL OR XCT INST.
	SAD	EAEN+1
	JMP	EFIX	/EAE INST.
	AND	IOTN+1	/700000
	SAD	IOTN+1
	JMP	PROOF-1	/LAW, OPR, OR IOT INST.
	LAC	PROOF	/ADDRESS INSTRUCTION
	JMS	REFAD	/COMPUTE ADDRESS REFERRED TO IN INST.
	LAC	FIRST	/XCT IN REFAD
	DAC	SHOT3	/DEPOSIT ADDRESS REFERRED TO
	LAC	PROOF
	AND	(20000
	SNA
	JMP	PROGO2	/DIRECT INSTRUCTION
	LAC	SHOT3	/INDIRECT REFERENCE
	AND	(77770	/IS ADDRESS THAT OF INDEX REG
	XOR	(10
	SNA
	ISZ*	SHOT3	/YES, INCREMENT IT
	LAC*	SHOT3	/MAKE REFERENCE DIRECT
	DAC	SHOT3
PROGO2	LAC	PROOF
	AND	NOPN+1	/740000
	SAD	JMSN+1
	JMP	JFIX	/JMS INSTRUCTION
BPMEMA	XOR	(20000 SHOT3
	.IFDEF	PDP15
	XOR	PROOF
	AND	(767777
	XOR	PROOF
	.ENDC
	DAC	PROOF
	JMS	OUTFUJ
PROOF	XX		/INSTRUCTION TO BE EXECUTED OUT OF PLACE
	JMP*	NUM	/INITIALIZED
	ISZ	NUM	/SKIP NEXT INSTRUCTION
	JMP*	NUM	/USED AS LITERAL
EFIX	LAC	(500	/EAE INSTRUCTION
	AND	PROOF
	SAD	(100
	SKP
	JMP	PROOF-1	/NON MEMORY REFERENCE EAE
	ISZ	XCTF
	SKP
	JMP	ERR	/USER MAY NOT EXECUTE MEMORY
			  /REFERENCE EAE INST.
	LAC*	BPRET1	/FETCH SRG. OF EAE INSTRUCTION
	DAC	PROOF+1
	JMP	PROOF-1
CFIX	ISZ	XCTF	/CAL OR XCT COMMAND
	SKP
	JMP	ERR	/USER MAY NOT EXECUTE A XCT OR CAL INSTRUCTION
	JMS	OUTFUJ	/RESTORE BREAKPOINTS
	LAC	PROOF	/REMOVE CURRENT BKPT
	DAC*	BPHOLD
	JMS	RESET	/RESET AC, LINK
	JMP*	BPHOLD	/XCT.INST. IN PLACE
	.IFDEF	PDP15
JFIX	LAC	JFIXI
	XOR	PROOF
	AND	(767777
	XOR	PROOF
	DAC	JFIXI
	JMS	RESET
	LAC	LKH
	.ENDC
	.IFUND	PDP15
JFIX	LAC	LKH	/COMPUTE JMS DEPOSIT
	.ENDC
	RTR
	XOR	NUM	/LINK STATUS MERGED WITH PC
	AND	XCTN+1	/400000
	XOR	NUM
JFIXI	DAC*	SHOT3	/DEPOSIT IN SHOT3 ADDRESS
	ISZ	SHOT3	/POINT TO NEXT ADDRESS
	LAC	JMPN+1	/JMP TO ADDRESS +1
	JMP	BPMEMA
/EXECUTE INSTRUCTION
DO	LAC	PROOF+3	/PREINITIALIZE INST. FOLLOWING BKPT. INST.
	DAC	PROOF+1
	LAC	(XDONE	/SET PC FOR NEXT INST. FOLLOWING BKPT. INST.
	DAC	NUM
	LAC	P	/SET INST. EFFECTIVE ADDRESS
	DAC	FIRST	/AS .
	CLC
	DAC	XCTF	/SET XCT FLAG
	JMS	CRLF
	LAC	ARG
	XCT	ARGF
	LAC*	P	/DEFAULT INST. TO BE EXECUTED IS IN .
	JMP	PROGO1
XDONE	DZM	NUM	/INST. EXECUTED DID NOT SKIP IF RETURN COMES HERE
	JMP	.+4	/EXTRA CR FOR SKIP OF 1
	JMP	STARE	/SKIP OF 2 IS ILLEGAL
	JMP	STARE	/3 ILLEGAL
	JMP	STARE	/4 ILLEGAL
	DAC	ACH	/SAVE AC
	LAC	PCS
	JMS	INFUJ	/REMOVE BREAKPOINTS
	LAC	NUM
	SZA
	JMS	CRLF	/EXTRA CR FOR SKIP
	JMP	LLQ
/START PROGRAM $G
GO= .
ARGF	XX		/SKIP IF ARG. EXISTS
	LAC	SAH	/DEFAULT ADDRESS IS SA#
FARGF	XX		/SKIP IF FIRST ARGUMENT EXISTS
	SKP
	DAC	SAH	/CHANGE SA# IF FIRST ARG. EXISTS
	DAC	PCS
GOX	CLC
	DAC	PRH
	DAC	CT
	LAC	PCS
	JMS	ADRES	/MUST START PROGRAM IN LEGAL
	JMS	MEMPRT	/ADDRESS
	JMS	CRLF
	JMS	OUTFUJ	/RESTORE BREAKPOINTS AND AC, LINK
	JMP*	PCS	/START PROGRAM
/SAVE USERS MACHINE CONDITIONS
INFUJ	0
	SAD	PCS
	SKP
	DZM	CT
	DAC	PCS	/SAVE PC
	AND	(77777	/TRIM OFF FLAGS
	DAC	P	/MAKE PCS= .
	DAC	CUR
	GLK
	DAC	LKH	/SAVE LINK
IEAE1	LACQ			/SAVE MQ
	DAC	MQH
	724000			/PXA
	DAC	XH
	730000			/PLA
	DAC	LRH
	.IFUND	BF
	LAC	B1I	/PUT BACK BREAKPOINT INSTRUCTIONS
	DAC*	B1H
	LAC	B2I
	DAC*	B2H
	LAC	B3I
	DAC*	B3H
	LAC	B4I
	DAC*	B4H
	.ENDC
	.IFDEF	BF
	LAC	B1I
	JMS	MEMPT
	DAC*	B1H
	LAC	B2I
	JMS	MEMPT
	DAC*	B2H
	LAC	B3I
	JMS	MEMPT
	DAC*	B3H
	LAC	B4I
	JMS	MEMPT
	DAC*	B4H
	.ENDC
	LAC	NOPN+1	/CLOSE ANY OPEN REGISTER
	DAC	OPENF
	DZM	XCTF	/MAKE SURE XCT FLAG IS OFF
	JMP*	INFUJ
/RESET ACTIVE REGISTERS
RESET	0
	LAC	XH		/RESTORE INDEX REGISTER
	721000			/PAX
	LAC	LRH
	722000			/PAL
	LAC	MQH
IEAE2	LMQ			/RESTORE MQ REGISTER
	LAC	LKH
	RAR
	LAC	ACH
	JMP*	RESET
/RESTORE USER'S MACHINE CONDITIONS AND PLACE BKPTS
OUTFUJ	0
	LAC*	B1H	/STORE BKPT. INSTRUCTIONS
	DAC	B1I
	LAC*	B2H
	DAC	B2I
	LAC*	B3H
	DAC	B3I
	LAC*	B4H
	DAC	B4I
	LAC	(BPRET1-1	/INITIALIZE BREAKPOINT AUTO-INDEX REGISTER
	DAC*	AXH
	LAC	AXH	/SET BREAKPOINTS
	XOR	(JMS*
	.IFUND	BF
	DAC*	B1H
	DAC*	B2H
	DAC*	B3H
	DAC*	B4H
	.ENDC
	.IFDEF	BF
	JMS	MEMPT
	DAC*	B1H
	JMS	MEMPT
	DAC*	B2H
	JMS	MEMPT
	DAC*	B3H
	JMS	MEMPT
	DAC*	B4H
	.ENDC
	CLC
	DAC	INFUJ
	JMS	RESET	/RESTORE AC, LINK
	JMP*	OUTFUJ
/BACKGROUND FOREGROUND MUST NOT STORE IN REGISTER 0
	.IFDEF	BF
MEMPT	0
	DAC	SHOT
	LAC*	MEMPT
	JMS	REFAD
	LAC	MEMPT
	DAC	PRINT
	LAC*	PRINT
	SNA
	ISZ	MEMPT
	LAC	SHOT
	JMP*	MEMPT
	.ENDC
/REGISTER EXAMINATION
CBRAK	LAC	BAKAR+1	/]- FORCE OUTPUT TO BE SYMBOLIC
	SKP
OBRAK	LAC	EQUAL+1	/[- FORCE OUTPUTTO BE OCTAL
	DAC	OUTMOD
	XCT	ALTF
	DAC	MODE	/WITH ALT MODE CHANGES PERMANENT MODE
SLASH	LAC	ARG
	XCT	ARGF
	LAC	P	/DEFAULT REG. IS 0
SLASH1	DAC	CUR	/MAKE REG. CURRENT
	JMP	OREG
DY	JMS	DAZ	/$Y
	JMP	SLASH1
DZ	JMS	DAZ	/$Z
	JMP	OREG
DJ	JMS	CRLF	/$J
	JMS	CREG	/CLOSE REG. IF OPEN (AND MODIFY)
LACQH	LAC	QH	/USED AS LITERAL
	AND	(77777	/GET ADDRESS PART (15 BITS)
	JMP	SLASH1
/SUBROUTINE TO CLOSE REGISTER AND COMPUTE EFFECTIVE ADDRESS
DAZ	0
	JMS	CRLF
	JMS	CREG	/CLOSE AND OPTIONALLY MODIFY REGISTER
			  /IF ONE IS OPEN
	LAC	QH	/ASSUME REGISTER CONTAINS ADDR. INST.
	JMS	REFAD	/COMPUTE ADDRESS REFERRED TO
	LAC	P	/EXECUTED IN REFAD
	JMP*	DAZ
LINEF	LAW	15	/TYPE CR (LINE FEED TYPED)
	JMS	TYO
	LAW	-12	/SET TAB COUNTER
	DAC	TABC
	CLA		/JIGGLE TT TO WAIT FOR CR COMP.
	JMS	TYO
/
/  INSERT BY P. HENDERSON TO STEP CURRENT ADDRESS POINTER BY TWO
/  WHEN IN TEXT OUTPUT MODE
/
	LAC	MODE
	SAD	QUES+1	/ 5/7 ASCII OUTPUT ?
	SKP
	JMP	LINE
	LAC	(2	/ STEP BY TWO IF YES
	JMP	LINE+1
/
/  END OF INSERTION
/
	JMP	LINE
UPAR	JMS	CRLF	/^ TYPED
	CLC!SKP		/DECREMENT CUR BY 1
LINE	LAC	(1	/INCREMENT CUR BY 1
	TAD	CUR
	DAC	CUR
	JMS	CREG	/CLOSE AND OPTIONALLY MODIFY ANY OPEN REGISTER
	LAC	CUR
	JMS	PADJ	/ADJUST HEADER (CUR=.)
	XCT	AMOD	/TYPE ADDRESS
	JMP	LINE1
OREG	AND	(77777
	JMS	PADJ	/ADJUST HEADER
LINE1	LAC	SKPN+1	/OPEN REGISTER
	DAC	OPENF
	LAC*	P
	DAC	QH	/Q#=CONTENTS OF OPEN REGISTER
	JMS	TAB
	LAC	QH	/MODIFIED BY TYPE IN MODE
OUTMOD	JMS	INSPR
	JMS	TAB
LINE2	LAC	MODE	/GO BACK TO PERMANENT MODE
	DAC	OUTMOD
	JMP	LLR
LT	LAC	(JMP LINE2 /< - TYPE IN MODE
	DAC	OUTMOD-1 /OMIT PRINTING OF REG CONTENTS
	JMP	SLASH
RETURN	JMS	CREG	/CLOSE ANY OPEN REGISTER
	LAC	LACQH	/LEAVE TYPE IN MODE
	DAC	OUTMOD-1
	.IFUND	BF
	LAW	-11
	DAC	TABC
	.ENDC
	JMP	LLQ+1
/SUBROUTINE TO CLOSE AND OPTIONALLY MODIFY OPEN REG.
CREG	0
	XCT	ARGF	/IS CHANGE REQUESTED
	JMP	CREW	/NO, CLOSE REG. UNCHANGED
	LAC	ARG	/YES
	DAC	QH	/UPDATE Q#
OPENF	NOP		/SKIP IF REG. IS OPEN
	JMP*	CREG
	ISZ	MODF	/IS REGISTER LEGAL TO MODIFY
	JMP	CREW1	/NO, CLOSE REG. AND GIVE?
	DAC*	P	/YES, MODIFY REGISTER
CREW	LAC	NOPN+1	/CLOSE REGISTER
	DAC	OPENF
	JMP*	CREG
CREW1	LAC	NOPN+1	/TRIED TO MODIFY ILLEGAL ADDRESS
	DAC	OPENF
	JMS	MEMPRT
	LAC	QH
	JMP	CREW-1
/ADJUST HEADER
PADJ	0
	DAC	P	/UPDATE P
	JMS	ADRES	/TEST LEGAL ADDRESS
	NOP
	LAC	(JMP PADJT	/ADJUST PROGRAM HEADER
	JMS	SEARCH	/SEARCH SYMBOL TABLE
	LAC	TAB3P	/XCT IN SEARCH
	LAC	P	/EXIT P IN AC
	JMP*	PADJ
/ADJUST HEADER SIFTER
PADJT	LAC	SYMT
	RAL
	SMA
	JMP	SEAGIN	/NOT FILE NAME
	LAC	TRIAL
	JMS	TWOCMA
	TAD	P
	SPA
	JMP	SEAGIN	/NOT < OR = P
	DAC	ADRES
	JMS	TWOCMA
	TAD	DIFF
	SPA
	JMP	SEAGIN	/NOT CLOSER
	LAC	ADRES	/UPDATE TRIAL HEADER
	DAC	DIFF
	LAC	TRIAL
	DAC	H
	LAC	TABP
	DAC	HEAD
	JMP	SEAGIN
/CALCULATE ADDRESS REFERRED TO
/	LAC	INST	/AC INSTRUCTION REFERRING TO ADDRESS
/	JMS	REFAD
/	LAC	(INST
/DESTROYS PREVIOUS CONTENTS OF PRINT
/LEAVES EFFECTIVE ADDRESS REFERRED TO IN AC
REFAD	0
	AND	(37777	/PEEL OFF INST. OP CODE
	DAC	PRINT
	.IFDEF	PDP15
	AND	(67770
	.ENDC
	.IFUND	PDP15
	AND	(77770
	.ENDC
	XOR	(20010
	SZA		/SKIP IF INDEX REGISTER REFERRED TO
	XCT*	REFAD	/LOAD BANK BITS INTO AC
	ISZ	REFAD	/SKIP OVER ARG. ON RETURN
	XOR	PRINT	/SPLICE BANK BITS INTO ADDRESS
	.IFDEF	PDP15
	AND	(70000
	.ENDC
	.IFUND	PDP15
	AND	(60000	/SAVE ONLY BANK BITS
	.ENDC
	XOR	PRINT
	JMP*	REFAD
/ADDRESS TEST ROUTINE
ADRES	0
	AND	(77777	/TRIM ADDRESS TO 15 BITS
	DAC	SHOT
	TAD	TOP
	SMA
	JMP	ERR
	LAC	SHOT
	CMA
	TAD	PAH
	SPA
	JMP	ADRES1	/ADDRESS IS ABOVE PATCH AREA BEG.
	LAC	SHOT	/ADDRESS IS BELOW PATCH AREA
	AND	(77770
	SAD	(10
	JMP	ADRES4	/ADDRESS IS INDEX REG.; IT MAY BE MODIFIED BUT OTHERWISE ILLEGAL
ADRES2	DZM	MODF	/ILLEGAL ADDRESS MAY NOT BE MODIFIED
	JMP	ADRES3
ADRES1	LAC	LIM1
	CMA
	TAD	SHOT
	SMA
	JMP	ADRES2
	.IFUND	PTP
	.IFUND	BF
	LAC*	(.SCOM
	CMA
	TAD	SHOT
	SPA
	JMP	ADRES4-1
	TAD	(-141
	SPA
	JMP	ADRES2
	.ENDC
	.ENDC
	ISZ	ADRES	/SKIP ON RETURN IF ADDRESS IS LEGAL
ADRES4	CLC		/ADDRESS MODIFIABLE
	DAC	MODF
ADRES3	LAC	SHOT	/EXIT WITH ADDRESS IN AC
	JMP*	ADRES
/TYPE OUT ROUTINES
BAKAR	JMS	PRINT	/PRINT AS SYMBOLIC INSTRUCTION(LEFT ARROW)
	JMS	INSPR
EQUAL	JMS	PRINT	/PRINT AS UNSIGNED OCTAL NUMBER (=)
	JMS	OINSPR
COLON	JMS	PRINT	/PRINT AS TRANSFER VECTOR IN CURRENT ADDRESS MODE (:)
AMOD	JMS	ADRPR	/CURRENT ADDRESS MODE INST.
QUES	JMS	PRINT		/PRINT AS 5/7 PACKED ASCII
	JMS	P57
/PRINT AC OR Q# IN SPECIFIED MODE
PRINT	0
	XCT	ARGF
	LAC	QH
	DAC	QH	/UPDATE Q#
	XCT*	PRINT	/PRINT
	JMS	TAB	/TAB
	JMP	LLQ+1
/CHANGE INSTRUCTION PRINT MODE
DO1	LAC	EQUAL+1		/$O - PRINT INST. AS OCTAL NUMBER
	SKP
DS	LAC	BAKAR+1		/$S - PRINT INST. SYMBOLIC
	SKP
DT	LAC	QUES+1		/$T - PRINT AS 5/7 PACKED ASCII
	SKP
DV	LAC	AMOD		/$V - PRINT AS TRANSFER VECTOR
	DAC	MODE
	DAC	OUTMOD
	JMP	LLQ
/CHANGE ADDRESS PRINT MODE
DR	LAC	(JMS ADRPR	/$R - PRINT ADDRESS RELATIVE SYMBOLIC
	SKP
DA	LAC	AHA+3		/$A - PRINT ADDRESS IN ABSOLUTE OCTAL
	SKP
DF	LAC	ADRPR1+1		/$F - PRINT ADDRESS IN RELOCATABLE FLOATING ADDRESSES
	DAC	AMOD
	JMP	LLQ
/CHANGE PROTECT MODE
DAT	LAC	SKPN+1
	XCT	ALTF
	LAC	NOPN+1
	DAC	ALTERF
	JMP	LLQ
/SYMBOLIC INSTRUCTION PRINT ROUTINE
/INSTRUCTION IN AC
INSPR	0
	DAC	VALUE	/INST. IN VALUE
	AND	(777000
	DAC	PRINT
	AND	NOPN+1	/740000
	DAC	NUM	/OP CODE IN NUM
	SAD	NOPN+1
	JMP	SPOPR	/OPR OR LAW INSTRUCTION
	SNA
	JMP	SCAL	/CAL INSTRUCTION
	SAD	DACN+1
	JMP	ADINST	/LAC INSTRUCTION
	LAC	(SAD VALUE	/LOOK FOR EXACT MATCH IN DDT SYMBOL TABLE
	JMS	SEARCH
	LAC	TAB4P	/DO NOT INCLUDE Q#
	LAC	(SYMT	/EXACT MATCH FOUND
	JMS	TYPEM	/TYPE MNEMONIC
	JMP*	INSPR	/EXIT
NOLUCK	LAC	NUM	/EXACT MATCH NOT FOUND
	SAD	IOTN+1
	JMP	SIOT	/IOT INST.
	SAD	EAEN+1
	JMP	SEAE	/EAE INST.
ADINST	LAC	(SAD NUM	/ONLY POSSIBILITY LEFT IS ADDRESS INSTRUCTION
	JMS	SEARCH	/SEARCH FOR ONLY OP CODE MATCH
	LAC	TAB4P	/DO NOT LOOK AT Q# ENTRY
	LAC	(SYMT	/TYPE OP CODE MNEMONIC
	JMS	TYPEM
	LAC	VALUE
	AND	(20000
	SNA
	JMP	SYMPR1	/INDIRECT BIT MISSING
	LAW	52	/*
	JMS	TYO
SYMPR1	LAW	40	/SPACE
	JMS	TYO
	LAC	VALUE	/CALCULATE ADDRESS REFERRED TO
	JMS	REFAD
	LAC	P	/XCT IN REFAD
	XCT	AMOD	/TYPE ADDRESS IN CURRENT MODE
	.IFDEF	PDP15
	LAC	PRINT
	AND	(10000
	SNA
	JMP*	INSPR
	LAW	54	/,
	JMS	TYO
	LAW	130	/X
	JMS	TYO
	.ENDC
	JMP*	INSPR
SIOT	LAC	PRINT
	SAD	AACN+1
	LAC	AACN
	SAD	AXSN+1
	LAC	AXSN
	SAD	AXRN+1
	LAC	AXRN
	SPA
	JMP	SIOT1
	JMS	SQPR
	LAC	VALUE
	AND	(777
	DAC	VALUE
	AND	(400
	SZA
	LAW	17000
	XOR	VALUE
	DAC	VALUE
	SPA
	JMP	SPLAW1
	SNA
	JMP*	INSPR
	LAW	40
	JMP	SCAL-1
SIOT1	LAC	IOTN
	SKP
SEAE	LAC	EAEN	/OR EAE +
	JMS	SQPR
	LAC	VALUE	/TRIM OFF OP CODE
	AND	(37777
SYMPR2	DAC	VALUE
	SNA		/QUIT IF REMAINDER 0
	JMP*	INSPR
	LAW	53	/+
	JMS	TYO
SCAL	LAC	VALUE	/PRINT VALUE IN OCTAL WITH 0 SUPPRESSION
	JMS	OADRPR
	JMP*	INSPR
SPOPR	LAW		/OPR OR LAW INSTRUCTION
	AND	VALUE
	SAD	.-2
	JMP	SPLAW	/LAW INSTRUCTION
	DZM	TYI	/OPR INSTRUCTION - OMIT FIRST!
CM1	LAW	-1	/ALL BITS MUST MATCH IN RESULT
	DAC	NECES
SPRAY	LAC	(JMP STOPR	/SEARCH FOR CONSTITUENT ORR'S
	JMS	SEARCH
	LAC	TAB4P	/DO NOT INCLUDE Q#
	LAC	DIFF
	SAD	(377777
	JMP	SPLAT	/NO LUCK THIS TIME
	LAC	BEST
	CMA
	AND	NECES
	DAC	NECES	/REDUCE BITS NEEDED
	LAC	TYI	/INITIALLY 0
	SZA
	JMS	TYO	/TYPE!
	LAW	41	/SET UP FOR NEXT TIME
	DAC	TYI
	LAC	(SYM	/TYPE MNEMONIC FOUND
	JMS	TYPEM
	JMP	SPRAY
SPLAT	LAC	NECES
	AND	VALUE
	JMP	SYMPR2
SPLAW	LAC	LAWN	/TYPE LAW
	JMS	SQPR
SPLAW1	LAW	40	/SPACE
	JMS	TYO
	LAW	55	/-
	JMS	TYO
	LAC	VALUE
	JMS	TWOCMA
	JMP	SCAL+1
/TO SEARCH FOR CLOSEST SYMBOL IN VALUE
SEARCH	0
	DAC	SEATES	/DEPOSIT TEST SWITCH
	LAC	(377777
	DAC	DIFF	/GOODNESS OF FIT SET TO POOREST
	XCT*	SEARCH	/FETCH POINTER TO FIRST SYMBOL ENTRY
	ISZ	SEARCH	/SKIP OVER ARGUMENT ON EXIT
	DAC	TAB
	LAC	NOPN+1	/INITIALIZE SEARCH FLAG
	DAC	SEFLG
SEAGIN	JMS	GETSYM	/FETCH NEXT SYMBOL
	JMP*	SEARCH	/END OF TABLE REACHED
SEATES	SAD	VALUE	/MODIFIED SWITCH
	JMP*	SEARCH	/RETURN WITH MATCH
	LAC	TAB	/IS DDT SYMBOL TABLE DONE
	SAD	TAB3M
	JMP	NOLUCK	/YES
	JMP	SEAGIN	/NO, TRY NEXT ENTRY
/OPERATE TEST SEQUENCE
STOPR	AND	VALUE
	SAD	TRIAL
	CMA!SKP
	JMP	SEAGIN	/VALUE DOES NOT CONTAIN AT LEAST ALL THE 1'S THAT TRIAL DOES
	AND	NUM
	SZA!CLL
	JMP	SEAGIN	/TRIAL NOT OPR INSTRUCTION
	LAC	TRIAL
	JMS	TWOCMA
	TAD	VALUE
	DAC	CH
	LAC	NECES
	AND	TRIAL
	SNA
	JMP	SEAGIN	/NO NEW BITS MATCH
SEAOK	LAC	CH	/IS THIS A BETTER MATCH
	SMA
	JMS	TWOCMA
	TAD	DIFF
	SPA
	JMP	SEAGIN	/NOT BETTER MATCH
	SZA
	JMP	SEAOK1
	LAC	SYMT
	AND	LACN+1
	SZA
	JMP	SEAGIN
SEAOK1	LAC	SYMT	/SAVE BETTER MATCH
	DAC	SYM
	LAC	BOLT
	DAC	BOL
	LAC	TRIAL
	DAC	BEST
	LAC	CH
	SPA
	JMS	TWOCMA
	DAC	DIFF	/ABSOLUTE DIFFERENCE
	JMP	SEAGIN
/2'S COMPLEMENT ACCUMULATOR
TWOCMA	0
	TAD	MINUS
	CMA
	JMP*	TWOCMA
/SYMBOLIC ADDRESS PRINT
ADRPR	0
	AND	(77777	/TRIM OFF EXTRA BITS
	DAC	VALUE
	LAC	(JMP ADR1	/SEARCH FOR CLOSET ADDRESS
	JMS	SEARCH
	LAC	TAB3P	/OMIT SPECIAL ADDRESSES ON OUTPUT
	LAC	DIFF
	SAD	(377777
	JMP	ADRPR1	/NO ADDRESS WITHIN 100 OCTAL
	LAC	(SYM	/TYPE ADDRESS MNEMONIC
	JMS	TYPEM
	LAC	BEST	/DIFFERENCE IN BEST
	SNA!RAL		/SAVE SIGN IN LINK
	JMP*	ADRPR	/EXACT MATCH
	LAW	53	/+
	SZL
	LAW	55	/-
	JMS	TYO
	LAC	DIFF	/ABSOLUTE DIFFERENCE IN DIFF
	JMS	OADRPR	/PRINT IN OCTAL WITH 0 SUP.
	JMP*	ADRPR
ADRPR1	LAC	VALUE
	JMS	RADRPR	/TYPE RELATIVE ADDRESS
	JMP*	ADRPR
/ADDRESS TEST ROUTINE
ADR1	SPA
	JMP	SEAGIN	/ADDRESS MUST BE POSITIVE
	JMS	TWOCMA
	TAD	VALUE
	DAC	TRIAL	/VALUE AND SIGN OF MISMATCH
	DAC	CH
	SPA
	JMS	TWOCMA
	TAD	LIMIT	/CHECK DISTANCE
	SMA
	JMP	SEAGIN	/TOO DISTANT
	JMP	SEAOK	/WITHIN RANGE
/RELATIVE ADDRESS PRINT
RADRPR	0
	AND	(77777	/TRIM EXCESS BITS
	DAC	VALUE
	LAC	H	/COMPUTE RELATIVE ADDRESS
	JMS	TWOCMA
	TAD	VALUE
	SPA
	JMP	RADR1	/PRINT NEG. RELATIVE ADDRESS IN OCTAL
	DAC	VALUE
	LAW	43	/#
	JMS	TYO
	LAW	53	/+
	JMS	TYO
RADR1	LAC	VALUE
	JMS	OADRPR
	JMP*	RADRPR
/OCTAL PRINT WITH 0 SUPPRESSION
OADRPR	0
	DAC	VALUE
	LAW	-6	/6 OCTAL DIGITS
	DAC	TWOCMA
	LAC	VALUE	/WORD IN VALUE
TYPE61	RTL
	RTL
	DAC	ADRES
	RAR
	DAC	VALUE
	LAC	ADRES
	AND	(7
	SNA
	JMP	.+3
	DZM	SUP	/NONZERO DIGIT
	SKP		/ALWAYS TYPE
	SAD	SUP	/TYPE 0?
	JMP	TYPE62	/TYPE DIGIT
	LAW	17777	/IGNORE ALL BUT FINAL 0
	SAD	TWOCMA
	SKP!CLA		/TYPE FINAL 0
	JMP	.+3
TYPE62	XOR	(60	/SET UP ASCII
	JMS	TYO
	LAC	VALUE	/SET UP ITERATION
	ISZ	TWOCMA	/HAVE WE DONE 6
	JMP	TYPE61	/NO, GO BACK
	ISZ	SUP	/NEXT NUMBE 0 SUPPRESSED
	JMP*	OADRPR
/OCTAL PRINT WITHOUT 0 SUPPRESSION
OINSPR	0
	DZM	SUP
	JMS	OADRPR
	JMP*	OINSPR
/SEARCHES
WORD	LAC	SZAN+1	/$W - SEARCH FOR EQUAL WORDS
	SKP
NOT	LAC	SNAN+1	/$N - SEARCH FOR UNEQUAL WORDS
	DAC	TEST
	JMS	WHAT
	XOR	ARG
WHO	AND	FIRST	/MASK IN FIRST ARGUMENT
TEST	SZA
	JMP	WHY
AHA	JMS	CRLF	/FOUND QUALIFIED REGISTER
	LAC	CREG
	DAC	P
	JMS	OADRPR	/PRINT ADDRESS IN OCTAL
	JMS	TAB
	LAC*	CREG
	XCT	OUTMOD	/PRINT CONTENTS IN CURRENT MODE
WHY	ISZ	CREG	/MOVE TO NEXT ADDRESS
	ISZ	DAZ	/ARE WE THROUGH?
	JMP	OHO	/NO
	JMP	LLQ	/YES
/PRINT . AND .+1 AS 5/7 PACKED ASCII
P571	0
	0
	.ASCII <175>
	.LOC	.-1
P57	0
	LAC	P
	DAC	PRINT
	LAC*	PRINT
	DAC	P571
	ISZ	PRINT
	LAC*	PRINT
	DAC	P571+1
	CAL	2775		/.WRITE -3
	11
	P571-2
	-5
	.WAIT	-3
	JMP*	P57
/SET UP SEARCH
WHAT	0
	LAC	LOH
	DAC	CREG
	LAC	HIH
	JMS	ADRES
	NOP
	CMA
	TAD	LOH
	DAC	DAZ
	SMA
	JMP	ERR	/LO > HI
	LAC	MKH	/M# IS DEFAULT MASK
	XCT	FARGF
	DAC	FIRST
OHO	LAC*	CREG	/FETCH CONTENTS OF NEXT REGISTER
	JMP*	WHAT	/RETURN TO TEST ROUTINE
ADRS	LAC	SZAN+1	/$ E-EFFECTIVE ADDRESS SEARCH
	DAC	TEST
	JMS	WHAT
	AND	NOPN+1	/CHECK IF REGISTER CONTAINS AN
	SPA!SNA		/ADDRESS INSTRUCTION
	TAD	SADN+1	/540000
	SPA
	JMP	WHY	/NOT ADDRESS INSTRUCTION
	LAC*	CREG	/CALCULATE ADDRESS REFERRED TO DIRECTLY
	JMS	REFAD
	LAC	CREG	/XCT IN REFAD
	DAC	SHOT3
	.IFDEF	PDP15
	LAC*	CREG
	AND	(30000
	XOR	(10000
	SNA!CLA
	LAC	XH
	TAD	SHOT3
	.ENDC
	XOR	ARG
	AND	(77777
	AND	FIRST	/MASK BEFORE CHECKING
	SNA
	JMP	AHA	/MATCH
	LAC*	CREG	/IS INST. INDIRECT REFERENCE
	AND	(20000
	SNA
	JMP	WHY	/NO, TRY NEXT REGISTER
	LAC	SHOT3	/YES, IS REGISTER INDEX REG.
	AND	(77770
	XOR	(10
	SNA!CLA
	TAD	(1	/YES, ADD 1
	TAD*	SHOT3
	.IFDEF	PDP15
	DAC	SHOT3
	LAC*	CREG
	AND	(10000
	SZA
	LAC	XH
	TAD	SHOT3
	.ENDC
	XOR	ARG	/REGISTER IS SAME
	AND	(77777
	JMP	WHO
/SET SEARCH LIMITS
DL	XCT	ARGF	/$L
	LAC	LKH1	/2ND REG. OF DDT IS DEFAULT UPPER LIMIT
	DAC	HIH
	LAC	FIRST
	XCT	FARGF
	LAC	PAH	/1ST REG. OF PATCH AREA IS DEFAULT
			/LOWER LIMIT
	DAC	LOH
	JMP	LLQ
/INITIALIZE MEMORY TO A CONSTANT
DM	JMS	WHAT	/$M
	LAC	CREG
	JMS	ADRES
	JMP	.+3	/ADDRESS MUST BE LEGAL
	LAC	ARG
	DAC*	CREG
	JMP	WHY
/DEFINING A SYMBOL
CLOSEP	XCT	LETF	/)
	JMP	ERR	/SYMBOL IS ILLEGAL
	LAC	P	/. IS DEFAULT VALUE FOR SYMBOL
	XCT	FARGF
	DAC	FIRST
	LAC	(JMP NEWSYM
	DAC	SCAN+1	/INTERCEPT ERROR ON SYMBOL NOT FOUND
	JMS	EVAL
	LAC	TABP	/SYMBOL FOUND
	CMA
	TAD	TAB3M1
	SPA!CLC
	JMP	CLOSE1	/OBJECT TIME SYMBOLS MAY BE REDEFINED
	LAW	130	/X-SYMBOL MAY NOT BE REDEFINED
	JMS	TYO
	JMP	CLOSE2
CLOSE1	TAD	TAB
	DAC	TAB
	LAC	FIRST
	DAC*	TAB	/REDEFINE SYMBOL
	JMP	CLOSE2
NEWSYM	LAC	TAB3M	/SYMBOL NOT FOUND
	DAC	TAB
	LAC	BOL
	SZA!CLA!STL
	RAR		/PUT 1 IN SIGN BIT
	XOR	SYM
	JMS	QUASH
	LAC	BOL
	SZA
	JMS	QUASH
	LAC	FIRST
	JMS	QUASH
	LAC	TAB	/INCLUDE NEW ENTRY IN DDT SYMBOL TABLE
	DAC	TAB3M
CLOSE2	LAC	(JMP LOSE	/REPLACE ERROR JUMP
	DAC	SCAN+1
	JMP	LLQ
/ADD TO SYMBOL TABLE
QUASH	003340
	DAC*	TAB
	ISZ	TAB
	LAC	TAB
	SAD	TABMAX
	SKP
	JMP*	QUASH
	LAW	117	/O - OVERFLOW
	JMS	TYO
	JMP	CLOSE2
/KILL SYMBOLS $K
DKAY	LAC	TAB3M1
	DAC	TAB3M
	LAC	PAH
	JMP	DK1
DK	XCT	ARGF
	JMP	DKAY
	SZA
	JMP	ERR	/ARGUMENT MUST BE 0
	LAC	LOWSYM	/SET MAXIMUM+1 OF TABLE TO
			/BEGINNING
	DAC	PAH
DK1	DAC	H	/ALSO RELOCATION FACTOR
	LAC	(PAH-1	/INITIALIZE HEADER
	DAC	HEAD
	LAC	P
	JMS	PADJ
	JMP	LLQ
/MISCELLANEOUS COMMANDS
DH	XCT	ARGF	/$H-MAKE HEADER CURRENT
	LAC	SAH		/STARTING ADDRESS OF PROGRAM IS DEFAULT HEADER ARG
	JMS	PADJ
	JMP	LLQ
DU	DAC	ACH	/$U - RESET AC AND LINK
	LAC	FIRST
	DAC	LKH
	JMP	LLQ
D0	JMS	EVAL		/$0 - SET UP AUTO-INDEX REG. USED BY DDT
	XCT	ARGF
	LAC	(7	/DEFAULT REGISTER IS 17
	AND	(7
	XOR	(10
	DAC	AXH
	JMP	LLQ
/TYPING ROUTINES
TYI	.SCOM+3		/READ ONE CHARACTER
	CAL	3776	/.READ
	10
	SHOT		/INPUT BUFFER
	-3		/READ 1 CHARACTER
	.WAIT	-2
	LAW	-12
	ISZ	TABC
	SKP
	DAC	TABC	/COUNT INPUT CHARACTERS FOR TAB
	JMP*	TYI
/INPUT BUFFER
SHOT	-1
SHOT1	.SCOM+1		/POINTS TO ADDRESS OF FIRST WORD OF SYMBOL TABLE
CH	130357		/TYPED CHARACTER
TYO	055170		/TYPE CHARACTER IN RIGHT
	DAC	SHOT3	/JUSTIFIED 7 BIT ASCII
	CAL	3775	/.WRITE
	11
	BLOTCH		/OUTPUT BUFFER
	-3
	.WAIT	-3	/WAIT FOR COMPLETION
	ISZ	TABC
	JMP*	TYO
	LAW	-12	/COUNT OUTPUT LETTERS FOR TAB
	DAC	TABC
	JMP*	TYO
BLOTCH	2005		/OUTPUT BUFFER HEADER WORD
SHOT2	.SCOM+2		/POINTS ADDR. +1 OF SYMBOL WORD TABLE END
SHOT3	.SCOM+6		/POINTS USER STARTING ADDRESS CHANGED TO DDT STARTING ADDRESS
	377		/RUBOUT- IGNORED BY TTY HANDLERS
TAB	.SCOM+11		/TYPE TAB
	LAW	40	/TYPE AS MANY SPACES AS NECESSARY TO FORCE TABC TO -12
	JMS	TYO
	LAW	-12
	SAD	TABC
	JMP*	TAB
	JMP	TAB+1
CRLF	0		/TYPE CAR. RET. OR LINE FEED
	CAL	775		/.INIT TT
	1
	.IFDEF	BF
	300000			/DO NOT DISTURB ^P
	.ENDC
	.IFUND	BF
	XCT+STARET		/^T ADDRESS
	.ENDC
	0
	LAW	-11
	DAC	TABC
	.WAIT	-3
	.IFDEF	BF
	LAC	(3
	.ENDC
	JMP*	CRLF
/TYPE MESSAGE IN RADIX 50
TYPEM	0
	DZM	SPACF	/FILE NAME FALG
	DAC	SUP	/ADDRESS OF MESSAGE
TYPEM1	LAC*	SUP
	JMS	SQPR	/PRINT 3 SQOZE
	LAC*	SUP	
	ISZ	SUP	/INCREMENT POINTER
	RAL
	SPA!CLC
	DAC	SPACF	/BIT 1=1 INDICATES FILE NAME
	SZL		/BIT 0=1 INDICATES CONTINUATION
	JMP	TYPEM1
	LAW	47	/' MEANS FILE NAME
	ISZ	SPACF
	SKP
	JMS	TYO	/TYPE FINAL ' FOR FILE NAME
	JMP*	TYPEM
/OUTPUT 3 CHARACTERS FROM RADIX 50
SQPR	0
	AND	(177777	/TRIM OFF TOP 2 FLAG BITS
	DAC	OADRPR
	LAW	-3	/PRINT 3
	DAC	RADRPR
	LAC	(M3100	/ADDRESS OF CONVERSION RADIX CONSTANTS
	DAC	OINSPR
SQPR1	LAC	OADRPR	/SIMULATED DIVIDE
	DZM	CHA	/QUOTIENT
	TAD*	OINSPR	/DIVISOR
	SPA
	JMP	SQPR2
	ISZ	CHA
	DAC	OADRPR	/REMAINDER
	JMP	SQPR1+2
SQPR2	LAC	CHA	/PRINT SQOZE
	SNA
	JMP	SQPR3	/IGNORE SPACE
	TAD	(-34	/TRANSLATE TO ASCII
	SNA!CMA
	LAW		/.(56)
	SNA!CMA
	LAW	111	/%(45)
	SMA
	TAD	(-55	/NUMBERS AND.
	TAD	(134
	SAD	(72
	LAW	243	/#43
	JMS	TYO
SQPR3	ISZ	OINSPR	/NEW DIVISOR
	ISZ	RADRPR	/THROUGH?
	JMP	SQPR1	/NO
	JMP*	SQPR	/YES
	.IFUND	NOPAT
/PATCH FILE OUTPUT ROUTINES
DD	JMS	PINIT	/$D - DUMP DDT-TIME SYMBOLS
	LAC	TAB3M1
	DAC	FIRST	/LOWER ADDRESS OF OBJECT TIME SYMBOL TABLE
	LAC	TAB3M	/UPPER ADDRESS OF OBJECT TIME
	DAC	ARG	/SYMBOL TABLE
	LAC	LSYM	/OUTPUT POINTER TO END OF DDT SYMBOL TABLE
	JMS	PUTP
	JMP	DF2-1	/OUTPUT SYMBOL TABLE
DQ	JMS	PINIT	/$Q - OUTPUT PATCH FILE
	XCT	FARGF
	JMP	DF1	/NO FIRST ARGUMENT MEANS OUTPUT 1 REGISTER
	LAC	ARG
	JMS	ADRES
	NOP
	JMS	TWOCMA
	TAD	FIRST
	SMA!SZA
	JMP	ERR	/UPPER LIMIT BELOW LOWER LIMIT
	LAC	FIRST
DF2	JMS	PUTP	/OUTPUT WORD
	LAC	PFBUF+2
	SAD	ARG	/TEST FOR END
	JMP	LLQ
	TAD	(1
	JMP	DF2
DF1	LAC	ARG	/OUTPUT 1 REGISTER
	XCT	ARGF
	LAC	P	/DEFAULT REGISTER IS -
	JMS	PUTP
	JMP	LLQ
DC	CAL	772	/$C - CLOSE PATCH FILE
	6
	JMP	LLQ
PINIT	0
	ISZ	PUTP	/.INIT PATCH FILE ONLY ONCE
	JMP*	PINIT
	CAL	1772	/.INIT -6 FOR OUTPUT
	1
PFBUF	2000		/OUTPUT BUFFER
	0
	JMP*	PINIT
	0
PUTP	-1		/OUTPUT ONE PATCH ADDRESS AND CONTENTS
	DAC	PFBUF+2
	LAC*	PFBUF+2
	DAC	PFBUF+3
	CAL	772	/.WRITE
	11
	PFBUF
	-4		/OUTPUT 2 WORDS
	CAL	772	/.WAIT -6
	12
	JMP*	PUTP
/PATCH FILE INPUT
PFBUFI	.BLOCK 4	/INPUT BUFFER
DI	CAL	770	/$I - .INIT -10 FOR INPUT
	1
LSYM	TAB3M		/ADDRESS OF POINTER TO END OF DDT SYMBOL TABLE
	0
DR3	CAL	770	/.READ -10
	10
	PFBUFI		/INPUT BUFFER
	-4		/2 WORDS
	CAL	770	/.WAIT -10
	12
	LAC	PFBUFI
	AND	(60
	SZA
	JMP	ERR	/INVALID ENTRY
	LAC	PFBUFI
	AND	(17
	SZA
	JMP	DR2	/END OF PATCH FILE REACHED
	LAC	PFBUFI+3
	DAC*	PFBUFI+2
	JMP	DR3
DR2	CAL	770	/.CLOSE -10
	6
	JMP	LLQ
	.ENDC
/END OF PROGRAM
	.IFDEF	PTP
	.END	BANK*20000+17720
	.ENDC
	.IFUND	PTP
	.END	START
