	.TITLE MACRO-15 V1A
/COPYRIGHT 1970, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
	.ABS
	.IFUND BANK
BANK=0
	.ENDC
	.IFUND PTP
	.IFUND	BF
	.IFDEF %MACI
	.IFDEF %PDP9
%MAC9I=1
	.ENDC
	.ENDC
	.IFUND %MACI
	.IFUND %PDP9
	.IFDEF %DIMAC
	.LOC 4340	/MACRO/D  FOR IN HOUSE USE ONLY/
	.ENDC
	.IFUND %DIMAC
	.LOC 4400	/MACRO-15 V1A FULL BLOWN MACRO-15
	.ENDC
	.ENDC
	.IFDEF %PDP9
	.LOC 5100	/MACRO-9 V6A
	.ENDC
	.ENDC
	.ENDC
	.IFDEF %MAC9I
	.LOC 5440	/MACRO/I-9 V6A
	.ENDC
	.IFUND %MAC9I
	.IFDEF %MACI
	.LOC 5163	/FULL BLOWN MACROI-15
	.ENDC
	.ENDC
	.ENDC
	.ENDC
	.IFDEF	BF
	.LOC 4760	/BACKGROUND/FOREGROUND MACRO-9
%PDP9=1
	.ENDC
	.ENDC
	.IFDEF PTP
	.LOC BANK*20000+4410
	.ENDC
	.EJECT
/ALL ENTRIES IN THE MACRO-15 SYMBOL TABLE ARE 54 BITS LONG.
/THERE ARE NO WASTED BITS.  THE USER SYMBOLS ARE STORED
/DIRECTLY UNDER MACRO-15 AND WORK DOWN TO LOW CORE.
/IF AN EXTRA PAGE IS NOT AVAILABLE THE EXTRA PAGE CODE
/UP TO 'START' IS OVERLAID WITH USER SYMBOLS.
/
/I.E. LOCATIONS 4000,4001, AND 4002 CONTAIN A SYMBOL
/'ZZ'.  IF A NEW SYMBOL 'AA' WERE INTRODUCED IT WOULD
/BE STORED IN 3775,3776, AND 3777.  3775 AND 3776
/CONTAIN THE FIRST AND SECOND HALF OF THE SYMBOL
/CHARACTERS IN RADIX 50.  3777 WOULD CONTAIN ITS
/VALUE.  SYMBOLS ARE STORED IN ALPHABETIC SEQUENCE.
/IF A SYMBOL MUST BE INSERTED INTO THE MIDDLE
/OF A TABLE THE ENTIRE LOWER HALF IS MOVED DOWN
/THREE WORDS AND THE NEW SYMBOL IS MERGED IN.
/THE SYMBOL BITS ARE:
/
/WORD1		BIT 0: 1=DIRECT ASSIGNMENT
/		       0=NOT A DIRECT ASSIGNMENT
/
/		BIT 1: 1=RELOCATABLE SYMBOL
/		       0=ABSOLUTE SYMBOL
/
/		BITS 2-17: SYMBOL CHARS 1-3 IN RADIX 50.
/
/
/WORD2		BITS 0-1: 00=SYMBOL UNDEFINED
/			  01=EXTERNAL SYMBOL (GLOBL)
/			  10=LOCAL SYMBOL
/			  11=INTERNAL SYMBOL (GLOBL)
/
/		BITS 2-17: SYMBOL CHARS 4-6 IN RADIX 50.
/
/
/WORD3		18 BIT VALUE IF BIT0 OF WORD1=1.
/		OTHERWISE:
/		BIT0: IF BIT 2=0, 0=NOT A VARIABLE
/				  1=VARIABLE
/
/		IF BIT 2=1, 0=MACRO NOT DEFINED IN PASS2
/			    1=MACRO DEFINED IN PASS2
/
/		BIT 1: 0=NOT MULTIPLY DEFINED
/		       1=MULTIPLY DEFINED (ERROR)
/
/		BIT 2: 0=NOT MACRO NAME
/		       1=MACRO NAME
/
/		BITS 3-15: 15 BIT VALUE IF WORD 1, BIT 0
/			   IS 0. (NOT DIRECT ASSIGNMENT)
/
	.EJECT
/MACRO-15 MAY HAVE AN EXTRA PAGE OF MEMORY FOR
/SYMBOL TABLE SPACE.  THIS MEANS THAT SYMBOL TABLE
/SPACE IS NOT CONTIGUOUS AND IN TWO SECTIONS.
/THE FOLLOWING CODE DOES MOST OF THE WORK TO HANDLE
/THE EXTRA PAGE.  IF THE EXTRA PAGE IS NOT IN,
/MEMORY IS CONTIGUOUS, SO THIS CODE IS NOT REQUIRED.
/.SCOM+3 WOULD THEN BE ADJUSTED UPWARD SO THAT
/THE WORDS UP TO 'START' ARE OVERLAYED WITH
/SYMBOLS.
	.IFUND %MACI
	.IFUND %PDP9
/
/
PAGIN	LAC	PAGTOP		/HIGHEST CORE LOCATION
	DAC	PAGBOT		/LOWEST OF XTRA PAGE (SO FAR)
	DAC	BEGUST		/BEGINNING (LOWEST) OF USER SYMBOLS.
	LAC	SCOM20
	DAC PAGEND
	LAC* L103
	DAC USTEND
	JMP PG001
/THIS CODE IS EXECUTED AFTER PASS1 BUT BEFORE PASS2 BEGINS.
/THE PROGRAM SEARCHES THROUGH THE SYMBOL TABLE AND
/PRINTS ALL UNDEFINED SYMBOLS.  IT STARTS AT THE BOTTOM
/AND WORKS UP.
/CONTROL COMES HERE AFTER A SYMBOL IS PROCESSED.  WE MUST
/DETERMINE WHETHER OR NOT TO SKIP OVER THE PROGRAM BLOCK, ETC.
/THE USTBEG POINTER IS POINTING TO THE LAST WORD OF THE SYMBOL
/JUST PROCESSED.  IF IT IS EQUAL TO THE END OF SECTION 2 POINTER
/SKIP OVER THE BLOCK.
/
PAGSYM	LAC	USTBEG
	SAD	USTEND		/END OF BOTTOM SECTION.
	SKP
	JMP	PG0003
	LAC	PAGEND		/SKIP OVER TO THE SYMBOLS IN
	DAC	USTBEG		/THE EXTRA PAGE.
	JMP	CVA
/FROM SUBS GIVS,CKEST
/THE SYMBOL TABLE POINTER 'USTBEG' HAS REACHED THE
/TOP OF THE BOTTOM SECTION.  ADJUST THE POINTER SO THAT IT
/IS POINTING TO THE LOWEST SYMBOL IN THE UPPER PAGE.
/
PAG005	LAC	PAGEND
	DAC	USTBEG
	JMP	LAWITH		/TEST FOR LITERAL
/
/TEST FOR END OF SYMBOL TABLE
/
PAG006	SAD	PAGTOP
	JMP*	CKEST
	JMP	LAWITH
/
/LITERALS ARE ALWAYS STORED AT THE TOP OF THE USER
/SYMBOL TABLE.  WHEN COMPUTING FOR THE BEGINNING OF
/THE LITERAL TABLE, MULTIPLY THE LITERAL COUNT BY 3
/AND SUBTRACT IT FROM THE TOP.  IF THE RESULT IS LESS
/THAN THE PAGE BOTTOM THE LITERAL TABLE GOES INTO THE
/BOTTOM SECTION.
/
PAG007	TAD	PAGTOP		/AC=3*LITS SUB FROM PAGTOP.
	DAC*	L10
	LAC	PAGEND
	JMS	TWOS
	TAD*	L10
	SMA			/IF NEG TABLE OVERFLOWS INTO
	JMP*	LITBEG		/SECTION 2
	JMP	PG0008
/
/
/SEARCH THE EXTRA PAGE FIRST.  IF THE SYMBOL IS FOUND, EXIT.
/IF ITS NOT FOUND COMPARE THE MERGING LOCATION PRODUCED FROM
/SEARCH WITH THE PAGE END LOCATION.  IF IT IS GREATER, THE
/SYMBOL DOESN'T EXIST IN THE SYMBOL TABLE YET, OTHERWISE;
/THE SYMBOL IS LESS THAN THE BOTTOM SYMBOL IN THE UPPER
/PAGE.  SEARCH THE LOWER SECTION IN THAT EVENT.
/
SRXPAG	LAC	SRCUS1		/GET AND SET THE SRCUST INPUT ARG.
	DAC	SRCUS2
	JMS	SEARCH
	LAC	PAGTOP		/TOP (HIGHEST AVAIL LOC. OF PAGE.
	LAC	PAGBOT		/BOTTOM OF EXTRA PAGE SO FAR.
	LAC	AD32		/POINTER TO CURRENT SYMBOL.
SRCUS2	XX			/400002 OR 2 (CONTROL WORD).
	JMP*	SRCUST		/FOUND, EXIT
/
/THE SYMBOL WAS NOT FOUND.  A POINTER (MRGLOC) HAS BEEN SET
/BY 'SEARCH' FOR THE ADDRESS TO MERGE THIS SYMBOL IN.  IF
/THE MERGE LOCATION IS GREATER THAN PAGEND, THE
/SYMBOL DOESN'T EXIST.  (TABLE IN ALPHA SEQUENCE).
/
	LAC	MRGLOC
	JMS	TWOS
	TAD	PAGEND
	SMA
	JMP	NOEXPG		/SEARCH BOTTOM SECTION
	JMP	SRCNFD		/.SYMBOL NOT FOUND, EXIT
/
/TEMP STORAGE FOR EXTRA PAGE
/
PAGEND	0			/VARIABLE END, MOVES UP IF MACRO DEF'S OVERFLOW
PAGBOT	0			/VARIABLE BEGINNING, MOVES DOWN.
SCOM20	0			/AFTER SET, REMAINS CONSTANT FOR ENTIRE
PAGTOP	0			/CORE LOAD
/A SYMBOL HAS TO BE MERGED INTO THE USER SYMBOL TABLE.  THE
/SYMBOL TABLE IS IN TWO NON-CONTIGUOUS SECTIONS.  IF THE
/MERGING LOCATION SET UP BY 'SEARCH' IS POINTING TO SOMEWHERE
/IN THE UPPER PAGE, THE BOTTOM SECTION MAY HAVE TO BE
/PUSHED DOWN IF THE UPPER PAGE IS FULL.
/BECAUSE OF THE WAY 'SRCUST' IS SET UP, PAGEND AND
/MRGLOC CAN NEVER BE EQUAL.  IF THE SYMBOL TABLE IN THE
/EXTRA PAGE BECAME FULL THE LAST TIME A SYMBOL WAS
/MERGED THE 'BEGUST' SWITCH HAS BEEN SET TO THE BOTTOM
/SECTION.
/
MGXPAG	LAC	MRGLOC		/MERGING LOCATION+3
	JMS	TWOS
	TAD	PAGEND
	SMA
	JMP	NOXMRG		/MERGE INTO BOTTOM.
/THE SYMBOL MUST BE STORED IN THE TOP SECTION.  IF THE PAGE IS
/FULL MOVE THE BOTTOM SECTION DOWN THREE WORDS, AND THE
/BOTTOM THREE WORD FROM THE TOP SECTION.
/
	LAC	PAGBOT		/IS THE PAGE FULL?
	SAD	PAGEND
	SKP			/YES..DO THE ADJUSTING
	JMP PNOFUL
	JMS MOVMRG		/MOVE THE BOTTOM SECTION DOWN 3 WORDS.
	LAC	USTEND		/TOP OF BOTTOM SECTION.
	LAC	BEGUST		/BOTTOM OF BOTTOM SECTION.
	LAC PAGBOT		/POINTER TO THREE WORDS TO MOVE IN.
	JMS ADD3			/ADJUST POINTER(DECREMENTED LATER).
	DAC PAGBOT
/
PNOFUL	JMS	MOVMRG		/MERGE SYMBOL INTO TOP PAGE.
	LAC	MRGLOC
	LAC	PAGBOT
	LAC	CMPLOC
	JMS	SUB3		/ADJUST PAGE BOTTOM
	DAC	PAGBOT
	JMS	SUB3
	DAC	BEGUST
/THE SYMBOL HAS BEEN MERGED IN AND ALL POINTERS HAVE BEEN
/ADJUSTED.  IF THE PAGE JUST BECAME FULL 'BEGUST' AND 'PAGEND'
/MUST BE EQUAL.  IN THAT EVENT ADJUST BEGUST TO POINT TO THE
/TOP OF THE SECOND SECTION.  (.SCOM+3).
/
	SAD	PAGEND
	LAC USTEND		/C(.SCOM+3)
	JMP	MGOUT1
/THE DUMMY ARGUMENTS OF A MACRO DEFINITION ARE BEING
/SET UP. IF THE EXTRA PAGE IS NOT ALREADY FULL,
/SAVE THE PAGE POINTERS. IF IT IS FULL TURN THE EXTRA-
/PAGE-IN SWITCH OFF.
/
PAGDUM	LAC PAGTOP
	DAC GETBOP		/SAVE TOP OF PAGE POINTER.
	LAC PAGBOT
	DAC INDXSW		/SAVE BOTTOM POINTER.
	SAD PAGEND		/IS PAGE FULL?
	JMP PAGDM1		/PAGE IS ALREADY FULL.
	DAC PAGTOP
	LAC* L103
	DAC USTEND
	JMP DUMBAK
/
PAGDM1	LAC SKPLIT
	DAC EXPAGE
	JMP DUMBAK
/RESTORE PAGE POINTERS.
/
PAGRES	LAC GETBOP
	DAC PAGTOP
	LAC INDXSW
	DAC PAGBOT
	JMP .ENDMA
/THE MACRO DEFINITION IS BEING BUILT UPWARD TOWARD THE USER
/SYMBOL TABLE. IF THE DEFINITIONS REACH LOCATION
/USTEND (C(103)) TERMINATE THE ASSEMBLY.
/
PAKPAG	SAD USTEND
	SKP			/TERMINATE ASSEMBLY
	JMP PKPGA			/OK...STORE THE CHAR.
	LAC ID			/'MACRO' OVERFLOW
	DAC TORC
	LAC ID+1
	JMP STOVB-1
	.ENDC
	.ENDC
	.EJECT
/AFTER BANK GITS ARE INITIALIZED CONTROL GOES TO PASS1.
/
/MACRO-15,MACROI-15
/THE FIRST SIX LOCATIONS OF THIS PROGRAM ARE USED TO STORE
/THE INPUT PROGRAM NAME (3 LOCATIONS) AND THE OUTPUT FILE
/NAME BOTH FOR THE BINARY AND FOR THE LISTING. THE FILE
/EXTENSION CAN BE 'BIN', 'ABS', OR 'LST'.
START	JMP INITBB	/SET BANK BITS
	0		/2ND HALF OF INPUT PROG NAME.
	0		/EXTENSION
IFEXT	0		/OUTPUT FILE NAME
BNOPTN	0		/BINARY OPTION.
ALOPTN	0		/LISTING OPTION.
ASWCH	0		/ALPHA SEQUENCE FOR OUTPUTTING SYMBOLS.
CSWCH	0		/DON'T PRINT UNSATISFIED CONDITIONAL AREA.
VSWCH	0		/VALUE SEQUENCE FOR OUTPUTTING SYMBOLS.
	.IFDEF %MACI
DSWCH	0
TSWCH	0
MSWCH	0
	.ENDC
BATCH	0
GSWCH	0	/DO NOT PRINT GENERATED LINES.
XSWCH	0	/NUMBER LINE AND CROSS REFERENCE DURING PASS3.
NSWCH	0	/NUMBER THE LINE SWITCH.
LSWCH	0		/LIST PARAN USED SWITCH (USED BY .LST,.NO LST)
	.IFUND %MACI
	.IFUND %DIMAC
/***ABSOLUTE BINARY LOADER ***
/
CLOF=700004
RRB=700112
RSB=700144
RSF=700101
LDSTRT=17720
BINLDR	CAF		/CLEAR FLAGS
	CLOF		/CLOCK OFF
	IOF+10		/INTERRUPT OFF
	ISA		/TURN OFF API
	.IFUND %PDP9
LODMOD	XX		/(EBA) OR (DBA)
	.ENDC
	707702		/PDP-9 COMPATIBILITY (EEM)
LDNXBK=17726
	DZM LDCKSM	/CHECKSUMMING LOCATION
	JMS LDREAD
	DAC LDSTAD	/GET STARTING ADDRESS
	SPA		/BLOCK HEADING OR
	JMP LDXFR		/START BLOCK
	JMS LDREAD
	DAC LDWDCT	/WORD COUNT (2'S COMPLEMENT)
	JMS LDREAD
LDNXWD=17736
	JMS LDREAD
	DAC* LDSTAD	/LOAD DATA INTO APPROPRIATE
	ISZ LDSTAD	/MEMORY LOCATIONS
	ISZ LDWDCT	/FINISHED LOADING
	JMP LDNXWD	/NO
	TAD LDCKSM
	SZA		/LDCKSM SHOULD CONTAIN 0
	HLT		/CHECKSUM ERROR HALT
	JMP LDNXBK	/PRESS CONTINUE TO IGNORE
LDXFR=17747
	DAC LDWDCT
	ISZ LDWDCT
	JMP LDWAIT	/EXECUTE START ADDRESS
	HLT		/NO ADDRESS ON .END STATEMENT
LDREAD=17753		/MANUALLY START USER PROGRAM
	0
	RSB
	TAD LDCKSM
	DAC LDCKSM
	RSF
	JMP LDREAD+4
	RRB
	JMP* LDREAD
/THE LAST FRAME OF EVERY .ABS(P) PROG IS GARBAGE.
LDWAIT=17763
	JMS LDREAD	/PASS OVER LAST FRAME (PDP-9
	JMP* LDSTAD	/COMPATABILITY).
ENDLDR=.
HRMWD	003500;	0		/HEADER
	261;	277	/HRM START
	320;	0
LDCKSM=17775
LDSTAD=17776
LDWDCT=17777
/
/*** END OF LOADER ***
	.ENDC
	.EJECT
	.IFDEF %DIMAC
/
/--
/***ABSOLUTE BINARY LOADER FOR DIAGNOSTIC PROGRAMS***
/
CLOF=700004
RRB=700112
RSB=700144
RSF=700101
LDSTRT=17700
KRS=700322
KRB=700312
KSF=700301
BINLDR	CAF		/CLEAR FLAGS
	CLOF		/CLOCK OFF
	IOF+10		/INTERRUPT OFF
	ISA		/TURN OFF API
LODMOD	XX		/(EBA OR DBA) EBA IF .ABS, DBA IF .ABSP
	707702
LDNXBK=17706
	DZM LDCKSM	/CHECKSUMMING LOCATION
	JMS LDREAD
	DAC LDSTAD	/GET STARTING ADDRESS
	SPA		/BLOCK HEADING OR
	JMP LDXFR	/START BLOCK
	JMS LDREAD
	DAC LDWDCT	/WORD COUNT (2'S COMPLEMENT)
	JMS LDREAD	/ADD PROGRAM'S CHECKSUM.
LDNXWD=17716
	JMS LDREAD
	DAC* LDSTAD	/LOAD DATA INTO APPROPRIATE
	ISZ LDSTAD	/MEMORY LOCATIONS
	ISZ LDWDCT	/FINISHED LOADING
	JMP LDNXWD	/NO
	TAD LDCKSM
	SZA		/LDCKSM SHOULD CONTAIN 0
	HLT		/CHECKSUM ERROR HALT
	JMP LDNXBK	/PRESS CONTINUE TO IGNORE
LDXFR=17727
	DAC LDWDCT	/IF IT WAS -1 NO ADDRESS WAS
	ISZ LDWDCT	/SPECIFIED AFTER THE .END AT ASSEMBLY TIME.
	JMP* LDSTAD	/EXECUTE START ADDRESS
	HLT		/NO ADDRESS ON .END STATEMENT
/
/THE READ ROUTINE SELECTS BOTH THE HOGH SPEED AND
/THE LOAW SPEED PAPER TAPE READERS.THE DEVICES ARE
/MUTUALLY EXCLUSIVE,THEREFORE ONLY ONE OF THE TWO
/MAY BE ATTACHED TO THE PDP-15 AT ANY ONE TIME.
/THE SELECT TO THE UNATTACHED DEVICE WILL OPERATE 
/AS A NOP.
/
LDREAD=17733
	0
	TAD LDCKSM
	DAC LDCKSM
	LAW -3
	DAC LDCTR
	DZM LDTMP
	RSB		/HISPEED SELECT
LDRDA=17742
	KRS		/LOW SPEED SELECT
	RSF		/HIGH SPEED FLAG ON?
	SKP		/NO TRY THE LOW SPEED
	JMP HIGHIN	/YES READ AND EXIT
	KSF		/IS THE LOW FLAG ON?
	JMP LDRDA+1		/NO  TEST HIGH FLAG AGAIN
	KRB		/USE LOW SPEED
	TAD LDMSK		/IS THIS A NULL FRAME
	SPA!CLL
	JMP LDRDA		/YES  IGNORE IT
	TAD LDTMP
	ISZ LDCTR
	SKP!RTL
	JMP* LDREAD
	RTL; RTL
	DAC LDTMP
	JMP LDRDA
HIGHIN=17764
	RRB
	JMP* LDREAD
LDMSK=17766
	777600
LDCTR=17773
LDTMP=17774
LDCKSM=17775
LDSTAD=17776
LDWDCT=17777
ENDLDR=.
HRMWD	003500;	0	/HEADER
	261;	277	/HRM START
	300;	0
	.ENDC
/SUBROUTINE TO TURN THE PAGE BIT OF THE .ABS,.ABSP
/LOADER ON OR OFF.
/
	.IFUND %PDP9
ABSLOD	0
	LAC AD50		/LODMOD+1
	DAC ABSADR	/START OF LOOP ADDRESS
	LODMOD+1-ENDLDR	/WORD COUNT
	DAC ABSCNT
ABSLUP	LAC* ABSADR	/GET NEXT WORD
	DAC WRDVAL
	AND IOTLIT	/(700000
	CLL		/IS IT A MEMREF?
	TAD L157S
	SZL		/YES
	JMP ABSNON	/NO..TEST FOR END
	LAC PDP9SW	/YES..TURN PAGE BIT ON OR OFF.
	JMS PAGBIT
	DAC* ABSADR
ABSNON	ISZ ABSADR
	ISZ ABSCNT
	JMP ABSLUP
	JMP* ABSLOD
	.ENDC
	.ENDC
	.ENDC
/
ACCREL	LAC OPRTR		/PICK UP OPERATOR
	AND L7
	TAD (JMP .+3
	DAC .+1
USET1	0
	JMP ARLC		/ADD
	JMP ARLC		/OR
	JMP ARLA		/MPY
	JMP ARLC		/ADD
	JMP ARLC		/XOR
	JMP ARLB		/SUB
	JMP ARLC		/AND
			/DVD
ARLA	LAC CREL		/CURRENT RELOCATION
	SNA
	JMP ARLD
	LAC L1
	DAC AREL		/ACCUMULATED RELOCATION
ARLF	JMS ERRORR	/R TO FLAG WORD
	JMP ARLE
ARLD	LAC AREL
	SAD L1
	JMP ARLF
	JMP ARLE
ARLB	LAC AREL
	SZA
	JMP ARLG
ARLC	LAC CREL
	JMP ARLH
ARLG	LAC CREL
	JMS TWOS
ARLH	TAD AREL
	DAC AREL
ARLE	DZM CREL
	JMP ENDFLD		/END OF OP OR ADDRESS FIELD
	.TITLE BINARY OUTPUT ROUTINES.
BLDBIN	0
	XCT PASSNO		/WHICH PASS
	JMP* BLDBIN	/EXIT ON PASS1
	LAC BNOPTN		/BINARY REQUESTED
	SNA		/YES
	JMP* BLDBIN		/NO
	LAC LOCSW	/.LOC
	TAD BSSW	/.BLOCK
	TAD ENDSW	/OR .END ON
	TAD EXLTSW	/OR EXT OR LIT
	SNA	/YES
	JMP BLDBN1	/NO
	LAC BNWDCT	/WORD COUNT 0
	SNA	/NO
	JMP* BLDBIN	/YES, EXIT
BLDBN2	DAC WDCSAV	/SAVE WORD COUNT
	JMS TWOS
	DAC BNWDCT	/MAKE 2'S COMPLEMENT
	TAD BNCKSM	/ADD IT TO CHECKSUM
	JMS TWOS
	DAC BNCKSM	/2'S COMPLEMENT CHECKSUM
	.IFUND %MACI
	JMS WAIT13	/WAIT FOR PUNCH
	.ENDC
	LAC (LAC AD25
	DAC BLDBN5
	LAC BMODE	/WHAT MODE
	SAD L2	/.FULL
	JMP BLDBN4
	JMS ADD3		/UPDATE WORD COUNT BY 3
	DAC WDCSAV	/FOR .ABS
	SKP
BLDBN4	ISZ BLDBN5	/AD26 NOT AD25
	LAC WDCSAV		/WORD COUNT
	JMS TWOS
	DAC BLDBN3
	JMS MOVER
BLDBN5	XX		/LAC AD25 OT LAC AD26
	LAC AD27
	DZM BNWDCT
	.IFUND %MACI
	JMS NULFRM
	CAL+4765		/WRITE DUMP MODE
	11
MOD35	PTPBUF+2
BLDBN3	0		/CONTAINS W/C IN 2'S
	.ENDC
	.IFDEF %MACI
	JMS DWRITE
	XCT PTPBUF+2
BLDBN3	XX
	.ENDC
	JMP* BLDBIN	/EXIT
BLDBN1	LAC BNWDCT	/WORD COUNT 0
	SZA	/YES
	JMP BLDBN7
	LAC PC	/PC TO
	DAC BNADDR	/ADDRESS AND
	DAC BNCKSM	/CHECKSUM
BLDBN7	LAC WRDVAL	/ADD WORD
	TAD BNCKSM	/TO CHECKSUM
	DAC BNCKSM
	LAC (DAC BNDATA
	TAD BNWDCT
	DAC .+2
	LAC WRDVAL
	DAC 0	/STORE WORD IN
	LAC BNWDCT	/APPROPRIATE POSITION
	TAD L1
	DAC BNWDCT	/UPDATE WORD COUNT
	SAD L31	/CHECK IF FILLED UP
	JMP BLDBN2	/OUTPUT IT
	JMP* BLDBIN	/EXIT
	.IFUND %MACI
NULFRM	0
	LAC BBFSIZ
	SMA
	JMP* NULFRM
	CAL+3765
	11
MOD34C	BLNKS
	-4
	JMP* NULFRM
BLNKS	002500;	0
	0;	0
	.ENDC
	.ENDC
PTPBUF	000500;	0	/PUNCH BUFFER
/
/THE FOLLOWING AR%LOCATIONS FOR WHICH BANK BITS
/HAVE TO BE SET. THIS TABLE CAN BE OVERLAYED WHEN THE
/PROGRAM HAS BEEN INITIALIZED.
/
MODF=.
	.IFUND %MACI
	MOPBEG	/BEGINNING OF MACRO SYMBOLS.
	PS3BEG	/BEGINNING OF 3-WORD SYMBOL TABLE.
	PS2BEG	/BEGINNING OF 2-WORD PERM SYMBOL TABLE.
	SMBEG	/BEGINNING OF SYSTEM MACRO TABLE.
	POPBEG	/BEGINNING OF PSEUDO-OP TABLE.
	MODPAR	/PARAMETER FILE
	MOD1
	MOD1A
	MOD1B
	MOD2
	MOD3
	.IFUND %PDP9
	MPMB01
	MPMB02
	.ENDC
	MPMB03
	MPMB04
	MOD3A
	MOD4
	MOD4A
	MOD5
	MOD5A
	MOD5B
	MOD6
	MOD19A
	MOD26
	MOD27
	MOD28
	MOD31
	MOD31A
	MOPEND
	MOD34C
	MOD35
	MOD29
	MOD30
	MOD30A
	PS3END
	PS2END
	SMEND
	POPEND
	MOD33
	MOD33B
	MOD33C
	MOD34
	MOD34A
	MOD34B
	MOD36
	MOD37
	MOD38
	.ENDC
MODL=.
MODCT=MODL-MODF\777777+1	/MOD COUNT
	.BLOCK	MODF-MODL+34+34
BNADDR=.-34
BNWDCT=.-33
BNCKSM=.-32
BNDATA=.-31
/
/BUILD LINKING LOADER BINARY OUTPUT
/
IOPHDR=BNADDR
LLCKSM=BNWDCT
LLDATA=BNCKSM
BLDLLB	0
	XCT PASSNO
	JMP* BLDLLB
	LAC BNOPTN
	SNA
	JMP* BLDLLB
	LAC (DAC LLDATA
	TAD LLWDCT	/OUTPUT DATA WORD TO
	DAC .+2		/APPROPRIATE BUFFER POSITION
	LAC LLBWRD
LOLIM	DAC 0
	ISZ LLWDCT	/UPDATE BUFFER POSITION
	JMS DIVIDE	/DIVIDE POSITION BY 4
	LAC LLWDCT
	LAC K4
/
/PACK CURRENT CODE INTO ACCUMULATED CODE WORD
/
	LAC DVD		/REMAINDER; 2=1ST
	SZA		/3=2ND, 0=3RD
	JMP PKCDA
	LAC LLCODE	/PICK UP CURRENT CODE
	JMP PKCDC
PKCDA	SAD L3
	JMP PKCDB
	LAC LLCODE
	RCR
	JMS RIGHT6
	JMP PKCDC
PKCDB	CLL
	LAC LLCODE
	JMS LEFT6
PKCDC	XOR LLBCDE
	DAC LLBCDE	/ACCUMULATE CODE WORD
	LAC DVD
	SNA
	JMP LLB1
	LAC LLCODE	/CHECK FOR
	SAD L27		/END OF PROGRAM CODE
	SKP
	JMP* BLDLLB	/EXIT
	ISZ LLWDCT
	LAC DVD		/ADJUST WORD COUNT
	SAD L2
	ISZ LLWDCT
LLB1	LAC (DAC LLDATA
	TAD LLWDCT	/OUTPUT CODE WORD
	TAD LAWM4		/TO APPROPRIATE POSITION
	DAC .+2
	LAC LLBCDE
HILIM	DAC 0
	DZM LLBCDE	/CLEAR ACCUMULATED CODE WORD
	LAC LLWDCT
	SAD L30		/BUFFER FULL
	JMP LLB3		/YES
	LAC LLCODE
	SAD L27		/END
	JMP LLB3		/YES
	ISZ LLWDCT	/UPDATE WORD COUNT
	JMP* BLDLLB	/EXIT
LLB3	ISZ LLWDCT
	ISZ LLWDCT	/WORD / PAIR COUNT
	LAC LLWDCT
	JMS LEFT8		/ROTATE AC LEFT 8-BITS
	AND (77000
	XOR (500
	DAC IOPHDR
	.IFUND %MACI
	JMS WAIT13	/WAIT FOR BINARY DEVICE
	.ENDC
	LAW -32
	JMS MOVER
	LAC AD29		/IOPHDR-1
	LAC AD30		/PTPBUF-1
	LAC L1
	DAC LLWDCT	/RESET COUNT
	.IFUND %MACI
	CAL+0765		/WRITE IOPS BINARY
	11
MOD36	PTPBUF
	-32
	.ENDC
	.IFDEF %MACI
	JMS DWRITE
	PTPBUF
	.ENDC
	JMP* BLDLLB
/
/CHECK FOR L/L BINARY
/
CKFLLB	0
	JMS TMODE		/LINK LOAD?
	JMP* CKFLLB
	ISZ CKFLLB	/UPDATE EXIT
	XCT PASSNO
	JMP* CKFLLB
	LAC LASW		/NEW LOAD ADDRESS
	SNA		/YES
	JMP LLINST
	LAC LOCSW		/LOC OR
	TAD BSSW		/BLOCK
	SZA		/NO
	JMP* CKFLLB	/EXIT
	DZM LASW
	JMS NEWLA		/GET LOAD ADDRESS
LLINST	LAC WRDVAL	/DATA WORD
	DAC LLBWRD
	LAC K4		/ABS
	DAC LLCODE
	LAC AREL
	SNA
	JMP LLINSA
	ISZ LLCODE
	LAC BITS	/-2 = 13R, 0 = 15R
	TAD LLCODE
	DAC LLCODE
LLINSA	JMS BLDLLB
	JMP* CKFLLB
/
/GET NEW LOAD ADDRESS
/
NEWLA	0
	LAC L2		/L/A CODE
	DAC LLCODE
	LAC PC		/PC IS L/A
	DAC LLBWRD
	LAC SYMTYP
	SPA
	JMP .+4
	LAC LLBWRD
	XOR XCTLIT	/SET ABSOLUTE
	DAC LLBWRD
	JMS BLDLLB	/BUILD LL-BINARY
	JMP* NEWLA
/BUILD LINKING LOADER SYMBOLS
/
LLSTBL	0
	JMS SYM3		/PICK UP 3 WORDS OF SYMBOL
	LAC* LLSTBL	/0=LOCAL, 1=INTERNAL
	TAD (JMP LLSTA	/2=VIRTUAL
	DAC LLSTB
	ISZ LLSTBL
	JMS MACFST
	JMP LLSTB-2
	SKP
	JMP* LLSTBL
	LAC* SWD2		/WORD 2 OF SYMBOL
	AND JMPLIT
LLSTB	JMP 0
LLSTA	JMP LSZMA		/LOCAL
	JMP LLSBI		/INTERNAL
	JMP LLSBV		/EXTERNAL
LSZMA	SZA!SMA
	JMP* LLSTBL	/NOT LOCAL
	JMS PUSLL		/PICK UP SYMBOL
	LAC* SWD1		/WORD1
	SMA
	JMP LLSTC
	LAC L30		/P/A CODE
	DAC LLCODE
	LAC* SWD3		/VALUE
	JMP LLSTD
LLSTC	LAC L23		/LOCAL CODE
	DAC LLCODE
LLSTE	LAC* SWD3		/PICK UP 15 BITS OF VALUE
	AND L57S
LLSTD	DAC LLBWRD
	JMS BLDLLB	/BUILD L/L BINARY
	JMP* LLSTBL
LLSBI	XOR JMPLIT
	SZA
	JMP* LLSTBL	/NOT INTERNAL
	JMS PUSLL
	LAC L12		/INTERNAL CODE
	JMP LLSTE-1
LLSBV	SAD LACLIT
	SKP
	JMP* LLSTBL	/NOT VIRTUAL
	JMS PUSLL
	LAC L11
	JMP LLSTE-1
/
/PICK UP SYMBOL FOR LINK LOADER
/
PUSLL	0
	LAC L7
	DAC LLCODE	/L/L CODE 1-3
	LAC XCTLIT
	DAC TMP		/1-3 OR 4-6 INDICATOR
	LAC* SWD2
	AND L157S
	DAC TMP1		/SAVE LAST 3 CHARS, IF ANY
	SNA
	DZM TMP
	LAC* SWD1
	AND L157S
	XOR TMP		/LENGTH IND
	DAC LLBWRD	/DATA WORD
	JMS BLDLLB	/BUILD L/L BINARY
	LAC TMP
	SMA		/> 3 CHARS
	JMP* PUSLL	/NO
	LAC L10		/L/L CODE 4-6
	DAC LLCODE
	LAC TMP1		/CHARS 4-6
	DAC LLBWRD
	JMS BLDLLB
	JMP* PUSLL
/SUBROUTINE TO SET RELOC TO 13/12 BITS.
/
/
LL13	0
	LAW -2
	DAC BITS
	JMP* LL13
/
/SUBROUTINE TO PRINT A MACRO LINE. THE PACK57 UTILITY
/ROUTINE IS USED SO THE POINTERS MUST BE SAVED BEFORE
/MORE PACKING CAN BE DONE.
/
PRTMAC	0
	JMS PUTSAV	/SAVE POINTERS AND COUNTERS.
	JMS PRTCOM	/PRINT THE LINE.
	JMS PUTRST	/RESTORE POITERS .
	JMP* PRTMAC
	.TITLE MACRO CALL AND DEFIN PROCESSING.
/*** MACRO CALL PROCESSING
/
MACALL	JMS WRD3		/POINT TO THE THIRD WORD TO GET
	LAC* MRGLOC
SYSCAL	DAC MACLOC	/STARTING LOC OF MACRO DEF
	DZM CHVDA		/CURRENT HIGH VALUE OF D/A
	JMS SUB1		/SUB1 FROM CALL LEVEL
	DAC MCLCTR	/UPDATE FOR NEXT LEVEL (SUB1 ARGUMENT)
	SAD LAWM4
	JMP ICOVA		/TOO MANY IMBEDDED CALLS
	TAD (DAC BEGRL1+1
	DAC .+3		/GET BEGINNING OF R/A
	LAC ENDUMT	/LIST FOR CALL LEVEL N
	DAC BEGRAL
	XX		/BEGRL1, BEGRL2 OR BEGRL3
	JMS P57INT
	DZM RANUM		/REAL ARGUMENT NUMBER
	DZM BRKCTR	/ANGLE BRACKETS COUNTER
	JMS TSTC15
	JMP MCLE		/END OF CALL
/
/STORING OF REAL ARGUMENTS
/
MCLA	JMS GETCHR
	JMS CKSPTB	/CHECK FOR SPACE OR TAB
	JMP MCLA		/BYPASS INITIAL SPACES AND TABS
	SAD L15
	JMP MCLE		/NO ARGUMENTS
MCLF	LAC L1		/ARGUMENT INDICATOR
	JMS PAKRAM	/REAL ARGUMENT PACKING
	LAC RANUM		/REAL ARGUMENT NUMBER
	JMS PAKRAM
	LAC CHRHLD
	SAD KOMMA		/,
	JMP MCLB		/END OF ARGUMENT
	SAD (44		/$
	JMP MCLC		/ARGUMENT CONTINUATION
MCLJ	SAD LEFTAB		/<
	JMP MCLK
	SAD RITEAB		/>
	JMP MCLL
MCLN	LAC CHRHLD
	JMS PAKRAM	/PACK CHARACTERS INTO TABLE
	JMP MCLD
MCLK	LAC BRKCTR	/IF OUTERMOST, DO NOT PACK IT
	SNA!CLC
	JMP MCLM
	LAC CHRHLD
	JMS PAKRAM	/PACK <
	JMS SUB1		/UPDATE COUNT FOR BALANCING
MCLM	DAC BRKCTR
	JMP MCLD
MCLL	LAC BRKCTR
	SZA
	ISZ BRKCTR	/IF OUTERMOST, DO NOT PACK IT
	JMP MCLN
MCLD	JMS GETCHR	/GET NEXT CHARACTER
	JMS CKSPTB	/CHECK FOR SPACE OR TAB
	JMP MCLE		/END OF REAL ARGUMENTS
	SAD L15
	JMP MCLE
	SAD KOMMA		/,
	JMP MCLB		/END OF CURRENT ARGUMENT
	SAD (44		/$
	JMP MCLC		/ARGUMENT CONTINUATION
	JMP MCLJ		/PACK THE CHARACTER
MCLB	LAC BRKCTR
	SZA
	JMP MCLN
	INC RANUM		/UPDATE R/A NUMBER
	LAC L1
	JMS PAKRAM
	LAC RANUM
	JMP MCLN+1	/PACK R/A #
MCLC	JMS PRTMAC		/PRINT
	LAC MCLCTR
	TAD L1		/BYPASS READ ON IMBEDDED CALLS
	SMA
	.IFUND %MACI
	JMS DBLBUF	/GET NEXT SOURCE LINE
	.ENDC
	.IFDEF %MACI
	JMS RDSRC
	.ENDC
	JMS GETCHR
	SAD L12		/LINE FEED
	JMP MCLD
	JMP MCLD+1
MCLE	LAC BRKCTR	/CHAR ENCLOSED IN <>
	SNA		/YES
	JMP MCLP
	JMS TSTC15	/CR?
	SKP
	JMP MCLN
	JMS PAKRAM	/PACK AND GET NEXT LINE
	JMP MCLC
MCLP	JMS RSET57	/END OF ARGUMENTS INDICATOR
	LAC PACKT		/WAS THERE A TAG
	SNA		/ON THE CALL LINE?
	JMP MCLG		/NO
	ISZ MCLSW		/MACRO CALL SWITCH
	JMP PRTGPA	/MERGE SYMBOL INTO
MCLH	DZM MCLSW		/TABLE AND PRINT LINE
	JMP EXPMAC
MCLG	JMS PRTMAC		/PRINT
/*** MACRO EXPANSION ROUTINE **
/
EXPMAC	LAC MACLOC	/STARTING LOCATION OF DEFINTION
	JMS USET57	/INIT 5/7 UNPACKING
	JMS SAVRDX	/SAVE CURRENT RADIX
	SKP
/
/RETURN HERE AFTER ASSEMBLING A DEFINITION LINE
/
EXPMCR    JMS GETRST /RESTORE MACRO DEFINITION POSITION
/
EXPMD     LAC AD01		/RDBUF+2
	JMS P57INT
	SET EXPSW		/SET EXPANDING SWITCH
EXPMA	JMS GETCHR	/GET CHAR FROM DEFINITION
	SNA
	JMP EXPMA		/BYPASS NULL
	SAD L177		/CHECK FOR END OF DEFINITION
	JMP EXPMB
	DAC DATYPE
	TAD LAWM3		/D/A INDICATOR
	SPA
	JMP EXPMC		/YES
	JMS GETDEF	/PACK DEFINITION INTO RDBUF
	JMS TSTC15
	SKP
	JMP EXPMA		/GET NEXT MACRO CHARACTER
	JMS GETSAV	/SAVE MACRO DEFINITION POSITION
EXPMM	JMS UPBLB		/RESET TO RDBUF+2
	JMP SCNTAG	/SCAN TAG FIELD
EXPMB	LAC NOREST
	SZA
	JMP .+3		/DEFT. ENTERED IN TABLE DURING EXPANSION
	JMS GETRAL	/RESET FOR NEXT
	DAC ENDUMT	/DEFINITION OR R/A LIST
	LAC MCLCTR
	TAD (LAC CSNL1+1
	DAC EXPMJ
	LAC MCLCTR	/UPDATE BASE FOR CREATED SYMBOLS
	TAD (DAC CSNL1+1
	DAC EXPMK
EXPMJ	LAC 0		/CSNL1, CSNL2, CSNL3
	TAD CHVDA		/CURRENT HIGH VALUE OF D/A
	TAD L1
EXPMK	XX		/CSNL1, CSNL2, CSNL3
	JMS RSTRDX	/RESTORE PRE-EXPANSION RADIX
	JMP NXTLNE	/GET NEXT LINE
EXPMC	JMS GETCHR	/PICK UP D/A NUMBER
	DAC SAVDA1
	JMS TWOS
	DAC SAVDA		/SAVE D/A NUMBER
	JMS GETSAV	/SAVE MACRO DEF POSITON
	JMS GETRAL
	JMS USET57	/INIT UNPACKING
EXPMF	JMS GETCHR	/GET AN R/A CHARACTER
	SAD L177		/END OF LIST
	JMP EXPME		/YES
	SAD L1		/R/A INDICATOR
	SKP		/YES
	JMP EXPMF
	JMS GETCHR	/PICK UP R/A NUMBER
	TAD SAVDA		/COMPARE TO D/A/ NUMBER
	SZA!SMA
	JMP EXPME		/NO REAL ARGUMENT
	SZA		/EQUAL
	JMP EXPMF		/D/A > R/A - LOOK FURTHER
EXPMG     JMS GETCHR
          SAD L1
          JMP EXPME             /NO REAL ARGUMENT
          SAD L177
          JMP EXPME             /END OF R/A LIST
          JMS GETDEF	/PACK R/A CHARACTER
	ISZ RASUPL	/R/A SUPPLIED
	JMS TSTC15	/CHECK FOR A REAL ARGUMENT
	SKP
	JMP EXPMG
	LAC UPKAD
	DAC SVUPK		/SAVE 5/7 UNPACKING VALUES
	LAC PKNUM
	DAC SVPKNM
	SET RASW		/SET RETURN TO REAL ARGUMENT LIST
	JMP EXPMM		/ASSEMBLE THE LINE
/
/RETURN HERE TO CONTINUE GETTING INPUT FROM R/A LIST
/
RARET	LAC SVUPK
	DAC UPKAD
	LAC SVPKNM	/RESTORE UNPACKING VALUES
	DAC PKNUM
	LAC AD01		/RDBUF+2
	JMS P57INT
	DZM RASW		/RESET RETURN SWITCH
	JMP EXPMG
EXPME	LAC DATYPE	/CREATE SYMBOL
	SAD L2
	SKP		/YES
	JMP EXPMH		/NO
	LAC RASUPL	/WAS R/A SUPPLIED
	SZA		/NO - CREATE A SYMBOL
	JMP EXPMH		/YES
	LAC MCLCTR
	TAD (LAC CSNL1+1
	DAC .+1
	XX		/PICK UP BASE
	TAD SAVDA1		/DA NUMBER
	DAC CSBVAL	/CREATE SYMBOL VALUE
	LAC CHVDA
	TAD SAVDA		/CHECK IF CURRENT D/A NUMBER
	SMA		/IS GREATER THAN CHVDA
	JMP .+3
	LAC SAVDA1
	DAC CHVDA		/NEW HIGH VALUE OF D/A
	JMS BINDEC		/BINARY TO DECIMAL
	LAC CSBVAL		/VIA CSBVAL
	LAC L56		/.
	DAC DECOUT
	DAC DECOUT+1
	LAC AD40		/DECOUT-1
	DAC* L10
	LAW -6
	DAC CTR
EXPML	LAC* 10
	SAD L40		/CHANGE SPACE TO ZERO
	LAC L60
	DAC CHRHLD
	JMS GETDEF		/PACK THE CREATED SYMBOL
	ISZ CTR
	JMP EXPML
EXPMH	JMS GETRST		/RESTORE DEFINITION POSITION
	DZM RASUPL		/R/A SUPPLIED
	JMP EXPMA
/*** .DEFIN ***
/MACRO DEFINITION PROCESSOR.
/THE .DEFIN PSEUDO-OP PACKS A MACRO DEFINITION INTO LOW CORE.
/THE DUMMY ARGUMENTS ARE STORED JUST BELOW THE USERS
/SYMBOL TABLE. THE POINTERS AND COUNTERS IN THE
/-SRCUST- AND -MERGE- SUBROUTINES ARE SAVED SO THESE
/ROUTINES CAN BE USED DURING DEFINITION TIME WITHOUT
/SCREWING UP.
/
DEFERR	JMS ERRORS
.DEFIN	JMS ARGMNT		/PICK UP MACRO NAME
	JMP PRPOP		/NO NAME
	JMP DEFERR		/SYMBOLIC LOOKUP
	CLC		/INITIALIZE THE .DEFIN COUNT. IF THIS COUNT GOES
	DAC DFNCTR	/BELOW -3 AT EXPANSION TIME ITS TERMINAL
	JMS USTLKP	/LOOK UP IN USER TABLE
	SKP		/FOUND
	JMP DFNA		/NOT FOUND
	JMS CKMAC		/IS ENTRY A MACRO
	SKP		/NO
	JMP DFNB		/YES
	LAC* TMP		/IS IT A VARIABLE
	SMA		/YES
	JMP DFNC
	JMS SUB1		/SUBTRACT 1 FROM VARIABLE COUNT
	DAC VARCTR	/ARGUMENT(SUB1)
	JMP DFNB
DFNC	JMS TSTUND	/UNDEFINED?
	SPA		/RETURN HERE IF DEFINED, IS IT LOCAL?
	JMP DFNB		/		
	JMS SUB1		/CHANGE EXTERNAL COUNT
	DAC EXTCTR	/ARGUMENT(SUB1)
	JMP DFNB
DFNA	XCT PASSNO
	JMP DFNJ
	JMS ERRORP	/P TO FLAG WORD
DFNJ	JMS MERGE	/MERGE MACRO NAME INTO S/T
	LAC* L11		/POINTER OF WD3 OF THIS ENTRY IN S/T.
	DAC TMP		/SET MACRO NAME BIT, AND POINTER TO DEFINITION.
DFNB	LAC ENDUMT		/STARTING LOCATION OF MACRO
	DAC BEGDEF	/FOR 12K SYSTEMS.
	JMS P57INT
	XOR JMSLIT	/MACRO BIT
	XCT PASSNO
	SKP
	XOR XCTLIT	/SET DEFINITION ENCOUNTERED
	DAC* TMP		/IS PASS 2
/THE MACRO NAME HAS BEEN STORED IN THE USERS SYMBOL TABLE.
/PREPARE THE COUNTERS AND POINTERS FOR STORING DUMMY
/ARGUMENTS.
/
	SET DFNSW		/MACRO DEFINITION SWITCH.
	LAC USTEND
	DAC TT3
	LAC USTSZE
	DAC TT1		/SAVE NUMBER OF USER SYMBOLS.
	LAC BEGUST
	DAC TT2		/BEGINNING OF USER TABLE
	DAC USTEND	/END OF USER TABLE
	.IFUND %MACI
	.IFUND %PDP9
	LAC EXPAGE
	DAC LL13		/EXTRA-PAGE-IN SWITCH.
	XCT EXPAGE	/PAGE IN?
	JMP PAGDUM
	.ENDC
	.ENDC
DUMBAK	DZM USTSZE	/DUMMY ARGUMENT COUNT.
	SKP
DFNFER	JMS	ERRORS
DFNF	JMS ARGMNT		/SCAN FOR D/A NAME
	JMP DFNK		/NO D/A'S
	JMP DFNFER		/SYMBOLIC NAMES
/A DUMMY ARGUMENT EXISTS AND IS LIVING IN PACKS AND PACKS+1.
/IF ITS ALREADY IN THE DUMMY ARGUMENT TABLE, IGNORE IT.
/IF NOT, MERGE IT IN.
/
	LAC USTSZE	/D/A NUMBER
	TAD CSBSW		/TURN ON BIT 0 IF CREATE
	DZM CSBSW		/SYMBOL SWITCH IS ON
	DAC SQZOUT+2
	JMS LUKDUM	/LOOK UP IN DUMMY TABLE.
	SKP		/FOUND, IGNORE IT.
	JMS MERGE		/NOT FOUND, MERGE IT IN.
DFNK	JMS PUTSAV	/SAVE 5/7 POINTERS
	JMS TKOM		/ANY MORE DUMMIES?
	JMP DFNF		/YES...CONTINUE.
/CONTROL COMES TO PKMDJ AFTER A LINE IS READ IN
/AT NXTLNE AND THE SWITCHES ARE CLEARED AT SCNTAG.
/PACK MACRO DEFINITION INTO TABLE
/
PKMCDF	JMS PUTRST
	SET NDIL		/NO DATA IN LINE IND
PKMDJ	JMS CLEARS	/VARIABLE SWITCH
	LAC AD08
	JMS P6INT		/INITIALIZE SIXBIT PACK
	JMS GETCHR	/GET NEXT DEFINITION CHAR
	JMS LEGAL
	SKP
	JMP PKMDA
	SAD L57		/SLASH
	SKP
	JMP PKMDB
	LAC NDIL		/COMMENT
	SNA		/YES
	JMP PKMDB		/NO
	LAC L15
	DAC CHRHLD	/CHANGE / TO CR
	JMP PKMDB
PKMDA	JMS SIXP		/6 CHARS PACKED? IF NO, PACK IT.
PKMDC	JMS GETCHR	/GET NEXT CHARACTER
	JMS LEGAL		/VALID SYMBOL CHAR?
	SKP		/NO
	JMP PKMDA		/YES
	JMS CHRLKP	/SPACE,TAB,;,CR
	007765		/+,-,/,*,&,!,OR\
	JMP PKMDD		/YES
	SAD EQSIGN		/=
	JMP PKMDD
	SAD KOMMA		/,
	JMP PKMDD
	SAD VARAB		/#
	SKP
	JMP PKMDD	/UNRECOGNIZABLE CHAR ,DELIMIT THE STRING.
	ISZ VARSW		/SET VARIABLE INDICATOR
	JMP PKMDC
PKMDD	JMS SEARCH	/SEARCH FOR .DEFIN,
	LAC MOPEND		/.ENDM OR .ETC
	LAC MOPBEG
	LAC AD08		/PACKS
	2
	SKP		/FOUND
	JMP PKMDG
	JMS WRD3
	XCT* MRGLOC	/SWITCH TO APPROPRIATE ROUTINE
/
/.DEFIN WITHIN A .DEFIN
/
NSTDFN	JMS SUB1
	DAC DFNCTR	/ADD -1 TO COUNTER
/
NSTDA	LAC AD08		/PACKS
	JMS UP6INT
	LAC CHRNUM
	JMS TWOS
	DAC CTR
PKMDE	JMS UNPACK	/UNPACK 6-BIT CHAR
	TAD LM33		/A-Z
	SPA!CLA		/YES
	LAC L100
	XOR UPKCHR
	JMS PAKRAM	/PACK INTO MACRO DEFINITION TABLE
	ISZ CTR
	JMP PKMDE
PKMDK	LAC VARSW		/VARIABLE ENCOUNTERED
	SNA		/YES
	JMP PKMDB
	DZM VARSW
	LAC VARAB		/#
	JMS PAKRAM
PKMDB	LAC CHRHLD	/PACK CURRENT CHARACTER
	JMS PAKRAM
	JMS TSTC15
	JMP PKMDH
	SAD L73		/;
	JMP PKMCDF+1
	JMS CKSPTB	/SPACE OR TAB
	JMP PKMCDF+1	/YES
	JMP PKMDJ
PKMDH	JMS PRTMAC		/PRINT
	JMP NXTLNE	/GET NEXT SOURCE LINE
/
/CHECK IF PACKED SYMBOL IS A DUMMY ARGUMENT
/
/THE PACKED SYMBOL IS NOT A PSEUDO-OP OF THE MACRO VARIETY
/IF ITS A DUMMY ARGUMENT, PACK ITS POSITION NUMBER (0,1,2
/..ETC.). IF ITS NOT, PACK THE ARGUMENT ITSELF.
/
PKMDG	JMS LUKDUM	/DUMMY?
	SKP		/YES.
	JMP NSTDA		/NO, PACK THE SYMBOL.
	JMS WRD3		/POINT TO WORD 3 TO GET THE
	LAC* MRGLOC	/SUMMY ARGUMENT NUMBER.
	SPA!CLA
	LAC L1
	TAD L1
	JMS PAKRAM
	LAC* MRGLOC
	JMS PAKRAM
	JMP PKMDK
/
/PUT THE SYMBOL IN SQZOUT AND SQZOUT+1, THEN SEARCH
/THE DUMMY TABLE.
/
LUKDUM	0
	LAC PACKS
	DAC SQZOUT
	LAC PACKS+1
	DAC SQZOUT+1
	LAC L2		/SEARCH AND COMPARE 18 BITS.
	JMS SRCUST
	JMP* LUKDUM	/FOUND
	INC LUKDUM
	JMP* LUKDUM	/NOT FOUND.
/
/*** .ENDM ***
/
.ENDM	ISZ DFNCTR	/IS .ENDM ASSOCIATED WITH
	JMP NSTDA		/HIGHEST LEVEL - NO
	DZM DFNSW		/YES
	JMS RSET57
	LAC TT3
	DAC USTEND	/RESET TOP OF BOTTOM SECTION OF UST.
	LAC TT2
	DAC BEGUST	/RESET BOTTOM OF U/S TABLE.
	LAC TT1
	DAC USTSZE	/RESET U/S COUNT.
	.IFUND %MACI
	.IFUND %PDP9
	LAC LL13
	DAC EXPAGE
	XCT EXPAGE
	JMP PAGRES
	.ENDC
	.ENDC
.ENDMA	LAC EXPSW
	SZA
	ISZ NOREST
	JMP PRPOP
/
/*** .ETC ***
/
.ETC	LAC DFNCTR	/IS .ETC ASSOCIATED
	TAD L1		/WITH HIGHEST LEVEL .DEFIN
	SZA		/YES
	JMP NSTDA
	LAC ENDUMT
	JMS P57INT
	JMP DFNF		/SCAN FOR MORE D/A'S
/
/
/PACK THE END INDICATOR AND RESET POINTER
/
RSET57	0
	LAC L177		/END OF ARG INDICATOR.
	JMS PAKRAM
	LAC CTR57
	SZA
	INC PK57AD
	LAC PK57AD
	DAC ENDUMT
	JMP* RSET57
/
/
/REAL ARGUMENT AND MACRO
/DEFINITION PACKING ROUTINE
/
PAKRAM	0
	DAC GETDEF
	LAC PK57AD	/TEST FOR OVERFLOW
	TAD L1
	SAD BEGUST
	JMP STOVA		/TYPE OUT OVERFLOW
	.IFUND %MACI
	.IFUND %PDP9
	XCT EXPAGE
	JMP PAKPAG
	.ENDC
	.ENDC
PKPGA	LAC GETDEF
	JMS PACK57	/5/7 PACKING
	JMP* PAKRAM
/
/ROUTINE TO GET CHARACTERS FROM MACRO
/DEFINITION IN SYMBOL TABLE AND PACK
/INTO SOURCE INPUT AREA
/
GETDEF	0
	LAC PK57AD
	SAD AD39		/RDLST
	JMP .+4		/LINE OVERFLOW
	LAC CHRHLD
	JMS PACK57
	JMP* GETDEF
	JMS ERRORW	/W TO FLAG WORD
	JMP* GETDEF
BEGRL3	0		/R/A ADDRESS FOR LEVEL 3
BEGRL2	0		/R/A ADDRESS FOR LEVEL 2
BEGRL1	0		/R/A ADDRESS FOR LEVEL 1
CSNL3	0		/CREATE SYMBOL BASE -L3
CSNL2	0		/CSB -L2
CSNL1	0		/CSB -L1
SVUPK3	0		/UNPACKING SAVE -L3
SVUPK2	0		/LEVEL 2
SVUPK1	0		/LEVEL 1
SVPKN3	0
SVPKN2	0
SVPKN1	0
RDXSV3	0		/RADIX SAVE -L3
RDXSV2	0		/RADIX SAVE -L2
RDXSV1	0		/RADIX SAVE -L1
	.TITLE COMMAND STRING PROCESSOR.
	.IFUND %MACI
/SOME I/O ROUTINES.
/
/
WAIT13	0
	CAL+765		/WAIT FOR BINARIES TO STOP.
	12
	JMP* WAIT13	/EXIT
/THE CODE AT PASS1P IS EXECUTED ONLY WHEN A ^P IS TYPED.
/THE TELETYPE IS CLOSED WITH A CR,LF AND THE CTLP REGISTER
/IS CHECKED TO DETERMINE WHETHER OR NOT THE ^P WAS
/EXPECTED. IF IT WAS, CONTROL STARTS AT THE LOCATION STOED
/IN CTLP. IF IT WAS UNEXPECTED THE MACRO PROGRAM IS
/RESTARTED. AFTER THE BANK BITS ARE INITIALIZED,
/CONTROL GOES TO PASS1.
/
PASS1P	CAL+775
	6
	LAC CTLP
	SZA
	JMP* CTLP
/
PASS1	CAL+1775		/.INIT TTY OUTPUT
	1
MOD1	PASS1P		/RETURN TO PROCESSOR
POWA=.
CTLP	NOP
/
	DZM CTLP		/CONTROL P TO PASS1
/
/TYPE MACRO-15
/
CMDSTP	CAL+2775		/.WRITE ON TTY
	11
MOD2	M9MSG		/MACRO
BINEXT	.SIXBT /BIN/
/
L2775	CAL+2775		/TYPE >
	11
MOD1B	LF-1
SRCEXT	.SIXBT /SRC/
/
	.ENDC
	.IFDEF %MACI
SRCEXT	.SIXBT 'SRC'
BINEXT	.SIXBT 'BIN'
PASS1P	JMS INITIO
	LAC TOP
	JMS ZEROIT
	START-LSWCH
	JMS TTYOUT
	M9MSG
	JMS TTYOUT
	LF-1
	SET MSWCH
RSTRT=PASS1P
PASS1=PASS1P
CMDSTP=PASS1P
BEGIN=START
	JMS UPBLB	/INIT 5/7 UNPACK TO RDBUF+2
	JMS TTYIN	/READ IN COMMAND STRING.
	.ENDC
	.IFUND %MACI
	JMS UPBLB
/
/
/
/*****COMMAND STRING PROCESSOR*****
/
/
L2776	CAL+2776		/.READ KEYBOARD
	10
MOD1A	RDBUF
LM33	-33
	CAL+776
	12
	.ENDC
	LAW -11
	DAC SIXP+1	/USE MAXIMUM COUNTER ROUTINE.
	.IFUND %MACI
	LAC TOP		/POINTER TO TOP OF MACR0-15.
	JMS ZEROIT	/CLEAR OUT ALL THE OPTIONS AND
	START-LSWCH	/THE NAME OF THE INPUT FILE.
	.ENDC
	CLC
	DAC NOIN2		/NO ALTERNATE INPUT
CMDA	JMS GETCHR		/GET A CHARACTER
	SAD L137			/LEFT ARROW
	JMP CMDC			/GET FILE NAME
/
/OPTIONS:A,B,C,G,L,N,O,P,S,V,X,G
/AN ALTMODE OR CR BEFORE THE _ IS ILLEGAL.
/
	SAD L15			/CR
	JMP CMDE			/ERROR
	SAD L175			/ALT MODE
	JMP CMDE			/ERROR
	SAD L101			/A?
	SET ASWCH
	SAD L102			/B
	SET BNOPTN
	.IFDEF %MACI
	SAD L124			/T?
	SET TSWCH
	SAD L104	/D?
	SKP
	JMP .+3
	SET DSWCH
	JMP CSPL+1
	SAD L125			/U?
	SET DTSAMS
	.ENDC
	SAD L103			/C?
	SKP
	JMP CSPG
	SET CSWCH
	JMP CSPL+1
CSPG	SAD L107		/G?
	SKP
	JMP CSPN
	SET GSWCH
	JMP CSPL+1
CSPN	SAD L116
	JMP CSPNST
	SAD L120		/P?
	DZM NOIN2
	SAD L123			/S?
	SKP
	JMP .+3
	SET ASWCH
	SET VSWCH
	SAD L126			/V?
	SET VSWCH
	SAD L130			/X?
	SKP			/G?
	JMP CSPL
	SET XSWCH
CSPNST	SET NSWCH
	JMP CSPL+1
CSPL	SAD L114	/	oL?
	SET ALOPTN
	JMP CMDA		/IGNORE ANYTHING ELSE
/
/
/THE TEXT TYPED AFTER THE LEFT ARROW REPRESENTS THE PROGRAM NAME,
/PROGRAM EXTENSION NAME , AND PAGE HEADER TEXT. LEADING SPACES
/AFTER THE LEFT ARROW ARE IGNORED. ALL SUBSEQUENT SPACES ARE CRUCIAL
/IN THE WAY THEY EFFECT THE INPUT PROGRAM NAME.THE FIRST SPACE
/AFTER AT LEAST ONE NAME CHAR TELL THE COMMAND STRING PROCESSOR THAT
/THE PROPER NAME HAS BEEN DELIMITED AND THAT THE EXTENSION NAME
/FOLLOWS. ANOTHER SPACE DELIMTS THE PROGRAM NAME ALTOGETHER,WITH
/THE INPUT TEXT STORED FOR PAGE HEADERS. CHARS AFTER THE 
/40 TH  CCHAR ARE IGNORED.
/
CMDC	LAW -40		/MAX OF 40 DECIMAL CHARACTERS.
	DAC FLDSW
	LAC ADPNAM
	JMS P57INT
	LAW -26
	JMS SPACKS
	LAC ADPNAM
	JMS P57INT
	LAC AD02		/FILE, +1, +2
	JMS P6INT
	JMS IGNORE	/IGNORE LEADING BLANKS
	DZM PRVCHR	/PSEUDO COUNTER FOR SPACES.
	SKP
CMDSUB	JMS GETCMD	/GET A CHAR AND RETURN IF NOT DELIMITED.
	SAD L40
	JMP CMD40
	JMS SIXP	/DONT PACK AFTER 9 CHARS ARE IN.
CMD57	ISZ FLDSW
	SKP
	JMP CSPDUN
	LAC CHRHLD
CMDPAK	JMS PACK57
	JMP CMDSUB
CSPDUN	JMS GETCMD	/BYPASS SUBSEQUENT CHARS.
	JMP .-1
CMD40	SAD PRVCHR
	JMP CMD240
	DAC PRVCHR
	LAC AD02		/SET ADDRESS FOR EXTENSION.
	TAD L2
	JMS P6INT
	LAW -3
	DAC SIXP+1
	JMP CMD57
CMD240	DAC CHRNUM
	JMP CMD57	/FORCE .GT. 9 SITUATION.
GETCMD	0
	JMS GETCHR
	SAD L15
	JMP CMD15
	SAD L175
	JMP CMD175
	JMP* GETCMD
CMD175=.
	.IFDEF %MACI
	JMS TTCLOS
	.ENDC
	.IFUND %MACI
	CAL+775
	6
	.ENDC
/**********
	SKP!CLA
CMD15	CLC
	DAC BATCH
	.IFDEF %MACI
	DZM MSWCH
	LAC DSWCH
	SZA
	DZM BNOPTN
	.ENDC
	LAC FILE
	SNA
	JMP CMDE
/IF AN OPTION WAS SPECIFIED WHICH REQUIRES PRINTING SET THE LSTSW.
/
	LAW -6	/RESET MAXIMUM COUNTER ROUTINE.
	DAC SIXP+1
	LAC (064000	/INSERT A CR.
	DAC TEXTT
	LAC ALOPTN
	DAC LSWCH			/FOR .LST, .NOLST PSEUDO-OPS.
	LAC FILE+2	/IF NO EXTENSION WAS INPUT INSERT
	SNA		/THE 'SRC' EXTENSION
	LAC SRCEXT
	DAC IFEXT
	JMP PASS1A		/START ASSEMBLING
	.IFDEF %MACI
CMDE	JMS TTYOUT
	ERMSG
	JMP CMDSTP
	.ENDC
	.IFUND %MACI
/**********
CMDE	CAL+2775		/TYPE  
	11
MOD3	ERMSG
	.ENDC
LSTEXT=.
ERMSG	.SIXBT	/LST/
/**********
M9MSG	JMP CMDSTP		/GET NEW COMMAND STRING
	374320		/QUESTION MARK <15>
	.IFUND	BF
	.IFUND %MAC9I
	.IFUND %MACI
	.IFDEF %DIMAC
ID	.ASCII 'MACRO/D-15 V1A'<15>
	.ENDC
	.IFUND %DIMAC
ID	.ASCII	/MACRO-15 V1A/<15><15><15>
	.ENDC
	.ENDC
	.IFDEF %PDP9
	.IFUND %MAC9I
ID	.ASCII 'MACRO-9 V6A'<15><15>
	.ENDC
	.ENDC
	.ENDC
	.IFDEF %MACI
	.IFUND %MAC9I
ID	.ASCII 'MACRO/I-15 V1A'
	.ENDC
	.ENDC
	.ENDC
	.ENDC
	.IFDEF	BF
ID	.ASCII	'MACRO-9 BF6A'<15>
	.ENDC
	.IFDEF %MAC9I		/LF CR
ID	.ASCII 'MACRO/I-9 V6A'<15>
	.ENDC
	.ENDC
LF	050320
	373720		/> ALT MODE
/
/INITIALIZE LOCATIONS FOR PASS 1
/
PASS1A	LAC NOPLIT	/SET PASS 1
	DAC PASSNO
	LAC AD41		/BPIT-1
	JMS ZEROIT	/ZERO SWITCHES
	BP1T-EP1T
	LAC ADBEG	/START-1(OVERLAY EXTRA PAGE CODE IF NO XPAGE)
	DAC USTEND
	DAC BEGUST
	.IFUND %MACI
	.IFUND %PDP9	
	XCT EXPAGE	/EXTRA PAGE IN?
	JMP PAGIN		/YES..INIT******.
	.ENDC
PG001	DZM MOD3A+1	/TO DETERMINE WHAT THE LISTING DEVICE IS
	.ENDC
	.IFUND %MACI
	CAL+1766		/.INITD LISTING DEVICE
	1
MOD3A	PASS1P
	NOP
	.ENDC
/**********
/
	LAC LSTEXT	/LST
	DAC FILE+2
	.IFDEF %MACI
	LAC DSWCH
	SNA
	JMP READ1
	JMS DENTER
	.ENDC
	.IFUND %MACI
/**********
/
L766	CAL+766		/.ENTER LISTING DEVICE
	4
MOD4	FILE
/**********
/
	.ENDC
	JMP READ1
/
/ENTER HERE FOR PASS 2
/
PASS2=.
	.IFUND %MACI
	DZM CTLP		/SET CONTRL P TO PASS 1
	.ENDC
	LAW -1		/FORCE AN EJECT NEXT TIME
	DAC LNCTR		/THE PRINTING ROUTINE IS CALLED.
	LAC SKPLIT
	DAC PASSNO	/SET PASS 2 SWITCH
	LAC BNOPTN	/BINARY REQUESTED
	SNA		/YES
	JMP READ1		/NO
	.IFUND %MACI
/**********
/
	CAL+1765		/.INIT BINARY OUTPUT DEVICE
	1
MOD4A	PASS1P
BBFSIZ	0
/**********
	LAW -377
	TAD BBFSIZ
	DAC BBFSIZ
	.ENDC
	LAC BMODE
	SZA!CLL
	CML
	LAC ABXEXT
	SNL
	LAC BINEXT	/BINARY
	DAC FILE+2
	.IFUND %MACI
/**********
/
	CAL+765		/.ENTER BINARY OUTPUT DEVICE
	4
MOD5	FILE
	.ENDC
	.IFDEF %MACI
	JMS DENTER
	.ENDC
/**********
/
	DZM LLBCDE
	LAC L1
	DAC LLWDCT
	DZM BNADDR	/BINARY OUTPUT ADDRESS
	DZM BNWDCT	/BINARY OUTPUT WORD COUNT
	DZM BNCKSM	/BINARY OUTPUT CHECKSUM
READ1=.
	.IFUND %MACI
	LAC* L102		/END OF USER MACRO TABLE
	.ENDC
	.IFDEF %MACI
	LAC ENDIMB
	.ENDC
	DAC ENDUMT
	DZM CSNL1		/CREATE SYMBOL - LEVEL 1
	LAC (7640		/4000 (10)
	DAC CSNL2		/CREATE SYMBOL - LEVEL 2
	LAC (15530	/7000 (10)
	DAC CSNL3		/CREATE SYMBOL - LEVEL 3
	CLC
	DAC SYMTYP	/SYMBOL TYPE -=REL,+=ABS
	DAC FSTLNE	/FIRST LINE SWITCH
	LAC AD42		/BP12T-1
	JMS ZEROIT	/ZERO OUT SWITCHES
	BP12T-EP12T
	LAC NOIN2		/SECONDARY INPUT REQUESTED
	SPA		/YES
	JMP READ1A	/NO
	.IFUND %MACI
/**********
L770	CAL+770		/INIT SECONDARY INPUT DEVICE
	1
MOD5B	PASS1P
	NOP
	CAL+770		/SEEK .PARAM
	3
	.ENDC
	.IFDEF %MACI
	LAC TSWCH
	SZA
	JMP NXTLNE
	JMS DSEEK
	LAC (PARASS
	.ENDC
	.IFUND %MACI
MODPAR	PARASS
/**********
	JMP NEWTP1
/**********
READ1A	CAL+767		/INIT SOURCE INPUT DEVICE
	1
MOD5A	PASS1P
POWB	NOP
/**********
	LAC IFEXT		/SRC
	DAC FILE+2	
/**********
	CAL+767		/SEEK SOURCE INPUT
	3
MOD6	FILE
/**********
	.ENDC
	.IFDEF %MACI
READ1A	LAC IFEXT
	DAC FILE+2
	JMS DSEEK
	LAC LFILE	/(FILE
	.ENDC
	JMP NEWTP1
PARASS	.SIXBT '.PARAMSRC'
	.IFUND %MACI
/
/ENTER HERE FOR NEW TAPES
/
NEWTAP	LAC NOIN2		/WAS PREVIOUS TAPE SECONDARY INPUT
	SPA!CLC		/YES
	JMP READ1A	/NO
	DAC NOIN2
	DZM EOTSW		/ONLY NEEDED FOR BULK STORAGE
/**********
	CAL+770		/CLOSE SECONDARY
	6
/**********
	JMP READ1A	/GET PRIMARY INPUT
NEWTP1	DZM CTLP		/SET ^P TO PASS 1
	JMS RDSRC
	.ENDC
/
/READ SUBSEQUENT LINES
/
NXTLNE	DZM STOPPER	/CLEAR C/R
	LAC RASW		/IN MIDDLE OF R/A LAST
	SZA
	JMP RARET		/RETURN TO EXPANSION
	LAC EXPSW		/IS A MACRO BEING EXPANDED
	SZA		/NO
	JMP EXPMCR	/RETURN TO EXPANDING ROUTINE
	DZM NOREST
	.IFUND %MACI
	JMS DBLBUF	/GET NEXT SOURCE LINE
	.ENDC
	.IFDEF %MACI
	JMS RDSRC
NEWTP1=NXTLNE
	.ENDC
	JMS PRTINT
	.TITLE LOGICAL LINE PROCESSOR.
/******SCNTAG*****
/ROUTINE TO PROCESS A LOGICAL LINE (ONE THAT MAY END
/WITH ; AS WELL AS CR).  THE BEGINNING OF THE ROUTINE
/SETS UP OR CLEARS SWITCHES FOR THE SYMCHR AND LEGAL
/SUBROUTINES.  AFTER THE SET-UP AND THE SYMCHR
/CALL THE ROUTINE WILL DO SOME EXTENSIVE ERROR
/CHECKING ON THE TAG (IF ONE IS IN).
/
/
SCNTAG	LAC	AD43
	JMS	ZEROIT		/CLEAR LINE SWITCHES
	BST-EST
	SET	NDIL		/NO DATA IN LINE SWITCH.
	LAC	DFNSW		/IF THIS IS WITHIN A MACRO DEFINITION
	SZA
	JMP	PKMCDF		/AREA, RETURN TO MACRO DEFIN ROUTINE.
	JMS	CLEARS		/CLEAR SYMBOL SWITCHES
TAGCKA	JMS	SYMCHR
/
/
/CONTROL COMES BACK FROM SYMCHR WHEN AN ILLEGAL
/OR DELIMITING CHARACTER IS ENCOUNTERED IN THE CHAR
/STRING.  THE CURRENT CHAR IN CHRHLD IS THE ONE THAT
/CAUSED THE TAG STRING TO BE DELIMITED.
/IF THE LEGAL COUNT LCOUNT IS NON-ZERO, AT LEAST ONE
/CHARACTER APPEARS AS A TAG, IF A TAG IS STORED MAKE
/SURE THE FIRST CHAR IS NON-NUMERIC.
/
/
	LAC	PACKS		/STORE THE TAG BUILT UP IN
	DAC	PACKT		/PACKS IN PACKT.
	LAC	PACKS+1
	DAC	PACKT+1
	LAC	LCOUNT		/LEGAL CHARACTER COUNT
	SNA			/YES
	JMP	TAGCKB		/NO LEGAL CHARACTERS.
	LAC	VARSW		/IF # WAS ENCOUNTERED, ERROR
	TAD	CHAR1		/MAKE SURE THE FIRST CHAR IS ALPHA.
	SZA			/0 IF ALPHA, NON 0 IF NUMERIC
	JMP	TAGERR		/TAG ERROR
	JMP	TAGCKC
/
/
/IF THERE IS NO TAG SYMBOL, CHECK THE FIRST CHARACTER FOR
/BEING A SLASH OR CR.  IF THIS IS THE CASE TREAT THE LINE
/AS A COMMENT.
/
/
TAGCKB	JMS TSTC15	/CR?
	JMP TAGCOM
	SAD	L57		/SLASH
	JMP	TAGCOM
/
/
/CHECK CHRHLD FOR A VALID SYMBOL DELIMETER
/
/
TAGCKC	JMS CKSPTB		/SPACE OR TAB?
	JMP SCNOP		/YES.. SCAN FOR OP SYMBOL.
	SAD EQSIGN
	JMP TAGCKE
	JMS CKSCR
	JMP ENDLNE
/THE CHARACTER IN CHRHLD IS UNRECOGNIZABLE.  IF SIX
/CHARACTERS HAVE ALREADY BEEN PROCESSED KEEP THE
/TAG SYMBOL AND PRINT THE ERROR MESSAGE.
/
	LAW -6
	TAD CHRNUM
	SMA
	JMP TAGCKD
TAGERR	DZM PACKT
	DZM PACKT+1
TAGCKD	JMS ERRORT		/KEEP PROCESS TAG CHARS UNTIL A
	JMS CHR6		/SYMBOL DELIMITER IS FOUND, BUT
	JMS CKSCR
	JMP ENDLNE
	JMP TAGCKA		/DO NOT STORE ANYTHING.
 
/AN = SIGN HAS BEEN ENCOUNTERED WHICH DELIMITED THE
/TAG PROCESSING.  IF NO CHARACTERS WERE STORED IN
/PACKT ITS AN ERROR, AND WILL BE PICKED UP AT PRTGPA.
/
TAGCKE	SET PASW		/SET PARAM SWITCH
	JMP SCNOP
/A SLASH OR A CR WAS THE FIRST CHAR OF THIS
/LOGICAL LINE. IF THE MULTI WORD STOPPER IS ON
/GET THE NEXT LINE
/
TAGCOM	LAC STOPPER
	SNA
	JMS PRTCOM		/PRINT IF PASS2
	JMP NXTLNE
/
/
/
/CONTINUE PROCESSING A LINE.
/CONTROL GOES TO SCNOP WHEN A TAG IS DELIMITED, CONTROL
/GOES TO SCNADR WHEN THE OPERATION FIELD IS DELIMITED.
/THE FIELD SWITCH FLDSW IS 0 IF PROCESSING AND OPERATION
/SYMBOL AND NON 0 FOR AN OPERAND.  IN EITHER CASE, THE
/LINE IS SCANNED UNTIL A SYMBOL IS DELIMITED, IF THE
/DELIMITER IS LEGAL THE SYMBOL IS EVALUATED BY EITHER
/SEARCHING THROUGH TABLES OR (IF NUMERIC) CONVERTING
/THE ASCII STRING TO NUMBERS.
/
/
/
SCNADR	SET	FLDSW		/ADDRESS FIELD.
	SKP
SCNOP	DZM	FLDSW		/OPERATION FIELD
	DZM	OPRTR		/CLEAR PREVIOUS OPERATION.
	LAC	ENDSW		/DON'T CLEAR FLDVAL IS THE LAST
	SNA			/SYMBOL WAS THE END STATEMENT.
	DZM	FLDVAL		/NO IT WASN'T.
	DZM	LKAHED		/CHARACTER IN OR OUT SWITCH
FLDCHR	JMS	IGNORE
	SAD	L11		/AS A .DSA PSEUOD-OP
	JMP	.DSA
MORSYM	JMS	CLEARS		/NEITHER.. PROCESS THE STRING
	JMS	SYMCHR
 
/CONTROL RETURNS HERE WHEN THE CHARACTER STRING, USED TO
/BUILD A SYMBOL IS DELIMITED.  IF PACKS IS 0 NO SYMBOL
/EXISTS.  IF THIS IS THE CASE CHECK ALL THE VALID DELIMITERS
/AND SPECIAL CHARACTERS, IF NONE OF THESE ARE SATISFIED
/FLAG THE LINE.
	LAC	LCOUNT		/IF NO LEGAL CHARACTERS WERE
	SZA			/PROCESSED AND THE LOOK AHEAD
	JMP	SYMIN		/SWITCH IS ON, THE LINE IS
	LAC	LKAHED		/QUESTIONABLE (E.G. LAC**B)
	SZA
	JMS	ERRORQ
	JMS	CHRLKP		/CHECK FOR / ; OR CR, IF YES THERE
	27775			/IS NO NEW ITEM TO EVALUATE, BUT THERE
	JMP	ENDLNE		/MAY HAVE BEEN BEFORE ON THIS LINE
	SAD	LPAREN		/IF ITS NOT A LITERAL, CHECK TO SEE IF
	JMP	LTERAL		/ITS A UNARY SIGN + OR -.
	JMS	CHRLKP
	57776
	JMP	NOTIN		/CHAR IS + OR -.
	JMP	SYMERR		/UNIDENTIFIABLE.....SYMBOL ERROR.
/
/
/CONTROL ONLY COMES TO NXOPAD IN THE EVENT THAT A LEGAL
/CHARACTER IS TERMINATED BY AN OPERATOR  (+ - * ETC)
/WHICH IS NOT FOLLOWED BY A SPACE OR A TAB.  THE FIELD
/SWITCH IS NOT CHANGED AND THE 'OPRTR' VALUE IS STORED
/WITH THE OP TO PERFORM THE NEXT TIME A SYMBOL IS DELIMITED.
/
/
NXOPAD	LAC BYPASS		/CHECK IF CHAR IN FROM INDIRECT
	SZA
	JMP OPASTR		/IS ON.
NOTIN	LAC CHRHLD
	DZM BYPASS	/CLEAR NEXT CHAR SWITCH.
OPASTR	DAC OPRTR	/OPERATOR IN BYPASS OR CHRHLD.
	SET LKAHED		/WHEN CONTROL RETURNS FROM SYMCHAR, IF
	JMP	MORSYM		/NO LEGAL SYMBOLS - ERROR
 
/THE CURRENT CHARACTER IS LEFT PAREN.  IF MORE THAN
/ONE HAS BEEN ENCOUNTERED FLAG THE LINE WITH AN L.
/SAVE THE OPERATION VALUE AND TURN ON THE OP SAVE
/SWITCH.  THE OPVALUE WAS SET TO 0 BEFORE THE TAG
/WAS SCANNED.
 
LTERAL	JMS	CKERL		/FLAG IF MORE THAN ONE (.
	SET	LITSW		/TURN ON LITERAL SWITCH.
	SET	OPSVSW		/OPERATION VALUE SAVED.
	LAC	OPVAL		/IF THIS IS A NESTED LITERAL
	DZM	OPVAL		/THE OLD VALUES ARE CLOBBERED.
	DAC OPSAV
	LAC FLDSW	/IS THIS A LITERAL IN THE OP FIELD.
	SNA		/NO
	SET NULOPF	/YES.. SET FOR 15-BIT RELOC.
	DZM	FLDSW		/ASSUME NEXT FIELD IS OP FIELD
	DZM	FLDVAL
	DZM	NCD		/NOT COMPLETELY DEFINED.
	JMS	GETCHR		/IF THE NEXT CHARACTER IS A
	SET	BYPASS		/SPACE OR A TAB SET THE
	JMS	CKSPTB		/FIELD SWITCH
	SKP	
	JMP	MORSYM
	DZM	BYPASS
	SET	FLDSW
	JMP	FLDCHR
 
 
/A SYMBOL OF SOME SORT IS IN PACKS.  IF THE FIRST
/CHARACTER WAS NUMERIC THEY ALL HAVE TO BE NUMERIC.
/
/
/
/
 
SYMIN	DZM	LKAHED		/OK TO TURN OFF, LEGAL CHAR IS IN.
	JMS	CHRLKP		/MAKE SURE THE SYMBOL
	7765			/TERMINATOR WAS OK
	JMP	TERMOK		/ SPACE, TAB, ; , CR, +, -, / *, &,
	SAD	KOMMA		/ !, BACKSLASH, OR COMMA
	JMP	TERMOK
	JMS	RPTEST		/RIGHT PAREN?
	JMP	SYMERR		/SYMBOL TERIMATE ERROR
 
/
/WAS THE SYMBOL PRECEEDING THE TERMINATOR, NUMERIC
/OR ALPHANUMERIC (BEGINS WITH ALPHA).  THE 1ST CHARACTER
/CODE = 0 IF ALPHA AND NON0 IF NUMERIC.
/
TERMOK	LAC	CHAR1		/NUMERIC?
	SNA			/YES
	JMP	SYMBLD		/NO..EVALUATE SYMBOL.
	LAC	VARSW		/ALPHA AND # CANNOT BE
	TAD	ALPCIN		/WITH NUMBERS.
	SNA
	JMP	NUMEND		/ABSOLUTE, EVALUATE NUMBER.
	JMS	CLEARS		/CLEAR THE GARBAGE STRING
	JMP	NUMER		/VALID TERMINATOR BUT NON-NUMBERS
/				/WHERE ENCOUNTERED IN THE LEGAL C.S.
 
 
/AN INVALID CHAR WAS ENCOUNTERED AND CAUSED THE
/CHARACTER STRING TO BE DELIMITED.  IGNORE IT
/
SYMERR	JMS	ERRORS		/THE WHOLE SYMBOL IS LOST.
	DZM	BYPASS
	JMP	MORSYM+1
/
/
/
/SUBROUTINE 'RPTEST' LOOKS AT THE AC FOR A RIGHT PAREN,
/IF IT IS A '(' THE RETURN ADDRESS IS INCREMENTED
/AND THE CHAR IS REPLACED WITH A SPACE (40).
/
RPTEST	0
	SAD	RPAREN		/RIGHT PAREN?
	SKP			/YES
	JMP*	RPTEST		/NO EXIT
	ISZ	RPTEST
	LAC	L40
	DAC	CHRHLD
	JMP*	RPTEST
 
/SUBROUTINE TO SET ALL SYMBOL SWITCHES.
/
/
/
CLEARS	0
	LAC AD08			/PACKS
	JMS P6INT
	DZM	PACKS+1		/SYMBOLS.
	DZM	VARSW		/# IN CHARACTER STRING SWITCH.
	DZM	FNDSW
	DZM	LCOUNT
	DZM	NUMBR
	DZM	CHAR1		/FIRST CHAR SWITCH.
	DZM	ALPCIN
	JMP* CLEARS
CHR6	0
	LAC	L6
	DAC	CHRNUM
	JMP*	CHR6
 /SUBROUTINE 'IGNORE' LOOKS AT THE NEXT CHAR OR THIS
/CHAR (DEPENDING ON BYPASS SWITCH). IF THE CHAR IS
/BLANK ITS IGNORED, AND THE NEXT CHAR COMES IN.
/
IGNORE	0
	JMS GETCHR		/NO. GET ANOTHER CHAR.
	SAD L40		/IGNORE BLANKS
	JMP .-2
	DAC BYPASS		/SET CHAR IN SWITCH
	JMP* IGNORE
/
/
/
/SUBROUTINE TO PROCESS A LEGAL CHARACTER.  CONTROL STAYS IN
/THIS SUBROUTINE UNTIL A STRING OF CHARS IS DELIMITED, OR
/UNTIL AN ILLEGAL CHAR IS ENCOUNTERED.  THE CHARS ARE
/PACKED .SIXBT IN PACKS AND PACKS+1.  THE PAPERTAPE CONTROL
/PUNCHES VT, LF, AND FF ARE ALWAYS IGNORED.  THE SIXBT 
/CHARACTER COUNTER CHRNUM MUST BE SET TO ZERO BEFORE ENTRANCE
/THE BYPASS (GETCHR) SWITCH MUST ALSO BE PRESET. LEADING 0'S OF
/A NUMERIC STRING ARE NOT PACKED, BUT THE 1ST CHAR
/SWITCH IS SET.
/
SYMCHR	0
	LAC	BYPASS		/IS THE CHARACTER ALREADY IN?
	SNA			/YES
SYMGET	JMS	GETCHR		/NO
	SAD	VARAB		/IF ITS THE # SIGN, TURN ON THE VARAIBLE
	JMP	SYMVAR		/AND GET ANOTHER CHARACTER
	JMS	CHRLKP		/ALWAYS IGNORE LF, FF, VT
	157775
	JMP	SYMGET
	DZM	BYPASS		/CLEAR CHAR IN SWITCH
	JMS	LEGAL		/IS THE CHARACTER LEGAL?
	JMP*	SYMCHR		/NO.. EXIT
	LAC	CHRNUM		/HAVE ANY CHARS BEEN PACKED?
	SZA			/NO..TEST FOR LEADING ZEROES?
	JMP	SYMSTO		/ZEROES ARE IGNORED
	LAC	CHRHLD
	SAD	L60
	JMP	SYMGET
				/IF IT IS IGNORE IT
SYMSTO	JMS	SIXP		/SIXBT PACKING
	JMP SYMGET
SYMVAR	SET	VARSW
	JMP	SYMGET
/
/
/
/LEGAL
/SUBROUTINE LEGAL LOOKS AT A CHARACTER AND DETERMINES WHETHER
/OR NOT THE CHARACTER IS A LEGAL SYMBOL VALUE: A-Z,.,%,OR
/0-9.  IF IT IS LEGAL, A COUNT IS MADE OF THAT TYPE OF CHARACTER.
/IF THE CHARACTER IS THE FIRST ONE IN, A SWITCH IS SET FOR ITS
/TYPE.  CHAR1=0 IF FIRST CHAR IS ALPHA AND NON 0 IF IT IS
/NUMERIC.
/
/
LEGAL	0
	JMS	CKALF		/IS THE CHAR A-Z?
	JMP	LEGALA
	JMS	CKNUM		/NUMERIC?
	JMP	LEGALN
	JMS	CHRLKP
	137776			/' OR %?
	JMP	LEGALA
	JMP*	LEGAL		/ILLEGAL
LEGALA	SET	ALPCIN		/ALPHA CHARACTER IN
	JMP	LEGALO		/EXIT FROM LEGAL.
LEGALN	LAC	ALPCIN		/IF ALPCIN IS 0, THE FIRST CHAR
	SNA			/IS NUMERIC.
	SET	CHAR1
LEGALO	ISZ	LCOUNT		/COUNT CHARACTERS
	ISZ	LEGAL		/BUMP TO LEGAL-CHAR-IN RETURN.
	JMP*	LEGAL
/
/
/
/CHECK THIS CHARACTER FOR BEING A SEMICOLON.
/
CKSEMI	0
	LAC CHRHLD
	SAD L73
	ISZ CKSEMI		/CHAR IS A SEMICOLON
	JMP* CKSEMI


/SUBROUTINE SUB1 PERFORMS THE FUNCTION: LAW -1, TAD ADDR,
/DAC ADDR. I.E. ONE IS SUBTRACTED FROM THE CONTENTS OF
/A LOCATION.
SUB1	0
LAWM1	LAW	-1
	JMS	ADDER
SUB2	0
	LAW	-2
	JMS	ADDER
SUB3	0
LAWM3	LAW	-3
	JMS	ADDER
ADD3	0
	LAC MERGE+1
	JMS ADDER
/
/
/
ADDER	0
	DAC	ADDER1
	LAW	-3
	TAD	ADDER
	DAC	ADDER
	LAC*	ADDER
	DAC	ADDER
	LAC*	ADDER
	AND	L347S
	TAD	TADLIT
	DAC	ADDER2
ADDER1	XX
ADDER2	XX
	JMP*	ADDER
/
/
/
/
/NUMBER ERROR
/
NUMER	JMS ERRORN	/N TO FLAG WORD
	JMS CKSCR		/CHECK FOR ; OR CR
	JMP NUMEND
ENDALL	JMS SCNEND	/SCAN TO END OF WORD
	JMP ENDLNE	/END WORD/LINE
NUMEND	JMS NUMEVL		/NUMBER EVALUATION
	DZM CREL
ARITHOP	LAC OPRTR		/DETERMINE WHAT OPERATION
	AND L7		/IS TO BE PERFORMED
	TAD (JMP .+4
	DAC .+2
	LAC FLDVAL
	0
	JMP ARADD		/ADD
	JMP ARIOR		/INCLUSIVE OR
	JMP ARMUL		/MULTIPLY
	JMP ARADD		/ADD
	JMP ARXOR		/EXCLUSIVE OR
	JMP ARSUB		/SUBTRACT
	JMP ARAND		/AND
	JMP ARDIV		/DIVISION
ARADD	TAD NUMBR
	JMP STORIT
ARSUB	LAC NUMBR
	JMS TWOS		/CHANGE NUMBR TO 2'S COMP
	TAD FLDVAL
	JMP STORIT
ARMUL	JMS MPY	/FLDVAL IS MULTIPLIER
	LAC NUMBR	/MULTIPLICAND
	JMP STORIT	/AC IS LOW ORDER PRODUCT
ARDIV	JMS DIVIDE	/DIVIDE ROUTINE
	LAC FLDVAL	/DIVIDEND
	LAC NUMBR	/DIVISOR
	JMP STORIT
ARAND	AND NUMBR
	JMP STORIT
ARIOR	AND NUMBR
	XOR FLDVAL
	XOR NUMBR
	JMP STORIT
ARXOR	XOR NUMBR
STORIT	DAC FLDVAL
	JMS MODETR	/WHAT OUPUT MODE
	JMP ACCREL		/REL
/
/END OF OP OR ADDRESS FIELD
/
ENDFLD	JMS CKSCR		/CHECK FOR ; OR CR
	JMP ENDLNE	/END WORD-LINE ROUTINE
	JMS CKSPTB	/CHECK FOR SPACE OR TAB
	SKP
	JMP NXOPAD	/GET NEXT ELEMENT OF EXPRESSION
	LAC FLDSW	/WHAT FIELD
	SZA
	JMP ENDALL	/ADDRESS FIELD
	LAC FLDVAL	/OPERATION FIELD
	DAC OPVAL
	JMS IGNORE
	JMS CHRLKP
	017774		/CHECK FOR TAB,CR,;OR /
	JMP ENDALL		/END OF STATEMENT
	DZM FLDVAL
	DZM OPRTR
	SET FLDSW
	JMP MORSYM
	.TITLE SYMBOL TABLE BUILD-UP
SYMBLD	LAC PACKS		/CHECK FOR CURRENT
	SNA			/SYMBOL IS IN
	JMP VAL155	/NO SYMBOL IN PACKS OR PACKS+1.
SYMBIN	SAD (560000	/LOCATION REFERENCE
	SKP
	JMP NOTCLC
	LAC PC		/PC PICKED UP
	DAC NUMBR		/AS ITS VALUE
	DZM CREL
	LAC SYMTYP	/PICK UP RELOCATION
	SPA
	ISZ CREL
	JMP ARITHOP	/PERFORM ARITHMETIC OPERATIONS
NOTCLC	LAC IFSW		/.IF STATEMENT?
	SZA		/NO
	JMP IFEXP		/YES
	TAD FLDSW	/OP FIELD?
	TAD PASW	/PARAM?
	TAD OPRTR
	SZA		/FOR SYMBOL OR EXPRESSION
	JMP CNVIT		/IF SYMBOL, LOOK FOR
	JMS CHRLKP	/PSEUDO-OP
	007774		/CHECK FOR SPACE, TAB, CR, OR ;
	SKP		/FOUND
	JMP CNVIT
	JMS SEARCH	/SEARCH PSEUDO-OP TABLE
	LAC POPEND
	LAC POPBEG	/CALLING SEQUENCE
	LAC AD08		/PACKS
	2		/
	SKP		/FOUND
	JMP CNVIT		/NOT FOUND
	JMS CKPFV
	LAC* MRGLOC
	JMS WRD3		/PICK UP JUMP INSTRUCTION
	SAD IFOP		/.IF PSEUDO OP
	JMP POPIT		/YES
	LAC CONDSW		/CONDITIONALIZED SECTION
	SNA		/YES
POPIT	XCT* MRGLOC	/NO - JUMP TO PSEUDO-OP RTNE
	LAC* MRGLOC
	SAD ENDCOP	/.ENDC
	XCT* MRGLOC	/YES
CNVIT	LAC CONDSW	/CONDITIONALIZED SECTION
	SZA		/NO
	JMP ENDLNE	/EXIT TO END LINE ROUTINE
	JMS USTLKP	/LOOK UP SYMBOL IN USER TABLE
	SKP		/FOUND
	JMP CKSYSM		/NOT FOUND
	JMS CKMAC		/IS ENTRY A MACRO
	JMP NOTMAC		/NO
	LAC FLDSW		/IF NOT OP FIELD
	SZA		/IT'S A USAGE ERROR
	JMP MACERR
	XCT PASSNO		/WHICH PASS
	JMP MACALL	/MACRO CALL ROUTINE
	LAC* TMP		/WAS MACRO DEFINED FOR PASS 2
	SPA		/NO
	JMP MACALL	/YES
MACERR	JMS ERRORX	/X TO FLAG WORD
	DZM NUMBR
	JMP ARITHOP
CKSYSM	LAC FLDSW		/BYPASS SYSTEM MACRO SEARCH
	SZA		/IF NOT OP FIELD
	JMP SPST
	JMS SEARCH	/SEARCH FOR SYSTEM MACRO
	LAC SMEND
	LAC SMBEG
	LAC AD08		/PACKS
	2
	SKP
	JMP SPST
	JMS WRD3		/PICK UP WORD3
	LAC* MRGLOC
	XOR BNKBTS
	JMP SYSCAL		/MACRO CALL PROLESSING
NOTMAC	LAC* MRGLOC	/IS IT A PARAMETER ASSIGNMENT
	SMA	/YES
	JMP STFND
	JMS GETREL		/PICK UP RELOCATION
	LAC VARSW		/VARIABLE INDICATOR ON
	SNA		/YES
	JMP SPSTA
	LAC* MRGLOC
	AND L357S
	DAC* MRGLOC		/CHANGE SYMBOL TABLE ENTRY
	JMS WRD3		/FROM P/A TO VARIABLE
	JMS SETB0			/SET BIT 0.
	JMS SUB2		/C(MRGLOC)=C(MRGLOC)-2
	DAC MRGLOC
	ISZ VARCTR		/UPDATE VARIABLE COUNT
	JMP STFND
SPSTA	LAC FLDSW
	SNA
	JMP SPSTB
SPSTAP	JMS SYMVAL		/PICK UP SYMBOL VALUE
	JMP ARITHOP	/PERFORM ARITHMETIC OPERATIONS
STFND	ISZ FNDSW		/SET FOUND IN USER TABLE
	LAC MRGLOC
	DAC MRGSAV	/SAVE MERGING LOCATION
/IF THE SYMBOL VALUE IS X IT HAS TO BE TREATED AS A
/SPECIAL CASE. IF THE FIELD SWITCH IS NON 0, GO AHEAD
/AND SCAN THE PERMANENT SYMBOL TABLE TABLE IF THE
/NULL OP SWITCH IS OFF. IF THE NULL OP SWITCH IS
/ON, OR WE ARE IN THE OPERATION FIELD FLAG THE
/LINE WITH X. (ILLEGAL USE OF INDEX REGISTER).
/SCAN THE PERM SYMBOL TABLE SO THAT THE-U-FLAG
/DOESN'T COME UP AND SAVE A LOCATION AFTER PROG AND BEFORE LITERALS.
SPST=.
	.IFUND %PDP9
	LAC PACKS		/GET THE SIXBT SYMBOL VALUE.
	SAD XREG		/IS IT X?
	SKP		/YES-CHECK FOR OPERATION FIELD.
	JMP SPSTNX	/NO-SCAN PERM IF OP FIELD.
	JMS CKERX
	SET INDXSW	/TURN ON XR SWITCH.
	LAC FLDSW		/IS IT THE OPERATION FIELD?
	SNA			/NO.
	JMS ERRORX	/YES...FLAG THE LINE.
	LAC NULOPF		/IS THIS A NULL OPERATOR?
	SZA		/NO
	JMS ERRORX	/YES..FLAG THE LINE.
	JMP ENDFLD	/GET NEXT SYMBOL  .
	.ENDC
SPSTNX	LAC FLDSW		/IF OP FIELD
	SZA		/SEARCH PERMANENT SYMBOL TABLE
	JMP NOTPST	/BYPASS SEARCH
SPSTX	LAC PACKS+1		/BYPASS 2 WORDS
	SZA		/IF 2ND WORD NONFILE
	JMP SPSTF
	JMS SEARCH		/SEARCH 2 WORD S/T
	LAC PS2END
	LAC PS2BEG
	LAC AD08		/PACKS
L1	1
	JMP SPSTE		/FOUND
SPSTF	JMS SEARCH		/SEARCH 3 WORD S/T
	LAC PS3END
	LAC PS3BEG
	LAC AD08		/PACKS
L2	2
	JMP SPSTC		/FOUND
	JMP NOTPST		/NOT FOUND
SPSTE	JMS SUB1		/SUBTRACT 1 FROM MRGLOC
	DAC MRGLOC		/FOR 2 WORD SYMBOLS
SPSTC	JMS CKPFV
	DZM CREL
SPSTB	JMS SYMVAL		/PICK UP SYMBOL VALUE
/THE VALUE FROM THE PERM SYMBOL TABLE IS IN -NUMBR- AND THE AC.
/CHECK ITS VALUE.  IF ITS A MEM REF TURN A SWITCH ON.
	LAC CHRHLD
	SAD L52		/*
	JMP CKMRI		/CHECK FOR MEMORY REFERENCE INSTR
	JMP ARITHOP
CKMRI	DAC BYPASS	/BYPASS GETTING
	JMS GETCHR
	JMS CHRLKP	/CHECK FOR SPACE, TAB
	007774		/; OR CAR. RET.
	JMP CKOPCD	/FOUND
	JMS RPTEST	/)?
	JMP ARITHOP		/NO
/
/CHECK IF SYMBOL IS A MEMORY REFERENCE INSTRUCTION
/
CKOPCD	CLL
	LAC NUMBR
	TAD L157S		/(177777
	SZL
	JMP INDER		/NOT A MEMORY REFERENCE
	LAC NUMBR
	XOR L20000	/SET INDIRECT BIT
	JMP VAL155
INDER	JMS ERRORS	/S TO FLAG WORD
	JMP ARITHOP
/
/
/
NOTPST	LAC MRGSAV	/RESTORE MERGING LOCATION
	DAC MRGLOC
	DZM BYPASS
	XCT PASSNO		/WHICH PASS
	JMP P1SP		/PASS 1
	LAC FNDSW	/WAS IT IN USER'S TABLE
	SZA		/NO
	JMP P2FND
	JMS ERRORE	/E TO FLAG WORD
	DZM NUMBR
	JMP ENDFLD
P2FND	DZM FNDSW
	LAC* MRGSAV
	JMS GETREL		/PICK UP RELOCATION
	JMS MRGP1		/CHECK FOR UNDEFINED
	AND JMPLIT
	SZA
	JMP CKVT		/CHECK FOR VIRTUAL
	JMS ERRORU	/U TO FLAG WORD
	JMP VAL15
CKVT	SPA
	JMP CKMD		/CHECK FOR MULTIPLE DEFINITION
	ISZ EXTSW		/SET EXT SWITCH
	JMP VAL15		/PICK UP VALUE
CKMD	JMS MRGP1
	AND LACLIT
	SZA
	JMS ERRORD	/D TO FLAG WORD
VAL15	JMS SYMVAL	/PICK UP SYMBOL VALUE
	AND L57S		/MASK OUT CONTROL BITS
VAL155	DAC NUMBR
	JMP ARITHOP
/
/LOOK UP SYMBOL IN USER'S TABLE
/
USTLKP	0
	LAC AD08		/PACKS
	JMS SQOZE		/CONVERT SYMBOL TO RADIX 50
	LAC (400002
	JMS SRCUST		/SEARCH USER TABLE
	JMP* USTLKP	/FOUND
	ISZ USTLKP
	JMP* USTLKP	/NOT FOUND
/
/PASS 1 SYMBOL PROCESSING
/
P1SP	LAC FNDSW		/FOUND IN USER'S TABLE
	SZA		/NO
	JMP P1FND		/YES
	ISZ NCD		/NOT COMPLETELY DEFINED
	JMS USTLKP	/SEARCH USER TABLE
	NOP
	JMS MERGE		/MERGE IN NEW SYMBOL
LAWM2	LAW -2		/GET TABLE ADDRESS
	TAD* L11		/OF MERGED SYMBOL
	DAC MRGLOC
	LAC VARSW		/IS PACKS A VARIABLE
	SZA		/NO
	JMP FLGVAR
	INC UNDCTR	/UPDATE UNDEFINED SYMBOL COUNT
	JMP ENDFLD
IFEXP	DZM NUMBR
	JMS USTLKP	/LOOK UP SYMBOL
	JMP IFXPA		/FOUND
	SET NCD		/NOT FOUND
	JMP ARITHOP
IFXPA	LAC* MRGLOC
	SPA		/P/A
	JMP SPSTAP	/PICK UP 18 BITS
	JMP VAL15
/
/FLAG VARIABLE SYMBOL
FLGVAR	INC MRGLOC	/SET BIT 0 OF WORDS
	JMS SETB0		/2 AND 3 OF ENTRY
	INC MRGLOC		/TO VARIABLE
	JMS SETB0
	AND IOTLIT	/PUT PC IN WORD 3
	XOR PC		/FOR MULTIPLE DEFINITION
	DAC* MRGLOC	/ERROR PRINTOUTS
	INC VARCTR	/UPDATE VARIABLE COUNT
	DZM VARSW
	JMP ENDFLD
SETB0	0
	LAC* MRGLOC
	AND L357S
	XOR XCTLIT
	DAC* MRGLOC
	JMP* SETB0
/
/SYMBOL FOUND IN PASS 1
/
P1FND	DZM FNDSW		/RESET FOUND SWITCH
	LAC VARSW		/PACKS A VARIABLE
	SZA		/NO
	JMP P1VAR		/YES
	LAC* MRGSAV
	JMS GETREL		/GET RELOCATION
	JMS MRGP1		/IF SYMBOL IN TABLE
	AND XCTLIT	/IS NOT A VARIABLE
	SNA		/OR UNDEFINED, PICK
	JMP NOVAL		/UP ITS VALUE
	ISZ MRGSAV
	LAC* MRGSAV
	AND XCTLIT
	SNA
	JMP VAL15		/PICK UP 15 BITS OF VALUE
NOVAL	ISZ NCD
	JMP ENDFLD
/
/VARIABLE ENCOUNTERED IN PASS 1 AND SYMBOL FOUND IN TABLE
/
P1VAR	ISZ MRGSAV
	DZM VARSW
	ISZ NCD
	LAC* MRGSAV
	AND JMPLIT
	SZA		/CHECK FOR UNDEFINED
	JMP P1EXT		/OR EXTERNAL
	JMS SUB1		/IF UNDEFINED, DECREMENT UNDEFINED COUNT
	DAC UNDCTR	/MARK SYMBOL AS A VARIABLE
	JMP FLGVAR
P1EXT	SAD LACLIT	/CHECK FOR EXTERNAL
	SKP
	JMP RDNTV		/CHECK FOR REDUNDANT VARIABLE
	JMS SUB1		/IF EXTERNAL, DECREMENT
	DAC EXTCTR	/EXTERNAL COUNT AND (SUB1 ARG)
	JMP FLGVAR	/MARK SYMBOL AS A VARIABLE
RDNTV	JMS MRGP1
	SPA
	JMP ENDFLD	/REDUNDANT VARIABLE
	AND L557S		/(577777
	XOR LACLIT	/SET MULTIPLE DEFINITION FLAG
	DAC* MRGSAV
	LAC AD08		/PACKS
	JMS MDER		/PRINT MULTIPLE DEFINITION
	JMP ENDFLD
	.TITLE BUILD OUTPUT VALUES
/
/END OF LINE (OR WORD) PROCESSING
/
ENDLNE	LAC NDIL		/ANY DATA IN LINE
	SNA		/YES IF ZERO.
	JMP DATAIN
	JMS CKSEMI
	JMP TAGCOM
	JMP SCNTAG
DATAIN	LAC CONDSW	/CONDITIONAL SECTION
	SNA		/YES
	JMP ENDLNA
	JMS SCNEND	/SCAN TO STATEMENT END
	DZM FLGWD
	JMS CKSEMI	/;?
	SKP
	JMP SCNTAG	/NEXT TAG FIELD
	DZM STOPPER
	JMP TAGCOM+2
ENDLNA	LAC IFSW		/.IF SWITCH?
	SZA
	JMP IFRET		/RETURN TO .IF RTNE
	LAW -2		/IF AREL > 1
	TAD AREL		/FLAG AS POSSIBLE
	SPA		/RELOCATION ERROR
	JMP ARELOK
	LAC L1
	DAC AREL
	JMS ERRORR	/R TO FLAGWORD
ARELOK	LAC ENDSW		/PASS 2 .END
	SNA		/YES
	JMP CKLOC
	LAC FLDVAL	/SAVE .END
	DAC ENDVAL
	JMP DACWD
CKLOC	LAC LOCSW		/.LOC
	SNA		/YES
	JMP CKFTXT	/NO
KON001	LAC FLDVAL	/OPERAND VALUE
	DAC PC		/REPLACES PC
	LAC AREL		/SET SUCCEEDING
	SZA		/INSTRUCTIONS TO SAME
	CLC		/RELOCATION AS .LOC OPERAND
	DAC SYMTYP
	JMP OUTPUT
/
/CHECK FOR TEXT LINE
/
CKFTXT	LAC TEXTSW
	SNA
	JMP CKLFP
	LAC AD09		/TEXT LOCATION - TXTBF
	DAC TXTLOC
	LAC TXTBF
	DAC WRDVAL
	JMP CKFTG		/CHECK FOR TAG
CKLFP	LAC SZESW		/.SIZE
	SNA
	JMP CKLFP2
	DZM SZESW
	LAC SYMSAV
	SPA
	LAC L1
	DAC AREL
	LAC PRGSZE	/PICK UP PROG SIZE
	DAC WRDVAL
	DZM BITS		/0 = 15 BITS, -2 = 13 BITS
	JMP CKFTG		/CHECK FOR TAG
CKLFP2	JMS LL13		/13 BITS/12 BITS ASSUMED.
	LAC FLDSW
	SNA
	JMP CKLFP5
	LAC OPVAL
	SZA
	JMP WRDEVL	/COMBINE OPERATOR AND OPERAND AS 13-BIT RELOC.
	LAC NULOPF 	/IF THIS SWITCH IS ON, (.DSA) MAKE IT 15-BIT RELOC.
	SNA
	JMP WRDEVL
	DZM FLDSW
CKLFP5	DZM BITS		/FLDSW=0 15-BIT RELOC IF NO OPERAND.
CKLFPM	LAC FLDVAL
	JMP DACWD
/
/
/
/COMPUTE THE INSTRUCTION WORD VALUE BY COMBINING
/THE OP AND THE ADDRESS FIELD VALUES. THERE ARE MANY
/OD RESTRICTIONS THAT HAVE TO BE CHECKED
/IF THE OPERATOR IS A MEMORY REFERENCING INSTRUCTION.
/THE PDP-15 INSTRUCTIONS THAT TAKE IMMEDIATE
/NINE BIT OPERANDS ARE HANDLED FIRST.
/
WRDEVL=.
	.IFUND %PDP9
	LAC	OPVAL		/OPERATION FIELD VALUE.
	DZM	PCIMAG
	SAD	AASI		/AAS?
	JMP	STRIP9
	SAD	AACI		/AAC?
	JMP	STRIP9
	SAD	AXRI		/AXR?
	JMP	STRIP9
	SAD	AXSI		/AXS?
	JMP	STRIP9
	JMP	NOT9OP		/NOT A 9-BIT OPERATOR
STRIP9	SET	NINEOP		/STRIP LEFT MOST 9-BITS FROM
	LAC	PCIMAG
	SZA
	JMS	ERRORL
	JMS	CKERR		/THE OPERAND VALUE BEFORE
	LAC	L37S
	SKP
	.ENDC
NOT9OP	LAC	L147S
	AND	FLDVAL
	TAD	OPVAL		/(NOT A 9-BIT OPERATOR).
DACWD	DAC WRDVAL
/
/THE OPERATOR AND OPERAND VALUES HAVE BEEN COMBINED
/AND ARE IN THE BUILDER WORD-WRDVAL-. MOST OF THE
/FOLLOWING CODE WILL DEAL WITH ERROR CHECKING. BEFORE
/THE ERROR CHECKING THOUGH, MAKE SURE THAT THERE IS
/AN OPERAND.
/
	LAC FLDSW		/FIELD SWITCH (0=OPERATOR
	SNA!CLL			/NOT 0=OPERAND.)
	JMP LITRLS		/NO ADDRESS VALUE.
	LAC OPVAL		/IF THE OP VALUE IS A 0,
	SNA			/ITS EITHER A CAL OR A USER
	JMP BNKTST		/SYMBOL.
/
/AT THIS POINT WE KNOW THERE IS NON 0 OPERATOR AND
/AN OPERAND. IF THE OPVALUE IS NOT A MEMORY REFERENCING
/INSTRUCTION, FLAG THIS WORD AS AN OPERAND ERROR (-O-ERROR).
/WE CAN DETERMINE WHETHER OR NOT THE OPERATOR IS A
/MEMORY REFERENCE BY ADDING 140000 TO IT. ANY INSTRUCTION
/GREATER THAN 60 WILL CAUSE AN OVERFLOW. IF THE
/INSTRUCTION THAT CAUSED THE OVERFLOW IS A LAW OR
/A NINE-BIT INSTRUCTION, ITS OK, BUT THE OPERAND
/MUST NOT BE RELOCATABLE OR USE THE INDEX REGISTER.
/
	TAD DZMLIT		/ADD 140000 TO OPVAL.
	SML			/NOT A MEMORY REF.
	JMP LITRET		/INSTN IS A MEM REF.
	.IFUND %PDP9
	JMS	CKERX		/CHECK FOR INDEX REGISTER.
	.ENDC
	LAC	OPVAL		/LAW?
	SAD	LAWLIT		/YES-CHECK OPERAND FOR POSSIBLE
	JMP	CKFER		/ERRONEOUS RESULTS.
	AND NOPLIT		/EAE?
	SAD EAELIT
	JMP EAENEG		/YES..ACCEPT ANY OPERAND
	.IFUND %PDP9
	LAC NINEOP		/CHECK FOR LAW ON 9-BIT OP.
	SZA			/NO-CHECK FOR LAW
	JMP CKFER-1		/CHECK 9-BIT ADDRESS
	.ENDC
	JMS ERRORO		/NOT-LAW-AND NOT 9-BIT OP,
	JMP LITRLS		/AND NOT A MEM-REF, YET IT HAS
				/AN OPERAND VALUE FLAC THIS WORD.
EAENEG	LAC FLDVAL	/ADD ALL 18 BIT OF OPERAND TO EPERATOR
	TAD OPVAL	/WHEN PROCESSING AN EAE OP.
	DAC WRDVAL
	AND NOPLIT
	SAD EAELIT	/WAS THE OPERATOR LOST?
	JMP LITRLS	/NO IT 640000.
	JMS ERRORE	/YES ITS OTHER THAN AN EAE.
	JMP LITRLS
/
/
LITRET=.
	.IFUND %PDP9
	LAC K10000	/BIT 5
	JMS GETBOP	/GET PAGE BIT RESULT
	LAC INDXSW	/WAS THE INDEX REGISTER USED?
	SNA		/YES
	JMP NOUSEX	/NO
	LAC BPXRES	/IS THE PAGE BIT RESULT OK?
	SNA		/YES
	JMP PGOKX	/YES..MAKE SURE BIT IS ON.
	LAC BOPADR	/IF THE ADDR PAGE BIT IS ON ITS 
	SZA		/PAGE ERROR('B')
	JMS ERRORB	/(LAC 0,X TO LAC 7777,X)=OK ANY PAGE.
PGOKX	LAC K10000	/TURN ON BIT 5 OF WRDVAL.
	JMS PAGBIT	/INDEX BIT IS ON
	JMP BNKTST+2	/WAS XORED WITH X.
NOUSEX	LAC DIRASW	/CURRENTLY PDP-15 MODE?
	SZA		/YES
	JMP BNKTST	/NO..CHECK FOR BANK ERROR
	LAC BOPPC
	SZA!CLA
	JMS PAGBIT	/IF PC BIT BIT 5 IS OFF TURN OFF ARG.
	LAC BPXRES	/IS THE PAGE BIT RESULT OK(0)?
	SZA
	JMS CKAUTO	/NO CHECK FOR LAC* 10 TO 17
	JMP BNKTST+2	/TEST ALL 3 ADDR BITS.
/
/IF THE PROGRAM IS RELOCATABLE THE BANK BIT CANNOT
/BE ON. IF ITS ABSOLUTE AND THE BANK BITS ARE ON, THE
/BANK BITS MUST EQUAL THE PC BANK BITS.
/
BNKTST	LAC (60000	/BANK BITS 3 AND 4
	SKP
	LAC (70000
	.ENDC
	.IFDEF %PDP9
BNKTST	LAC (60000
	.ENDC
	JMS GETBOP
	LAC BPXRES	/ARE BANK BITS OK?
	SNA
	JMP BIT012	/YES..CHECK BITS 0,1,2 LAST.
	LAC BOPADR	/NO...WERE THE ADDR BITS AT FAULT?
	SZA		/IF 0 IT MIGHT BO LAC 0,X OR
	JMP BNKERR	/LAC* 10 THRU 17.
	.IFUND %PDP9
	LAC INDXSW
	SNA
	.ENDC
	JMS CKAUTO
BIT012	LAC IOTLIT	/CHECK BITS 0,1 AND 2.
	AND FLDVAL
	SZA
BNKERR	JMS ERRORB
	JMP LITRLS
/
/INPUT TO THIS SUBROUTINE IS THE 'AND' AND 'XOR' VALUE
/FOR LOOKING AT CERTAIN BITS IN THE PC AND THE
/ADDRESS VALUE.
/
GETBOP	0
	DAC ANDXOR	/SAVE 'AND-XOR' VALUE
	AND PC
	DAC BOPPC		/SAVE BANK OR PAGE BITS OF PC
	LAC FLDVAL
	AND ANDXOR
	DAC BOPADR	/SAVE BANK OR PAGE BITS OF ADR VALUE.
	XOR BOPPC
	DAC BPXRES	/RESULT
	JMP* GETBOP
	.IFUND %PDP9
/INPUT TO THIS SUBROUTINE IS IN THE AC
/THIS ROUTINE PERFORMS AN OPERATION ON THE
/PAGE BIT OF WRDEVL. (CLEAR OR SET IT)
PAGBIT	0
	DAC ANDXOR		/SAVE VALUE TO ADD TO WRDVAL
	LAW 7777
	AND WRDVAL
	TAD ANDXOR		/SET PAGE BIT OR LEAVE IT 0.
	DAC WRDVAL
	JMP* PAGBIT
	.ENDC
/THIS SUBROUTINE CHECKS FOR AN AUTOINDEX REG.
/
CKAUTO	0
	LAC OPVAL
	AND L20000	/INDIRECT BIT
	SNA
	JMP CKBERR
	LAC FLDVAL
	TAD (-10
	SPA
	JMP CKBERR
	LAC FLDVAL
	TAD (-17
	SZA!SMA
CKBERR	JMS ERRORB
	JMP* CKAUTO
	.IFUND %PDP9
/ALL THE BITS (0-4(5)). IF ANY OF THE LOW ORDER
/BITS ARE ON, THEY BETTER ALL BE ON (NEGATIVE).
/
	LAW	17000		/NINE-BIT OP
	.ENDC
/THE NINEBIT OPS AND THE LAW INSTRUCTION ARE SPECIAL CASES.
/THE USER MIGHT HAVE A PC OF 30000 AND A LAW 37777 WITH
/THE DESIRED RESULT BEING 777777. IF THE PC BITS MATCH ITS
/OK. IF THE PC BIT(S) ARE OFF AND THE ADDRESS BITS ARE
/ON ITS AN ERROR.
CKFER	DAC OUTFLG
	LAC (60000	/BITS 3 AND 4 ONLY.
	JMS GETBOP
	LAC BOPADR	/IF ADDRESS BITS ARE OFF THE WORD IS OK.
	SNA
	JMP CKOKPC
	LAC BPXRES	/ARE PC AND ADDRESS PC BIT EQUAL?
	SZA		/YES DELETE ADDRESS PC BITS.
	JMP CKOKPC	/NO..GO THROUGH TEST TO PRODUCE .E. ERROR.
	LAC FLDVAL
	AND (717777	/AND OFF BIT 3,4
	SKP
CKOKPC	LAC FLDVAL
	AND OUTFLG
	SAD OUTFLG
	JMP LITRLS		/0 ITS AN N-ERROR(NUMERIC VALUE ERROR)
	SZA			/
	JMS ERRORE		/COMBINATION OF OPERATOR
	.TITLE LITERAL PROCESSOR
LITRLS	LAC LITSW		/IS THERE A LITERAL
	SNA		/YES
	JMP CKXDSA	/NO
	DZM LITSW
	XCT PASSNO		/WHICH PASS
	SKP
	JMP LTP2		/PASS 2 LITERAL PROCESSING
/
/PASS 1 LITERAL PROCESSING
/
KON002	LAC NCD		/IS IT COMPLETELY DEFINED
	SZA!CLC		/YES
	JMP NCDP1		/NO
	LAC WRDVAL
	DAC SQZOUT+2	/PICK UP LITERAL VALUE
	DZM SQZOUT+1
	LAC AREL		/GET RELOCATION
	SNA
	JMP NCDP1A
	ISZ SQZOUT+1	/SET LIT ADDRESS RELOCATABLE
			/13 BITS
	LAC BITS
	SMA
	ISZ SQZOUT+1		/REL 15 BITS
NCDP1A	LAC LITCTR		/IS IT THE FIRST ENTRY
	SZA		/YES
	JMP RDNCK		/NO, SEE IF IN TABLE
	JMP MRGLIT
NCDP1	DAC SQZOUT+1
	LAC PC		/REFERENCING LOCATION
	DAC SQZOUT+2	/USED INSTEAD OF VALUE
/
/MERGE LITERAL INTO USER SYMBOL TABLE
/FORCE THE SYMBOL VALUE OF THE LITERAL TO BE HIGHER THAN
/ANY SYMBOL VALUE. DIFFERENTIATE IT FROM OTHER LITERALS
/BY MAKING THE LITGRAL COUNT ITS LOW ORDER SYMBOLIC
/VALUE.
/
MRGLIT	LAW 10000		/LITERAL INDICATOR
	TAD LITCTR	/AND COUNT TO
	DAC SQZOUT		/FIRST WORD OF LITERAL
	LAC L2
	JMS SRCUST	/USE SEARCH ROUTINE
	NOP		/INITIALIZE THE MERGE ROUTINE
	JMS MERGE		/MERGE IN LITERAL
	ISZ LITCTR	/UPDATE LITERAL COUNT
	JMP CKFTG
/
/CHECK IF LITERAL IS ALREADY IN TABLE
/
RDNCK	JMS LITBEG	/GET LITERAL
	ISZ* L10		/STARTING POSITION
RDC4	LAC* 10		/COMPARE WORD 3
	SAD SQZOUT+2
	JMP RDC1
RDC3	ISZ CTR
	JMP RDC2
	JMP MRGLIT	/NOT FOUND, MERGE CURRENT
RDC1	JMS ALTA		/ADJUST ADDRESS
	SAD SQZOUT+1	/CHECK WORD 2
	JMP CKFTG		/LITERAL ALREADY IN
	ISZ* L10
	JMP RDC3
RDC2	JMS INCL10	/UPDATE FOR NEXT COMPARE
	JMP RDC4
/
/PASS 2 LITERAL PROCESSING
/
LTP2	JMS LITBEG	/PERFORM STARTING
	ISZ* L10		/ADDRESS SEARCH
	LAC* L10
	DAC TMP
	LAC CTR
	DAC TMP1
LTP2A	LAC* 10		/CHECK IF NOT COMPLETELY
	SAD PC		/DEFINED IN PASS 1
	JMP LTP2C
LTP2B	ISZ CTR
	JMP LTP2J
	JMP LTP2D
LTP2J	JMS INCL10
	JMP LTP2A
/
/PC FOUND, CHECK PREV. WORD FOR NCD
/
/
LTP2C	JMS ALTA		/ADJUST LITERAL TABLE ADDRESS AND GET ITS
	SPA		/DESCRIPTION WORD. IS IT COMPLETELY DEFINE?
	JMP LTP2E		/SO CONTINUE
	ISZ* L10
	JMP LTP2B
LTP2D	LAC TMP
	DAC* L10
LTP2G	LAC* 10
	SAD WRDVAL	/CHECK LITERAL VALUE
	JMP LTP2F		/AGAINST TABLE VALUE
LTP2H	ISZ TMP1
	JMP LTP2K
	JMS ERRORL	/L TO FLAG WORD
	DZM WRDVAL
	JMP CKFTG
LTP2F	JMS ALTA
	DAC TMP
	LAC AREL
	SZA		/ABS
	JMP LTP2N
	LAC TMP
	SNA
	JMP LTP2L		/LITERAL IS ABSOLUTE
	JMP LTP2M		/NOT THE SAME
LTP2N	LAC TMP
	SNA
	JMP LTP2M		/NOT THE SAME
	SAD L1
	JMP LTP2P
	LAC BITS
	SMA
	JMP LTP2L		/15 BITS RELOCATABLE
	JMP LTP2M
LTP2P	LAC BITS
	SMA		/13 BITS RELOCATABLE
	JMP LTP2M
	JMP LTP2L
LTP2M	ISZ* L10
	JMP LTP2H
LTP2L	ISZ* L10
	LAC* L10
	DAC TMP
	JMP LTP2I
LTP2K	JMS INCL10	/ISZ* L10;ISZ* L10
	JMP LTP2G
LTP2E	LAC* L10
	DAC TMP
	LAC AREL		/RELOCATION IND
	DAC* TMP		/INTO WORD 2
	SNA
	JMP LTP2Q
	LAC BITS
	SNA
	ISZ* TMP
LTP2Q	ISZ TMP
	LAC WRDVAL	/VALUE INTO
	DAC* TMP		/WORD 3
LTP2I	JMS SUB2		/C(TMP)=C(TMP)-2
	DAC TMP
	LAC* TMP
	AND L47S		/LITERAL NUMBER (7777
	TAD LITLOC	/ADDED TO LITERAL STARTING
	DAC FLDVAL
	DAC WRDVAL	/LOCATION
	DZM AREL
	LAC SYMSAV	/LITERAL RELOCATABILITY
	SZA
	ISZ AREL
	DZM BITS		/15-BIT RELOCATION FOR ALL LITERALS.
	LAC OPSVSW	/IF NO OPERATOR WAS SAVED, GO TO THE
	SNA		/TAG PROCESSING AREA.
	JMP CKXDSA
	LAC NULOPF	/WAS IT (.DSA (LAC ADDR) OR (.DSA (ADDR))?
	SZA
	JMP CKXDSA
	JMS LL13		/RELOC TO 13 BITS.
	LAC OPSAV
	DAC OPVAL
	SET FLDSW
	.IFUND %PDP9
	DZM INDXSW
	SET PCIMAG
	JMP WRDEVL+2
	.ENDC
	.IFDEF %PDP9
	JMP WRDEVL
	.ENDC
/
/
/IF THE INDEX REGISTER SWITCH IS ON, TURN ON BIT 5.
/THE INSTRUCTION MUST HAVE BEEN (.DSA ADDR,X) OR ((TAB) ADDR,X).
/USING THE INDEX REGISTER WITH THIS TYPE OF INSTRUCTION IS ILLEGAL
/AND USELESS. TURN ON BIT 5 FOR CONSISTENCY.
/
CKXDSA=.	/INDEX REGISTER SWITCH ON?
	.IFUND %PDP9
	LAC INDXSW
	SNA		/YES..ITS AN ERROR
	JMP CKFTG		/NO..CHECK THE TAG.
	LAC FLDSW		/DON'T FLAG IT IF NOT
	SZA		/OPERATOR FIELD.
	JMP CKFTG
	JMS ERRORX
	LAC K10000	/TURN ON BIT 5.
	JMS PAGBIT
	.ENDC
	JMP CKFTG
	.IFUND %PDP9
/
/CKER-X-
/
/THIS ROUTINE IS REFERENCED WHEN AN INSTRUCTION THAT CANNOT
/USE AN INDEX REGISTER IS ENCOUNTERED.IF THE INDEX SWITCH IS
/ON FLAG THIS LINE WITH AN X.
CKERX	0
	LAC INDXSW	/INDEX REGISTER SWITCH.
	SZA		/(0=NOT INDEXED)
	JMS ERRORX	/(NOT 0= INDEX USED)
	JMP* CKERX
	.ENDC
/
/CKER-R-  (CHECK FOR RELOCATION ERROR)
/
CKERR	0
	LAC AREL
	SZA
	JMS ERRORR
	JMP* CKERR
/
/THIS ROUTINE FLAGS A LINE THAT CANNOT HAVE A
/LITERAL, OR ONE THAT ALREADY HAS LITSW ON.
/
/CKER-L-
/
CKERL	0
	LAC LITSW
	SZA
	JMS ERRORL
	JMP* CKERL
	.TITLE BUILD PRINTING IMAGES
/
/END OF LITERAL PROCESSING
/
CKFTG	LAC PACKT		/WAS THERE A TAG
	SZA		/NO
	JMP PRTGPA	/YES
	LAC PASW		/IS LINE A PARAMETER ASSIGNMENT ?
	SZA
FLAGPA	JMS ERRORA	/A TO FLAG WORD
	JMP OUTPUT
/
MODETR	0
	LAC BMODE
	SZA
	INC MODETR
	JMP* MODETR
TMODE	0
	LAC BMODE		/TEST BINARY MODE
	SNA		/0=RELOCATABLE BINARY
	INC TMODE		/RETURN TO PC+1 IF REL
	LAC L40		/AND PC IF ABS-FULL.
	JMP* TMODE
PCIMAG	0			/OUTPUT THE 5 CHAR PC IMAGE AND /CHAR TYPE
	LAW -5		/5 CHAR OCTAL PC.
	JMS MOVBIN
	LAC PC
	JMS PKBLNK		/1 SPACE BEFORE THE PC TYPE
	JMS TMODE		/BUILD LOCATION TYPE.
	JMP TLOCR+1			/FULL OR ABS =3 SPACES.
	LAC SYMTYP		/RELOC PROG WITH REL TAG = R.
	SPA
	JMP TLOCR
	LAC L101		/A
	SKP
TLOCR	LAC L122		/R
	JMS PACK57
	JMS PKBLNK
	JMP* PCIMAG		/BUILD OBJECT CODE.
/
GOBJC	0
	LAC BSSW		/IF ITS THE BLOCK PSEUDO-OP, JUST THE TYPE
	SZA
	JMP GAD6SP
	LAW -6
	JMS MOVBIN
	LAC WRDVAL
	JMP GADTYP
GAD6SP	LAW -6		/SIX BLANKS INSTEAD OF TYPE.
	JMS SPACKS
GADTYP	JMS PKBLNK		/1 SPACE BEFORE ADDR. TYPE.
	JMS TMODE
	JMP NABS+1
	LAC EXTSW		/CHECK FOR VIRTUAL
	SNA
	JMP NNOEXT
	LAC L105		/E
	JMP NABS+1
NNOEXT	LAC AREL
	SZA
	JMP NABS
LL101	LAC L101		/A
	JMP NABS+1
NABS	LAC L122		/R
	JMS PACK57
	JMS PKBLNK
	JMP* GOBJC		/EXIT
/
/
/
/INITIALIZE THE AREA TO RECEIVE THE OUTPUT LINE.
/THE TOP OF THIS ROUTINE ASSUMES THIS IS A SOURCE LINE.
/IF THE N SWITCH IS ON, OUTPUT THE FOUR CHARACTER DECIMAL
/SEQUENCE NUMBER AND A TAB CHARACTER. IF ITS OFF OUTPUT THE
/ERROR FLAGS.
/
/
SEQERF	0
	JMS P57INT		/INIT COUNTERS AND 5/7 POINTER.
	LAC EXPSW		/IF THIS IS A MACRO EXPANSION OR IF
	TAD STOPPER
	SZA			/THE MULTI WORD STOPPER SWITCH IS ON
	JMP OUTERB		/DON'T NUMBER THE LINE.
	INC OUTLCT		/OUTPUT SOURCE LINE COUNT.
	JMS BINDEC		/BINARY TO DECIMAL.
	LAC OUTLCT		/ARG TO BINDEC.
LAWM4	LAW -4
	JMS MOVEPK		/PACK THE DECIMAL #
	LAC AD511		/DECOUT+1=DONOR ADDRESS-1
	LAC PK57AD		/PRTBUF=RECEIVING ADDRESS(FROM P57INT)
	JMP OUTSPL		/SEQUENCE # IS OUT.
/
/THE 'N' SWITCH IS ON BUT THIS IS NOT A SOURCE LINE.
/PRINT 4 SPACES INSTEAD.
/
OUTERB	LAW -4
	JMS SPACKS
OUTSPL	JMS P57TAB		/CHAR OF DOUBLE WORD
/
/OUTPUT THE ERROR FLAGS.
/THIS ROUTINE MUST OUTPUT 4 CHARACTERS, WHETHER OR NOT
/4 ERRORS WERE PRODUCED. SPACES WILL FILL THE AREA IF NONE
/ARE ON OR NOT 4 ARE ON.
/
OUTERC	LAW	-22		/CHECK 18 BITS OF FLAG WORD.
	DAC	CTR
	LAW	-4		/PRINT FIVE CHARS (SPACES OR FLAGS).
	DAC	CTRMX5
	LAC	LL101		/FIRST ERROR FLAG IMAGE.
	DAC	OUTFLG
	LAC	FLGWD		/ARE THERE ANY ERRORS?
	DAC	FLGSAV
	SNA
	JMP	OUTSP5		/NO..PRINT 5 SPACES.
	INC	ERLNCT		/YES..UPDATE ERROR LINE COUNT.
OUTER1	LAC	FLGWD		/TOP OF BIT SEARCH LOOP.
	RCL
	DAC	FLGWD
	SZL			/IS THIS ERROR BIT ON?
	JMP	OUTFLG		/YES..OUTPUT TO NEXT FLAG IMAGE.
OUTER2	INC	OUTFLG		/POINT TO NEXT FLAG IMAGE.
	ISZ	CTR		/HAVE 18-BITS BEEN CHECKED?
	JMP	OUTER1		/NO..CONTINUE SCAN
	JMP	OUTSP5		/YES..OUTPUT REQUIRED # OF SPACES.
OUTFLG	XX			/LAC NN (ERROR FLAG TO AC)
	JMS	PACK57
	ISZ	CTRMX5		/HAVE 5 FLAGS BEEN PACKED?
	JMP	OUTER2		/NO..UPDATE FLAG POINTER.
	JMP* SEQERF		/YES..EXIT
OUTSP5	LAC CTRMX5		/OUTPUT FILLER SPACES.
	JMS SPACKS
	JMP* SEQERF
/
/
/
OUT3EX	0
	LAC RPTSW		/3 MORE CHRS TO PRINT LINE.
	SNA		/*R?
	JMP OUTGAS		/NO..TEST FOR *G.
	LAC STOPPER	/IF THE STOPPER IS OFF DON'T
	SNA		/OUTPUT THE *R THIS TIME.
	JMP OUTBLK	/OUTPUT BLANKS INSTEAD.
	JMS SPOEX
	LAC L122		/OUTPUT SPECIAL EXTERSION *R
OUTGAS	LAC	EXPSW
	SNA
	JMP	OUTLAS
	JMS	SPOEX
	LAC	L107		/OUTPUT SPECIAL EXTENSION *G
OUTLAS	LAC	LITSW		/IS THIS A LITERAL(END OF PASS2 PRINTOUT)?
	SNA			/YES..OUTPUT *L
	JMP	OUTEAS
	JMS	SPOEX
	LAC	L114		/*L
OUTEAS	LAC EXLTSW		/TEST FOR EXTERNAL SYMBOL.
	SNA
	JMP OUTBLK		/OUTPUT BLANKS, NO EXTENSION
	JMS SPOEX
	LAC L105		/*E
OUTBLK	JMS SPACE2
/
/IF THE MULTI WORD STOPPER IS ON OUTPUT A CR INSTEAD
/OF THE LAST BLANK CHR.
/
OUTLST	LAC STOPPER
	SZA
	JMS P57K15	/THE BLANK AFTER THE CR WILL BE IGNORED
	JMS	PKBLNK
	JMP*	OUT3EX
SPOEX	0
	LAC	L52	/OUTPUT AN ASTERISK
	JMS	PACK57
	XCT*	SPOEX
	JMS	PACK57
	JMP	OUTLST
/
/
/
/
/
/ERROR FLAG TABLE
/
L101	101	/A
L102	102	/B
L103	103	/C
L104	104	/D
L105	105	/E
L117	117	/-O- INSTEAD OF F.
	111	/I
L114	114	/L
L115	115	/M
L116	116	/N
L120	120	/P
	121	/Q
L122	122	/R
L123	123	/S
L125	125	/U
L124	124	/-T- INSTEAD OF V.
	127	/W
ERTBL	130	/X
/
/
/
OUTPUT	XCT PASSNO	/WHICH PASS1
	JMP OUTPC		/PASS1
	LAC AD222		/ARG TO SEQERF
	JMS SEQERF	/SEQUENCE # AND ERROR FLAGS.
/
/BUILD THE LOCATION IMAGE IF THIS IS NOT A PSEUDO-OP,
/PARAMETER ASSIGNMENT OR END.
	LAC PASW		/P/A
	TAD ENDSW
	SZA
	JMP PC7SP
	JMS PCIMAG	/5 CHAR PC, 1 SPACE BEFORE PC TYPE AND 1 AFTER.
	JMP PCLSP		/LAST SPACE AFTER PC TYPE
L570S=.
PC7SP	LAW -10
	JMS SPACKS	/OUTPUT 8 SPACES.
/
/BUILD THE OBJECT CODE IMAGES IF THIS LINE HAS ANY.
/
PCLSP	LAC LOCSW		/BYPASS IF A MACRO CALL OR A LOC.
	TAD MCLSW		/OUTPUT 8 SPACES INSTEAD.
	SZA
	JMP NOBJC		/NO OBJECT CODE, 8 SPACES.
	JMS GOBJC
	JMP OBJLST	/LAST BLANK AFTER OBJECT CODE TYPE.
NOBJC	LAW -11
	JMS SPACKS
/
/OUTPUT 3 MORE CHAR BEFORE THE SOURCE LINE.
/
OBJLST	JMS OUT3EX	/3 BLANKS,*G,*R,*L,*E
			/COMPUTE TOP OF BUFFER
/THE LINE IS NOW COMPLETE EXCEPT FOR
/USER SOURCE LINE IMAGE AND THE STOPPER
/COMPUTE THE OUTPUT BUFFER POINTER AND USE IT
/AS AN ARGUMENT TO THE PRINT SUBROUTINE.
/
	JMS SHRINK
	TAD MOD33B
/
/
/
/***
/TEST FOR TEXT, RPT, ETC.
/***
OUTPC	LAC ENDSW		/.END
	SZA
	JMP BKTEND
	LAC MCLSW		/MACRO CALL
	SZA
	JMP MCLH
	LAC BSSW		/WAS LINE .BLOCK
	SNA		/YES
	JMP INCPC2
	LAC PC		/ADD .BLOCK VALUE TO PC
	TAD WRDVAL
	DAC PC
	SET LASW
	JMS CKFLLB
	JMS BLDBIN	/BUILD BINARY OUTPUT
	DZM BSSW
	JMP CKMWD
INCPC2	LAC LOCSW		/CHECK FOR .LOC
	SNA
	JMP INCPC1
	ISZ LASW
	JMS CKFLLB	/LINK LOADER RTNE
	JMS BLDBIN	/BUILD BINARY OUTPUT
	DZM LOCSW
	JMP CKMWD
INCPC1	LAC PASW		/IS LINE A P/A
	SZA		/NO
	JMP CKMWD		/YES
INCBIN	JMS CKFLLB
	JMS BLDBIN	/BUILD BINARY OUTPUT
	ISZ PC		/UPDATE PC BY 1
	LAC TEXTSW		/TEXT SWITCH ON
	SNA		/YES
	JMP CKRPT
	ISZ TXTCTR	/FINISHED OUTPUTTING IT
	SKP		/NO
	JMP TXTND
	ISZ TXTLOC	/UPDATE FOR NEXT TEXT WORD
	LAC* TXTLOC
	DAC WRDVAL
SETTER	SET STOPPER	/CR TO MULTI WORD STOPPER
	JMP OUTPUT	/OUTPUT IT
TXTND	DZM TEXTSW	/RESET SWITCH
CKRPT=.
	LAC RPTSW		/REPEAT ON
	SNA		/YES
	JMP CKMWD		/NO
/
/THIS LINE IS PART OF A .REPT PSEUDO OP EXPANSION.
/IF THE 'G' SWITCH WAS USED, DO NOT PRINT THIS LINE.
/THE WRDVAL MUST BE OUTPUT TO THE BINARY FILE
/REGARDLESS OF THE SWITCH THAT WAS USED.
/
	LAC WRDVAL
	TAD RPTINC	/ADD INCREMENT TO
	DAC WRDVAL	/CURRENT VALUE
	ISZ RPTCTR		/FINISHED.REPT?
	JMP SETTER
RPTND	DZM RPTSW		/RESET SWITCH
CKMWD	LAC PC
	CMA
	TAD CHVPC
	SMA
	JMP CKMWD1
	LAC PC		/CURRENT HIGH
	DAC CHVPC		/VALUE OF PC
CKMWD1	JMS CKSEMI	/CHECK FOR MULTIWORD LINE (;)?
	JMP NXTLNE	/NO..GET ANOTHER LINE.
	SET STOPPER		/SET MULTIWORD LINE STOPPER SWITCH
	JMP SCNTAG	/SCAN TAG FIELD
/
	.TITLE TAG PROCESSOR
/
/PROCESSING OF TAG OR PARAMETER ASSIGNMENT
/
/------------------------------
/THE CHARACTER -X- CANNOT BE USED AS A DIRECT ASSIGNMENT
/OR AS A TAG.(TAG ERROR)
PRTGPA	LAC PACKT
	.IFUND %PDP9
	SAD XREG
	SKP
	JMP .+3		/OK CONTINUE PROCESSING TAG.
	JMS ERRORT	/TAG ERROR.
	JMP OUTPUT	/IGNORE TAG.
	.ENDC
/---------------------------------
	LAC AD06		/PACKT
	JMS SQOZE		/TO SQOZED FORM
	LAC PASW		/IS IT A PARAMETER ASSIGNMENT
	SNA		/YES
	JMP PRCTAG	/NO, IT'S A TAG
/
/PARAMETER PROCESSING
/
	XCT PASSNO
	SKP
	JMP PAFR
	LAC NCD		/IS P/A A FWD REF
	SNA		/YES
	JMP PAFR
	DZM NCD
	JMS PRTSOH	/PRINT IN PASS1
MOD19A	RDBUF+1
L5	5
PAFR	LAC WRDVAL	/GET PARAMETER VALUE
	DAC SQZOUT+2
	LAC SQZOUT
	AND L157S
	XOR XCTLIT
	DAC SQZOUT	/SET PA AND ABS BITS
	LAC AREL
	SZA
	JMS LACSQZ
	JMP STLCL
/
/
LACSQZ	0
	LAC SQZOUT
	XOR LACLIT
	DAC SQZOUT
	JMP* LACSQZ
/
/TAG PROCESSING
/
PRCTAG	LAC PC		/PC IS VALUE
	DAC SQZOUT+2	/FOR THE SYMBOL
	LAC SQZOUT
	AND L157S
	DAC SQZOUT	/SET ABS
	LAC SYMTYP
	SPA
	JMS LACSQZ
STLCL	LAC SQZOUT+1	/SET SYMBOL AS LOCAL
	AND L157S
	XOR XCTLIT
	DAC SQZOUT+1
	LAC (400002
	JMS SRCUST		/SEARCH USER TABLE
	JMP TPAF
	XCT PASSNO
	JMS MERGE	/NOT FOUND, MERGE IT IN (PASS 1)
P2NF	JMS ERRORP	/P TO FLAG WORD, IGNORE IF PASS 1.
	JMP OUTPUT
/
/TAG OR P.A. FOUND
/
TPAF	JMS CKMAC		/IS TABLE ENTRY A MACRO
	JMP TPAF1		/NO
	JMS ERRORX	/X TO FLAGWORD
	JMP OUTPUT
TPAF1	XCT PASSNO		/WHICH PASS
	SKP		/PASS 1
	JMP TPAFP2	/PASS 2
	LAC MRGLOC
	DAC MRGSAV
	JMS MRGP1		/GET 2ND WORD OF SYMBOL
	AND JMPLIT
	DAC TMP	/SAVE CONTROL BITS
	SZA
	JMP CKVRT	/CHECK FOR VIRTUAL
	JMS SUB1		/CHANGE TO LOCAL
	DAC UNDCTR
	JMP MRGSMB	/MERGE IN NEW VALUES
CKVRT	SPA
	JMP CKVART
	JMS SUB1		/VIRTUAL IN TABLE TO INTERNAL
	DAC EXTCTR
	LAC LACLIT
	JMP MRGSCO
CKVART	JMS MRGP1		/IS ENTRY A VARIABLE
	SMA	/YES
	JMP MODCB	/NO
	LAC PASW	/IS SYMBOL A P.A.
	SZA	/NO
	JMP OUTPUT
	JMS SUB1	/SUBTRACT FROM VARIABLE COUNT
	DAC VARCTR	/SUB1 ARGUMENT
	LAC SQZOUT+2
	AND L57S
	XOR LACLIT	/SET MULTIPLE DEFINITION
	DAC SQZOUT+2
	LAC AD06		/PACKT
	JMS MDER	/PRINT ERROR
	JMP MRGSMB	/MERGE INTO SYMBOL TABLE
MODCB	LAC SQZOUT+1
	AND L157S
	XOR TMP
	DAC SQZOUT+1	/APPEND NEW CONTROL BITS
	LAC* MRGLOC	/IS TABLE SYMBOL A P/A
	SPA	/NO
	JMP MRGSMB	/YES
	LAC PASW	/IS CURRENT SYMBOL A P/A
	SZA	/NO
	JMP OUTPUT
	LAC* MRGSAV
	AND L557S		/(577777)
	XOR LACLIT
	DAC* MRGSAV	/FLAG SYMBOL AS A
	LAC AD06
	JMS MDER	/PRINT ERROR
	JMP OUTPUT	/MULTIPLE DEFINITION
/
/TAG OR P.A. FOUND IN TABLE
/DURING PASS 2
/
TPAFP2	LAC PASW	/IS CURRENT A P.A.
	SNA	/YES
	JMP CKVAR2
	LAC* MRGLOC	/IS TABLE ENTRY A PA
	SPA	/NO
	JMP MRGSMN	/YES, MERGE NEW VALUE
	JMP FLAGPA	/FLAG AS A P.A. ERROR
CKVAR2	JMS WRD3
	LAC* MRGLOC
	RAL	/CHECK FOR MULTIPLE
	SMA	/DEFINITION OF SYMBOL
	JMP CKPHSE
	JMS ERRORM
	JMP OUTPUT
/
/CHECK PHASING
/
CKPHSE	LAC* MRGLOC
	AND L57S		/COMPARE PASS 1 (77777
	SAD PC	/AND PASS 2 VALUES
	JMP OUTPUT
	JMP P2NF		/BUILD PRINT IMAGE, P TO FLAG WORD
MRGSMN	LAC MRGLOC
	DAC TMP		/SAVE GLOBL
	ISZ TMP		/INDICATOR
	LAC* TMP
	AND LACLIT
MRGSCO	XOR SQZOUT+1
	DAC SQZOUT+1
/
/MERGE IN NEW VALUES INTO SYMBOL TABLE
/
MRGSMB	LAC SQZOUT
	DAC* MRGLOC	/WORD 1
	INC MRGLOC
	LAC SQZOUT+1
	DAC* MRGLOC	/WORD 2
	INC MRGLOC
	LAC SQZOUT+2
	DAC* MRGLOC	/WORD 3
	JMP OUTPUT
/
/CHECK SYMBOL TABLE ENTRY FOR MACRO
/
CKMAC	0
	LAC* MRGLOC
	SPA
	JMP* CKMAC	/PARAMETER ASSIGNMENT
	LAC MRGLOC
	TAD L2
	DAC TMP
	LAC* TMP
	AND JMSLIT
	SZA		/IS ENTRY A MACRO
	ISZ CKMAC		/YES
	JMP* CKMAC	/NO
	.EJECT
	.IFUND %MACI
/!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
/!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
/!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
/PATCH AREA.
PATCH	.BLOCK 20
/!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
/!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
/!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
	.ENDC
	.TITLE PSEUDO-OP ROUTINES
/*** .LST *** AND *** .NOLST
/
.LST	LAC LSWCH		/RESET ALOPTN IF IT WAS
	DAC ALOPTN		/ORIGINALLY ON.
	DZM .NLSW
	JMP PRPOP
/
.NOLST	SET .NLSW		/SET SWITCH SO THAT PSEUDO-OP
	JMP PRPOP		/IS PRINTED BUT NOT SUBSEQUENT LINES.
/
/*** PSEUDO-OP ROUTINES ***
/
/*** .EJECT ***
/
.EJECT	SET EJCTSW		/SET SWITCH
	JMP PRPOP
/
/*** .OCT *** AND *** DEC
/
.OCT	SKP!CLA		/SET OCTAL RADIX
.DEC	CLC		/SET DECIMAL RADIX
	DAC RADIX
	JMP PRPOP
/
/*** .LOC ***
/
.LOC	SET LOCSW		/SET .LOC INDICATOR
	JMP SCNADR	/GET ITS VALUE
/
/*** .BLOCK ***
/
.BLOCK	SET BSSW		/SET .BLOCK INDICATOR 
	JMP SCNADR	/GET ITS VALUE
/
/***.DSA ***
/
.DSA	LAC FLDSW
	SNA
	SET NULOPF		/NULL OPFIELD
	JMP ENDFLD
/
/*** .SIZE ***
/
.SIZE	SET SZESW		/SET SIZE SWITCH
	JMP ENDALL
/
/*** .GLOBL ***
/
.GLOBL	JMS TMODE
	JMP OUTERR
	JMS ARGMNT
	JMP PRPOP
	JMP GLOBER	/NUMERICS ARE NOT ALLOWED.
	XCT PASSNO	/WHICH PASS
	SKP		/PASS 1
	JMP TGBEND
	JMS USTLKP		/SEARCH USER TABLE
	JMP GBFTB		/FOUND
	LAC SQZOUT+1	/NOT FOUND
	XOR LACLIT
	DAC SQZOUT+1	/SET SYMBOL EXTERNAL
	JMS MERGE		/MERGE INTO TABLE
	INC EXTCTR	/UPDATE EXTERNAL COUNT
	JMP TGBEND
GBFTB	JMS TSTUND	/UNDEFINED?	
	SKP		/NO
	INC EXTCTR	/YES
	LAC* MRGLOC
	AND L557S		/(577777)
	XOR LACLIT
	DAC* MRGLOC
TGBEND	JMS TKOM
	JMP .GLOBL+2	/GET NEXT SYMBOL
GLOBER	JMS ERRORS
	JMP TGBEND
/
/
/TEST SYMBOL, IF UNDEFINED SUBTRACT 1 FROM
/COUNT.
TSTUND	0
	INC MRGLOC	/POINT TO WORD2
	LAC* MRGLOC
	AND JMPLIT
	SZA
	JMP* TSTUND
	INC TSTUND
	JMS SUB1		/SUB 1 FROM UND. COUNT.
	DAC UNDCTR
	JMP* TSTUND
/
/
.EOT	SET EOTSW
	.IFDEF %MACI
	DZM TSWCH
	.ENDC
	XCT PASSNO		/WHICH PASS
	JMP .+3
	JMS PRTCOM		/PRINT .EOT
	JMS EJECT			/SKIP TO HEAD OF FORM
	.IFUND %MACI
	LAC BNOPTN		/BINARY REQUESTED
	SZA			/NO
	JMS WAIT13		/.WAIT FOR BINARY OUTPUT DEVICE
/
/TYPE EOT MESSAGE
/
	CAL+2775
	11
MOD26	EOTMSG
LITNO	472360
/
	LAC AD05		/NEWTAP
EOTMSG	DAC POWA
	JMP POW
	.ENDC
	.IFDEF %MACI
	JMS TTYOUT
	EOTMSG-2
	CLC
	DAC NOIN2
	JMP READ1A
EOTMSG=.
	.ENDC
	.ASCII	/ EOT/<15>
/
/
.ENDC	LAC CONDSW	/ANY IFS OUTSTANDING
	SNA		/YES
	JMP PRPOP		/IGNORE
	ISZ IFCTR		/.IF COUNT SATISFIED
	JMP PRPOP		/NO
	DZM CONDSW	/RESET CONDITIONAL SWITCH
	JMP PRPOP
	.ENDC
TXTBF	.BLOCK 32		/26 (10) LOCATIONS ALLOCATED FOR TEXT
/
/
/
/THE MACRO-15 TEXT TYPES ARE 5/7 ASCII (.ASCII) OR STRIPPED SIXBIT
/CHARACTERS (.SIXBT). THE TYTYP SWITCH IS USED TO DETERMINE THE DATA
/TYPE; 0=SIXBT, NON 0=ASCII. THE FIRST LEGAL TEXT CHARACTER
/AFTER THE INITIAL TAB OR SPACE IS USED AS THE STRING DELIMITER,
/AND IS NOT PACKED.
/AFTER A STRING HAS BEEN DELIMITED, IF A SPACE, TAB, OR A CR IS
/ENCOUNTERED THE PROGRAM LEAVES TEXT MODE. CHARACTER STRINGS
/ARE ALWAYS TIED TOGETHER (I.E.  /ABC/'D'/K/ LOOKS LIKE
/'ABCDK'.
/
/
/
.ASCII	SET TXTYP		/SET TEXT TYPE FOR 5/7 ASCII
	LAC CMDPAK	/INSERT THE JMS PACK57 CALL.
	JMP TXTCOM	/JUMP TO THE TEXT HANDLING COMMON AREA.
.SIXBT	DZM TXTYP		/SET TEXT TYPE FOR STRIPPED SIXBIT TEXT.
	LAC SIXPA		/INSERT THE JMS PACK CALL.
TXTCOM	DAC PKXXX
	DZM BRKSW		/CLEAR PREV CHAR DELIMITER SWITCH.
	LAC AD09		/SET UP BUFFER POINTER FOR BOTH POINTERS.
	JMS P6INT		/ALWAYS POINTS TO THE TOP OF TXTBUF(SIXBT)
	JMS P57INT	/INITIALIZE 5/7 ASCII PACKER.
	LAC AD13		/CLEAR OUT THE TEXT BUFFER.(TXTBUF-1)
	JMS ZEROIT
	-32
	JMS CKSCR		/IF THE FIRST CHAR IS A CR OR ;
	JMP PRPOP		/DELIMIT THE TEXT MODE.
/USE THE SUBROUTINE CKV15 TO GET A TEXT CHAR AND TO DETERMINE
/WHETHER OR NOT THE CHAR WAS LEGAL TEXT OR A CR. A CR ALWAYS
/TERMINATES TEXT INPUT MODE. AN ILLEGAL CHAR IS IGNORED AND DOES
/NOT CHANGE CHAR COUNTERS, BUT DOES CAUSE THE 'S' FLAG
/TO BE OUTPUT.
/
TXTOP	JMS CKV15		/DO NOT RETURN IF CR.
	SAD LEFTAB	/IF ITS A LEFT ANGLE BRACKET, TREAT
	JMP TXTRAW	/SUBSEQUENT CHARACTERS AS RAW NUMBERS.
	DAC DLMTR		/NO..SAVE IT AS A DELIMITER.
/
/GET MORE CHARACTERS AND COMPARE THEM TO THE DELIMITER. IF ITS
/EQUAL TURN ON THE PREV CHAR DELIMITER SWITCH AND RESET FOR
/RECEIVING MORE TEXT.
/
TXTLUP	DZM BRKSW		/ALWAYS TURN OFF SWITCH.
	JMS CKV15		/GET THE NEXT LEGAL TEXT CHAR.
	SAD DLMTR		/IS IT THE DELIMITER?
	JMP TXTDEL	/YES..TURN ON BRKSW.
PKXXX	XX		/PACK THE CHAR AND GET THE NEXT.
	JMP TXTLUP	/
/A LEFT ANGLE BLACKET HAS BEEN ENCOUNTERED. RAW TEXT
/FOLLOWS. THE TEXT MUST BE NUMBERS IN THE RANGE 260-267
/OCTAL. IF IT IS OUTSIDE THIS RANGE, THE 'N' FLAG IS OUTPUT
/AND ERRONIOUS RESULTS ARE SURE TO FOLLOW. IN ANY CASE USE
/ONLY THE HIGH-ORDER 3 BITS.
/
TXTRAW	DZM ANGLVL	/ANGLE BLACKET EVALUATION.
	JMS CKV15
	SAD RITEAB	/RIGHT ANGLE BRACKET?
	JMP TXTRAB	/YES..STORE ANGLVL IN CHRHLD.
	JMS CKNUM		/IS IT IN THE RANGE 260-267 OCTAL?
	SKP		/YES..TEST FOR 261 OR 262.
	JMS ERRORN
	AND L10
	SZA		/NO..ITS OK.
	JMS ERRORN	/YES ITS 8 OR 9, FLAG THE LINE.
	LAC CHRHLD	/KEEP ONLY 3 BITS.
	AND L7
	DAC CHRHLD
/
/IF MORE THAN THREE NUMBERS ARE USED, ONLY THE RIGHT MOST
/THREE ARE CONSIDERED. THE RIGHT MOST BITS ARE ALWAYS
/ANDED OFF TO PREVENT A GARGAGE CHAR IF MORE THAN
/6 NUMBERS APPEAR BETWEEN ANGLE BLACKETS.
/
	LAC ANGLVL	/VALUE BUILT SO FAR
	RCL
	RTL
	AND L570S		/DROP RIGHT MOST BITS (IN CASE OF WRAPAROUND).
	XOR CHRHLD	/(777770)
	DAC ANGLVL
	JMP TXTRAW+1	/GET THE NEXT NUMBER.
/
/
/
TXTRAB	LAC ANGLVL
	DAC CHRHLD
	XCT PKXXX		/PACK THIS CHAR.
TXTDEL	SET BRKSW		/SET THE PREV CHAR DELIMITER SWITCH.
	LAC ADTXT	/FUDGE RETURN ADDRESS OF TEXT CHECKER.
	DAC CKV15		/(TXTOP+1)
	JMS GETCHR
	JMS CKSPTB
	JMP TXTDON
	JMP CKV15+2
	JMP TXTOP		/GET A NEW DELIMITER SET.
/
/THE TEXT LINE HAS BEEN DELIMITED. NO MORE TEXT EXITS ON
/THIS LINE. COMPUTE THE # OF BUFFER WORDS USED TO PREPARE
/FOR OUTPUTTING THEM. TAKE THE TOP OF THE BUFFER AND
/SUBTRACT THE LAST WORD USED IN THAT BUFFER FOR PACKING THE
/CHARS. IF THE MODE IS ASCII AND THE CHAR COUNT IS 0,
/THE BUFFER POINTER MAY BE ONE MORE THAN NECESSARY.
/
TXTDON	LAC TXTYP		/WHAT TYPE OF TEXT?
	SNA!CLA		/ASCII
	JMP TXTSIX	/SIXBT
	SAD CTR57		/IS 5/7 CTR 0?
	JMP TXTC0		/YES..IT MAY BE NECESSARY TO SUBTRACT.
TXTASC	JMS TXTGNM	/GET THE TEXT NUMBER.
	TAD PK57AD	/ARG1
	AND LAWM2		/ARG2
TXTSIX	JMS TXTGNM	/GET THE NUMBER OF SIXBIT WORDS
	TAD PKLOC		/AR1
	NOP		/AR2
TXTC0	LAC PK57AD	/HAVE ANY ASCII CHARACTERS
	SAD AD09		/BEEN PACKED?
	JMP TXTASC	/NO..SET UP 0 TEXT COUNT
	TAD LAWM1		/YES..SUBTRACT I FROM THE POINTER.
	DAC PK57AD
	JMP TXTASC
/
/TEXT SUBROUTINE TO GET A 5/7 ASCII TEXT INPUT CHARACTER
/AND EXAMINE IT FOR A CR AND TEXT VALIDITY. IF THE CHAR
/IS A CR THIS ROUTINE IS TERMINAL. IF THE CHAR IS INVALID
/TEXT THE 'S' FLAG IS OUTPUT AND THE CHAR IS IGNORED.
/
CKV15	0
	JMS GETCHR
	SAD L15
	JMP TXTDON	/TERMINATE IF CR.
	TAD CMDC		/(-40
	SPA
	JMP NTVLD
	LAW -140
	TAD CHRHLD
	SPA
	JMP CKVLDA
NTVLD	JMS ERRORS	/
	JMP CKV15+1	/GET NEXT CHAR.
CKVLDA	LAC CHRHLD
	JMP* CKV15
/
/
/
TXTGNM	0
	LAC AD13		/TXTBUF-1
	JMS TWOS
	XCT* TXTGNM
	JMS TWOS
	ISZ TXTGNM
	XCT* TXTGNM	/(NOP) OR (AND (777776)
	DAC TXTCTR
	DAC TEXTSW
	SNA		/ANY TEXT PACKED?
	JMP PRPOP		/NO..TREAT AS A COMMENT.
	JMP ENDALL	/YES..OUTPUT THE TEXT.
/***.IODEV***
/THE IODEV PSEUDO OP CAN ONLY BE USED IN A RELOCATABLE
/PROGRAM. IT IS FLAGGED (I) AND IGNORED OTHERWISE.
/THE ARGUMENTS MAY BE NUMERIC OR ALPHANUMERIC. IF ITS
/ALPHA THE SYMBOL MUST BE A DIRECT ASSIGNMENT.
/
/
.IODEV	JMS TMODE	/WHAT MODE?
	JMP OUTERR	/.ABS OR .FULL, IGNORE PSEUDO-OP.
	DZM OPRTR
	JMS ARGMNT
	JMP PRPOP	/NO ARGS.
	JMP IODOK		/NUMERIC ARGUMENT.
	JMS PSALPH	/ALPHA ARGUMENT.
	JMP IODEND	/SYMBOL NOT FOUND
IODOK	AND L37S
	DAC LLBWRD
	LAC L26
	DAC LLCODE
	JMS BLDLLB
IODEND	JMS TKOM
	JMP .IODEV+2
/
/
/
PSALPH	0
	JMS USTLKP	/LOOK UP IN USER TABLE
	JMP PSAFND	/FOUND
	XCT PASSNO
	SKP
	JMP PSAERP
	JMS MERGE
	INC UNDCTR
	JMP PSAOK1
PSAERP	JMS ERRORP
	JMS ERRORA
	JMP* PSALPH	/SYMBOL NOT FOUND
PSAFND	LAC* MRGLOC
	SMA		/IS IT A DIRECT ASS?
	JMP PSAERP+1
	JMS WRD3
	LAC* MRGLOC
	DAC NUMBR
	JMS SETNUM
PSAOK1	INC PSALPH
	JMP* PSALPH
/
/
/
/***.REPT***
/THE .REPT PSEUDO-OP CAN HAVE TWO ARGUMENTS. ANYTHING
/AFTER THE SECOND ARGUMENT THAT IS NOT A LINE DELIMITER
/WILL BE IGNORED AND WILL CAUSE A Q-ERROR.
/IF THE ARGUMENT IS A SYMBOL IT MUST BE A DIRECT
/ASSIGNMENT.
/
.REPT	JMS .REPTA
	SPA		/IF FIRST ARG IN NEG THE
	JMP REPTER	/USER IS CONFUSED.
	DZM RPTINC	/CLEAR INCREMENT CONSTANT.
	LAC NUMBR
	SNA		/IF 0 IGNORE THE LINE.
	JMP PRPOP
	JMS TWOS
	DAC RPTCTR
.REPTC	SET RPTSW
	JMS .REPTA
	DAC RPTINC
	JMP PRPOP		/SCAN TO END OF LINE
REPTER	DAC RPTCTR
	JMS ERRORQ
	JMP .REPTC
/
.REPTA	0
	JMS ARGMNT	/ARGUMENT SCANNER.
	JMP PRPOP		/NO ARGUMENTS.
	JMP* .REPTA	/NUMERIC ARGUMENT.
	JMS PSALPH	/ALPHA ARGUMENT
	CLA		/ALPHA ARG NOT FOUND
	JMP* .REPTA
/IF THE ARGUMENT WAS PRECEDED BY A MINUS SIGN
/NEGATE THE NUMBER.
/
SETNUM	0
	LAC OPRTR
	SAD L55
	JMP SETNMA
	LAC NUMBR
	JMP* SETNUM
SETNMA	LAC NUMBR
	JMS TWOS
	DAC NUMBR
	JMP* SETNUM
/
/
/
TKOM	0
	LAC CHRHLD
	SAD KOMMA
	JMP* TKOM
	JMP PRPOP
/
/
/
/SUBROUTINE TO SCAN A LINE IN ORDER TO PICK UP ARGUMENTS.
/ARGUMENTS ARE SEPARATED BY COMMAS AND DELIMITED BY
/A SPACE, TAB, SEMICOLON OR CR. CURRENTLY CHRHLD HAS THE
/CHAR WHICH DELIMITED THE ARGUMENT TAKING PSEUDO-OP.
/CALLING SEQUENCE:	JMS ARGMNT
/		JMP SOMEWHERE	/NO ARGUMENTS
/		JMP SOMEWHERELSE	/NUMERIC ARG
/					/SYMBOL IN ARG
/
ARGMNT	0
	JMS CKSCR		/WAS PSEUDO-OP DELIMITER A LINE DELIMITER.
	JMP* ARGMNT	/YES...EXIT, NO ARGUMENTS.
ARGMNA	JMS GETCHR		/IGNORE TABS AND SPACES.
	JMS CKSPTB
	JMP ARGMNA
	SET BYPASS			/SET FIRST CHAR-IN SWITCH.
ARGMNB	JMS CHRLKP	/TEST NEXT TEXT CHAR FOR LINE DELIMITER.
	027775
	JMP* ARGMNT	/YES..EXIT, NO ARGUMENTS.
ARGMOR	JMS CLEARS	/CLEARS SWITCHES
	JMS SYMCHR
	LAC LCOUNT	/ANY LEGAL CHARS?
	SZA		/NO
	JMP ARGMIN	/YES..CHECK FOR NUMERICS.
	JMS CHRLKP
	057776		/CHECK FOR + OR -
	SKP		/YES..SET OPERATOR.
	JMP ARGQES	/ARGUMENT ERROR, UNRECOGNIZABLE CHAR.
	DAC OPRTR
	JMP ARGMOR	/KEEP SCANNING
ARGQES	SAD L77		/CHECK CHAR FOR ? QUESTION MARK.
	SKP
	JMP ARGSE		/ERROR
	LAC DFNSW		/MACRO DEFINITION SWITCH MUST BE ON
	SNA		/FOR THIS CHAR TO BE ACCEPTABLE.
	JMP ARGSE
	LAC XCTLIT
	DAC CSBSW		/SET CREATE SYMBOL SWITCH.
	JMP ARGMOR
ARGSE	JMS ERRORS		/FLAG THE LINE AND GET NEXT ARG.
	JMP ARGMOR
/
/A STRING OF CHARACTERS HAVE BEEN PROCESSED AND ARE
/LIVING IN PACKS AND PACKS+1. THE STRING MAY BE ALPHA
/OR ALPHANUMERIC. IF THE FIRST CHAR IS NUMERIC THEY
/MUST ALL BE NUMERIC. IF THE STRING TERMINATOR IS AN
/ILLEGAL CHAR, FLAG THE LINE AND CONTINUE WITH THE
/LEGAL STUFF IN PACKS AND PACKS+1.
/
ARGMIN	JMS CHRLKP	/LEGAL TERMINATOR.
	007774
	JMP ARGTOK	/TERMINATOR OK.
	SAD KOMMA
	SKP
	JMS ERRORS	/ILLEGAL CHAR TERMINATED STRING.
ARGTOK	LAC CHAR1		/IS IT A NUMERIC STRING?
	SNA		/YES..MAKE SURE ALL NUMBERS.
	JMP ARGALP	/ALPHA STRING. EXIT.
	LAC VARSW		/MAKE SURE VARIABLE SWITCH IS NOT ON.
	TAD ALPCIN
	SZA
	JMP ARGNER	/ERROR
	JMS NUMEVL	/CONVERT TO BINARY.
	JMS SETNUM
	JMP ARGALP+1	/NUMERIC ARG RETURN
/
ARGNER	JMS ERRORN
	JMP ARGMNB	/STILL NO ARGUMENTS
/
ARGALP	INC ARGMNT	/ALPHA RETUTN
	INC ARGMNT	/NUMERIC RETURN/
	JMP* ARGMNT
	.EJECT
/THESE SIX PSUEDO-OPS CANNOT BE USED IN ALL CASES.
/THE ABSOLUTE (INCLUDES .FULL(P)) PSUEDO-OPS CANNOT
/APPEAR ANYWHERE IN A PROGRAM OTHER THAN BEFORE
/ANY LOCATION PRODUCING CODE.  I.E., THE PSUEDO PC
/MUST BE ZERO WHEN THESE ARE ENCOUNTERED.
/
/THE TWO RELOCATABLE PSUEDO-OPS (.EBREL, DBREL)
/CANNOT APPEAR ANYWHERE IN AN ABSOLUTE OR FULL
/PROGRAM.
/IN ALL ERROR CASES, THESE PSUEDO-OPS ARE IGNORED
/
.ABS=.
	.IFUND %PDP9
	LAC	K10000		/PDP-9 MODE (13-BIT ADDRESSING)
	DAC	PDP9SW
	SKP
.ABSP	DZM	PDP9SW		/PDP-15 MODE (12-BIT ADDRESSING)
	.ENDC
	JMS	CKPC0		/MAKE SURE THE PC IS 0
	LAC	L1		/(0=PDP15 MODE, NOT 0=PDP9 MODE)
	DAC	BMODE		/SET OUTPUT MODE TO .ABS(9) BINARY(1).
/THE POSITION OF THE .ABS(9) PSUEDO-OP IN THE PROGRAM
/HAS BEEN ACCEPTED.  IF THIS IS PASS 2 SCAN THE OPERAND
/FIELD FOR THE -NLD=OPTION.  IF ITS PASS1 IGNORE THE POSSIBLE
/OPTION AND GET THE NEXT LINE.
/IF IT IS PASS2 AND THEIR IS AN OPERAND AND
/IT DOES NOT EQUAL -NLD- ,FLAG THE LINE (S-ERROR)
/AND PUNCH THE LOADER AHEAD OF THE PROGRAM
/ANYWAY.
/
	XCT	PASSNO		/(SKP OR NOP)
	JMP PRPOP		/PASS1-IGNORE OPERAND
	.IFUND %PDP9
	.IFUND %MACI
	JMS ABSLOD
	.ENDC
	.ENDC
	JMS ARGMNT		/SCAN THE OPERAND FIELD.
	JMP PNCHLD		/RETURN HERE IF NO OPERAND.
	JMP ABSERO
	LAC PACKS		/RETURN HERE AFTER ARG SCAN.
	TAD	PACKS+1		/IF THE OPERAND IS NLD DO NOT
	SAD	(161404		/PUNCH A LOADER.  IF ITS NOT
	JMP	PRPOP		/FLAG THE LINE AND PUNCH
ABSERO	JMS	ERRORO		/THE LOADER ANYWAY.
	JMP	PNCHLD
/
/
.FULL=.
	.IFUND %PDP9
	SET PDP9SW		/PDP-9 MODE (13-BIT DIRECT ADDRESSING)
	SKP
.FULLP	DZM PDP9SW		/PDP-15 (12-BIT DIRECT ADDRESSING)
	.ENDC
	JMS	CKPC0		/MAKE SURE PC IS 0
	LAC	L2		/PC IS OK.
	DAC	BMODE		/SET OUTPUT MODE TO .FULL
	JMP	PRPOP		/BINARY (2).
/
/
/THESE TWO PSUEDO-OPS CAN BE USED ANYWHERE IN A
/RELOCATABLE PROGRAM, BUT NOWHERE IN AN ABSOLUTE
/OR FULL BINARY PROGRAM. THE .EBREL PSUEDO-OP CAUSES
/A WORD HAVING A L.LOADER CODE OF 31 TO BE OUTPUT
/THE RELOCATABLE BINARY PRODUCING SUBROUTINE.  THE
/.DBREL CAUSES A L.LOADER CODE OF 32 TO BE OUTPUT.
/THE CODES (31-13 BIT:32-12 BIT) TELL THE LINKING LOADER
/HOW TO RELOCATE OPERAND.  IN BOTH CASES THE DATA WORD
/IS IGNORED.
/THESE PSUEDO-OPS ALSO CAUSE A SOFTWARE SWITCH TO BE
/SET. (DIRASW).  THIS SWITCH IS LATER USED (IN ROUTINE WRDEVL)
/TO DETERMINE IS 13 BIT ADDRESSES SHOULD BE FLAGGED OR NOT.
/
	.IFUND %PDP9
.EBREL	SET PDP9SW		/PDP-9 MODE(13-BIT DIRECT ADDRESSING)
	LAC	L31
	JMP	LLSETM
.DBREL	DZM	PDP9SW		/PDP-15 MODE(12-BIT DIRECT ADDRESSING)
	LAC	L32
LLSETM	DAC	LLCODE		/SET L.LOADER MODE
	JMS	MODETR		/IF THE OUTPUT MODE SWITCH IS
				/NOT 0, IGNORE THIS PSUEDO-OP.
	JMP .RELOK		/(OUTPUT MODE:0=REL, 1=.ABS, 2=.FULL).
	.ENDC
OUTERR	JMS ERRORI		/SET ERROR FLAG AND IGNORE
	JMP PRPOP		/THIS PSUEDO OP
	.IFUND %PDP9
.RELOK	LAC PDP9SW		/SET THE DIRECT ADDRESSING
	DAC DIRASW		/SWITCH.
	DZM LLBWRD		/CLEAR THE LL DATA WORD
	JMS BLDLLB		/TELL L.LOADER TO START OR STOP
	JMP PRPOP		/RELOCATING 13-BIT ADDRESSES.
	.ENDC
/
/THE PSUEDO PROGRAM COUNTER MUST BE ZERO TO
/BE ACCEPTABLE BY ANY OF THE FOUR ABSOLUTE
/PSUEDO-OPS.  IF THE PC IS NOT 0 DON'T EVEN
/BOTHER TO RETURN, GO IMMEDIATELY TO THE PSUEDO-OP
/PRINT AND SCAN AREA.
/
CKPC0	0
	LAC PC		/IF THE PC IS NOT 0
	SZA			/DO NOT ACCEPT IT.
	JMP OUTERR
	DZM SYMTYP
	.IFUND %PDP9
	LAC	PDP9SW		/PC IS OK, SET THE DIRECT
	DAC	DIRASW		/ADDRESSING MODE SWITCH.
	.IFUND %MACI
	SZA
	JMP	.+3
	LAC	DBALIT
	SKP
	LAC	EBALIT
	DAC LODMOD
	.ENDC
	.ENDC
	JMP* CKPC0
/
/PUNCH THE .ABS LOADER
PNCHLD=.
	.IFUND %MACI
	LAC BNOPTN	/WAS A BINARY REQUESTED?
	SNA!CLC		/YES
	JMP PRPOP	/NO
	AND BBFSIZ	/IF THE OUTPUT BUFFER SIZE
	SMA		/INDICATES DECTAPE DO NOT PUNCH.
	JMP PRPOP
/
	CAL+4765		/PUNCH LOADER DUMP MODE
	11
MOD27	BINLDR
	ENDLDR-BINLDR\777777+1	/2'S W/C
	CAL+3765
	11			/PUNCH HRI WORD
MOD28	HRMWD
	-6
	.ENDC
	JMP PRPOP			/PRINT PSEUDO OP
ABXEXT	.SIXBT /ABS/
/
/
/
/
/
/*** .IF ***
/
.IFZER	LAC LSZA		/ZERO
	JMP IFA
.IFPNZ	LAC .IFK01	/POSITIVE AND NON ZERO
	JMP IFA
.IFPOZ	LAC LSPA		/POSITIVE OR ZERO
	JMP IFA
.IFNEG	LAC LSMA		/NEGATIVE
	JMP IFA
.IFNOZ	LAC LSZMA		/NEGATIVE OR ZERO
	JMP IFA
.IFNZR	LAC LSNA		/NON ZERO
	JMP IFA
.IFDEF	LAC LSZA		/DEFINED
	SKP
.IFUND	LAC LSNA		/UNDEFINED
	DAC CNDTN
	LAC KON002	/INIT TO PICK UP DEF IND
	JMP IFC-1
IFA	DAC CNDTN
	LAC KON001	/PICK UP VALUE
	DAC VALDEF
IFC	LAC CONDSW	/CONDITIONALIZED SECTION
	SNA!CLC		/YES
	JMP IFE
	TAD IFCTR		/UPDATE IF COUNTER
	DAC IFCTR
	JMS SCNEND
	DZM FLGWD		/CLEAR FLAG WORD
	JMP PRPOP
IFE	ISZ IFSW
	JMP SCNADR	/GET EXPRESSION
/
/RETURN FROM EXPRESSION EVALUATION
/
IFRET	DZM IFSW
VALDEF	XX		/LAC FLDVAL OR NCD
CNDTN	XX		/SMA,SPA,SZA,ETC
	SKP!CLC		/CONDITION NOT SATISFIED
	JMP PRPOP
	DAC IFCTR
	SET CONDSW	/SET CONDITIONAL SWITCH
	JMP PRPOP
/
/
/
/
/***** .TITLE *****
/THE TITLE PSEUDO-OP CAUSES A TOP OF FORM CHARACTER TO BE
/OUTPUT TO THE LISTING DEVICE.  THE PAGE COUNT IS INCREMENTED
/AND THE FIRST 40 CHARS ARE USED AS THE NEW TITLE.
/
.TITLE	XCT PASSNO		/WHICH PASS
	JMP PRPOP
	LAW -50		/DO NOT PACK MORE THAN 50 (OCTAL) CHARS.
	DAC TITCNT
	LAC ADTITX
	JMS P57INT
	JMS TSTC15	/IF THE .TITLE (DELIM) WAS A CR
	JMP TITDON	/TO THE END OF TITLE ROUTINE.
TITLUP	JMS GETCHR	/PACK THE CHARS UNTIL 40(10) HAVE BEEN
	SAD L15		/PACKED OR A CR IS ENCOUNTERED.
	JMP TITDON
	JMS PACK57
	ISZ TITCNT
	JMP TITLUP
/
/THE TITLE STRING HAS BEEN DELIMITED BY A ; , CR, OR 40 CHARS.
/MAKE SURE THAT A CR IS APPENDED TO THE LINE.
TITDON	JMS P57K15
	JMS EJECT	/PRINT THE HEADER ETC.
	JMP TAGCOM+2	/TREAT THE .TITLE LINE AS A COMMENT LINE.
/
/SUBROUTINE TO TEST FOR CURRENT CHAR BEING A CR.
/
TSTC15	0
	LAC CHRHLD
	SAD L15
	JMP* TSTC15
	ISZ TSTC15
	JMP* TSTC15
/
/
/
/
/
/PRINT THE PSEUDO-OP
/
PRPOP	JMS SCNEND 	/SCAN TO END OF LINE
	XCT PASSNO
	JMP NXWD
/PRINT THE SEQUENCE NUMBER (IF 'N' SWITCH) AND THE ERRORS
/FOR THIS LINE.  SSSSB,EEEEE, RDBUF=2 TABS. . BEFORE CALLING
/PRINT MOVE THE DATA DOWN TO THE TOP OF RDBUF AND
/ADJUST THE PRINT BUFFER POINTER.  THE DATA IN THE
/PRINT BUFFER IS STORED AS FOLLOWS:  RDBUF-4, RDBUF-3=
/DECIMAL SEQUENCE NUMBER.  RDBUF-2, RDBUF-1=ERRORS.
/RDBUF, RDBUF+1=2 TABS AND 0 FILLER.
/
	JMS PRTCOM
	LAC .NLSW		/.NOLST SWITCH?
	SZA		/YES
	DZM ALOPTN	/CLEAR LISTING SWITCH
PRPOPA	LAC EJCTSW
	SZA
	JMS EJECT
	DZM EJCTSW
NXWD	JMP CKMWD1	/TEST CR FOR GOING TO NEXT LINE
/
/SUBROUTINE TO PRINT A COMMENT LINE, OR A LINE THAT
/IS TREATED AS A COMMENT.E.G. MACRO DEFINITIONS.
/THE LINE MAY REQUIRE A SEQUENCE NUMBER. IF S0 THE 5/7
/PACKING SUBRIUTINES ARE UD;SED. THE CRITICAL POINTERS AND
/COUNTERS MUST BE SAVED SO THEY CAN BE RESTORED AFTER 
/THE 5/7 ROUTINE FOR PACKING AN OUTPUT LINE ARE FINISHED.
/
PRTCOM	0
	XCT PASSNO
	JMP* PRTCOM	/PASS1 DONT PRINT ANYTHING.
	LAC AD666
	JMS SEQERF
	JMS P57TAB	/2 TABS TO RDBUF
	JMS P57TAB
	LAW -5
	JMS SPACKS
	JMS OUT3EX
	JMS SHRINK
	TAD AD667
	JMP* PRTCOM
	.TITLE	END OF PASS CODE.
.END=.
	.IFUND %MACI
	CAL+767		/.CLOSE THE SOURCE FILE
	6
	.ENDC
	XCT PASSNO	/WHICH PASS
	SKP		/PASS 1
	JMP ENDPS2 	/PASS 2
	LAC SYMTYP 
	SMA
	JMP .+2
	LAC LACLIT
	DAC SYMSAV 	/SAVE LAST RELOCATION IND
	LAC CHVPC		/CURRENT HIGH VALUE OF PC
	DAC VARLOC 	/VARIABLES STARTING LOCATION
	TAD VARCTR
	DAC UNDLOC 	/UNDEFINES STARTING LOCATION
	TAD UNDCTR
	DAC EXTLOC 	/V.T. STARTING LOCATION
	DAC EXTLC1
	TAD EXTCTR
	DAC LITLOC 	/LITERALS STARTING LOCATION
	TAD LITCTR
	DAC PRGSZE 	/PROGRAM SIZE
	LAC VARCTR 	/CHECK IF ANY VARIABLES,
	TAD UNDCTR 	/UNDEFINES OR EXTERNALS
	TAD EXTCTR 	/WERE ENCOUNTERED
	SNA
	JMP P1CMPL 	/PASS 1 COMPLETED
	LAC BEGUST
	DAC USTBEG	/LOWEST WORD OF SYMBOL TABLE
	LAC LITCTR
	JMS TWOS
	TAD USTSZE 	/SYMBOL TABLE SIZE - LITERAL
	JMS TWOS		/COUNT EQUALS NUMBER OF SYMBOLS
	DAC SZECTR
/
/COMPUTE VALUES FOR VARIABLES, UNDEFINES
/AND EXTERNALS
CVA	JMS SYM3
	JMS MACFST
	JMP CVE		/BYPASS P/A
	SKP		/NOT A MACRO
	JMP CVE		/BYPASS MACROS
	LAC* SWD2
	AND JMPLIT
	SZA 		/UNDEFINED
	JMP CVB
	LAC* SWD3
	AND IOTLIT
	XOR UNDLOC 	/UNDEFINED LOCATION VALUE
	DAC* SWD3
/
/PRINT UNDEFINED SYMBOL IN PASS 1
/
	JMS UNSQZE	/UNSQOZE THE SYMBOL
	LAW -6
	JMS MOVEPK	/MOVE AND PACK CHARS FROM
	LAC AD16		/UNSQZV-1 TO THE
	LAC AD09		/TEXT BUFFER TO P57INT
	JMS PKBLNK	/SPACE (PACK IT 5/7)
	LAW -5
	JMS MOVBIN	/BINARY TO OCTAL
	LAC UNDLOC	/UNDLOC AS INPUT
	JMS P57K15	/CR
	JMS PRTSOH
MOD29	TXTBF-1
L3	3
	JMS SUB2		/RESTORE USTBEG: C(USTBEG)=C(USTOEG)-2
	DAC USTBEG 	/IN UNSQOZE ROUTINE
	INC UNDLOC
	JMP CVC
CVB	SPA 		/EXTERNAL
	JMP CVD
	LAC* SWD3
	AND IOTLIT
	XOR EXTLC1 	/EXTERNAL LOCATION VALUE
	DAC* SWD3
	ISZ EXTLC1
	JMP CVC
CVD	LAC* SWD3
	SMA 		/VARIABLE
	JMP CVE
	AND IOTLIT
	XOR VARLOC 	/VARIABLE LOCATION VALUE
	DAC* SWD3
	INC VARLOC
CVC	LAC* SWD1
	AND L557S		/(577777)
	XOR SYMSAV	/LAST REL IND
	DAC* SWD1
CVE	ISZ SZECTR
	SKP
	JMP P1CMPL 	/FINISHED VALUE COMPUTING
	.IFUND %MACI
	.IFUND %PDP9
	XCT EXPAGE	/EXTRA PAGE?
	JMP PAGSYM	/YES
	.ENDC
	.ENDC
PG0003	JMS USTB2
	INC USTBEG
	JMP CVA
	.IFUND %MACI
/********************PASS 1 COMPLETED********************
/**********
P1CMPL	CAL+2775		/PRINT PASS 1 COMPLETED
	11
MOD30	PS1MSG
L377	377
/**********
	LAC AD37		/PASS2
	DAC POWA
POW	LAC EOTSW		/EOT ENCOUNTERED IN PROGRAM
	SZA		/NO
	JMP POWD		/WAIT FOR CONTROL P
	LAC POWB		/IF BULK STORAGE DEVICE
	SAD L377
	JMP* POWA		/CONTINUE, ELSE WAIT FOR
/**********
POWD	CAL+2775		/WRITE ^P
	11
MOD30A	CNTRLP
CNTRLP	-4
/**********
	JMP .		/WAIT FOR ^P
PS1MSG	.ASCII	/^P/<175>
	.LOC .-1
	.ENDC
L557S	577777
ENDPAS	.ASCII	/ END OF PASS 1/<15>
WRNMES	.ASCII	<12>/PROG/<76>/4K/<15>
	.IFDEF %MACI
P1CMPL	JMS TTYOUT
	ENDPAS-2
	JMP PASS2
	.ENDC
/
/
/
/
/
/********************END OF PASS 2********************
/
ENDPS2	SET ENDSW
	DZM ENDVAL
	DZM FLDVAL
	JMS TSTC15
	JMP ENDLNE
	JMP SCNADR+1 	/GET OPERAND VALUE
/
PREL	0
	SET STOPPER
	LAC AD222	/PRTBUF
	JMS SEQERF
	JMS PCIMAG	/PC IMAGE AND TYPE.
	JMS GOBJC		/OBJECT CODE - WRDVAL.
	JMS OUT3EX	/OUTPUT THE EXTENSION. *E
	JMS SHRINK
	TAD MOD33B
	JMP* PREL
/RETURN FROM .END ADDRESS SCAN
/
BKTEND	DZM ENDSW
	LAC ENDVAL
	SZA
	XOR JMPLIT 	/SET MINUS ADDRESS ALSO A JMP
	DAC ENDVAL
/
/PRINT AND OUTPUT EXTERNALS AND LITERALS
/
	LAC EXTLOC 	/CONTAINS START OF V.T.
	DAC WRDVAL
	DAC PC
	LAC EXTCTR 	/EXTERNAL COUNT
	SNA
	JMP LITOUT
	JMS TWOS
	DAC CTR1
	ISZ EXTSW		/SET EXTERNA SWITCH
	ISZ EXLTSW
	JMS TMODE
	JMP .+3
	JMS NEWLA		/OUTPUT NEW LOAD ADDRESS
	SKP
	JMS BLDBIN
NXEXT	JMS PREL	 	/GO TO PRINT ROUTINE
	JMS TMODE		/L/L OUT?PUT
	JMP ABSEXT
	LAC PC
	DAC LLBWRD	/PC IS DATA WORD
	LAC K4		/ABS
	DAC LLCODE
	LAC SYMTYP
LSPA	SPA
	ISZ LLCODE		/REL 15
	JMS BLDLLB
	SKP
ABSEXT	JMS BLDBIN	/BUILD BINARY OUTPUT
	ISZ PC
	ISZ WRDVAL
	ISZ CTR1
	JMP NXEXT 	/GET NEXT EXTERNAL
	JMS TMODE		/ABS OR REL
	JMP LITOUT-1	/ABS NO SYMBOLS
	LAC L2
	JMS GIVS		/OUTPUT EXT SYMBOLS
/
	DZM EXLTSW
/LITERAL OUTPUTTING AT END OF PASS 2
/
	DZM EXTSW
LITOUT	LAC LITCTR 	/LITERAL COUNT
	SNA
	JMP RSTRIT
	SET LITSW
	ISZ EXLTSW
	JMS TMODE
	JMS BLDBIN
	DZM EXLTSW
	JMS LITBEG 	/GET START OF LITERALS
	LAC CTR
	DAC CTR1 		/SAVE COUNT
	LAC* L10
	DAC* L12
	ISZ LASW
NXLIT	DZM AREL		/ABS
	JMS LL13		/13 BITS REL
	LAC* 12
	SZA
	ISZ AREL
	AND L1
	SNA
	DZM BITS		/15 BITS REL
	LAC* 12 		/GET LITERAL VALUE
	DAC WRDVAL
	JMS PREL	 	/GO TO PRINT ROUTINE
	JMS CKFLLB
	JMS BLDBIN 	/BUILD BINARY OUTPUT
	ISZ PC
	ISZ* L12
	ISZ CTR1
	JMP NXLIT 	/GET NEXT LITERAL
/
/
/
/
/PRINT THE SIZE AND ERROR LINE COUNT MESSAGES BEFORE
/OUTPUTTING THE SYMBOL TABLE.  IF THE OUTPUT DEVICE
/BUFFER ASSIGNED TO -12 IS EQUAL TO THAT OF -3, ONLY
/PRINT THE MESSAGE ONCE BECAUSE THE OUTPUT IS TO THE
/SAME DEVICE.
/
RSTRIT=.
	.IFUND %PDP9
	JMS TMODE		/DON'T CHECK THE SIZE IF ITS
	JMP SIZEOK	/A NON-RELOCATABLE PROGRAM.
	LAC PRGSZE	/HIGHEST LOCATION USED.
	AND (70000
LSNA	SNA
	JMP SIZEOK
	.IFUND %MACI
	CAL+2775		/SELECT -3 FIRST.
	11
MPMB01	WRNMES-2
L42	42		/CONSTANT STORAGE
	LAC MOD3A+1	/CHECK IF SAME DEVICE.
	SAD L42
	JMP SIZEOK	/YES..SET UP LAST LINE BEFORE
	JMS PRTSOH			/SYMBOL TABLE OUTPUT.
MPMB02	WRNMES-1
L6	6
	.ENDC
	.ENDC
/
/
	.IFDEF %MACI
	JMS TTYOUT
	WRNMES-2
	LAC DSWCH
	SNA
	JMP SIZEOK
	JMS PRTSOH
	WRNMES-1
	.ENDC
/BUILD THE LAST IMAGE LINE.
/THE SIZE (HIGHEST LOCATION) OF THE PROGRAM AND THE
/ERROR LINE COUNT ARE NEXT.
/
SIZEOK	LAC ADS0		/AREA FOR OCTAL SIZE IMAGE
	JMS P57INT
	LAW -5
	JMS MOVBIN
	LAC PRGSZE			/ARGUMENT TO BINOCT SUBROUTINE.
	LAC ERLNCT			/THE ERROR NUMBER IMAGE IS
	SZA				/NEXT. IF THE ARE NO ERRORS
	JMP ERRS1		/OUTPUT THE IMAGE  'NO'.
	LAC LITNO
	DAC ERNMBR
	DZM ERNMBR+1
	JMP ERRS2
ERRS1	JMS BINDEC			/DECIMAL ERROR LINE COUNT.
	LAC ERLNCT
	LAW -3
	JMS MOVEPK
	LAC AD24
	LAC AD38
ERRS2=.
	.IFDEF %MACI
	JMS TTYOUT
	ERRLIN
	.ENDC
	.IFUND %MACI
	CAL+2775		/PRINT SIZE AND ERRNO ON TTY.
	11
MPMB03	ERRLIN
L137	137
	LAC MOD3A+1			/TEST FOR SAME OUTPUT DEVICE.
	SAD L42
	JMP ERRS3
	JMS PRTSOH
MPMB04	ERRLIN-1
L175	175				/ALTMODE (USED AS CONSTANT)
	.ENDC
	.IFDEF %MACI
	LAC DSWCH
	SNA
	JMP ERRS3
	JMS PRTSOH
	ERRLIN-1
	.ENDC
ERRS3	SET ENDSW
	LAC BNOPTN	/BINARY REQUESTED
	SNA		/YES
	JMP ANPST
	JMS MODETR
	JMP ANPST 	/REL
	JMS BLDBIN
	DZM ENDSW
	.IFUND %MACI
	JMS WAIT13	/WAIT FOR PUNCH
	.ENDC
	LAC BMODE
	SAD L1
	JMP ABSEND 	/ABS OUTPUT
	.IFUND %MACI
	LAC ENDVAL 	/FULL OUTPUT
	AND L147S		/13 BIT ADDRESS
	SZA
	JMP FULL1
	LAC HLTLIT
	SKP
FULL1	XOR JMPLIT
	DAC ENDVAL
	LAC AD17		/ENDVAL
	JMS UP6INT
	LAC AD34		/FULHRW+1
	DAC* L10		/OUTPUT AREA
	LAW -2
	DAC CTR
FULL2	JMS UNPACK	/PICK UP 6 BITS
	XOR L200
	DAC* 10
	ISZ CTR
	JMP FULL2
	JMS UNPACK
	XOR (300		/HRI WORD
	DAC* 10
	DZM PRVCHR
	JMS NULFRM
	CAL+3765		/WRITE THE HRI WORD
	11
MOD31	FULHRW
	-6
/
	.ENDC
	JMP ANPST
FULHRW	003500
ALPCIN	0		/USE AS TEMP STORAGE
LCOUNT	0
CHAR1	0
LKAHED	0
PRVCHR	0
/
ABSEND	LAC ENDVAL
	SNA!CLC
	DAC ENDVAL
	.IFUND %MACI
	JMS NULFRM
	CAL+4765		/PUNCH DUMP MODE
	11
MOD31A	ENDVAL
	.ENDC
	.IFDEF %MACI
	JMS DWRITE
	XCT ENDVAL
	.ENDC
	-2
/
/
/ALPHA AND NUMERIC PRINTOUT OF SYMBOL TABLE
/ALPHA:
/
	.ENDC
ANPST	SET STOPPER	/CR IN MULTIWORD STOPPER
	SET STPSW
	LAC ALOPTN
	SNA		/IF NO LISTING
	DZM PGCTR		/RESET PAGE NO.
	LAC ASWCH		/SYMBOLS
	DAC ALOPTN	/FOR PRINT RTNE
	JMS GBST		/GET START OF S/T
	JMP ALFNXB	/NO SYMBOLS
	JMS EJECT
ALFNX	JMS TMODE
	JMP ALFNXA
	JMS LLSTBL
	0
ALFNXA	JMS BPSMB 	/BUILD AND PRINT SYMBOL
	ISZ USTBEG
	JMS CKEST 	/CHECK FOR END OF TABLE
	SKP 		/FOUND
	JMP ALFNX 	/GET NEXT SYMBOL
ALFNXB	LAC BNOPTN	/BINARY REQUESTED
	SNA		/YES
	JMP ALFNXD	/NO
	JMS TMODE		/WHAT TYPE OUTPUT
	JMP ALFNXC
	LAC ENDVAL		/.END VALUE
	AND L147S		/13 BIT
	DAC LLBWRD
	LAC L27			/END CODE
	DAC LLCODE
	JMS BLDLLB		/L/L BINARY ROUTINE
	.IFUND %MACI
ALFNXC	JMS WAIT13		/WAIT FOR BINARY
	CAL+765		/CLOSE BINARY
	6
/
/
/
/
/
	.ENDC
	.IFDEF %MACI
ALFNXC	JMS DCLOSE
	.ENDC
ALFNXD	LAC VSWCH		/NUMERIC SEQUENCE, (VALUE SEQUENCE).
	DAC ALOPTN
	SNA
	JMP EOJ
/
/NUMERIC PRINTOUT, VALUE SEQUENCE OF SYMBOL TABLE.
/
/SORT SYMBOL TABLE INTO VALUE SEQUENCE.
/PRINT MACROS AS THEY ARE ENCOUNTERED
/AND IGNORE THEM LATER.
	JMS GBST
	JMP EOJ		/NO SYMBOLS
	JMS EJECT 	/EJECT A PAGE
	DZM NUMVAL
	LAC BEGUST
	DAC USTBEG
NUMNXH	JMS SYM3
	JMS MACFST	/PICK UP SYMBOL AND TEST IT
	JMP NUMNXJ	/P/A
	JMP NUMNXJ		/NOT A MACRO
	JMS BPSMB		/PRINT SYMBOL-MACRO
SKPLIT	SKP
NUMNXJ	JMS USTB2
NUMNXK	INC USTBEG		/UPDATE TABLE POSITION
	JMS CKEST		/END OF TABLE
	SKP		/YES
	JMP NUMNXH		/GET NEXT SYMBOL
NUMNXF	LAC BEGUST 	/RESET TO BEGINNING
	DAC USTBEG 	/OF TABLE
	CLC
	DAC NXHVL 	/NEXT HIGHER VALUE
NUMNXB	JMS SYM3
	JMS MACFST 	/PICK UP THE SYMBOL AND TEST IT
	JMP NUMNXA	/P/A
	SKP		/NOT A MACRO.
	JMP NUMNXD	/BYPASS THIS MACRO.
	LAC TMP
	AND L57S
	DAC TMP
NUMNXA	LAC NUMVAL 	/COMPARE CURRENT NUMBER
	SAD TMP 		/AGAINST SYMBOL VALUE
	JMP NUMNXC
	JMS TRC 		/COMPARE SYMBOL VALUE
	LAC TMP 		/AGAINST NEXT HIGHER VALUE
	LAC NXHVL
	SKP 		/S/V < NXHVL
	JMP NUMNXD 	/S/V > NXHVL
	JMS TRC 		/COMPARE S/V AGAINST NUMVAL
	LAC TMP
	LAC NUMVAL
	JMP NUMNXD 	/S/V < NUMVAL
	LAC TMP 		/S/V > NUMVAL
	DAC NXHVL
NUMNXD	JMS USTB2		/UPDATE TABLE LOCATION
NUMNXG	INC USTBEG
	JMS CKEST 	/END OF TABLE
	JMP NUMNXE 	/YES
	JMP NUMNXB 	/NO, GET NEXT
NUMNXC	JMS BPSMB 	/BUILD AND PRINT SYMBOL
	JMP NUMNXG
NUMNXE	LAC NXHVL 	/IF CURRENT VALUE
	SAD NUMVAL 	/=NEXT HIGHER VALUE
	JMP EOJ		/EXIT
	DAC NUMVAL
	JMP NUMNXF
/
/
MACFST	0
	LAC* SWD1
	SPA		/PA?
	JMP MACPA		/YES..EXIT
	ISZ MACFST
	LAC* SWD3		/MACRO?
	AND JMSLIT
	SZA
	ISZ MACFST	/YES
MACPA	LAC* SWD3
	DAC TMP
	JMP* MACFST
EOJ=.
	.IFUND %MACI
	CAL+766		/CLOSE LISTING
	6
	.ENDC
	.IFDEF %MACI
	LAC DSWCH
	SZA
	JMS DCLOSE
	.ENDC
/
/************ END OF ASSEMBLY ************
/
EOJ1	LAC BATCH		/MORE ASSEMBLES
	SZA		/NO
	JMP PASS1		/YES
	.IFUND %MACI
L775	CAL+775
	6
	CAL
	15		/EXIT TO MONITOR
	.ENDC
	.IFDEF %MACI
	JMP CTLC
	.ENDC
ERRLIN	.ASCII <12><11><11>
	.ASCII	'SIZE='
PSIZEE	0;	0
	.ASCII	'     '
ERNMBR	0;	0
	.ASCII	/ ERROR LINES/<15>
	.LOC .-1
LRCR	510320
/SOME UTILITY ROUTINES.
/
SPACE2	0
	JMS PKBLNK
	JMS PKBLNK
	JMP* SPACE2
/
/PICK UP 3 SYMBOL WORDS
/
SYM3	0
	LAC USTBEG
	DAC SWD1
	TAD L1
	DAC SWD2
	TAD L1
	DAC SWD3
	JMP* SYM3
USTB2	0
	INC USTBEG
	INC USTBEG
	JMP* USTB2
/
P57K15	0
	LAC L15
	JMS PACK57
	JMP* P57K15
/
PKBLNK	0
	LAC L40
	JMS PACK57
	JMP* PKBLNK
/
/
/
/
/
/BUILD AND PRINT SYMBOL
/
BPSMB	0
	JMS SYM3
	JMS UNSQZE 	/UNSQOZE THE SYMBOL
	LAW -6
	JMS MOVEPK
	LAC AD16		/UNSQZV-1
	LAC AD222		/SIX CHAR SYMBOL TO PRTBUF
	JMS SPACE2	/2 SPACES BEFORE LOCATION
			/IF SYMBOL IS A P/A
			/PICK UP ALL 18 BITS.
			/ELSE ONLY 15 BITS
	LAW -6
	DAC CTR
	JMS MACFST
	JMP BPSMBB	/P/A.
	SKP		/NOT MAC OR PA.
	JMP BMACRO	/MACRO.
	ISZ CTR
	JMS PKBLNK	/PACK A BLNK
BPSMBB	LAC CTR
	JMS MOVBIN	/BINARY TO OCTAL
	LAC* SWD3
	JMS TMODE 	/BY PASS ADDRESS TYPE
	 		/IF NON REL ASSEMBLY
	JMP BPABS		/ABSOLUTE.
	JMS SPACE2	/2 SPACES BEFORE TYPE
	LAC* SWD2
	AND JMPLIT 	/CHECK FOR VIRTUAL
.IFK01	SNA!SPA
	JMP BPNOTE 	/CHECK FOR A OR R, NOT E.
	LAC L105		/E, CR
	JMP BPACK
BPNOTE	LAC* SWD1		/CHECK FOR A OR R.
	AND LACLIT
	SNA
	JMP BPACK-1
	LAC L122		/R, CR
	JMP BPACK
	LAC L101
BPACK	JMS PACK57
BPABS	JMS P57K15
	LAC AD333		/PRTBUF-1
	JMS PRINT
	JMP* BPSMB
BMACRO	JMS PKBLNK		/M/PACK MACRO
	LAC L115
	JMS PACK57
	LAC L101		/A
	JMS PACK57
	LAC L103		/C
	JMS PACK57
	LAC L122		/R
	JMS PACK57
	LAC L117
	JMS PACK57	/0
	JMP BPABS
/
/CHECK FOR END OF SYMBOL TABLE
/
CKEST	0
	LAC USTBEG 	/CHECK NEXT
	SAD USTEND		/FOR END
	JMP CKESTA 	/FOUND
	.IFUND %MACI
	.IFUND %PDP9
	XCT EXPAGE
	JMP PAG006
	.ENDC
	.ENDC
LAWITH	LAW 10000		/CHECK FOR LITERAL
	AND* USTBEG
	SAD LAWITH
	JMP* CKEST 	/FOUND
	INC CKEST 	/NOT FOUND
	JMP* CKEST
CKESTA=.
	.IFUND %PDP9
	.IFUND %MACI
	XCT EXPAGE	/IS THERE AN EXTRA PAGE AVAILABLE?
	JMP PAG005	/YES..ADJUST USTBEG
	.ENDC
	.ENDC
	JMP* CKEST
	.TITLE	RADIX 50 AND UTILITIES
/
/CONVERT RADIX 50 VALUE TO ASCII VALUE
/
ASCVAL	0
	DAC TMP
	SZA 		/SPACE
	JMP ASCVA
	LAC L40
	JMP ASCVD
ASCVA	TAD LM33
	SMA
	JMP ASCVB
	LAC TMP 		/A-Z
	XOR L100
	JMP ASCVD
ASCVB	LAC TMP
	TAD LM35
	SPA
	JMP ASCVC
	LAC TMP 		/0-9
	TAD L23
	JMP ASCVD
ASCVC	DAC TMP
	LAC L56 		/.
	ISZ TMP
	LAC L45 		/%
ASCVD	DAC* UNSQZL
	INC UNSQZL
	JMP* ASCVAL
UNSQZV	0		/USE AS TEMP
	0
	0
	0
	0
	0
/
/UNSQOZING ROUTINE
/
UNSQZE	0
	LAC AD20	/UNSQZV
	DAC UNSQZL
	LAW -2
	DAC USQCTR
HALF2	LAC* USTBEG 	/SYMBOL
	AND L157S	 	/MASK OUT
	DAC UNSQ	 	/CONTROL BITS
	JMS DIVIDE 	/1'ST AND 4'TH CHARS
	LAC UNSQ 		/DIVIDEND
	LAC (3100 	/DIVISOR
	JMS ASCVAL 	/GET ASCII VALUE
	LAC DVD 		/REMAINDER SAVED
	DAC UNSQ
	JMS DIVIDE
	LAC UNSQ
	LAC LPAREN	/CONSTANT 50.
	JMS ASCVAL 	/2ND AND 5TH CHARS
	LAC DVD
	JMS ASCVAL 	/3RD AND 6TH CHARS
	INC USTBEG
	ISZ USQCTR
	JMP HALF2 	/GET 2ND HALF
	JMP* UNSQZE
/
/LOCATIONS TO BE INITIALIZED FOR PASS1 ONLY
/
BP1T=.
LITCTR	0		/LITERAL COUNTER
VARCTR	0		/VARIABLE COUNTER
EXTCTR	0		/EXTERNAL COUNTER
UNDCTR	0		/UNDEFINED COUNTER
BMODE	0		/BINARY NODE - 0=REL, 1=ABS, 2=FULL
USTSZE	0		/USER S/T SIZE
EP1T=.
/
/LOCATIONS TO BE INITIALIZED FOR PASS1 AND PASS2
BP12T=.
RASUPL	0		/REAL ARGUMENT SUPPLIED
CSBSW	0		/CREATE SYMBOL SWITCH
DIRASW	0		/DIRECT ADDRESS SWITCH(0=12BITS,NOT 0=13BITS)
ERLNCT	0		/ERROR LINE COUNT
PGCTR	0		/PAGE COUNT
RASW	0		/RETURN TO REAL ARGUMENTS
MCLCTR	0		/MACRO CALL LEVEL COUNTER
MCLSW	0		/MACRO CALL SWITCH
IFCTR	0
LASW	0
OUTLCT	0
FNDSW	0
EXPSW	0		/MACRO EXPANDING SWITCH
NOREST	0
DFNSW	0		/MACRO DEFINITION SWITCH
PC	0		/PROGRAM COUNTER
CHVPC	0		/CURRENT HIGH VALUE OF PROGRAM COUNTER
EOTSW	0		/END OF TAPE SWITCH
RPTSW	0		/REPEAT SWITCH
CONDSW	0		/CONDITIONAL ASSEMBLY SWITCH
RADIX	0		/RADIX +=OCTAL, -=DECIMAL
EP12T=.
/
/LOCATIONS TO BE INITIALIZED BEFORE
/EACH SOURCE STATEMENT IS ASSEMBLED
/
BST=.
PACKT	0;	0	/CONTAINS PACKED TAG
IFSW	0		/IF STATEMENT SWITCH
BYPASS	0		/BYPASS GETTING NEXT CHARACTER
PASW	0		/PARAMETER ASSIGNMENT
FLGWD	0
FLGSAV	0
FLDVAL	0		/ANY FIELD VALUE
PSEUDO	0
WRDVAL	0		/WORD VALUE
OPVAL	0		/OPERATION FIELD VALUE
AREL	0		/ACCUMULATED RELOCATION
CREL	0		/CURRENT RELOCATION
CHRNUM	0		/PACKING CHARACTER NUMBER
NCD	0		/NOT CURRENTLY DEFINED SYMBOL
LITSW	0		/LITERAL SWITCH
STPSW	0		/SYMBOL TABLE PRINT SWITCH
BRKSW	0		/BRACKETS IN TEXT SWITCH
BSSW	0		/.BLOCK SWITCH
ENDSW	0		/.END SWITCH
NDIL	0
BKBITS	0
EXLTSW	0		/EXTERNAL OR LITERAL
EXTSW	0		/EXTERNAL SWITCH
FLDSW	0		/WHICH FIELD SWITCH
SZESW	0		/.SIZE SWITCH
NULOPF	0		/NULL OPERATION FIELD
OPSVSW	0		/OP SAVED SWITCH
EJCTSW	0		/.EJECT SWITCH
TEXTSW	0		/.TEXT SWITCH
VARSW	0		/VARIABLE ENCOUNTER
LOCSW	0		/.LOC SWITCH
	.IFUND %PDP9
NINEOP	0
INDXSW	0		/INDEX REGISTER SWITCH.
PDP9SW	0		/TEMP DIRECT ADDRESS SWITCH.
	.ENDC
EST=.
/
/INITIALIZE 5/7 UNPACKING TO BEGINNING OF LINE BUFFER
/
UPBLB	0
	LAC	AD01	/RDBUF+2
	DAC UPKAD		/UNPACKING LOCATION
	LAC L1
	DAC PKNUM		/PACKING NUMBER
	.IFDEF %MACI
	LAC TSWCH
	TAD MSWCH
	SNA
	JMP* UPBLB
	LAC (DTIBUF+2
	DAC UPKAD
	.ENDC
	JMP* UPBLB
/
/LOCATION ZEROING SUBROUTINE
/
/LAC (TABL-1
/JMS ZEROIT
/BEG-END	/TABLE SIZE
/
ZEROIT	0
	DAC* L10		/BEG-1 OF TABLE
	XCT* ZEROIT	/PICK UP LAW
	DAC CTR
	DZM* 10		/ZERO LOCATIONS
	ISZ CTR
	JMP .-2
	JMP* ZEROIT
/INIT 5/7 UNPACKING, LOC IN AC AT ENTRY
USET57	0
	DAC UPKAD
	LAC L1
	DAC PKNUM
	JMP* USET57
/
/INITIALIZE FOR 5/7 PACKING
/
/LAC LOC
/JMS P57INT
/
P57INT	0
	DAC PK57AD	/LOCATION TO PACK
	DZM CTR57		/RESET COUNT
	JMP* P57INT
WRD3	0
	INC MRGLOC
	INC MRGLOC	/PICK UP WORD 3 OF S/T
	JMP* WRD3
/
GETREL	0
	RTL
	GLK
	DAC CREL		/PICK UP LOCATION
	JMP* GETREL
/
MRGP1	0
	INC MRGSAV
	LAC* MRGSAV	/UPDATE MERGE SAVE
	JMP* MRGP1
ALTA	0
	JMS SUB2		/ADJUST LITERAL TABLE ADDRESS
	DAC* L10
	LAC* 10
	JMP* ALTA
/
/SUBROUTINE TO PACK N BLANKS.
/
SPACKS	0
	DAC ALTA
	JMS PKBLNK
	ISZ ALTA
	JMP .-2
	JMP* SPACKS
/
P57TAB	0
	LAC L11
	JMS PACK57
	JMP* P57TAB
SET10	0
	TAD LAWM1
	DAC* L10
	JMP* SET10
SET11	0
	TAD LAWM3
	DAC* L11
	JMP* SET11
/
/INCREMENT AUTO INDEX IO TWICE INDIRECTLY.
INCL10	0
	ISZ*	L10
	ISZ*	L10
	JMP*	INCL10
/
/CONVERT TO TWO'S COMPLEMENT
/
TWOS	0
	CMA
	TAD L1
	JMP* TWOS
/
/
/CHECK FOR 6 CHARACTERS PACKED
/
SIXP	0
	XX		/LAW -6 OR LAW -9(11)
	TAD CHRNUM	/6 CHARS PACKED
	SPA		/YES
SIXPA	JMS PACK		/NO - ADD1 TO RETURN
	JMP* SIXP
/
/
/
/
/SHIFTING UTILITY ROUTINES**********
/
/THIS AREA OF CODE CAN BE CONDENSED, BUT ITS NOT WORTH IT.
/THESE ROUTINES ARE USED EXTENSIBLY FOR THE TIME CONSUMING
/TASK OF SHIFTING BITS TO PACK AND UNPACK CHARACTERS.
/THE ROTATE 8 ROUTINES COULD BE MADE SHORTER BY CALLING
/THE ROTATE 4 ROUTINE TWICE.  4 MIROSECONDS ARE ADDED
/EVERY TIME A SUBROUTINE IS CALLED (A JMS=2 AND AJMP*=2).
/THE ADDED MICRO-SECONDS ARE TOO EXPENSIVE
/
LEFT8	0
	.IFUND %MACI
	RTL; RTL; RTL; RTL
	.ENDC
	.IFDEF %MACI
	JMS LEFT4		/IF MACRO-I
	JMS LEFT4		/SPEED IS NO FACTOR.
	.ENDC
	JMP* LEFT8
/
RIGHT8	0
	.IFUND %MACI
	RTR; RTR; RTR; RTR
	.ENDC
	.IFDEF %MACI
	JMS RIGHT4		/IF MACRO-I SPACE
	JMS RIGHT4		/NOT SPEED IS CRITICAL.
	.ENDC
	JMP* RIGHT8
/
LEFT6	0
	.IFUND %MACI
	RTL; RTL; RTL
	.ENDC
	.IFDEF %MACI
	JMS LEFT4
	RTL
	.ENDC
	JMP* LEFT6
/
RIGHT6	0
	.IFUND %MACI
	RTR; RTR; RTR
	.ENDC
	.IFDEF %MACI
	RTR
	JMS RIGHT4
	.ENDC
	JMP* RIGHT6
/
LEFT4	0
	RTL; RTL
	JMP* LEFT4
/
RIGHT4	0
	RTR; RTR
	JMP* RIGHT4
/
RIGHT3	0
	RTR; RAR
	JMP* RIGHT3
	.TITLE	TABLE COMPARE-LOOKUP ROUTINES
/THIS ROUTINE CHECKS CHRHLD FOR A-Z.
/CALLING SEQUENCE:
/JMS CKALF
/FOUND
/NOT FOUND
/
CKALF	0	/RETURN LOCATION
	LAW -133
	TAD CHRHLD
	SMA
	JMP NTALF	/>Z
	LAW -101
	TAD CHRHLD
	SMA	/<A
	JMP* CKALF	/FOUND EXIT
NTALF	ISZ CKALF
	JMP* CKALF	/NOT FOUND EXIT
/ROUTINE TO COMPARE MAGNITUDES OF 2 LOCATIONS
/
/JMS TRC
/LAC LOC 1
/LAC LOC 2
/RETURN 1 - LOC 1 < LOC 2
/RETURN 2 - LOC 1 > OR = TO LOC 2
/	IF =, AC=0 ON RETURN 2
/
TRC	0
	XCT* TRC
	DAC USET1		/LOC 1
	INC TRC
	SPA
	JMP TRC1
	XCT* TRC
	SPA
	JMP TRC4		/LOC 1 < LOC 2
	JMP TRC2		/BOTH HAVE SAME SIGN
TRC1	XCT* TRC
	SMA
	JMP TRC3		/LOC  1 > LOC 2
TRC2	JMS TWOS		/BOTH LOCS HAVE SAME SIGN
	TAD USET1		/LOC 1 > OR=TO LOC 2
	SMA		/LOC 1 < LOC 2
TRC3	INC TRC		/LOC 1 > OR= TO LOC 2
TRC4	INC TRC		/LOC 1 < LOC 2
	JMP* TRC
	.EJECT
/THIS ROUTINE CHECKS CHRHLD FOR 0-9.
/CALLING SEQUENCE:
/JMS CKNUM
/FOUND
/NOT FOUND
/
CKNUM	0	/RETURN LOCATION
	LAW -72
	TAD CHRHLD
LSMA	SMA
	JMP NTNUM	/>9
	LAW -60
	TAD CHRHLD
	SMA	/<0
	JMP* CKNUM	/FOUND EXIT
NTNUM	ISZ CKNUM
	JMP* CKNUM	/NOT FOUND EXIT
P6INT	0
	DAC PKLOC
	DZM* PKLOC
	DZM CHRNUM
	DZM SIXCTR
	JMP* P6INT
/
/
/PACKING SUBROUTINE (THREE 6 BIT CHARS/WORD)
/PKLOC= LOCATION TO BE PACKED
/CHRNUM=CHARACTER NUMBER
/CHRHLD=CHARACTER TO BE PACKED
/
PACK	0
	LAC SIXCTR
	SAD L3
	SKP!CLA
	JMP OKSIX
	INC PKLOC
	DZM* PKLOC	/CLEAR NEXT WORD
OKSIX	DAC SIXCTR
	TAD (JMP PKTBL
	DAC SIXDIS
	LAC CHRHLD
	AND L77
	CLL
SIXDIS	0
PKTBL	JMS LEFT6		/1ST LEFT 12 BITS
	JMS LEFT6		/2ND LEFT 6 BITS
	XOR* PKLOC	/3RD NO SHIFTS
	DAC* PKLOC
	INC CHRNUM	/UPDATE CHAR NUMBER
	INC SIXCTR
	JMP* PACK
/
/NON-ALPHANUMERIC CHARACTER LOOKUP ROUTINE.
/ENTRY: CHAR IN CHRHLD
/JMS CHRLKP
/XXYYYY	XX=STARTING POSITION IN TABLE (1ST=0)
/FOUND	YYYY=NUMBER OF POSITIONS TO SCAN (2'S COMPL)
/NOT FOUND
/
CHRLKP	0
	LAC* CHRLKP
	AND L47S
	XOR LAWITH
	DAC CTRLK		/NUMBER OF POSITIONS TO SCAN
	LAC* CHRLKP
	JMS LEFT6
	RAL
	AND L77
	TAD (SAD SPCHRS-1	/DEVELOP STARTING POSITION
	DAC CHCMP
	ISZ CHRLKP
	LAC CHRHLD
	ISZ .+1
CHCMP	XX		/FOUND
	JMP* CHRLKP	/YES
	ISZ CTRLK
	JMP CHCMP-1
	ISZ CHRLKP
	JMP* CHRLKP	/NOT FOUND
/
/CHARACTER TABLE
/
L40=.
SPCHRS	40	/SPACE (0)
L11	11	/TAB (1)
L73	73	/; (2)
L15	15	/CR (3)
L57	57	/SLASH (4)
	53	/+ (5)
L55	55	/- (6)
L52	52	/* (7)
	46	/& (10)
L41	41	/! (11)
KBACK	134	/ (12)
L56	56	/. (13)
L45	45	/% (14)
L12	12	/LF (15)
L14	14	/FF (16)
L13	13	/VT (17)
L0	00	/NULL (20)
L177	177	/DELETE (21)
KOMMA	54	/COMMA(S)
/
/ROUTINE TO DETERMINE IF CHAR IS A SPACE OR TAB
/
CKSPTB	0
	JMS CHRLKP	/SPACE OR TAB?
	7776
	JMP* CKSPTB	/YES
	ISZ CKSPTB	/NO
	JMP* CKSPTB
/
/ROUTINE TO DETERMINE IF CHAR IS ; OR CR.
/
CKSCR	0
	JMS CHRLKP	/; OR CR?
	27776
	JMP* CKSCR	/YES
	ISZ CKSCR		/NO
	JMP* CKSCR
/
/
UP6INT	0
	DAC UPKLOC
	DZM UPKCTR
	JMP* UP6INT
/
/UNPACKING ROUTINE FOR 6 BIT CHARS,
/3 CHARS/WORD.
/ENTRY:
/DZM UPKCTR
/LAC (INITIAL LOCATION TO UNPACK
/DAC UPKLOC
/JMS UNPACK
/UNPACKED CHAR IN UPKCHR
/
UNPACK	0
	LAC UPKCTR
	SAD L3
	SKP!CLA
	JMP OK6UNP
	INC UPKLOC
	DAC UPKCTR
OK6UNP	TAD (JMP UPKTBL
	DAC .+2		/GET CHAR POSITION
	LAC* UPKLOC	/GET WORD
	0
UPKTBL	JMS RIGHT6		/1ST CHAR
	JMS RIGHT6		/2ND CHAR
	AND L77
	DAC UPKCHR	/UNPACKED WORD
	INC UPKCTR
	JMP* UNPACK	/EXIT
/
/THIS ROUTINE UNPACKS CHARACTERS FROM 5/7 ASCII WORD
/PAIRS AND LEAVES THEM IN CHRHLD
/
GETCHR	0
	.IFDEF %MACI
	LAC TSWCH
	TAD MSWCH
	SNA
	JMP NTTYIN
	LAC* UPKAD
	JMP CHR5+1
NTTYIN=.
	.ENDC
	LAC PKNUM		/PKNUM=1,2,3,4 OR 5
	TAD (JMP JMPTBL-1
	DAC .+2
	LAC* UPKAD	/CONTAINS ADDR OF PACKED CHARS
	0		/JMP CHAR (1-5)
/UNPACKING JUMP TABLE
JMPTBL	JMP CHR1		/1ST CHARACTER
	JMP CHR2		/2ND CHARACTER
	JMP CHR3		/3RD CHARACTER
	JMP CHR4		/4TH CHARACTER
	JMP CHR5		/5TH CHARACTER
CHR1	JMS LEFT8
	JMP GETEND
CHR2	JMS RIGHT4	/ROTATE 4 RIGHT
	JMP GETEND
CHR3	RTL
	RAL		/ROTATE 3 LEFT
	AND L170
	DAC TMP		/SAVE LEFTMOST 4 BITS
	ISZ UPKAD
	LAC* UPKAD	/PICK UP NEXT WORD
	JMS LEFT4
	AND L7		/RIGHTMOST 3 BITS
	XOR TMP
	JMP GETEND+1
CHR4	JMS RIGHT8
	JMP GETEND
CHR5	RAR
	ISZ UPKAD		/UPDATE FOR NEXT 5/7 PAIR
	DZM PKNUM		/RESET CHAR NUMBER
GETEND	AND L177
	DAC CHRHLD	/UNPACKED 7 BIT CHAR
	ISZ PKNUM
	JMS CHRLKP	/CHECK FOR SPACE, TAB
	007773		/CR, ; OR /
	JMP* GETCHR
	JMS CHRLKP	/CHECK FOR LF, FF, VT, NULL
	157773		/OR DELETE
	JMP* GETCHR
	DZM NDIL		/RESET NO DATA IN LINE
	JMP* GETCHR
/
/CHECK FOR # ON PERMANENT SYMBOL OR PSEUDO OP.
/
CKPFV	0
	LAC VARSW		/VAR SWITCH
	SZA
	JMS ERRORS	/S TO FLAG WORD
	DZM VARSW
	JMP* CKPFV
/
/ROUTINE TO SCAN TO END OF WORD OR LINE
/
SCNEND	0
	JMS CKSCR		/CHECK CURRENT CHARACTER FOR ; OR CR.
	JMP* SCNEND	/FOUND
	SAD L57
	JMP SCND4
SCND1	LAC CHRHLD
	DAC PRVCHR	/PREVIOUS CHARACTER
SCND3	JMS GETCHR	/GET NEXT CHAR
	JMS CKSCR		/CHECK FOR ; OR CR
	JMP* SCNEND	/FOUND
	JMS CKSPTB	/CHECK FOR SPACE OR TAB
	JMP SCND1		/FOUND
	SAD L57		/CHECK FOR /
	JMP SCND2		/FOUND
	JMS ERRORQ	/Q TO ERROR FLAG WORD
	JMP SCND1
SCND2	LAC CHRHLD
	DAC TMP
	LAC PRVCHR
	DAC CHRHLD
	JMS CKSPTB	/CHECK PREVIOUS FOR SPACE OR TAB
	JMP SCND4		/FOUND
	LAC TMP
	JMP SCND1+1
SCND4	LAC L15		/CARRIAGE RETURN
	DAC CHRHLD
	JMP* SCNEND	/EXIT
	.EJECT
/SUBROUTINE TO MERGE A SYMBOL AND ITS VALUE INTO THE USER
/SYMBOL TABLE.
/IF THERE IS AN EXTRA PAGE THE SYMBOL TABLE MAY BE IN TWO
/NON-CONTIGUOUS SECTIONS.  IF THERE IS AN EXTRA PAGE, TEST
/THE END OF THE SYMBOL WITH THE END OF PAGE TO SEE IF THE
/SYMBOL TABLE HAS EXTENDED TO THE SECOND SECTION, IF SO A
/GREAT DEAL OF MOVING MAY BE REQUIRED.
/
/IF THE END OF THE MACRO DEFINITION TABLE MEETS THE
/BOTTOM OF THE SYMBOL TABLE THE ASSEMBLY TERMINATES.
/MRGLOC = 3 WORDS.GT. ITS SET PLACE.
/
MERGE	0
	LAC L3
	TAD ENDUMT
	CMA
	TAD BEGUST
	SPA
	JMP STOVA		/TABLE OVERFLOW, ASSEMBLY ENDS.
	.IFUND %MACI
	.IFUND %PDP9
	XCT EXPAGE	/IS THERE AN EXTRA PAGE?
	JMP MGXPAG
	.ENDC
	.ENDC
/MERGE THE SYMBOL INTO THE BOTTOM SECTION
/
NOXMRG	JMS MOVMRG
	LAC MRGLOC
	LAC BEGUST
	LAC CMPLOC
	JMS SUB3		/ADJUST BEGUST
MGOUT1	DAC BEGUST
	INC USTSZE	/COUNT SYMBOLS.
	JMP* MERGE	/EXIT.
/
/
/
/SUBROUTINE TO MOVE A BLOCK OF CORE DOWN THREE WORDS.
/THE NUMBER OF WORDS IN THE BLOCK IS COMPUTED BY
/SUBTRACTING THE HIGH ADDRESS FROM THE LOW ADDRESS.
/IF THE RESULT IS 0 NO MOVING TAKES PLACE AND AUTO
/INDEX REGISTER 11 IS SET UP TO RECEIVE THREE WORDS.
/THE LAST ARGUMENT TO THIS SUBROUTINE POINTS TO THE
/THREE WORDS TO BE MERGED IN.
/
/
MOVMRG	0		/MOVE-MERGE SUBROUTINE.
	XCT* MOVMRG	/HIGHEST LOCATION ON BLOCK
	JMS TWOS
	DAC SEARCH	/SAVE IT.
	INC MOVMRG	/POINT TO LOWEST LOC OF BLOCK
	XCT* MOVMRG
	TAD SEARCH
	DAC CTR	/NEG DIFFERENCE
	XCT* MOVMRG	/LOWEST LOC OF BLOCK
	JMS SET10	/SET UP 10 AND 11
	JMS SET11	/10=BOTTOM-1,11=BOTTOM-4
	LAC CTR
	INC MOVMRG
	SZA
	JMS MOVAUT
	XCT* MOVMRG
	JMS SET10		/GET ADDRESS OF 3 WORDS TO MOVE IN.
	LAW -3
	JMS MOVAUT
	JMP* MOVMRG
/
/
/
/
/MACRO DEFINITIONS ARE STORED AT THE BOTTOM OF
/CORE (.SCOM+2) AND ARE BUILT UPWARDS TOWARD
/THE USER SYMBOL TABLE.  THE INVERSE IS TRUE
/FOR SYMBOLS, THEY ARE STORED AT THE TOP OF
/AVAILABLE CORE (.SCOM+3 OR TOP OF EXTRA PAGE) AND
/ARE BUILT DOWNWARD TOWARD THE MACRO DEFINITIONS.
/
/IF THE EXTRA PAGE BECOMES FULL OF SYMBOLS, THE
/SYMBOL TABLE IS EXTENDED TO .SCOM+3 AND DOWN.
/IF MACRO-DEFINITIONS FILL LOWER CORE IT IS
/EXTENDED TO THE EXTRA PAGE.  WHEN BOTH TABLES
/MEET NO MORE SYMBOLS OR MACRO DEFINITIONS
/CAN BE STORED SO MACRO-15 STOPS ASSEMBLING
/
/
SRCUST	0
	DAC SRCUS1	/STORE INPUT ARG.
	.IFUND %MACI
	.IFUND %PDP9
	XCT EXPAGE	/NOP IF EXTRA PAGE  IN.
	JMP SRXPAG	/SEARCH PAGE FIRST
	.ENDC
	.ENDC
NOEXPG	JMS SEARCH	/SEARCH SYMBOL TABLE UNDER
	LAC USTEND	/MACRO-15.
	LAC BEGUST
	LAC AD32		/SQZOUT
SRCUS1	XX		/400002 OR 2.
	JMP* SRCUST
SRCNFD	INC SRCUST
	JMP* SRCUST
/SUBROUTINE TO SEARCH A TABLE.
/THE ARGUMENTS ARE AS FOLLOWS:  ENDING LOCATION OF TABLE
/(GREATEST MAGNITUDE), BEGINNING LOCATION (LOWEST MAGNITUDE),
/LOCATION OF SYMBOL TO COMPARE WITH, A CONTROL WORD WHICH TELLS
/WHETHER OR NOT THE TABLE IS 2 OR 3 WORD ENTRIES AND ALSO
/HOW MANY BITS TO COMPARE (18 OR 16 BITS).
/CALLING SEQ:
/	JMS SEARCH
/	LAC ENDLOC	/TOP OF TABLE
/	LAC BEGLOC	/BOTTOM OF TABLE (LOWEST MAGNITUDE)
/	LAC SYMLOC	/POINTER TO SYMBOL
/	CONTROL WORD	/
/	FOUND		/RETURN HERE IF SYMBOL FOUND.
/	NOT FOUND
/
/
SEARCH	0
	XCT* SEARCH		/ENDING LOCATION OF TABLE
	DAC HILIM
	INC SEARCH
	XCT* SEARCH
	DAC LOLIM		/NUMBER OF SYMBOLS
	INC SEARCH
	XCT* SEARCH	/LOCATION OF SYMBOL
	DAC CMPLOC	/TO COMPARE TABLE WITH
	INC SEARCH
	LAC* SEARCH	/PICK UP CONTROL WORD
	SPA
	JMP .+3
	LAC NOPLIT	/CHECK ALL 18 BITS
	JMP .+2
	LAC .+4		/CHECK LO ORDER 16 BITS
	DAC MSK2
	DAC MSK2A
	LAC* SEARCH
	AND L157S
	DAC INCR
	ISZ INCR		/2 OR 3
	JMS TWOS		/TWOS COMPLEMENT
	DAC WORDCT
	ISZ SEARCH	/FOUND EXIT
	LAC HILIM		/FIRST ENTRY?
	SAD LOLIM
	JMP NTFND+1	/YES..SET MRGLOO
/
/SPLIT TABLE LIMITS
/
SPLIT	LAC HILIM
	TAD LOLIM
	RCR		/DIVIDE BY 2
	SZL		/ADJUST BY -1
	TAD LAWM1		/IF REMAINDER PRESENT
	DAC MRGLOC	/MERGING LOCATION
	LAC WORDCT		/LENGTH 2 SYMBOL
	TAD L1
	SZA!CLA		/YES
	JMP CMPL1		/NO
	LAC HILIM
	TAD MRGLOC		/IF HIGH LIMIT AND MERGING
	AND L1		/LOCATION ARE NOT SAME WITH
	SNA!CLC		/RESPECT TO ODD/EVEN
	CLA
CMPL1	TAD MRGLOC
	DAC MRGLOC
/
/COMPARE ITEM VALUE AGAINST TABLE VALUE
/
	JMS SET10		/TABLE LOCATION
	LAC CMPLOC
	TAD LAWM1
	DAC* L11		/ITEM LOCATION
	LAC WORDCT
	DAC CTR1
CMPLUP	LAC* 10		/TABLE VALUE
MSK2	AND L157S		/OR NOP
	DAC TMPT		/TABLE VALUE
	LAC* 11
MSK2A	AND L157S		/OR NOP
	DAC TMPI		/ITEM VALUE
	SAD TMPT
	SKP
	JMP CKLORG	/CHECK <OR>
	ISZ CTR1		/CHECK N WORDS
	JMP CMPLUP
	JMP* SEARCH	/FOUND EXIT
CKLORG	JMS TRC		/CHECK FOR
	LAC TMPI		/< OR >
	LAC TMPT
	SKP		/<
	JMP GRTR		/>
LESS	LAC MRGLOC	/ITEM < TABLE
	SAD LOLIM		/END OF SPLITTING
	JMP NTFND+2	/YES, NOT FOUND
	DAC HILIM		/SET NEW HI LIMIT
	JMP SPLIT		/ONCE AGAIN
GRTR	LAC MRGLOC	/ITEM > TABLE
	SAD LOLIM		/END OF SPLITTING
	JMP NTFND		/YES, NOT FOUND
	TAD INCR		/2 OR 3
	SAD HILIM
	JMP NTFND+1
	DAC LOLIM		/SET NEW LOW LIMIT
	JMP SPLIT
NTFND	TAD INCR		/2 OR 3
	DAC MRGLOC
	INC SEARCH	/NOT FOUND EXIT
	JMP* SEARCH
/
/IMBEDDED MACRO CALL OVERFLOW
/
ICOVA	LAC (416031
	DAC TORC		/CALL
	LAC (446000
	JMP STOVB-1
/
/SYMBOL TABLE OVERFLOW
/
STOVA	LAC (522030
	DAC TORC		/TABLE
	LAC (246212
	DAC TORC+1
STOVB=.
/
	.IFUND %MACI
	CAL+2775
	11
MOD33	PRTOVA
LM35=.
PRTOVA	-35
	.ENDC
	.IFDEF %MACI
	JMS TTYOUT
	TORC-2
	.ENDC
	JMP PASS1		/RETURN TO COMMAND STRING
TORC	0;	0	/TABLE OR CALL
	.ASCII	/ OVERFLOW/<15>
	.EJECT
/SUBROUTINES TO MOVE DATA.
/MOVER IS A SUBROUTINE TO MOVE DATA FROM ONE ADDRESS
/TO ANOTHER. THE ADDRESSES AND THE WORD COUNT ARE
/RECEIVED AS ARGUMENTS
/
MOVER	0
	DAC CTR		/SAVE THE WORD COUNTER
	XCT* MOVER	/GET THE DONOR ADDRESS-1
	DAC* L10
	ISZ MOVER		/POINT TO RECEIVING ADDRESS.
	XCT* MOVER	/RECEIVER -1
	DAC* L11
	LAC CTR		/USE THE AUTO INDEX MOVER
	JMS MOVAUT
	JMP* MOVER
/
/MOVAUT IS A SUBROUTINE TO MOVE DATA FROM AUTO INDEX
/10 TO AUTO INDEX 11. ITS ONLY ARGUMENT IS
/THE WORD COUNT.
/
MOVAUT	0
	DAC CTR
	LAC* 10
	DAC* 11
	ISZ CTR		/DONE?
	JMP .-3		/NO LOOP AGAIN
	JMP* MOVAUT	/YES EXIT
/
/MOVBIN IS SUBROUTINE WHICH CALLS THE
/BINARY TO OCTAL ROUTINE
/
MOVBIN	0
	DAC CTR
	JMS BNOCT
	XCT* MOVBIN
	JMS PACK57
	ISZ CTR
	JMP .-4
	ISZ MOVBIN
	JMP* MOVBIN
/
MOVEPK	0
	DAC CTR
	XCT* MOVEPK
	DAC* L10
	ISZ MOVEPK
	XCT* MOVEPK
	JMS P57INT
	LAC* 10
	JMS PACK57
	ISZ CTR
	JMP .-3
	ISZ MOVEPK
	JMP* MOVEPK
	.TITLE	MATH UTILITY ROUTINES
/
/MULTIPLY SUBROUTINE
/CALLING SEQUENCE:
/	LAC MULTIPLIER
/	JMS MPY
/	LAC MULTIPLICAND
/	RETURN; LOW ORDER PRODUCT IN AC, HIGH ORDER PRODUCT IN MP5
/
MPY	0
	DZM MP5
	SNA
	JMP MPZ
	DAC MP1
	XCT* MPY
	SNA
	JMP MPZ
	DAC MP2
	LAW -22
	DAC MP3
MP4	LAC MP1
	RAR
	DAC MP1
	LAC MP5
	SZL!CLL
	TAD MP2
	RAR
	DAC MP5
	ISZ MP3
	JMP MP4
	LAC MP1
	RAR
MPZ	ISZ MPY
	JMP* MPY
/
/PDP-15 DIVIDE SUBROUTINE
/CALLING SEQUENCE:
/
/	JMS DIVIDE
/	LAC LOW ORDER DIVIDEND
/	LAC DIVISOR
/	RETURN	;QUOT. IN AC, REM. IN D#VD
/IF HIGH DIVIDEND IS GREATER OR EQUAL TO DIVISOR, NO DIVIDE TAKES
/PLACE AND LINK IS SET TO 1.  TIME = 368 CYCLES MAXIMUM
QUO=MPY
DIVIDE	0	/HIGH ORDER DIVIDEND IN AC
	DZM DVD	/STORE HIGH ORDER DIVIDEND
	XCT* DIVIDE	/FETCH LOW ORDER DIVIDEND
	DAC QUO	/STORE LOW ORDER DIVIDEND
	ISZ DIVIDE
	XCT* DIVIDE	/FETCH DIVISOR
	JMS TWOS
	DAC DVS	/SAVE DIVISOR
	ISZ DIVIDE	/INCREMENT TO EXIT ADDRESS
	SNA		/DIVIDEND 0?
	JMP* DIVIDE	/YES -- EXIT WITH LINK = 1
	LAW -23	/SET UP COUNTER
	DAC DV1	/SAVE COUNTER
	JMP DV2	/START DIVISION
DV3	LAC DVD	/FETCH DIVIDEND
	RAL	/ROTATE LEFT TO PICK UP NEXT BIT
	DAC DVD	/STORE DIVIDEND
	TAD DVS	/SUBTRACT DIVISOR FROM DIVIDEND
	SZL	/DIVIDEND GREATER THAN OR EQUAL TO DIVISOR
	DAC DVD	/YES
DV2	LAC QUO	/FETCH QUOTIEND
	RAL	/PICK UP QUOTIENT BIT FROM LINK
	DAC QUO	/STORE NEW QUOTIENT
	ISZ DV1	/FINISHED?
	JMP DV3	/NO
	JMP* DIVIDE	/EXIT
/
/NUMBER EVALUATION ROUTINE
/
NUMEVL	0
	DZM NUMBR		/WHERE RESULTS WILL BE
	LAC CHRNUM
	.IFDEF %PDP9
LSNA=.
	.ENDC
	SNA
	JMP* NUMEVL	/NUMBER IS 0
	LAC ARADD		/LAC (TAD NUMBER
	DAC OCTOUT
	LAC RADIX		/FIND RADIX
	SPA
	JMP CNVRSN	/DECIMAL
OCT	JMS INTUPN	/INITIALIZE UNPACKING RTNE
	JMS UNPACK	/GET A DIGIT
	TAD LM70		/CHECK FOR 8 OR 9
	SPA
	JMP SETOCT
	JMS ERRORN	/N TO ERROR FLAG WORD
	JMP CNVRSN	/CONVERSION ROUTINE
SETOCT	ISZ CTR
	JMP OCT+1
	LAC NOPLIT	/INITIALIZE CONVERSION
	DAC OCTOUT	/ROUTINE FOR OCTAL
/
/6 BIT DECIMAL TO BINARY, OCTAL TO BINARY CONVERSION
/
CNVRSN	JMS INTUPN	/INITIALIZE UNPACKING RTNE
NXTDGT	JMS UNPACK	/GET A DIGIT
	AND L17		/NEED ONLY 4 BITS
	DAC UPKCHR
	CLL
	LAC NUMBR
	RTL		/X4
	SZL
	JMP OVA		/CHECK FOR OVERFLOW
OCTOUT	TAD NUMBR		/X5-NOP FOR OCT
	SZL
	JMP OVA
	RAL		/X10
	SZL
	JMP OVA
	TAD UPKCHR
	SZL
	JMP OVA
	DAC NUMBR
	ISZ CTR		/FINISHED WITH NUMBER
	JMP NXTDGT	/GET NEXT DIGIT
	JMP* NUMEVL
OVA	JMS ERRORN	/N TO FLAG WORD
	JMP* NUMEVL
/
/INITIALIZE NUMERIC UNPACKING
/
INTUPN	0
	LAC CHRNUM
	JMS TWOS
	DAC CTR
	LAC AD08		/PACKS
	JMS UP6INT
	JMP* INTUPN
	.EJECT
/ERROR-A-  (PARAMETER ASSIGNMENT ERROR)
/
ERRORA	0
	JMS SETFLG
XCTLIT	400000
/
/ERROR-B-  (BANK OR PAGE ERROR)
/
ERRORB	0
	JMS SETFLG
LACLIT	200000
/
/ERROR-D-  (DOUBLY DEFINED SYMBOL)
/
ERRORD	0
	JMS SETFLG
L40000	40000
/
/ERROR-L-  (LITERAL ERROR)
/
ERRORL	0
	JMS SETFLG
	002000
/
/ERROR-M-  (MULTIPLE DEFINITION ERROR)
/
ERRORM	0
	JMS SETFLG
L1000	1000
/
/ERROR-N-  (NUMBER ERROR)
/
ERRORN	0
	JMS SETFLG
L400	400
/
/ERROR-P-  (PHASE ERROR)
/
ERRORP	0
	JMS SETFLG
L200	200
/
/ERROR-T-  (TAG ERROR)
/
ERRORT	0
	JMS SETFLG
K4	4
/
/ERROR-U-  (UNDEFINED ERROR)
/
ERRORU	0
	JMS SETFLG
L10	10
/
/PSUEDO-OP ERROR
/ERROR-I-  (LINE IGNORED)
/
ERRORI	0
	JMS SETFLG
	4000
/
/ERROR-O-  (OPERAND ERROR)
/
ERRORO	0
	JMS SETFLG
K10000	10000
/
/ERROR-Q- (QUESTIONABLE LINE)
/
ERRORQ	0
	JMS SETFLG
L100	100
/
/ERROR-R-  (RELOCATION ERROR)
/
ERRORR	0
	JMS SETFLG
	40
/
/ERROR-E-  (ERRONIOUS RESULTS ERROR)
/
ERRORE	0
	JMS SETFLG
L20000	20000
/
/ERROR-S-  (SYMBOL ERROR)
/
ERRORS	0
	JMS SETFLG
K20	20
/
/ERROR-W-
/
ERRORW	0
	JMS SETFLG
	2
/
/ERROR-X- (MACRO NAME OR INDEX REGISTER ERROR).
/
ERRORX	0
	JMS SETFLG
	1
/
/ERROR FLAG SETTING SUBROUTINE:
/JMS SETFLG
/XXXXXX	FLAG POSITION (0-17)
/
SETFLG	0
	LAC* SETFLG	/GET POSITION
	CMA
	AND FLGWD		/FLAG WORD
	XOR* SETFLG	/SET NEW BIT
	DAC FLGWD
	JMS SUB2		/POINT TO ERROR SUBR ENTRY
	DAC SETFLG	/C(SETFLG)=C(SETFLG)-2
	LAC* SETFLG	/GET THE NEXT ADDRESS LEVEL
	DAC SETFLG	/SET FOR EXIT
	JMP* SETFLG
/
/FORMAT OF FLAG WORD
/
/ABC,DEO,ILM,NPQ,RSU,TWX
/
/
/INITIALIZE PRINT AREA WITH SPACES
/
PRTINT	0
	LAC AD110		/CLEAR FLGWD TO RDBUF+1 (INCLUSIVE).
	JMS ZEROIT
	-15
	JMP* PRTINT
/THE LINE IMAGE LOOKS LIKE THIS (DASH=SPACE):
/SSSS-EEEEEPPPPP-T-OOOOOO-T-(3 WORD EXTENSION OR 3 SPACES).
/
/PRINT AND READIN BUFFERS (5 CHARS/2 WORDS)
/
STOPPER	0
PRTBUF	0;	0	/SOURCE LINE SEQUENCE #
	0;	0	/FLAGS MAXIMUM OF 5
	0;	0	/LOCATION 5 OCTAL CHARS.
	0;	0	/TAG TYPE PLUS 1ST 2 CHAR OF OBJ CODE.
	0;	0	/LAST 4 CHAR OF OBJ CODE + 1 SPACE.
			/OBJECT CODE TYPE, SPACE, 2 CHAR EXTENSION + 1 SPACE OR 3 SPACES.
/
RDBUF	201004;	020100	/HEADER WORDS ADD 6 AND MOVE TO PRTBUF.
/IF THE MULTIWORD STOPPER SWITCH COMES ON PACK A CR IN THE HEADER (RDBUF)
/AND MAKE THE PRTBUF SET TO 8 WORD PAIRS.
	.BLOCK 41
RDLST	0
/
/SYMBOL PACKING AREA (6 BITS/GHAR-6 CHARS)
/
PACKS	0
	0
	.TITLE	PERMANENT SYMBOL TABLES.
/
/PERMANENT SYMBOL TABLE FOR 3 WORD SYMBOLS
/SIX BIT TRIMMED - ZERO FILLED
/MUST BE MAINTAINED IN ALPHABETIC ORDER
/
PS3BEG	PS3BEG+1
	.IFUND %PDP9
	.SIXBT	/CLLR/
	736000			/CLEAR LIMIT REGISTER
	.ENDC
	.SIXBT	/IORS/
	IORS
	.IFUND %PDP9
	.SIXBT	/SWHA/
	742030			/SWAP HALVES OF THE AC.
	.ENDC
PS3END	PS3END
/--------------------------------------------
/
/PERMANENT SYMBOL TABLE FOR 2 WORD SYMBOLS
/SIX BIT TRIMMED
/MUST BE MAINTAINED IN ALPHABETIC ORDER
/
PS2BEG	PS2BEG+1
	.IFUND %PDP9
	.SIXBT	/AAC/
AACI	723000			/ADD (IMMEDIATE) TO AC
	.SIXBT	/AAS/
AASI	720000			/ADD (IMMEDIATE) AND SKIP IF .GF.LR
	.ENDC
	.SIXBT	/ADD/
	ADD
	.SIXBT	/AND/
	AND
	.IFUND %PDP9
	.SIXBT	/AXR/
AXRI	737000			/ADD (IMMEDIATE) TO XR
	.SIXBT	/AXS/
AXSI	725000			/ADD (IMMEDIATE) TO XR AND SKIP IF .GF.LR
	.ENDC
	.SIXBT	/CAF/
	CAF
	.SIXBT	/CAL/
	CAL
	.SIXBT	/CCL/
	CCL
	.SIXBT	/CLA/
	CLA
	.SIXBT	/CLC/
	CLC
	.SIXBT	/CLL/
	CLL
	.IFUND %PDP9
	.SIXBT	/CLX/
	735000			/CLEAR XR
	.ENDC
	.SIXBT	/CMA/
	CMA
	.SIXBT	/CML/
	CML
	.SIXBT	/DAC/
	DAC
	.IFUND %PDP9
	.SIXBT	/DBA/
DBALIT	707762
	.ENDC
	.SIXBT	/DBK/
	DBK
	.SIXBT	/DBR/
	DBR
	.SIXBT	/DZM/
DZMLIT	DZM
	.SIXBT	/EAE/
EAELIT	EAE
	.IFUND %PDP9
	.SIXBT	/EBA/
EBALIT	707764
	.ENDC
	.SIXBT	/GLK/
	GLK
	.SIXBT	/HLT/
HLTLIT	HLT
	.IFUND %PDP9
	.SIXBT	/IAC/
	740030			/INCREMENT THE AC
	.ENDC
	.SIXBT	/IOF/
	IOF
	.SIXBT	/ION/
	ION
	.SIXBT	/IOT/
IOTLIT	IOT
	.SIXBT	/ISA/
	ISA
	.SIXBT	/ISZ/
	ISZ
	.SIXBT	/JMP/
JMPLIT	JMP
	.SIXBT	/JMS/
JMSLIT	JMS
	.SIXBT	/LAC/
	LAC
	.SIXBT	/LAS/
	LAS
	.SIXBT	/LAT/
	LAT
	.SIXBT	/LAW/
LAWLIT	LAW
	.SIXBT	/NOP/
NOPLIT	NOP
	.SIXBT	/OAS/
	OAS
	.SIXBT	/OPR/
	OPR
	.IFUND %PDP9
	.SIXBT	/PAL/
	722000			/PLACE AC IN LR.
	.SIXBT	/PAX/
	721000			/PLACE AC IN XR.
	.SIXBT	/PLA/
	730000			/PLACE LR IN AC.
	.SIXBT	/PLX/
	731000			/PLACE XR IN AC.
	.SIXBT	/PXA/
	724000			/PLACE XR IN AC.
	.SIXBT	/PXL/
	726000			/PLACE XR IN LR.
	.ENDC
	.SIXBT	/RAL/
	RAL
	.SIXBT	/RAR/
	RAR
	.SIXBT	/RCL/
	RCL
	.SIXBT	/RCR/
	RCR
	.IFUND %PDP9
	.SIXBT	/RES/
	707742
	.ENDC
	.SIXBT	/RTL/
	RTL
	.SIXBT	/RTR/
	RTR
	.SIXBT	/SAD/
	SAD
	.SIXBT	/SKP/
	SKP
	.SIXBT	/SMA/
	SMA
	.SIXBT	/SML/
	SML
	.SIXBT	/SNA/
	SNA
	.SIXBT	/SNL/
	SNL
	.SIXBT	/SPA/
	SPA
	.SIXBT	/SPI/
	SPI
	.SIXBT	/SPL/
	SPL
	.SIXBT	/STL/
	STL
	.SIXBT	/SZA/
	SZA
	.SIXBT	/SZL/
	SZL
	.SIXBT	/TAD/
TADLIT	TAD
	.IFUND %PDP9
	.SIXBT	/TCA/
	740031			/2'S COMP AC
XREG	.SIXBT	/X/
	10000
	.ENDC
	.SIXBT	/XCT/
	XCT
	.SIXBT	/XOR/
	XOR
	.SIXBT	/XX/
	XX
PS2END	PS2END
	.EJECT
/
/SAVE UNPACKING VALUES
/
GETSAV	0
	LAC MCLCTR
	TAD (DAC SVUPK1+1
	DAC .+2
	LAC UPKAD
WORK1	XX
	LAC MCLCTR
	TAD (DAC SVPKN1+1
	DAC .+2
	LAC PKNUM
WORK2	XX
	JMP* GETSAV
/
/RESTORE UNPACKING VALUES
/
GETRST	0
	LAC MCLCTR
	TAD (LAC SVUPK1+1
	DAC .+1
WORK3	XX
	DAC UPKAD
	LAC MCLCTR
	TAD (LAC SVPKN1+1
	DAC .+1
WORK4	XX
	DAC PKNUM
	JMP* GETRST
/
/SAVE MACRO PACKING
/
PUTSAV	0
	LAC CTR57
	DAC CT57SV
	LAC PK57AD
	DAC PK57SV
	JMP* PUTSAV
/
/RESTORE MACRO PACKING
/
PUTRST	0
	LAC CT57SV
	DAC CTR57
	LAC PK57SV
	DAC PK57AD
	JMP* PUTRST
/
/SAVE CURRENT RADIX
/
SAVRDX	0
	LAC MCLCTR
	TAD (DAC RDXSV1+1
	DAC .+2
	LAC RADIX
WDCSAV	XX
	DZM RADIX		/SET TO OCTAL
	JMP* SAVRDX
/
/RESTORE PRE-EXPANSION RADIX
/
RSTRDX	0
	LAC MCLCTR
	TAD (LAC RDXSV1+1
	DAC .+1
PTMVCT	XX
	DAC RADIX
	ISZ MCLCTR		/SWITCH TO NEXT LEVEL
	SKP
	DZM EXPSW		/RESET EXPANDING
	JMP* RSTRDX
/
/GET START OF ASSOCIATED REAL ARGUMENTS
/
GETRAL	0
	LAC MCLCTR
	TAD (LAC BEGRL1+1
	DAC .+1
USQCTR	XX
	JMP* GETRAL
	.EJECT
/MACRO15  TAPE 7
/
/SQOZING SUBROUTINE
/LAC INPUT LOC
/JMS SQOZE
/OUTPUT IN SQZOUT AND SQZOUT+1
/
SQOZE	0
	JMS UP6INT	/INIT UNPACKING
	DZM SQZOUT	/INITIALIZE SQOZING AREA
	DZM SQZOUT+1
	DZM SQZOUT+2
	LAC AD32		/SQZOUT
	DAC SQZLOC
	LAW -6
	DAC CTR1
	LAW -3
	DAC CTR
SQZNXT	JMS UNPACK	/GET A CHARACTER
	DAC TMP
	LAC LPAREN	/CONSTANT 50
	JMS MPY		/MULTIPLY ACCUMULATED
	LAC* SQZLOC	/SQOZED VALUE BY 50 (8)
	DAC* SQZLOC
	LAC TMP		/CONVERT CHAR TO RADIX 50 (8)
	AND L40
	SNA
	JMP SQZACM	/A-Z
	LAC TMP
	AND K20
	SNA
	JMP NONAN		/.OR %
	LAW -23
	TAD TMP		/0-9
	DAC TMP
	JMP SQZACM
NONAN	LAC L33
	DAC TMP
	LAC UPKCHR	/UNPACKED CHAR
	SAD L56		/.
	INC TMP		/FOR %
SQZACM	LAC* SQZLOC
	TAD TMP		/ADD NEW CHAR INTO
	DAC* SQZLOC	/ACCUMULATED SQOZED VALUE
	ISZ CTR
	SKP
	INC SQZLOC	/UPDATE FOR NEW OUTPUT WORD
	ISZ CTR1		/CHECK FOR 6 CHARS PROCESSED
	JMP SQZNXT	/GET NEXT CHAR
	JMP* SQOZE
SQZOUT	0;	0;	0
/
/5/7 ASCII PACKING SUBROUTINE
/
/DZM CTR57
/LAC (STLOC  -OUTPUT STARTING LOCATION
/DAC PK57AD
/INPUT IN AC
/
PACK57	0
	AND L177
	DAC TMP	/SAVE INPUT CHARACTER
	CLL
	LAC CTR57
	TAD (JMP .+4
	DAC .+2	/GET CHARACTER POSITION
	LAC TMP
	0
	JMP CH571		/1ST CHAR
	JMP CH572	/2ND CHAR
	JMP CH573	/3RD CHAR
	JMP CH574	/4TH CHAR
	JMP CH575	/5TH CHAR
CH571	JMS RIGHT8	/SHIFT AC RIGHT 8-BITS.
	DAC TMP
	LAC* PK57AD
	AND (3777
	JMP END57
CH572	JMS LEFT4		/SHIFT AC LEFT 4-BITS.
	DAC TMP
	LAW 14017
	AND* PK57AD
	JMP END57
CH573	JMS RIGHT3	/3 RIGHT
	AND L17
	DAC TMP1
	LAW 17760
	AND* PK57AD
	XOR TMP1
	DAC* PK57AD
	ISZ PK57AD
	LAC TMP	/GET 2ND HALF
	JMS RIGHT4
	AND IOTLIT
	DAC TMP
	LAC* PK57AD
	AND L57S
	JMP END57
CH574	JMS LEFT8
	DAC TMP
	LAC* PK57AD
	AND (700377
	JMP END57
CH575	RAL
	DAC TMP
	LAW 17400
	AND* PK57AD
	DZM CTR57	/RESET 5/7 COUNTER
	SKP
END57	ISZ CTR57	/SET COUNTER FOR NEXT
	XOR TMP	/MERGE CHARACTER
	DAC* PK57AD	/INTO 5/7 PAIR
	LAC CTR57
	SNA
	ISZ PK57AD
	JMP* PACK57	/EXIT
/
/BINARY TO OCTAL - 1 CHARACTER AT A TIME
/
/CTR=POSITION IN WORD (2'S COMPLEMENT)
/JMS BNOCT
/LAC BNLOC
/ON EXIT; CHAR IN AC
/
BNOCT	0
/ITS ILLEGAL FOR BACKGROUN/FOREGROUND TO DO AN XCT TO AN XCT.
	.IFDEF BF
	LAC* BNOCT
	DAC TT2-1	/CLOBBER THE XCT INSTRUCTION.
	.ENDC
	LAC (JMP BN2
	TAD CTR
	DAC .+2		/GET CHARACTER POSITION
	XCT* BNOCT	/PICK UP INPUT WORD
TT2	0
	JMS RIGHT3	/BITS 0-2
	JMS RIGHT3	/BITS 3-5
	JMS RIGHT3	/BITS 6-8
	JMS RIGHT3	/BITS 9-11
	JMS RIGHT3	/BITS 12-14
	AND L7		/BITS 15-17
BN2	XOR L60
	INC BNOCT		/UPDATE FOR RETURN
	JMP* BNOCT
/
/ROUTINE TO PICK UP SYMBOL VALUE
/
SYMVAL	0
	JMS WRD3
	LAC* MRGLOC
	DAC NUMBR
	JMP* SYMVAL	/RETURN
	.EJECT
/SPECIAL TABLE FOR MACRO PSEUDO-OPS
/
MOPBEG	MOPBEG+1
	.SIXBT '.DEFIN'
	JMP NSTDFN
	.SIXBT '.ENDM'
	JMP .ENDM
	.SIXBT '.ETC'
	JMP .ETC
MOPEND	MOPEND
/
/
/
/
/PSEUDO-OP TABLE
/
POPBEG	POPBEG+1
	.SIXBT /.ABS/
	JMP .ABS		/PDP-15 ABSOLUTE MODE
	.IFUND %PDP9
	.SIXBT /.ABSP/
	JMP .ABSP		/PDP-9 ABSOLUTE FORMAT
	.ENDC
	.SIXBT /.ASCII/
	JMP .ASCII
	.SIXBT /.BLOCK/
	JMP .BLOCK
	.IFUND %PDP9
	.SIXBT	/.DBREL/
	JMP .DBREL
	.ENDC
	.SIXBT /.DEC/
	JMP .DEC
	.SIXBT /.DEFIN/
	JMP .DEFIN
	.SIXBT	/.DSA/
	JMP .DSA
	.IFUND %PDP9
	.SIXBT	/.EBREL/
	JMP .EBREL
	.ENDC
	.SIXBT /.EJECT/
	JMP .EJECT
	.SIXBT /.END/
	JMP .END
	.SIXBT /.ENDC/
ENDCOP	JMP .ENDC
	560517	/.EOT
	240000
	JMP .EOT
	560625	/.FULL
	141400
	JMP .FULL
	.IFUND %PDP9
	.SIXBT	/.FULLP/
	JMP .FULLP	/PDP-15 FULL BINARY MODE
	.ENDC
	.SIXBT	/.GLOBL
	JMP .GLOBL
IFOP	.SIXBT /.IFDEF/
	JMP .IFDEF
	.SIXBT /.IFNEG/
	JMP .IFNEG
	.SIXBT /.IFNOZ/
	JMP .IFNOZ
	.SIXBT /.IFNZR/
	JMP .IFNZR
	.SIXBT /.IFPNZ/
	JMP .IFPNZ
	.SIXBT /.IFPOZ/
	JMP .IFPOZ
	.SIXBT /.IFUND/
	JMP .IFUND
	.SIXBT /.IFZER/
	JMP .IFZER
	.SIXBT	/.IODEV/
	JMP .IODEV
	.SIXBT	/.LOC/
	JMP .LOC
	.SIXBT	/.LST/	/TURN ON LIST SWITCH
	JMP	.LST	/IF 'L' OPTION TYPED.
	.SIXBT	/.NOLST/	/TURN OFF LIST SWITCH
	JMP	.NOLST
	.SIXBT	/.OCT/
	JMP .OCT
	.SIXBT	/.REPT/
	JMP .REPT
	.SIXBT	/.SIXBT/
	JMP .SIXBT
	.SIXBT	/.SIZE/
	JMP .SIZE
	.SIXBT	/.TITLE/
	JMP .TITLE
POPEND	POPEND
	.EJECT
SHRINK	0
	LAC NSWCH
	SNA!CLA
	LAC L2
	XCT* SHRINK
	JMS PRINT
	JMP* SHRINK
/BUFFER ADDRESS IS THE ARG TO THIS SUBROUTINE.
/PRINT LISTING SUBROUTINE AND OUTPUT L.L. BEGINNING CODES.
/IF THE CONDSW SWITCH IS SET, THIS LINE IS IN A CONDITIONALLY DEFINED
/AREA WHERE THE CONDITIONAL IS NOT SATISFIED AND NO OBJECT CODE
/IS PRODUCED.  IF THE 'C' PARAMETER WAS TYPED, THIS LINE WILL BE
/IGNORED AND THE PROGRAM EXITS.
/
PRINT	0
	DAC PRTXXX
	LAC FSTLNE	/FIRST LINE
	SMA		/YES
	JMP NTFLN
	DZM FSTLNE
	JMS TMODE		/WHAT TYPE OUTPUT?
	JMP NTFLN
	LAC PRGSZE
	DAC LLBWRD		/OUTPUT PROG SIZE
	LAC SYMSAV
	SZA
	JMP PFLH4
	LAC LLBWRD
	XOR XCTLIT
	DAC LLBWRD
PFLH4	LAC L1
	DAC LLCODE
	JMS BLDLLB
	LAC L1		/INIT FOR INTERNAL
	JMS GIVS		/OUTPUT INTERNALS
	LAC AD02		/FILE
	JMS SQOZE		/PUT PROG NAME IN RADIX 50
	LAC SQZOUT
	DAC LLBWRD	/DATA WORD
	LAC L7
	DAC LLCODE	/CODE
	LAC SQZOUT+1
	SNA		/4-6 CHARS
	JMP PFLH2		/1-3 CHARS
	LAC SQZOUT
	AND L157S
	XOR XCTLIT	/SET 4-6 CHARS IND
	DAC LLBWRD
PFLH2	JMS BLDLLB	/BUILD L/L BINARY
	LAC SQZOUT+1
	DAC LLBWRD	/CHARS 4-6
	SNA
	JMP PFLH3
	LAC L10
	DAC LLCODE	/CURRENT CODE
	JMS BLDLLB
PFLH3	LAC L23		/PROG NAME CODE
	DAC LLCODE
	LAC XCTLIT
	DAC LLBWRD
	JMS BLDLLB
	SET LASW		/OUTPUT NEW LOAD ADDRESS SWITCH
/
/
NTFLN	LAC CONDSW	/UNDEFINED CONDITIONAL?
	SNA
	JMP NOTCON	/NOT UNDEF COND.
	LAC CSWCH
	SZA
	JMP* PRINT
NOTCON	LAC EXPSW		/IN MACRO EXPANSION
	SNA		/YES
	JMP TSTRPT
/
/THIS LINE IS PART OF MACRO-EXPANSION.
/IF THE GSWCH WAS NOT USED DO NOT PRINT THE LINE.
/THE GSWICH IS ALL INCLUSIVE, THAT IS, ERROR LINES
/ARE NOT PRINTED EITHER.
/
TSTG	LAC GSWCH		/WAS 'G' PARAM TYPED?
LSZA	SZA		
	JMP* PRINT	/YES..EXIT
NOTEXP	ISZ LNCTR	/60 LINES PRINTED
	JMP .+3
	JMS EJECT		/PAGE EJECT ROUTINE
	ISZ LNCTR
	LAC CHRHLD
	DAC TMP
	LAC RDBUF+2
	JMS LEFT8		/ROTATE AC LEFT 8-BITS
	AND L177
	DAC CHRHLD
	JMS CHRLKP	/CHECK FIRST CHARACTER FOR
	157775	/LF. FF OR VT
	SKP	/FOUND
	JMP PRTLNE
	LAC RDBUF+2
	AND (3777
	DAC RDBUF+2	/NULL TO 1ST CHARACTER
/
/PRINT THE SOURCE LINE
/
PRTLNE	LAC TMP
	DAC CHRHLD
	LAC FLGSAV	/ANY ERRORS?
	DAC PRTLNB		/0 IF NO ERRORS
	JMS PRTSOH		/PRINT SOURCE
PRTXXX	XX		/ADDRESS TO BE PRINTED(ARG TO SUB)
PRTLNB	0		/0=NORMAL, 1=ERROR LINE
	JMS PRTINT	/CLEAR OUTPUT AREA
	JMP* PRINT
/
TSTRPT	LAC RPTSW
	SNA
	JMP NOTEXP
	LAC STOPPER
	SZA
	JMP TSTG
	JMP NOTEXP
MOD33B	PRTBUF-1
/
/
/ROUTINE TO PRINT MULTIPLE DEFINITIONS
/ENCOUNTERED IN PASS 1
/
MDER	0
	DZM UPKCTR	/INIT 6 BIT UNPACKING
	DAC UPKLOC	/LOCATION TO UNPACK
			/INIT 5/7 PACKING
	LAC AD09	/TXTBF
	JMS P57INT
	LAW -6
	DAC MDCTR
MDERA	JMS UNPACK	/UNPACK SYMBOL
	SNA
	LAC L40		/ITS 0, INSERT A SPACE
	DAC UPKCHR
	TAD LM33
	SPA!CLA
	LAC L100
	XOR UPKCHR
	JMS PACK57	/5/7 PACKING
	ISZ MDCTR
	JMP MDERA
	JMS PKBLNK	/PACK A BLANK
	LAW -5
	JMS MOVBIN	/BINARY TO OCTAL (VALUE IN S/T)
	LAC* MRGSAV	/POINTER TO WORD 3 OF S/T
	LAC L73	/;
	JMS PACK57
	LAW -5
	JMS MOVBIN	/BINARY TO OCTAL
	LAC PC	/PC AS INPUT
	JMS P57K15
	JMS PRTSOH		/PRINT ERROR
MOD33C	TXTBF-1
EQSIGN	75		/= (CONSTANT)
	JMP* MDER
/
/ROUTINE TO COMPUTE LITERAL STARTING
/LOCATION IN USER SYMBOL TABLE
/COUNT IN CTR (2'S COMPL)
/1ST LOC IN 10
/
LITBEG	0
	LAC LITCTR	/LITERAL COUNT
	JMS TWOS
	DAC CTR	/COUNT IN 2'S COMP
	LAC LITCTR
	RCL		/MULTIPLY BY 3
	TAD LITCTR	/AND SUBTRACT FROM
	JMS TWOS		/SYMBOL TABLE END
	.IFUND %MACI
	.IFUND %PDP9
	XCT EXPAGE	/IS THERE AN EXTRA PAGE AVAILABLE?
	JMP PAG007	/YES..COMPUTE FOR SECTION OVERFLOW.
	.ENDC
	.ENDC
PG0008	TAD USTEND
	DAC* L10
	JMP* LITBEG
/
/EJECT SUBROUTINE
/
/
EJECT	0
	LAC PK57AD	/SAVE POINTERS TO
	DAC SVMCPT	/MACRO TABLE.
	LAC CTR57
	DAC SVMCCT
LM70	LAW -70
	DAC LNCTR
	ISZ PGCTR	/UPDATE PAGE COUNT
	JMS PRTSOH
MOD34	HOF-1
	0
	JMS BINDEC	/CONVERT PAGE COUNT
	LAC PGCTR	/TO DECIMAL
	LAW -3
	JMS MOVEPK
	LAC AD24		/DECOUT+2
	LAC AD23		/P57INT
	JMS PRTSOH		/PRINT HEADING
MOD34A	HDRLNE-1
	0
	JMS PRTSOH		/PRINT LF
MOD34B	LF-1
	0
	LAC SVMCPT	/RESTORE POINTERS TO
	DAC PK57AD	/MACRO TABLE.
	LAC SVMCCT
	DAC CTR57
	JMP* EJECT
	.EJECT
/
/HEADER LINE IMAGE
HDRLNE	.ASCII 'PAGE '
PNMBR	0; 0		/ALLOW 2 WORDS FO PAGE NUMBER.
	.ASCII '     '	/5 SPACES AFTER PAGE # AND BEFORE TITLE.
PRNAIM	0; 0	/PROGRAM NAME
	0; 0	/PROGRAM EXTENSION
TEXTT	0; 0	/1-5 OF TITLE
	0; 0	/6-10
	0; 0	/11-15
	0; 0	/16-20
	0; 0	/21-25
	0; 0	/26-30
	0; 0	/31-35
	0; 0	/36-40
	0	/ALLOW FOR CARRIAGE RETURN
HOF	060320	/FORM FEED,CARRIAGE RETURN.
/
/
/SYSTEM MACROS SYMBOL TABLE
/
SMBEG	SMBEG+1
	.SIXBT /.CLEAR/
	CLEAR.
	.SIXBT /.CLOSE/
	CLOSE.
	.SIXBT /.DLETE/
	DLETE.
	.SIXBT /.ENTER/
	ENTER.
	.SIXBT /.EXIT/
	EXIT.
	.SIXBT /.FSTAT/
	FSTAT.
	.IFDEF	BF
	.SIXBT	/.IDLE/
	IDLE.
	.SIXBT	/.IDLEC/
	IDLEC.
	.ENDC
	.SIXBT /.INIT/
	INIT.
	.SIXBT /.MTAPE/
	MTAPE.
	.SIXBT /.READ/
	READ.
	.IFDEF	BF
	.SIXBT	/.REALR/
	REALR.
	.SIXBT	/.REALW/
	REALW.
	.ENDC
	.SIXBT /.RENAM/
	RENAM.
	.IFDEF	BF
	.SIXBT	/.RLXIT/
	RLXIT.
	.ENDC
	.SIXBT /.SEEK/
	SEEK.
	.SIXBT /.TIMER/
	TIMER.
	.SIXBT /.TRAN/
	TRAN.
	.SIXBT /.WAIT/
	WAIT.
	.SIXBT /.WAITR/
	WAITR.
	.SIXBT /.WRITE/
	WRITE.
SMEND	SMEND
/SYSTEM MACROS DEFINITIONS
/
CLEAR.	.ASCII <11>/CAL /<001><000>/&777/<15><11>/5/<15><177>
/
CLOSE.	.ASCII <11>/CAL /<001><000>/&777/<15><11>/6/<15><177>
/
DLETE.	.ASCII <11>/CAL+1000 /<001><000>/&777/<15><11>/2/<15>
	.ASCII <11><001><001><15><177>
/
ENTER.	.ASCII <11>/CAL /<001><000>/&777/<15><11>/4/<15>
	.ASCII <11><001><001><15><177>
/
EXIT.	.ASCII <11>/CAL/<15><11>/15/<15><177>
/
FSTAT.	.ASCII <11>/CAL+3000 /<001><000>/&777/<15><11>/2/<15>
	.ASCII <11><001><001><15><177>
	.IFDEF	BF
/
IDLE.	.ASCII <11>/CAL/<15><11>/17/<15><177>
/
IDLEC.	.ASCII <11>/CAL+1000/<15><11>/17/<15><177>
	.ENDC
/
INIT.	.ASCII <11>/CAL+/<001><001>/*1000 /<001><000>
	.ASCII /&777/<15><11>/1/<15><11><001><002>/+0/<15><11>/0/<15><177>
/
MTAPE.	.ASCII <11>/CAL+/<001><001>/*1000 /<001><000>
	.ASCII /&777/<15><11>/7/<15><177>
/
READ.	.ASCII <11>/CAL+/<001><001>/*1000 /<001><000>
	.ASCII /&777/<15><11>/10/<15><11>
	.ASCII <001><002><15><11>/.DEC/<15><11>
	.ASCII /-/<001><003><15><177>
	.IFDEF	BF
/
REALR.	.ASCII <11>/CAL+/<001><001>/*1000+10000 /<001>
	.ASCII <0>/&777/<15><11>/10/<15>
	.ASCII <11><001><002><15><11>/.DEC/<15>
	.ASCII <11>/-/<001><003><15>
	.ASCII <11>/.OCT/<15><11><001><005>/+/
	.ASCII /0*100000+/<001><004><15><177>
/
REALW.	.ASCII <11>/CAL+/<001><001>/*1000+10000 /<001>
	.ASCII <0>/&777/<15><11>/11/<15>
	.ASCII <11><001><002><15><11>/.DEC/<15>
	.ASCII <11>/-/<001><003><15>
	.ASCII <11>/.OCT/<15><11><001><005>/+/
	.ASCII /0*100000+/<001><004><15><177>
	.ENDC
RENAM.	.ASCII <11>/CAL+2000 /<001><000>/&777/<15><11>/2/<15>
	.ASCII <11><001><001><15><177>
	.IFDEF	BF
/
RLXIT.	.ASCII	<11>/CAL /
	.ASCII <001><000><15><11>/20/<15><177>
	.ENDC
/
SEEK.	.ASCII <11>/CAL /<001><000>/&777/<15><11>/3/<15>
	.ASCII <11><001><001><15><177>
/
TIMER.	.ASCII <11>/CAL/<15><11>/14/<15><11>
	.ASCII <001><002>/+0*100000+/<001><001><15>
	.ASCII <11>/.DEC/
	.ASCII <15><11>/-/<001><000><15><177>
/
TRAN.	.ASCII <11><001><005>/+CAL*2+/
	.ASCII <001><001>/*1000 /<001><000>
	.ASCII /&777/<15><11>/13/<15><11>
	.ASCII <001><002><15><11><001>
	.ASCII <003><15><11>/.DEC/<15><11>/-/
	.ASCII <001><004><15><177>
/
WAIT.	.ASCII <11>/CAL /<001><000>/&777/<15><11>/12/<15><177>
/
WAITR.	.ASCII <11>/CAL+1000 /<001><000>/&777/<15><11>/12/
	.ASCII <15><11><001><001><15><177>
/
WRITE.	.ASCII <11>/CAL+/<001><001>/*1000 /<001><000>
	.ASCII /&777/<15><11>/11/<15><11>
	.ASCII <001><002><15><11>/.DEC/<15><11>
	.ASCII /-/<001><003><15><177>
/
/END OF SYSTEM MACROS DEFINITIONS
	.EJECT
/
/GET BEGINNING OF SYMBOL TABLE
/
GBST	0
	LAC BEGUST
	DAC USTBEG
	JMS CKEST
	JMP* GBST		/NO SYMBOLS RETURN
	ISZ GBST
	JMP* GBST
/GET INTERNAL OR VIRTUAL SYMBOLS
/
GIVS	0
	DAC IOVS
	JMS GBST		/GET START OF S/T
	JMP* GIVS		/NO SYMBOLS
GIVSN	JMS LLSTBL
IOVS	0		/1=INTERNAL, 2=VIRTUAL
	ISZ USTBEG
	JMS USTB2
	JMS CKEST		/FINISHED
	JMP* GIVS		/YES
	JMP GIVSN		/NO
/
/BINARY TO DECIMAL SUBROUTINE
/
/JMS BINDEC
/LAC INPUT LOCATION
/OUTPUT IN DECOUT THRU DECOUT+5
/
BINDEC	0
	LAC L40
	.REPT 6,1
	DAC DECOUT
	XCT* BINDEC	/PICK UP INPUT
	DAC BNDVND	/SAVE AS DIVIDEND
	LAC AD31	/DECOUT+5
	DAC DECLOC
DVDREM	JMS DIVIDE	/DIVIDE BY 10 DECIMAL
	LAC BNDVND
	LAC L12
	DAC BNDVND
	LAC DVD
	XOR L60		/REMAINDER IS DECIMAL
	DAC* DECLOC	/DIGIT
	JMS SUB1		/DECLOC=DECLOC-1
	DAC DECLOC
	LAC BNDVND	/IF QUOTIENT IS 0
	SNA	/EXIT, ELSE MAKE
	JMP* BINDEC	/QUOTIENT NEW DIVIDEND
	JMP DVDREM
DECOUT	0
	0
	0
	0
	0
	0
/
/PRINTING ROUTINE
/
/JMS PRTSOH
/AREA-1 TO BE PRINTED
/0 OR 1; 0=NORMAL LINE, 1=ERROR LINE
PRTSOH	0
	LAC* PRTSOH
	DAC CLEARS		/AREA-1 TO BE MOVED
	ISZ PRTSOH
	LAC* PRTSOH	/TYPE OF LINE
	/0=NORMAL, 1=ERROR
	ISZ PRTSOH	/UPDATE FOR RETURN
	TAD ALOPTN	/LISTING OR S/T REQUESTED
	SNA		/YES
	JMP* PRTSOH	/NO, EXIT
	.IFUND %MACI
PRTA	CAL+766		/WAIT FOR -12
	12
/
	.ENDC
	LAW -70
	JMS MOVER
	LAC CLEARS	/AREA-1 TO BE MOVED
	LAC AD36		/PRTLIN+1
/
/COMPUTE WORD/PAIR COUNT OF LISTING LINE
/
	LAC CHRHLD
	DAC MP1
	LAC UPKAD		/SAVE UNPACKING VALUES
	DAC MP2
	LAC PKNUM
	DAC MP3
	LAC AD45		/PRTLIN+2 (UNPACKING LOCATION)
	JMS USET57
	JMS GETCHR	/GET A CHARACTER
	SAD L15		/CR
	SKP
	JMP .-3
	LAC AD45		/PRTLIN+2
	JMS TWOS		/TWOS COMPLEMENT
	TAD K4
	TAD UPKAD		/GET END - BEG
	JMS LEFT8
	AND (077000
	DAC PRTLIN	/WORD/PAIR COUNT
	LAC MP1
	DAC CHRHLD
	LAC MP2
	DAC UPKAD		/RESTORE UNPACKING VALUES
	LAC MP3
	DAC PKNUM
	.IFUND %MACI
/
PRTB	CAL+2766		/WRITE ON -12
	11
MOD37	PRTLIN
	-72
/
	.ENDC
	.IFDEF %MACI
	LAC DSWCH
	SNA
	JMP TTYPRT
	JMS DWRITE
	PRTLIN
	JMP* PRTSOH
TTYPRT	JMS TTYOUT
	PRTLIN
	.ENDC
	JMP* PRTSOH
/
/BANK BITS INITIALIZATION ROUTINE.
/WILL BE OVERLAYED
/
PRTLIN	034500;	0	/PRINT BUFFER
INITBB=.
	.IFUND %MACI
	LAC* L103
	AND INTOV1	/PICK UP BANK BITS
	XOR INTOV2
	DAC BNKBTS	/FROM MONITOR
	ADCT		/ADCON COUNT
	DAC CTR
	LAC INTOV3
	XOR BNKBTS
	DAC* L10		/FIRST LOC-1 OF TABLE
	DAC* L11		/OF ADCONS
LOOP	LAC* 10
	XOR BNKBTS
	DAC* 11
	ISZ CTR
	JMP LOOP
/
/ROUTINE TO SET BANK BITS IN LOCATIONS
/SCATTERED THROUGHOUT THE PROGRAM
/
	MODCT		/LOCATION COUNT
	DAC CTR
	LAC AD00		/MODF
	DAC TMP		/FIRST LOC. OF TABLE
LOOP1	LAC* TMP
	XOR BNKBTS	/ADD ON BANK BITS
	DAC TMP1
	LAC* TMP1
	XOR BNKBTS
	DAC* TMP1
	ISZ TMP
	ISZ CTR
	JMP LOOP1
/IF THERE IS AN EXTRA PAGE AVAILABLE THE EXPAGE SWITCH MUST
/BE SET TO NOP.  COMPUTE FOR THE TOP AND BOTTOM OF THE EXTRA,
/IT MUST BE AN INTEGRAL OF 3.
	.IFUND %PDP9
	LAC* L120		/IS THERE AN EXTRA 4K AVAILABLE?
	SMA
	JMP PASS1		/NO..PROCEED WITH ASSEMBLY
	AND L47S		/LOW-ORDER 12-BITS.
	JMS TWOS		/SUBTRACT IT FROM TOP (7777).
	TAD L47S
	DAC SEARCH	/DIFFERENCE
	TAD* L120		/POINTER TO TOP.
	AND L57S
	DAC PAGTOP
	JMS DIVIDE	/GET # OF 3 WORD SYMBOLS THAT CAN FIT.
	LAC SEARCH
	LAC L3
	DAC MERGE		/
	SNA		/NO SYM WILL FIT
	JMP PASS1
	JMS MPY
	LAC L3
	JMS TWOS
	TAD PAGTOP
	DAC SCOM20
	LAC NOPLIT
	DAC EXPAGE
	.ENDC
	.ENDC
	JMP PASS1		/PROCEED WITH ASSEMBLY
INTOV1	60000
INTOV2	BANK*20000
INTOV3	ADF-1
	.BLOCK	INITBB-.+70
	.IFUND %MACI
/
/SOURCE INPUT DOUBLE BUFFERING
/
DBLBUF	0
	LAC L770
	TAD NOIN2		/SECONDARY REQUEST
	DAC .+1
	CAL+767		/WAIT FOR SOURCE - PRIMARY OR SECONDARY
	12
	LAC SRCBUF
	AND L17
	SAD L6
	JMP .EOT
	SAD L5		/CONTROL D ENCOUNTERED
	JMP .EOT
	LAW -44
	JMS MOVER
	LAC AD03		/SRCBUF-1
	LAC AD04		/RDBUF-1
	JMS RDSRC		/READ NEXT SOURCE LINE
	LAC RDLST
	AND IOTLIT
	XOR (6400		/CR IN
	DAC RDLST		/PSN 74
	JMS UPBLB		/RESET TO RDBUF+2
	JMP* DBLBUF
/
/READ SOURCE ASCII INPUT
/
RDSRC	0
	LAC (CAL+2770
	TAD NOIN2		/SECONDARY REQUEST
	DAC .+1
	CAL+2767		/READ IOPS ASCII
	10
MOD38	SRCBUF
	-44
	JMP* RDSRC
SRCBUF	.BLOCK 44	/SOURCE BUFFER
	.ENDC
/
/ADDRESS CONSTANTS WHICH REQUIRE
/BANK BITS TO BE APPENDED
/
ADF=.
AD00	MODF
AD01	RDBUF+2
ADTXT	TXTOP+1	/FUDGE RETURN ADDRESS OF TEXT CHECKER(.SIXBT,ASCII)
AD02	FILE
	.IFUND %MACI
AD03	SRCBUF-1
AD05	NEWTAP
	.ENDC
AD04	RDBUF-1
AD06	PACKT
AD08	PACKS
AD09	TXTBF
AD110	STOPPER-1		/POINT TO FLAG WORD.
AD13	TXTBF-1
AD143	HDRLNE+5
ADTITX	TEXTT
AD16	UNSQZV-1
ADPNAM	PRNAIM
AD17	ENDVAL
AD20	UNSQZV
AD23	PNMBR		/PAGE NUMBER
AD24	DECOUT+2
AD25	BNADDR-1
	BNDATA-1
AD27	PTPBUF+1
ADBEG	START-1	/FOR OVERLAYING EXTRA PAGE CODE.
AD29	IOPHDR-1
AD30	PTPBUF-1
AD31	DECOUT+5
ADS0	PSIZEE		/SIZE OF PROGRAM
AD32	SQZOUT
AD333	PRTBUF-1
AD34	FULHRW+1
AD36	PRTLIN+1
AD37	PASS2
AD38	ERNMBR
AD39	RDLST
AD40	DECOUT-1
AD41	BP1T-1
AD42	BP12T-1
AD43	BST-1
AD45	PRTLIN+2
TOP	START
	.IFUND %MACI
	.IFUND %PDP9
AD50	LODMOD+1
	.ENDC
	.ENDC
AD511	DECOUT+1		/ADDR-1 OF DECIMAL SEQ IMAGES.
AD666	RDBUF-6		/
AD667	RDBUF-7
AD222	PRTBUF
ADL=.
ADCT=ADL-ADF\777777+1
	.EJECT
	.IFDEF %MACI
RDSRC	0
	LAC TSWCH
	SNA
	JMP RDTAPI
	JMS TTYIN
	LAC TTCHR	/CONTROL D?
	SAD L4
	JMP .EOT
	JMP RDEXIT
RDTAPI	JMS DREAD
	LAC DTIBUF	/CHECK HEADER
	AND L17
	SAD L6
	JMP .EOT
	SAD L5
	JMP .EOT
	LAW -44
	JMS MOVER
	LAC LIBUF1
	LAC AD04
	LAC RDLST
	AND IOTLIT
	XOR (6400
	DAC RDLST
RDEXIT	JMS UPBLB
	JMP* RDSRC
	.ENDC
	.ENDC
/MACRO-15 CONSTANTS*********
LPAREN	50		/(
RPAREN	51		/)
VARAB	43		/#
L126	126		/V
L107	107		/G
LEFTAB	74		/<
RITEAB	76		/>
L170	170
L7	7
L60	60
L17	17
L47S	7777
L37S	777
L26	26
L77	77
L27	27
L30	30
L33	33
L147S	17777
L347S	37777
L357S	377777
L31	31
L32	32
L23	23
L157S	177777
L57S	77777
	.IFDEF %MACI
L42	42
L6	6
L175	175
L137	137
L4	4
LM35	-35
LM33	-33
LITNO	.ASCII	'NO'
	.LOC .-1
	.ENDC
	.IFUND %MACI
	.IFDEF %PDP9
L42	42
L6	6
L4	4
	.ENDC
	.ENDC	/AN EXTRA ONE
	.ENDC
/THE FOLLOWING PAGE CONSTANT ARE SET BY THE INITBB
/ROUTINE AND STAY CONSTANT FOR THE ENTIRE CORE LOAD.
EXPAGE	SKP		/SKP IF NO XTRA PAGE, NOP OTHERWISE.
/
/
/
/MACRO-15 TEMP STORAGE
OPRTR	0
MRGSAV	0
PRGSVE	0
SYMSAV	0
VARLOC	0
UNDLOC	0
EXTLOC	0
EXTLC1	0
LITLOC	0
USTBEG	0
SZECTR	0
SIXCTR	0
BEGDEF	0
ENDVAL	0
NUMVAL	0
UNSQZL	0
CHRHLD	0
WORDCT	0
MRGLOC	0
CMPLOC	0
TMPT	0
BEGUST	0		/BOTTOM OF USER SYMBOL TABLE.
TMP	0
BEGRAL	0
BITS	0
PRGSZE	0
CT57SV	0
PK57SC	0
BEGDAL	0
.NLSW	0		/.NOLST ENCOUNTERED SWITCH.
LLWDCT	0
LLBWRD	0
LLCODE	0
LLBCDE	0
MACLOC	0
CHVDA	0
RANUM	0
BRKCTR	0
ENDUMT	0
DATYPE	0
SAVDA1	0
SAVDA	0
SVUPK	0
SVPKNM	0
CSBVAL	0
DFNCTR	0
BNKBTS	0
CTR	0
DECLOC	0
CTRMX5	0
TXTLOC	0
TXTCTR	0
PASSNO	0
USTEND	0
PK57AD	0
CTR57	0
PKLOC	0
UPKCTR	0
UPKLOC	0
UPKCHR	0
UPKAD	0
PKNUM	0
NUMBR	0
PK57SV	0
CTR1	0
LNCTR	0
RPTCTR	0
RPTINC	0
BNDVND	0
TMP1	0
NOIN2	0
SYMTYP	0
FSTLNE	0
OPSAV	0
SWD1	0
SWD2	0
SWD3	0
TT1	0
	.EJECT
TT3	0
/SHARED TEMPORARY STORAGE.
ABSADR=ERRORX
L130=ERTBL	/X
ABSCNT=ERRORA
FIXCNT=ERRORA
INCR=ERRORI
TMPI=ERRORA
SVMCPT=ERRORQ
SVMCCT=ERRORM
DLMTR=ERRORX		/DELIMITER IN TEXT ROUTINES.
ANGLVL=ERRORI		/ANGLE BRACKET EXALUATOR
BPXRES=GBST
BOPPC=GIVS
BOPADR=IOVS
TXTYP=SRCUST
MDCTR=BOPADR
FILE=START
UNSQ=PRTINT
SQZLOC=TORC
NXHVL=TORC+1
CTRSPA=GIVS
INC=ISZ
SET=ISZ
CTRLK=TMODE
MP1=ERRORA
MP2=ERRORB
MP3=ERRORD
MP5=ERRORW
DV1=NUMEVL
DVD=TMODE
SYMBLS=TORC
ANDXOR=SUB1
DVS=INTUPN
TITCNT=GETRST
XLIT=K10000
	.IFDEF PTP
	.END BANK*20000+17720
	.ENDC
	.IFUND %MACI
	.END
	.ENDC
	.EOT
	.ENDC
