/SUBROUTINE COPY GIVES HARD COPY OF DISPLAY FILE ON 'X-Y' RECORDER.
/ START DISPLAY FILE AT FILER (FIRST WORD MUST BE PARAMETER MODE. )
/      CHANGE ABOVE --- FILER POINTS TO START OF DISPLAY FILE
/THE SUBROUTINE RETURNS ON A STOP CODE OR RETURNS TO FILER OR FINDS
/AN ERROR. ERRORS - 0 SLAVE MODE WORD FOUND.
/	        - 2 SUBROUTINE OPCODE 00 FOUND.
/	        - 4 X OR Y ADDRESS EXCEEDS SCREEN LIMITS.
/ERRORS ARE TYPED ON TTY AS ERR 'X' @ NNNNN
/	WHERE NNNNN IS ADDRESS OF ERROR
/
/THE TIMER IS PROPORTIONAL TO ((2**-SPEED)+BIAS) . SPEED AND BIAS
				/ARE PROGRAM PARAMETERS.
/
/DEFINITIONS:
ORCS=702105
DJP=400000
EEM=707702
STCODE=2000
IDLA=700606
RB17UP=0
RB17DN=1
STPCOD=2000
UPDNWT
/
/
/
	.GLOBL COPY,FILER,PLOT,SWITCH
COPY	XX
	JMS	SHIFTN	/DISPLAY IS INITIALLY IN 'SHIFT IN'
	DZM	PENPOS
	LAC	SWITCH	/SHORT CIRCUIT 'SWITCH' TO ALLOW
	DAC	SAVADR#	/PEN CONTROL FROM 'COPY'
	ISZ	SAVADR
	LAC*	SAVADR	/GET CONTENTS OF 'SWITCH+1'
	DAC	SAVCON#	/SAVE IT
	LAC	SWITCH
	AND	(17777	/CHOP TO 13 BITS
	XOR	(JMP*
	DAC*	SAVADR	/INSERT 'JMP* SWITCH' AT 'SWITCH+1'
	LAC	(RB17UP
	ORCS			/PUT PEN UP
				/    AN EXITSW.
	DZM	MODE#
	DZM	PRMODE#
INITPL	LAS
	SNA			/NO SETUP OF PLOTTER ACC=0
	JMP	PROC
	DAC	SAVE#
	RCR
	AND	(1776	/TRUNCATE TO PREVENT DATA OVER-RANGE
	DAC	XREGST
	DAC	YREGST
	JMS	PLOTT
	LAS
	SAD	SAVE
	JMP	.-2
	JMP	INITPL
PROC	DZM	XREGST
DZMX=PROC
DZMY	DZM	YREGST
	JMS	PLOTT
	DZM	SAVE
	DZM	XLAST#
	DZM	YLAST#
PROCED	LAC*     FILER
	DAC	ADDRES#	         /RUNNING FILE POINTER.
	LAC*	ADDRES
	DAC	SAVEFR#
	LAC	(STPCOD
	DAC*	ADDRES
	LAC	SAVEFR
	JMP	PARMTR+1
DECODE	LAC	MODE
	AND	(7
	TAD	(JMP* MODETB	/SET UP BRANCH INST.
	DAC	.+1
	XX
MODETB	PARMTR		         /MODE = 0
	POINT			/       1
	ERROR0			/       2 (SLAVE)
	CHARAT			/       3
	VECTOR			/       4
	VECT1			/       5 (VECTOR CONTINUE)
	INCREM			/       6
	SUBROT			/       7
/
/
/
GO	JMS	WRITE		/MOVE PEN
	LAC	PRMODE
	SAD	(JMP* MODETB+1	/WAS MODE = POINT
	JMP	PNTCHK		/YES
	LAC	SAVE#
	SAD	(2	/IS THIS A SUBROUTINE RETURN.
	JMP	SUBRET	/YES
GET	ISZ	ADDRES	/SHIFT POINTER TO NEXT WORD.
CHECK	LAC	ADDRES
	SAD*      FILER	/IS IT THE INITIAL ADDRESS.
	JMP	EXIT	/YES. STOP
	JMP	DECODE	/NO.
/
/
/
PNTCHK	DZM	PRMODE	/ZERO PRESENT WORD REGISTER.
	LAC	DOTIT#
	SZA		/IS PEN-DOWN FLAG SET?
	JMS	PENDWN	/YES.
	NOP
	JMP	GET	/CONTINUE
/
SUBRET	DZM	SAVE	/WE HAVE A SUBROUTINE RETURN.
	LAC	ASR#	 /JUMP, ADDRESS OF NEXT INST.
	DAC	ADDRES	/IS IN ASR.
	JMP	CHECK
/
EXIT	LAC*	FILER
	DAC	ADDRES
	LAC	SAVEFR
	DAC*	ADDRES		/REPLACE FILER BEFORE STARTING
					/DISPLAY
	LAC	ADDRES
	IDLA
EXIT1	JMS	PENUP
	LAC*	FILER
	DAC	ADDRES
	LAC	SAVEFR
	DAC*	ADDRES		/REPLACE FILER IF ENTER @ EXIT1
	LAC	(7
	LAC	SAVCON	/RESTORE 'SWITCH+1'
	DAC*	SAVADR
	JMP*	COPY
/
/THIS IS THE ENTRY POINT OF THE CLOCK INTERRUPT (API ONLY)
/
CLOCK	LAC	MKLOCK#		/THIS MARKER TELLS US WHERE
					/TO RETURN
	SMA
	JMP	CLO1		/NOT MINUS --- TRY AGAIN!
/ MKLOCK=-1 WE HAVE AN X-Y MOVE TO MAKE
/LOAD XREGST (THEN YREGST ) ADJUST POSITION IN ACC ADD CHANNEL
/      NUMBER AND SIGN THEN PUSH THRU THE D-A.
	JMS	PLOTT
	JMP*	WRITE
PLOTT	XX
	JMS*	PLOT
	JMP*	PLOTT
	XREGST
	YREGST
	KPEN
KPEN	1
/
CLO1	SZA
	JMP	CLO2			/NOT ZERO  TRY AGAIN
/MKLOCL=0 --- WE HAVE A PEN POSITION CHANGE ( UP OR DOWN ).
	LAC	PENPOS
	AND	(RB17DN		/CREATE OUTPUT WORD
	ORCS			/PUT ONTO RELAYS.
	LAW	-40
	DAC	UPDNWT
	ISZ	UPDNWT
	JMP	.-1
	JMP	PENRET
CLO2	SAD	(1		/IS IT THE INIT.
	JMP	CLO3		/YES
	SAD	(77		/IS IT THE ERROR DIAGNOSTIC
	JMP	WRTERR		/YES, GO WRITE ERROR MESSAGE
/MKLOCK=7 IT IS THE EXIT
	JMP*	COPY
	JMP	CLOCK
/MKLOCK=1 IT IS THE INITIALIZING ROUTINE
CLO3	JMP	PROCED
/
/
/
ERROR0	LAC	(201404
	SKP
ERROR2	LAC	(201444
	SKP
ERROR4	LAC	(201504
	DAC	ERR+4
/
	LAC	ADDRES
	CLL
	LRS+14
	AND	(7
	TAD	(60
	RTL
	RTL
	LLS+3
	TAD	(60
	RTL
	RTL
	TAD	(6
	DAC	ERR+6
	LLS+3
	AND	(7
	CLL
	RTL
	RTL
	LLS+3
	TAD	(60
	RTL
	RTL
	LLS+3
	TAD	(60
	RAL
	DAC	ERR+7
/MUST WAIT FOR CLOCK HERE
	LAC	(77		/FLAG FOR ERROR DIAGNOSTIC ROUTINE
	DAC	MKLOCK#
	JMP	CLOCK
/
/RETURN HERE WHEN CLOCK EXPIRES
WRTERR	DBK
	EEM
	.WRITE -3,2,ERR,10
	.WAIT	-3
	LAC	(201404	/CHECK FOR POSSIBILITY OF ERROR 0
	SAD	ERR+4
	JMP	EXIT	/IF ERROR 0, RESTART DISPLAY
	JMP	EXIT1
/
/
ERR	.ASCII	'     ERROR 1 @ 57777 '<015>'   '
/
/
/SUBROUTINE WRITE (MOVES PEN)
/
WRITE	XX
	LAC	INTENS#
	SNA
	JMS	PENUP		/PUT PEN UP IF INTENSITY = 0 .
	LAC	XREGST
	AND	(1777
	SAD	XREGST	/WAS IT LEGIT ADDRES
	SKP!CLL
	JMP	ERROR4	/NO.
	DAC	XLAST#
	LAC	YREGST
	AND	(1777
	SAD	YREGST
	SKP!CLL
	JMP	ERROR4
	DAC	YLAST#
	CLC
	DAC	MKLOCK#		/SET MARKER FOR WRITE ROUTINE.
	JMP	CLOCK
/
PENUP	XX
	DAC	SAVACC#
	LACQ
	DAC	SAVMQ#		/SAVE MQ TOO.
	LAC	PENPOS#		/0=UP, -1=DOWN
	SNA!CLA
	JMP	PENRET		/RETURN ---PEN IS UP NOW.
PENGO	DAC	PENPOS
	DZM	MKLOCK#		/SET MARKER TO PEN POSN CHANGE
	JMP	CLOCK
/
PENDWN	XX
	ISZ	.-1
	DAC	SAVACC
	LACQ
	DAC	SAVMQ
	LAC	PENDWN
	DAC	PENUP		/PENUP WILL BE USED AS THE 
					/RETURN POINTER.
	LAC	PENPOS
	SZA!CMA
	JMP	PENRET		/PEN IS NOW DOWN.
	JMP	PENGO		/GO WAIT FOR CLOCK
PENRET	LAC	SAVMQ		/RESTORE MQ
	LMQ
	LAC	SAVACC		/GET ACC 
	JMP*	PENUP
/
/PARAMETER MODE
/
PARMTR	LAC*	ADDRES
	LRS	+15
	DAC	MODE
	LACQ
	RTL
	SPA
	JMP	STOP		/STOP CODE FOUND
	LLS	+4
	DAC	SAVACC
	LLS	+3
	SMA
	JMP	SCALES
	RTL			/REQUIRES A CHANGE IN INTENSITY
	RTL
	RAL
	AND	(7
	DAC	INTENS#
SCALES	LAC	SAVACC
	SMA
	JMP	GET
	RTL			/REQUIRES A CHANGE IN SCALE
	RTL
	AND	(3
	DAC	SCALEF#
/
/CREATE SCALE=1,2,4,!8 FOR INCREMENT MODE
/
	TAD	(LLS!CLQ
	DAC	.+3
	CLA!STL
	RAL
	XX
	DAC	SCALE#
/
	JMP	GET
/
/ON STOP INTERRUPT, MAY HAVE TO CHANGE BANKS FOR NEXT PIECE OF DISPLAY
/FILE
/
STOP	RAL
	SMA
	JMP	EXIT	/NOT STOP INTERRUPT
	ISZ	ADDRES
	LAC*	ADDRES	/IF STOP INTERRUPT, CHECK FOR BANK CHANGE
	SNA
	JMP	EXIT	/NO BANK CHANGE - ERROR
	AND	(77777
	DAC	ADDRES	/GET NEW 15 BIT ADDRESS
	DZM	MODE
	JMP	CHECK
/POINT MODE
/
POINT	DAC	PRMODE	/SAVE IT.
	JMS	PENUP	/PEN IS UP WHILE MOVING IN POINT MODE.
	LAC	(DAC XREGST
	DAC	XORY
	LAC*	ADDRES
	RTL
	SZL!RTL		/IS IT VERTICLE?
	ISZ	XORY	/YES,CHANGE LOAD INST.
	RTL
	DAC	MODE
	RTL
	SZL!CLA		/IS INTENSIFY BIT ON?
	CMA		/YES SET DOTIT=-1
	DAC	DOTIT
	LAC*	ADDRES
	AND	(001777
XORY	DAC	XREGST	/ASSUMES ORDER OF(XREGST,YREGST)
	JMP	GO
/INCREMENT MODE
/
INCREM	LAC	(-4		/SET UP COUNTER
	DAC	INCNTR#
	LAC*	ADDRES		/GET WORD
	RAL
	SZL			/IS ESCAPE BIT SET?
	JMS	ESCAPE
	SPA			/IS INTENSIFY BIT SET?
	JMS	PENDWN		/YES
	JMS	PENUP		/NO
INCYCL	RTL			/MOVE X BIT TO LINK
	DAC	INTEMP#		/SAVE WORD
	SNL!RAL
	JMP	YSTART		/DO NOT MOVE X
	LAC	SCALE
	SZL			/MOVE LEFT OR RIGHT
	JMS	TWOCMA		/LEFT
	TAD	XREGST
	DAC	XREGST
YSTART	LAC	INTEMP
	RTL
	DAC	INTEMP
	SNL!RAL
	JMP	YEND
	LAC	SCALE
	SZL
	JMS	TWOCMA
	TAD	YREGST
	DAC	YREGST
YEND	JMS	WRITE
	LAC	INTEMP
	ISZ	INCNTR
	JMP	INCYCL
	CLA
	SAD	MODE		/IS MODE SET TO ZERO?
	JMP	GET-3		/YES. CHECK FOR SUBROUTINE RETURN
	ISZ	ADDRES
	JMP	INCREM
/
/CHARACTER MODE
/
CHARAT	NOP			/SET TO SHIFT IN ?
/ SET UP SCALING ROUTINE
	LAC	SCALEF		/GET SCALE=0,1,2,OR 3
	RAR			/SET LINK TO "1" BIT
	LMQ			/SAVE OTHER BIT
	LAC	(NOP
	SZL
	LAC	(CLL!RAL	/MULTIPLIES BY 2 IF "1" IS SET
	DAC	CHISCA+1
	LACQ			/RETREIVE "2" BIT
	RAR
	LAC	(NOP
	SZL
	LAC	(CLL!RAL	/MULTIPLIES BY 4 IF "2" BIT IS SET
	DAC	CHISCA+2
	DAC	CHISCA+3
/
CHICYC	LAC	(-3
	DAC	CHICNT#	/SET CHARACTER COUNTER FOR 3 PER WORD
	LAC*	ADDRES		/GET WORD, 3 CHARS.
	RTL			/ROTATE TO GET FIRST CHAR.
	RTL
	RTL
	DAC	CHISAV#		/SAVE OTHER CHARS.
	RAL
	AND	(77		/WE NOW HAVE A CHAR.
	SAD	(37		/ESCAPE
	JMP	CHIEND
	SAD	(34		/CARRAGE RETURN
	JMP	CR
	SAD	(35		/SHIFT IN
	JMP	SIN
	SAD	(36		/SHIFT OUT
	JMP	SOUT
	CLL
	RAR			/DIVIDE BY 2
	TAD	(LAC CHIPNT	/LINK_0 IF WE WANT FIRST HALF 
						/POINTER
	DAC	.+1
	XX
	DZM	MARKER	/MARKS FIRST- OR SECOND-HALF PEN MOVE
	SNL
	LRS	+11
	AND	(777
	TAD	(LAC	CHITBL-1
	DAC	.+2
NXTWRD	ISZ	.+1		/ENTER HERE TO GET 2 MORE MOVES
	XX
NXTMOV	SPA!RAL			/INTENSIFY?
	JMS	PENDWN		/YES
	JMS	PENUP
	LRSS	+16		/SIGNED SHIFT TO GET X MOVE
	SAD	(-7		/JUMP
	JMP	JUMP
	SAD	(-10		/ESCAPE
	JMP	NXTCHI
	JMS	CHISCA
/	FOR SHIFT IN		FOR SHIFT OUT
S0	NOP			/JMP	Y1
X1	TAD	XREGST
	DAC	XREGST
	NOP			/JMP	Y2
CY	LACQ			/GET Y MOVE
	LRSS	+16
	JMS	CHISCA
Y0	JMP	Y1		/CMA
	TAD	(1
	JMP	X1
Y1	TAD	YREGST
	DAC	YREGST
	NOP			/JMP	CY
/
Y2	LACQ			/SAVE MQ
	DAC	SAVEMQ
	JMS	WRITE
	LAC	MAR#KER
	CMA
	DAC	MARKER		/SET MARKER
	SMA			/HAVE DONE BOTH MOVES IF =0
	JMP	NXTWRD
	LAC	SAVEMQ#
	JMP	NXTMOV		/GO DECIFER THIS ONE
/
CR	DZM	XREGST		/CARRAGE RETURN
	JMS	WRITE
	JMP	NXTCHI
/
SIN	JMS	SHIFTN		/SHIFT IN
	JMP	NXTCHI
/
SHIFTN	XX		/SETS UP FOR HORIZONTAL CHARACTERS.
	LAC	(NOP
	DAC	S0
	DAC	CY-1
	DAC	Y2-1
	LAC	(JMP Y1
	DAC	Y0
	LAC	DZMX
	DAC	CR
	JMP*	SHIFTN
/
SOUT	LAC	(JMP Y1	/SHIFT OUT,FOR VERTICLE CHARACTERS
	DAC	S0
	LAC	(JMP Y2
	DAC	CY-1
	LAC	(CMA
	DAC	Y0
	LAC	(JMP CY
	DAC	Y2-1
	LAC	DZMY
	DAC	CR
	JMP	NXTCHI
/
CHISCA	XX			/SCALES THE MOVES
	NOP			/OR CLL!RAL IF BIT 1=1
	NOP			/OR CLL!RAL IF BIT 2=1
	NOP			/OR CLL!RAL IF BIT 2=1
	JMP*	CHISCA
/
/GO GET NEXT CHARACTER
NXTCHI	ISZ	CHICNT		/IS IT THIRD CHAR.?
	JMP	.+3		/NO
	ISZ	ADDRES		/YES,INCREMENT POINTER & GET 
	JMP	CHICYC				/A WORD.
	LAC	CHISAV		/GET REMAINING CHARACTERS
	JMP	CHICYC+3		/AND DECODE.
/
CHIEND	JMS	ESCAPE		/WE ESCAPE FROM CHARACTERS NOW.
	JMP	GET-3
/
JUMP	CLA			/A JUMP IN THE CHARACTER TABLE
	LLS	+4
POINTER=NXTMOV-1
	TAD	POINTER		/ADD Y TO POINTER
	DAC	POINTER
	DZM	MARKER		/SET MARKER=FIRST HALF
	JMP	POINTER
/
/  TABLE OF PEN MOVES FOR EACH CHARACTER
/
P0=2
P1=20
ESCP=10
JMP.=11
          .DEFINE   KL,I1,X1,Y1,I2,X2,Y2
A=X1
B=Y1
C=X2
D=Y2
          .IFNEG X1
A=20X1
          .ENDC
          .IFNEG Y1
B=20Y1
          .ENDC
          .IFNEG X2
C=20X2
          .ENDC
          .IFNEG Y2
D=20Y2
          .ENDC
          I1*P1+A*P1+B*P0+I2*P1+C*P1+D
          .ENDM
/  TABLE NOW STARTS
AA=.
CHITBL    KL        1,2,6,1,2,-6        /0        A
          KL        0,-3,+3,1,2,0       /1
          KL        0,3,-3,0,ESCP,0     /2
BB=.
          KL        0,0,+3,1,+3,0       /3        B
          KL        1,1,-1,1,0,-1       /4
          KL        0,-1,2,1,1,+1       /5
          KL        1,0,1,1,JMP.,+2     /6
DD=.
          KL        0,4,1,1,0,4         /7        D
          KL        1,-1,1,1,-3,0       /10
          KL        1,0,-6,1,3,0        /11
          KL        1,1,1,0,2,-1        /12
          KL        0,ESCP,0,0,0,0      /13
GG=.
          KL        0,3,3,1,1,0         /14       G
          KL        1,0,-2,1,JMP.,6     /15
QQ=.
          KL        0,2,2,1,+2,-2       /16       Q
          KL        0,-4,0,0,0,0        /17
O0=.
          KL        0,4,5,1,0,-4        /20       O
          KL        1,JMP.,2,0,0,0      /21
CC=.
          KL        0,4,1,1,0,0         /22       C
          KL        1,-1,-1,1,-2,0      /23
          KL        1,-1,+1,1,0,4       /24
          KL        1,1,1,1,2,0         /25
          KL        1,1,-1,0,2,-5       /26
          KL        0,ESCP,0,0,0,0      /27
EE=.
          KL        0,4,0,1,-4,0        /30       E
FF=.
          KL        1,0,6,1,4,0         /31       F
          KL        0,-4,-3,1,3,0       /32
          KL        0,3,-3,0,ESCP,0     /33
LF=.
          KL        0,0,-6,0,0,-5       /34       LINE FEED
          KL        0,ESCP,0,0,0,0      /35
SPACE=.
          KL        0,6,0,0,ESCP,0      /36       SPACE
HH=.
          KL        1,0,6,0,0,-3
          KL        1,4,0,0,0,3
          KL        1,0,-6,0,2,0
	KL	0,ESCP,0,0,0,0
TT=.
          KL        0,0,6,1,4,0
          KL        0,-4,-6,0,0,0
II=.
          KL        0,2,6,1,0,-6
          KL        0,4,0,0,ESCP,0
UU=.
          KL        0,0,6,1,0,-5
          KL        1,JMP.,2,0,0,0
JJ=.
          KL        0,0,1,1,0,0
          KL        1,1,-1,1,2,0
          KL        1,1,1,1,0,5
          KL        0,2,-6,0,ESCP,0
KK=.
          KL        1,0,6,0,4,0
          KL        1,-4,-3,1,4,-3
          KL        0,2,0,0,ESCP,0
LL=.
          KL        0,0,6,1,0,-6
          KL        1,4,0,0,2,0
          KL        0,ESCP,0,0,0,0
MM=.
          KL        1,0,6,0,4,0
          KL        1,0,-6,0,-4,0
VV=.
          KL        0,0,6,1,2,-6
	KL	1,2,6,0,2,-6
          KL        0,ESCP,0,0,0,0
NN=.
          KL        1,0,6,1,4,-6
          KL        1,0,6,0,2,-6
          KL        0,ESCP,0,0,0,0
RR=.
          KL        0,2,3,1,2,-3
          KL        0,-4,0,1,0,0
PP=.
          KL        1,0,6,1,3,0
          KL        1,1,-1,1,0,-1
          KL        1,-1,-1,1,-3,0
          KL        0,6,-3,0,ESCP,0
EIG=.
          KL        0,4,5,1,0,-1
          KL        1,-1,-1,0,-2,0
          KL        1,-1,-1,1,0,-1
          KL        1,JMP.,4,0,0,0
DOLL=.
          KL        0,2,6,1,0,-6
          KL        0,-2,1,1,JMP.,2
SS=.
          KL        0,0,1,0,0,0
          KL        1,1,-1,1,2,0
          KL        1,1,1,1,0,1
          KL        1,-1,1,1,-2,0
          KL        1,-1,1,1,0,1
          KL        1,1,1,1,2,0
          KL        1,1,-1,0,2,-5
          KL        0,ESCP,0,0,0,0
TWO=.
          KL        0,4,0,1,-4,0
          KL        1,0,1,1,3,2
          KL        1,JMP.,16,0,0,0
QUST=.
          KL        0,2,0,1,0,1
          KL        0,0,1,1,0,1
          KL        1,JMP.,12,0,0,0
NINE=.
          KL        0,0,1,1,1,-1
          KL        1,2,0,1,1,1
          KL        1,0,3,0,-4,1
          KL        1,0,-1,1,1,-1
          KL        1,2,0,1,JMP.,6
THREE=.
          KL        0,0,1,1,1,-1
          KL        1,2,0,1,1,1
          KL        1,0,1,1,-1,1
          KL        0,-1,0,1,0,0
          KL        1,1,0,1,0,0
          KL        1,1,1,1,0,1
          KL        1,-1,1,1,-2,0
          KL        1,-1,-1,0,6,-5
          KL        0,ESCP,0,0,0,0
WW=.
          KL        0,0,6,1,1,-6
          KL        1,1,6,1,1,-6
          KL        1,1,6,0,2,-6
          KL        0,ESCP,0,0,0,0
XX=.
          KL        1,4,6,0,-4,0
          KL        1,4,-6,0,2,0
          KL        0,ESCP,0,0,0,0
YY=.
          KL        0,0,6,1,2,-3
          KL        1,2,3,0,-2,-3
          KL        1,0,-3,0,4,0
          KL        0,ESCP,0,0,0,0
ZZ=.
          KL        0,4,0,1,-4,0
SEV=.
          KL        1,4,6,1,-4,0
          KL        0,6,-6,0,ESCP,0
ONE=.
          KL        0,1,0,1,2,0
          KL        0,-1,0,1,0,6
          KL        1,-1,-1,0,5,-5
          KL        0,ESCP,0,0,0,0
FOUR=.
          KL        0,3,0,1,0,6
          KL        1,-3,-4,1,4,0
          KL        0,2,-2,0,ESCP,0
FIVE=.
          KL        0,4,6,1,-4,0
          KL        1,0,-3,1,JMP.,4
SIX=.
          KL        0,0,1,1,0,4
          KL        1,1,1,1,2,0
          KL        1,1,-1,0,-4,-2
          KL        1,1,1,1,2,0
          KL        1,1,-1,1,0,-2
          KL        1,-1,-1,1,-2,0
          KL        1,-1,1,0,6,-1
          KL        0,ESCP,0,0,0,0
STAR=.
          KL        0,0,1,1,4,4
          KL        0,0,-4,1,-4,4
          KL        0,0,-5,0,0,0
PLUS=.
          KL        0,2,1,1,0,4
          KL        0,-2,-5,0,0,0
MINUS=.
          KL        0,0,3,1,4,0
          KL        0,2,-3,0,ESCP,0
SLASH=.
          KL        1,4,6,0,2,-6
          KL        0,ESCP,0,0,0,0
PERC=.
          KL        1,4,6,1,-4,0
          KL        1,0,-1,1,1,0
          KL        1,0,1,0,3,-6
          KL        1,0,1,1,-1,0
          KL        1,0,-1,1,1,0
          KL        0,2,0,0,ESCP,0
OR=.
          KL        0,2,6,1,0,-4
          KL        0,0,-1,1,0,-1
          KL        0,4,0,0,ESCP,0
NUMB=.
          KL        0,1,1,1,0,4
          KL        0,2,0,1,0,-4
          KL        0,-3,-1,0,0,0
EQ=.
          KL        0,0,2,1,4,0
          KL        0,0,2,1,-4,0
          KL        0,6,-4,0,ESCP,0
OPEN=.
          KL        0,3,0,1,-2,2
          KL        1,0,2,1,2,2
          KL        0,3,-6,0,ESCP,0
CLOSE=.
          KL        0,1,0,1,2,2
          KL        1,0,2,1,-2,2
          KL        0,5,-6,0,ESCP,0
LT=.
          KL        0,4,0,1,-3,3
          KL        1,3,3,0,2,-6
          KL        0,ESCP,0,0,0,0
GT=.
          KL        1,3,3,1,-3,3
          KL        0,6,-6,0,ESCP,0
QUOTE=.
          KL        0,1,6,1,0,-1
          KL        0,2,1,1,0,-1
          KL        0,3,-5,0,ESCP,0
COMMA=.
          KL        0,2,1,1,0,-1
          KL        0,-2,0,0,JMP.,6
SEMI=.
          KL        0,2,1,1,0,-1
          KL        0,-2,0,0,0,0
COLON=.
          KL        0,2,4,1,0,1
          KL        1,-1,0,1,0,-1
          KL        1,1,0,0,-2,-4
PER=.
          KL        0,2,1,1,0,1
          KL        1,-1,0,1,0,-1
          KL        1,1,0,0,4,-1
          KL        0,ESCP,0,0,0,0	`-ANDS=.
ANDS=.
          KL        0,4,0,1,-4,5
          KL        1,1,1,1,1,0
          KL        1,1,-1,1,-3,-3
          KL        1,0,-1,1,1,-1
	KL	1,3,3,0,2,-3
	KL	0,ESCP,0,0,0,0
AT=.
          KL        0,3,1,1,-1,-1
          KL        1,-1,0,1,-1,1
          KL        1,0,3,1,1,1
          KL        1,1,0,1,1,-1
          KL        1,0,-2,1,-2,0
          KL        1,0,1,1,1,0
          KL        1,0,-1,0,4,-2
          KL        0,ESCP,0,0,0,0
APOST=.
          KL        0,2,4,1,0,2
          KL        1,-1,0,1,0,-1
          KL        1,1,0,0,4,-5
          KL        0,ESCP,0,0,0,0
PF=1000
          .DEFINE   NM,ONE,TWO
          ONE-CHITBL*PF+TWO-CHITBL
          .ENDM
/
/  POINTER TABLE
/
CHIPNT    NM        AT,AA               /@,A
          NM        BB,CC               /B,C
          NM        DD,EE               /D,E
          NM        FF,GG               /F,G
          NM        HH,II               /H,I
          NM        JJ,KK               /J,K
          NM        LL,MM               /L,M
          NM        NN,O0               /N,O
          NM        PP,QQ               /P,Q
          NM        RR,SS               /R,S
          NM        TT,UU               /T,U
          NM        VV,WW               /V,W
          NM        XX,YY               /X,Y
          NM        ZZ,LF               /Z,LF
          0                             /CR SI
          0                             /S0 ES
          NM        SPACE,OR            / ,!
          NM        QUOTE,NUMB          /",#
          NM        DOLL,PERC           /$,%
          NM        ANDS,APOST           /&,'
          NM        OPEN,CLOSE          /(,)
          NM        STAR,PLUS           /*,+
          NM        COMMA,MINUS         /,,-
          NM        PER,SLASH           /.,/
          NM        O0,ONE              /0,1
          NM        TWO,THREE           /2,3
          NM        FOUR,FIVE           /4,5
          NM        SIX,SEV             /6,7
          NM        EIG,NINE            /8,9
          NM        COLON,SEMI          /:,;
          NM        LT,EQ               /<,=
          NM        GT,QUST             />,?
/
/
/
/ PATCH FOR VECTOR CONTINUE
/
VECT1	JMS	ESCAPE
	JMP	GET
/
/THAT IS ALL
/
/VECTOR MODE
/
VECTOR	LAC*	ADDRES
	DAC	DELTAX#
	RAL
	SZL!RAL		/SKIP IF NO ESCAPE BIT.
	JMS	ESCAPE
	SZL		/TEST FOR INT. BIT AND EXECUTE.
	JMS	PENDWN	/THIS OR
	JMS	PENUP	/THIS.
	DZM	SNDY#	 /SET SIGN DELTA Y + (ARBITRARY)
	SPA!RAL		/IF SIGN = 1
	ISZ	SNDY	/SET NEGATIVE.
	LMQ
	LLS	+7
	AND	(000177
	DAC	DELTAY#
	LACQ
	RAL		/SIGN DELTAX TO LINK
	LAC	SCALEF		/GET SCALE FACTOR (0-3)
	TAD	(LLS!CLQ
	DAC	SCINST
	LAC	DELTAX	/MODIFY DELTA X AND Y BY SCALE FACTOR.
	AND	(177	/DELETE GARBAGE
	XCT	SCINST
	SZL
	JMS	TWOCMA
	TAD	XREGST
	DAC	XREGST
	LAC	SNDY
	RAR
	LAC	DELTAY
SCINST	LLS
	SZL
	JMS	TWOCMA
	TAD	YREGST
	DAC	YREGST
	JMP	GO
TWOCMA	XX
	CMA
	TAD	(1
	JMP*	TWOCMA
/
/SUBROUTINE MODE
/
SUBROT	LAC*	ADDRES
	LRS	+15
	DAC	MODE
	LAC*	ADDRES
	AND	(17777
	DAC	TADDRS#
	LAC	ADDRES
	AND	(60000	/GET BANK BITS
	XOR	TADDRS	/MAKE CORRECT 15 BIT ADDRESS
	DAC	TADDRS
	LAC*	ADDRES
	RAL
	SNL!RAL		/CHECK FIRST BIT OF OPCODE.
	JMP	DDS	/OPCOD 0 - INDICATES DDS.
	SNL
	JMP	DJPCOD	   /OPCD 10 = DJP
DJS	ISZ	ADDRES	/OPCD 11, INCREMENT RETURN ADDRESS.
	LAC	(1
	DAC	SAVE	/ENTER SUBROUTINE MODE.
	LAC	ADDRES
	AND	(17777	/ASR IS ONLY 13 BITS
	DAC	ASR	/SAVE RETURN ADDRESS
	LAC	TADDRS
	DAC	ADDRES	/ADDRESS OF NEXT WORD
	JMP	CHECK
DJPCOD	LAC	TADDRS	  /OPCODE=10
	DAC	ADDRES	/ADDRESS OF NEXT WORD.
	JMP	CHECK
DDS	SNL
	JMP	ERROR2	/OPCODE =00 IS ILLEGAL
	DZM	SAVE		/CLEAR SUBROUTINE INDICATOR
	LAC	(DJP	    /OPCODE=01, FORM RETURN.
	XOR	ASR	/JUMP	INSTRUCTION
	DAC*	TADDRS	/STORE RETURN JMP
	JMP	GET
/
/ESCAPE - MARKS RETURN JUMP FROM DISPLAY SUBROUTINES
/
ESCAPE	XX
	DZM	MODE	/SET MODE TO PARAMETER
	DAC	SAVACC
	LAC	SAVE
	SZA
	ISZ	SAVE
	LAC	SAVACC
	JMP*	ESCAPE
XREGST	0
YREGST	0
	.END
