Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-02 - decus/20-0043/pal10.mac
There are 9 other files named pal10.mac in the archive. Click here to see a list.
00100		TITLE	PAL10	V141	26-AUG-68
00200		SUBTTLE NONREENTRANT VERSION
00300	;	R.C. BOWERING  -  TRADITIONAL PRODUCTS
00400	;	SHARABLE VERSION B.G. DUERR/RCC
00500	
00600		EXTERNAL	.JBREL,	.JBFF,	.JBDDT,	.JBSYM
00800	
00900		INTERNAL	JOBVER,JOBCOR
01000	
01100	
01200		JOBVER=137
01300		JOBCOR=133
01400		IFNDEF SHARE,<SHARE=0>		;1 FOR SHARE = REENTRANT VERSION
01500		IF2,<IFN SHARE,<	SUBTTLE REENTRANT VERSION>>
01600	
01700		IFN SHARE,<HISEG>
01800	
01900		PALVER=141
02000	
02100		LOC JOBVER
02200		EXP PALVER		;PROGRAM VERSION #
02300		RELOC
02400	
02500	TITLE:	SIXBIT/PAL10/
02600	SUBTTL:	SIXBIT/V141/
02700		IFE SHARE,<
02800		DEFINE XX (A1,A2,A3)<
02900	A1:	BLOCK A2
03000	>
03100		LOC JOBCOR
03200		EXP 7777
03300		RELOC
03400	>
03500		IFN SHARE,<
03600		ZZ=140
03700		DEFINE XX (A1,A2,A3)<
03800		A1=ZZ
03900		ZZ=ZZ+A2
04000	>
04100	>
     
00100	;BITS FOR GETCHR STATUS AND IO STATUS CALLS:
00200	
00300		TTYDEV=	000010		;1-DEVICE IS A TTY
00400		DTADEV=	000100		;1-DEVICE IS A DTA
00500		PTRDEV=	000200		;1-DEVICE IS A PTR
00600		LPTDEV=	040000		;1-DEVICE IS A LPT
00700		CDRDEV=	100000		;1-DEVICE IS A CDR
00800	
00900		IODATA= 200000		;1-IO DATA ERROR
01000		IODEV=  100000		;1-IO PARITY ERROR
01100		IOWRLK= 400000		;1-IO WRITE LOCK ERROR
01200		IOBKTL=	040000		;1-IO BLOCK TOO LARGE
01300		IOEOF=	020000		;1-END OF FILE ON IO DEVICE
01400	
01500		%00=	0
01600		%01=	1
01700		%02=	2
01800		%03=	3
01900		%04=	4
02000		%05=	5
02100		%06=	6
02200		%07=	7
02300		%10=	10
02400		%11=	11
02500		%12=	12
02600		%13=	13
02700		%14=	14
02800		%15=	15
02900		%16=	16
03000		%17=	17
03100	
03200	OPDEF	RESET	[CALLI	 0]
03300	OPDEF	DEVCHR	[CALLI	 4]
03400	OPDEF	CORE	[CALLI	11]
03500	OPDEF	UTPCLR	[CALLI	13]
03600	OPDEF	DATE	[CALLI	14]
03700	OPDEF	MSTIME	[CALLI	23]
03800	OPDEF	RUNTIM	[CALLI	27]
03900	OPDEF	ZBINK	[CLOSE BIN,]
04000	
04100		CRFSYM=1
04200		CRFMAC=5
04300		CRFOPC=3
04400		CRSYMD=2
04500		CRFMAD=6
04600		CRFPFX=177
04700		CRFSOL=102
04800		CRFEOL=103
     
00100		;COMPILER AND EXEC FLAGS
00200	
00300		;FLAGS SET BY EXEC, USED BY COMPILER (LEFT HALF OF AC F OR %16)
00400	
00500		LSTBIT=	001		; 1-SUPRESS LISTING OUTPUT
00600		BINBIT=	002		; 1-SUPRESS BINARY OUTPUT
00700		CSWBIT=	004		; 1-SUPRESS CROSS REFERENCE
00800		MSWBIT=	020		; 1-SUPRESS MACRO LISTING
00900		NSWBIT=	040		; 1-SUPRESS ERRORS ON TTY
01000		TTYBIT=	200		; 1-LISTING IS ON TTY
01100		XLBIT=	001000		; 1-XLIST IS IN PROGRESS
01200		NOPBIT=	002000		; 1-NOPUNC IN EFFECT
01300		DSWBIT=	004000		; 1-/D SET
01400		NSRBIT=	010000		; 1-NEW SOURCE FILE
01500		XSWBIT=	020000		; 1-SUPPRESS BIT MAP LISTING
01600	
01700	
01800		PALXSW=	0
01900		PAL3SW=	1
02000		PAL8SW=	2
02100		PALDSW=	3
02200		PALSSW=	4
02300	
02400	
02500		SBX=	1B<PALXSW>
02600		SB3=	1B<PAL3SW>
02700		SB8=	1B<PAL8SW>
02800		SBD=	1B<PALDSW>
02900		SBS=	1B<PALSSW>
     
00100		;VARIABLE PARAMETERS
00200	
00300		IFNDEF	PAGSIZ,
00400	<
00500		PAGSIZ=	^D54		;NUMBER OF LINES ON A PAGE
00600	>
00700	
00800		IFNDEF	NUMBUF,
00900	<
01000		NUMBUF=	2		;NUMBER OF BUFFERS PER DEVICE
01100	>
01200	
01300		CORINC=	2000		;CORE INCREMENT
01400	
01500		IFNDEF	SPL,
01600	<
01700		SPL=	4		;SYMBOLS PER LINE
01800	>
01900	
02000		IFNDEF	SPLTTY,
02100	<
02200		SPLTTY=	3
02300	>
02400	
02500		IFNDEF	CPL,
02600	<
02700		CPL=	^D120		;CHARACTERS PER LINE
02800	>
02900	
03000		IFNDEF	TTLLEN,
03100	<
03200		TTLLEN=	^D60		;TITLE BUFFER LENGTH
03300	>
03400	
03500		PDPLEN=	40		;PUSH-DOWN STACK LENGTH
03600	
03700	
03800	
03900	
     
00100		;FLAGS SET AND USED ONLY BY THE EXEC
00200	
00300		ARWBIT=	1		;1-LEFT ARROW SEEN
00400		EXTBIT=	2		;1-EXPLICIT EXTENSION SEEN
00500		SWTBIT=	4		;1-ENTER SWITCH MODE
00600		INFOBIT=10		;1-VALID INFORMATION SEEN
00700		ENDBIT=	400		;1-END OF ALL INPUT FILES
00800		SLSHBIT=1000		;1-SWITCH MODE ENTERED WITH A </>
00900		HDRSAV=	2000		;HDRBIT SAVE FOR LITERAL DUMP
01000		NULBIT=	10000		;1-NON-NULL COMMAND STRING
01100		HDRBIT=	40000
01200		SEQBIT=	100000
01300		FSCBIT=	200000		;1-NOT FIRST SRC INIT
01400	
01500		TTO=	0		;DEVICE CHANNELS
01600		BIN=	1
01700		LST=	2
01800		SRC=	3
01900		TTI=	4
02000	
02100		TAB=	11
02200		FF=	14
02300		SPACE=	40
02400		HASH=	47		;HASH MARK FOR GENERATED LINKS
02500	
02600		RUBOUT=	177
02700	
02800	
02900		P1F=	400000		;%15 LEFT
03000		XLFLG=	2
03100		SRCFLG=	4
03200		LINFLG=	10
03300		IFDFLG=	20
03400		NEGFLG=	40
03500		LITFLG=	100		;1-LITERALS PERMITTED
03600		CODFLG=	200		;1-CODE STORED IN THIS FIELD
03700		CSYBIT=	400		;1 MEANS CREF OUTPUT BLK IN PROCESS
03800	
03900		OPDEF	JUMP1	[JUMPL	%15,	]
04000		OPDEF	JUMP2	[JUMPGE	%15,	]
04100	
04200	
     
00100	PAL:	RESET			;RESET ALL I/O
00200		MOVNI	%17,PDPLEN	;SET PUSHDOWN POINTER
00300		HRLS	%17
00400		HRRI	%17,PDPBUF-1
00500		IFN SHARE,<
00600		MOVEI	%00,EZCOR+1	;INITIALIZE LOW SEGMENT
00700		MOVEM	%00,.JBFF
00800		MOVEI	%00,3777	;SET FOR 2K
00900	>
01000		IFE SHARE,<
01100		MOVEI	%00,7777	;SET FOR 4K
01200		SKIPN	.JBDDT		;UNLESS DDT IS LOADED
01300		CAMN	%00,.JBREL
01400		CAIA
01500	>
01600		PUSHJ	%17,PANIC1
01700		MOVE	%00,[XWD BZCOR,BZCOR+1]
01800		SETZB	%01,BZCOR
01900		BLT	%00,EZCOR-1
02000		RUNTIM	%01,
02100		MOVEM	%01,RUNTIM
02200		DATE	%00,
02300		MOVEM	%00,DATE	;SAVE DATE
02400		MSTIME	%00,
02500		MOVEM	%00,MSTIME	;  AND TIME
02600		MOVSI	%16,BINBIT!LSTBIT!CSWBIT
02700		HRRI	%16,HDRBIT
02800		MOVSI	%15,P1F		;SET FOR PASS1
02900	
03000		MOVE	%00,[INIT TTI,1]
03100		MOVSI	%01,(SIXBIT /TTY/)
03200		MOVEI	%02,TTIBUF
03300		PUSHJ	%17,INISET	;INITIALIZE TTY FOR INPUT
03400		INBUF	TTI,1		;GIVE IT AN INPUT BUFFER
03500		MOVE	%00,[INIT TTO,1]
03600		MOVSI	%02,TTOBUF
03700		MOVSI	%03,(AOS 0(%17));SET FOR LOGICAL ASSIGNMENT TEST
03800	;	MOVEI	%10,4
03900		MOVEI	%10,3			;TAKE PS OUT OF LOGICAL ASSIGNMENT TEST
04000		MOVE	%01,[SIXBIT /TTY/	;(PS IS DEC-20'S DISK NAME)
04100			     SIXBIT /P3/	;THIS EDIT BROUGHT TO YOU BY PAUL
04200			     SIXBIT /P8/	;ROBINSON, WESLEYAN UNIV., LIBRARY
04300			     SIXBIT /PD/	;CONVERSION PROGRAMMER, 26 JUN 80
04400			     SIXBIT /PS/](%10)
04500		PUSHJ	%17,%00		;TEST
04600		CAIA
04700		SOJA	%10,.-3		;NO, TRY NEXT ITEM
04800		MOVEM	%10,MODSW	;OK, SET MODE
04900		OUTBUF	TTO,4
05000		MOVEI	%02,"*"		;TYPE AN ASTERISK AT THE USER
05100		PUSHJ	%17,TTYDMP	;...
05200		OUTPUT	TTO,		;REALLY OUTPUT IT
05300		INPUT	TTI,		;GET A COMMAND STRING
     
00100		MOVSI	%01,(SIXBIT /DSK/)
00200		PUSHJ	%17,GETBIN	;INITIALIZE THE BINARY FILE
00300		MOVSI	%01,(SIXBIT /DSK/)
00400		TRNN	%16,ARWBIT	;GO ON TO SOURCE IF _ HAS BEEN SEEN
00500		PUSHJ	%17,GETLST	;INITIALIZE THE LISTING FILE
00600	
00700		MOVE	%05,.JBFF
00800		MOVEM	%05,JOBFFI	;SAVE START OF SRC BUFFER
00900		MOVE	%05,TTIPNT
01000		MOVEM	%05,TTISAV	;SAVE TTI POINTER
01100		MOVSI	%01,(SIXBIT /DSK/)
01200		PUSHJ	%17,GETSRC	;INITIALIZE THE SOURCE FILE
01300		MOVEI	%05,204		;COMPUTE MAX BUFFER SIZE
01400		IMUL	%05,INBCNT
01500		ADD	%05,JOBFFI
01600		TRNN	%16,ENDBIT	;MULTI-FILE?
01700		MOVEM	%05,.JBFF	;  YES, SAVE LARGEST BUFFER SIZE
01800	
01900		MOVE	%05,.JBFF
02000		ADDI	%05,1
02100		HRRZM	%05,CORBOT	;CORE BOTTOM
02200		MOVE	%05,.JBREL
02300		SKIPE	.JBDDT		;DDT LOADED?
02400		MOVE	%05,.JBSYM	;  YES, DON'T CLOBBER SYMBOLS
02500		SUBI	%05,1
02600		HRRZM	%05,CORTOP	;CORE TOP
02700	
02800		PUSHJ	%17,ACSAVE	;SAVE EXEC AC'S
02900		MOVE	%12,MODSW	;SET MODE SWITCH
03000		PUSHJ	%17,PASS1	;PROCESS PASS1
03100	
03200		TLZ	%15,P1F		;SET FOR PASS 2
03300		TRZ	%16,ENDBIT
03400		PUSHJ	%17,ACSAVE	;GET EXEC AC'S
03500		MOVE	%05,TTISAV
03600		MOVEM	%05,TTIPNT	;RESTORE INPUT COMMANDS
03700		MOVSI	%01,(SIXBIT /DSK/)
03800		PUSHJ	%17,GETSRC	;GET A SOURCE FILE
03900		PUSHJ	%17,ACSAVE	;SAVE EXEC AC'S
04000		PUSHJ	%17,PASS2	;PROCESS PASS 2
     
00100		PUSHJ	%17,LSTCR	;SKIP ONE LINE
00200		PUSHJ	%17,ACSAVE	;SWAP AC'S
00300		TLZ	%16,NSWBIT	;BE SURE TO TYPE FINAL MESSAGE
00400		PUSHJ	%17,ERRCR	;SKIP A LINE
00500		MOVEI	%02,"?"		;ASSUME ERROR
00600		SKIPE	%11,ERRCNT	;TEST ERRORS, LOAD %11
00700		PUSHJ	%17,ERROUT
00800		MOVEI	%10,[ASCIZ / ERRORS DETECTED: 5/]
00900		PUSHJ	%17,LSTMSG
01000		PUSHJ	%17,ERR2CR
01100		SETZ	%11,
01200		MOVE	%11,LINKS	;OUTPUT LINKS GENERATED
01300		MOVEI	%10,[ASCIZ / LINKS GENERATED: 5/]
01400		PUSHJ	%17,LSTMSG
01500		PUSHJ	%17,ERR2CR
01600		SETZ	%11,
01700		RUNTIM	%11,		;GET RUNTIM
01800		SUB	%11,RUNTIM	;DEDUCT STARTING TIME
01900		IDIVI	%11,^D1000	;CONVERT TO SECONDS
02000		ADDI	%11,1		;ROUND HIGH
02100		MOVEI	%10,[ASCIZ / RUN-TIME:  5 SECONDS/]
02200		PUSHJ	%17,LSTMSG
02300		PUSHJ	%17,ERR2CR
02400		HRRZ	%11,.JBREL	;GET TOP OF COR
02500		ASH	%11,-^D10	;CONVERT TO "K"
02600		ADDI	%11,1		;BE HONEST ABOUT IT
02700		MOVEI	%10,[ASCIZ / 5K CORE USED/]
02800		PUSHJ	%17,LSTMSG	;LIST MESSAGE
02900		PUSHJ	%17,ERR2CR
03000		JRST	EXIT		;CLOSE OUT
     
00100	;INITIALIZE A BINARY FILE
00200	;COLLECTS A DEVICE NAME IN AC %01, A FILE NAME IN XE, AND
00300	;AN OPTIONAL FILE NAME EXTENSION, THE DEVICE IS INITIALIZED IN
00400	;BINARY MODE ON CHANNEL ONE, WITH EITHER ONE OR TWO BUFFERS.
00500	
00600	GETBIN:	MOVSI	%13,(Z BIN,)	;SET SWITCH AC
00700		PUSHJ	%17,GETCHR	;GET A DEVICE NAME AND FILE NAME
00800		POPJ	%17,		;NULL FILE EXIT
00900		MOVE	%00,%01		;GET AN EXTRA COPY OF THE DEVICE
01000		DEVCHR	%00,		;TEST ITS CHARACTERISTICS
01100		TLNE	%00,PTRDEV!LPTDEV!CDRDEV
01200		JRST	ERRTB		;ILLEGAL FOR BINARY
01300		MOVE	%00,[INIT BIN,10]	;INIT IMAGE MODE
01400		MOVSI	%02,BINBUF	;GET BUFFER HEADER ADDRESS
01500		PUSHJ	%17,INISET	;INITIALIZE THE BINARY DEVICE
01600		OUTBUF	BIN,NUMBUF
01700		TLNE	%13,777000	;IS THERE A SWITCH TO PROCESS?
01800		XCT	%13		;EXECUTE THE ASSEMBLED UUO
01900		TRZN	%16,EXTBIT	;WAS THERE AN EXTENSION
02000		MOVSI	%14,(SIXBIT /BIN/)	;SAVE EXTENSION IN LOOKUP BLOCK
02100		HLLZM	%14,XE1
02200		ENTER	BIN,XE		;ENTER FILE NAME IN DIRECTORY
02300		JRST	ERRNR		;DIRECTORY FULL
02400		TLZ	%16,BINBIT	;INDICATE GOOD BINARY FILE
02500		POPJ	%17,		;EXIT
     
00100	;INITIALIZE A LISTING FILE
00200	;COLLECTS A DEVICE NAME IN AC %01, A FILE NAME IN XE AND
00300	;AN OPTIONAL FILENAME EXTENSION, THE DEVICE IS INITIALIZED IN
00400	;ASCII LINE MODE ON CHANNEL 2, IF THE DEVICE IS A TTY, THE
00500	;TTYLST FLAG IS SET TO 1, AND THE INBUF/OUTBUF INDEX IS INCREMENTED.
00600	
00700	GETLST:	MOVSI	%13,(Z LST,)	;SET SWITCH AC
00800		SETZM	XE
00900		PUSHJ	%17,GETCHR	;GET A DEVICE AND FILE NAME
01000		TLNN	%16,CSWBIT
01100		CAIA
01200		POPJ	%17,
01300		TLNE	%16,CSWBIT
01400		JRST	GETLS2		;NORMAL
01500		MOVSI	%04,(SIXBIT /CRF/)
01600		SKIPE	XE
01700		JRST	GETLS1
01800		MOVE	%03,[SIXBIT /CREF/]
01900		MOVEM	%03,XE
02000	GETLS1:	TRON	%16,EXTBIT
02100		MOVE	%14,%04
02200	GETLS2:	MOVE	%00,[INIT LST,1]
02300		MOVSI	%02,LSTBUF	;GET BUFFER HEADER ADDRESS
02400		PUSHJ	%17,INISET	;INITIALIZE LISTING FILE
02500		MOVE	%00,%01
02600		DEVCHR	%00,		;GET DEVICE CHARACTERISTICS
02700		TLNE	%00,TTYDEV	;IS IT A TTY?
02800		TLO	%16,TTYBIT	;SET FLAG
02900		OUTBUF	LST,NUMBUF
03000		TLNE	%13,777000	;IS THERE A SWITCH TO PROCESS?
03100		XCT	%13		;EXECUTE THE ASSEMBLED UUO
03200		TRZN	%16,EXTBIT	;WAS THERE AN EXTENSION?
03300		MOVSI	%14,(SIXBIT /LST/)	;NO
03400		HLLZM	%14,XE1		;SAVE EXTENSION IN LOOKUP BLOCK
03500		ENTER	LST,XE		;ENTER FILE NAME IN DIR.
03600		JRST	ERRNR		;DIRECTORY FULL
03700		TLZ	%16,LSTBIT	;INDICATE A GOOD LISTING FILE
03800		POPJ	%17,		;EXIT
     
00100	;INITIALIZE A SOURCE FILE
00200	;COLLECTS A DEVICE NAME IN AC %01, A FILE NAME IN XE AND
00300	;AN OPTIONAL FILE NAME EXTENSION. THE DEVICE IS INITIALIZED
00400	;IN ASCII LINE MODE ON CHANNEL 3, AND THE FILE NAME ASSOCIATED
00500	;WITH THE SOURCE FILE IS USED AS THE TITLE ON THE LISTING.
00600	
00700	GETSRC:	TLO	%16,NSRBIT	;FLAG NEW SOURCE FILE
00800		MOVSI	%13,(Z SRC,)	;SET SWITCH AC
00900		SETZM	XE
01000		PUSHJ	%17,GETCHR	;GET A DEVICE NAME AND FILE NAME
01100		JRST	ERRSE		;COMMAND ERROR IF A NULL
01200		TROE	%16,FSCBIT	;FIRST TIME THROUGH?
01300		JRST	SRC1		;  NO
01400		MOVEI	%05,NUMBUF		; SET UP BUFFERING SCHEME
01500		MOVEM	%05,INBCNT	;SAVE THE NUMBER
01600	SRC1:	MOVE	%00,[INIT SRC,1]
01700		MOVEI	%02,SRCBUF	;GET BUFFER HEADER ADDRESS
01800		PUSHJ	%17,INISET	;INITIALIZE THE SOURCE DEVICE
01900		MOVE	%05,JOBFFI
02000		MOVEM	%05,.JBFF	;SET TO TOP OF INPUT BUFFER
02100		INBUF	SRC,@INBCNT
02200		TLNE	%13,777000	;IS THERE A SWITCH TO PROCESS?
02300		XCT	%13		;EXECUTE THE ASSEMBLED UUO
02400		TRZE	%16,EXTBIT	;WAS AN EXPLICIT EXTENSION SEEN?
02500		JRST	SRC3A		;YES, LOOK FOR IT
02600		MOVSI	%14,(SIXBIT /PAL/)
02700		HLLZM	%14,XE1		;NO, TRY .SRC FIRST
02800		LOOKUP	SRC,XE
02900		TDZA	%14,%14		;NOT FOUND, TRY BLANK
03000		POPJ	%17,		;FOUND
03100	SRC3A:	HLLZM	%14,XE1		;SAVE EXTENSION IN LOOKUP BLOCK
03200		HLLZM	%14,EXTSAV	;SAVE EXTENSION FOR HEADER
03300		LOOKUP	SRC,XE		;LOOKUP FILE NAME
03400		JRST	ERRCF		;FILE NOT FOUND
03500		POPJ	%17,		;EXIT
     
00100	;EXEC COMMAND STRING DISPATCHING
00200	;THIS ROUTINE PICKS UP CHARACTERS FROM THE EXEC TTY BUFFER AND
00300	;DISPATCHES TO THE PROPER ROUTINE DEPENDING ON THE TYPE OF
00400	;CHARACTER. A TABLE OF BYTES AND BYTE POINTERS ALLOWS EACH CHARAC-
00500	;TER IN THE ASCII SET TO BE TREATED INDIVIDUALLY.
00600	
00700	
00800	GETCHR:	SETZ	%14,		;CLEAR SYMBOL WORD
00900		MOVE	%06,[POINT 6,%14]
01000	
01100	
01200	GETCMN:	PUSHJ	%17,GETTTI	;GET NEXT CHARACTER
01300		CAIN	%05,"["		;PROJECT-PROGRAMMER PAIR?
01400		JRST	LFTBRA		;YES
01500		CAIGE	%10,4		;MODIFY CODE IF .GE. 4
01600		TRNN	%16,SWTBIT	;MODIFY IF SWITCH IS ON
01700		ADDI	%10,4		;CHANGE DISPATCH BY ADDING 4
01800		HRRZ	%02,DSPTCH(%10)	;LOAD RIGHT HALF DISPATCH
01900		CAIL	%10,10		;SKIP IF CORRECT
02000		HLRZ	%02,DSPTCH-10(%10);OTHERWISE, GET LEFT HALF DSPTCH
02100		JRST	@%02		;GO TO CORRECT ROUTINE
02200	
02300	GETTTI:	ILDB	%05,TTIPNT	;GET A CHARACTER FROM TTY BUFFER
02400		MOVE	%10,%05		;ANOTHER COPY OF IT IN AC %10
02500		IDIVI	%10,8		;TRANSLATE TO 4-BIT CODE
02600		LDB	%10,TABLE(%11)	;USE PROPER BYTE POINTER
02700		CAIN	%10,4		;IS IT A NULL?
02800		JRST	GETTTI		;YES, TRY AGAIN
02900		POPJ	%17,		;NO, EXIT
03000	
03100	;COMMAND DISPATCH TABLE AND BYTE POINTERS
03200	DSPTCH:	XWD	GETCMN,	ERRBS	;IGNORED CHAR, BAD CHAR(SWITCH)
03300		XWD	SWTCH,	SWTCHA	;<(>, LETTER(SWITCH MODE)
03400		XWD	COLON,	ERRBS	;<:>, NUMBER(SWITCH MODE)
03500		XWD	PERIOD,	SWTCHE	;<.>,<)>ESCAPE SWITCH MODE
03600		XWD	LFTARW,	ERRIC	;<_> OR <=>, BAD CHAR (NORMAL MODE)
03700		XWD	COMMA,	STORE	;<,>,ALPHABETICH CHAR (NORMAL)
03800		XWD	CARRTN,	STORE	;<CR>,NUMERIC CHAR (NORMAL)
03900		XWD	SLASH,	ERRIC	;</>, <)> ILLEGAL ESCAPE
04000	
04100	
04200	TABLE:	POINT	4, BITE(%10), 3
04300		POINT	4, BITE(%10), 7
04400		POINT	4, BITE(%10), 11
04500		POINT	4, BITE(%10), 15
04600		POINT	4, BITE(%10), 19
04700		POINT	4, BITE(%10), 23
04800		POINT	4, BITE(%10), 27
04900		POINT	4, BITE(%10), 31
     
00100	;BYTE TABLE FOR DISPATCHING
00200	;CLASSIFICATION BYTE CODES
00300	
00400	
00500	;	BYTE	DISP	CLASSIFICATION
00600	
00700	
00800	;	00	00	ILLEGAL CHARACTER, SWITCH MODE
00900	;	01	01	ALPHABETIC CHARACTER, SWITCH MODE
01000	;	02	02	NUMERIC CHARACTER, SWTICH MODE
01100	;	03	03	SWITCH MODE ESCAPE, SWITCH MODE
01200	
01300	
01400	;	00	04	ILLEGAL CHARACTER, NORMAL MODE
01500	;	01	05	ALPHABETIC CHARACTER, NORMAL MODE
01600	;	02	06	NUMERIC CHARACTER, NORMAL MODE
01700	;	03	07	SWITCH MODE ESCAPE, NORMAL MODE
01800	
01900	
02000	;	04	10	IGNORED CHARACTER
02100	;	05	11	ENTER SWITCH MODE WITH A <(>
02200	;	06	12	DEVICE DELIMITER, <:>
02300	;	07	13	FILE EXTENSION DELIMITER, <.>
02400	;	10	14	OUTPUT SPEC. DELIMITER, <_> OR <=>
02500	;	11	15	FILE DELIMITER, <,>
02600	;	12	16	COMMAND TERMINATOR, <CR>
02700	;	13	17	ENTER SWITCH MODE WITH </>
02800	
02900	
03000	;BYTE TABLE:
03100	
03200	
03300	BITE:
03400		BYTE	(4)	 4,  ,  ,  ,  ,  ,  ,  
03500		BYTE	(4)	  , 4,12, 4, 4,12,  ,  
03600		BYTE	(4)	  ,  ,  ,  ,  ,  ,  ,  
03700		BYTE	(4)	  ,  ,12,  ,  ,  ,  ,  
03800	
03900		BYTE	(4)	11,  , 4,  ,  ,  ,  ,  
04000		BYTE	(4)	 5, 3,  ,  ,11,  , 7,13 
04100		BYTE	(4)	 2, 2, 2, 2, 2, 2, 2, 2
04200		BYTE	(4)	 2, 2, 6,  ,  ,10,  ,  
04300	
04400		BYTE	(4)	  , 1, 1, 1, 1, 1, 1, 1
04500		BYTE	(4)	 1, 1, 1, 1, 1, 1, 1, 1
04600		BYTE	(4)	 1, 1, 1, 1, 1, 1, 1, 1
04700		BYTE	(4)	 1, 1, 1,  ,  ,  ,  ,10
04800	
04900		BYTE	(4)	  ,  ,  ,  ,  ,  ,  ,  
05000		BYTE	(4)	  ,  ,  ,  ,  ,  ,  ,  
05100		BYTE	(4)	  ,  ,  ,  ,  ,  ,  ,  
05200		BYTE	(4)	  ,  ,  ,  ,  ,12,  , 4
     
00100	;LEFT ARROW PROCESSOR
00200	LFTARW:	TRO	%16,ARWBIT	;SET APPROPIATE FLAGS
00300		TRNN	%16,EXTBIT	;IS THIS A FILE NAME EXTENSION?
00400		MOVEM	%14,XE		;NO, ITS A FILE NAME
00500		TRZE	%16,INFOBIT	;IS THIS A NULL FILE?
00600	CPOPJ1:	AOS	(%17)		;GOOD EXIT
00700	CPOPJ:	POPJ	%17,		;...
00800	
00900	;PERIOD PROCESSOR
01000	PERIOD:	TRO	%16,EXTBIT	;SET FLAG FOR EXPLICIT EXTENSION
01100		MOVEM	%14,XE		;SAVE THE FILE NAME
01200		JRST	GETCHR		;RE-ENTER THE GETCHR ROUTINE
01300	
01400	;COLON PROCESSOR
01500	COLON:	MOVE	%01,%14		;SET UP NEW DEVICE NAME
01600		JRST	GETCHR		;RETURN FOR MORE COMMAND
01700	
01800	;COMMA PROCESSOR
01900	COMMA:	TRZN	%16,INFOBIT	;IS THIS A NULL FILE?
02000		TRNE	%16,ARWBIT	;ONLY LOOK FOR THEM IF NO _
02100		SKIPA			;NOT A NULL FILE
02200		POPJ	%17,		;NULL FILE, EXIT
02300	COMMA1:	TRNN	%16,EXTBIT	;DO WE HAVE A FILE NAME EXTENSION?
02400		MOVEM	%14,XE		;NO, IT WAS A FILE NAME
02500		JRST	CPOPJ1		;GOOD EXIT
02600	
02700	;CARRIAGE RETURN PROCESSOR
02800	CARRTN:	TRNN	%16,NULBIT	;IS THIS JUST A RANDOM CR?
02900		JRST	PAL		;YES, RESTART COMPLETELY
03000		TRO	%16,ENDBIT	;IS THIS A NORMAL MODE COMMAND?
03100		TRNN	%16,ARWBIT	;YES, HAS A LEFT ARROW BEEN SEEN?
03200		JRST	ERRSE		;NO, SYNTAX ERROR
03300		JRST	COMMA1		;YES, TREAT IT LIKE A COMMA
     
00100	;THE FOLLOWING TWO ROUTINES HANDLE ALPHANUMERIC CHARACTERS
00200	;FOUND IN THE COMMAND STRING. IN NORMAL MODE, THE CHARACTER
00300	;IS DEPOSITED TO FORM A SIXBIT SYMBOL. IN SWITCH MODE, THE
00400	;PROPER INSTRUCTION IS EXECUTED WITH THE AID OF A DISPATCH
00500	;TABLE. THEN, IF SWITCH MODE WAS ENTERED WITH A SLASH, THE
00600	;EXEC EXITS FROM SWITCH MODE.
00700	
00800	
00900	STORE:	TRO	%16,INFOBIT+NULBIT;TURN ON BITS FOR CR ROUTINE
01000		SUBI	%05,40		;CONVERT SIXBIT TO ASCII
01100		TLNE	%06,770000	;DON'T STORE IF NO ROOM FOR CHAR
01200		IDPB	%05,%06		;PLOP THE CHARACTER INTO AC %14
01300		JRST	GETCMN		;RETURN
01400	
01500	SWTCHA:	MOVEI	%11,-"A"(%05)
01600		MOVE	%10,[POINT 4,BYTAB]
01700		IBP	%10
01800		SOJGE	%11,.-1
01900		LDB	%11,%10
02000		JUMPE	%11,ERRBS
02100		CAIG	%11,SWTABA-SWTAB;THIS SWITCH LEGAL FOR INPUT?
02200		TRNN	%16,ARWBIT	;  NO, ERROR IF "_" SEEN
02300		XCT	SWTAB-1(%11)
02400		JRST	ERRBS
02500		TRZE	%16,SLSHBIT	;CALLED BY A SLASH?
02600		TRZ	%16,SWTBIT	;YES, EXIT FROM SWITCH MODE
02700		JRST	GETCMN		;NO, RETURN FOR MORE CHARACTERS
02800	
02900	
03000	;THE FOLLOWING THREE ROUTINES HANDLE THE CONTROL CHARACTERS
03100	;IN THE COMMAND STRING WHICH CAUSE THE EXEC TO ENTER INTO AND
03200	;EXIT FROM SWITCH MODE. THERE ARE TWO TYPES OF SWITCH MODE,
03300	;DEPENDING ON WHETHER IT IS ENTERED WITH A </> OR A <(>.
03400	
03500	
03600	SLASH:	TRO	%16,SLSHBIT	;TURN ON THE SPECIAL SWITCH MODE
03700	SWTCH:	TROA	%16,SWTBIT	;TURN ON NORMAL SWITCH MODE
03800	SWTCHE:	TRZ	%16,SWTBIT	;TURN OFF THE NORMAL SWITCH MODE
03900		JRST	GETCMN		;RETURN FOR MORE CHARACTERS
     
00100	;DISPATCH TABLE FOR SWITCHES
00200	
00300	
00400		DEFINE	SETSW	(LETTER, INSTRUCTION) <
00500		INSTRUCTION
00600		Y=<"LETTER"-"A">-^D9*<X=<"LETTER"-"A">/^D9>
00700		SETCOD	\X,Y>
00800	
00900		DEFINE	SETCOD	(X,Y)
01000		<BYTAB'X=BYTAB'X!<.-SWTAB>B<4*Y+3>>
01100	
01200	BYTAB0=	0
01300	BYTAB1=	0
01400	BYTAB2=	0
01500	
01600	SWTAB:
01700	
01800		SETSW	P,<PUSHJ %17,SETPSW>
01900	
02000		SETSW	C,<TLZA  %16,CSWBIT>
02100	
02200		SETSW	Z,<TDOE  %13, [UTPCLR  ]>
02300	
02400	SWTABA:
02500		SETSW	A,<TDOE  %13, [MTAPE 16]>
02600		SETSW	B,<TDOE  %13, [MTAPE 17]>
02700		SETSW	T,<TDOE  %13, [MTAPE 10]>
02800		SETSW	W,<TDOE  %13, [MTAPE  1]>
02900	
03000		SETSW	M,<TLOA  %16,MSWBIT>
03100	
03200		SETSW	N,<TLOA  %16,NSWBIT>
03300	
03400		SETSW	D,<TLOA  %16,DSWBIT>
03500	
03600		SETSW	X,<TLOA  %16,XSWBIT>
03700	
03800	BYTAB:	+BYTAB0
03900		+BYTAB1
04000		+BYTAB2
04100	
04200	IF2,	<PURGE	X,	Y,	BYTAB0,	BYTAB1,	BYTAB2	>
     
00100	SETPSW:				;TEST SPECIAL PAL SWITCH
00200		PUSHJ	%17,GETTTI	;GET THE NEXT CHARACTER
00300		SETZ	%10,		;RESET COUNT
00400		MOVE	%11,[POINT 7,[ASCIZ /X38DS/],]
00500		ILDB	%02,%11		;GET A CHARACTER
00600		JUMPE	%02,CPOPJ	;EXIT IF END
00700		CAME	%02,%05		;HAVE WE A MATCH?
00800		AOJA	%10,.-3		;  NO, TRY AGAIN
00900		MOVEM	%10,MODSW	;  YES, SET MODE
01000		AOS	0(%17)		;OK, SET SKIP-RETURN
01100		POPJ	%17,		;EXIT
01200	
01300	
01400	LFTBRA:	SETZM	XE3		;CLEAR NUMBER
01500	LFTBR1:	HRLZS	XE3		;COMMA, MOVE TO LEFT HALF
01600	LFTBR2:	PUSHJ	%17,GETTTI	;GET NEXT CHAR
01700		CAIN	%05,"]"		;TERMINAL?
01800		JRST	GETCMN		;YES, EXIT
01900		CAIN	%05,","		;SEPARATOR?
02000		JRST	LFTBR1		;YES
02100		CAIL	%05,"0"		;TEST FOR OCTAL NUMBER
02200		CAILE	%05,"7"
02300		JRST	ERRIC		;IMPROPER CHARACTER
02400		HRRZ	%10,XE3		;OK, GET PREVIOUS VALUE
02500		IMULI	%10,8
02600		ADDI	%10,-"0"(%05)	;ACCUMULATE NEW NUMBER
02700		HRRM	%10,XE3
02800		JRST	LFTBR2
     
00100	LSTCR:	TDZA	%02,%02
00200	LSTTAB:	MOVEI	%02,11
00300	LSTOUT:	TLNE	%16,LSTBIT	;LISTING REQUESTED?
00400		POPJ	%17,		;  NO, EXIT
00500		TRZE	%16,HDRBIT
00600		PUSHJ	%17,HEADER
00700		JUMPN	%02,LSTDMP
00800	
00900		MOVEI	%02,15		;CARRIAGE RETURN
01000		PUSHJ	%17,LSTDMP
01100		MOVEI	%02,12		;LINE FEED
01200		PUSHJ	%17,LSTDMP
01300		TLNE	%16,TTYBIT	;LISTING TO TTY?
01400		PUSHJ	%17,LIST1	;YES, DUMP THE LINE
01500		SOSG	LINCNT
01600		TRO	%16,HDRBIT
01700		POPJ	%17,
01800	
01900	LSTDMP:	SOSG	LSTCNT		;DECREMENT ITEM COUNT
02000		PUSHJ	%17,LIST1	;EMPTY ENTIRE BUFFER
02100		IDPB	%02,LSTPNT	;STORE THE CHARACTER
02200		POPJ	%17,		;EXIT
02300	
02400	
02500	LIST1:	OUTPUT	LST,		;EMPTY A BUFFER
02600	LSTTST:	STATO	LST,IODATA!IODEV!IOWRLK	;CHECK FOR ERRORS
02700		POPJ	%17,		;NO, EXIT
02800		MOVEI	%10,[ASCIZ /LISTING OUTPUT ERROR/]
02900		JRST	ERROR		;TYPE MESSAGE
     
00100	;ROUTINES FOR OUTPUT ON THE ERROR FILE
00200	;THE FOLLOWING CONVENTIONS ARE OBSERVED FOR OUTPUT ON THE ERROR
00300	;FILE:	1. IF THERE IS A LISTING DEVICE, THE ERROR IS ALWAYS
00400	;	   OUTPUT ON THE LISTING DEVICE
00500	;	2. IF THERE IS NO LISTING DEVICE, THE ERROR WILL BE
00600	;	   TYPED ON THE CONSOLE TTY, AND THE ROUTINE EXITS
00700	;	3. AFTER THE CHARACTER HAS BEEN OUTPUT ON THE LISTING
00800	;	   FILE, THE CHARACTER WILL ALSO BE OUTPUT ON THE TTY
00900	;	   UNLESS ONE OF THE FOLLOWING CONDITIONS EXISTS:
01000	;	   A. THE USER HAS REQUESTED THAT ERRORS BE SUPPRESSED
01100	;	   B. THE LISTING FILE IS ITSELF A TTY.
01200	;	4. IF CERTAINS CONDITIONS OCCUR,THE MESSAGE  "SOURCE
01300	;		ERROR(S) IN FILEXXX " WILL BE TYPED OUT BEFORE
01400	;		THE ERROR CHARACTER IS OUTPUT. THESE CONDITIONS 
01500	;		ARE:
01600	;		A. THE COMPILATION IS IN STANDARD MODE (I.E. ,
01700	;		 ONE OF MANY COMPILATIONS FROM THE SAME 
01800	;		COMMAND STRING).
01900	;	B. THE INPUT IS NOT ON THE TTY
02000	;	. THE USER HAS NOT REQUESTED SUPPRESSION 
02100	;	       OF ERRORS WITH AN N SWITCH
02200	;	D. THE MESSAGE HAS NOT BEEN TYPED BEFORE
02300	;ROUTINES ERROUT AND ERRMES ARE CALLED IN A MANNER SIMILAR TO
02400	;LSTOUT AND LSTMES
02500	
02600	
02700	ERR2CR:	PUSHJ	%17,ERRCR
02800	ERRCR:	TDZA	%02,%02
02900	ERRSP:	MOVEI	%02," "
03000	ERROUT:	HRLM	%02,0(%17)	;SAVE VIRGIN CHARACTER
03100		PUSHJ	%17,LSTOUT	;TRY THE LISTING FILE
03200		TLNE	%16,NSWBIT!TTYBIT	;CHAR TO TTY ALSO?
03300		POPJ	%17,		;NO, JUST EXIT
03400		HLRZ	%02,0(%17)	;YES, RESTORE CHARACTER
03500		JRST	TTYOUT		;TYPE AND EXIT
     
00100	;ROUTINE HEADER DEPOSITS THE LINE FEED IN THE LISTING FILE
00200	;BUFFER AND THEN CHECKS TO SEE IF A FORM FEED IS NECESSARY.
00300	;IF SO, THE ACCUMULATORS ARE SAVED, THE PAGE COUNTER IS
00400	;INCREMENTED, A FORM FEED IS ISSUED, AND A HEADER IS PRINTED.
00500	;THE HEADER CONSISTS OF THE PROGRAM TITLE, FOUND IN THE
00600	;TTLBUF BUFFER,  THE DATE, TIME, AND PAGE NUMBER
00700	
00800	
00900	HEADER:	PUSHJ	%17,ACSAVE	;YES, SAVE THE ACCUMULATORS
01000		PUSH	%17,%16		;SAVE CURRENT FLAGS
01100		TLO	%16,NSWBIT	;DON'T OUTPUT TO TTY
01200		MOVEI	%02,14		;GET A FORM FEED
01300		PUSHJ	%17,LSTDMP	;OUTPUT IT
01400		MOVEI	%10,PAGSIZ+3	;RESET LINE COUNTER REGISTER
01500		MOVEM	%10,LINCNT	;...
01600		SKIPA	%10,[POINT 7,TTLBUF,]
01700		PUSHJ	%17,LSTDMP	;LIST TITLE
01800		ILDB	%02,%10		;GET NEXT CHAR
01900		JUMPN	%02,.-2		;TEST FOR END
02000		PUSHJ	%17,LSTTAB
02100		MOVE	%00,TITLE
02200		PUSHJ	%17,LSTSIX
02300		MOVE	%10,[POINT 7,[ASCIZ / 38DS/],]
02400		MOVE	%02,AC12	;GET MODE TYPE
02500		ILDB	%11,%10		;FETCH A CHARACTER
02600		SOJGE	%02,.-1		;TEST FOR PROPER CHARACTER
02700		MOVEI	%02,"/"
02800		CAIE	%11," "		;DON'T LIST IF "PALX"
02900		PUSHJ	%17,LSTDMP
03000		MOVE	%02,%11
03100		PUSHJ	%17,LSTDMP	;GOT IT, LIST IT
03200		PUSHJ	%17,LSTTAB
03300		MOVE	%00,SUBTTL	;PRINT VERSION NO.
03400		PUSHJ	%17,LSTSIX
03500		PUSHJ	%17,LSTTAB
03600	
03700	;THE FOLLOWING SECTION PRINTS THE DATE, WHICH IS FOUND IN
03800	;REGISTER XDATE IN THE FORM
03900	;	((Y-1964)*12 + (M-1))*31 + (D-1)
04000		MOVE	%10,DATE	;GET THE DATE IN %10
04100		IDIVI	%10,^D31	;DIVIDE BY 31 DECIMIAL
04200		ADDI	%11,1
04300		PUSHJ	%17,DNC		;OUTPUT DAY
04400		IDIVI	%10,^D12	;DIVIDE BY 12 DECIMAL
04500		MOVE	%00,MONTH(%11)
04600		PUSHJ	%17,LSTSIX	;OUTPUT THE MONTH, (M-1) IS IN %12
04700		MOVEI	%11,^D64(%10)	;GET THE YEAR
04800		PUSHJ	%17,DNC		;TYPE IT
04900		PUSHJ	%17,LSTTAB	;OUTPUT TAB
     
00100	;THE FOLLOWING SECTION OF CODE PRINTS THE TIME, WHICH IS
00200	;PICKED UP FROM THE MONITOR AS THE NUMBER OF MILLISECONDS
00300	;SINCE MIDNIGHT. THE FORMAT OF THE TIME PRINTOUT IS HH:MM
00400		MOVE	%11,MSTIME	;GET THE CURRENT TIME
00500		IDIVI	%11,^D60*^D1000	;NUMBER OF MIN. SINCE MIDNITE
00600		IDIVI	%11,^D60	;NUMBER OF HOURS
00700		PUSH	%17,%12		;SAVE MINUTES
00800		PUSHJ	%17,DNC		;OUTPUT THE HOURS
00900		MOVEI	%02,":"		;OUTPUT A COLON AFTER THE HOURS
01000		PUSHJ	%17,LSTDMP	;OUTPUT IT
01100		POP	%17,%11		;PUT MINUTES IN OUTPUT AC
01200		MOVEI	%02,"0"		;GET AN ASCII ZERO
01300		CAIG	%11,^D9		;IS IT A ONE-DIGIT NUMBER?
01400		PUSHJ	%17,LSTDMP	;YES, OUTPUT A ZERO
01500		PUSHJ	%17,DNC		;OUTPUT THE MINUTES
01600	
01700	
01800	;THE FINAL SECTION OF CODING PICKS UP THE WORD "PAGE " AND
01900	;STORES IT IN THE PROPER PLACE IN THE TITLE BUFFER.
02000		PUSHJ	%17,LSTTAB
02100		MOVE	%00,[SIXBIT /PAGE/]
02200		PUSHJ	%17,LSTSIX	;PRINT "PAGE"
02300		MOVEI	%02," "
02400		PUSHJ	%17,LSTDMP	;SPACE
02500		MOVE	%11,PAGNUM	;GET PAGE NUMBER
02600		PUSHJ	%17,DNC		;CONVERT TO DECIMAL AND PRINT
02700		MOVEI	%10,[ASCIZ //]	;ASSUME NO EXTENSION
02800		AOSE	%11,PAGEXT	;INCREMENT, PICK UP, AND TEST
02900		MOVEI	%10,[ASCIZ /-5/]
03000		PUSHJ	%17,LSTMSG	;LIST IT
03100		PUSHJ	%17,ERR2CR
03200		POP	%17,%16		;RESTORE FLAGS
03300		JRST	ACSAVE		;RESTORE F4 REGS AND EXIT
     
00100	DNC:	IDIVI	%11,^D10	;RECURSIVE SUBROUTINE
00200		HRLM	%12,0(%17)	;SAVE REMAINDER ON PUSHDOWN LIST
00300		SKIPE	%11		;ALL DONE?
00400		PUSHJ	%17,DNC		;NO, CALL DNC AGAIN
00500		HLRZ	%02,0(%17)	;RETRIEVE NUMBER FROM PD LIST
00600		ADDI	%02,"0"		;MAKE IT ASCII
00700		JRST	ERROUT		;GET NEXT NUMBER OR EXIT
00800	
00900	LSTSIX:	MOVSI	%06,(POINT 6,%00,)
01000	LSTSI1:	ILDB	%02,%06
01100		JUMPE	%02,CPOPJ
01200		ADDI	%02," "
01300		PUSHJ	%17,ERROUT
01400		TLNE	%06,770000
01500		JRST	LSTSI1
01600		POPJ	%17,
01700	
01800	MONTH:	SIXBIT	/-JAN-/
01900		SIXBIT	/-FEB-/
02000		SIXBIT	/-MAR-/
02100		SIXBIT	/-APR-/
02200		SIXBIT	/-MAY-/
02300		SIXBIT	/-JUN-/
02400		SIXBIT	/-JUL-/
02500		SIXBIT	/-AUG-/
02600		SIXBIT	/-SEP-/
02700		SIXBIT	/-OCT-/
02800		SIXBIT	/-NOV-/
02900		SIXBIT	/-DEC-/
     
00100	;BASIC TELTYPE OUTPUT ROUTINES
00200	;THESE ROUTINES EXIST FOR THE USE OF THE EXEC ONLY, BUT THEIR
00300	;CALLING SEQUENCES ARE THE SAME AS THOSE FOR LSTOUT, LSTMES,
00400	;CONOUT, CONMES, ERROUT, AND ERRMES
00500	
00600	
00700	TTYOUT:	JUMPN	%02,TTYDMP
00800	TTYCR:	MOVEI	%02,15
00900		PUSHJ	%17,TTYDMP
01000		MOVEI	%02,12
01100	TTYDMP:	SOSG	TTOCNT		;IS THE BUFFER EMPTY?
01200		OUTPUT	TTO,		;YES, GO EMPTY IT
01300		IDPB	%02,TTOPNT	;STORE THE CHARACTER
01400		CAIN	%02,12		;WAS IT A LINE FEED?
01500		OUTPUT	TTO,		;YES, OUTPUT THE LINE
01600		POPJ	%17,		;EXIT
01700	
01800	INISET:	MOVE	%03,[JRST ERRNA];ERROR EXIT FOR INIT
01900		MOVSI	%04,(POPJ %17,)
02000		JRST	%00
     
00100	;ROUTINE TO INPUT CHARACTERS FROM THE SOURCE DEVICE
00200	;ROUTINE CHAR INPUTS CHARACTERS ON CHANNEL 3 UNTIL AN END OF
00300	;FILE CONDITION IS MET. IT THEN CHECKS A FLAG TO SEE IF ANY 
00400	;MORE INPUT FILES NEED TO BE INITIALIZED. IF SO, IT RELEASES
00500	;THE OLD INPUT FILE AND INITIALIZES A NEW ONE, AND CONTINUES 
00600	;TO DO INPUT ON THIS FILE.
00700	;WHEN THE LAST END OF FILE IS REACHED, THE EXEC PLACES AN
00800	;S2 CHARACTER AND A CARRIAGE RETURN IN THE BUFFER
00900	
01000	
01100	CHARB:	MOVEM	%14,SEQNUM	;SAVE SEQUENCE NUMBER
01200		AOS	SRCPNT		;INCREMENT POINTER PAST WORD
01300		MOVNI	%14,5		;GET -5
01400		ADDM	%14,SRCCNT	;SUBTRACT 5 FROM WORD COUNT
01500		TRO	%16,SEQBIT
01600	CHAR:	SOSGE	SRCCNT		;DECREMENT ITEM COUNT
01700		JRST	CHAR4		;GET ANOTHER BUFFER IF NECESSARY
01800		IBP	SRCPNT		;INCREMENT THE BYTE POINTER
01900		MOVE	%14,@SRCPNT	;PICK UP AN ENTIRE WORD FROM BUFFER
02000		TRZE	%14,1		;IS THE SEQUENCE NUMBER BIT ON?
02100		JRST	CHARB		;YES, SKIP AROUND IT
02200		LDB	%14,SRCPNT	;NO, PICK UP A GOOD CHARACTER
02300		CAIE	%14,FF		;FORM FEED?
02400		POPJ	%17,		;  NO, EXIT
02500		AOS	PAGNUM		;YES, INCREMENT PAGE
02600		SETOM	PAGEXT		;INITIALIZE EXTENSION
02700		TRO	%16,HDRBIT
02800		POPJ	%17,
02900	
03000	CHAR4:	INPUT	SRC,		;CALL MONITIOR FOR A BUFFER
03100		STATZ	SRC, IODATA+IODEV+IOBKTL
03200		JRST	ERRID		;INPUT TRANSMISSION ERROR
03300		STATO	SRC, IOEOF	;WAS AN END OF FILE REACHED?
03400		JRST	CHAR		;GET NEXT CHAR
03500		CLOSE	SRC,
03600		TRNN	%16,ENDBIT	;CRR SEEN BY COMMAND SCANNER?
03700		JRST	CHAR5		;  NO, MUST BE ANOTHER FILE
03800		JRST	ERRND		;ERROR IF NO "$"
03900	
04000	CHAR5:	PUSHJ	%17,ACSAVE	;GET EXEC AC'S
04100		PUSHJ	%17,GETSRC	;GET THE NEXT SOURCE FILE
04200		TRO	%16,HDRBIT	;START NEW FILE
04300		PUSHJ	%17,ACSAVE	;SAVE EXEC AC'S AND RETURN
04400		JRST	CHAR
     
00100	;ROUTINES TO SAVE AND RESTORE THE COMPILER ACCUMULATORS
00200	ACSAVE:				;SWAP AC'S
00300		EXCH	%00,AC00
00400		EXCH	%01,AC01
00500		EXCH	%02,AC02
00600		EXCH	%03,AC03
00700		EXCH	%04,AC04
00800		EXCH	%05,AC05
00900		EXCH	%06,AC06
01000		EXCH	%07,AC07
01100		EXCH	%10,AC10
01200		EXCH	%11,AC11
01300		EXCH	%12,AC12
01400		EXCH	%13,AC13
01500		EXCH	%14,AC14
01600		POPJ	%17,
     
00100	;ROUTINE TO OUTPUT RELOCATABLE BINARY
00200	
00300	
00400	BINOUT:	TLNE	%16,BINBIT!NOPBIT	;BINARY REQUESTED?
00500		POPJ	%17,		;  NO, EXIT
00600		SOSG	BINCNT
00700		PUSHJ	%17,BINDMP
00800		IDPB	%02,BINPNT
00900		POPJ	%17,
01000	
01100	BINDMP:	OUTPUT	BIN,
01200	BINTST:	STATO	BIN,IODATA!IODEV!IOWRLK
01300		POPJ	%17,
01400		MOVEI	%10,[ASCIZ /BINARY OUTPUT ERROR/]
01500		JRST	ERROR		;TYPE ERROR MESSAGE
     
00100	;CALLS TO THE EXEC FOR MORE CORE
00200	
00300	
00400	;PANIC HAS THE FOLLOWING CALLING SEQUENCE
00500	;	PUSHJ	%17,PANIC	
00600	;	RETURN 1		;NO MORE CORE
00700	;	RETURN 2		;MORE CORE
00800	;THE EXEC CALL THE TIME-SHARING MONITOR FOR MORE
00900	; CORE BY LOADING AC %10 ,WHICH IS USED AS A SCRATCH AC, WITH 
01000	; THE HIGHEST DESIRED RELATIVE ADDRESS,I.E.;%13(.JBREL)+2000,AND
01100	; THEN EXECUTING A CALL %10,CORE. IF UNCUCCESSFUL, THE ROUTINE
01200	; EXITS TO RETURN 1 ABOVE.
01300	;IF SUCCESSFUL, THE MONITOR WILL UPDATE .JBREL IN THE JOB
01400	;DATA AREA. THE EXEC THEN UPDATES THE LEFT HALT OF ROLMEM
01500	;SO THAT THE COMPILER CAN MOVE ITS TABLES HIGHER IN CORE.
01600	
01700	
01800	PANIC:	HRRZ	%00,.JBREL	;GET PRESENT ROLMEM
01900		ADDI	%00,CORINC	;ADD 1K OF CORE TO IT
02000	PANIC1:	CORE	%00,		;ASK FOR MORE CORE
02100		JRST	ERRNC		;NO MORE CORE AVAILABLE
02200		POPJ	%17,
     
00100	ERRCF:	MOVEI	%10,[ASCIZ /CANNOT FIND 234/]
00200		JRST	ERROR
00300	
00400	ERRID:	MOVEI	%10,[ASCIZ /INPUT DATA ERROR 234/]
00500		SKIPA	%01,AC01
00600	
00700	ERRBS:	MOVEI	%10,[ASCIZ /1 IS A BAD SWITCH/]
00800		JRST	ERROR
00900	
01000	ERRIC:	MOVEI	%10,[ASCIZ /1 IS AN ILLEGAL CHARACTER/]
01100		JRST	ERROR
01200	
01300	ERRNA:	MOVEI	%10,[ASCIZ /2 IS NOT AVAILABLE/]
01400		JRST	ERROR
01500	
01600	ERRNR:	MOVEI	%10,[ASCIZ /NO ROOM FOR 234/]
01700		JRST	ERROR
01800	
01900	ERRSE:	MOVEI	%10,[ASCIZ /SYNTAX ERROR IN COMMAND STRING/]
02000		JRST	ERROR
02100	
02200	ERRNC:	MOVEI	%10,[ASCIZ /INSUFFICIENT CORE/]
02300		JRST	ERROR
02400	
02500	ERRND:	MOVEI	%10,[ASCIZ /NO "$" SEEN/]
02600		JRST	ERROR
02700	
02800	ERRTF:	MOVEI	%10,[ASCIZ /TOO MANY INPUT FILES/]
02900		JRST	ERROR
03000	
03100	ERRTB:	MOVEI	%10,[ASCIZ /2 ILLEGAL FOR BINARY OUTPUT/]
03200		JRST	ERROR
     
00100	ERROR:	MOVE	%16,[XWD LSTBIT!BINBIT,ENDBIT]
00200		PUSHJ	%17,ERRCR
00300		MOVEI	%02,"?"
00400		PUSHJ	%17,ERROUT
00500		PUSHJ	%17,ERRSP	;TYPE SPACE
00600		PUSHJ	%17,LSTMSG
00700		PUSHJ	%17,ERR2CR
00800		JRST	EXIT
00900	
01000	LSTMSG:	TLOA	%10,(POINT 7,,)	;SET BYTE POINTER AND SKIP
01100	LSTMS4:	PUSHJ	%17,ERROUT	;TYPE CHARACTER
01200	LSTMS5:	ILDB	%02,%10		;GET CHARACTER
01300		JUMPE	%02,CPOPJ	;TEST FOR END
01400		CAIL	%02,"1"		;TEST FOR SWITCH
01500		CAILE	%02,"5"
01600		JRST	LSTMS4		;NO, TYPE THE CHARACTER
01700		PUSHJ	%17,@[EXP ERR1,ERR2,ERR3,ERR4,DNC]-"1"(%02)
01800		JRST	LSTMS5		;GET NEXT CHARACTER
01900	
02000	ERR1:	MOVE	%02,%05		;GET IMPROPER CHARACTER
02100		JRST	TTYDMP		;DUMP IT
02200	
02300	ERR2:	MOVE	%00,%01		;GET DEVICE NAME
02400		PUSHJ	%17,LSTSIX	;TYPE IT
02500		MOVEI	%02,":"
02600		JRST	TTYDMP		;TYPE ":"
02700	
02800	ERR3:	MOVE	%00,XE		;GET FILE NAME
02900		JRST	LSTSIX		;TYPE IT
03000	
03100	ERR4:	HLLZ	%00,XE1		;GET EXTENSION
03200		JUMPE	%00,CPOPJ	;EXIT IF NULL
03300		MOVEI	%02,"."
03400		PUSHJ	%17,TTYDMP	;TYPE "."
03500		JRST	LSTSIX
     
00100	EXIT:	CLOSE	SRC,		;CLOSE THE SOURCE DEVICE
00200		CLOSE	LST,		;CLOSE THE LISTING FILE
00300		CLOSE	BIN,		;CLOSE THE BINARY FILE
00400		TLON	%16,LSTBIT	;WAS THERE A LISTING FILE?
00500		PUSHJ	%17,LSTTST	;YES, TEST FOR FINAL ERROR
00600		TLON	%16,BINBIT	;IS THERE A BINARY FILE?
00700		PUSHJ	%17,BINTST	;YES, TEST FOR FINAL ERROR
00800		TRNN	%16,ENDBIT	;END OF COMMAND STRING?
00900		JRST	ERRTF		;  NO, MARK ERROR
01000		CLOSE	TTO,		;BE SURE MESSAGES ARE COMPLETE
01100		JRST	PAL		;GET A NEW COMMAND STRING
     
00100	;RH OF %15 FLAG BITS
00200	
00300	ERRC=	400000		;ILLEGAL CHARACTER (IC)
00400	ERRD=	200000		;ILLEGAL REDEFINITION (ID)
00500	ERRI=	100000		;ILLEGAL INDIRECT (II)
00600	ERRL=	040000		;LITERAL ERROR (PE)
00700	ERRN=	020000		;NUMERIC ERROR
00800	ERRO=	010000		;ILLEGAL OP-CODE
00900	ERRP=	004000		;PHASE ERROR (ID)
01000	ERRQ=	002000		;QUESTIONABLE FORMAT ERROR
01100	ERRT=	001000		;ILLEGAL TEXT CHARACTER
01200	ERRU=	000400		;UNDEFINED SYMBOL (US)
01300	ERRZ=	000200		;PAGE ZERO EXCEEDED (ZE)
01400	ERRM=	000100		;MACRO ERROR
01500	ERRG=	000040		; LINK GENERATED
01600	
01700	;LH OF VALUE CELL FOR SYMBOL
01800	
01900	LBLFLG=	001000
02000	MDLFLG=	002000		;MULTIPLY DEFINED LABEL FLAG
02100	DEFFLG=	004000		;DEFINED FLAG
02200	
02300	;RH OF VALUE CELL OF SYMBOL TABLE ENTRY
02400	
02500	CHAN7=	010000
02600	CHAN8=	020000
02700	CHAN78=	030000
     
00100	PASS1:
00200		MOVSI	%02,BSYMT-EBSYMT	;SET FOR FULL TABLE
00300		PUSHJ	%17,INIPAS
00400		PUSHJ	%17,SYTI
00500		MOVEI	%02,TERMCV+TJLP	;TEST FOR LITERALS
00600		LDB	%02,CNVTBL(%12)
00700		CAIN	%02,TJLP	;WAS "(" MAPPED?
00800		TLO	%15,LITFLG	;  NO, ALLOW LITERALS
00900		PUSHJ	%17,LINE
01000		POPJ	%17,
01100	
01200	
01300	PASS2:
01400		PUSHJ	%17,LEADER
01500		PUSHJ	%17,INIPAS
01600		MOVEI	%10,CHAN7+200
01700		PUSHJ	%17,BINWRD
01800		PUSHJ	%17,LINE
01900		PUSHJ	%17,DCLIT	;DUMP CURRENT LITERALS
02000		PUSHJ	%17,DZLIT	;DUMP PAGE ZERO LITERALS
02100		TLZ	%16,NOPBIT	;REENABLE BINARY FOR CHECKSUM AND TRAILER
02200		MOVE	%10,CHKSUM
02300		TRZ	%10,CHAN78	;ONLY 12 BITS
02400		PUSHJ	%17,BINWRD
02500		PUSHJ	%17,LEADER
02600		ZBINK			;KEEP THE OPERATOR HAPPY
02700		PUSHJ	%17,BITDMP	;LIST BIT MAP
02800		TLNN	%16,LSTBIT!MSWBIT	;LISTING?
02900		PUSHJ	%17,SYMTB	;  YES, OUTPUT THE SYMBOL TABLE
03000		POPJ	%17,
03100	
03200	
03300	INIPAS:
03400		PUSHJ	%17,OCTAL	;SET OCTAL RADIX
03500		MOVEI	%05,200
03600		SETZM	CHKSUM
03700		SETZM	SEQNUM
03800		SETZM	LVLCNT
03900		MOVEI	%00,1
04000		MOVEM	%00,PAGNUM	;INITIALIZE PAGE NUMBER
04100		SETOM	PAGEXT		;  AND EXTENSION
04200		MOVE	%00,CORBOT
04300		MOVEM	%00,MACTOP
04400		SETZM	MACPNT
04500		SETZM	ARGPNT
04600		TLZ	%15,SRCFLG
04700		POPJ	%17,
     
00100	LINE:				;PROCESS ONE LINE
00200		PUSHJ	%17,GETLIN	;GET A SOURCE LINE
00300	
00400	LINE1:	SETZM	EQUIV
00500		JUMPE	%14,LINE4	;BRANCH IF END OF LINE
00600		SKIPE	DBLPNT		;ANY DUBL OR FLTG IN PROGRESS?
00700		JRST	DBLENT		;  YES, GO PROCESS
00800		PUSHJ	%17,STMNT	;PROCESS ONE STATEMENT
00900	
01000	LINE2:	LDB	%02,C1PNTR	;CONVERT USING COLUMN 1
01100		XCT	LINEJT(%02)	;EXECUTE TABLE
01200	LINE3:	ILDB	%14,%13		;NOT TERMINATOR
01300		JRST	LINE2		;  GO LOOK FOR IT
01400	
01500	
01600	LINE4:	PUSHJ	%17,ENDL	;NORMAL TERMINATION
01700	LINE5:	JUMPE	%14,LINE	;RECYCLE IF CR
01800		SKIPN	LVLCNT		;NO, ARE WE IN A CONDITIONAL?
01900		JRST	LINE		;  NO
02000		ILDB	%14,%13		;YES, GET THE NEXT CHARACTER
02100		CAIN	%14,">"		;TEST FOR RIGHT ANGLE BRACKET
02200		SOS	LVLCNT		;  YES, DECREMENT IT
02300		JRST	LINE5		;TEST FOR END OR MORE
02400	
02500	LINE6:	PUSHJ	%17,ENDL	;SEMI-COLON, LIST LINE
02600		ILDB	%14,%13		;MOVE PAST SEMI
02700		TLO	%15,SRCFLG	;DON'T LIST CONTINUATION
02800		JRST 	LINE1		;CONTINUE WITH THIS LINE
02900	
03000	LINE7:	SOSL	LVLCNT		;DECREMENT LEVEL COUNT AND TEST
03100		JRST	LINE3		;OK, TEST FOR ANOTHER
03200		SETZM	LVLCNT		;UNDERFLOW, RESET TO ZERO
03300		TRO	%15,ERRQ	;FLAG ERROR
03400		JRST	LINE3		;TRY AGAIN
03500	
03600	
03700	LINEJT:				;LINE JUMP TABLE
03800		PHASE	0
03900		TRO	%15,ERRQ	; INVALID TERMINATOR
04000	LNSP:	JFCL			; TAB OR SPACE
04100	LNCR:	JRST	LINE4		; CR OR /
04200	LNSC:	JRST	LINE6		; ;
04300	LNDO:	JRST	ENDL		; $
04400	LNLA:	TRO	%15,ERRQ	; <
04500	LNRA:	JRST	LINE7		; >
04600		DEPHASE
     
00100	GETLIN:				;GET THE NEXT SOURCE LINE
00200		MOVEI	%06,CPL		;TEST FOR OVERFLOW
00300		SKIPA	%13,LINPNT	;SET POINTER AND SKIP
00400	GETLI1:	TRO	%15,ERRC	;ILLEGAL CHARACTER
00500	GETLI2:	SKIPE	MACPNT		;IN A MACRO?
00600		JRST	GETMAC		;  YES
00700		PUSHJ	%17,CHAR	;GET AN INPUT CHARACTER
00800	GETLI4:	LDB	%02,C7PNTR	;SET INDEX
00900		XCT	GLTBL(%02)
01000	GETLI5:	SOJL	%06,GETLI2	;DON'T STORE IF TOO MANY
01100	GETLI6:	IDPB	%14,%13		;STORE IN BUFFER
01200		JUMPN	%14,GETLI2	;RECYCLE IF NOT END
01300		LDB	%14,[POINT 7,LINBUF,6]
01400		JUMPE	%14,GETLI7
01500		MOVE	%13,[XWD LINBUF,TTLBUF]
01600		TLZE	%16,NSRBIT	;NEW SOURCE SEEN?
01700		BLT	%13,TTLEND-1	;  YES, SET IT UP
01800	GETLI7:	PUSHJ	%17,CREFQ	;CREF OUTPUT WANTED?
01900		JRST	GETLI8		;NO
02000		TLON	%15,CSYBIT	;YES. STARTED ALREADY?
02100		PUSHJ	%17,CRFBGN	;NO. START IT NOW
02200	GETLI8:	MOVE	%13,LINPNT	;SET FOR READ
02300		ILDB	%14,%13		;RETURN FIRST CHAR
02400		POPJ	%17,		;EXIT
02500	
02600	CRFBGN:	MOVEI	%02,CRFPFX	;START CREF BLOCK
02700		PUSHJ	%17,LSTOUT	;OUTPUT ON LISTING
02800		MOVEI	%02,CRFSOL	;START OF LINE CHARACTER
02900		JRST	LSTOUT		;OUTPUT AND POPJ TO GETLIN
03000	
03100	CREFQ:	JUMP1	CPOPJ		;NO OUTPUT ON PASS 1
03200		TLNN	%16,CSWBIT!LSTBIT	;CREF BEEN ASKED FOR?
03300		AOS	0(%17)		;YES. SKIP RETURN
03400		POPJ	%17,0
03500	
03600	GLTBL:				;GET LINE TABLE
03700		PHASE	0
03800		JRST	GETLI1		;ILLEGAL
03900	QJNU:	JRST	GETLI2		;NULL
04000	QJCR:	TDZA	%14,%14		;CARRIAGE RETURN
04100	QJTB:	JFCL
04200	QJSP:	JFCL
04300	QJPC:	JFCL
04400		DEPHASE
     
00100	GETMAC:				;GET A MACRO CHARACTER
00200		SKIPE	ARGPNT		;PROCESSING AN ARGUMENT?
00300		JRST	GETMA3		;  YES
00400		ILDB	%14,MACPNT	;  NO, GET THE NEXT CHARACTER
00500		JUMPE	%14,GETLI6	;BRANCH IF END OF LINE
00600		CAIE	%14,RUBOUT	;RUBOUT FLAG?
00700		JRST	GETLI5		;  NO, RETURN
00800		ILDB	%14,MACPNT	;  YES, GET THE NEXT ITEM
00900		JUMPE	%14,GETMA4	;IF NULL, WE ARE DONE
01000		MOVE	%02,ARGTMP	;NO, IT IS AN ARGUMENT
01100		MOVEM	%02,ARGPNT	;SET ARG PNTR
01200	GETMA1:	SOJE	%14,GETMA3	;TEST FOR PROPER ARG
01300	GETMA2:	ILDB	%02,ARGPNT	;NOT PROPER ARG, MOVE TO IT
01400		CAIE	%02,RUBOUT	;ARGUMENT END?
01500		JRST	GETMA2		;  NO
01600		JRST	GETMA1		;  YES, TEST FOR END
01700	
01800	GETMA3:	ILDB	%14,ARGPNT	;ARGUMENT, GET NEXT CHARACTER
01900		CAIE	%14,RUBOUT	;END FLAG?
02000		JRST	GETLI4		;  NO, RETURN
02100		SETZM	ARGPNT		;  YES, ZERO POINTER
02200		JRST	GETMAC		;RETURN TO MAIN STREAM
02300	
02400	GETMA4:	SETZM	MACPNT		;END OF MACRO, CLEAR POINTER
02500		SETZM	ARGPNT		;  AND ARG POINTER
02600		MOVE	%02,ARGTMP
02700		HRRZM	%02,MACTOP	;RECOVER SPACE
02800		JRST	GETLI6		;RETURN
     
00100	ENDL:				;END OF LINE PROCESSOR
00200		JUMP1	ENDL11		;BRANCH IF PASS 1
00300	
00400		SKIPGE	VALUE		;IF NO CODE
00500		TLNE	%16,XSWBIT	;  OR BIT MAP SUPPRESSED,
00600		JRST	ENDL2		;  BYPASS FOLLOWING
00700		MOVE	%01,%05
00800		IDIVI	%01,^D36
00900		MOVNS	%02
01000		MOVSI	%03,(1B0)
01100		ROT	%03,0(%02)
01200		ORM	%03,BITBUF(%01)
01300		TLO	%15,CODFLG
01400		LDB	%02,[POINT 5,%05,28]
01500		AOS	PAGBUF(%02)	;FLAG PAGE AS USED
01600	
01700	ENDL2:	MOVEI	%01,CPOPJ	;DISPATCH ADR IF NO LISTING
01800		TLNE	%16,XLBIT	;DONT LIST IF XLIST TRUE
01900		JRST	ENDL2A		;XLIST
02000		TLZN	%15,CSYBIT	;CREF BLOCK STARTED?
02100		JRST	ENDL2B		;NO. DONT END IT THEN.
02200		MOVEI	%02,CRFPFX	;PREFIX CHARACTER
02300		PUSHJ	%17,LSTDMP	;OUTPUT THE CHAR TO LISTING
02400		MOVEI	%02,CRFEOL	;END OF LINE CODE
02500		PUSHJ	%17,LSTDMP	;OUTPUT IT TOO
02600	ENDL2B:	MOVEI	%01,LSTOUT	;DISPATCH ADR FOR LISTING
02700	ENDL2A:	SKIPL	VALUE		;ANY CODE TO BE STORED?
02800		JRST	ENDL4		;  NO
02900		TRNE	%05,7600	;  YES, ARE WE ON PAGE ZERO?
03000		JRST	ENDL3		;  NO
03100		SKIPE	ZLTBUF(%05)	;  YES, TEST FOR IN USE
03200		TROA	%15,ERRZ	;  YES, FLAG ERROR
03300		HLRZM	%17,ZLTBUF(%05)	;  NO, FLAG AS USED
03400		JRST	ENDL4
     
00100	ENDL3:	LDB	%02,[POINT 5,%05,28]	;GET PAGE
00200		SKIPE	CLHBUF(%02)	;TEST FOR LITERAL OVERLAP
00300		CAMGE	%05,CLHBUF(%02)
00400		CAIA
00500		TRO	%15,ERRL	;OVERLAP, FLAG ERROR
00600	ENDL4:	TRNN	%15,-1		;ANY ERRORS?
00700		JRST	ENDL6		;  NO
00800		MOVEI	%00,7402	;SET "HLT" INSTRUCTION
00900		TRNE	%15,ERRU!ERRI	;UNDEFINED ERROR?
01000		HRRM	%00,VALUE	;  YES, SUBSTITUTE FOR INSTRUCTION, IF ANY
01100		MOVE	%00,XE		;GET FILE NAME
01200		TLNN	%16,NSWBIT
01300		CAMN	%00,XESAVE
01400		JRST	ENDL4C
01500		JUMPE	%00,ENDL4C
01600		MOVEM	%00,XESAVE
01700		MOVSI	%01,(POINT 6,%00,)
01800	ENDL4A:	ILDB	%02,%01
01900		JUMPE	%02,ENDL4B
02000		ADDI	%02,40
02100		PUSHJ	%17,TTYOUT
02200		TLNE	%01,770000
02300		JRST	ENDL4A
02400	ENDL4B:	MOVEI	%02,":"
02500		PUSHJ	%17,TTYOUT
02600		PUSHJ	%17,TTYCR
02700	ENDL4C:	HRLZ	%00,%15		;PUT FLAGS IN AC0 LEFT
02800		TLNE	%00,-1-ERRG
02900		AOS	ERRCNT
03000		MOVE	%01,MODSW
03100		TRNE	%15,ERRG
03200		PUSHJ	%17, @HASHTB(%01)		; PROCESS THE "G" ERROR
03300		TLNE	%00,-1-ERRQ-ERRC;ANY ERRORS OTHER THAN Q OR C?
03400		TLZ	%00,ERRQ	;  YES, FLUSH Q
03500		MOVE	%01,[POINT 7,[ASCII /CDILNOPQTUZMG/],]
03600	ENDL5:	ILDB	%02,%01		;FETCH CHARACTER
03700		TLNE	%00,400000	;THIS CHARACTER
03800		PUSHJ	%17,ERROUT	;  YES
03900		LSH	%00,1
04000		JUMPN	%00,ENDL5	;TEST FOR END
04100		MOVEI	%01,ERROUT	;END, SET TO ERROR-LIST
     
00100	ENDL6:	MOVE	%02,LINPNT	;TEST FOR NO MORE LISTING
00200		ILDB	%02,%02
00300		TDO	%02,VALUE
00400		TDO	%02,EQUIV
00500		TDO	%02,SEQNUM
00600		JUMPE	%02,ENDL10	;BRANCH IF NOTHING TO LIST
00700		MOVEI	%02,TAB
00800		PUSHJ	%17,0(%01)	;LIST A TAB
00900		REPEAT	2,		<
01000		MOVEI	%02,SPACE
01100		PUSHJ	%17,0(%01)	>
01200		MOVE	%10,%05		;ASSUME BINARY
01300		SKIPE	VALUE		;TRUE?
01400		PUSHJ	%17,LSTOCT	;  YES
01500		MOVEI	%02,TAB
01600		PUSHJ	%17,0(%01)
01700		SKIPL	%10,VALUE
01800		SKIPE	%10,EQUIV	;ANYTHING TO BE LISTED?
01900		PUSHJ	%17,LSTOCT	;  YES
02000		TRNN	%15,ERRG
02100		JRST	ENDL6A
02200		MOVEI	%02,HASH		; OUTPUT A HASH MARK
02300		PUSHJ	%17, 0(%01)
02400	ENDL6A:	TLZE	%15,SRCFLG	;SHOULD WE BYPASS SOURCE?
02500		JRST	ENDL10		;  YES
02600		TRNN	%16,SEQBIT	;ANY SEQUENCE NUMBERS ENCOUNTERED?
02700		JRST	ENDL8		;  NO
02800		MOVEI	%02,TAB
02900		PUSHJ	%17,0(%01)	;OUTPUT A TAB
03000		MOVE	%00,[POINT 7,SEQNUM,]
03100	ENDL7:	ILDB	%02,%00		;GET A CHARACTER
03200		JUMPE	%02,ENDL8	;BYPASS IF NULL
03300		PUSHJ	%17,0(%01)	;OUTPUT THE NUMBER
03400		TLNE	%00,760000	;END OF WORD?
03500		JRST	ENDL7		;  NO, TRY FOR MORE
03600	ENDL8:	MOVEI	%02,TAB
03700		PUSHJ	%17,0(%01)
03800		SKIPA	%03,LINPNT	;GET SET TO PRINT LINE
03900	ENDL9:	PUSHJ	%17,0(%01)	;LIST A CHARACTER
04000		ILDB	%02,%03		;GET ANOTHER CHARACTER
04100		JUMPN	%02,ENDL9	;TEST FOR END
     
00100	ENDL10:	SETZB	%02,SEQNUM
00200		PUSHJ	%17,0(%01)	;END,LIST CR/LF
00300		TLZE	%15,XLFLG	;XLIST ENCOUNTERED?
00400		TLC	%16,XLBIT	;  YES, TOGGLE BIT
00500	ENDL11:	SKIPL	%10,VALUE	;ANY OCTAL?
00600		JRST	ENDL12		;  NO
00700		TRZ	%10,CHAN78	;  YES, CLEAR ANY HIGH BITS
00800		PUSHJ	%17,BINWRD	;  AND DUMP THE BINARY
00900		ADDI	%05,1
01000		ANDI	%05,007777
01100	ENDL12:	SETZM	VALUE
01200		TRZ	%15,-1
01300		TLZ	%15,SRCFLG!LINFLG
01400		POPJ	%17,
01500	
01600	; "G" ERROR SWITCH PROCESSOR
01700	HASHTB:	GERR02	;PAL10
01800		GERR01	;PALX
01900		GERR01	;PAL3
02000		GERR01	;PAL8
02100		GERR03	;PALD
02200		GERR01	;PALS
02300	
02400	GERR03:	TLZA	%00, ERRG		; JUST DO IT NO ERROR NO FLAG
02500	GERR01:	AOS	ERRCNT		;COUNT AS AN ERROR
02600		AOS	LINKS		; COUNT AS A LINK ALSO
02700		TRZ	%15,ERRG
02800		POPJ	%17,
02900	
03000	GERR02:	AOS	LINKS		; COUNT AS A LINK ONLY
03100		TLZ	%00,ERRG		; DO NOT OUTPUT AS ERROR
03200		POPJ	%17,
03300	
     
00100	STMNT0:	ILDB	%14,%13
00200	STMNT:				;STATEMENT PROCESSOR
00300		LDB	%02,C2PNTR	;CONVERT USING COLUMN 2
00400	STMNT1:	ADDI	%02,STMNCV	;SET CONVERSION TABLE ADDRESS
00500		LDB	%02,CNVTBL(%12)	;SET FOR PROPER MODE
00600		XCT	STMNJT(%02)	;EXECUTE TABLE
00700		 POPJ	%17,		;NO CODE
00800		HRROM	%10,VALUE	;STORE AND MARK CODE
00900		POPJ	%17,		;EXIT
01000	
01100	
01200	STMNCV:				;STATEMENT CONVERSION TABLE
01300		PHASE	0
01400		BYTE	(4)	  . ,  . ,  . ,  . ,  . ,  . 
01500	STSP:	BYTE	(4)	  . ,  . ,  . ,  . ,  . ,  . 
01600	STAL:	BYTE	(4)	  . ,  . ,  . ,  . ,  . ,  . 
01700	STAS:	BYTE	(4)	  . ,  . ,  . ,  . ,  . ,  . 
01800	STLA:	BYTE	(4)	  . ,  0 ,  0 ,  0 ,  0 ,  0 
01900	STSC:	BYTE	(4)	  . ,  . ,  . ,  . ,  . ,  . 
02000		DEPHASE
02100	
02200	
02300	STMNJT:				;STATEMENT JUMP TABLE
02400		PHASE	0
02500		PUSHJ	%17,EXPR	; NOTHING SPECIAL
02600	STSP:	JRST	STMNT0		; TAB OR SPACE
02700	STAL:	JRST	STMNAL		; ALPHABETIC
02800	STAS:	JRST	STMNAS		; *
02900	STLA:	JRST	XTEXT		; <
03000	STSC:	TRO	%15,ERRQ	; ;
03100		DEPHASE
     
00100	STMNAL:				;ALPHABETIC
00200		MOVE	%10,%13		;SAVE CHARACTER POINTER
00300		PUSHJ	%17,GETSYM	;ACCUMULATE A SYMBOL
00400		LDB	%02,C3PNTR	;CONVERT USING COLUMN 3
00500		XCT	STALJT(%02)	;EXECUTE TABLE
00600		 SETZ	%01,
00700		LDB	%02,[POINT 9,%01,17]	;GET OP TYPE POINTERS
00800		XCT	STOPJT(%02)	;TEST FOR PSEUDO-OPS
00900		MOVE	%13,%10		;NOT PSEUDO-OP
01000		LDB	%14,%13		;REPLACE CHARACTER
01100		JRST	STMNT1		;FALL THROUGH TO EXPRESSION
01200	
01300	
01400	STALJT:
01500		PHASE	0
01600		PUSHJ	%17,SRCH	;GET SYMBOLIC QUANTITY
01700	SACM:	JRST	LABEL		; ,
01800	SAEQ:	JRST	ASGMT		; =
01900		DEPHASE
02000	
02100	
02200	STOPJT:
02300		PHASE	0
02400		SETZ	%02,
02500	PSOP:	JRST	PSCREF
02600	MROP:	SETZ	%02,
02700	MCOP:	SETZ	%02,
02800	MAOP:	JRST	MACREF
02900		DEPHASE
03000	
03100	MACREF:	PUSHJ	%17,CRFOUT	;REFERENCE THE MACRO NAME
03200		JRST	CALLM		;AND GO DO IT.
03300	PSCREF:	PUSHJ	%17,CRFOUT	;REFERENCE THE PSEUDO
03400		JRST	0(%01)		;AND DISMISS TO ROUTINE
     
00100	LABEL:				;LABEL PROCESSOR
00200		PUSHJ	%17,SRCH	;SEARCH SYMBOL TABLE
00300		 JRST	LABEL1		;NOT FOUND
00400		TLNN	%01,MDLFLG	;FOUND, MULTIPLY DEFINED?
00500		CAIE	%05,0(%01)	;  NO, OUT OF PHASE?
00600		TROA	%15,ERRP	;  YES, FLAG PHASE ERROR
00700		JRST	LABEL2		;TO STATEMENT PROCESSOR AFTER CREF
00800		TLZ	%01,DEFFLG	;CLEAR POSSIBLE UNDEFINED FLAG
00900		TLOA	%01,MDLFLG	;FLAG AND SKIP
01000	
01100	LABEL1:	MOVE	%01,%05		;PUT CURRENT LOCATION IN %01
01200		TLO	%01,LBLFLG	;SET LABEL FLAG
01300		PUSHJ	%17,INSRT	;INSERT IN THE SYMBOL TABLE
01400	LABEL2:	PUSHJ	%17,CRFOUT
01500		MOVEI	%02,CRSYMD	;FLAG AS A DEFINITION
01600		PUSHJ	%17,LISTCQ	;OUTPUT TO CREF
01700		JRST	STMNT0
01800	
01900	
02000	
02100	ASGMT:				;ASSIGNMENT PROCESSOR
02200		PUSH	%17,%00		;STACK SYMBOL
02300		PUSHJ	%17,EXPR0	;EVALUATE EXPRESSION
02400		 TRO	%15,ERRU	;ERROR IF NULL
02500		ANDI	%10,7777	;JUST 12 BITS OF VALUE, CLR LH
02600		HRROM	%10,EQUIV
02700		POP	%17,%00		;FETCH SYMBOL
02800		TRNE	%15, ERRU	; TEST FOR SYMBOL UNDEFINED AT THIS POINT
02900		TLO	%10, DEFFLG	; SET DEFFLG IF EXPRESSION NOT DEFINED
03000		PUSHJ	%17,SRCH	;SEARCH TABLE
03100		 JRST	ASGMT1		;  NOT THERE, INSERT IT
03200		LDB	%02,[POINT 9,%01,17]
03300		XCT	ASGTBL(%02)	;DISPATCH ON SYMBOL TYPE
03400		JRST	ASGMT3
03500	ASGMT1:	HRRZ	%01,%10		;GET VALUE
03600		TLNE	%10, DEFFLG	; MOVE DEFFLG TO SYMBOL TO BE INSERTED
03700		TLO	%01, DEFFLG
03800		PUSHJ	%17,CRFOUT
03900		MOVEI	%02,CRSYMD	;FLAG AS A DEFINITION
04000		PUSHJ	%17,LISTCQ	;OUTPUT TO CREF
04100		JRST	INSRT
04200	
04300	ASGMT2:	JUMP1	ASGMT1		;JUST INSERT IF PASS 1
04400		CAIE	%10,0(%01)	;  NO, TEST FOR CHANGE
04500	ASGMT3:	TRO	%15,ERRD	;ERROR, FLAG IT
04600		POPJ	%17,		;EXIT
     
00100	ASGTBL:
00200		PHASE	0
00300		TLNE	%01,LBLFLG
00400	PSOP:	JRST	ASGMT3
00500	MROP:	JRST	ASGMT2
00600	MCOP:	JRST	ASGMT2
00700	MAOP:	JRST	ASGMT3
00800		DEPHASE
00900	
01000	STMNAS:				; *
01100		PUSHJ	%17,EXPR0	;EVALUATE THE EXPRESSION
01200		 MOVEI	%10,770000(%05)	;NULL, FORCE ERROR
01300		PUSH	%17,%10
01400		XOR	%10,%05		;COMPARE CURRENT WITH NEW
01500		TRNE	%10,7600	;SKIP IF NOT LEAVING PAGE
01600		PUSHJ	%17,DCLIT	;DUMP CURRENT PAGE LITERALS
01700		POP	%17,%10
01800		JRST	OUTLOC		;DON'T TEST FOR SEQUENCE BREAK
     
00100	EXPR0:	ILDB	%14,%13		;FETCH NEXT CHARACTER
00200	EXPR:				;EXPRESSION PROCESSOR
00300		TRZ	%15, ERRU	; CLEAR ERROR FLAG BEFORE EVALUATING THE EXPRESSION
00400		PUSHJ	%17,TERM	;SEEK THE FIRST TERM
00500		 POPJ	%17,		;  NOT FOUND, EXIT NORMAL
00600		  JRST	EXPR1		;  NUMERIC
00700		PUSHJ	%17,SRCH	;SYMBOLIC, SEARCH THE TABLE
00800		TROA	%15,ERRU	;  NOT FOUND, ERROR
00900		PUSHJ	%17,CRFOUT	;FOUND. OUTPUT TO CREF.
01000		TLNE	%01,DEFFLG	;UNDEFINED?
01100		TRO	%15,ERRU	;  YES, FLAG ERROR
01200		HRRZ	%10,%01		;PUT VALUE IN %10
01300	EXPR1:	LDB	%02,[POINT 9,%01,17]	;GET TYPE
01400		XCT	EXO1JT(%02)	;EXECUTE TABLE
01500		AOS	0(%17)		;RETURN +1
01600		POPJ	%17,
01700	
01800	
01900	
02000	EXO1JT:
02100		PHASE	0
02200		PUSHJ	%17,EXPR3	; USER DEFINED SYMBOL
02300	PSOP:	PUSHJ	%17,EXPRPS	; PSEUDO-OP
02400	MROP:	PUSHJ	%17,EXPMR	; MEMORY-REFERENCE OP
02500	MCOP:	PUSHJ	%17,EXPR3	; MICRO-INSTRUCTION
02600	MAOP:	PUSHJ	%17,EXPRPS
02700		DEPHASE
     
00100	EXPR2:	ILDB	%14,%13		;FETCH NEXT CHARACTER
00200	EXPR3:	LDB	%02,C4PNTR	;CONVERT USING COLUMN 4
00300		ADDI	%02,EXPRCV	;POINT TO EXPRCV ENTRY
00400		LDB	%02,CNVTBL(%12)	;GET PROPER CONVERSION BYTE
00500		XCT	EXPRJT(%02)	;EXECUTE TABLE
00600		ILDB	%14,%13		;BYPASS OPERATOR
00700		PUSH	%17,%06		;STACK INSTRUCTION
00800		PUSH	%17,%10		;SAVE CURRENT VALUE
00900		PUSHJ	%17,TERM	;GET THE NEXT TERM
01000		 TRO	%15,ERRQ	;NULL, ERROR
01100		  JRST	EXPR4		;NUMERIC
01200		PUSHJ	%17,SRCH	;SYMBOLIC, SRCH FOR IT
01300		 TROA	%15,ERRU	;NOT IN TABLE
01400		PUSHJ	%17,CRFOUT	;OUTPUT TO CREF.
01500		TLNE	%01,DEFFLG	;UNDEFINED?
01600		TRO	%15,ERRU	;  YES, FLAG ERROR
01700		HRRZ	%10,%01		;TRANSFER VALUE TO %10
01800	EXPR4:	LDB	%02,[POINT 9,%01,17]	;GET OP-TYPE
01900		XCT	EXO2JT(%02)	;EXECUTE TABLE
02000		POP	%17,%00	;FETCH PREVIOUS VALUE
02100		POP	%17,%02		;  AND OPERATION
02200		XCT	%02		;EXECUTE OPERATION
02300		JRST	EXPR3		;TEST FOR MORE OPS
02400	
02500	
02600	EXPRCV:				;EXPRESSION CONVERSION TABLE
02700		PHASE	0
02800		BYTE	(4)	  . ,  . ,  . ,  . ,  . ,  . 
02900	EXSP:	BYTE	(4)	  . ,  . ,  . ,  . ,  . ,  . 
03000	EXPL:	BYTE	(4)	  . ,  . ,  . ,  . ,  . ,  . 
03100	EXMI:	BYTE	(4)	  . ,  . ,  . ,  . ,  . ,  . 
03200	EXOR:	BYTE	(4)	EXC1,  0 ,  . ,  . ,  . ,  . 
03300	EXAN:	BYTE	(4)	  . ,  0 ,  . ,  . ,  . ,  . 
03400	EXMU:	BYTE	(4)	  . ,  0 ,  0 ,  0 ,  0 ,  . 
03500	EXTE:	BYTE	(4)	  . ,  . ,  . ,  . ,  . ,  . 
03600		DEPHASE
03700	
03800	
03900	EXPRJT:				;EXPRESSION JUMP TABLE
04000		PHASE	0
04100		POPJ	%17,
04200	EXSP:	JRST	EXPR2			; SPACE OR TAB
04300	EXPL:	MOVE	%06,[ADDM %00,%10]	; +
04400	EXMI:	MOVE	%06,[SUBM %00,%10]	; -
04500	EXOR:	MOVE	%06,[ORM  %00,%10]	; !
04600	EXAN:	MOVE	%06,[ANDM %00,%10]	; &
04700	EXMU:	MOVE	%06,[IMULM %00,%10]	; ^
04800	EXTE:	SKIPA	%06,[ORM  %00,%10]	; SPACE USED AS OPERATOR
04900	
05000	EXC1:	PUSHJ	%17,EXPRHW		; !
05100		DEPHASE
05200	
05300	EXPRHW:	LSH	%10,6			;HALF-WORD OPERATION
05400		MOVE	%06,[ORM  %00,%10]
05500		POPJ	%17,
05600	
05700	
05800	EXO2JT:
05900		PHASE	0
06000		JFCL			; USER-DEFINED SYMBOL
06100	PSOP:	PUSHJ	%17,EXPRPS	; PSEUDO-OP
06200	MROP:	PUSHJ	%17,EXPMR	; MEMORY REFERENCE
06300	MCOP:	JFCL			; MICRO-INSTRUCTION
06400	MAOP:	PUSHJ	%17,EXPRPS
06500		DEPHASE
06600	
06700	
06800	EXPRPS:	SETZ	%10,
06900		TRO	%15,ERRO
07000		POPJ	%17,
     
00100	EXPMR:				;MEMORY REFERENCE INSTRUCTION
00200		SKIPA	%03,%13		;SAVE CHARACTER POINTER AND SKIP
00300	EXPMR1:	ILDB	%14,%13		;GET NEXT CHARACTER
00400		LDB	%02,C5PNTR	;CONVERT USING COLUMN 5
00500		XCT	EXPMT1(%02)
00600		ILDB	%14,%13		;GET NEXT CHARACTER
00700		LDB	%02,ANPNTR	;TEST FOR TERMINATOR
00800		XCT	EXPMT2(%02)
00900		TRO	%15,ERRI	;BAD REFERENCE
01000		JRST	EXPMR		;TEST FOR ANOTHER
01100	
01200	
01300	EXPMT1:
01400		PHASE	0
01500		JRST	EXPMR3
01600	MRSP:	JRST	EXPMR1		; TAB, SPACE
01700	MRCI:	MOVEI	%01,0400	; I
01800	MRCZ:	MOVEI	%01,0000	; Z
01900		DEPHASE
02000	
02100	
02200	EXPMT2:
02300		PHASE	0
02400		TROE	%10,0(%01)
02500	.TAB:	TROE	%10,0(%01)	; TAB, SPACE
02600	.ALP:	JRST	EXPMR3		; ALPHABETIC
02700	.NUM:	JRST	EXPMR3		; NUMERIC
02800		DEPHASE
     
00100	EXPMR3:
00200		MOVE	%13,%03		;RESTORE CHARCTER POINTER
00300		LDB	%14,%13		;  AND CHARACTER
00400		PUSH	%17,%10		;STACK VALUE
00500		PUSHJ	%17,EXPR	;EVALUATE EXPRESSION
00600		 SKIPE	LITLVL		;NULL ADDRESS, ERROR IF NOT IN LITERAL
00700		CAIA			;  OK
00800		TRO	%15,ERRU	;  NULL, NOT IN LITERAL
00900		ANDI	%10,7777	;BEWARE OF OVERFLOW
01000		CAIGE	%10,200		;PAGE ZERO?
01100		JRST	EXPMR5		;  YES, SKIP TEST
01200		MOVE	%03,%05		;NO, USE %03 FOR SCRATCH
01300		TRZ	%03,0177	;ZERO LOW BITS
01400		TDC	%10,%03		;TEST FOR CURRENT PAGE
01500		TRNN	%10,7600
01600		JRST	EXPMR4		;YES
01700		TRO 	%15,ERRG		; SET LINK GENERATED ERROR
01800		TDC	%10,%03		;NO, RESTORE VALUE
01900		PUSHJ	%17,PILIT	;BUILD A LITERAL
02000		ANDI	%10,0177	;WE KNOW THAT IT IS THE CURRENT PAGE
02100		TRO	%10,0400	;SET INDIRECT BIT
02200		TDNE	%10,0(%17)	;BIT ALREADY SET?
02300		TRO	%15,ERRI	;  YES, FLAG ERROR
02400	EXPMR4:	TRO	%10,0200	;SET PAGE BIT
02500	EXPMR5:	ORM	%10,0(%17)	;MERGE INTO INSTRUCTION
02600		POP	%17,%10		;RESTORE VALUE
02700		POPJ	%17,		;EXIT
     
00100					;PUSHJ	%17,TERM
00200					; 	NULL
00300					; 	NUMERIC
00400					; 	SYMBOLIC
00500	
00600	TERM0:	ILDB	%14,%13
00700	TERM:
00800		SETZB	%10,%01		;RETURN VALUE IN %10
00900		LDB	%02,C6PNTR	;CONVERT USING COLUMN 6
01000		ADDI	%02,TERMCV	;POINT TO CONVERSION TABLE
01100		LDB	%02,CNVTBL(%12)	;CONVERT TO PROPER MODE
01200		CAIL	%02,TJNM	;NUMERIC TYPE?
01300		AOS	0(%17)		;  YES, RETURN +1
01400		CAIL	%02,TJAL	;ALPHABETIC?
01500		AOS	0(%17)		;  YES, RETURN +2
01600		XCT	TERMJT(%02)	;EXECUTE TABLE
01700	
01800	TERMCV:				;TERM CONVERSION TABLE
01900		PHASE	0
02000		BYTE	(4)	  . ,  . ,  . ,  . ,  . ,  . 
02100	TJSP:	BYTE	(4)	  . ,  . ,  . ,  . ,  . ,  . 
02200	
02300	TJNM:	BYTE	(4)	  . ,  . ,  . ,  . ,  . ,  . 
02400	TJUO:	BYTE	(4)	  . ,  . ,  . ,  . ,  . ,  . 
02500	TJPE:	BYTE	(4)	  . ,  . ,  . ,  . ,  . ,  . 
02600	TJQT:	BYTE	(4)	  . ,  0 ,  . ,  . ,  . ,  . 
02700	TJLP:	BYTE	(4)	  . ,  0 ,  . ,  . ,  . ,  . 
02800	TJLB:	BYTE	(4)	  . ,  0 ,  . ,  . ,  . ,  . 
02900	
03000	TJAL:	BYTE	(4)	  . ,  . ,  . ,  . ,  . ,  . 
03100		DEPHASE
03200	
03300	
03400	TERMJT:				;TERM JUMP TABLE
03500		PHASE	0
03600		POPJ	%17,		; NO OPERATION
03700	TJSP:	JRST	TERM0		; SPACE OR TAB
03800	
03900	TJNM:	JRST	TERMNM		; NUMERIC
04000	TJUO:	POPJ	%17,		; +, -
04100	TJPE:	JRST	TERMPE		; .
04200	TJQT:	JRST	TERMQT		; "
04300	TJLP:	JRST	PCLIT		; (
04400	TJLB:	JRST	PZLIT		; [
04500	
04600	TJAL:	JRST	GETSYM		; ALPHABETIC
04700		DEPHASE
04800	TERMNM:				;NUMERIC TERM
04900		MOVEI	%02,-"0"(%14)	;GET ABSOLUTE VALUE
05000		CAML	%02,RADIX	;TEST WITHIN CURRENT RADIX BOUNDS
05100		TRO	%15,ERRN	;  NO, FLAG ERROR
05200		IMUL	%10,RADIX	;MULTIPLY BY RADIX
05300		ADD	%10,%02		;ADD IN CURRENT CHAR
05400		ILDB	%14,%13		;GET NEXT CHARCTER
05500		LDB	%02,ANPNTR	;TEST FOR NUMERIC
05600		XCT	NTERMT(%02)	;EXECUTE TABLE
05700		TRO	%15,ERRN	;OVERFLOW ERROR, FLAG IT
05800		POPJ	%17,
05900	
06000	NTERMT:				;NUMERIC TERM TABLE
06100		PHASE	0
06200		CAILE	%10,7777
06300	.TAB:	CAILE	%10,7777	;TAB, SPACE
06400	.ALP:	CAILE	%10,7777
06500	.NUM:	JRST	TERMNM
06600		DEPHASE
06700	
06800	
06900	TERMPE:				;  .
07000		MOVE	%10,%05		;SET VALUE TO CURRENT LOCATION
07100		ILDB	%14,%13		;GET NEXT CHARACTER
07200		POPJ	%17,		;EXIT
07300	
07400	
07500	TERMQT:				;  "
07600		ILDB	%14,%13		;GET THE NEXT CHARACTER
07700		LDB	%02,C7PNTR	;CONVERT USING COLUMN 7
07800		XCT	QJTABL(%02)	;TEST VALIDITY
07900		ILDB	%14,%13		;OK, GET NEXT CHARACTER
08000		POPJ	%17,		;EXIT
08100	
08200	
08300	QJTABL:
08400		PHASE	0
08500		TROA	%15,ERRT	; INVALID QUOTE CHARACTER
08600	QJNU:	TROA	%15,ERRT
08700	QJCR:	TROA	%15,ERRT
08800	QJTB:	MOVEI	%10,200(%14)	; TAB
08900	QJSP:	MOVEI	%10,200(%14)	; SPACE
09000	QJPC:	MOVEI	%10,200(%14)	; PRINTING CHARACTER
09100		DEPHASE
     
00100	PCLIT:				;PROCESS CURRENT LITERALS
00200		AOS	LITLVL		;INCREMENT LIT LEVEL COUNT
00300		PUSHJ	%17,EXPR0	;EVALUATE THE EXPRESSION
00400		 TRO	%15,ERRL	;ERROR IF NULL
00500		SOSA	LITLVL		;DECREMENT LEVEL COUNT AND SKIP
00600	PCLIT1:	ILDB	%14,%13		;GET THE NEXT CHARACTER
00700		LDB	%02,C9PNTR	;CONVERT USING COLUMN 9
00800		XCT	PCLJT(%02)	;TEST FOR )
00900	PILIT:	TLNN	%15,LITFLG	;LITERALS ALLOWED?
01000		TROA	%15,ERRI	;  NO, FLAG ILLEGAL INDIRECT
01100		TLNE	%15,P1F		;PASS 1?
01200		POPJ	%17,		;  YES, EXIT
01300		LDB	%01,[POINT 5,%05,28]	;GET PAGE NUMBER
01400		JUMPE	%01,PCZLIT	;BRANCH IF PAGE 0
01500		ANDI	%10,007777	;MASK VALUE
01600		SKIPN	%07,CLHBUF(%01)	;ANY LITS THIS PAGE?
01700		JRST	PCLIT3		;  NO, INITIALIZE
01800		MOVEI	%07,177		;MAKE ADDRESS RELATIVE
01900	PCLIT2:	SKIPN	%02,CLTBUF(%07)	;TEST FOR VALUE (NON-ZERO)
02000		JRST	PCLIT4		;  NO
02100		CAIN	%10,0(%02)	;  YES, DO THEY COMPARE?
02200		JRST	PCLIT5		;  YES, THIS IS THE ONE
02300		SOJGE	%07,PCLIT2	;TEST FOR END
02400		SETZ	%07,		;END ,ERROR
02500		TRO	%15,ERRL
02600		JRST	PCLIT5
02700	
02800	PCLIT3:	MOVEI	%07,177		;INITIALIZE
02900	PCLIT4:	HRROM	%10,CLTBUF(%07)	;STORE AND FLAG CURRENT LITERAL
03000		DPB	%01,[POINT 5,%07,28]	;SET PAGE
03100		MOVEM	%07,CLHBUF(%01)	;SET HEADER BUFFER
03200		MOVE	%10,%07
03300		JRST	LITCRF
03400	
03500	PCLIT5:	DPB	%01,[POINT 5,%07,28]
03600		MOVE	%10,%07		;SET RESULT IN %10
03700		JRST	LITCRF		;EXIT THROUGH CREF
03800	
03900	
04000	PCLJT:				;PROCESS CURRENT LITERALS JUMP TABLE
04100		PHASE	0
04200		JFCL
04300	LTSP:	JRST	PCLIT1		; SPACE, TAB
04400	LTRP:	ILDB	%14,%13		; )
04500	LTRB:	JFCL			; ]
04600		DEPHASE
     
00100	DCLIT:				;DUMP CURRENT LITERALS
00200		TLNN	%15,P1F		;PASS 1?
00300		TRNN	%05,7600	;  OR PAGE ZERO?
00400		POPJ	%17,		;  YES, EXIT
00500		MOVSI	%07,-200	;INIT INDEX
00600		SKIPN	CLTBUF(%07)	;SEARCH FOR START
00700		AOBJN	%07,.-1
00800		JUMPGE	%07,CPOPJ	;EXIT IF NONE
00900		TRZE	%16,HDRBIT	;FORM FEED SEEN?
01000		TRO	%16,HDRSAV	;  YES, CLEAR BUT REMEMBER
01100		MOVEI	%10,-1(%07)	;GET CURRENT LOCATION MINUS ONE
01200		LDB	%01,[POINT 5,%05,28]
01300		DPB	%01,[POINT 5,%10,28]	;SET PAGE
01400		SETZM	CLHBUF(%01)	;CLEAR FOR OUTPUT
01500		PUSH	%17,%10		;STACK NEW VALUE
01600		PUSH	%17,%01		;  AND INDEX
01700	DCLIT1:	SKIPN	%10,CLTBUF(%07)	;VALUE STORED HERE (NON-ZERO)?
01800		JRST	DCLIT2		;  NO
01900		SETZM	CLTBUF(%07)	;ZERO
02000		MOVEM	%10,VALUE	;SET FOR ENDL
02100		MOVE	%10,%05		;GET LOCATION COUNTER
02200		ANDI	%10,007600	;MASK CURRENT PAGE BITS
02300		TRO	%10,0(%07)	;SET ADDRESS BITS
02400		PUSHJ	%17,LITCRF	;CREF IT
02500		MOVEI	%02,CRSYMD
02600		PUSHJ	%17,LISTCQ	;FLAG AS DEFINING OCCURENCE
02700		PUSHJ	%17,SETLOC	;CHECK FOR SEQUENCE BREAK
02800		SETZM	EQUIV
02900		TLO	%15,SRCFLG	;DON'T LIST SOURCE LINE
03000		PUSHJ	%17,ENDL	;PRINT
03100	DCLIT2:	AOBJN	%07,DCLIT1	;TEST FOR END
03200		POP	%17,%01		;RETRIEVE INDEX
03300		POP	%17,CLHBUF(%01)	;SET NEW VALUE
03400		TRZE	%16,HDRSAV	;WAS THERE A FORM FEED?
03500		TRO	%16,HDRBIT	;  YES, RESTORE IT
03600		POPJ	%17,		;EXIT
     
00100	PZLIT:				;PROCESS PAGE ZERO LITERALS
00200		AOS	LITLVL		;INCREMENT LIT LEVEL COUNT
00300		PUSHJ	%17,EXPR0	;EVALUATE THE EXPRESSION
00400		 TRO	%15,ERRL	;ERROR IF NULL
00500		SOSA	LITLVL		;DECREMENT LEVEL COUNT AND SKIP
00600	PZLIT1:	ILDB	%14,%13		;GET THE NEXT CHARACTER
00700		LDB	%02,C9PNTR	;CONVERT USING COLUMN 9
00800		XCT	PZLJT(%02)	;TEST FOR ]
00900		JUMP1	CPOPJ		;EXIT IF PASS 1
01000	PCZLIT:	ANDI	%10,007777	;MASK VALUE
01100		MOVEI	%07,177		;POINT TO END OF BUFFER
01200	PZLIT2:	SKIPE	%02,ZLTBUF(%07)	;IF LOCATION AVAILABLE
01300		CAIN	%10,0(%02)	;OR WE HAVE A MATCH
01400		JRST	PZLIT3		;WE ARE ALMOST THRU
01500		CAIE	%07,0		;NO. MORE ROOM ON THIS PAGE?
01600		SOJA	%07,PZLIT2	;YES. DECREMENT ADR AND TRY AGAIN
01700		TROA	%15,ERRL	;NO ROOM. FLAG ERR AND DON'T STORE
01800	PZLIT3:	HRROM	%10,ZLTBUF(%07)	;  YES, STORE IT
01900		MOVEI	%10,0(%07)	;SUBSTITUTE
02000	
02100	LITCRF:				;CREF FOR LITERALS
02200		TLNN	%15,LITFLG	;LITERALS ALLOWED?
02300		TRO	%15,ERRL	;  NO, FLAG ERROR
02400		MOVE	%01,%10		;GET VALUE
02500		LSHC	%00,^D24+3	;CONVERT TO SIXBIT
02600		REPEAT	3,	<
02700		LSH	%00,3
02800		LSHC	%00,3	>
02900	
03000		ADD	%00,[SIXBIT /.L0000/]	;FORM SYMBOL
03100		JRST	CRFOUT		;EXIT THROUGH CREF
03200	
03300	
03400	PZLJT:				;PROCESS PAGE ZERO LITERALS JUMP TABLE
03500		PHASE	0
03600		JFCL
03700	LTSP:	JRST	PZLIT1		; SPACE, TAB
03800	LTRP:	JFCL			; )
03900	LTRB:	ILDB	%14,%13		; ]
04000		DEPHASE
     
00100	DZLIT:				;DUMP PAGE ZERO LITERALS
00200		JUMP1	CPOPJ		;EXIT IF PASS 1
00300		MOVSI	%07,-200	;INIT INDEX
00400	DZLIT1:	SETZ	%10,
00500		EXCH	%10,ZLTBUF(%07)	;ZERO FOR NEXT FIELD
00600		JUMPGE	%10,DZLIT2	;VALUE STORED HERE (NON-ZERO)?
00700		MOVEM	%10,VALUE	;SET FOR ENDL
00800		MOVEI	%10,0(%07)	;PUT VALUE IN %10
00900		PUSHJ	%17,LITCRF	;CREF IT
01000		MOVEI	%02,CRSYMD
01100		PUSHJ	%17,LISTCQ	;FLAG AS DEFINING OCCURENCE
01200		PUSHJ	%17,SETLOC	;TEST FOR SEQUENCE BREAK
01300		SETZM	EQUIV
01400		TLO	%15,SRCFLG	;DON'T LIST SOURCE LINE
01500		PUSHJ	%17,ENDL	;PRINT
01600	DZLIT2:	AOBJN	%07,DZLIT1	;TEST FOR END
01700		MOVSI	%07,-40
01800		SETZM	CLHBUF(%07)	;ZERO IN EVENT OF "FIELD"
01900		AOBJN	%07,.-1
02000		POPJ	%17,
     
00100	TSTSYM:				;TEST FOR SYMBOL
00200		LDB	%02,ANPNTR
00300		XCT	TSTTBL(%02)
00400		JRST	TSTSYM		;TAB, TRY AGAIN
00500		JRST	GETSYM		;OK
00600	
00700	
00800	TSTTBL:				;TEST SYMBOL TABLE
00900		PHASE	0
01000		POPJ	%17,
01100	.TAB:	ILDB	%14,%13
01200	.ALP:	AOSA	0(%17)
01300	.NUM:	POPJ	%17,
01400		DEPHASE
01500	
01600	
01700	GETSYM:
01800		SETZ	%00,		;CLEAR AC
01900		MOVSI	%02,(POINT 6,%00,)	;SET BYTE POINTER
02000	GETSY1:	SUBI	%14,40		;CONVERT TO SIXBIT
02100		TLNE	%02,770000	;ROOM TO STORE?
02200		IDPB	%14,%02		;  YES
02300		ILDB	%14,%13		;GET NEXT CHARACTER
02400		LDB	%03,ANPNTR	;TEST ALPHA/NUMERIC
02500		XCT	GSJTBL(%03)	;EXECUTE TABLE
02600	
02700	
02800	GSJTBL:				;GETSYM JUMP TABLE
02900		PHASE	0
03000		POPJ	%17,		; NULL
03100	.TAB:	POPJ	%17,		; TAB OR SPACE
03200	.ALP:	JRST	GETSY1		; ALPHABETIC
03300	.NUM:	JRST	GETSY1		; NUMERIC
03400		DEPHASE
     
00100	OCTAL:
00200		MOVEI	%10,^D8
00300		CAIA
00400	DECIMA:
00500		MOVEI	%10,^D10
00600		MOVEM	%10,RADIX
00700		POPJ	%17,
00800	
00900	
01000	PAGE:
01100		PUSHJ	%17,DCLIT	;TEST FOR LITERALS
01200		PUSHJ	%17,EXPR
01300		 JRST	PAGE1
01400		TRZE	%10,7400	;WITHIN BOUNDS?
01500		TRO	%15,ERRP	;  NO, FLAG ERROR
01600		LSH	%10,7
01700		JRST	OUTLOC		;DON'T TEST FOR SEQUENCE BREAK
01800	
01900	PAGE1:				;"PAGE" WITH NO ARGUMENT
02000		MOVE	%10,%05		;GET CURRENT LOCATION
02100		TRZE	%10,000177	;CLEAR ADDRESS FIELD, WAS IT ZERO?
02200		ADDI	%10,000200	;  NO, MOVE TO NEXT PAGE
02300		JRST	OUTLOC		;DON'T TEST FOR SEQUENCE BREAK
02400	
02500	
02600	FIELD:				;"FIELD" PSEUDO-OP PROCESSOR
02700		PUSHJ	%17,DCLIT	;DUMP CURRENT LITERALS
02800		PUSHJ	%17,DZLIT	;  AND PAGE ZERO LITERALS
02900		PUSHJ	%17,EXPR	;COMPUTE EXPRESSION
03000		 CAIA			;NULL, ERROR
03100		TRZE	%10,777770	;OVERFLOW?
03200		TRO	%15,ERRQ	;  YES, MARK IT
03300		HRROM	%10,EQUIV	;LIST THE VALUE
03400		JUMP1	CPOPJ		;EXIT IF PASS 1
03500		LSH	%10,3		;MOVE BITS INTO PROPER SLOT
03600		MOVEI	%02,CHAN78_-6(%10)	;SET CHANNEL BITS
03700		PUSHJ	%17,BINOUT	;OUTPUT, BYPASSING CHECK-SUM
03800		JRST	BITDMP		;DUMP BIT TABLE AND EXIT
03900	
04000	
04100	XLIST:				;"XLIST" PSEUDO-OP PROCESSOR
04200		TLNN	%15,P1F		;BYPASS IF PASS 1
04300		TLO	%15,XLFLG	;SET FLAG
04400		POPJ	%17,		;EXIT
04500	
04600	
04700	NOPUNC:	TLNN	%15,P1F		;"NOPUNC" PSEUDO-OP
04800		TLOA	%16,NOPBIT
04900	ENPUNC:	TLZ	%16,NOPBIT	;"ENPUNC" PSEUDO-OP
05000		POPJ	%17,
     
00100	DTORG:				;"DTORG" PSEUDO-OP
00200		PUSHJ	%17,DCLIT	;DUMP CURRENT PAGE LITERALS
00300		PUSHJ	%17,DZLIT	;DUMP PAGE ZERO LITERALS
00400		PUSHJ	%17,EXPR	;EVALUATE THE EXPRESSION
00500		 JFCL			;NULL
00600		HRROM	%10,EQUIV	;LIST THE VALUE
00700		TLNN	%16,DSWBIT	;/D SET?
00800		POPJ	%17,		;  NO, EXIT
00900		TRO	%10,CHAN78	;YES, SET CHANNELS 7 AND 8
01000		JRST	BINWRD		;DUMP AND EXIT
01100	
01200	
01300	ZBLOCK:				;"ZBLOCK" PSEUDO-OP
01400		PUSHJ	%17,EXPR	;EVALUATE THE EXPRESSION
01500		 TRO	%15,ERRQ	;NULL, FLAG ERROR
01600		ANDI	%10,7777	;MASK VALUE
01700		TRZE	%10,4000	;OVERFLOW?
01800		TRO	%15,ERRQ	;  YES, FLAG ERROR
01900		MOVEM	%10,ZBLTMP	;SAVE THE COUNT
02000	ZBLOC1:	SOSGE	ZBLTMP		;TEST FOR END
02100		POPJ	%17,		;  OK, EXIT
02200		HRROS	VALUE		;DUMP A ZERO
02300		PUSHJ	%17,ENDL	;LIST THE LINE
02400		TLO	%15,LINFLG	;DON'T LIST NEXT LINE
02500		JRST	ZBLOC1		;TRY AGAIN
02600	
02700	
02800	FIXMR0:	ILDB	%14,%13
02900	FIXMRI:				;"FIXMRI" PSEUDO-OP
03000		LDB	%02,ANPNTR
03100		XCT	FIXTBL(%02)	;TAKE PROPER ACTION
03200		CAIE	%14,"="		;PROPER TERMINATION?
03300		JRST	EXPRPS		;  NO, ERROR
03400		PUSHJ	%17,EXPR0	;  YES, COMPUTE EXPRESSION
03500		 TRO	%15,ERRU	;NULL, ERROR
03600		PUSHJ	%17,SRCH	;SEARCH THE SYMBOL TABLE
03700		 JFCL
03800		MOVE	%01,%10		;SET VALUE
03900		HRLI	%01,MROP	;FLAG AS MEMORY REFERENCE INSTRUCTION
04000		JRST	INSRT		;INSERT AND EXIT
04100	
04200	FIXTBL:				;FIXMRI TABLE
04300		PHASE	0
04400		JRST	EXPRPS		; ERROR
04500	.TAB:	JRST	FIXMR0		; SPACE OR TAB
04600	.ALP:	PUSHJ	%17,GETSYM	; ALPHABETIC
04700	.NUM:	JRST	EXPRPS		; NUMERIC
04800		DEPHASE
     
00100	EXPUNG:				;"EXPUNGE" PSEUDO-OP
00200		JUMP2	CPOPJ		;EXIT IF PASS 2
00300		MOVSI	%02,BSYMT-EEXOPS;  YES, SET FOR ONLY PSEUDO-OPS
00400		JRST	SYTI		;RE-INIT TABLE AND EXIT
00500	
00600	
00700	FIXTAB:				;"FIXTAB" PSEUDO-OP
00800		JUMP2	CPOPJ		;EXIT IF PASS 2
00900		MOVE	%07,SYTBOT	;SET INDEX
01000		ADDI	%07,2
01100	FIXTA1:	PUSHJ	%17,GETSTE	;GET NEXT NON-SPECIAL SYMBOL
01200		 POPJ	%17,		;END, EXIT
01300		MOVSI	%02,MCOP	;NON-SPECIAL, CONSIDER IT A PSEUDO-OP
01400		ORM	%02,0(%07)	;FLAG SYMBOL
01500		JRST	FIXTA1		;TRY AGAIN
     
00100	TEXT0:	ILDB	%14,%13
00200	TEXT:				;"TEXT" PSEUDO-OP PROCESSOR
00300		LDB	%02,C7PNTR	;CONVERT USING COLUMN 7
00400		XCT	TEXTB1(%02)	;TEST FOR DELIMITER
00500	TEXT1:	ILDB	%14,%13		;FOUND, GET NEXT CHARACTER
00600		LDB	%02,C7PNTR	;CONVERT USING COLUMN 7
00700		XCT	TEXTB2(%02)	;TEST FOR END
00800		JRST	TEXT4		;FOUND
00900		ANDI	%14,77		;VALID CHARACTER, TRIM
01000		SKIPE	VALUE		;SECOND HALF?
01100		JRST	TEXT2		;  YES
01200		LSH	%14,6		;  NO, MOVE INTO LEFT POSITION
01300		HRROM	%14,VALUE	;STORE IT
01400		JRST	TEXT1		;TRY AGAIN
01500	
01600	TEXT2:	ORM	%14,VALUE	;SECOND HALF, MERGE WITH FIRST
01700		PUSHJ	%17,ENDL	;PRINT THE LINE
01800		TLO	%15,SRCFLG	;DON'T LIST FOLLOWING LINES
01900		JRST	TEXT1		;GET THE NEXT CHARACTER
02000	
02100	TEXT3:	TROA	%15,ERRT	;ERROR, MARK AND SKIP
02200	TEXT4:	ILDB	%14,%13		;NORMAL TERMINATION, MOVE TO NEXT CHAR
02300		HRROS	VALUE		;MAKE SURE BINARY IS COUNTED
02400		POPJ	%17,		;EXIT
02500	
02600	
02700	TEXTB1:				;TEXT TABLE 1
02800		PHASE	0
02900		JRST	TEXT3		; INVALID CHARACTER
03000	QJNU:	JRST	TEXT3
03100	QJCR:	JRST	TEXT3
03200	QJTB:	JRST	TEXT0		; TAB
03300	QJSP:	JRST	TEXT0		; SPACE
03400	QJPC:	MOVEM	%14,TXTEND	; PRINTING CHARACTER
03500		DEPHASE
03600	
03700	TEXTB2:				;TEXT TABLE 2
03800		PHASE	0
03900		JRST	TEXT3
04000	QJNU:	JRST	TEXT3
04100	QJCR:	JRST	TEXT3
04200	QJTB:	JRST	TEXT3
04300	QJSP:	CAMN	%14,TXTEND
04400	QJPC:	CAMN	%14,TXTEND
04500		DEPHASE
     
00100	XTEXT:				; "<" PALX GLICH
00200		ILDB	%14,%13		;MOVE PAST OPENING BRACKET
00300		TLNE	%16,DSWBIT	;/D SET?
00400		ILDB	%14,%13		;  YES, FORGET FIRST CHAR
00500	XTEXT1:	JUMPE	%14,XTEXT4	;BRANCH IF CR
00600		CAIN	%14,">"
00700		JRST	XTEXT5		;BRANCH IF CLOSING BRACKET
00800		CAIL	%14,"A"		;ALPHABETIC?
00900		CAILE	%14,"Z"
01000		TRO	%15,ERRT	;  NO, FLAG ERROR
01100		ANDI	%14,77		;MASK TO TRIMMED ASCII
01200		MOVE	%00,%14		;SAVE IN %00
01300		ILDB	%14,%13		;GET THE NEXT CHARACTER
01400		CAIE	%14,"-"
01500		JRST	XTEXT2		;BRANCH IF NOT MINUS
01600		TRO	%00,40		;FLAG
01700		ILDB	%14,%13		;MOVE PAST MINUS
01800	XTEXT2:	SKIPE	VALUE		;FIRST HALF?
01900		JRST	XTEXT3		;  NO
02000		LSH	%00,6		;  YES, MOVE VALUE THERE
02100		HRROM	%00,VALUE	;STORE
02200		JRST	XTEXT1		;TRY THE NEXT CHARACTER
02300	
02400	XTEXT3:	ORM	%00,VALUE	;SECOND HALF, MERGE
02500		PUSHJ	%17,ENDL	;DUMP THE LINE
02600		TLO	%15,SRCFLG	;DON'T PRINT SOURCE MORE THAN ONCE
02700		JRST	XTEXT1		;GET NEXT CHAR
02800	
02900	XTEXT4:	PUSH	%17,VALUE	;CR, SAVE VALUE
03000		SETZM	VALUE
03100		TLZN	%15,SRCFLG	;HAVE WE LISTED THE SOURCE?
03200		PUSHJ	%17,ENDL	;  NO, DO SO
03300		PUSHJ	%17,GETLIN	;GET THE NEXT SOURCE LINE
03400		TLNE	%16,DSWBIT	;/D SET?
03500		ILDB	%14,%13		;  YES, BYPASS FIRST CHAR
03600		POP	%17,VALUE	;REPLACE VALUE
03700		SETZ	%00,		;TREAT CR AS NULL
03800		JRST	XTEXT2
03900	
04000	XTEXT5:	ILDB	%14,%13		;">", MOVE PAST IT
04100		MOVEI	%00,0077	;ASSUME NEW CODE WORD
04200		SKIPN	VALUE		;GOOD GUESS?
04300		JRST	XTEXT6		;YES
04400		PUSHJ	%17,ENDL	;  NO, LIST CURRENT WORD
04500		TLO	%15,SRCFLG
04600		MOVEI	%00,7777	;FINISH WITH 7777
04700	XTEXT6:	HRROM	%00,VALUE	;SET FINAL VALUE
04800		POPJ	%17,		;EXIT
     
00100	DBLENT:				;DOUBLE ENTRY
00200		MOVEM	%13,DBLSAV	;SAVE IN EVENT OF FAILURE
00300		PUSHJ	%17,@DBLPNT	;GO TO APPROPRIATE ROUTINE
00400		TRZN	%15,ERRN	;VALUE FOUND?
00500		JRST	LINE2		;  YES, FINISH UP
00600		SETZM	DBLPNT		;  NO, RESET POINTER
00700		MOVE	%13,DBLSAV	;RESTORE CHARACTER POINTER
00800		LDB	%14,%13		;  AND CHARACTER
00900		JRST	LINE1		;TRY FOR NORMAL LINE
01000	
01100	
01200	DUBL:				;"DUBL" PSEUDO-OP
01300		PUSHJ	%17,DBL0	;GO PROCESS
01400		 JRST	DBLERR		;ERROR
01500		TLZE	%15,NEGFLG	;UNARY MINUS FOUND?
01600		MOVNS	%10		;  YES
01700		MOVEI	%00,DUBL
01800	DUBLX:	MOVEM	%00,DBLPNT	;SET POINTER FOR NEXT LINE
01900		LDB	%00,[POINT 12,%10,23]
02000		HRROM	%00,VALUE	;SET FIRST WORD
02100		HRROS	%10
02200		PUSH	%17,%10		;SAVE SECOND HALF
02300		PUSHJ	%17,ENDL	;LIST FIRST HALF
02400		POP	%17,VALUE	;SET SECOND HALF
02500		TLO	%15,SRCFLG	;DON'T LIST SOURCE ARAIN
02600		POPJ	%17,		;EXIT
     
00100	FLTG:				;"FLTG" PSEUDO-OP
00200		PUSHJ	%17,DBL0	;PROCESS DOUBLE PRECISION
00300		 CAIN	%14,"."		;  NON-NUMERIC, IS IT DECIMAL POINT?
00400		SKIPA	%03,%15		;OK, SAVE NEGFLG
00500		JRST	DBLERR		;ERROR, EXIT
00600		HRRZ	%06,%01		;SAVE INTEGER DIGITS
00700		CAIE	%14,"."		;DECIMAL POINT?
00800		JRST	FLTG1		;  NO
00900		ILDB	%14,%13		;  YES, GET NEXT CHARACTER
01000		PUSHJ	%17,DBL		;PROCESS DOUBLE
01100		 JFCL
01200	FLTG1:	HLRZS	%01		;GET DIGITS USED
01300		SUB	%06,%01		;DECREMENT FACTOR
01400		CAIE	%14,"E"		;EXPONENT?
01500		JRST	FLTG2		;  NO
01600		ILDB	%14,%13		;  YES, PASS OVER IT
01700		MOVE	%07,%10		;SAVE VALUE TO DATE
01800		PUSHJ	%17,DBL0	;COMPUTE EXPONENT
01900		 JRST	DBLERR		;  ERROR, EXIT
02000		TLZE	%15,NEGFLG	;UNARY MINUS SEEN?
02100		MOVNS	%10		;YES
02200		ADD	%06,%10		;UPDATE FACTOR
02300		MOVE	%10,%07		;RESTORE VALUE
02400	FLTG2:	SETZ	%00,
02500		JUMPE	%10,FLTG7	;BRANCH IF ZERO
02600		TROA	%00,^D35	;SET INITIAL EXPONENT
02700	FLTG3:	ASH	%10,1		;SHIFT LEFT
02800		TLNN	%10,200000	;NORMALIZED?
02900		SOJA	%00,FLTG3	;  NO, ADJUST EXPONENT AND LOOP
03000		JUMPL	%06,FLTG5	;BRANCH IF NEGATIVE
03100	FLTG4:	SOJL	%06,FLTG6	;TEST FOR END
03200		MOVEM	%10,%02		;COMPUTE N/4
03300		ASH	%02,-2
03400		ADD	%10,%02		;ADD IT IN
03500		ADDI	%00,3		;MULTIPLY BY 8 (8*(N+N/4) = 10N)
03600		CAIGE	%10,0		;ARE WE IMPOSING ON SIGN BIT?
03700		PUSHJ	%17,SCALML	;  YES, SCALE RIGHT
03800		JRST	FLTG4		;LOOP
03900	
04000	FLTG5:	CAML	%10,[^D10B4]	;OK FOR DIVIDE?
04100		PUSHJ	%17,SCALML	;  NO, SCALE DOWN
04200		DIV	%10,[^D10B4]	;DIVIDE BY TEN
04300		SUBI	%00,4		;COMPENSATE FOR [^D10B4] SCALING
04400		AOJL	%06,FLTG5	;TEST FOR END
04500	FLTG6:	ADDI	%10,4000 	;ADD ROUNDING CONSTANT
04600		CAIGE	%10,0		;OVERFLOW?
04700		PUSHJ	%17,SCALML	;  YES, SCALE RIGHT
04800		ASHC	%10,-^D12
04900		TLZE	%03,NEGFLG	;UNARY MINUS SEEN?
05000		MOVNS	%10		;  YES, NEGATE FRACTION
05100	FLTG7:	PUSH	%17,%10		;SAVE FRACTION
05200		HRROM	%00,VALUE	;SET EXPONENT
05300		PUSHJ	%17,ENDL	;DUMP IT
05400		POP	%17,%10		;RETRIEVE FRACTION
05500		TLO	%15,SRCFLG	;SUPPRESS SOURCE LITING
05600		MOVEI	%00,FLTG	;SET FLAG FOR RETURN
05700		JRST	DUBLX		;EXIT THROUGH DUBL
05800	
05900	
06000	SCALML:				;SCALE ML
06100		LSH	%10,-1		;SCALE RIGHT
06200		AOJA	%00,CPOPJ	;INCREMENT EXPONENT AND EXIT
     
00100	DBL0:				;DOUBLE PRECISION SUBROUTINE
00200		SETZB	%10,%01
00300	DBL:				;NON-INITIALIZING ENTRY POINT
00400		TLZA	%15,NEGFLG	;RESET NEGATE FLAG AND SKIP
00500	DBL1:	ILDB	%14,%13		;GET NEXT CHARACTER
00600		LDB	%02,ANPNTR	;GET CHARACTERISTICS
00700		XCT	DBLTBL(%02)	;EXECUTE TABLE
00800		TLCA	%15,NEGFLG	;  "-", TOGGLE FLAG AND SKIP
00900		CAIN	%14,"+"		;  NO, UNARY PLUS?
01000		JRST	DBL1		;  YES, GET NEXT CHARACTER
01100		POPJ	%17,
01200	
01300	DBL2:	TLNE	%10,760000	;POSSIBLE OVERFLOW?
01400		AOJA	%01,DBL3	;  YES
01500		IMULI	%10,^D10	;USE DECIMAL RADIX
01600		ADDI	%10,-"0"(%14)	;ADD IN THIS NUMBER
01700		AOBJP	%01,.+1
01800	DBL3:	ILDB	%14,%13		;GET NEXT CHARACTER
01900		CAIL	%14,"0"		;IS IT A NUMBER
02000		CAILE	%14,"9"
02100		JRST	CPOPJ1		;FINISHED, SKIP-RETURN
02200		JRST	DBL2		;  YES, ADD IT IN
02300	
02400	
02500	DBLTBL:
02600		PHASE	0
02700		CAIN	%14,"-"
02800	.TAB:	JRST	DBL1
02900	.ALP:	POPJ	%17,
03000	.NUM:	JRST	DBL2
03100		DEPHASE
03200	
03300	
03400	DBLERR:	TRO	%15,ERRN	;FLAG NUMERIC ERROR
03500		POPJ	%17,		;  AND QUIT
     
00100	IFDEF:	TLO	%15,IFDFLG	;"IFDEF" PSEUDO-OP
00200	IFNDEF:				;"IFNDEF" PSEUDO-OP
00300		PUSHJ	%17,TSTSYM	;TRY FOR SYMBOL
00400		 TROA	%15,ERRQ	;  NOT SYMBOL, ERROR AND NOT FOUND
00500		PUSHJ	%17,SRCH	;SYMBOL, LOOK IT UP
00600		TLCA	%15,IFDFLG	;  NOT FOUND, TOGGLE FLAG
00700		PUSHJ	%17,CRFOUT	;OUTPUT TO CREF
00800		TLZN	%15,IFDFLG	;FLAG TRUE?
00900		JRST	UNSCON		;  NO
01000		JRST	SATCON		;  YES
01100	
01200	
01300	IFZERO:				;"IFZERO" PSEUDO-OP
01400		PUSHJ	%17,EXPR	;EVALUATE THE EXPRESSION
01500		 TRO	%15,ERRQ	;NULL, ERROR
01600		TRNE	%10,7777	;ZERO?
01700		JRST	UNSCON		;  NO, UNSATISFIED
01800		JRST	SATCON		;  YES, SATISIFIED
01900	
02000	IFNZRO:				;"IFNZRO" PSEUDO-OP
02100		PUSHJ	%17,EXPR	;EVALUATE THE EXPRESSION
02200		 TRO	%15,ERRQ	;NULL, ERROR
02300		TRNN	%10,7777	;ZERO?
02400		JRST	UNSCON		;  YES, UNSATISFIED
02500		JRST	SATCON		;  NO, SATISIFIED
     
00100	SATCON:	AOSA	LVLCNT		;FOUND, BUMP CONDITIONAL LEVEL COUNT
00200	SATCO1:	ILDB	%14,%13		;GET NEXT CHARACTER
00300		LDB	%02,C1PNTR	;CONVERT USING COLUMN 1
00400		XCT	SATJTB(%02)	;LOOK FOR "<"
00500		TRO	%15,ERRQ	;INVALID, FLAG ERROR
00600		POPJ	%17,		;EXIT
00700	
00800	
00900	SATJTB:				;SATCON JUMP TABLE
01000		PHASE	0
01100		SOS	LVLCNT		; INVALID
01200	LNSP:	JRST	SATCO1		; SPACE, TAB
01300	LNCR:	SOS	LVLCNT		; CR, /
01400	LNSC:	SOS	LVLCNT		; ;
01500	LNDO:	SOS	LVLCNT		; $
01600	LNLA:	JRST	STMNT0		; <
01700	LNRA:	SOS	LVLCNT		; >
01800		DEPHASE
01900	
02000	
02100	UNSCON:				;UNSATISFIED CONDITIONAL
02200		TDZA	%07,%07		;INIT LOCAL LEVEL COUNT
02300	UNSCO1:	ILDB	%14,%13		;GET NEXT CHARACTER
02400	UNSCO2:	LDB	%02,C1PNTR	;CONVERT USING COLUMN 1
02500		XCT	UNSJTB(%02)	;PERFORM PROPER ACTION
02600		CAIE	%07,0		; ">", WAS "<" SEEN?
02700		TROA	%15,ERRQ	;  NO, FLAG ERROR
02800		ILDB	%14,%13		;  YES, GET NEXT CHARACTER
02900		POPJ	%17,		;EXIT
03000	
03100	UNSCO3:	JUMPN	%14,UNSCO1	;BRANCH ON NON-CR
03200		PUSHJ	%17,ENDL	;END OF LINE, LIST IT
03300		PUSHJ	%17,GETLIN	;GET ANOTHER LINE
03400		JRST	UNSCO2		;TRY AGAIN
03500	
03600	
03700	
03800	UNSJTB:				;UNSATISFIED CONDITIONAL JUMP TABLE
03900		PHASE	0
04000		JRST	UNSCO1
04100	LNSP:	JRST	UNSCO1		; SPACE, TAB
04200	LNCR:	JRST	UNSCO3		; CR, /
04300	LNSC:	JRST	UNSCO1		; ;
04400	LNDO:	JRST	UNSCO1		; $
04500	LNLA:	AOJA	%07,UNSCO1	; <
04600	LNRA:	SOJG	%07,UNSCO1	; >
04700		DEPHASE
     
00100	DEFINE:				;"DEFINE" PSEUDO-OP
00200		SKIPE	MACPNT		;NESTED?
00300		JRST	MACERR		;  YES, ERROR
00400		PUSHJ	%17,TSTSYM	;  NO, GET ITS NAME
00500		 JRST	MACERR		;NON-SYMBOLIC, ERROR
00600		PUSHJ	%17,SRCH	;SEARCH SYMBOL TABLE
00700		 JFCL
00800		MOVE	%01,MACTOP	;GET CURRENT TOP OF MACRO STORAGE
00900		HRLI	%01,MAOP	;DEFINE AS MACRO
01000		PUSHJ	%17,INSRT	;INSERT IN TABLE
01100		HRLI	%01,(POINT 7,,)	;SET BYTE POINTER
01200		MOVEM	%01,MACTMP	;SET START FOR STORAGE
01300		MOVEM	%17,MACPDP	;SAVE CURRENT PUSH-DOWN STACK
01400		PUSHJ	%17,CREFQ	;CREF WANTED?
01500		JRST	DEFIN0		;DONT OUTPUT TO CREF
01600		MOVEI	%02,CRFMAD	;MACRO DEFINITION FLAG
01700		PUSHJ	%17,CRFOU0	;OUTPUT SYMBOL TO CREF
01800	DEFIN0:	SETZ	%07,		;INIT ARG COUNT
01900	DEFIN1:	PUSHJ	%17,TSTSYM	;FETCH DUMMY ARGUMENTS
02000		 JRST	DEFIN2		;  END OF STRING
02100		PUSH	%17,%00		;STACK NAME
02200		AOJA	%07,DEFIN1	;TRY FOR ANOTHER
02300	
02400	DEFIN2:	MOVE	%14,%07		;GET ARG COUNT
02500		PUSHJ	%17,WCIMT	;WRITE IN MACRO TREE
02600		LDB	%14,%13		;RESTORE LAST CHARACTER
02700		TDOA	%07,[-1]	;INIT LEVEL COUNTER AND SKIP
02800	DEFIN3:	ILDB	%14,%13		;GET NEXT CHARACTER
02900	DEFIN4:	CAIN	%14,"<"
03000		AOJE	%07,DEFIN3	;BUMP, FORGET IF OPENING BRACKET
03100		CAIN	%14,">"
03200		SOJL	%07,DEFIN8	;BRANCH IF END
03300		LDB	%02,ANPNTR	;TEST CHARACTERISTICS OF CHAR
03400		XCT	DEFTBL(%02)
03500		MOVE	%06,%13		;ALPHABETIC, SAVE POINTER
03600		PUSHJ	%17,GETSYM	;ACCUMULATE SYMBOL
03700		MOVE	%02,MACPDP	;POINT TO START OF ARG STORAGE
03800	DEFIN5:	CAML	%02,%17		;FINISHED?
03900		JRST	DEFIN6		;  YES
04000		CAME	%00,1(%02)	;  NO, TEST FOR MATCH
04100		AOBJN	%02,DEFIN5	;  NO, TRY AGAIN
04200		SUB	%02,MACPDP	;COMPUTE ARG NUMBER
04300		MOVEI	%14,1(%02)	;PLACE IN %14
04400		PUSHJ	%17,WTIMT	;WRITE WITH FLAG
04500		LDB	%14,%13		;RETRIEVE LAST CHARACTER
04600		JRST	DEFIN4
     
00100	DEFIN6:	MOVE	%13,%06		;NOT ARG, POINT TO BEGINNING
00200		LDB	%14,%13		;RESTORE CHARACTER
00300		LDB	%02,ANPNTR
00400		XCT	DEFTB2(%02)	;FLUSH CHARACTERS IF NOT FOUND
00500		ILDB	%14,%13		;TRY AGAIN
00600		JRST	.-3
00700	
00800	
00900	DEFTB2:
01000		PHASE	0
01100		JRST	DEFIN4
01200	.TAB:	JRST	DEFIN4
01300	.ALP:	PUSHJ	%17,WCIMT
01400	.NUM:	PUSHJ	%17,WCIMT
01500		DEPHASE
01600	
01700	
01800	
01900	DEFIN7:	SKIPL	%07		;PROCESSING YET?
02000		PUSHJ	%17,WCIMT	;  YES, WRITE CHARACTER IN TREE
02100		JUMPN	%14,DEFIN3	;BRANCH IF NOT END OF LINE
02200		PUSHJ	%17,ENDL	;END, LIST IT
02300		PUSHJ	%17,GETLIN	;GET ANOTHER
02400		JRST	DEFIN4		;RECYCLE
02500	
02600	DEFIN8:	AOSE	%07		;">", IS IT MATCHING?
02700		TRO	%15,ERRM	;  NO, ERROR
02800		SETZ	%14,		;SET END FLAG
02900		PUSHJ	%17,WTIMT	;WRITE IN TREE
03000		ILDB	%14,%13		;BYPASS ">"
03100		MOVE	%17,MACPDP	;RESTORE PD PNTR
03200		AOS	%02,MACTMP
03300		HRRZM	%02,MACTOP	;SET NEW TOP
03400		POPJ	%17,
03500	
03600	
03700	DEFTBL:
03800		PHASE	0
03900		JRST	DEFIN7
04000	.TAB:	JRST	DEFIN7
04100	.ALP:	JUMPL	%07,DEFIN7
04200	.NUM:	JRST	DEFIN7
04300		DEPHASE
     
00100	CALLM:				;MACRO CALL PROCESSOR
00200		SKIPE	MACPNT		;ARE WE NESTED?
00300		JRST	MACERR		;  YES, ERROR
00400		HRLI	%01,(POINT 7,,)	;  NO, SET BYTE POINTER
00500		MOVEM	%01,MACPNT	;SET MACRO BYTE POINTER
00600		MOVE	%02,MACTOP
00700		HRLI	%02,(POINT 7,,)
00800		MOVEM	%02,ARGTMP	;SET ARG POINTER
00900		MOVEM	%02,MACTMP	;SET FOR STORAGE
01000		ILDB	%06,MACPNT	;GET ARGUMENT COUNT
01100	CALLM1:	JUMPE	%06,CALLM4	;BRANCH IF NO MORE ARGS
01200		ILDB	%14,%13		;GET NEXT CHARACTER
01300	CALLM2:	JUMPE	%14,CALLM4	;TEST FOR CR
01400		CAIN	%14,"/"		;INTO COMMENT FIELD?
01500		JRST	CALLM4		;  YES, GET OUT
01600		CAIN	%14,","		;END OF ARG?
01700		JRST	CALLM3		;  YES
01800		PUSHJ	%17,WCIMT	;  NO, WRITE CHARACTER IN TREE
01900		JRST	CALLM1		;GET NEXT CHARACTER
02000	
02100	CALLM3:	IBP	%13		;INCREMENT BYTE POINTER
02200	CALLM4:	MOVEI	%14,RUBOUT	;SET FLAG CHARACTER
02300		PUSHJ	%17,WCIMT	;WRITE IN TREE
02400		LDB	%14,%13		;RECOVER LAST CHARACTER
02500		SOJG	%06,CALLM2	;RECYCLE IF NOT END
02600		AOS	%02,MACTMP
02700		HRRZM	%02,MACTOP	;SET NEW TOP
02800		POPJ	%17,		;EXIT
     
00100	WTIMT:				;WRITE TWO CHARACTERS IN MACRO TREE
00200		PUSH	%17,%14		;SAVE FIRST CHARACTER
00300		MOVEI	%14,RUBOUT
00400		PUSHJ	%17,WCIMT	;WRITE RUBOUT
00500		POP	%17,%14		;RESTORE CHARACTER
00600		JRST	WCIMT
00700	
00800	
00900	WCIMT:					;WRITE CHAR IN MACRO TREE
01000		HRRZ	%02,MACTMP
01100		ADDI	%02,4
01200		CAML	%02,SYTBOT	;OVERFLOW?
01300		PUSHJ	%17,GETCOR	;  YES
01400		IDPB	%14,MACTMP	;DEPOSIT CHARACTER
01500		POPJ	%17,
01600	
01700	
01800	MACERR:
01900		TRO	%15,ERRM
02000		POPJ	%17,
     
00100	LSTOCT:
00200		MOVE	%03,[POINT 3,%10,23]
00300	LSTOC1:	ILDB	%02,%03
00400		ADDI	%02,"0"
00500		PUSHJ	%17,0(%01)
00600		TLNE	%03,770000
00700		JRST	LSTOC1
00800		POPJ	%17,
00900	
01000	SETLOC:				;TEST FOR SEQUENCE BREAK
01100		HRROM	%10,EQUIV	;LIST NEW LOCATION
01200		CAIN	%05,0(%10)	;IS THERE A SEQUENCE BREAK?
01300		POPJ	%17,		;  NO, EXIT
01400	OUTLOC:	HRROM	%10,EQUIV
01500		TRZE	%10,770000	;EXPRESSION OVERFLOW?
01600		TRO	%15,ERRQ	;  YES, FLAG ERROR
01700		HRRZ	%05,%10
01800		TRO	%10,CHAN7	;SET CHANNEL BITS AND OUTPUT
01900	
02000	BINWRD:
02100		LDB	%02,[POINT 8,%10,29]
02200		PUSHJ	%17,BINCHR
02300		LDB	%02,[POINT 6,%10,35]
02400	
02500	BINCHR:
02600		TLNN	%16,BINBIT!NOPBIT
02700		TLNE	%15,P1F
02800		POPJ	%17,
02900		ADDM	%02,CHKSUM
03000		JRST	BINOUT
03100	
03200	
03300	LEADER:
03400		MOVEI	%03,120
03500		MOVEI	%02,CHAN8_-6
03600		PUSHJ	%17,BINOUT
03700		SOJG	%03,.-1
03800		POPJ	%17,
03900	
04000	
04100	LINPNT:	POINT	7,LINBUF,
     
00100	;	SYMBOL TABLE ROUTINES
00200	
00300	SYTI:				;INITIALIZE THE SYMBOL TABLE
00400		MOVE	%06,CORTOP	;GET TOP OF CORE
00500		MOVEM	%06,SYTTOP	;SAVE TOP LOCATION
00600		SUBI	%06,4		;COMPUTE INITIAL BOTTOM
00700		MOVEM	%06,SYTBOT	;STORE IT
00800		MOVEI	%00,2		;INITIALIZE WITH TWO DUMMY SYMBOLS
00900		MOVEM	%00,0(%06)
01000		MOVSI	%00, (1B0)
01100		MOVEM	%00,1(%06)	;SET LOW BUMPER
01200		SETZM	    2(%06)
01300		SETCAM	%00,3(%06)	;SET HIGH BUMPER
01400		SETZM	    4(%06)
01500		PUSHJ	%17,SRCHI	;INITIALIZE THE SEARCH ROUTINES
01600	SYTI1:	MOVE	%00,BSYMT(%02)	;GET MNEMONIC
01700		AOBJN	%02,.+1
01800		MOVE	%01,BSYMT(%02)	;GET VALUE
01900		LSH	%01,0(%12)	;SHIFT MODE BIT INTO POSITION
02000		JUMPGE	%01,SYTI2	;BRANCH IF NOT SET
02100		MOVE	%01,BSYMT(%02)	;GET VALUE
02200		TLZ	%01,777000	;MASK OUT BITS
02300		PUSHJ	%17,SRCH	;SEARCH THE SYMBOL TABLE
02400		 PUSHJ	%17,INSRT	;INSERT MNEMONIC AND VALUE
02500	SYTI2:	AOBJN	%02,SYTI1	;TEST FOR END
02600		POPJ	%17,		;EXIT
     
00100	SRCH:				;SEARCH THE SYMBOL TABLE
00200		MOVE	%07,SRCHS	;GET STARTING ADDRESS
00300		MOVE	%06,SRCHD	;  AND DELTA
00400	
00500	SRCH1:	CAMGE	%00,-1(%07)	;ON OR ABOVE?
00600		JRST	SRCH2		;  NO, MOVE DOWN
00700		CAMG	%00,-1(%07)	;ABOVE?
00800		JRST	SRCH3		;  NO, POINTING TO IT
00900		ADD	%07,%06		;  YES, MOVE UP
01000		CAIA
01100	SRCH2:	SUB	%07,%06
01200		ASH	%06,-1		;HALVE DELTA
01300		CAMG	%07,SYTTOP	;WITHIN BOUNDS?
01400		JUMPN	%06,SRCH1	;  YES, RECYCLE IF NOT DONE
01500		JUMPN	%06,SRCH2	;  NO, MOVE DOWN IF NOT THROUGH
01600		SOJA	%07,CPOPJ	;NOT FOUND, EXIT
01700	
01800	SRCH3:	MOVE	%01,0(%07)	;FOUND, FETCH VALUE
01900		AOS	0(%17)		;SKIP-RETURN
02000		POPJ	%17,0		;RETURN
     
00100	INSRT:				;INSERT IN SYMBOL TABLE
00200		CAMN	%00,-1(%07)	;ALREADY IN TABLE?
00300		JRST	UPDATE		;  YES, JUST REPLACE VALUE
00400	INSRT1:	MOVE	%06,SYTBOT	;  NO, GET BOTTOM OF TABLE
00500		SUBI	%06,2		;PREPARE TO MOVE DOWN TWO LOCATIONS
00600		CAMLE	%06,MACTOP	;HAVE WE ROOM?
00700		JRST	INSRT2		;  YES
00800		PUSHJ	%17,GETCOR	;  NO, GET AND MOVE CORE
00900		ADDI	%07,CORINC
01000		JRST	INSRT1		;TRY AGAIN
01100	
01200	INSRT2:	MOVEM	%06,SYTBOT	;SET NEW BOTTOM
01300		HRLI	%06,2(%06)	;COMPUTE BLT
01400		BLT	%06,-2(%07)
01500		AOS	@SYTBOT		;INCREMENT SYMBOL COUNT
01600		MOVEM	%00,-1(%07)	;STORE VALUE
01700	UPDATE:	MOVEM	%01, 0(%07)	;STORE MNEMONIC
01800		JRST	SRCHI		;RE-COMPUTE OFFSET
01900	
02000	
02100	GETCOR:				;GET MORE CORE
02200		PUSH	%17,%00		;SAVE REGS
02300		PUSH	%17,%01
02400		HRRO	%01,.JBREL	;GET CURRENT TOP
02500		PUSHJ	%17,PANIC	;ASK EXEC FOR MORE CORE
02600		MOVN	%00,SYTBOT	;GET -BOTTOM
02700		ADDI	%00,1(%01)	;COMPUTE DIFFERENCE +1
02800		POP	%01,CORINC(%01)	;POP UP
02900		SOJG	%00,.-1		;TEST FOR END
03000		MOVEI	%01,CORINC
03100		ADDM	%01,SYTBOT	;UPDATE POINTERS
03200		ADDM	%01,.JBSYM
03300		ADDM	%01,SYTTOP
03400		PUSHJ	%17,SRCHI	;UPDATE SEARCH OFFSET
03500		POP	%17,%01
03600		POP	%17,%00
03700		POPJ	%17,		;EXIT
     
00100	RESYM:				;REMOVE A SYMBOL FROM THE TABLE
00200		SUBI	%07,2
00300	RESYM1:	MOVE	%06,0(%07)	;GET MNEMONIC VALUE
00400		MOVEM	%06,2(%07)	;MOVE UP TWO SLOTS
00500		CAME	%07,SYTBOT	;END?
00600		SOJA	%07,RESYM1	;  NO
00700		ADDI	%07,2		;  YES, COMPUTE NEW BOTTOM
00800		MOVEM	%07,SYTBOT
00900		SOS	@SYTBOT		;REDUCE SYMBOL COUNT
01000		JRST	SRCHI		;COMPUTE NEW OFFSET AND EXIT
     
00100	SRCHI:				;INITIALIZE THE SYMBOL TABLE OFFSET
00200		SETZ	%06,
00300		FAD	%06,@SYTBOT	;COMPUTE BINARY POWER
00400		LSH	%06,-33		;RIGHT-JUSTIFY
00500		MOVEI	%03,1_11	;SET A BIT
00600		LSH	%03,-<400-<33-11>+1>(%06)	;MOVE IT INTO POSITION
00700		MOVEM	%03,SRCHD	;SAVE AS DELTA
00800		ASH	%03,1		;MULTIPLY BY TWO
00900		ADD	%03,SYTBOT	;COMPUTE HALF-WAY MARK
01000		MOVEM	%03,SRCHS
01100		POPJ	%17,
     
00100	SYMTB:				;LIST THE SYMBOL TABLE
00200		MOVE	%07,SYTBOT	;GET START OF SYMBOL TABLE
00300		ADDI	%07,2		;MOVE PAST GARBAGE
00400	
00500	SYMTB1:	TRO	%16,HDRBIT	;FLAG NEW PAGE
00600		MOVEI	%03,PAGSIZ-2	;SET LINE COUNT
00700	
00800	SYMTB2:	SKIPL	-1(%07)		;END REACHED?
00900		POPJ	%17,		;  YES, EXIT
01000		MOVE	%06,%07		;SAVE CURRENT POINTER
01100		MOVEI	%04,SPL		;SET "SYMBOLS PER LINE"
01200		TLNE	%16,TTYBIT	;TTY?
01300		MOVEI	%04,SPLTTY	;  YES, REDUCE
01400		SETZ	%05,
01500	
01600	SYMTB3:	PUSHJ	%17,GETSTE	;GET THE NEXT SYMBOL TABLE ENTRY
01700		 JRST	SYMTB4		;FINIS
01800		SOJG	%05,SYMTB3	;TEST FOR ITEMS TO SKIP
01900		PUSHJ	%17,LSTSTE	;LIST SYMBOL TABLE ENTRY
02000		MOVEI	%05,PAGSIZ-2
02100		SOJG	%04,SYMTB3	;TEST FOR MORE ITEMS ON LINE
02200	
02300	SYMTB4:	PUSHJ	%17,LSTCR	;END OF LINE, LIST CR/LF
02400		SOJLE	%03,SYMTB1	;BRANCH IF END OF PAGE
02500		MOVE	%07,%06		;RETRIEVE POINTER
02600		PUSHJ	%17,GETSTE	;MOVE ONE PAST
02700		 POPJ	%17,		;END, EXIT
02800		JRST	SYMTB2		;OK, PROCESS ANOTHER
     
00100	GETSTE:				;GET SYMBOL TABLE ENTRY
00200		ADDI	%07,2		;MOVE UP TWO
00300		SKIPL	-1(%07)		;TEST FOR END
00400		POPJ	%17,		;  YES, EXIT
00500		LDB	%02,[POINT 9,0(%07),17]	;GET SYMBOL TYPE
00600		JUMPN	%02,GETSTE	;BYPASS IF OP
00700		AOS	0(%17)		;OK, PERFORM SKIP-RETURN
00800		POPJ	%17,
00900	
01000	LSTSTE:				;LIST SYMBOL TABLE ENTRY
01100		PUSHJ	%17,LSTTAB	;LEAD OFF WITH TAB
01200		HRLOI	%01,(POINT 6,0(%07),)	;SIXBIT POINTER TO SYMBOL
01300	LSTST1:	ILDB	%02,%01		;GET A CHARACTER
01400		JUMPE	%02,LSTST2	;DON'T LIST TRAILING BLANKS
01500		ADDI	%02,40		;CONVERT TO ASCII
01600		PUSHJ	%17,LSTOUT	;LIST CHARACTER
01700		TLNE	%01,770000	;ANY MORE CHARACTERS?
01800		JRST	LSTST1		;  YES
01900	LSTST2:	PUSHJ	%17,LSTTAB
02000		MOVSI	%01,(POINT 3,0(%07),23)	;SET OCTAL POINTER
02100	LSTST3:	ILDB	%02,%01		;GET OCTAL CHARACTER
02200		ADDI	%02,"0"		;CONVERT TO ASCII
02300		PUSHJ	%17,LSTOUT	;LIST IT
02400		TLNE	%01,770000	;ANY MORE BYTES?
02500		JRST	LSTST3		;  YES
02600		JRST	LSTTAB		;OUTPUT A TAB AND EXIT
     
00100	BITDMP:				;DUMP THE BIT TABLE
00200		TLZE	%15,CODFLG	;NO CODE STORED?
00300		TLNE	%16,XSWBIT!LSTBIT	;BIT MAP LISTING SUPPRESSED?
00400		JRST	BITDM4		;  YES, JUST INITIALIZE
00500		SETZ	%10,
00600	BITDM1:	TRNN	%10,3777
00700		TRO	%16,HDRBIT
00800		TRNN	%10,0777
00900		PUSHJ	%17,LSTCR
01000		TRNN	%10,0177
01100		PUSHJ	%17,LSTCR
01200		TRNE	%10,0077
01300		JRST	BITDM2
01400		PUSHJ	%17,LSTCR
01500		MOVEI	%01,LSTOUT
01600		PUSHJ	%17,LSTOCT
01700	BITDM2:	LDB	%02,[POINT 5,%10,28]
01800		SKIPN	PAGBUF(%02)	;ANY CODE ON THIS PAGE?
01900		JRST	BITDM3		;  NO, DON'T LIST
02000		MOVEI	%02,SPACE
02100		TRNN	%10,0007
02200		PUSHJ	%17,LSTOUT
02300		TRNN	%10,0007
02400		PUSHJ	%17,LSTOUT
02500		MOVE	%01,%10
02600		IDIVI	%01,^D36
02700		MOVE	%01,BITBUF(%01)
02800		ROT	%01,0(%02)
02900		MOVEI	%02,"0"
03000		TLNE	%01,(1B0)
03100		MOVEI	%02,"1"
03200		PUSHJ	%17,LSTOUT
03300	BITDM3:	CAIGE	%10,7777
03400		AOJA	%10,BITDM1
03500		TRO	%16,HDRBIT
03600	BITDM4:	SETZM	BITBUF
03700		MOVE	%01,[XWD BITBUF,BITBUF+1]
03800		BLT	%01,BITEND	;ZERO BIT MAP STORAGE AREA
03900		POPJ	%17,
     
00100	CRFOUT:				;OUTPUT WORD TO CREF
00200		PUSHJ	%17,CREFQ	;CREF WANTED?
00300		POPJ	%17,		;NO  EXIT
00400		LDB	%02,[POINT 9,%01,17]	;GET SYMBOL TYPE BITS
00500		XCT	CRFTBL(%02)	;GET PROPER FLAG
00600	CRFOU0:	PUSHJ	%17,LISTCQ	;LIST IT
00700		MOVEI	%03,6		;HAVE TO COUNT THE CHARACTERS
00800		MOVEI	%02,0		;NONE SO FAR
00900		TRNE	%00,77		;CHARACTER HERE?
01000		ADDI	%02,1		;YES. COUNT IT
01100		ROT	%00,6		;CHECK ANOTHER CH
01200		SOJG	%03,.-3		;COUNT 6 CHARS
01300		PUSHJ	%17,LSTDMP	;OUTPUT THE COUNT FROM AC2
01400		MOVSI	%03,(POINT 6,%00,)
01500	CRFOU1:	ILDB	%02,%03		;GET A SIXBIT CHARACTER
01600		JUMPE	%02,CRFOU2	;BRANCH IF END
01700		ADDI	%02,40		;CONVERT TO ASCII
01800		PUSHJ	%17,LSTDMP	;LIST IT
01900		TLNE	%03,770000	;END OF WORD?
02000		JRST	CRFOU1		;  NO, GET ANOTHER
02100	CRFOU2:	POPJ	%17,0		;EXIT
02200	
02300	CRFTBL:				;CREF TABLE
02400		PHASE	0
02500		MOVEI	%02,CRFSYM
02600	PSOP:	MOVEI	%02,CRFOPC
02700	MROP:	MOVEI	%02,CRFOPC
02800	MCOP:	MOVEI	%02,CRFOPC
02900	MAOP:	MOVEI	%02,CRFMAC
03000		DEPHASE
03100	
03200	LISTCQ:	PUSHJ	%17,CREFQ	;CREF WANTED NOW?
03300		POPJ	%17,0		;NO. RETURN
03400		PUSH	%17,%02		;SAVE CHARACTER
03500		TLON	%15,CSYBIT	;BLOCK BEGUN?
03600		PUSHJ	%17,CRFBGN	;NO. START IT
03700		POP	%17,%02		;RETRIEVE CHARACTER
03800		JRST	LSTDMP		;TYPE CHAR AND RETURN
     
00100	BSYMT:				;BASIC SYMBOL TABLE
00200	
00300					;PSEUDO-OPERATORS
00400	
00500	SIXBIT	/ZBLOCK/
00600			<SBX!            SBS> + <PSOP>B17 + ZBLOCK
00700	
00800	SIXBIT	/DECIMA/
00900			<SBX!SB3!SB8!SBD!SBS> + <PSOP>B17 + DECIMA
01000	
01100	SIXBIT	/DEFINE/
01200			<SBX!    SB8        > + <PSOP>B17 + DEFINE
01300	
01400	SIXBIT	/DTORG/
01500			<SBX                > + <PSOP>B17 + DTORG
01600	
01700	SIXBIT	/DUBL/
01800			<SBX!    SB8        > + <PSOP>B17 + DUBL
01900	
02000	SIXBIT	/ENPUNC/
02100			<SBX!            SBS> + <PSOP>B17 + ENPUNC
02200	
02300	SIXBIT	/EXPUNG/
02400			<SBX!SB3!SB8!SBD!SBS> + <PSOP>B17 + EXPUNG
02500	
02600	SIXBIT	/FIELD/
02700			<SBX!SB3!SB8!SBD!SBS> + <PSOP>B17 + FIELD
02800	
02900	SIXBIT	/FIXMRI/
03000			<SBX!SB3            > + <PSOP>B17 + FIXMRI
03100	
03200	SIXBIT	/FIXTAB/
03300			<SBX!SB3!SB8!SBD!SBS> + <PSOP>B17 + FIXTAB
03400	
03500	SIXBIT	/FLTG/
03600			<SBX!    SB8        > + <PSOP>B17 + FLTG
03700	
03800	SIXBIT	/IFDEF/
03900			<SBX!            SBS> + <PSOP>B17 + IFDEF
04000	
04100	SIXBIT	/IFNDEF/
04200			<SBX!            SBS> + <PSOP>B17 + IFNDEF
04300	
04400	SIXBIT	/IFNZRO/
04500			<SBX!            SBS> + <PSOP>B17 + IFNZRO
04600	
04700	SIXBIT	/IFZERO/
04800			<SBX!            SBS> + <PSOP>B17 + IFZERO
04900	
05000	SIXBIT	/NOPUNC/
05100			<SBX!            SBS> + <PSOP>B17 + NOPUNC
05200	
05300	SIXBIT	/OCTAL/
05400			<SBX!SB3!SB8!SBD!SBS> + <PSOP>B17 + OCTAL
05500	
05600	SIXBIT	/PAGE/
05700			<SBX!    SB8!SBD!SBS> + <PSOP>B17 + PAGE
05800	
05900	SIXBIT	/PAUSE/
06000			<SBX!SB3!    SBD!SBS> + <PSOP>B17 + CPOPJ
06100	
06200	SIXBIT	/TEXT/
06300			<SBX!    SB8!SBD!SBS> + <PSOP>B17 + TEXT
06400	
06500	SIXBIT	/XLIST/
06600			<SBX!        SBD!SBS> + <PSOP>B17 + XLIST
     
00100					;MEMORY REFERENCE INSTRUCTIONS
00200	
00300	SIXBIT	/AND/
00400			<SBX!SB3!SB8!SBD!SBS> + <MROP>B17 + 0000
00500	
00600	SIXBIT	/TAD/
00700			<SBX!SB3!SB8!SBD!SBS> + <MROP>B17 + 1000
00800	
00900	SIXBIT	/ISZ/
01000			<SBX!SB3!SB8!SBD!SBS> + <MROP>B17 + 2000
01100	
01200	SIXBIT	/DCA/
01300			<SBX!SB3!SB8!SBD!SBS> + <MROP>B17 + 3000
01400	
01500	SIXBIT	/JMS/
01600			<SBX!SB3!SB8!SBD!SBS> + <MROP>B17 + 4000
01700	
01800	SIXBIT	/JMP/
01900			<SBX!SB3!SB8!SBD!SBS> + <MROP>B17 + 5000
02000	
02100	
02200	EEXOPS:
     
00100					;GROUP 1 OPERATE MICROINSTRUCTIONS
00200	
00300	SIXBIT	/OPR/
00400			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 7000
00500	
00600	SIXBIT	/NOP/
00700			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 7000
00800	
00900	SIXBIT	/IAC/
01000			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 7001
01100	
01200	SIXBIT	/RAL/
01300			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 7004
01400	
01500	SIXBIT	/RTL/
01600			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 7006
01700	
01800	SIXBIT	/RAR/
01900			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 7010
02000	
02100	SIXBIT	/RTR/
02200			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 7012
02300	
02400	SIXBIT	/CML/
02500			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 7020
02600	
02700	SIXBIT	/CMA/
02800			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 7040
02900	
03000	SIXBIT	/CLL/
03100			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 7100
03200	
03300	SIXBIT	/CLA/
03400			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 7200
     
00100					;GROUP 2 OPERATE MICROINSTRUCTIONS
00200	
00300	SIXBIT	/HLT/
00400			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 7402
00500	
00600	SIXBIT	/OSR/
00700			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 7404
00800	
00900	SIXBIT	/SKP/
01000			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 7410
01100	
01200	SIXBIT	/SNL/
01300			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 7420
01400	
01500	SIXBIT	/SZL/
01600			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 7430
01700	
01800	SIXBIT	/SZA/
01900			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 7440
02000	
02100	SIXBIT	/SNA/
02200			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 7450
02300	
02400	SIXBIT	/SMA/
02500			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 7500
02600	
02700	SIXBIT	/SPA/
02800			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 7510
     
00100					;COMBINED OPERATE MICROINSTRUCTIONS
00200	
00300	
00400	SIXBIT	/CIA/
00500			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 7041
00600	
00700	SIXBIT	/STL/
00800			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 7120
00900	
01000	SIXBIT	/GLK/
01100			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 7204
01200	
01300	SIXBIT	/STA/
01400			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 7240
01500	
01600	SIXBIT	/LAS/
01700			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 7604
     
00100					;IOT MICROINSTRUCTIONS
00200	
00300	;PROCESSOR IOTS
00400	
00500	SIXBIT	/IOT/
00600			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6000
00700	
00800	SIXBIT	/ION/
00900			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6001
01000	
01100	SIXBIT	/IOF/
01200			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6002
01300	
01400	
01500	;KEYBOARD/READER
01600	
01700	SIXBIT	/KSF/
01800			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6031
01900	
02000	SIXBIT	/KCC/
02100			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6032
02200	
02300	SIXBIT	/KRS/
02400			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6034
02500	
02600	SIXBIT	/KRB/
02700			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6036
02800	
02900	
03000	;TELEPRINTER/PUNCH
03100	
03200	SIXBIT	/TSF/
03300			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6041
03400	
03500	SIXBIT	/TCF/
03600			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6042
03700	
03800	SIXBIT	/TPC/
03900			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6044
04000	
04100	SIXBIT	/TLS/
04200			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6046
     
00100	;HIGH-SPEED READER (TYPE PC02)
00200	
00300	SIXBIT	/RSF/
00400			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6011
00500	
00600	SIXBIT	/RRB/
00700			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6012
00800	
00900	SIXBIT	/RFC/
01000			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6014
01100	
01200	
01300	;HIGH-SPEED PUNCH (TYPE PC03)
01400	
01500	SIXBIT	/PSF/
01600			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6021
01700	
01800	SIXBIT	/PCF/
01900			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6022
02000	
02100	SIXBIT	/PPC/
02200			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6024
02300	
02400	SIXBIT	/PLS/
02500			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6026
     
00100	;DISK FILE AND CONTROL (TYPE DF32)
00200	
00300	SIXBIT	/DCMA/
00400			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6601
00500	
00600	SIXBIT	/DMAR/
00700			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6603
00800	
00900	SIXBIT	/DMAW/
01000			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6605
01100	
01200	SIXBIT	/DCEA/
01300			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6611
01400	
01500	SIXBIT	/DSAC/
01600			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6612
01700	
01800	SIXBIT	/DEAL/
01900			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6615
02000	
02100	SIXBIT	/DEAC/
02200			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6616
02300	
02400	SIXBIT	/DFSE/
02500			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6621
02600	
02700	SIXBIT	/DFSC/
02800			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6622
02900	
03000	SIXBIT	/DMAC/
03100			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6626
     
00100	;DECTAPE TRANSPORT (TYPE TU55) AND CONTROL (TYPE TC01)
00200	
00300	SIXBIT	/DTRA/
00400			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6761
00500	
00600	SIXBIT	/DTCA/
00700			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6762
00800	
00900	SIXBIT	/DTXA/
01000			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6764
01100	
01200	SIXBIT	/DTSF/
01300			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6771
01400	
01500	SIXBIT	/DTRB/
01600			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6772
01700	
01800	SIXBIT	/DTLB/
01900			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6774
02000	
02100	
02200	;MEMORY EXTENSION CONTROL (TYPE 183)
02300	
02400	
02500	SIXBIT	/CDF/
02600			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6201
02700	
02800	SIXBIT	/CIF/
02900			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6202
03000	
03100	SIXBIT	/RDF/
03200			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6214
03300	
03400	SIXBIT	/RIF/
03500			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6224
03600	
03700	SIXBIT	/RMF/
03800			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6244
03900	
04000	SIXBIT	/RIB/
04100			<SBX!SB3!SB8!SBD!SBS> + <MCOP>B17 + 6234
     
00100	;PALX CODES
00200	
00300	
00400	SIXBIT	/MMLS/
00500			<SBX                    > + <MCOP>B17 + 6751
00600	
00700	SIXBIT	/MMLM/
00800			<SBX                    > + <MCOP>B17 + 6752
00900	
01000	SIXBIT	/MMLF/
01100			<SBX                    > + <MCOP>B17 + 6754
01200	
01300	SIXBIT	/MMMF/
01400			<SBX                    > + <MCOP>B17 + 6756
01500	
01600	SIXBIT	/MMMM/
01700			<SBX                    > + <MCOP>B17 + 6757
01800	
01900	SIXBIT	/MMSF/
02000			<SBX                    > + <MCOP>B17 + 6761
02100	
02200	SIXBIT	/MMCC/
02300			<SBX                    > + <MCOP>B17 + 6762
02400	
02500	SIXBIT	/MMML/
02600			<SBX                    > + <MCOP>B17 + 6766
02700	
02800	SIXBIT	/MMSC/
02900			<SBX                    > + <MCOP>B17 + 6771
03000	
03100	SIXBIT	/MMCF/
03200			<SBX                    > + <MCOP>B17 + 6772
03300	
03400	SIXBIT	/MMRS/
03500			<SBX                    > + <MCOP>B17 + 6774
03600	
03700	
03800	SIXBIT	/SKPNA/
03900			<SBX                    > + <MCOP>B17 + 6311
04000	
04100	SIXBIT	/RSC/
04200			<SBX                    > + <MCOP>B17 + 6312
04300	
04400	SIXBIT	/PSC/
04500			<SBX                    > + <MCOP>B17 + 6314
04600	
04700	
04800	
04900	EBSYMT:				;END OF BASIC SYMBOL TABLE
     
00100	CNVTBL:				;MODE CONVERSION TABLE
00200		POINT	4,0(%02),3
00300		POINT	4,0(%02),7
00400		POINT	4,0(%02),11
00500		POINT	4,0(%02),15
00600		POINT	4,0(%02),19
00700		POINT	4,0(%02),23
00800	
00900	
01000	C1PNTR:	POINT	4,CHJTBL(%14), 3
01100	C2PNTR:	POINT	4,CHJTBL(%14), 7
01200	C3PNTR:	POINT	4,CHJTBL(%14),11
01300	C4PNTR:	POINT	4,CHJTBL(%14),15
01400	C5PNTR:	POINT	4,CHJTBL(%14),19
01500	C6PNTR:	POINT	4,CHJTBL(%14),23
01600	C7PNTR:	POINT	4,CHJTBL(%14),27
01700	C8PNTR:	POINT	4,CHJTBL(%14),31
01800	C9PNTR:	POINT	4,CHJTBL(%14),35
01900	
02000	ANPNTR=	C8PNTR
     
00100	CHJTBL:				;CHARACTER JUMP TABLE
00200	
00300	BYTE	(4)	LNCR,    ,    ,    ,    ,    ,QJNU,    ,    	;
00400	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
00500	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
00600	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
00700	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
00800	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
00900	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
01000	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
01100	
01200	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
01300	BYTE	(4)	LNSP,STSP,    ,EXSP,MRSP,TJSP,QJTB,.TAB,LTSP	; TAB
01400	BYTE	(4)	    ,    ,    ,    ,    ,    ,QJNU,    ,    	; LF
01500	BYTE	(4)	    ,    ,    ,    ,    ,    ,QJNU,    ,    	;
01600	BYTE	(4)	    ,    ,    ,    ,    ,    ,QJNU,    ,    	; FF
01700	BYTE	(4)	    ,    ,    ,    ,    ,    ,QJCR,    ,    	; CR
01800	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
01900	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
02000	
02100	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
02200	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
02300	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
02400	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
02500	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
02600	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
02700	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
02800	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
02900	
03000	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
03100	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
03200	BYTE	(4)	    ,    ,    ,    ,    ,    ,QJNU,    ,    	; EOF
03300	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
03400	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
03500	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
03600	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
03700	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
     
     
00100	BYTE	(4)	LNSP,STSP,    ,EXSP,MRSP,TJSP,QJSP,.TAB,LTSP	; SPACE
00200	BYTE	(4)	    ,    ,    ,EXOR,    ,    ,QJPC,    ,    	; !
00300	BYTE	(4)	    ,    ,    ,EXTE,    ,TJQT,QJPC,    ,    	; "
00400	BYTE	(4)	    ,    ,    ,    ,    ,    ,QJPC,    ,    	; #
00500	BYTE	(4)	LNDO,    ,    ,    ,    ,    ,QJPC,    ,    	; $
00600	BYTE	(4)	    ,    ,    ,    ,    ,    ,QJPC,    ,    	; %
00700	BYTE	(4)	    ,    ,    ,EXAN,    ,    ,QJPC,    ,    	; &
00800	BYTE	(4)	    ,    ,    ,    ,    ,    ,QJPC,    ,    	; '
00900	
01000	BYTE	(4)	    ,    ,    ,EXTE,    ,TJLP,QJPC,    ,    	; (
01100	BYTE	(4)	    ,    ,    ,    ,    ,    ,QJPC,    ,LTRP	; )
01200	BYTE	(4)	    ,STAS,    ,    ,    ,    ,QJPC,    ,    	; *
01300	BYTE	(4)	    ,    ,    ,EXPL,    ,TJUO,QJPC,    ,    	; +
01400	BYTE	(4)	    ,    ,SACM,    ,    ,    ,QJPC,    ,    	; ,
01500	BYTE	(4)	    ,    ,    ,EXMI,    ,TJUO,QJPC,    ,    	; -
01600	BYTE	(4)	    ,    ,    ,EXTE,    ,TJPE,QJPC,    ,    	; .
01700	BYTE	(4)	LNCR,    ,    ,    ,    ,    ,QJPC,    ,    	; /
01800	
01900	BYTE	(4)	    ,    ,    ,EXTE,    ,TJNM,QJPC,.NUM,    	; 0
02000	BYTE	(4)	    ,    ,    ,EXTE,    ,TJNM,QJPC,.NUM,    	; 1
02100	BYTE	(4)	    ,    ,    ,EXTE,    ,TJNM,QJPC,.NUM,    	; 2
02200	BYTE	(4)	    ,    ,    ,EXTE,    ,TJNM,QJPC,.NUM,    	; 3
02300	BYTE	(4)	    ,    ,    ,EXTE,    ,TJNM,QJPC,.NUM,    	; 4
02400	BYTE	(4)	    ,    ,    ,EXTE,    ,TJNM,QJPC,.NUM,    	; 5
02500	BYTE	(4)	    ,    ,    ,EXTE,    ,TJNM,QJPC,.NUM,    	; 6
02600	BYTE	(4)	    ,    ,    ,EXTE,    ,TJNM,QJPC,.NUM,    	; 7
02700	
02800	BYTE	(4)	    ,    ,    ,EXTE,    ,TJNM,QJPC,.NUM,    	; 8
02900	BYTE	(4)	    ,    ,    ,EXTE,    ,TJNM,QJPC,.NUM,    	; 9
03000	BYTE	(4)	    ,    ,    ,    ,    ,    ,QJPC,    ,    	; :
03100	BYTE	(4)	LNSC,STSC,    ,    ,    ,    ,QJPC,    ,    	; ;
03200	BYTE	(4)	LNLA,STLA,    ,    ,    ,    ,QJPC,    ,    	; <
03300	BYTE	(4)	    ,    ,SAEQ,    ,    ,    ,QJPC,    ,    	; =
03400	BYTE	(4)	LNRA,    ,    ,    ,    ,    ,QJPC,    ,    	; >
03500	BYTE	(4)	    ,    ,    ,    ,    ,    ,QJPC,    ,    	; ?
     
     
00100	BYTE	(4)	    ,    ,    ,    ,    ,    ,QJPC,    ,    	; @
00200	BYTE	(4)	    ,STAL,    ,EXTE,    ,TJAL,QJPC,.ALP,    	; A
00300	BYTE	(4)	    ,STAL,    ,EXTE,    ,TJAL,QJPC,.ALP,    	; B
00400	BYTE	(4)	    ,STAL,    ,EXTE,    ,TJAL,QJPC,.ALP,    	; C
00500	BYTE	(4)	    ,STAL,    ,EXTE,    ,TJAL,QJPC,.ALP,    	; D
00600	BYTE	(4)	    ,STAL,    ,EXTE,    ,TJAL,QJPC,.ALP,    	; E
00700	BYTE	(4)	    ,STAL,    ,EXTE,    ,TJAL,QJPC,.ALP,    	; F
00800	BYTE	(4)	    ,STAL,    ,EXTE,    ,TJAL,QJPC,.ALP,    	; G
00900	
01000	BYTE	(4)	    ,STAL,    ,EXTE,    ,TJAL,QJPC,.ALP,    	; H
01100	BYTE	(4)	    ,STAL,    ,EXTE,MRCI,TJAL,QJPC,.ALP,    	; I
01200	BYTE	(4)	    ,STAL,    ,EXTE,    ,TJAL,QJPC,.ALP,    	; J
01300	BYTE	(4)	    ,STAL,    ,EXTE,    ,TJAL,QJPC,.ALP,    	; K
01400	BYTE	(4)	    ,STAL,    ,EXTE,    ,TJAL,QJPC,.ALP,    	; L
01500	BYTE	(4)	    ,STAL,    ,EXTE,    ,TJAL,QJPC,.ALP,    	; M
01600	BYTE	(4)	    ,STAL,    ,EXTE,    ,TJAL,QJPC,.ALP,    	; N
01700	BYTE	(4)	    ,STAL,    ,EXTE,    ,TJAL,QJPC,.ALP,    	; O
01800	
01900	BYTE	(4)	    ,STAL,    ,EXTE,    ,TJAL,QJPC,.ALP,    	; P
02000	BYTE	(4)	    ,STAL,    ,EXTE,    ,TJAL,QJPC,.ALP,    	; Q
02100	BYTE	(4)	    ,STAL,    ,EXTE,    ,TJAL,QJPC,.ALP,    	; R
02200	BYTE	(4)	    ,STAL,    ,EXTE,    ,TJAL,QJPC,.ALP,    	; S
02300	BYTE	(4)	    ,STAL,    ,EXTE,    ,TJAL,QJPC,.ALP,    	; T
02400	BYTE	(4)	    ,STAL,    ,EXTE,    ,TJAL,QJPC,.ALP,    	; U
02500	BYTE	(4)	    ,STAL,    ,EXTE,    ,TJAL,QJPC,.ALP,    	; V
02600	BYTE	(4)	    ,STAL,    ,EXTE,    ,TJAL,QJPC,.ALP,    	; W
02700	
02800	BYTE	(4)	    ,STAL,    ,EXTE,    ,TJAL,QJPC,.ALP,    	; X
02900	BYTE	(4)	    ,STAL,    ,EXTE,    ,TJAL,QJPC,.ALP,    	; Y
03000	BYTE	(4)	    ,STAL,    ,EXTE,MRCZ,TJAL,QJPC,.ALP,    	; Z
03100	BYTE	(4)	    ,    ,    ,    ,    ,TJLB,QJPC,    ,    	; [
03200	BYTE	(4)	    ,    ,    ,    ,    ,    ,QJPC,    ,    	; \
03300	BYTE	(4)	    ,    ,    ,    ,    ,    ,QJPC,    ,LTRB	; ]
03400	BYTE	(4)	    ,    ,    ,EXMU,    ,    ,QJPC,    ,    	; ^
03500	BYTE	(4)	    ,    ,    ,    ,    ,    ,QJPC,    ,    	; _
     
     
00100	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
00200	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
00300	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
00400	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
00500	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
00600	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
00700	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
00800	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
00900	
01000	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
01100	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
01200	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
01300	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
01400	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
01500	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
01600	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
01700	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
01800	
01900	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
02000	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
02100	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
02200	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
02300	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
02400	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
02500	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
02600	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
02700	
02800	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
02900	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
03000	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
03100	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
03200	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
03300	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
03400	BYTE	(4)	    ,    ,    ,    ,    ,    ,    ,    ,    	;
03500	BYTE	(4)	    ,    ,    ,    ,    ,    ,QJNU,    ,    	;
     
00100	XX SYTTOP,1,POINTER TO TOP OF SYMBOL TABLE
00200	XX SYTBOT,1,POINTER TO BOTTOM OF SYMBOL TABLE
00300	
00400	XX SRCHD,1,SEARCH DELTA
00500	XX SRCHS,1,SEARCH HALF-WAY POINT
00600	
00700	XX RADIX,1
00800	XX VALUE,1
00900	XX EQUIV,1
01000	XX CHKSUM,1
01100	XX LVLCNT,1,CONDITIONAL LEVEL COUNT
01200	
01300	XX MACPNT,1
01400	XX MACTMP,1
01500	XX MACPDP,1
01600	XX ARGPNT,1
01700	XX ARGTMP,1
01800	
01900	XX MACTOP,1
02000	
02100	XX DBLPNT,1
02200	XX DBLSAV,1
02300	
02400	XX TXTEND,1,USED BY "TEXT" PSEUDO-OP
02500	
02600	XX RUNTIM,1,RUN TIME
02700	
02800	XX LINBUF,CPL/5+1,SOURCE LINE BUFFER
02900	
03000	XX TTLBUF,TTLLEN/5,TITLE BUFFER
03100	XX TTLEND,1
03200	
03300	XX CLTBUF,200,CURRENT LITERAL BUFFER
03400	
03500	XX ZLTBUF,200,PAGE ZERO LITERAL BUFFER
03600	
03700	XX CLHBUF,40,CURRENT LITERAL HEADER BUFFER
03800	XX SEQNUM,1
03900	
04000	XX PDPBUF,PDPLEN
04100	
04200	XX AC00,1,AC EXCHANGE BLOCK
04300	XX AC01,1
04400	XX AC02,1
04500	XX AC03,1
04600	XX AC04,1
04700	XX AC05,1
04800	XX AC06,1
04900	XX AC07,1
05000	XX AC10,1
05100	XX AC11,1
05200	XX AC12,1
05300	XX AC13,1
05400	XX AC14,1
05500	
05600	XX DATE,1
05700	XX MSTIME,1
05800	XX PAGNUM,1,PAGE NUMBER
05900	XX PAGEXT,1,PAGE EXTENSION
06000	XX ERRCNT,1,ERROR COUNT
06100	XX LINKS,1, LINKS GENERATED
06200	XX EXTSAV,1,FILNAM EXTENSION FOR HEADER (EXEC)
06300	XX MODSW,1
06400	XX JOBFFI,1,.JBFF SAVE
06500	XX TTISAV,1,TTI POINTER SAVE
06600	XX INBCNT,1
06700	XX XESAVE,1
06800	
06900	XX XE,1,EXEC LOOKUP BLOCK
07000	XX XE1,1
07100	XX XE2,1
07200	XX XE3,1
07300	
07400	XX TTIBUF,1
07500	XX TTIPNT,1
07600	XX TTICNT,1
07700	
07800	XX TTOBUF,1
07900	XX TTOPNT,1
08000	XX TTOCNT,1
08100	
08200	XX BINBUF,1
08300	XX BINPNT,1
08400	XX BINCNT,1
08500	
08600	XX LSTBUF,1
08700	XX LSTPNT,1
08800	XX LSTCNT,1
08900	
09000	XX SRCBUF,1
09100	XX SRCPNT,1
09200	XX SRCCNT,1
09300	
09400	XX LINCNT,1,EXEC LINE COUNTER
09500	
09600	XX CORTOP,1,CORE TOP
09700	XX CORBOT,1,CORE BOTTOM
09800	
09900	XX BITBUF,10000/^D36+1,BIT MAP BUFFER
10000	XX PAGBUF,^D32,PAGE BUFFER FOR BIT MAP
10100	
10200	XX LITLVL,1,LIT LEVEL COUNT
10300		BITEND=LITLVL-1
10400		ZBLTMP=TXTEND
10500		BZCOR=SYTTOP
10600		EZCOR=LITLVL+1
10700		XLIST ;DONT LIST LITERALS
10800	LIT
10900		LIST  ;JUST LITERALS ABOVE
11000		END	PAL		;....PAL
11100