          .TITLE IMBED-MACRO AND F4 I/O
/COPYRIGHT 1970, DIGITAL EQUIPMENT CORP., MAYNARD,MASS.
/
/EDIT# 001   8.20.70
/
/IOT ASSIGNMENTS
TLS=700406
TSF=700401
TCF=700402
KRB=700312
KRS=700322
KSF=700301
IORS=700314
DTCA=707541
DTXA=707544
DTLA=707545
DTRA=707552
DTEF=707561
DTRB=707572
DTDF=707601
SET=ISZ
INC=ISZ
.BOOT=17646
LOC0=0
AUTO13=13
AUTO16=16
	.LOC 1
	JMP SKPCHN	/(1) DETERMINE INTERRUPT SOURCE
	0		/(2) IORS STATUS IF UNKNOWN INTERRUPT.
DTUDRR	0		/(3) B-STATUS IF DECTAPE ERROR.
	0		/(4) PROGRAM COUNTER IF CAL* EXECUTED.
	JMP IOPS01	/(5) ERROR ROUTINE FOR IOPS 01.
LFAKE	DTFAKE
LILNK	DTILNK
	0		/(10) AUTO-INDEX REGISTERS
	.LOC 20
	4		/(20) PC IF  CAL OR DISPATCHER IF  CAL*.
	JMP IOPS00	/(21) IOPS 00 OF IMBED ROUTINE.
/
/
DIUN	100000		/ INPUT DECTAPE UNIT #
DOUN	200000		/ OUTPUT DECTAPE UNIT #
LFILE	FILE
L21400	21400
CCOUNT	0
LFPIN	FMAPIN
	.LOC 30
LOC30	760163
LOC31	31
	.EJECT
	.LOC 32
/ALL BUFFERS..........
DTOBIT	.BLOCK 40			/OUTPUT FILE BIT MAP.
DTIBUF	.BLOCK	377		/DTA BUFFER INPUT FILE
DTILNK	0
				/DTA DIRECTORY BIT MAP.
DTDBIT	.BLOCK 40
DTOBUF	.BLOCK 377		/DTA OUTPUT BUFFER.
DTOLNK	0
/
/
/
DTNXBK	0		/BL.# TO BE TRANSFERRED
DTCNBK	0		/DATA LINK (NEXT BL.#)
DTCURE	0		/DIR. POINTER TO CURR. FILE ENTRY EXAMINED
DTEOF	0	/EOF SWITCH, -0=EOF
DTHPT	0	/DTA BUF. LINE HEADER POINTER (INDEXED)
DTIOSW	0		/I/O SWITCH, 0=INPUT, 1=OUTPUT
DTRHPT	0		/DTA BUF. LINE HEADER POINTER (.READ)
DTDTR	0		/TRANSF. DIRECT. SWITCH,0=F,-1=R
DTBFCT	0		/BUFFER COUNT (INIT=-377)
DTFPCT	0		/FILE ENTRY COUNT
DBLKLC	0		/24,56 ENTRY SWITCH(50=24;10=56)
DTUNIT	0		/(0-2)=DTA UNIT# FOR TRANSFER
DTCL07	0		/SAVE THE ENTRY POINT IN DIR FOR DCLOSE.
DTCCA	0	/CURRENT ADDR. (C.A.) POINTER FOR TRANSFER
DTCT1	NOP		/GEN. PURP. COUNTER AND T. STOR.
DTCT2	0		/GEN PURP COUNT AND STORE
DTDATC	0		/LINE DATA COUNT
DTHPTS	0		/DTA BUF. LINE HEADER POINTER
DTTR	0			/DTA SEARCH-READ(13000) OR SEARCH-WRITE(15000)CONVERSION FACTOR
DTUCKP	0			/USER LINE BUF. CHECKSUM POINTER
DTUDP	0			/USER LINE BUF DATA POINTER (MODIFIED)
DTUHP	0			/USER LINE BUF. HEADER POINTER
DTUND	0			/I/O UNDERWAY SWITCH,-=BUSY,0=NOT BUSY
DTWC	0			/2'S COMP TRANSFER WORD COUNT
DTCKSM	0			/LINE CHECKSUM
DTCT	0			/GEN. PURPOSE COUNTER=T.STORE
DTSAFE	0			/BL.# SAFE STORAGE DURING TRANSFER
DTEOTZ	0			/DOUBLE END ZONE SW(0=SET,-0=CLEAR
DTSAFD	0			/DIRECTION SW,SAFE DURING TRANSFER
DTDIRA	0			/BIT MAP DIRECTION SW(CURR BL)+1=F,-1=R
DTDIRL	0			/DTDIRA FOR LAST BLOCKTRANSFERRED
DTMTRX	0			/CURR BIT MAP WD POINTER
DTRBIT	0			/18 BIT COUNTER FOR BIT MAP SEARCH
DTRELB	0			/FREE BL # AFTER BIT MAP SEARCH
DTSBIT	0			/-(MATRIX WORD)
DTTBIT	0			/TEST BIT FOR BIT MAP SEARCH
DTWMCT	0			/BIT MAP WORD COUNT
DTBMPT	0			/BIT MAP 1 POINTER
DTBLOK	0			/BLOCK EXAMINED COUNT
DTPONT	0			/CURR FILE BIT MAP POINTER
DTOBCK	0			/T STORE
DTBMCT	0		/BIT MAP SEARCH COUNT
DT2XOR	0			/T STORE
DNTRY1	0
OUTPTR	0
DTINXB	0			/LAST BLOCK # READ.
DTCIP	0			/TOP OF CURRENT INPUT LINE POINTER.
DTAC	0			/AC SAVED DURING DECTAPE INTERRUPT
DOUT	0			/PC SAVED DURING INTERRUPT
DTT2	0			/'A' STATUS REGISTER SAVED.
DTBCA	0			/SAVE BLOCK # DURING SEARCH.
DTERCT	0			/PARITY COUNT (INIT TO -10(8)).
DTBLC	0			/BLOCK # BEING SEARCHED FOR
DTBLNC	0			/BLOCK INCREMENT TO CHANGE DIRECTION
DTEOTS	0			/END ZONE ENTERED SWITCH (-=EOT,+=NOTEOT)
DTUDRP	0
DTCTS	0
DTCT1S	0
DTDES	0
DTUWC	0
DTWPC	0
EXITSW	0	/PROCESSING A CONTROL C SWITCH.
DTSAMS	0
KYBSY	0
IMBEDE=.				/END
/DECTAPE FLAGS
/STATUS B-0=EF
/	1=MK. TK. ERR
/	2=EOT
/	3=SELECT ERR	/WILL PRODUCE IOPS4.
/	4=PARITY ERR.
/	5=TIMING ERR.
/	11=DTF
/STATUS A-0-2=UNIT#
/	3=FORW.(0),REV(1)
/	4=GO(1),STOP(0)
/	5=NORM.(0),CONT.(1)
/	6-8=FUNCTION
/	9=DISABLE DTF,EF(0),ENABLE(1)
/	10=CLEAR EF(0)
/	11=CLEAR DTF(0)
/
/
/SKIP CHAIN
/
SKPCHN	DTDF		/DECTAPE DONE FLAG?
	SKP
	JMP DTINT
	KSF		/KEYBOARD FLAG?
	SKP
	JMP KYSVC
	DTEF
	JMP IOPS03
/
/DTA INTERRUPT SERVICE
DTINT	DAC DTAC			/SAVE AC
	LAC 0			/PIC PC,L,EM,MP DTFAKE+2=0
	DAC DOUT			/SAVE FOR EXIT
	LAC DTUND			/I/O UNDERWAY SWITCH STILL ON?
	SZA
	JMP DTRBB			/NO-STOP TAPE
	DTLA			/CLEAR CONTROL
	JMP DTXIOT+1		/AND EXIT.
DTRBB	DTRB			/READ DTA STATUS B
	SMA
/
/(DTDIS = JMP DTSRCK ON SEARCH)
/(DTDIS = JMP DTRDWT ON READ OR WRITE)
/
DTDIS	XX		/SHIFT AC LEFT TWICE GO THE EOT
	AND L334Z	/BIT IS IN 0.
	JMP LTEND1	/NOT EQ TEST FOR END
/MERGE THE LIT AT SQZOUT-SQZOUT+2 INTO RUST. USE THE SRCUST ROUTINE TO
/FIND A PLACE FOR IT. THIS SUBR. IS USED BY BOTH PASSES AND IS THE ONLY
/PLACE THE THE LITERAL COUNT IS EVER INCREMENTED.
/
MLITER	0
	LAC L2
	JMS SRCUST	/SET UP FOR MERGE.
NOPLIT	NOP
	JMS MERGE
	INC LITCTR
	JMS SUB1		/DON'T COUNT LITS AS USER SYMBOLS
	DAC USTSZE
	JMP* MLITER
LITBEG	0
	LAC LITCTR
	JMS TWOS
	DAC CTR
	LAC BEGUST
	DAC* L12
	JMP* LITBEG
	.TITLE PASS 2 LITERAL PROCESSING
/
LPROC2	LAC LITCTR
	SNA
	JMP LNOTIN
	JMS LITBEG	/SET TO BEGINNING OF TABLE
LITNXT=.
	.IFUND %MACI
	.IFUND %BF9
	.IFUND %BF15
	IFUNA XCT,EXPAGE,JMS,TSTXLT
	.ENDC
	.ENDC
	.ENDC
	LAC* 12
	DAC LWORD2	/SAVE RELOC BITS OF THE LITERAL.
	RCL		/PUT DEFINED/UNDEFINED BIT IN LINK
	LAC* 12
	IDX* L12	/INC PTR TO WORD1 OF NEXT LIT
	DAC LWORD3
	SNL		/WAS THIS LIT DEF IN PASS1?
	JMP DEFYES	/YES..GO TEST WORD3 VALUE
	SAD PC		/NO.. TEST THE PC VALUE.
	JMP DEFNO	/THIS IS THE ONE.
LTEND2	ISZ CTR		/NOT FOUND YET ,HAS THE WHOLE TABLE BEEN CHECKED?
	JMP LITNXT	/NO..GET THE NEXT LIT.
/THE LITERAL IS NOT IN THE TABLE. PUT IT IN IF THE MAX HASN'T BEEN
/REACHED.
LNOTIN=.
	LAC MAXLIT	/MAXIMUM NO OF LITS IN THIS SECTION.
	JMS TWOS
	TAD LITCTR	/SUB FROM PASS2 COUNT.
	SMA		/ITS OK IF NEG. GO AHEAD INSERT IT.
	JMP ERRLIT	/NO.. IT WON'T FIT FLAG IT.
	JMS MLITER	/MERGE IT IN
	JMP LPROC2	/START OVER WITH PASS2 CODE.
ERRLIT	SET ERRORL
	DZM WRDVAL
	JMP CKFTG	/WIPE OUT THE ENTIRE WORD.
/AT DEFYES THE LIT WAS DEFINED IN PASS1(WORD2 POSITIVE).
/
DEFYES	SAD SQZOUT+2
	SKP		/WORD3 OF BOTH ARE EQUAL,CK REL BITS.
	JMP LTEND2
	LAC LWORD2
	SAD SQZOUT+1
	JMP USELIT	/THE REL BITS ARE EQ  USE THIS LIT
	JMP LTEND2
/AT DEFNO A LITERAL IS IN THAT WAS NOT DEFINED IN PASS1.
/
DEFNO	JMS SETSQZ	/SET UP FOR MOVING IN DEFINED VALUES
	JMS MRGSYM
USELIT	JMS SETSQZ	/AC HAS LIT NUMBER.
	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	/USE AS FLAG FOR AAX (12	/CHECK FOR NINE-BIT OPERATORS3:::NINE-BIT ERROR
	JMP WRDEVL+2
	.ENDC
	.IFDEF %PDP9
	JMP WRDEVL
	.ENDC
SETSQZ	0
	LAW -3
	TAD* L12	/12 IS POINTING TO WORD1 OF NEXT LIT.
	DAC MRGLOC	/ADJUST TO THIS LIT
	LAC* MRGLOC	/USE  LIT COUNT VALUE TO
	DAC SQZOUT	/BUILD LITERAL LOCATION
	JMP* SETSQZ
/
/THE LITERAL TABLE IS AT THE BOTTOM OF THE RESIDENT UST.
/ADJUST THE BOTTOM SO THAT THE LITERAL TABLE IS NO LONGER
/POINTED TO(EXIT WITH TRUE SYM PTR IN AC)
/
DROPLT	0
	LAC LITCTR
	RCL
	TAD LITCTR
	TAD BEGUST
	.IFUND %MACI
	.IFUND %BF9
	.IFUND %BF15
	IFUNA XCT,EXPAGE,JMP,DRPLTX
	.ENDC
	.ENDC
	.ENDC
	.ENDC
DROPLA	DAC BEGUST
	DZM LITCTR
	JMP* DROPLT
/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
	SET ERRORX
	LAC K10000	/TURN ON BIT 5.
	JMS PAGBIT
	.ENDC
	.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	SET ERRORA	/A TO FLAG WORD
	JMP OUTPUT
	.IFUND %BFA
MODETR	0
	LAC BMODE
	SZA
	IDX 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
	.ENDC
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
	.IFUND %BF9A
	.IFUND %BF15A
	JMS TMODE	/BUILD LOCATION TYPE.
	JMP TLOCR+1	/FULL OR ABS =3 SPACES.
	.ENDC
	.ENDC
	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.
	.IFUND %BF9A
	.IFUND %BF15A
	JMS TMODE
	JMP NABS+1
	.ENDC
	.ENDC
	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 EFLGN	/THE NUMBER OF FLAGS=ERRORX-ERRORA
	DAC CTR
	LAW -4		/PRINT FIVE CHARS (SPACES OR FLAGS).
	DAC CTRMX5
	LAC LL101	/FIRST ERROR FLAG IMAGE.
	DAC OUTFLG
	LAC EFLAGS	/POINTER TO ERRORA (TOP OF ERROR TABLE)
	DAC FLGPTR
ELUPE	LAC* FLGPTR
	SNA
	JMP NOFLGN
OUTFLG	XX
	JMS PACK57
	SET FLGSAV
	ISZ CTRMX5	/HAVE FOUR FLAGS BEEN PRINTED?
	SKP		/NO KEEP GOING
	JMP* SEQERF	/YES...EXIT.
NOFLGN	IDX OUTFLG
	IDX FLGPTR
	ISZ CTR
	JMP ELUPE
OUTSP5	LAC CTRMX5	/OUTPUT FILLER SPACES.
	JMS SPACKS
	JMP* SEQERF
OUT3EX	0
	.IFUND %BF9A
	.IFUND %BF15A
	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
	.ENDC
	.ENDC
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
	.TITLE ERRORS AND OBJECT CODE GENERATOR.
/ERROR FLAG TABLE
/
L101	101	/A
L102	102	/B
L104	104	/D
L105	105	/E
L106	106	/F
L111	111	/I
L114	114	/L
L115	115	/M
L116	116	/N
L120	120	/P
	121	/Q
L122	122	/R
L123	123	/S
L124	124	/-T- INSTEAD OF V.
L125	125	/U
	127	/W
ERTBL	130	/X
L117	117	/-O- INSTEAD OF F.
L103	103	/C
/
OUTPUT	XCT PASSNO	/WHICH PASS1
	.IFUND BIGMAC
	JMP OUTPC	/PASS1
	.ENDC
	.IFDEF BIGMAC
	JMP OBJLST+1
	.ENDC
	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
	.IFUND %BF9A
	.IFUND %BF15A
	JMS BLDBIN	/BUILD BINARY OUTPUT
	.ENDC
	.ENDC
	DZM BSSW
	JMP CKMWD
INCPC2	LAC LOCSW	/CHECK FOR .LOC
	SNA
	JMP INCPC1
	ISZ LASW
	JMS CKFLLB	/LINK LOADER RTNE
	.IFUND %BF9A
	.IFUND %BF15A
	JMS BLDBIN	/BUILD BINARY OUTPUT
	.ENDC
	.ENDC
	DZM LOCSW
	JMP CKMWD
	.ENDC
	.ENDC
INCPC1	LAC PASW	/IS LINE A P/A
	SZA		/NO
	JMP CKMWD	/YES
INCBIN	JMS CKFLLB
	IFUNA JMS,BLDBIN
	ISZ PC		/UPDATE PC BY 1
	LAC TEXTSW	/TEXT SWITCH ON
	SNA		/YES
	.IFDEF %BF9A
CKRPT=CKMWD
	.ENDC
	.IFDEF %BF15A
CKRPT=CKMWD
	.ENDC
	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
	.IFUND %BF9A
	.IFUND %BF15A
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
	.ENDC
	.ENDC
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
	DZM TEMP00
	.IFUND %PDP9
	SAD XREG
	SKP
	JMP .+3		/OK CONTINUE PROCESSING TAG.
	SET ERRORT	/TAG ERROR.
	JMP OUTPUT	/IGNORE TAG.
	.ENDC
	LAC LOCVAR	/IS THIS A # TAG IN A LOCAL AREA?
	SNA		/IF SO DO NOT TURN ON TAGSW(FAKEOUT MERGE).
	SET TAGSW	/TURN ON TAG SWITCH
	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
/
	LAC WRDVAL	/STORE PARAM VALUE  FOR MERGE.
	DAC SQZOUT+2
	LAC SQZOUT	/TURN ON THE P/A BIT(BIT 0).
	AND L157S
	XOR XCTLIT
	DAC SQZOUT
	LAC AREL	/IF REL TURN ON BIT 1.
	SZA
	JMS LACSQZ	/YES..BIT 1 =1
	XCT PASSNO	/WHICH PASS 1
	SKP
	JMP TSTFOR	/
	LAC NCD		/IS P/A A FWD REF
	SNA		/YES
	JMP STLCL	/GO SET THE LOCAL BIT OF WORD2.
	DAC TEMP00
	DZM NCD
	JMP PWORD2
LACSQZ	0		/SUBROUTINE TO TURN BIT 1 OF
	LAC SQZOUT	/SQZOUT ON OR OFF.
	XOR LACLIT
	DAC SQZOUT
	JMP* LACSQZ
TSTFOR	LAC ERRORF
	SZA
	JMP PWORD2
	JMP STLCL
	.EJECT
/TAG PROCESSING
/A TAG IS IN. IT HAS BEEN CONVERTED TO RADIX 50 ALREADY. THE RADIX
/50 VALUE IS AT SQZOUT AND SQZOUT+1. STORE THE PC IN
/SQZOUT+2 TO COMPLETE THE SYMBOL (THAT IS, IT WILL HAVE A
/VALUE IN ALL THREE WORDS. TURN ON SOME OTHER BITS OF THE
/THREE WORD SET, THEN SEARCH THE USER SYMBOL TABLE
/
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
/AS A RESUT OF SEARCHING THE USER SYMBOL TABLE THIS TAG IS
/EITHER FOUND OR NOT FOUND. IF ITS FOUND CHECK FOR PHASE
/ERRORS. IF ITS NOT FOUND, AND ITS NOT IN PASS 2 MERGE IT
/IN. IF ITS NOT FOUND AND IT IS PASS 2, ITS A PHASE ERROR
/(UNLESS OF COURSE THIS IS A LOCAL AREA (.LOCAL)).
/
PWORD2	LAC SYMARG
	JMS SRCUST	/SEARCH USER TABLE
	JMP TPAF	/SYMBOL IS FOUND
	XCT PASSNO
	JMP PASTG1
	XCT LOCALS	/LOCAL AREA?
	JMP PASTG1
PHASE	SET ERRORP	/P TO FLAG WORD, IGNORE IF PASS 1.
	JMP OUTPUT
PASTG1	JMS MERGE
	JMP OUTPUT
/TAG OR P.A. FOUND
/
TPAF	JMS CKMAC	/IS TABLE ENTRY A MACRO
	JMP TPAF1	/NO
	SET 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
	LAC* MRGLOC
	SPA
	JMP INMRG
	JMS SUB1	/CHANGE TO LOCAL
	DAC UNDCTR
	JMP INMRG	/MERGE IN NEW VALUES
CKVRT	SPA
	JMP CKVART
	JMS SUB1	/VIRTUAL IN TABLE TO INTERNAL
	DAC EXTCTR
	LAC PASW	/D/A?
	SNA		/YES IF NON 0.
	JMP GLPAOK	/ITS OK CONTINUE.
	LAC TEMP00	/IS IT A FORWARD REF?IF YES TURN OFF
	SNA!CLA		/BIT 1 OF WORD2 AT SQZOUT.
GLPAOK	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 INMRG
	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 INMRG	/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 INMRG	/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
	.TITLE TAG OR P.A. FOUND IN TABLE DURING PASS2
/
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
	SET ERRORM
	JMP OUTPUT
/CHECK PHASING
/
CKPHSE	LAC* MRGLOC
	AND L57S	/COMPARE PASS 1 (77777
	SAD PC		/AND PASS 2 VALUES
	JMP OUTPUT
	JMP PHASE	/BUILD PRINT IMAGE, P TO FLAG WORD
MRGSMN	LAC MRGLOC
	DAC TMP		/SAVE GLOBL
	IDX TMP		/INDICATOR
	LAC* TMP
	AND LACLIT
MRGSCO	XOR SQZOUT+1
	DAC SQZOUT+1
/MERGE IN NEW VALUES INTO SYMBOL TABLE
INMRG	JMS MRGSYM
	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
	IDX CKMAC	/YES
	JMP* CKMAC	/NO
	.TITLE SOME PSEUDO-OP ROUTINES
.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.
.EJECT=.
	.IFUND %MACI
	.IFUND %BF9A
	.IFUND %BF15A
	LAC ISWCH	/IGNORE EJECTS?
	SNA
	.ENDC
	.ENDC
	.ENDC
	SET EJCTSW	/SET SWITCH
	JMP PRPOP
.OCT	SKP!CLA		/SET OCTAL RADIX
.DEC	CLC		/SET DECIMAL RADIX
	DAC RADIX
	JMP PRPOP
.LOC	SET LOCSW	/SET .LOC INDICATOR
	JMP SCNADR	/GET ITS VALUE
/NESTED .LOCAL PSEUDO-OPS DON'T MAKE SENSE ARE ILLEGAL.
.LOCAL	XCT LOCALS	/IF LOCAL SWITCH IS ALREADY ON, IGNORE
	JMP OUTERR	/THIS LINE. (NOP=LOCAL ON, SKP=OFF)
	LAC ENDUMT	/TOP OF MACRO TABLE.
	DAC TOPLUS
	DAC BOTLUS
	LAC NOPLIT	/TURN ON.
BLOCL	DAC LOCALS
	JMP PRPOP
/FLAG THIS LINE IF THE LOCAL SWITCH WAS NOT ON.
.NDLOC	XCT LOCALS	/NOP IF ON, SKIP IF OFF.
	SKP
	JMP OUTERR
	LAC SKPLIT	/TURN OFF.
	JMP BLOCL
.BLOCK	SET BSSW	/SET .BLOCK INDICATOR 
	JMP SCNOP	/GET ITS VALUE
.DSA	LAC FLDSW
	SNA
	SET NULOPF	/NULL OPFIELD
	JMP ENDFLD
.SIZE	SET SZESW	/SET SIZE SWITCH
	JMP ENDALL
	.TITLE .GLOBL , .EOT, .ENDC ROUTINES.
.GLOBL=.
	IFUNA JMS,TMODE
	IFDEA LAC,L40
	JMP OUTERR
	JMS ARGMNT
	JMP PRPOP
	JMP GLOBER	/NUMERICS ARE NOT ALLOWED.
	JMS USTLKP	/SEARCH USER TABLE
	JMP GBFTB	/FOUND
	XCT PASSNO
	SKP		/ITS OK PASS1.
	JMP GLOBEE	/E-ERROR NOT FOUND IN PASS2.
	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
/THE GLOBL IS ALREADY IN THE UST.IF THE SYMBOL IS UNDEFINED
/SUB 1 FROM THE UNDCTR,BUT FIRST CHECK THE SPECIAL CONDITIONS.
GBFTB	LAC MRGLOC
	DAC TEMP01
	TAD L2
	DAC TEMP00
	LAC* MRGLOC	/DIRECT ASSIGNMENT?
	SPA
	JMP GLOBFF	/YES
	LAC* TEMP00	/IS IT A MACRO NAME?
	AND JMSLIT	/BIT 2 OF WORD 3
	SNA		/YES IF NON-0
	JMP GLOBOK
	SET ERRORX	/MACRO NAMES IN GLOBLS ARE NONSENSE!
	JMP TGBEND	/GO ON TO NEXT GLOBL SYMBOL
GLOBFF	IDX TEMP01	/IS IT A FORWARD REF?
	LAC* TEMP01
	AND JMPLIT
	SZA
	JMP GLOBEX	/DIR ASSIGN WITH EXTERNAL (ILLEGAL)
GLOBFX	SET ERRORF
	JMP TGBEND
GLOBEX	AND XCTLIT	/ERROR IF BIT 1 IS  ZERO
	SNA
	JMP GLOBFX	/ERROR BIT 0 IS OFF ITS A FOR REF.
	XCT PASSNO	/IF PASS1 ITS OK IF BIT 1 IS OFF.
	JMP GLOBOK	/PASS1.
	LAC* TEMP01	/IF PASS2 BIT 1 MUST BE ON OTHER-
	AND LACLIT	/WISE THERE WAS AN ERROR(F.REF.)
	SNA		/DURING PASS1
	JMP GLOBFX	/ERROR: FORWARD REF OR EXTERNAL D/A.
GLOBOK	XCT PASSNO
	SKP
	JMP TGBEND
	JMS TSTUND	/UNDEFINED?	
	SKP		/NO
	INC EXTCTR	/YES
GLBINT	LAC* MRGLOC
	AND L557S	/(577777)
	XOR LACLIT
	DAC* MRGLOC
TGBEND	JMS TKOM
	JMP .GLOBL+2	/GET NEXT SYMBOL
GLOBER	SET ERRORS
	JMP TGBEND
GLOBEE	SET ERRORE
	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	JMS PRTCOM
	SET EOTSW
	.IFUND %MACI
	LAC BNOPTN	/BINARY REQUESTED
	SZA		/NO
	JMS WAIT13	/.WAIT FOR BINARY OUTPUT DEVICE
	.ENDC
	LAC MSGEOT
	JMS WRITE3
	JMP NEWTAP
EOTMSG	.ASCII	/ EOT/<15>
LITNO	472360		/'NO'
.ENDC	LAC CONDSW	/ANY IFS OUTSTANDING
	SNA		/YES
	JMP PRPOP	/IGNORE
	ISZ IFCTR	/.IF COUNT SATISFIED
	JMP PRPOP	/NO
	JMS POPPR
	DZM CONDSW	/RESET CONDITIONAL SWITCH
	JMP CKMWD1
	.ENDC
	.TITLE	.LTORG PSEUDO-OP
	.IFUND %MACI
	.IFUND %BF9A
	.IFUND %BF15A
.LTORG	LAW -7		/THE USER MAY HAVE AS MANY AS 8 LTORGS		
	TAD LORGCT	/.LTORG COUNT
	SMA!SZA
	JMP OUTERR	/MORE THAN 8 FLAG AND IGNORE IT
	INC LORGCT
	LAC PC		/COMPARE PC VALUES FOR PHASE ERRORS.
	DAC CKV15	/SAVE PASS2 PC FOR BUILDING NEW PC.
	XCT PASSNO
	JMP .LTPA1
	SAD* .LTGPT
	SKP
	SET ERRORP	/COMPAR PC
	JMS SCNEND
	JMS PRTCOM
	JMS OUTLIT	/OUTPUT THE LITERALS SO FAR
	IDX .LTGPT	/POINT TO PASS1 LIT COUNT.
	LAC* .LTGPT	/BUILD NEW PC WITH PASS1 LIT COUNT.
.LTCOM	TAD CKV15
	DAC PC
	IDX .LTGPT	/POINT TO WORD1 OF NEXT .LTORG.
	JMS SETLIT	/SET UP LITLOC,LITCTR
	JMS DROPLT	/DROP LITERAL TABLE.
	SET EXLTSW	/FORCE NEW LOAD ADDRESS.
	JMS TMODE
	JMP NOTREL
	JMS NEWLA
	SKP
NOTREL	JMS BLDBIN
	DZM EXLTSW
	JMP CKMWD
/PASS 1 .LTORG PROCESSING
/
.LTPA1	DAC* .LTGPT	/SAVE THE PC (FOR PHASE CHECKING)
	IDX .LTGPT	/POINT TO WORD2(LITCNT).
	LAC LITCTR	/THE NUMBER OF LITERALS ENCOUNTERED
	DAC* .LTGPT	/SO FAR IN PASS 1
	JMP .LTCOM
SETLIT	0 
	LAC .LTGPT
	TAD L1
	DAC ADDER
	LAC* .LTGPT
	DAC LITLOC
	LAC* ADDER
	DAC MAXLIT
	JMP* SETLIT
	.ENDC
	.ENDC
	.ENDC
	.TITLE	TEXT GENERATING (.ASCII, .SIXBT)
/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.
	JMS CKSPTB
	JMP TXTOP
	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	/
	.EJECT
/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.
	SET ERRORN
	AND L10
	SZA		/NO..ITS OK.
	SET 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 LM40	/(-40
	SPA
	JMP NTVLD
	LAW -140
	TAD CHRHLD
	SPA
	JMP CKVLDA
NTVLD	SET 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.
	.TITLE .IODEV  LINKING LOADER ROUTINE.
/***.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=.
	IFUNA JMS,TMODE,JMP,OUTERR
	IFDEA LAC,L40
	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	SET ERRORP
	SET 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
	.TITLE .REPT CODE GENERATOR.
/***.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.
/
	.IFUND %BF9A
	.IFUND %BF15A
.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
	SET 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
	.ENDC
	.ENDC
/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
	.TITLE PSEUDO-OP ARGUMENT SCANNER.
/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.
	.IFUND %BF9A
	.IFUND %BF15A
	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
	.ENDC 
	.ENDC
ARGSE	SET 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
	SET 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	SET ERRORN
	JMP ARGMNB	/STILL NO ARGUMENTS
ARGALP	IDX ARGMNT	/ALPHA RETUTN
	IDX ARGMNT	/NUMERIC RETURN/
	JMP* ARGMNT
	.TITLE LOADER PSEUDO-OPS (.ABS(P),.FULL(P),.EBREL,DBREL)
/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
/
	.IFUND %BF9A
	.IFUND %BF15A
.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	SET ERRORQ		/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
	.ENDC
	.ENDC
OUTERR	SET ERRORI		/SET ERROR FLAG AND IGNORE
	JMP PRPOP		/THIS PSUEDO OP
	.IFUND %BF9A
	.IFUND %BF15A
	.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/
	.ENDC
	.ENDC
	.TITLE	***.IF PSEUPD-OPS***
/*** .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 ERRORQ	/CLEAR FLAG WORD
	JMP PRPOP
IFE	SET 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 TITLE ---PAGE BUILDER.
/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=.
	.IFUND BIGMAC
	XCT PASSNO	/WHICH PASS
	JMP PRPOP
	.ENDC
	.IFUND %BF9A
	.IFUND %BF15A
	LAW -62 /DON'T PACK > 62(8)=50(10) CHARACTERS IN THE TITLE BUFFER
	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
	.ENDC
	.ENDC
	.IFDEF BIGMAC
	SET TITLET
	.ENDC
	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
	IDX TSTC15
	JMP* TSTC15
	.TITLE PRPOP---PSEUDO-OP ---PRINTER.
PRPOP	JMS POPPR 	/SCAN TO END OF LINE
	XCT PASSNO
	JMP CKMWD1
/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.
	LAC .NLSW	/.NOLST SWITCH?
	SZA		/YES
	DZM ALOPTN	/CLEAR LISTING SWITCH
PRPOPA	LAC EJCTSW
	SZA
	JMS EJECT
	DZM EJCTSW
	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
	.IFUND BIGMAC
	XCT PASSNO
	JMP* PRTCOM	/PASS1 DONT PRINT ANYTHING.
	.ENDC
	LAC AD666
	JMS SEQERF
	JMS P57TAB	/2 TABS TO RDBUF
	JMS P57TAB
	LAW -5
	JMS SPACKS
	JMS OUT3EX
	JMS SHRINK
	TAD AD667
	JMP* PRTCOM
POPPR	0
	JMS SCNEND
	JMS PRTCOM
	JMP* POPPR
	.TITLE	END OF PASS CODE.
.END=.
	.IFUND %MACI
	.IFUND %BF9A
	.IFUND %BF15A
CAL6	XX		/CAL
	6
	.ENDC
	.ENDC
	.ENDC
	.IFDEF %BF9A
CAL6	CAL+767	/MACROA IS ALWAYS -11
	6
	.ENDC
	.IFDEF %BF15A
CAL6	CAL+767
	6
	.ENDC		/MACROA IS ALWAYS -11
	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
	.IFUND %MACI
	.IFUND %BF9A
	.IFUND %BF15A
	DAC* .LTGPT	 /LITERALS STARTING LOCATION
	IDX .LTGPT	/POINT TO WORD2 OF .LTORG TABLE
	.ENDC
	.ENDC
	.ENDC
	.IFDEF %MACI
	DAC LITLOC
	.ENDC
	.IFDEF %BF9A
	DAC LITLOC
	.ENDC
	.IFDEF %BF15A
	DAC LITLOC
	.ENDC
	TAD LITCTR
	DAC PRGSZE 	/PROGRAM SIZE
	LAC LITCTR
	.IFUND %MACI
	IFUNA DAC*,.LTGPT
	.ENDC
	.IFDEF %MACI
	DAC MAXLIT
	.ENDC
	IFDEA DAC,MAXLIT
	JMS DROPLT
	DAC USTBEG
	LAC VARCTR 	/CHECK IF ANY VARIABLES,
	TAD UNDCTR 	/UNDEFINES OR EXTERNALS
	TAD EXTCTR 	/WERE ENCOUNTERED
	SNA
	JMP P1CMPL 	/PASS 1 COMPLETED
	LAC USTSZE 	/SYMBOL TABLE SIZE 
	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
	.TITLE 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 BF
	.IFUND %MACI
	.IFUND %PDP9
	XCT EXPAGE	/EXTRA PAGE?
	JMP PAGSYM	/YES
	.ENDC
	.ENDC
	.ENDC
PG0003	JMS USTB2
	INC USTBEG
	JMP CVA
	.TITLE END OF PASS1 CODE.
P1CMPL	LAC P1MES
	JMS WRITE3
	.IFDEF %MACI
	JMP PASS2
	.ENDC
	.IFUND %MACI
	LAC AD37	/PASS2
	DAC POWA
	.IFUND %BF9A
	.IFUND %BF15A
	LAC FSWCH
	SNA
	JMP TRY.11
	LAC BULK14
	SNA
	JMP WAITCP
	.ENDC
	.ENDC
TRY.11	LAC EOTSW	/EOT ENCOUNTERED IN PROGRAM
	IFUNA SZA	/BFA ABBREV NOT DEFINED
	IFDEA SNA
	.IFUND %BF9A
	.IFUND %BF15A
	JMP WAITCP	/WAIT FOR CONTROL P
	LAC BULK11	/IF BULK STORAGE DEVICE
	SZA
	.ENDC
	.ENDC
	JMP* POWA	/CONTINUE, ELSE WAIT FOR
WAITCP	LAC CONTP	/WRITE ^P
	JMS WRITE3
	NOP
	JMP .-1		/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>
/*****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
	.TITLE	OUTPUT LITERALS
OUTLIT	0
	LAC BEGUST
	DAC* L12
	LAC LITCTR
	SNA
	JMP* OUTLIT
	JMS TWOS
	DAC CTR1
	SET LITSW
	SET EXLTSW
	IFDEA LAC,L40
	IFUNA JMS,TMODE,JMS,BLDBIN
	DZM EXLTSW	/SO OUTPUT THE BIN BUFFER.
	SET LASW	/NEW LOAD-ADDR SWITCH.
NXLIT	DZM AREL	/ABS
	JMS LL13	/13 BITS REL
	.IFUND %MACI
	.IFUND BF
	XCT EXPAGE
	JMS TSTXLT
	.ENDC
	.ENDC
	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
	IFUNA JMS,BLDBIN
	INC PC
	IDX* L12
	ISZ CTR1
	JMP NXLIT 	/GET NEXT LITERAL
	JMP* OUTLIT
	.TITLE RETURN FROM .END ADDR SCAN.
/RETURN FROM .END ADDRESS SCAN
/
BKTEND	DZM ENDSW
	LAC OUTLCT
	DAC LNSAVE	/SAVE FOR PASS3
	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
LSNA	SNA
	JMP LITOUT
	JMS TWOS
	DAC CTR1
	SET EXTSW	/SET EXTERNA SWITCH
	SET EXLTSW
	IFUNA JMS,TMODE,JMP,.+3
	JMS NEWLA	/OUTPUT NEW LOAD ADDRESS
	IFUNA SKP,,JMS,BLDBIN
NXEXT	JMS PREL	 /GO TO PRINT ROUTINE
	IFUNA JMS,TMODE,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
	.IFUND %BF9A
	.IFUND %BF15A
	SKP
ABSEXT	JMS BLDBIN	/BUILD BINARY OUTPUT
	.ENDC
	.ENDC
	IDX PC
	IDX WRDVAL
	ISZ CTR1
	JMP NXEXT 	/GET NEXT EXTERNAL
	.IFUND %BF9A
	.IFUND %BF15A
	JMS TMODE	/ABS OR REL
	JMP LITOUT-1	/ABS NO SYMBOLS
	.ENDC
	.ENDC
	LAC L2
	JMS GIVS	/OUTPUT EXT SYMBOLS
	DZM EXLTSW
/LITERAL OUTPUTTING AT END OF PASS 2
	DZM EXTSW
LITOUT	JMS OUTLIT
	.EJECT
/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 %BF9A
	.IFUND %BF15A
	JMS TMODE	/DON'T CHECK THE SIZE IF ITS
	JMP SIZEOK	/A NON-RELOCATABLE PROGRAM.
	.ENDC
	.ENDC
	LAC PRGSZE	/HIGHEST LOCATION USED.
	AND (70000
	.IFUND %BMODE
	SNA
	.ENDC
	.IFDEF %BMODE
	NOP
	.ENDC
	JMP SIZEOK
	LAC MESWRN
	JMS WRITE3
	.IFUND %MACI
	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
	LAC DSWCH
	SNA
	JMP SIZEOK
	JMS PRTSOH
	WRNMES-1
L6	6
	.ENDC
	JMS SUB1
	DAC ERLNCT	/WAS INCREMENTED AT PRTSOH
/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=.
	LAC ERRPTR
	JMS WRITE3
	.IFUND %MACI
	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
	.IFUND %BF9A
	.IFUND %BF15A
	LAC BNOPTN	/BINARY REQUESTED
	SNA		/YES
	.ENDC
	.ENDC
	JMP ANPST
	.IFUND %BF9A
	.IFUND %BF15A
	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
	.ENDC
/
	.ENDC
	JMP ANPST
FULHRW	003500
ALPCIN	0		/USE AS TEMP STORAGE
LCOUNT	0
CHAR1	0
LKAHED	0
PRVCHR	0
/
	.IFUND %BF9A
	.IFUND %BF15A
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
	.ENDC 
	.ENDC
	.TITLE SYM TABL OUTPUT ALPHA SEQ.
/ALPHA AND NUMERIC PRINTOUT OF SYMBOL TABLE
	.ENDC
ANPST	SET STOPPER	/CR IN MULTIWORD STOPPER
	JMS DROPLT
	SET STPSW
	LAC ALOPTN
	SNA
	DZM PGCTR
	LAC ASWCH
	DAC ALOPTN
	LAC PGCTR	/SAVE THE PAGE COUNT.
	DAC LCOUNT
	JMS GBST
	JMP ALFNXB
	JMS EJECT
	JMS INITLN
ALFNX=.
	.IFUND %BF9A
	.IFUND %BF15A
	JMS TMODE
	JMP ALFNXA
	.ENDC
	.ENDC
	JMS LLSTBL
	0
ALFNXA	JMS BPSMB 	/BUILD AND PRINT SYMBOL
	IDX USTBEG
	JMS CKEST 	/CHECK FOR END OF TABLE
	SKP 		/FOUND
	JMP ALFNX 	/GET NEXT SYMBOL
	JMS ENDSYM	/TEXT FOR LAST LINE
ALFNXB	LAC BNOPTN	/BINARY REQUESTED
	SNA		/YES
	JMP ALFNXD	/NO
	.IFUND %BF9A
	.IFUND %BF15A
	JMS TMODE	/WHAT TYPE OUTPUT
	JMP ALFNXC
	.ENDC
	.ENDC
	LAC ENDVAL	/.END VALUE
	AND L57S	/15 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
	.TITLE SYMBOL TAB. IN VALUE SEQ.
/NUMERIC PRINTOUT, VALUE SEQUENCE OF SYMBOL TABLE.
/SORT SYMBOL TABLE INTO VALUE SEQUENCE.
/PRINT MACROS AS THEY ARE ENCOUNTERED AND IGNORE THEM LATER.
/
ALFNXD	LAC	ASWCH
	SZA
	JMP	PNOC
	LAC	LCOUNT
	DAC	PGCTR
PNOC=.
	LAC	VSWCH
	SNA
	JMP	EOJ+1
	DAC	ALOPTN
	JMS	GBST
	JMP	EOJ+1
	JMS	EJECT
	JMS	INITLN
	DZM	NUMVAL
	LAC	BEGUST
	DAC	USTBEG
NUMNXH	JMS	SYM3
	JMS	MACFST
	JMP NUMNXJ	/P/A
	JMP NUMNXJ	/NOT A MACRO
	JMS BPSMB	/PRINT SYMBOL-MACRO
SKPLIT	SKP
NUMNXJ	JMS USTB2
NUMNXK	IDX 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	IDX 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=.
	JMS ENDSYM
	.IFUND %MACI
	LAC XSWCH	/WAS A CROSS REF REQUESTED?
	SZA		/NO..CLOSE THE LISTING
	JMP XSETUP	/YES SET IT UP AND LOAD IT.
	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
	.TITLE X-OPTION SETUP AND LOAD PASS3
XSETUP=.
	.IFDEF %PTP
	LAC MESSP3
	JMS WRITE3
	.ENDC
	LAC BKP3ST	/SET UP ARGUMENT RECEIVING PTR.
	DAC* L11
	AND L64Z	/(60000)
	DAC TMP
	.IFUND %MACI
	.IFUND %BF9A
	.IFUND %BF15A
	LAC .SEK14	/POINTER TO -14 NAME.
	JMS SET10
	LAW -6
	JMS MOVAUT	/MOVE -14, AND -11 NAMES.
	.ENDC
	.ENDC
	.ENDC
	.IFDEF %MACI
	LAC DSWCH
	DAC DDDMCI
	LAC ADFILE
	DAC* L10
	LAW -6
	JMS MOVAUT
	.ENDC
	.IFDEF	%BFA
	LAC	ADFILE
	DAC*	L10
	LAW	-3
	JMS	MOVAUT
	.ENDC
	LAC PTRFSW	/POINTER TO FSWCH-1
	JMS SET10
	.IFUND %MACI
	LAW -17		/MOVE IN 15(10) ARGS
	.ENDC
	.IFDEF %MACI
	LAW -24
	.ENDC
	JMS MOVAUT
	.IFUND %MACI
	CAL+775
	12
	CAL+766
	12
	.ENDC
	.IFDEF %PTP
	JMP .
P3MESS	.ASCII	'LOAD PASS3'<15>
	.LOC .-1
	.ENDC
/LOAD PASS3
/
	.IFUND %PTP
	.IFUND	BF
	LAC P3BLOK
	DAC 17637	/1ST BLOCK NO OF PASS3.
	LAC LPASS3	/CHANNEL ADDRESS -1.
	DAC 17640
	LAW -CREFWC
	DAC 17641
	LAC LP3ST
	DAC* L0
	JMP .DTBEG	/DONE..LOAD PASS3.
	.ENDC
	.IFDEF	BF
	LAC	P3BLOK
	DAC	17772	/1ST BLOCK NO. OF PASS 3
	LAC	LPASS3	/CHANNEL ADDRESS -1
	TAD	L1
	DAC	17773
	LAW	-CREFWC	/SIZE OF PASS 3
	DAC	17774
	LAC	LP3ST
	XOR	L640S
	DAC	17777
	LAC	L771
	DAC	17770
	LAC	L13
	DAC	17771
	LAC	L771
	DAC	17775
	LAC	L6
	DAC	17776
	JMP	17770
L771	771
L640S	640000
	.ENDC
	.ENDC
	.ENDC
	.TITLE .END MESSAGES AND UTILITIES.
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
	IDX USTBEG
	IDX USTBEG
	JMP* USTB2
/
P57K15	0
	LAC L15
	JMS PACK57
	JMP* P57K15
/
PKBLNK	0
	LAC L40
	JMS PACK57
	JMP* PKBLNK
	.TITLE BUILD AND PRINT SYMBOL IMAGES AND VALUES.
BPSMB	0
	JMS SYM3
	JMS UNSQZE 	/UNSQOZE THE SYMBOL
	LAW -6
	JMS PACKER
	LAC AD16		/UNSQZV-1
	JMS PKBLNK	/1 SPACE BEFORE LOCATION
	LAW -6		/IF SYMBOL IS A P/A
	DAC CTR		/PICK UP ALL 18 BITS.
	JMS MACFST	/ELSE ONLY 15 BITS
	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 PKBLNK
	.IFUND %BF9A
	.IFUND %BF15A
	JMS TMODE 	/BY PASS ADDRESS TYPE IF NON-RELOC ASSEMBLY.
	JMP BPACK	/ABSOLUTE.
	.ENDC
	.ENDC
	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	ISZ SCOUNT
	JMP .+3
	JMS OUTSYM
	JMP* BPSMB
	LAW -4
	JMS SPACKS
	JMP* BPSMB
BMACRO	JMS PKBLNK	/M/PACK MACRO
	LAC L115
CMDPAK	JMS PACK57
	LAC L101	/A
	JMS PACK57
	LAC L103	/C
	JMS PACK57
	LAC L122	/R
	JMS PACK57
	LAC L117
	JMS PACK57	/0
	JMS PKBLNK
	JMS PKBLNK
	JMP BPABS
/SUBROUTINE TO INITIALIZE THE PRTBUF LINE FOR OUTPUTTING
/MULTI SYMBOLS AT END OF PASS 2.
INITLN	0
CNTSYM	LAW -1		/-1, -4, OR ?
	DAC SCOUNT
	LAC AD222
	JMS P57INT
	JMP* INITLN
/A LINE OF SYMBOLS MAY HAVE BEEN BUILT. THIS SUBR. INSURES THAT
/THE LAST LINE IS PRINTED.
ENDSYM	0
	LAC SCOUNT
	SZA		/0 IF ALL SYMBOLS ARE OUTPUT
	JMS OUTSYM
	JMP* ENDSYM	/TERMINATE LINE
OUTSYM	0
	JMS P57K15	/TERMINATE THE LINE
	LAC AD333
	JMS PRINT	/PRINT IT
	JMS INITLN	/INITIALIZE THE NEXT LINE.
	JMP* OUTSYM
SCOUNT	0
/CHECK FOR END OF SYMBOL TABLE
CKEST	0
	LAC USTBEG 	/CHECK NEXT
	SAD USTEND	/FOR END
	JMP CKESTA 	/FOUND
	.IFUND BF
	.IFUND %MACI
	.IFUND %PDP9
	XCT EXPAGE
	JMP PAG006
	.ENDC
	.ENDC
	.ENDC
TBLOK	IDX CKEST
	JMP* CKEST
CKESTA=.
	.IFUND %PDP9
	.IFUND %MACI
	.IFUND BF
	XCT EXPAGE	/IS THERE AN EXTRA PAGE AVAILABLE?
	JMP PAG005	/YES..ADJUST USTBEG
	.ENDC
	.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
ABSADR	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
	.IFUND %MACI
LTABLE	0
	.REPT 17
	0
	0		/EXTRA FOR IMPLIED .LTORG AT END
	0		/OF PASS1.
	.ENDC
EP1T=.
/
/LOCATIONS TO BE INITIALIZED FOR PASS1 AND PASS2
BP12T=.
RASUPL	0		/REAL ARGUMENT SUPPLIED
CSBSW	0		/CREATE SYMBOL SWITCH
ERLNCT	0		/ERROR LINE COUNT
RASW	0		/RETURN TO REAL ARGUMENTS
MCLCTR	0		/MACRO CALL LEVEL COUNTER
MCLSW	0		/MACRO CALL SWITCH
OUTLCT	0	/OUTPUT LINE COUNT
IFCTR	0
	.IFUND %MACI
LORGCT	0		/.LTORG COUNT
	.ENDC
LASW	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
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
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
LOCVAR	0	/TAG IN LOCAL AREA MUST BE PUT IN RUST(FAKE OUT MERGE)
	.IFDEF BIGMAC
TITLET	0
	.ENDC
NDIL	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 MSWCH
	SNA
	JMP* UPBLB
	LAC (DTIBUF+2
	DAC UPKAD
	.ENDC
	JMP* UPBLB
/
/LOCATION ZEROING SUBROUTINE
	.IFUND %MACI
/
/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
	.ENDC
/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
	IDX MRGLOC
	IDX 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
/SUBROUTINE TO PACK N BLANKS.
/
SPACKS	0
	DAC P57TAB
	JMS PKBLNK
	ISZ P57TAB
	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
	IDX* L10
	IDX* L10
	JMP* INCL10
	.IFUND %MACI
/CONVERT TO TWO'S COMPLEMENT
/
TWOS	0
	CMA
	TAD L1
	JMP* TWOS
	.ENDC
/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
/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	IDX CKALF
	JMP* CKALF	/NOT FOUND EXIT
	.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	IDX 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
	IDX 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
	.EJECT
/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 (770000
	DAC CTRLK	/NUMBER OF POSITIONS TO SCAN
	LAC* CHRLKP
	JMS LEFT6
	RAL
	AND L77
	TAD (SAD SPCHRS-1
	DAC CHCMP
	IDX CHRLKP
	LAC CHRHLD
	ISZ .+1
CHCMP	XX		/FOUND
	JMP* CHRLKP	/YES
	ISZ CTRLK
	JMP CHCMP-1
	IDX 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
	IDX 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
	IDX 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
	.TITLE GET AN INPUT CHAR FRON LINE BUFF.
	.IFUND %MACI
/THIS ROUTINE UNPACKS CHARACTERS FROM 5/7 ASCII WORD
/PAIRS AND LEAVES THEM IN CHRHLD
GETCHR	0
	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
	JMP CHR2	/2ND
	JMP CHR3	/3RD
	JMP CHR4	/4TH
	JMP CHR5	/5TH
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
	.ENDC
/CHECK FOR # ON PERMANENT SYMBOL OR PSEUDO OP.
CKPFV	0
	LAC VARSW	/VAR SWITCH
	SZA
	SET ERRORS	/S TO FLAG WORD
	DZM VARSW
	JMP* CKPFV
	.TITLE MOVERS... AND END OF LINE SCANNER.
/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
	SET 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
/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
	IDX MOVER	/POINT TO RECEIVING ADDRESS.
	XCT* MOVER	/RECEIVER -1
	DAC* L11
	LAC CTR		/USE THE AUTO INDEX MOVER
	JMS MOVAUT
	JMP* MOVER
	.IFUND %MACI
/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
	.ENDC
/MOVBIN IS SUBROUTINE WHICH CALLS THE
/BINARY TO OCTAL ROUTINE
/
MOVBIN	0
	DAC CTR
	JMS BNOCT
	XCT* MOVBIN
	JMS PACK57
	ISZ CTR
	JMP .-4
	IDX MOVBIN
	JMP* MOVBIN
MOVEPK	0
	DAC CTR
	XCT* MOVEPK
	DAC* L10
	IDX MOVEPK
	XCT* MOVEPK
	JMS P57INT
	LAC* 10
	JMS PACK57
	ISZ CTR
	JMP .-3
	IDX MOVEPK
	JMP* MOVEPK
PACKER	0
	DAC CTR
	XCT* PACKER
	DAC* L10
	LAC* 10
	JMS PACK57
	ISZ CTR
	JMP .-3
	JMP* PACKER
	.TITLE	MATH UTILITY ROUTINES
/CALLING SEQUENCE:
/	LAC MULTIPLIER
/	JMS MPY
/	LAC MULTIPLICAND
/	RETURN; LO ORD PROD IN AC, HI ORD PROD IN MP5.
/
MP1	0
MP2	0
MP3	0
MP5	0
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
/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
	DZM DVD		/STORE HIGH ORDER DIVIDEND
	XCT* DIVIDE
	DAC QUO		/STORE LOW ORDER DIVIDEND
	ISZ DIVIDE
	XCT* DIVIDE	/FETCH DIVISOR
	JMS TWOS
	DAC DVS
	ISZ DIVIDE	/INCREMENT TO EXIT ADDRESS
	SNA		/DIVIDEND 0?
	JMP* DIVIDE	/YES -- EXIT WITH LINK = 1
	LAW -23		/SET UP COUNTER
	DAC DV1
	JMP DV2		/START DIVISION
DV3	LAC DVD		/FETCH DIVIDEND
	RAL		/ROTATE LEFT TO PICK UP NEXT BIT
	DAC DVD
	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
	ISZ DV1		/FINISHED?
	JMP DV3		/NO
	JMP* DIVIDE	/EXIT
/NUMBER EVALUATION ROUTINE
/
NUMEVL	0
	DZM NUMBR	/WHERE RESULTS WILL BE
	LAC CHRNUM
	SNA
	JMP* NUMEVL	/NUMBER IS 0
	TAD (-7
	SMA
	SET ERRORN
	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
	SET 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	SET 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
	.TITLE PACK FROM SIXBT TO MODIFIED RADIX 50.
/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
	.TITLE PACK IN IOPS ASCII (5/7)
/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
	LAC* MRGLOC
	RCL
	IDX MRGLOC
	LAC* MRGLOC
	AND JMPLIT
	IDX MRGLOC
	SZA
	JMP NOTFOR
	SZL
	SET ERRORF
NOTFOR=.
	LAC* MRGLOC
	DAC NUMBR
	JMP* SYMVAL	/RETURN
	.TITLE TEXT PRINTING ROUTINES.
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
	.IFDEF BIGMAC
	XCT PASSNO
	JMP NTFLN	/PASS1
	.ENDC
	DAC PRTXXX
	LAC FSTLNE	/FIRST LINE
	SMA		/YES
	JMP NTFLN
	DZM FSTLNE
	IFUNA JMS,TMODE,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
	.IFUND %MACI
	IFUNA LAC,.SEK11
	.ENDC
	IFDEA LAC,AD02
	.IFDEF %MACI
	LAC AD02
	.ENDC
	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
	IFUNA SNA,,JMP,TSTRPT
	IFDEA SZA
/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
	.IFDEF BIGMAC
	XCT PASSNO
	JMP* PRINT	/PASS1
	.ENDC
	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
	DZM FLGSAV
	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
	.IFUND %BF9A
	.IFUND %BF15A
TSTRPT	LAC RPTSW
	SNA
	JMP NOTEXP
	LAC STOPPER
	SZA
	JMP TSTG
	JMP NOTEXP
	.ENDC
	.ENDC
MOD33B	PRTBUF-1
	.TITLE PRINT MULT DEFINITIONS,PK SIXBT TO ASCII
MDER	0
	JMS UP6INT
	LAC AD09	/TXTBF
	JMS P57INT
	JMS P657	/SIXBT TO 5/7 ASCII
	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
/SUBROUTINE TO PACK FROM .SIXBT TO 5/7 ASCII.
/THE BUFFER POINTERS AND COUNTERS ARE ALREADY SETUP BEFORE
/CALLING THIS ROUTINE.
P657	0
	LAW -6
	DAC EJECT
P657LP	JMS UNPACK	/TOP OF LOOP.
	SNA		/RELPACE 00 WITH BLANK
	LAC L40
	DAC UPKCHR
	TAD LM33
	SPA!CLA
	LAC L100
	XOR UPKCHR
	JMS PACK57
	ISZ EJECT
	JMP P657LP
	JMP* P657	/EXIT
	.TITLE PAGE EJECT ROUTINE.
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
	.IFDEF BIGMAC
	XCT PASSNO	/WHAT PASS?
	JMP .+4	/PASS1
	.ENDC
	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
	.IFDEF BIGMAC
	XCT PASSNO
	JMP .+7
	.ENDC
	JMS PRTSOH	/PRINT HEADING
MOD34A	HDRLNE-1
	0
	JMS PRTSOH	/PRINT LF
MOD34B	LF-1
	0
	.IFDEF BIGMAC
	XCT PASSNO
	SKP		/PASS1
	JMP TCNOT	/PASS2 IGNORE.
	DZM TITLET
	LAW -4		/SET UP MOVER
	JMS MOVER
	LAC TCSTRT
	LAC TCPAGE
	LAC TITLET	/IS THIS A .TITLE?
	SNA		/YES
	JMP TCNOT	/NO IGNORE IT
	LAC TSWCH
	DAC TCPRT
	LAC ERLNCT
	DAC MDER
	JMS PRTSOH
TCMOD	PRNAIM+1
TCPRT	XX
	LAC MDER
	DAC ERLNCT
TCNOT=.
	.ENDC
	LAC SVMCPT	/RESTORE POINTERS TO
	DAC PK57AD	/MACRO TABLE.
	LAC SVMCCT
	DAC CTR57
	JMP* EJECT
/GET BEGINNING OF SYMBOL TABLE
/
GBST	0
	LAC BEGUST
	DAC USTBEG
	JMS CKEST
	JMP* GBST	/NO SYMBOLS RETURN
	IDX 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
/
	.TITLE PRTSOH-LAST LEVEL OF PRINT.
/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
	IDX PRTSOH
	LAC* PRTSOH	/TYPE OF LINE
	/0=NORMAL, 1=ERROR
	ISZ PRTSOH	/UPDATE FOR RETURN
	SZA
	INC ERLNCT	/COUNT LINES.
	TAD ALOPTN	/LISTING OR S/T REQUESTED
	SNA		/YES
	JMP* PRTSOH	/NO, EXIT
	.IFUND %MACI
PRTA	CAL+766		/WAIT FOR -12
	12
	.ENDC
/COMPUTE WORD/PAIR COUNT OF LISTING LINE
/
	LAC L2		/ONE WORD FOR HEADER AND 1 FOR DATA.
	DAC PRTLIN
	LAW -5
	DAC TEMP00	/COUNT 5/7 PAIRS.
	LAC PK57AD	/SAVE 5/7 POINTERS
	DAC TEMP01
	LAC CTR57
	DAC TEMP02
	IDX CLEARS	/POINT TO DATA(WAS DATA-1)
	LAC CHRHLD
	DAC MP1
	LAC UPKAD	/SAVE UNPACKING VALUES
	DAC MP2
	LAC PKNUM
	DAC MP3
	LAC CLEARS
	JMS USET57
	LAC AD45
	JMS P57INT
PLOOPN	JMS GETCHR
	SAD L15	/CR?
	JMP LASTG	/YES ITS THE LAST CHAR.
	SNA		/NO..IS IT A NULL?
	JMP PLOOPN	/YES IGNORE IT
	JMS PACK57	/NO PACK IT
	ISZ TEMP00
	JMP PLOOPN
	INC PRTLIN
	LAW -5		/RESET COUNTER
	DAC TEMP00
	JMP PLOOPN
LASTG	JMS PACK57
	LAC PRTLIN
	RCL
	JMS LEFT8
	DAC PRTLIN
	LAC MP2
	DAC UPKAD	/RESTORE UNPACKING VALUES
	LAC TEMP01
	DAC PK57AD
	LAC TEMP02
	DAC CTR57
	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 PRLEEV
TTYPRT	JMS TTYOUT
	PRTLIN
	.ENDC
PRLEEV	LAC MP1
	DAC CHRHLD
	JMP* PRTSOH
TEMP00	0
TEMP01	0
TEMP02	0
	.TITLE ALL INPUT EXCEPT -2 .
	.IFUND %MACI
/SOURCE INPUT DOUBLE BUFFERING
/
PARMES	.ASCII 'PARITY ERROR'<15>
DBLBUF	0
	.IFUND %BF9A
	.IFUND %BF15A
	XX
	.ENDC
	.ENDC
	.IFDEF %BF9A
	CAL+767	/.WAIT FOR INPUT TO FINISH BEFORE MOVING
	.ENDC
	.IFDEF %BF15A
	CAL+767	/NO GUESSING ABOUT DAT SLOTS WITH MACROA
	.ENDC
	12
/TEST THE FIRST HEADER FOR PARITY ERRORS.
/
	LAC SRCBUF
	AND L60
	SAD K20
	SKP
	JMP NOTPAR
	LAC PARITY
	JMS WRITE3
NOTPAR=.
	LAC SRCBUF
	AND L17
	SAD L6
	JMP .EOT+1
	SAD L5		/CONTROL D ENCOUNTERED
	JMP .EOT+1
	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
	.IFUND %BF9A
	.IFUND %BF15A
	XX
	.ENDC
	.ENDC
	.IFDEF %BF9A
	CAL+2767	/READ IN IOPS ASCII FROM -11
	.ENDC
	.IFDEF %BF15A
	CAL+2767	/READ IN IOPS ASCII FROM THE INPUT SLOT
	.ENDC
	10
MOD38	SRCBUF
	-44
	JMP* RDSRC
	.ENDC
	.TITLE ADDRESSES TO BE BANK BIT INITIALIZED 
/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
ADFILE	FILE-1
BKP3ST	P3ARGS-1	/ADDRESS OF ARG RECEIVER FOR CREF.
PTRFSW	FSWCH		/ARGUMENT STRING PTR FOR CREF.
	.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
	.IFUND %BF9A
	.IFUND %BF15A
ADTITX	TEXTT
	.ENDC
	.ENDC
AD16	UNSQZV-1
ADPNAM	PRNAIM
AD17	ENDVAL
AD20	UNSQZV
AD23	PNMBR		/PAGE NUMBER
	.IFDEF BIGMAC
TCPAGE	PRNAIM+1
TCSTRT	PNMBR-1
	.ENDC
AD24	DECOUT+2
AD25	BNADDR-1
	BNDATA-1
AD27	PTPBUF+1
ADBEG	ENDPP		/FOR OVERLAYING EXTRA PAGE CODE.
AD29	IOPHDR-1
AD30	PTPBUF-1
AD31	DECOUT+5
MESMAC	ID-2
MESCRT	LF-1
MESER	QMARK-2
	.IFUND %MACI
ADLITG	LTABLE
	.IFUND %BF9A
	.IFUND %BF15A
ADST11	SET.11
ADFNDF	FNDFIL
	.ENDC
	.ENDC
	.IFUND %BF9A
	.IFUND %BF15A
MESNAM	NOTHERE-2
	.ENDC
	.ENDC
PARITY	PARMES-2
CONTP	PS1MSG-2
	.ENDC
ERRPTR	ERRLIN
MSGEOT	EOTMSG-2
P1MES	ENDPAS-2
MESWRN	WRNMES-2
ADS0	PSIZEE		/SIZE OF PROGRAM
AD32	SQZOUT
AD333	PRTBUF-1
AD34	FULHRW+1
AD36	PRTLIN+1
AD37	PASS2
AD38	ERNMBR
	.IFDEF %PTP
MESSP3	P3MESS
	.ENDC
AD39	RDLST
AD40	DECOUT-1
AD41	BP1T-1
EFLAGS	ERRORA
AD42	BP12T-1
AD43	BST-1
AD45	PRTLIN+2
TOP	ENDPP		/END OF EXTRA PAGE CODE.
	.IFUND %BF15A
	.IFUND %MACI
	.IFUND %PDP9
AD50	LODMOD+1
	.ENDC
	.ENDC
	.ENDC
LPASS3	CREFCA	/LOAD ADDRESS OF PASS3
LP3ST	CREFST	/START ADDRESS OF PASS3
AD511	DECOUT+1	/ADDR-1 OF DECIMAL SEQ IMAGES.
AD666	RDBUF-6		/
AD667	RDBUF-7
AD222	PRTBUF
ADL=.
ADCT=ADL-ADF\777777+1
	.TITLE MACROI SOURCE INPUT ROUTINE.
	.IFDEF %MACI
RDSRC	0
	LAC PSWCH
	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+1
	SAD L5
	JMP .EOT+1
	LAW -44
	JMS MOVER
	LAC LIBUF1
	LAC AD04
	LAC RDLST
	AND IOTLIT
	XOR (6400
	DAC RDLST
RDEXIT	JMS UPBLB
	JMP* RDSRC
	.ENDC
	.ENDC
	.TITLE CONSTANTS AND TEMP STORAGE.
/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
L5	5
	.IFDEF %MACI
L1000	1000
L400	400
L40000	40000
	.ENDC
L137	137
L377	377
L17	17
L47S	7777
L37S	777
L26	26
L77	77
L27	27
L110	110		/H
	.IFUND %MACI
L132	132		/Z
	.ENDC
L30	30
L33	33
L147S	17777
L347S	37777
L357S	377777
L64Z	60000
L3000	3000
L31	31
L32	32
L42	42
L23	23
L157S	177777
L10	10
K4	4
L4=K4
L100	100
CONCAT=L100
L20000	20000
L2000	2000
K10000	10000
K20	20
L200	200
L57S	77777
LM40	-40
	.IFDEF %MACI
L175	175
LM35	-35
LM33	-33
	.ENDC
/MACRO-15 TEMP STORAGE
	.IFUND	BF
PACKS	LAC .DTBLK	/GET FIRST BLOCK NO OF MACRO.		/
	.ENDC
	.IFDEF	%BF15
PACKS	LAC	(547
	.ENDC
	.IFDEF	%BF15A
PACKS	LAC	(660
	.ENDC
	DAC FBLOCK
	.IFDEF	%BF15A
	LAC	(547
	.ENDC
OPRTR	TAD BSIZE	/THE NO OF BLOCKS IN MACRO
MRGSAV	DAC P3BLOK	/THE FIRST BLOCK OF CREF.
	.IFUND	BF
PRGSVE	LAC .DTWC	/GET SIZE OF MACRO(FROM BOOTSTRAP)
	.ENDC
	.IFDEF	BF
PRGSVE	LAC	ENDVAL
DVD	JMS	TWOS
	.ENDC
SYMSAV	DAC MSZE
UNDLOC	JMS .
EXTLOC LAC .-1
EXTLC1	AND L64Z
LITLOC	TAD SIXCTR
USTBEG	DAC MLOAD
SZECTR	JMP INITBB
SIXCTR	FIRST-1
BSIZE=.
BEGDEF	.MACRO
VARLOC	JMP INITBB
	.IFDEF BF
ENDVAL	17770-BFIRST
	.ENDC
	.IFUND BF
ENDVAL	0
DVD	0
	.ENDC
SETX=PACKS
NUMVAL	0
CTRLK	0
	.IFDEF	%BF9A
BULK11	0
	.ENDC
	.IFDEF	%BF15A
BULK11	0
	.ENDC
UNSQZL	0
CHRHLD	0
WORDCT	0
MRGLOC	0
CMPLOC	0
TMPT	0
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
MAXLIT	0	/MAXIMUM NO OF LIT IN THIS SECTION.
DIRASW	0	/ADDRESSING MODE(0=12 BIT) (NON0=13).
.LTGPT	0	/POINTER TO .LTORG TABLE.
BNKBTS	0
CTR	0
MACFFF	0
DECLOC	0
CTRMX5	0
TXTLOC	0
TXTCTR	0
PASSNO	0
PK57AD	0
CTR57	0
PKLOC	0
UPKCTR	0
TOPLUS	0
BOTLUS	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
INCR	0
TMPI	0
SVMCPT	0
SVMCCT	0
SWD1	0
SWD2	0
SWD3	0
TAGSW	0
TT1	0
LOCALS	0		/.LOCAL SWITCH
TT3	0
	.IFDEF	%BF9A
ADDTSK	DOTSEK
	.ENDC
	.IFDEF	%BF15A
ADDTSK	DOTSEK
	.ENDC
L130=ERTBL		/X
ABSCNT=MP1
FIXCNT=MP2
DLMTR=MP3		/DELIMITER IN TEXT ROUTINES.
ANGLVL=MP5		/ANGLE BRACKET EXALUATOR
BPXRES=GBST
BOPPC=GIVS
BOPADR=IOVS
TXTYP=SRCUST
MDCTR=BOPADR
UNSQ=PRTINT
SQZLOC=TORC
NXHVL=TORC+1
CTRSPA=GIVS
LWORD2=PUSLL
LWORD3=LL13
FLGPTR=LKAHED
INC=ISZ
IDX=ISZ
SET=ISZ
DV1=NUMEVL
SYMBLS=TORC
ANDXOR=SUB1
DVS=INTUPN
TITCNT=GETRST
XLIT=K10000
	.IFDEF %PTP
	.END BANK*20000+17720
	.ENDC
	.ENDC
	.ENDC
	.ENDC
	.IFUND %MACI
	.END
	.ENDC
	.EOT
	.ENDC
