/339 DISPLAY-FORTRAN CALLABLE SUBPROGRAM PACKAGE
/SUBPICTURE DISPLAY FILE GENERATION	H SPENCER, 9/68
/@COPYRIGHT 1968 DIGITAL EQUIPMENT CORP.
/
/CALLING SEQUENCES:
/	1) TO GENERATE A LINE:
/		JMS 	LINE
/		JMP	.+5	/(OR .+4, IF PNAME IS NOT GIVEN)
/		.DSA	DELTAY	/Y INCREMENT,10 BITS,2'S COMPLEMENT.
/		.DSA	DELTAX	/X INCREMENT. . . .
/		.DSA	LT	/INTENSIFICATION (1=ON,0=OFF)
/		[.DSA	PNAME]	/FIRST LOCATION OF THIS SUBPICTURE FILE
/	IF PNAME IS NOT GIVEN, THE LAST ONE GIVEN IS USED.
/
/	2) TO GENERATE A LINE OF TEXT:
/		JMS	TEXT
/		JMP	.+4	/(OR .+3 IF PNAME IS NOT GIVEN)
/		.DSA	STR	/FIRST WORD OF TEXT STRING TO BE DISPLAYED
/		.DSA	N	/NUMBER OF CHARACTERS (DELTAX=6N)
/		[.DSA	PNAME]	/BEGINNING OF SUBPICTURE FILE
/
/	3) TO GENERATE A DISPLAY COPY OF ANOTHER SUBPICTURE:
/		JMS	COPY
/		JMP	.+3	/(OR .+2 IF PNAME IS NOT GIVEN)
/		.DSA	PNAME1	/POINTER TO THE SUBPIC TO BE COPIED
/		[.DSA	PNAME]	/POINTER TO BEGINNING OF THIS SUBPIC
/
/	4) TO INSERT PARAMETER SETTINGS IN THE SUBPICTURE FILE:
/		JMS	PRAMTR
/		JMP	.+N	/N=2+# OF SETTINGS REQUESTED +1 IF PNAME GIVEN
/		.DSA	FEATR[S]	/SUM OF FEATURE IDS FOR WHICH SETTINGS
/				/ARE REQUESTED.
/		.DSA	VALUE1	/VALUES OF SETTINGS REQUESTED, IN
/				/ASCENDING NUMERICAL ORDER OF ID.
/		. . .
/		.DSA	VALUEM
/		[.DSA	PNAME]	/BEGINNING OF THIS SUBPICTURE.
/
/	5) TO GENERATE A GRAPH:
/		JMS	GRAPH
/		JMP	.+5	/(OR .+4 IF PNAME IS NOT GIVEN)
/		.DSA	DTA	/FIRST WORD OF DATA TO BE GRAPHED.
/		.DSA	N	/NUMBER OF DATA POINTS TO BE DISPLAYED.
/		.DSA	A	/IF 0,INCREMENT X AND SET Y.
/		[.DSA	PNAME]	/POINTER TO THE BEGINNING OF THIS SUBPIC.
/
/339 DISPLAY CODE
VEC=1120			/MODE=VECTOR
GRPL=1160			/MODE=GRAPHPLOT
EDS=1101			/ENTER DATA STATE
POP=3000			/SUBROUTINE RETURN
PJMP=2010			/SUBROUTINE PUSH-JUMP
CHAR=1170			/MODE=CHARACTER (5)
CHMOD=70000		/CHARACTER MODE INDICATOR
SC=400			/ENABLE SCALE SETTING
INT=10			/ENABLE INTENSITY SETTING
LPOF=40			/ENABLE CHANGE OF LIGHT PEN SETTING
BKOF=6301			/ENABLE CHANGE OF BLINK SETTING
	.GLOBL	LINE
	.GLOBL	GRAPH
	.GLOBL	TEXT
	.GLOBL	COPY
	.GLOBL	PRAMTR
/SUBROUTINE LINE
LINE	0			/LINE ENTRY POINT
	LAC	(JMP 4		/LENGTH OF ARGUMENT LIST
	DAC	ARGLG
	LAC	(20000		/DATA MODE=VECTOR
	DAC	MODE
	LAC	LINE		/SAVE RETURN ADDRESS
	JMP	INIT		/GO TO MAIN PROCESSING
/SUBROUTINE GRAPH
GRAPH	0
	LAC	(JMP 4		/LENGTH OF ARGUMENT LIST.
	DAC	ARGLG
	LAC	(60000		/DATA MODE=GRAPHPLOT.
	DAC	MODE
	LAC	GRAPH		/SAVE RETURN ADDRESS.
	JMP	INIT		/GO TO MAIN PROCESSING.
/SUBROUTINE TEXT
TEXT	0			/TEXT ENTRY POINT
	LAC	(JMP 3		/LENGTH OF ARGUMENT LIST
	DAC	ARGLG	
	LAC	(CHMOD		/DATA MODE=CHARACTER (50000=VC38;
	DAC	MODE		/SHOULD BE 70000 FOR VA38)	
	LAC	TEXT		/SAVE RETURN ADDRESS
	JMP	INIT		/GO TO MAIN PROCESSING
/SUBROUTINE COPY
COPY	0			/COPY ENTRY
	LAC	(JMP 2		/LENGTH OF ARGUMENT LIST
	DAC	ARGLG
	LAC	(700000		/MODE=CONTROL STATE
	DAC	MODE
	LAC	COPY		/SAVE RETURN ADDRESS
	JMP	INIT		/GO TO MAIN PROCESSING
/SUBROUTINE PRAMTR
PRAMTR	0
	LAC	PRAMTR		/GET RETURN ADDRESS.
	JMS	GETARG		/GO GET ARGUMENTS.
	LAC	(710000		/SET MODE SWITCH.
	DAC	MODE
	LAC	(ARG1		/SET UP POINTER TO LOCAL
	DAC	ARGP		/ARGUMENT STORAGE.
	DZM	TEMP1		/CLEAR DISPLAY CODE TEMP STORE.
	DZM	TEMP2
/DECIDE WHICH PARAMETER SETTINGS WERE ASKED FOR AND GET THEIR VALUES
	LAC*	FEATR		/GET SETTING BITS
	SKP
PRM10	LAC	TVTMP3		/GET FEATURE BITS INTO AC.
	SNA			/DONE YET?
	JMP	PRM25		/YES.
	RCR			/BOTTOM BIT INTO L.
	DAC	TVTMP3		/SAVE REMAINDER.
	SNL			/WAS THAT SETTING ASKED FOR?
	JMP	PRM20		/NO, RECYCLE.
	ISZ	ARGP		/BUMP ARGUMENT POINTER.
	LAC*	ARGP		/GET ARGUMENT,
	DAC	TEMP		/GET ITS VALUE.
	LAC*	TEMP
PRM15	JMP*	PRMTBL		/GO EXECUTE THE APPROPRIATE ROUTINE.
PRM20	ISZ	PRM15		/POINT TO NEXT ROUTINE, CORRESPONDING TO NEXT BIT.
	JMP	PRM10		/RECYCLE.
PRM25	LAC	(JMP* PRMTBL	/RESET DISPATCH POINTER
	DAC	PRM15
/DETERMINE WHETHER PNAME WAS GIVEN AND IF SO GET IT.
	LAC	ARGP		/IF THE LOCAL ARGUMENT POINTER NOW POINTS
	SAD	LINE		/TO THE LAST ARG GOTTEN BY GETARG, THEN
	JMP	INIT10		/PNAME WAS NOT GIVEN.
	ISZ	ARGP		/IF THERE IS ONE MORE ARGUMENT IN
	LAC*	ARGP		/THE LIST, IT IS PNAME.
	DAC	PNAME
	JMP	INIT10
/GENERATE SCALE SETTING FROM VALUE IN AC
SCALE	RTL			/LEFT SHIFT 6.
	RTL
	RTL
	AND	(300
	XOR	(SC		/ENABLE SCALE CHANGE.
	DAC	TEMP1		/SET ASIDE FOR LATER INSERTION IN FILE.
	JMP	PRM20		/RETURN TO DISPATCHER.
/GENERATE INTENSITY SETTING FROM VALUE IN AC
INTENS	XOR	(INT		/ENABLE INTENSITY CHANGE.
	XOR	TEMP1		/INCLUDE IN WORD TO BE
	DAC	TEMP1		/INSERTED IN DISPLAY FILE
	JMP	PRM20		/RETURN TO DISPATCHER.
/GENERATE LIGHT PEN SETTING FROM VALUE IN AC.
LTPN	SZA			/1=LPON, 0=LPOF.
	LAC	(20		/ON BIT.
	TAD	(LPOF		/ENABLE LIGHT PEN SETTING.
	XOR	TEMP1		/INCLUDE IN DISPLAY FILE WORD
	DAC	TEMP1
	JMP	PRM20		/RETURN TO DISPATCHER
/GENERATE BLINK SETTING FROM VALUE IN AC.
BLINK	SZA			/1=BKON, 0=BKOF.
	LAC	(1		/ON BIT.
	TAD	(BKOF		/SET BLINK CIRCUIT.
	DAC	TEMP2		/SAVE FOR DISPLAY FILE.
	JMP	PRM20		/RETURN TO DISPATCHER.
/GENERAL GET-ARGUMENT-POINTERS ROUTINE
GETARG	0			/ENTRY POINT
	DAC	ARGP		/IN ARGUMENT POINTER
	LAC*	ARGP		/GET JMP OVER ARGUMENT LIST.
	AND	(17777		/LOSE "JMP",
	DAC	TEMP		/SAVE.
	LAC	(ARG1-1		/SET UP POINTER TO START OF
	DAC	LINE		/LOCAL ARGUMENT STORE.
GTRG10	ISZ	ARGP		/INCREMENT ARGUMENT POINTER.
	LAC	ARGP		/SEE IF IT POINTS PAST
	AND	(17777		/(SAVE 13 BIT ADDRESS)
	SAD	TEMP		/THE END OF THE ARGUMENT LIST.
	JMP*	GETARG		/GO OUT IF IT DOES.
	LAC*	ARGP		/GET THE ARGUMENT.
	SMA			/IS IT INDIRECT (BIT0 ON)?
	JMP	GTRG15		/NO, GO PUT IT AWAY.
	DAC	TEXT		/GET THE REAL ARGUMENT POINTER AT
	LAC*	TEXT		/BY THE APPARENT ARGUMENT,
GTRG15	ISZ	LINE		/INCREMENT LOCAL STORAGE POINTER
	DAC*	LINE		/PUT IT IN LOCAL STORE AND
	JMP	GTRG10		/RECYCLE.
/BEGIN MAIN PROCESSING
INIT	DAC	RETAD		/SAVE RETURN ADDRESS.
	JMS	GETARG		/FETCH ARGUMENT POINTERS.
/SEE IF PNAME WAS GIVEN AND GET IT IF SO
	LAC	RETAD
	AND	(17777
	TAD	ARGLG		/AC=POINTER TO SUPPOSED LAST ARGUMENT
	SAD*	RETAD		/IS IT THE RETURN ADDRESS?
	JMP	INIT10		/YES; PNAME WAS NOT GIVEN.
	LAC*	LINE		/NO; LAST ARGUMENT CONTAINS PNAME.
	DAC	PNAME		/SAVE IT.
/SET UP SUBPICTURE FILE POINTERS
INIT10	LAC	PNAME		/BEGINNING OF FILE (PNAME(1))
	TAD	D.1		/MOVE TO FIRST DISPLAY LOCATION
	DAC	D1LOC		/POINTER TO FIRST DISPLAY LOCATION
	DZM	D1SAV		/CLEAR SAVE LOC FOR FIRST DISPLAY INSTRUCTION.
	DAC	TEMP		/ASSUME NEW FILE (NO SUCH MODE).
/SET UP FILE POINTER AND DETERMINE IF NEW OR OLD FILE.
	LAC*	PNAME		/PNAME(1)=0 FOR NEW FILES,
	SNA			/	=LENGTH OF OLD FILES.
	LAC	D.1		/STARTING ADDRESS FOR NEW FILE=D.1
	TAD	PNAME		/+PNAME.
	DAC	PNPTR		/POINTS TO FIRST AVAILABLE LOCATION IN FILE
	SAD	D1LOC		/IF=TO PNAME(3), THIS IS A NEW FILE.
	JMP	NEWFL
/START PROCESSING OF OLD FILE
	LAC*	PNPTR		/GET LAST DISPLAY INSTRUCTION (POP)
	AND	(770000		/SAVE HI ORDER MODE BITS
	DAC	TEMP		/SET ASIDE
	LAC*	D1LOC		/SAVE FIRST DISPLAY LOCATION.
	DAC	D1SAV
	LAC	(POP		/SET FIRST DISPLAY INST TO POP TO TURN
	DAC*	D1LOC		/OFF THIS SUBPICTURE WHILE PROCESSING.
/START PROCESSING OF NEW FILE
NEWFL	LAC	MODE		/GET DATA MODE OF CURRENT CALL
	SPA			/CONTROL STATE (70)?
	JMP	CNTRL
	SAD	(20000		/VECTOR?
	JMP	VECTOR
	SAD	(60000		/GRAPHPLOT?
	JMP	GRPH
	SAD	(CHMOD		/CHARACTER?
/MODE = CONTROL STATE
	JMP	CHAR5
CNTRL	XOR	(700000		/CLEAR BITS 0-2
	SNA			/(7)0=COPY, (7)1=PRAMTR
	JMP	PJUMP		/CALL TO COPY
	JMP	PARAM		/CALL TO PRAMTR
/PROCESS CALL TO COPY.
PJUMP	LAC	PNAME1		/GET ADDRESS OF PJMP.
	RTL; RTL; RTL; RAL		/MOVE BITS 3-5 INTO 15-17.
	AND	(7		/CLEAN OUT ALL BUT BREAK FIELD.
	TAD	(PJMP		/DISPLAY PJMP+BREAK FIELD.
	DAC*	PNPTR		/INSERT IN PLACE OF EXISTING POP.
	ISZ	PNPTR		/NEXT LOC IN DISPLAY FILE.
	LAC	PNAME1		/GET NAME OF SUBPICTURE TO COPY.
	TAD	(2		/POINT TO FIRST DISPLAY INSTRUCTION.
	DAC*	PNPTR		/INSERT IN FILE.
	JMP	RETRN		/GO CLOSE UP
/LAST PART OF CALL TO PRAMTR - PLACE REQUESTED PARAMETERS SETTINGS IN FILE.
PARAM	LAC	TEMP1		/CONTAINS SCALE, INTENSITY, LP SETTINGS
	SZA			/WERE THERE ANY?
	JMP	PARAM3		/YES
	LAC	TEMP2		/NO,GET BLINK WORD
	JMP	PARAM5
PARAM3	DAC*	PNPTR		/YES, PUT INTO DISPLAY FILE.
	LAC	TEMP2		/CONTAINS BLINK SETTING
	SNA			/WAS ONE?
	JMP	RETRN		/NO, RETURN.
	ISZ	PNPTR		/YES,KICK FILE POINTER
PARAM5	DAC*	PNPTR		/AND PUT IN THE FILE.
	JMP	RETRN		/RETURN.
/PROCESS CALL TO LINE; MODE=VECTOR
VECTOR	SAD	TEMP		/NEW MODE=OLD MODE?
	JMP	OLDVEC		/YES, GO CLEAR ESCAPE BIT
	LAC	(VEC!EDS		/VEC!EDS
	DAC*	PNPTR		/INTO NEXT DISPLAY LOCATION
VECT10	ISZ	PNPTR		/INCREMENT LOCATION COUNTER.
	LAC*	DELTAY		/GET VALUE OF Y INCREMENT.
	SMA			/CONVERT TO SIGN-MAGNITUDE IF MINUS.
	JMP	VECT15
	CMA			/POSITIVE MAGNITUDE,
	TAD	(1
	XOR	(2000		/INSERT MINUS SIGN BIT.
VECT15	DAC	DELTAY
	LAC*	LT		/GET LINE TYPE (1=INTENSIFY,0=OFF)
	SZA!CLA
	LAC	(4000		/SET BIT ACCORDINGLY
	XOR	DELTAY		/IN DELTA Y.
	DAC*	PNPTR		/INSERT IN FILE.
	LAC*	DELTAX		/GET DELTA X,
	SMA			/CONVERT TO SIGN-MAGNITUDE IF MINUS.
	JMP	VECT20
	CMA			/POSITIVE MAGNITUDE,
	TAD	(1
	XOR	(2000		/INSERT MINUS SIGN BIT.
VECT20	XOR	(4000		/INSERT ESCAPE BIT,
	ISZ	PNPTR		/UP THE FILE POINTER
	DAC*	PNPTR		/AND STICK DELTAX INTO THE FILE.
	JMP	RETRN		/RETURN.
OLDVEC	JMS	OLDVG		/GO CLEAR ESCAPE BIT
	JMP	VECT10		/GO FOR NEXT DATA WAORD.
/NEW MODE=OLD MODE=VECTOR OR GRAPHPLOT. CLEAR ESCAPE BIT.
OLDVG	0
	LAW	-1		/BACK UP PNPTR ONE LOCATION
	TAD	PNPTR
	DAC	PNPTR
	LAC*	PNPTR		/GET LAST DATA WORD
	XOR	(4000		/CLEAR ESCAPE BIT
	DAC*	PNPTR		/RETURN IT TO FILE
	JMP*	OLDVG		/RETURN.
/PROCESS CALL TO GRAPH; MODE=GRAPHPLOT
GRPH	SAD	TEMP		/NEW MODE=OLD MODE?
	JMP	OLDGRF		/YES,GO CLEAR ESCAPE BIT.
	LAC	(GRPL!EDS
	DAC*	PNPTR		/INTO NEXT DISPLAY LOCATION.
GRPH10	ISZ	PNPTR		/INCREMENT DISPLAY POINTER.
	LAC*	N		/GET NUMBER OF DATA POINTS
	CMA; TAD (1
	DAC	TVCNT		/INTO COUNTER.
	LAC*	A		/0=INCREMENT X,PLOT Y.
	SZA
	LAC	(2000		/SET BIT TO INCREMENT Y,PLOT X.
	DAC	A
GRPH20	LAC*	DTA		/GET A DATA POINT.
	AND	(1777		/SAVE LOW 10 BITS.
	XOR	A		/INSERT DIRECTION BIT.
	DAC*	PNPTR		/INSERT IN DISPLAY FILE.
	ISZ	DTA		/NEXT DATA POINT.
	ISZ	PNPTR		/NEXT DISPLAY LOCATION.
	ISZ	TVCNT		/CHECK COUNT OF POINTS.
	JMP	GRPH20		/RECYCLE.
	XOR	(4000		/DONE,INSERT ESCAPE BIT.
	DAC*	PNPTR
	JMP	RETRN		/RETURN.
OLDGRF	JMS	OLDVG		/CLEAR ESCAPE BIT.
	JMP	GRPH10		/GO GET DATA.
/PROCESS CALL TO TEXT; MODE=CHAR5
CHAR5	SAD	TEMP		/NEW MODE=OLD MODE?
	JMP	OLDCHR		/YES, GO CLEAR ESCAPE CHAR.
	LAC	(CHAR!EDS		/CHAR!EDS
	DAC*	PNPTR		/INTO DISPLAY FILE
/CONVERT IOPS ASCII LINE BUFFER TO DISPLAY TEXT
TVGT10	DZM	TVLRCH		/INDICATE LEFT CHARACTER TO START
TVGT11	LAC*	N		/SET UP CHARACTER COUNT GIVEN
	CMA			/BY USER
	TAD	(1
	DAC	TVCNT		/INTO COUNTER
TVGT20	LAC*	TVTXT	/GET WORD1 OF A PAIR
	DAC	PWRD2
	ISZ	TVTXT
	LAC*	TVTXT	/GET WORD 2
	DAC	PWRD3
	ISZ	TVTXT
	LAW	-5	/SET UP A COUNTER FOR
	DAC	TVTMP3	/  5 CHARS PER WORD PAIR
TVGT22	JMS	PRAL7	/GO GET ONE CHAR OUT
	AND	(177	/CLEAR THE REST OF THE WORD
	JMS	TVLN	/SEND CHAR TO DISPLAY BUILDER
	ISZ	TVCNT	/INCREMENT COUNT OF CHARS IN DISPLAY FILE
	JMP	TVGT26	/GO GET NEXT CHAR FROM WROD PAIR
	JMP	TVGT30	/GO PROCESS THIS BUFFER
TVGT26	ISZ	TVTMP3	/INCREMENT CHAR COUNT IN WORD PAIR
	JMP	TVGT22	/NEXT CHARACTER
	JMP	TVGT20	/NEXT WORD PAIR
/END OF TEXT STRING, INSERT ESCAPE CHARACTER
TVGT30	LAC	TV.ESC		/GET ESCAPE CHARACTER
	JMS	TVLN30		/INSERT IN BUFFER
	JMP	RETRN		/RETURN.
 
/ SUBROUTINE TO INSERT DISPLAY CHARACTER CODE INTO THE BUFFER
/POINTED TO BY TVCUR. 
TVLN	0			/RETURN ADDRESS
	SAD	(11		/TAB
	JMP	TVLN40		/PROCESS TAB CHARACTER
	SAD	(15		/CARRIAGE RETURN
	JMP	TVLN20		/DISREGARD THIS CHAR,REPLACE BY BLANK
	SAD	(175		/ALT MODE
	JMP	TVLN20
	SAD	(12		/LINE FEED
	JMP	TVLN18		/PROCESS LINE FEED.
	SAD	(44		/$ DISREGARDED
	JMP	TVLN20
	SAD	(45		/% DISREGARDED
	JMP	TVLN20
	SAD	(46		/& DISREGARDED
	JMP	TVLN20
	SAD	(100		/@ DISREGARDED
	JMP	TVLN20
/MAKE SURE ASCII IS BETWEEN 40 AND 137.
	DAC	TEMP		/SAVE CHAR
	TAD	(-40
	SPA			/GOOD IF GREATER THAN 40
	JMP	TVLN20		/OTHERWISE NO GOOD.
	TAD	(-100
	SMA			/GOOD IF LESS THAN 40+77=137
	JMP	TVLN20		/OTHERWISE NO GOOD.
	LAC	TEMP		/RESTORE CHAR TO AC.
	AND	(77		/CLEAR HIGH ORDER BIT.
TVLN11	JMS	TVLN30		/GO INSERT CHARACTER
	ISZ	TVTBCT		/INCREMENT COLUMN COUNTER FOR TABS
	JMP*	TVLN		/RETURN IF OK
TVLN12	LAW	-12		/RESET COLUMN COUNTER TO 10
	DAC	TVTBCT
	JMP*	TVLN		/AND RETURN
/PROCESS LINE FEED
TVLN18	LAC	TV.LF		/GET LINE FEED OUT OF TABLE
	JMP	TVLN11		/GO STICK IT   IN BUFFER
/PROCESS DISREGARDED CHARACTERS
TVLN20	LAC	TVTABL		/GET DISPLAY BLANK (SPACE)
	JMP	TVLN11
/INSERT CHARACTER
TVLN30	0			/RETURN ADDRESS
	XOR	TVLRCH		/BIT 0 = 0 OR 1 FOR L OR R CHAR
	SPA
	JMP	TVLN32		/RIGHT CHAR
	RTL			/SHIFT LEFT 6
	RTL			/FOR LEFT CHAR
	RTL
	AND	(7700		/CLEAR LOW-ORDER TRASH
	ISZ	TVCUR		/POINT TO NEXT FREE LOCATION
	DAC*	TVCUR		/INSERT LEFT CHAR
	LAC	(400000		/SET UP TO INDICATE RIGHT CHAR
	DAC	TVLRCH
	JMP*	TVLN30		/RETURN
TVLN32	XOR*	TVCUR		/STICK NEW CHAR INTO RIGHT SIDE
	DAC*	TVCUR
	DZM	TVLRCH		/SET UP TO INDICATE LEFT CHAR
	JMP*	TVLN30		/RETURN
/PROCESS TAB CHARACTER
TVLN40	LAC	TVTABL		/GET A SPACE FROM THE TABLE
	JMS	TVLN30		/INSERT IN DISPLAY FILE
	ISZ	TVTBCT		/INCREMENT AND CHECK COLUMN COUNTER
	JMP	TVLN40		/GET ANOTHER SPACE
	JMP	TVLN12		/GO RESET COLUMN COUNTER AND EXIT
/EXTRACT 7-BIT ASCII FROM 5/7 WORD PAIRS, COURTESY A.W.WILSON
PRAL7	0
	LAW -7		/SET UP SEVEN-BIT COUNTER.
	DAC PK7BTS	/..
PRALL7	LAC PWRD3		/ROTATE A SINGLE BIT
	RAL		/FROM PWRD3 TO PWRD1.
	DAC PWRD3
	LAC PWRD2
	RAL
	DAC PWRD2
	LAC PWRD1
	RAL
	DAC PWRD1
	ISZ	PK7BTS		/COUNT 7 BITS TO GET.
	JMP PRALL7	/NOT FINISHED, ROTATE OUT ONE MORE BIT.
	JMP* PRAL7	/ALL DONE, RETURN TO CALLER.
/CONSTANTS, ETC
TVCNT		/LOOP COUNTER
TVTBCT	-12		/COLUMN COUNTER FOR TABS
TVLRCH	0		/INDICATES LEFT OR RIGHT CHAR IN DISPLAY BUFFER
TVTABL	40		/SPACE
TV.LF	45		/LINE FEED
TV.ESC	46		/ESCAPE TO CONTROL STATE
/OLD MODE = NEW MODE = CHAR5; CLEAR ESCAPE CHAR AND SET CHAR L/R POINTER
OLDCHR	LAW	-1		/BACK UP PNPTR ONE LOCATION
	TAD	PNPTR
	DAC	PNPTR
	LAC*	PNPTR		/GET LAST WORD OF TEXT
	AND	(7700		/CHECK IF ESCAPE CHAR IS L OR R
	SAD	ESC
	JMP	OLDCH2		/ESCAPE CHAR IN LEFT OF WORD
	DAC*	PNPTR		/RETURN WORD WITH GOOD CHAR LEFT.
	LAC	(400000		/POINT TO RIGHT SIDE OF WORD.
	DAC	TVLRCH
	JMP	TVGT11		/PROCEED WITH NEW TEXT
OLDCH2	LAW	-1		/BACK FILE POINTER UP ONE MORE
	TAD	PNPTR
	DAC	PNPTR
	JMP	TVGT10		/PROCEED WITH NEW TEXT
/RETURN PROCESSING
RETRN	ISZ	PNPTR		/INCREMENT DISPLAY LOCATION COUNTER
	LAC	MODE		/MODE OF THIS CALL INTO LAST
	XOR	(POP		/DISPLAY INSTRUCTION HI-ORDER BITS
	DAC*	PNPTR
	LAC	PNPTR		/PNPTR-PNAME=CURRENT
	CMA			/LENGTH OF FILE;
	TAD	PNAME
	CMA
	DAC*	PNAME		/INTO PNAME(1).
	LAC	D1SAV		/RESTORE DISPLAY INSTRUCTION,
	SZA			/IF THERE WAS ONE,
	DAC*	D1LOC		/AT PNAME (3).
	JMP*	RETAD		/RETURN.
RETAD=PRAMTR			/SAVE LOC FOR RETURN ADDRESS
ARGLG				/LENGTH OF ARGUMENT LIST
MODE				/DATA STATE MODE OF CURRENT CALL
ARGP				/POINTS TO SUBROUTINE ARGUMENTS
TEMP				/TEMPORARY STORAGE
PNPTR				/POINTER TO CURRENT LOC IN SUBPIC FILE
D.1	2			/PNAME +D.1=FIRST DISPLAY LOCATION
ESC	4600			/CHAR GEN ESCAPE CHARACTER
ARG1	.BLOCK	6		/LOCAL ARGUMENT STORAGE
DELTAY=ARG1			/Y INCREMENT (LINE)
DELTAX=ARG1+1			/X INCREMENT (LINE)
LT=ARG1+2				/LINE TYPE (LINE)
PNAME=ARG1+5			/POINTS TO START OF SUBPICTURE FILE
STR=ARG1				/TEXT STRING POINTER (TEXT)
N=ARG1+1				/NUMBER OF CHARACTERS (TEXT)
PNAME1=ARG1			/SUBPICTURE TO BE COPIED (COPY)
FEATR=ARG1			/INDICATES PARAMETER SETTINGS DESIRED
DTA=ARG1				/DATA TO BE PLOTTED(GRAPH).
A=ARG1+2				/INDICATES PLOTTING ALONG X OR Y.
D1LOC=LINE			/POINTS TO FIRST EXECUTABLE DISPLAY INSTR.
D1SAV=TEXT			/SAVE LOC FOR FIRST DISPLAY INSTR.
TEMP1=COPY			/TEMP STORE FOR PRAMTR CALLS
TEMP2				/ALSO.
/EQUATE SYMBOLS USED BY TEXT CONVERSION ROUTINE
TVTXT=STR
TVTMP3=ARGLG
TVCUR=PNPTR
PWRD2=TEMP1
PWRD3=TEMP2
PWRD1=ARG1+3
PK7BTS=ARG1+4
	/DISPATCH TABLE FOR PARAMETER SETTINGS
PRMTBL	SCALE
	INTENS
	LTPN
	BLINK
	.END
