/INCREMENTAL PLOT ROUTINES FOR UWF-V4E		-JVZ-
/ 16MPLT.PA

/ THIS REVISION CONTAINS THE LOWER CASE SYMBOLS AND THE
/'BACKSPACE' COMMAND SUGGESTED BY STEVE L. GILLETTE.  I
/ HAVE ALSO IMPLEMENTED 'HALFSIZE' CHARACTERS.

/ RUNS .01 INCH PLOTTER AS IS
/ DEFINE 'FIVMIL' TO ASSEMBLE FOR THE '5 MIL' PLOTTER.
/ DEFINE 'METRIC' TO ASSEMBLE FOR A  'METRIC' PLOTTER.

/ BSLASH.PA OVRLAYS THIS PGM TO PLOT LOWERCASE CHARS
/  FROM AN UPPER CASE KEYBOARD
/	

/MULTIPLY ROUTINE FOR EAE HARDWARE (SEE PAGE 12)
/
/MULT,	0
/	AND N7		/MASK LOW ORDER DIGIT
/	MQL MUY		/MULTIPLY BY SIZE
/S1ZE,	0
/	SWP		/PUT RESULT IN AC
/	CLL RAR
/	JMP I MULT
/	ZBLOCK 4	/FOR STANDARD ROUTINE
/SYSTEM SYMBOLS:

	CDI=6203
	PLSF=6501
	PLCF=6502
	PLPU=6504
	PLPR=6511
	PLDU=6512
	PLDD=6514
	PLPL=6521
	PLUD=6522
	PLPD=6524
FIXMRI	FMUL=4000
	FIXTAB

/FOCAL SYMBOLS:

	AXIN=16
	C=00
	COMGO=722
	EVAL=1610
	EXIT=31
	EXP=44
	FENT=4407
	FGETIPT1=0400
	FMULIPT1=4400
	FPUTIPT1=6400
	FEXT=0000
	FIXIT=4560
	FLOAT=4552
	GS1=1434
	K77=7
	M4=105
	OBLK=5700
	P=10
	PT1=62
	P177=75
	PUSHJ=4522
	SBLK=236
	SINBLK=111
	THISOP=63
	TSTCMA=4543
	UINT=3112
/THIS TRAPS THE 'OPEN OUTPUT PLOT:' COMMAND:

	FIELD 0

	*SINBLK+2
	4201		/MOVE THE 'SIN' HANDLER

	*SBLK-1
	2200		/AND THE BUFFER, TOO

	*3177		/RESET THE STACK LIMIT
	2600

	*OBLK-1
	5200		/MOVE THE OUTPUT BUFFER

	*CDF
	LABEL		/ADD THE ENTRY POINT
DEVICE	PLTR		/AND THE NAME

	FIELD 1

	*COMGO+"P-"@
	PLOTXY		/ADD THE 'PLOT' ENTRY POINT

	*UINT
	CIF C		/ADD PLOTTER TO THE SKIP CHAIN
	JMP I .+1
	PINT

	PAGE 15

LABEL,	0		/OUTPUT TO THE PLOTTER
	AND P177	/IGNORE PARITY
	SNA
	JMP I LABEL	/AND NULL CHARS
	CDI C
	TAD (-15
	SNA
	JMP I (PCR	/RETURN THE PEN
	TAD (3
	SZA
	JMP I (PLC	/CHECK FOR OTHERS
	JMP I (PLF	/DROP DOWN A LINE
/PARAMETER PASSING & ROTATION CHECKS FOR THE 'PLOT' COMMAND

PLOTXY,	TAD LABEL	/ARE WE WHERE WE THINK WE ARE?
	SNA CLA
	JMP .+3		/NO NEED TO RETURN THE PEN
	CDI C
	JMS I (LTAD	/RETURN TO THE LAST PLOT POSITION
	TAD M4		/INITIALIZE ARGUMENT LOOP
	DCA LABEL	/CLEAR THE FLAG
	TAD (X-1
	DCA AXIN
	IAC
	FLOAT		/SET UP 1.00
	TAD (4406	/'$F'
	JMS LOOKUP
	TAD PT1
	DCA LOOKUP	/SAVE POINTER
	JMP .+4

PLOOP,	CDF P
	TSTCMA		/STILL ANOTHER ARGUMENT?
	JMP NOSCAL+1	/NO
	PUSHJ		/EVALUATE IT
	    EVAL
	STL RTL
	TAD LABEL
	SMA CLA		/X OR Y?
	JMP NOSCAL	/DON'T SCALE L OR M
	TAD LOOKUP
	DCA PT1		/RESET VARIABLE POINTER
	FENT
	FMULIPT1	/TIMES USER FACTOR
	FMUL SCALE	/SCALE UP TO INCHES
	FEXT
NOSCAL,	FIXIT		/CONVERT TO AN INTEGER
	CDF C
	DCA I AXIN	/STORE IT AWAY
	ISZ LABEL	/GOT ALL FOUR?
	JMP PLOOP	/NO, GO BACK FOR MORE

	TAD (SYMTAB-1	/INITIALIZE INDEX REGISTER AGAIN
	DCA AXIN
	STL RTL		/$R=2
	JMS GETR	/BRING IN THE ROTATION PARAMETERS
	DCA I LOOKUP
	STL RTL		/$S=2
	JMS GETR
	RAL
	DCA I LOOKUP
	STL RTL		/$D=2
	JMS GETR
	TAD M2		/NEED TO OFFSET THE DIRECTION BY 2
	DCA I LOOKUP	/SINCE THE LETTERS ARE CODED FOR D=2
	CIF C
	JMP I (XPLT
GETR,	0		/BRING IN THE ROTATION PARAMETERS
	CDF P
	FLOAT		/SET UP THE DEFAULT VALUE
	TAD I AXIN	/WHICH VARIABLE?
	JMS LOOKUP
	TAD I AXIN	/WHICH LOCATION?
	DCA LOOKUP
	FENT
	FGETIPT1	/CROSS-FIELD VARIABLE FETCH
	FEXT
	ISZ EXP		/X2
	FIXIT
	RAR		//2
	CDF C		/PREPARE TO STORE INTEGER VALUE
	JMP I GETR

LOOKUP,	0		/FIND A VARIABLE IN THE TABLE
	DCA THISOP	/SAVE THE NAME
	PUSHJ		/THE SUBSCRIPT WILL BE ZERO
	    GS1
	SZL		/ALREADY THERE?
	JMP I LOOKUP	/YES
	FENT		/NO
M2,	-2		/= NORMALIZE FLAC &
	FPUTIPT1	/SAVE DEFAULT VALUE
	FEXT
	JMP I LOOKUP

SYMTAB,	4422		/$R
	PDIR
	4423		/$S
	S1ZE
	4404		/$D
	LDIR

SCALE,
IFDEF	METRIC	<6;2400;0;0> / 40.0 CONVERTS TO CM
IFNDEF	METRIC	<7;3100;0;0> /100.0 CONVERTS TO IN

	PAGE
/PDP 8 PLOTTING ROUTINE USING THE OLD STYLE INTERRUPT (JVZ)

/CALLING SEQUENCE:
/	PLOT    = JMS I (PL0T)
/	X	X COORDINATE
/	Y	Y COORDINATE
/THIS VERSION SKIPS THE NEXT TWO WORDS

/C(AC) DETERMINES POSITION OF THE PEN:

/  C(AC)= -1  PEN UP; POSITION AT END OF MOTION SET TO 0,0
/  C(AC)=  0  PEN UP (ZERO MEANS "NO LINE")
/  C(AC)=  1  PEN DOWN
/  C(AC)=  2...  RESERVED FOR DOTTED AND DASHED LINES, ETC.

/COORDINATES ARE EXPRESSED IN TERMS OF PLOTTER UNITS: 0.01"
/THUS MAXIMUM MOTION IS +20.47" AND -20.47" FROM THE ORIGIN
/IN FACT THE MAXIMUM DIFFERENCE BETWEEN TWO POINTS IS ALSO
/RESTRICTED TO +20.47" OR -20.47" SO THAT IN SOME CASES TWO
/CALLS MAY BE REQUIRED TO REACH A POINT.

/THIS VERSION PERMITS ROTATING THE AXES IN 45 DEGREE INCRE-
/MENTS. THIS FEATURE IS USEFUL FOR PLACING THE X AXIS ALONG
/THE CARRIAGE (ROTATION BY 2) AND IS ALSO USED BY THE LABEL
/ROUTINE.  PLOTTING DONE WITH A ROTATION OF AN ODD MULTIPLE
/OF 45 DEGREES WILL BE "STRETCHED" UNIFORMLY BY THE SQRT(2)
/DUE TO THE NATURE OF THE PLOTTER MOTIONS.

	FIELD 0
	PAGE  5
PDIR,	0		/PLOT ROTATION
LDIR,	0		/LABEL DIRECTION
TDIR,	0
PL07,	7		/MASK
PLOP,	PLD0
PLD0,	PLPL		/PLOTTER OPERATION TABLE
PLD1,	JMS I PLD8
PLD2,	PLDD
PLD3,	PLPR PLDD
PLD4,	PLPR
PLD5,	PLPR PLDU
PLD6,	PLDU
PLD7,	PLPL PLUD
PLD8,	PLD9		/FOR MARK'S CONVENIENCE
PLPO,	PEN		/PEN CONTROL ROUTINE
PWGT,	WAIT		/QUEUE CONTROL

ROTATE,	0		/ROTATE IN 45 DEGREE STEPS
	TAD PDIR	/ADD PLOT ROTATION (0-7)
	TAD TDIR	/AND LABEL ROTATION (IF ANY)
	AND PL07	/MODULO EIGHT
	TAD PLOP	/ADD CODE FOR PLD0
	DCA PLD9	/SAVE TABLE ADDRESS
	TAD I PLD9	/GET INSTRUCTION
	JMP I ROTATE	/AND RETURN
PL0T,	0
	JMS I PWGT	/WAIT FOR PREVIOUS MOTION
	SPA		/TEST FOR NEGATIVE LINE VALUE
	DCA DIAG	/CLEAR AC AND SAVE -1
	JMS I PLPO	/CHECK & SET PEN POSITION

	JMS DXY		/GET X, COMPARE WITH OLD VALUE
LX,	0		/LAST X VALUE
	DCA DX		/STORE ABSOLUTE X MOTION
	JMS DXY		/GET Y, COMPARE WITH OLD VALUE
LY,	0		/LAST Y VALUE
	STL CIA		/NEGATE DY
	TAD DX		/AC=DX-DY
	SZL CLA		/LINK=0 IF DX>DY
	JMP DYGTDX

DXGTDY,	TAD DX		/EXCHANGE DY AND DX
	DCA DXY
	TAD DY
	DCA DX
	TAD DXY
	DCA DY
	IAC		/SET BIT 10 (SIGN OF X)

DYGTDX,	IAC		/SET BIT 11 (SIGN OF Y)
	AND DIAG	/CHECK FOR NEGATIVE VALUES
	SNL		/SKIP IF DY>DX
	RAR		/SIGN OF X -> BIT 11; LINK=0
	CML RTL		/BIT 11 + LINK = DIRECTION/4
	JMS ROTATE	/ADD ROTATION
	DCA AXIS	/STORE IN AXIS INSTRUCTION

	TAD DIAG	/CHECK ON SIGNS AGAIN
	RTR
	SZL		/MODIFY SIGNS TO REFLECT
	CMA		/PLOTTER DIRECTIONS
	RTL
	STL RAL		/2*RESULT+1 = DIRECTION
	JMS ROTATE	/ADD ROTATION
	DCA DIAG	/STORE IN DIAGONAL INSTRUCTION

STRCH,	IAC		/FIND OUT IF ROTATION
	AND PLD9	/IS EVEN OR ODD
	SNA CLA		/TABLE AT ODD ADDRESS
	JMP SETUP	/EVEN: CONTINUE
	TAD DX		/ODD: ADJUST RATIO
	TAD DY
	DCA DY
	TAD DX		/DOUBLE DIAGONAL STEPS
SETUP,	TAD DX		/DX IS MINOR MOTION
	CIA		/NEGATE FOR EASY SUBTRACTION
	DCA DX
	TAD DY		/DY IS MAJOR MOTION
IFDEF	FIVMIL	<CMA STL RAL>
IFNDEF	FIVMIL	<CMA>	/TIMES TWO FOR 5 MIL MODEL
	DCA DXY		/SAVE THE STEP COUNTER
	TAD DY
	CLL RAR		/OFFSET QUOTIENT BY HALF
	DCA ROTATE
	ION		/INTERRUPTS ARE OK NOW
	ISZ PL0T
	ISZ PL0T
	JMP I PL0T	/SKIP TWO WORDS AND RETURN

PLD9,	0		/PLACED HERE TO RESERVE SPACE
	PLPL		/FOR THE XY8E VERSION
	PLDD
	JMP I PLD9

LOOP,	TAD ROTATE	/GET THE RUNNING SUM
	TAD DX		/SUBTRACT DIAGONAL INCREMENT
	SMA		/TEST IF DIAG MOTION REQUIRED
	JMP AXIS	/NO
	TAD DY		/YES: RESTORE AXIS INCREMENT
DIAG,	0		/COMBINED MOTION (X + Y)
	SKP
AXIS,	0		/SINGLE MOTION (X OR Y)
	DCA ROTATE	/SAVE THE RUNNING SUM
PINT,	PLSF		/IS IT THE PLOTTER?
	JMP PXIT	/NO
	PLCF
	TAD DXY		/CHECK COUNTER
	SNA CLA
	JMP PXIT	/FALSE ALARM
	ISZ DXY		/COUNT THE STEPS
	JMP LOOP
PXIT,	CIF P		/RETURN TO SKIP CHAIN
	JMP I .+1
	UINT+3

DX,	0		/ABSOLUTE VALUE OF X MOTION
DY,	0		/ABSOLUTE VALUE OF Y MOTION
DXY,	0
	TAD I DXY	/GET LAST X OR LAST Y
	CIA		/NEGATE
	TAD I PL0T	/AC=NEW-OLD
	CLL		/SET LINK FOR POSITIVE SIGN
	SPA		/TEST FOR SIGN
	CML CIA		/REMEMBER SIGN & NEGATE
	DCA DY		/STORE ABSOLUTE Y MOTION
	TAD DIAG
	RAL		/SAVE MINUS SIGN
	DCA DIAG
	SNL		/CHECK FOR NEW ORIGIN
	TAD I PL0T	/GET NEW VALUE
	DCA I DXY	/REPLACE PREVIOUS ONE
	TAD DY		/SET AC FOR NEXT OPERATION
	ISZ PL0T	/SET NEXT ADDRESS 
	ISZ DXY		/SET RETURN ADDRESS
	JMP I DXY	/RETURN
/THIS ROUTINE DRAWS ANY ASCII SYMBOL ON THE PLOTTER.
/IN ADDITION TO THE 96 ASCII SYMBOLS, THE CODES FOR
/CR, LF AND BS ARE RECOGNIZED AND USED TO SIMULATE
/THOSE FUNCTIONS.  SYMBOLS ARE BASED ON A 6 X 7 GRID
/OF WHICH ONLY 4 X 6 IS USED.  SIZE 2 CHARACTERS ARE
/THUS .08" X .12" WITH .04" BETWEEN THEM.  LF MOVES
/0.1" X SIZE BELOW THE PRESENT LINE, BUT ONLY WORKS
/UNTIL THE NEXT 'PLOT' COMMAND MOVES THE PEN.

F1NAL,	TAD LDIR	/GET LABEL DIRECTION
	DCA TDIR
	TAD LX		/SAVE CURRENT POSITION
/	PAGE BOUNDARY
	DCA SX
	TAD SX		/"S" MEANS STARTING
	DCA RX		/"R" MEANS RUNNING
	TAD I YL
	DCA SY
	TAD SY
	DCA RY
	JMP EXIT	/RETURN FROM 'PLOT' COMMAND
R6,	R6R
YL,	LY

M0VE,	0		/ROUTINE TO CALL PLOT
	TAD RY		/ADD STARTING VALUE TO AC
	DCA IY		/TO GET NEXT Y POSITION
	TAD RX		/GET START OF THIS LETTER
	TAD IX		/ADD IN X INCREMENT
	DCA IX		/TO GET NEXT X POSITION
	TAD I LN	/GET THE LINE VALUE
	PLOT		/CALL PLOT TO MOVE THE PEN
IX,	0		/X COORDINATE
IY,	0		/Y COORDINATE
RX,	0		/THESE TWO ARE SKIPPED
RY,	0
	JMP I M0VE

LTAD,	0
	PLOT		/RETURN TO THE BEGINNING
SX,	0
SY,	0
N26,	212-240		/CHANGE THESE VALUES IF YOU
TBAD,	SPACE		/EXPAND THE CHARACTER TABLE
	CDI P
	JMP I LTAD	/AND RETURN TO FOCAL

ZER0,	TAD I LTAD	/LOOK AT THIS WORD
	ISZ LTAD	/POINT TO NEXT ONE
	CMA
N7,	AND K77
	SNA CLA		/DOES IT END IN 77 ?
HALF,	ISZ I LN	/YES: FOUND IT ?
	JMP ZER0	/NO:  KEEP GOING
ONE,	TAD I LTAD	/GET FIRST MOVE
	JMS I R6	/'BSW'
	JMS TWO
	TAD I LTAD	/GET SECOND MOVE
	JMS TWO
	ISZ LTAD	/ADVANCE TO NEXT WORD
	JMP ONE		/CONTINUE

TWO,	0
	AND K77		/GET RID OF THE OTHER PIECE
	DCA M0VE	/AND SAVE MOVE
	STL RTL		/=2 - TRICKY WAY TO GET -76
	TAD THREE	/THIS INSTRUCTION ADDS 7700
	TAD M0VE	/ADD -76 TO MOVE
	SMA SZA		/TEST FOR 77 = END
	JMP SIX		/MOVE TO POSITION (5,0)
	SNA		/CHECK FOR PEN UP
	JMP FOUR	/76 MEANS RAISE THE PEN
	IAC
THREE,	SMA CLA		/TEST FOR 75 (INST=7700)
	JMP FIVE	/75 MEANS REVERSE NEXT Y

	TAD M0VE	/GET X MOTION
	RAR
	RTR
	JMS MULT	/MULTIPLY BY SIZE
	DCA IX		/"I" MEANS "INCREMENTAL"
	TAD M0VE	/GET Y MOTION
	JMS MULT
	ISZ I NY	/CHECK DESCENDER SWITCH
	SKP		/NOTE: 'PLOT' RESETS IT
	CIA
	JMS M0VE	/"IY" IS IN AC
	IAC
FOUR,	DCA I LN	/SET THE PEN DOWN
	JMP I TWO	/GET NEXT BYTE

FIVE,	CMA		/SET THE DESCENDER SWITCH
	DCA I NY
	JMP I TWO

SIX,	STA CLL RAL	/-2 EQUALS WIDTH OF LETTER
	JMS MULT	/TIMES SIZE
	DCA IX		/STORE MOTION AND SET IY=0
	DCA I LN	/MOVE WITH THE PEN UP
	JMS M0VE	/"IY"=0
	TAD IX
	DCA RX		/UPDATE CURRENT X VALUE
	JMP SEVEN	/END OF THIS LETTER
PBS,	STA CLL RAL	/-2 IS THE SAME AS 6
	JMS MULT	/TIMES SIZE
	CIA		/MOVE BACK A LETTER
	JMP SIX+2	/CLEAR IX,IY(=AC), AND LN

PCR,	TAD SX		/GET STARTING VALUE
	DCA RX		/AND RESET RX
	JMP SIX+2

PLF,	DCA IX		/SET IX TO ZERO
	CMA CLL RTL	/-3=5
	JMS MULT	/5*SIZE
	RAL		/TIMES 2
	CIA		/AND NEGATE
	JMS M0VE	/TO (RX,-10*SIZE)
	TAD IY
	DCA RY		/UPDATE RY

PLC,	SPA		/ASCII-LF IN THE AC
	JMP PBS		/ANYTHING < LF = BS
	CLL
	TAD N26		/TEST FOR CONTROL CODES
	CMA
	DCA I LN	/SAVE THE LETTER COUNT
	TAD TBAD	/LOAD STARTING ADDRESS
	DCA LTAD	/INTO SEARCH ADDRESS
	SZL		/CHECK FOR CONTROL CHARS
	JMP HALF	/AND GO SEARCH

SEVEN,	CDI P		/EXIT FROM 'LABEL'
	JMP I .+1
	LABEL+3

MULT,	0
	AND N7		/MASK LOW ORDER DIGIT
	CMA		/EQUALS -(MOVE+1)
	DCA IY		/STORE IN STEP COUNTER
	SKP		/IN CASE MLPR=0
	TAD S1ZE	/ADD MCND UNTIL
	ISZ IY		/MLPR RUNS OUT
	JMP .-2
	CLL RAR
	JMP I MULT
S1ZE,	0		/THIS IS 2X THE LETTER SIZE

PLOT=	JMS I .		/THIS RESETS THE
NY,	PL0T		/DESCENDER SWITCH

TD,	TDIR		/FOR XPLT
LN,	M-1		/PEN POSITION
/PDP 8 CALCOMP ROUTINE:  MARK

/THIS ROUTINE DRAWS A SPECIFIED MARK CENTERED AT THE
/CURRENT PLOTTER POSITION.  MARK 0 IS A NULL AND NO
/ACTION OCCURS.  SPECIFYING A NON-EXISTENT MARK WILL
/CAUSE A SIMILAR EXIT.

/MARKS ARE CODED AT THE END OF THE PROGRAM ACCORDING
/TO THE FOLLOWING PLAN:  RDRD,RDRD,... WHERE R =
/REPETITION NUMBER (0-7) AND D = PLOTTER DIRECTION
/(0-7).  DIRECTIONS ARE COMPUTED RELATIVE TO ANY RO-
/TATION SPECIFIED BY PLOT. THIS PERMITS MARKS WITHOUT
/C/8 SYMMETRY TO FOLLOW ROTATIONS OF THE AXES.
/RD = 00/01 SPECIFIES PEN UP/DOWN AND RD = 07 OR 0707
/SIGNIFIES THE END OF A MARK.  THE CODE 0706 FOLLOWS 
/THE LAST MARK.  THE TABLE MAY BE CHANGED AS DESIRED.


XPLT,	DCA I TD	/ENTRY FROM PLOT CALL
	TAD I LN	/CLEAR TDIR & GET L

	PLOT
X,	0		/CALLING PARAMETERS
Y,	0		/ARE STORED HERE IN
	0		/SEQUENCE
M,	0

MARK,	TAD M		/GET MARK NUMBER
	SPA SNA		/TEST FOR MARK >0
	JMP I D0NE	/ZERO = NONE
	CIA		/NEGATE
	DCA ZWEI	/STORE IN MARK COUNTER
	TAD TABL	/GET START OF MARK TABLE
	DCA MKAD
	JMP HALB

D0NE,	F1NAL
MRK1,	PLD9		/FOR DIRECTION 1
TABL,	D0T		/FIRST MARK
M7,	-7

NULL,	IAC		/TEST FOR END OF TABLE
	SNA CLA
	JMP I D0NE	/NON-EXISTENT MARK
	TAD I MKAD	/LOOK AT THIS WORD
	ISZ MKAD	/AND POINT TO NEXT
	AND K77		/ONLY KEEP LOWER BYTE
	TAD M7
	SNA 		/END OF THIS MARK ?
HALB,	ISZ ZWEI	/HAVE WE FOUND IT ?
	JMP NULL	/NO
	JMS WAIT	/PROTECT PLOT ORIGIN
EINS,	TAD I MKAD	/GET FIRST MOTION
	JMS R6R		/'BSW' ON AN 8/E
	JMS ZWEI
	TAD I MKAD	/GET SECOND MOTION
	JMS ZWEI
	ISZ MKAD	/ADVANCE
	JMP EINS	/CONTINUE
MKAD=	M

ZWEI,	0
	AND K77		/GET RID OF THE OTHER PIECE
	DCA X		/TEMPORARY STORAGE
	TAD M7
	TAD X		/NOW LOOK AT CODE
	SNA		/TEST FOR END OF MARK
	JMP I D0NE	/RETURN WITH AC=0
	SMA CLA		/TEST FOR PEN MOTION
	JMP DREI	/EXECUTE XY MOTION
	TAD X		/GET PEN CODE
	JMS PEN		/MOVE PEN IF NECESSARY
	JMP I ZWEI	/DO NEXT OPERATION

DREI,	STL RTL		/COMPENSATE FOR OFFSET
	TAD X		/GET DIRECTION
	TAD I MDIR	/ADD ROTATION
	JMS I PLTR	/FORMULATE AND
	DCA VIER+3	/SAVE INSTRUCTION
	TAD I MRK1	/CHECK ROTATION
	AND X		/FOR ODDNESS
	CMA RAR		/SAVE -(BIT 11)
	CLA CMA
	AND X		/GET REPETITION
	AND .+1		/STRIP BITS 6-8
	SZL SNA		/SAME AS SZL BUT CODE XX70
	CLL RAR		/SKIP = EFFECTIVE X2
IFDEF	FIVMIL	<RAR>	/ANOTHER FACTOR OF 2
IFNDEF	FIVMIL	<RTR>	/FOR THE 5 MIL MODEL
	CIA		/NEGATE
	DCA X

VIER,	PLSF		/WAIT FOR THE PLOTTER
	JMP .-1
	PLCF
	0		/PLOTTER INSTRUCTION
	CLA		/FOR 'XY8E'
	ISZ X		/TEST LOOP COUNT
	JMP VIER	/KEEP GOING
	JMP I ZWEI	/GET NEXT BYTE

MDIR,	LDIR		/MARK ROTATION
PLTR,	ROTATE
PEN,	0		/CHECK PEN POSITION
	CLL RTL		/AC=0->PEN UP; AC=1->DOWN
	STL RTL		/SHIFT BIT INTO PLACE
	TAD PNOP-1	/ADD CODE FOR PEN UP
	STL CIA		/NEGATE
	TAD PNOP	/OLD - NEW
	SZA		/OLD = NEW ?
	CIA		/NEW - OLD
	TAD PNOP	/NEW
	DCA PNOP
	TAD I MOTN	/IS THE FLAG ACTIVE?
	SNA CLA
	JMP PNOP	/NO, MOVE THE PEN TO SET IT
	SNL		/NEW PEN POSITION?
	JMP I PEN	/NO
	PLSF		/ALLOW PLOTTER TO FINISH
	JMP .-1
	PLCF
PNOP,	PLPD		/PUT PEN UP INITIALLY
	JMP I PEN

WAIT,	0		/QUEUE CONTROL
	DCA PEN		/SAVE THE AC
	ION
	TAD I MOTN	/MOTION COUNTER
	SZA		/ARE WE DONE?
	IAC
	SZA CLA		/OR ALMOST DONE?
	JMP .-5		/NO
	IOF
	DCA I PSGN	/CLEAR THE SIGN REGISTER
	TAD PEN		/RESTORE THE AC
	JMP I WAIT
MOTN,	DXY		/MOTION COUNTER
PSGN,	DIAG

R6R,	0		/IMPLEMENT 'BSW'
	RTR
	RTR
	RTR
	JMP I R6R


/NEXT COME THE MARKS:
D0T,	0110		/MARK NUMBER 1
	1315
	1016
	2216
	1015
	1310
	0007
BAR,	0152		/MARK NUMBER 2
	5656
	5207
TICK,	0150		/MARK NUMBER 3
	5054
	5407
PMARK,	0142		/MARK NUMBER 4
	4646
	4244
	4040
	4407
XMARK,	0131		/MARK NUMBER 5
	6531
	3367
	3307
CIRCLE,	0025		/MARK NUMBER 6
	0117
	2021
	2223
	2425
	2617
	0021
	0707
SCIRCL,	0125		/MARK NUMBER 7
	1720
	2122
	2324
	2526
	1730
	1122
	1324
	1526
	3022
	2416
	1007
TRIANG,	0021		/MARK NUMBER 8
	0113
	1413
	1413
	5656
	1021
	1011
	1011
	1011
	1423
	1400
	2507
STRIAN,	0121		/MARK NUMBER 9
	1314
	1314
	1356
	5610
	2110
	1110
	1110
	1114
	2334
	1314
	7621
	1011
	1011
	1412
	3413
	4611
	1011
	2407
SQUARE,	0035		/MARK NUMBER 10
	0160
	6264
	6600
	3107
SSQUAR,	0137		/MARK NUMBER 11
	6264
	6650
	5244
	4630
	3224
	2610
	1207
DIAMND,	0023		/MARK NUMBER 12
	0125
	4741
	4325
	0027
	0707
SDIAMN,	0123		/MARK NUMBER 13
	2547
	4143
	2516
	1537
	3133
	1516
	1527
	2123
	1615
	1711
	1407
ASTRSK,	0152		/MARK NUMBER 14
	5656
	5244
	4040
	4431
	6531
	3367
	3307
STAR,	0024		/MARK NUMBER 15
	0125
	1615
	1011
	2011
	2011
	2011
	1413
	1413
	2413
	2413
	1417
	1627
	1627
	1627
	6262
	2516
	2516
	0020
	0707
CROSS,	0032		/MARK NUMBER 16
	1001
	2721
	6623
	2527
	6421
	2325
	6227
	2123
	6025
	0014
	3607
LAST,	0706		/END OF THE MARK TABLE

	PAGE		/ROOM FOR ADDITIONS
	*PDIR-630	/FOLLOWING THE LPT CHECK
SPACE,	7777	/'CONTROL' CODES COME BEFORE THIS
EXCLPT,	2622	/CHARACTER TABLE FOR CALCOMP PLOTTER
	7621
	2077
QUOTE,	1614
	7636
	3477
NUMSGN,	1026	/CHARACTERS ARE CODED USING A 4X6 MATRIX
	7614	/ASSUMING $D=2. EACH BYTE IS AN XY PAIR.
	4476	/CODE '75' SIGNALS A MOVE BELOW THE LINE
	4630	/CODE '76' IS USED TO RAISE THE PEN.
	7612	/CODE '77' MARKS THE END-OF-CHARACTER.
	4277	/
DOLLAR,	0110	/EXAMPLE:	    THE LETTER 'A'
	3041	/
	4233	/		     6 . ----- .
	1304	/	0004	     5 ./. . .\.
	0516	/	1636	     4 / . . . \
	3645	/	4443	     3 !-------!
	3626	/	0343	     2 ! . . . !
	2077	/	4077	     1 ! . . . !
PERCNT,	0046	/		     0 ! . . . !
	7614	/		       0 1 2 3 4
	0516	/
	2514	/THE PEN IS RAISED AT THE BEGINNING AND
	7630	/LOWERED AFTER THE FIRST (OR NEXT) MOVE.
	2132
	4130
	7777
AMPER,	4220
	0001
	2516
	0540
	7777
APOST,	2624
	7777
LPAREN,	2012
	1426
	7777
RPAREN,	2032
	3426
	7777
ASTER,	0145
	2320
	2623
	0541
	7777
PLUS,	2125
	2303
	4377
COMMA,	7511
	2021
	1110
	2077
MINUS,	0343
	7777
PERI0D,	2021
	1110
	2077
SLASH,	0046
	7777
NMBR0,	4230
	1002
	0416
	3644
	4277
NMBR1,	0040
	2026
	1577
NMBR2,	0516
	3645
	4401
	0040
	7777
NMBR3,	0110
	3041
	4233
	1333
	4445
	3616
	0577
NMBR4,	3036
	0242
	7777
NMBR5,	0110
	3041
	4233
	0306
	4677
NMBR6,	2602
	0110
	3041
	4233
	2377
NMBR7,	2046
	0677
NMBR8,	1333
	4241
	3010
	0102
	1304
	0516
	3645
	4433
	7777
NMBR9,	2044
	4536
	1605
	0413
	3377
C0L0N,	1121
	2212
	1176
	1424
	2515
	1477
SCOLON,	1021
	2212
	1121
	7624
	2515
	1424
	7777
LSTHAN,	3513
	3177
EQUAL,	4404
	7602
	4277
GTTHAN,	1133
	1577
QUESTN,	1426
	3645
	4433
	3077
ATSIGN,	0526
	3644
	4230
	1001
	0314
	2320
	7777
LTRA,	0004
	1636
	4443
	0343
	4077
LTRB,	0333
	4241
	3000
	0636
	4544
	3377
LTRC,	4536
	1605
	0110
	3041
	7777
LTRD,	3000
	0636
	4541
	3077
LTRE,	4606
	0333
	0300
	4077
LTRF,	4606
	0333
	0300
	7777
LTRG,	4536
	1605
	0110
	3041
	4323
	7777
LTRH,	0006
	0343
	4640
	7777
LTRI,	0040
	2026
	0646
	7777
LTRJ,	0201
	1030
	4146
	7777
LTRK,	0600
	0246
	2440
	7777
LTRL,	0600
	4077
LTRM,	0006
	2346
	4077
LTRN,	0006
	4046
	7777
LTRO,	4130
	1001
	0516
	3645
	4177
LTRP,	0006
	3645
	4433
	0377
LTRQ,	2240
	1001
	0516
	3645
	4130
	7777
LTRR,	0006
	3645
	4433
	0323
	4077
LTRS,	0110
	3041
	4233
	1304
	0516
	3645
	7777
LTRT,	2026
	0646
	7777
LTRU,	0601
	1030
	4146
	7777
LTRV,	0620
	4677
LTRW,	0610
	2330
	4677
LTRX,	0046
	2306
	4077
LTRY,	2023
	0623
	4677
LTRZ,	0646
	0040
	7777
LBRAKT,	3616
	1030
	7777
BSLASH,	0640
	7777
RBRAKT,	1636
	3010
	7777
UPAROW,	2026
	0426
	4477
UNDRLN,	7503
	7543
	7777
ACCENT,	1634	/BEGINNING OF LOWER CASE
	7777
LTLA,	3120
	1001
	0314
	2433
	3430
	4077
LTLB,	0600
	0110
	3041
	4334
	1403
	7777
LTLC,	4334
	1403
	0110
	3041
	7777
LTLD,	3646
	4041
	3010
	0103
	1434
	4377
LTLE,	1242
	4334
	1403
	0110
	4077
LTLF,	3526
	1510
	7603
	2377
LTLG,	7502
	7513
	7533
	7542
	4334
	1403
	0110
	3041
	7777
LTLH,	0600
	0314
	3443
	4077
LTLI,	2625
	7614
	2420
	7777
LTLJ,	2625
	7614
	2475
	2175
	1275
	0177
LTLK,	0600
	0244
	2340
	7777
LTLL,	1626
	2010
	3077
LTLM,	0004
	0314
	2320
	2334
	4340
	7777
LTLN,	0004
	0314
	3443
	4077
LTLO,	0103
	1434
	4341
	3010
	0177
LTLP,	7503
	0403
	1434
	4341
	3010
	0177
LTLQ,	7543
	4443
	3414
	0301
	1030
	4177
LTLR,	0400
	0224
	3443
	7777
LTLS,	0110
	3041
	0314
	3443
	7777
LTLT,   2524
        1434
        2420
        3077
LTLU,   0401
        1030
        4144
        4077
LTLV,   0420
        4477
LTLW,   0410
        2430
        4477
LTLX,   0044
        2204
        4077
LTLY,   0401
        1030
        4144
        7542
        7533
        7513
        7502
        7777
LTLZ,   0444
        0040
        7777
LBRACE, 3626
        2413
        2220
        3077
VBAR,   2620
        7777
RBRACE, 1626
        2433
        2220
        1077
TILDE,  0516
        3546
        7777
PILLOW, 0112
        1405
        1434
        4534
        3212
        3241
        7777
        $$$$    /END OF THE CHARACTER TABLE
