	.SYSID <	.TITLE VPA. >,< 113>
/
/COPYRIGHT (C) 1975
/DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
/
/THIS SOFTWARE IS FURNISHED UNDER A LICENSE FOR USE ONLY
/ON A SINGLE COMPUTER SYSTEM AND MAY BE COPIED ONLY WITH
/THE INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS
/SOFTWARE, OR ANY OTHER COPIES THEREOF, MAY NOT BE PRO-
/VIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON
/EXCEPT FOR USE ON SUCH SYSTEM AND TO ONE WHO AGREES TO
/THESE LICENSE TERMS.  TITLE TO AND OWNERSHIP OF THE
/SOFTWARE SHALL AT ALL TIMES REMAIN IN DEC.
/
/THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE
/WITHOUT NOTICE AND SHOULD NOT BE CONSTRUED AS A COM-
/MITMENT BY DIGITAL EQUIPMENT CORPORATION.
/
/DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY
/OF ITS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.
	.EJECT
/
/EDIT #011	FEB. 27, 73
/     #012	21-JUN-74 BY ED GARDNER.  MINOR FIXES TO HANDLEING OF
/		ALTMODES IN LINES LONGER THAN 72 CHAR.'S AND TO FORM FEEDS.
/     #013	11-JUL-74 BY ED GARDNER  REMOVE CODE TO ENABLE AND DISABLE
/		INTERRUPTS, AS CODE HAS BEEN ADDED TO RESMON TO HANDLE
/		SPURIOUS INTERRUPTS
/ 113	14-JUN-75 (RCHM)	MAKE XVM CHANGES.
/COPYRIGHT 1969, 71,72, 73 DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
/ROLF HUBERT
/BY DEFINING VPA.S A VERSION OF VPA IS PRODUCED WHICH OUTPUTS PAGE BY
/PAGE IF BIT 0 OF AC SWITCHES IS 1.  THIS IS USEFUL WITH MACRO LISTINGS.
/
	.GLOBL	VPA.
CXB=700522	/CLEAR X-COORDINATE BUFFER
CYB=700622	/CLEAR Y-COORDINATE BUFFER
LXB=700524	/LOAD X-COORDINATE BUFFER FROM AC 8-17
LYB=700624	/LOAD Y-COORDINATE BUFFER FROM AC 8-17
EST=700726	/ERASE THE STORAGE TUBE AND CLEAR FLAG
SDDF=700521	/SKIP IF DISPLAY DONE FLAG IS SET
CDDF=700722	/CLEAR DISPLAY DONE FLAG
LXBD=700564	/LOAD X-COORDINATE BUFFER AND DISPLAY THE POINT SPECIFIED
		/BY XB AND YB (STORED)
LYBD=700664	/LOAD Y-COORDINATE BUFFER AND DISPLAY THE POINT
		/SPECIFIED BY XB AND YB (STORED)
LXDNS=700544	/LOAD X-COORDINATE BUFFER AND DISPLAY THE POINT
		/SPECIFIED BY XB AND YB (NON-STORED)
LYDNS=700644	/LOAD Y-COORDINATE BUFFER AND DISPLAY THE POINT
		/SPECIFIED BY XB AND YB (N0N-STORED)
.MED=3		/ERROR MESSAGES
VPA.	DAC	VPCALP		/ADDRESS OF CAL INSTRUCTION
	DAC	VPARGP		/ARGUMENT POINTER CAL
	ISZ	VPARGP		/GET FUNTION CODE
	LAC*	VPARGP		/LOC+1		
	AND (177
	ISZ	VPARGP		/POINT TO NEXT ARGUMENT-LOC+2
	TAD	(JMP VPDSPT	/SET UP FUNTION DISPATBH
	DAC	VPDSPT
VPDSPT	XX			/FUNTION DISPATCH
	JMP	VPINIT		/1=.INIT
	JMP	VPFST		/2=.FSTAT
	JMP	VPILLG		/3=.SEEK (ILLEGAL)
	JMP	VPIGNR		/4=.ENTER (IGNORED)
	JMP	VPRET		/5=.CLEAR (IGNORED)
	JMP	VPCLOS		/6=.CLOSE
	JMP	VPRET		/7=.MTAPE (IGNORED)
	JMP	VPILLG		/10=.READ (ILLEGAL)
	JMP	VPWRIT		/11=.WRITE
	JMP	VPWAIT		/12=.WAIT-.WAITR
	ISZ	VPARGP		/13=.TRAN (IGNORED)
	ISZ	VPARGP
	JMP	VPIGNR
	.EJECT
VPINIT	LAC*	VPCALP		/GET CONTENTS OF CAL INSTRUCTION
	AND	(3000		/BIT 7-8 MUST CONTAIN 1
	SZA			/SKIP IF AC   EQUAL TO 0
	JMP	VPCAL
VPILLG	LAW	6		/ERROR CODE 6
	JMP*	(.MED+1		/JUMP TO ERROR ROUTINE
VPCAL	CAL	+54		/.SETUP FOR PIC AND API CHANNEL 54
VPXCRD	16
VPYCRD	SDDF			/SKIP ON DISPLAY DONE FLAG
VPIOBY	VPINT			/INTERRUPT HANDLER ADDRESS
VPSCL	LAC	(JMP VPXX	/JUMP AROUND CAL AFTER FIRST PASS
VPTAB	DAC	VPCAL
VPXX	LAC	(40		/MAXIMUM BUFFER SIZE
	ISZ	VPARGP
	DAC*	VPARGP		/DEPOSIT IN LOC+3
	LAC	VPIN20		/SET UP CORRECT RETURN FOR
	DAC	VPIN10		/INTERRUPT HANDLER
	EST			/ERASE SCREEN, AND...
	DAC VPIOBY		/SET I/O UNDERWAY BEFORE WE CAN GET INTERRUPTED
	LAC	(2000		/SET UP Y-COORDINATE, Y=1025
	DAC	VPYPOS
	DZM	VPXPOS		/CLEAR X POSITION
	ISZ	VPARGP		/BUMP TO EXIT ADDRESS FROM .INIT MACRO
	DZM	VPINTF		/MAKE SURE INTERRUPT FLAG OFF
	LAW -10	/INITIALISE TAB COUNT
	DAC VPTAB
	LAC (14
	DAC LSTFRM	/PRETEND FF WAS LAST CHAR
	DBR			/SCREEN ON AN .INIT
	XCT	VPRET1		/EXIT FROM .INIT CAL
VPIGNR	ISZ	VPARGP		/BUMP TO RETURN LOCATION
VPRET	DBR
VPRET1	XCT	(JMP* VPARGP	/RETURN TO USER
VPBSY	DBR
	XCT	(JMP* VPCALP	/I/O IS BUSY
	.TITLE TEST FOR MEMORY BOUNDS ERROR
 
MEMORY	XX			/(RCHM-113) SUBROUTINE ENTRY POINT
	AND (700000)		/(RCHM-113) EXTRACT EXTENDED MEMORY BITS.
	SNA			/(RCHM-113) ARE ANY OF THEM ON?
	JMP* MEMORY		/(RCHM-113) NO, EXIT TO CALLER.
	LAW 67			/(RCHM-113) PICK UP ERROR NUMBER.
	JMP* (.MED+1)		/(RCHM-113) PRINT ERROR
	.TITLE .WRITE PROCESSOR.
/.WRITE
VPWRIT	LAC	VPIOBY		/CHECK IF I/O UNDERWAY
	SZA
	JMP	VPBSY		/YES
	LAC	VPARGP		/GET CORRECT RETURN
	TAD	(2
	DAC	VPARGQ		/SET UP CORRECT RETURN TO USER
	DZM	VPINTF		/MAKE SURE INTERRUPT FLAG IS OFF
	LAC	(LYBD		/LOAD IOT IN VPIOT
	DAC	VPMODE
	DAC	VPIOBY		/SET I/O UNDERWAY
	LAC*	VPCALP		/GET CONTENTS OF CAL INSTRUCTION
	AND	(17000
	SAD	(2000		/IOPS ASCII-SCALE 2
	JMP	VPASC2
	SAD	(12000		/IOPS ASCII-SCALE 4
	JMP	VPASC4
	SAD	(3000		/IMAGE ASCII
	JMP	VPIMAG
	SAD	(4000		/DUMP - STORE MODE
	JMP	VPDMSM
	SAD	(14000		/DUMP - NON-STORE MODE
	JMP	VPDMNS
	LAW	7		/ERROR CODE 7, ILLEGAL DATA MODE
	JMP*	(.MED+1		/ERROR ROUTINE
VPASC2	LAC	(20000		/IOPS ASCII-SCALE2
	JMP	.+2
VPASC4	LAC	(40000		/IOPS ASCII-SCALE 4
	JMS	VPSCAL
	LAC	VPIN30		/SET UP CORRECT BRANCH IN
	DAC	VPIN10		/INTERRUPT HANDLER
	LAC	VPNT20		/SET UP CORRECT BRANCH TO
	DAC	VPNMPT		/GET ANOTHER CHARACTER
	LAC*	VPARGP
	JMS MEMORY		/(RCHM-113) CHECK BUFFER ADDRESS.
	LAC* VPARGP		/(RCHM-113) FETCH BUFFER ADDRESS.
	TAD	(2		/SKIP OVER HEADER PAIR
	DAC	VPNEWP		/POINTING AT FIRST WORD OF IOPS ASCII
	ISZ VPARGP		/BUMP TO WORD COUNT
	LAC* VPARGP
	DAC VPWCNT		/SAVE IT
	LAC* VPNEWP		/CHECK FOR LF (FORTRAN)
	SWHA
	RTR			/RIGHT JUSTIFY
	AND (177		/CLEAR JUNK
	SAD (12			/LF?
	JMP VPGETP		/YES. FORGET Y INCREMENT
	LAC	VPLF		/LOAD LINE FEED
	TAD	VPYPOS		/Y=Y-LF
	SMA			/ARE WE AT THE BOTTOM OF THE TUBE
	JMP	VPWR10
	LAW	-1		/INDICATES NO MORE CHARS IN WORD PAIR.
	DAC	VPTEMP
	JMP	VPFORM		/YES- RESET TO TOP OF SCREEN
VPWR10	DAC	VPYPOS		/SET Y POSITION
	TAD	VPDEL
	DAC	VPYCRD		/NO
VPGETP	LAC*	VPNEWP		/FIRST WORD OF PAIR
	DAC	VPWRD2
	ISZ VPWCNT		//WC OVFLO?
	SKP			/NO.
	JMP VPEOL		/YES. EXIT TO USER
	ISZ	VPNEWP
	LAC*	VPNEWP		/SECOND WORD OF PAIR
	DAC	VPWRD3
	ISZ	VPNEWP		/POINT TO NEXT PAIR
	LAW	-5
	DAC	VPTEMP		/FIVE CHARACTER COUNTER
VPGET	JMS	VPUNPK		/UNPACK CHARACTER
	JMP	VPDISP		/DISPLAY CHARACTER
				/END OF LINE, CR OR ALTMODE.
VPHERE	ISZ VPTEMP
	JMP	VPGET		/NO - GET ANOTHER CHARACTER
	JMP	VPGETP		/YES - GET ANOTHER WORD
	.EJECT
/IMAGE ASCII
VPIMAG	LAC*	VPARGP		/PTR TO BUFFER AREA
	DAC	VPNEWP
	JMS MEMORY		/(RCHM-113) CHECK BUFFER ADDRESS.
	LAC*	VPNEWP		/LOAD CONTENTS OF FIRST WORD
	AND	(377000		/TO GET WORD PAIR COUNT
	CLL; RTR; RTR; RTR; RTR		
	CMA			/COMPLEMENT TO SET UP
	TAD	(2		/COUNTER
	DAC	VPTEMP
	ISZ	VPNEWP		/MOVE PAST HEADER PAIR
	ISZ	VPNEWP
	LAC	VPIN30		/SET UP CORRECT BRANCH IN
	DAC	VPIN10		/INTERRUPT HANDLER
	LAC	VPNT30		/CORRECT BRANCH IN ORDER
	DAC	VPNMPT		/TO GET ANOTHER CHAR.
VPIM10	ISZ	VPTEMP		/WORD COUNTER
	SKP
	JMP	VPEOL		/CLEAR I/O BUSY, RESTORE AC
	LAC*	VPNEWP
	SMA			/IF OTHER THAN ZERO=NEW SCALE
	JMP	VPIM20
	JMS	VPSCAL		/JUMP TO SCALE ROUTINE
	LAC*	VPNEWP
VPIM20	DAC	VPWRD1
	ISZ	VPNEWP		/INCREMENT TO NEXT WORD
/TEST FOR SPECIAL CHARACTERS
	AND	(177		/GET JUST CHARACTER
	DAC	VPWRD1
	SAD (14
	JMS VPFRM
	DZM LSTFRM
	SAD	(15		/CR?
	JMP	VPIMCR		/YES
	SAD	(12		/LF?
	JMP	VPIMLF		/YES
	SAD	(175		/ALTMODE?
	JMP	VPNMPT		/YES
	SZA		/CHECK FOR NULL
	SAD	(177		/OR RUBOUT
	JMP	VPIM10		/GET NEXT CHAR IF SO
	SAD (20			/OVERPRINT?
	JMP VPNMPT		/YES. GET NEXT CHAR
	LAC	VPXPOS		/LOAD X POSITION
	DAC	VPXCRD		/X POS = X COORD
	TAD	VPSPAC		/ADD A SPACE TO X POS
	DAC	VPXPOS
	TAD	(-1777		/CHECK FOR END OF LINE
	SMA
	JMP	VPIM10		/END OF LINE REACHED
	LAC	VPYPOS
	TAD	VPDEL		/ADD A DELTA TO YPOS
	DAC	VPYCRD		/DEPOSIT IT IN YCRD
	LAC	VPWRD1		/LOAD LETTER IN AC
	JMP	VPOTHR
	.EJECT
VPDMNS	LAC	(LYDNS		/DUMP MODE-NON STORE
	DAC	VPMODE		/DEPOSIT NON-STORE IOT
VPDMSM	LAC*	VPARGP		/
	DAC	VPNEWP		/PTR TO BUFF AREA
	ISZ	VPARGP		/GET NEXT ARGUMENT
	LAC*	VPARGP
	DAC	VPTEMP
	CMA!IAC			/(RCHM-113) CONVERT WORD COUNT TO POSITIVE NUMBER.
	TAD VPNEWP		/(RCHM-113) ADD IN BUFFER ADDRESS.
	JMS MEMORY		/(RCHM-113) CHECK END OF BUFFER ADDRESS.
	LAC	VPIN40		/SET UP CORRECT BRANCH FOR
	DAC	VPIN10		/INTERRUPT HANDLER
VPMRPT	LAC*	VPNEWP		/SET UP FOR IOT
	RTR; RTR; RTR; RTR		/GET INTO AC 8-17
	AND	(1776
	DAC	VPXCRD		/GET JUST X CRD IN 9 RIGHT MOST BITS
	DAC	VPXPOS
	LAC*	VPNEWP
	RCL
	AND	(1776		/Y COORDINATE
	DAC	VPYCRD
	DAC	VPYPOS		/GET JUST Y CRD IN 9 RIGHT MOST BITS
	JMP	VPIOT
VPMPTS	ISZ	VPNEWP
	ISZ	VPTEMP		/WORD COUNTER
	JMP	VPMRPT		/GET ANOTHER CHAR
	JMP	VPEOL		/RETURN TO USER
	.EJECT
VPWAIT	LAC*	VPCALP		/GET CAL
	AND	(1000		/CHECK BIT 8
	SZA
	JMP	VPWATR		/WAITR
	LAC	VPIOBY		/GET BUSY SWITCH
	SZA
	JMP	VPBSY		/BUSY RETURN TO CAL
	JMP	VPRET		/NOT BUSY, RETURN PAST CAL
VPWATR	LAC	VPIOBY		/GET BUSY SWITCH
	SNA
	JMP	VPIGNR		/NOT BUSY, RETURN PAST CAL
	LAC	VPCALP		/BUSY, GET RESTORE BITS
	AND	(700000
	DAC	VPCALP		/SAVE THEM
	LAC*	VPARGP		/GET USER'S ADDRESS FROM LOC+2
	AND	(77777		/CLEAN OUT BITS 0-2
	XOR	VPCALP		/INSERT RESTORE BITS
	DAC	VPARGP		/SAVE IN RETURN POINTER
	JMP	VPRET		/AND GO THERE
	.EJECT
VPCLOS	LAC	VPIOBY		/CHECK IF I/O BUSY AND RETURN WHEN IT IS
	SZA		/OTHERWISE LOOP ON .CLOSE MACRO
	JMP	VPBSY		/I/O IS BUSY
	JMP	VPRET		/RETURN TO USER
VPFST	LAC*	VPCALP		/GET CAL
	AND	(3000		/CHECK BITS 7&8 TO SEE IF THIS
	SAD	(3000		/IS AN FSTAT
	JMP	VPFST1		/YES
	JMP	VPIGNR		/NO, RETURN TO USER
VPFST1	LAC* VPARGP			/PUT 0 IN BITS 0-2
	AND (77777
	DAC* VPARGP
	CLA
	JMP	VPIGNR		/RETURN TO USER
	.EJECT
/ROUTINE TO SET UP DISPLAY
VPDISP	LAC	VPWRD1		/LOAD CHARACTER
	AND	(177		/GET JUST THE CHARACTER
	SAD (12		/LF??
	JMP VPASLF		/YES.
ZZ	SAD (14	/FF?
	JMS VPFRM	/YES
	DZM LSTFRM
	SAD	(15		/CR?
	JMP	VPCR		/YES
	SAD	(175		/ALTMODE?
	JMP	VPALTM		/YES
	SZA		/CHECK FOR NULL CHARACTER
	SAD	(177		/OR RUBOUT
	JMP	VPHERE		/GET NEXT CHARACTER
	DAC	VPWRD1		/DEPOSIT CHARACTER
	.IFDEF	VPA.S
	LAC	(LAC	VPLF	/RESTORE INSTRUCTION CHANGED ON OCCURENCE
	DAC	VPASLF		/OF A FORM FEED ON OUTPUT.
	.ENDC
	LAC	VPXPOS
	DAC	VPXCRD
	TAD	VPSPAC
	DAC	VPXPOS		/IN X POSITION
	TAD	(-1777
	SMA
	JMP	VPHERE		/POSITIVE=WE AT THE END OF THE LINE
	LAC	VPWRD1
	SNA		/OTHER THAN ZERO
	JMP	VPNMPT		/GET ANOTHER CHARACTER IF ZERO
/CHECK FOR NON PRINTING CHARACTERS SUCH AS SPACE & TAB
VPOTHR	SAD	(40
	JMP	VPSCE		/SPACE
	SAD	(11
	JMP	VPTAB1		/TAB
/SET UP FOR DISPLAY
VPDC	AND	(77
	RCL			/CLL!RAL
	TAD	VPDCTB		/ADD BASE ADDRESS, DISPLAY TABLE
	DAC	VPCHAD		/FIRST WORD ADDRESS
	LAW	-2
	DAC	VPCNTW		/SECOND WORD ADDRESS
	LAW	-21
	DAC	VPCNTB		/17 BITS (1ST WORD) COUNTER
	LAC*	VPCHAD		/FIRST DISPLAY WORD
	RCL
	DAC	VPTEM		/SAVE REST OF 17 BITS
VPDCB	LAW	-7
	DAC	VPCNTD		/7 BIT LINE COUNTER
VPDCD	LAC	VPTEM		/FETCH DISPLAY WORD
VPDCF	RCL			/NEXT BIT IN LINK
	DAC	VPTEM		/SAVE THE REST
	LAC	VPYCRD
	TAD	VPDEL		/ADD DELTA (1 UNIT)
	DAC	VPYCRD		/TO COORDINATE
	SZL			/BIT SET?
	JMP	VPIOT		/ISSUE IOT
VPIT	ISZ	VPCNTB		/ANY MORE POINTS
VPSKP	SKP			/NO?
	JMP	VPDCC		/YES, CHECK WORD
	ISZ	VPCNTD		/LINE DONE?
	JMP	VPDCD		/NO, NEXT BIT
	LAC	VPYPOS
	TAD	VPDEL
	DAC	VPYCRD
	LAC	VPXCRD		/MOVE X COORDINATE
	TAD	VPDEL
	DAC	VPXCRD		/RESET FOR NEW LINE
	JMP	VPDCB
VPDCC	ISZ	VPCNTW		/SECOND WORD?
	JMP	VPDCE		/NO, SET IT UP
VPDF2	LAC	VPYPOS		/Y POSITION
	TAD	VPDEL		/ADD DELTA
	DAC	VPYCRD		/NEW Y COORD
VPSCE=.
	ISZ	VPTAB		/INCREMENT TAB COUNTER
	JMP	VPNMPT		/IF NOT 0 GET ANOTHER CHAR
VPTB1	LAW	-10		/OTHERWISE INITIALIZE TAB COUNT
	DAC	VPTAB
	JMP	VPNMPT		/THEN GET ANOTHER CHAR
VPDCE	ISZ	VPCNTD		/INCREMENT LINE COUNT
	LAW	-22
	DAC	VPCNTB		/18 BITS (2ND WORD)
	ISZ	VPCHAD		/MOVE POINTER TO SECOND WORD
	LAC*	VPCHAD		/FETCH IT
	JMP	VPDCF
VPDFF	LAC	(LYBD		/RESET PROPER IOT IN EXIT SEQUENCE.
	DAC	VPMODE
	LAC	(2000		/RESET Y TO TOP OF TUBE.
	TAD	VPLF
	DAC	VPYPOS
	DZM VPXPOS		/RESET X TO LEFT HAND MARGIN
	LAW -10			/AND RESET TAB COUNTER
	DAC VPTAB
	LAC	VPIN30
	DAC	VPIN10		/SET UP RETURN FOR ANOTHER CHAR
	LAW	-1
	TAD	VPTAB
	DAC	VPTAB		/SET PROPER TAB
	JMP	VPDF2		/GET NEXT CHAR
	.EJECT
VPIOT	LAC	VPXCRD		/SET UP X COORDINATE
	LXB
	ISZ	VPINTF		/SKIP IF EXIT FROM INTERRUPT
	JMP	VPCAL1		/EXIT FROM CAL
VPSW2	IOF			/MAKE SURE WE AREN'T INTERRUPTED
				/CHANGED TO NOP ON API INTERRUPTS
	LAC	VPYCRD		/SET UP Y COORDINATE AND DISPLAY
	XCT	VPMODE		/DISPLAY IOT
VPEOL1	LAC	VPAC		/RESTORE INTERRUPT AC
VPSW1	XX			/RESTORE PIC
	DBR
	XCT	.+1
	XCT	(JMP*	VPPC
VPCAL1	LAC	VPYCRD		/SET UP Y COORDINATE AND DISPLAY
VPMODE	XX			/SCOPE IOT
	LAC (2
	700721	/ENABLE INTERRUPT
VPCAL2	DBR
	XCT	.+1
	XCT	(JMP*	VPARGQ
VPNMPT	XX			/IS LOADED WITH VPNT20 OR VPNT30			
VPNT20	JMP	VPHERE		/GET ANOTHER IOPS ASCII CHAR
VPNT30	JMP	VPIM10		/GET ANOTHER IMAGE ASCII CHAR
	.EJECT
VPCR	DZM	VPXPOS		/X=2
	LAW -10
	DAC VPTAB
	JMP	VPEOL		/RETURN TO USER
VPASLF	LAC	VPLF		/LINE FEED(CHANGED TO JMP VPNMPT
				/IN VPA.S ON OCCURENCE OF FORM FEED)
	TAD	VPYPOS
	SPA			/ARE WE AT THE END OF THE TUBE
	.IFUND	VPA.S
	JMP	VPFORM
	.ENDC
	.IFDEF	VPA.S
	JMP	VPACS
	.ENDC
	DAC	VPYPOS		/NO - REPOSITION Y BEAM
	TAD	VPDEL		/ADD DELTA TO X COORD
	DAC	VPYCRD
	JMP	VPNMPT		/GET ANOTHER CHARACTER
	.IFDEF	VPA.S
VPACS	LAC	(JMP VPNMPT
	DAC	VPASLF
	JMP	VPFORM
	.ENDC
VPALTM	LAC	VPLF		/ADD TO Y-COORD
	CMA; TAD	(1
	TAD	VPYPOS
	DAC	VPYPOS
	JMP	VPEOL		/RETURN TO USER
VPFRM	XX		/THIS CHAR. IS FF
	SAD LSTFRM	/IGNORE IF LAST CHAR.
	SKP
	JMP VPFORM	/NO, LAST CHAR. WAS NOT A FF
	CLA		/YES, LAST CHAR. WAS A FF
	ISZ VPFRM	/PRETEND THIS CHAR. IS NULL
	JMP* VPFRM
VPFORM	LAC (14
	DAC LSTFRM
	LAC (700000
	DAC	VPIN10
	LAC	VPIN50
	ISZ	VPIN10
	JMP	.-2
	DAC	VPIN10
	.IFUND	VPA.S
VPEST	LAC	(EST
	.ENDC
	.IFDEF	VPA.S
VPEST	LAS
	SMA
	JMP	.+3
	LAC	(NOP
	SKP
	LAC	(EST
	.ENDC
	DAC	VPMODE
	JMP	VPIOT
VPTAB1	ISZ VPTAB	/TEST TAB
	SKP
	JMP VPTB1	/ALL DONE
	LAC VPXPOS
	TAD VPSPAC	/ADD A SPACE
	DAC VPXPOS
	JMP VPTAB1
VPEOL	DZM	VPIOBY		/CLEAR I/O BUSY
	ISZ	VPINTF		/RETURN FROM INTERRUPT
	JMP	VPCAL2		/NO; CAL INSTRUCTION
	JMP	VPEOL1		/RETURN FROM INTERRUPT
	.EJECT
/ROUTINE TO UNPACK IOPS ASCII TO IMAGE ASCII
VPUNPK	XX
	LAW	-7
	DAC	VP7BTS		/SET UP COUNTER FOR 7 BITS
VPALL7	LAC	VPWRD3		/LOAD FIRST WORD
	RAL
	DAC	VPWRD3
	LAC	VPWRD2		/LOAD RECORD WORD
	RAL
	DAC	VPWRD2
	LAC	VPWRD1
	RAL
	DAC	VPWRD1		/UNPACKED CHARACTER
	ISZ	VP7BTS		/CHECK IF SEVEN BITS ARE DONE
	JMP	VPALL7		/ROTATE AGAIN
	JMP*	VPUNPK		/CHARACTER IS UNPACKED - RETURN
	.EJECT
/SCALE ROUTINE TO SET UP LF,SPACE, AND DELTA
VPSCAL	XX
	AND	(370000		/PICK UP SCALE
	RCL; RTL; RTL; RTL		/GET SCALE IN BITS 13-17
	DAC	VPDEL		/DELTA
	CMA
	TAD	(1		/SET UP A COUNTER
	DAC	VPCNT
	DZM	VPLF
	DZM	VPSPAC
VPMORE	LAC	VPLF		/GET CORRECT LINE FEED ACCORDING
	TAD	(-11		/TO THE SCALE USED
	DAC	VPLF
	LAC	VPSPAC		/GET CORRECT SPACE ACCORDING
	TAD	(7		/TO THE SCALE USED
	DAC	VPSPAC
	ISZ	VPCNT		/TEST COUNTER
	JMP	VPMORE		/INCREMENT TO PROPER SCALE
	JMP*	VPSCAL		/0? RETURN
VPIMCR	DZM	VPXPOS		/X=0
	JMP	VPTB1		/GET ANOTHER CHARACTER
VPIMLF	LAC	VPLF		/YPOS=YPOS+LF
	TAD	VPYPOS
	SPA			/IF NEGATIVE OFF SCREEN
	JMP	VPFORM
	DAC	VPYPOS		/REPOSITON BEAM
	TAD	VPDEL		/ADD DELTA TO Y COORD
	DAC	VPYCRD		/
	JMP	VPNMPT		/GET ANOTHER CHARACTER
	.EJECT
VPIMSP	LAC	VPXPOS		/XPOS
	TAD	VPSPAC		/+SPACE
	DAC	VPXPOS
	JMP	VPNMPT		/GET ANOTHER CHARACTER
	.EJECT
VPINT	SKP			/PIC ENTRY
	JMP	VPAPI		/API ENTRY
	DAC	VPAC		/SAVE AC
	LAC	VPION		/ION INTO INTERRUPT RETURN SEQUENCE
	DAC	VPSW
	DAC	VPSW1
	LAC	(IOF
	DAC	VPSW2
	LAC*	(0		/PIC RETURN ADDR. IN LOC 0
	DAC	VPPC		/INTO RETURN PC
	JMP	VPSTOR
VPAPI	DAC	VPAC		/API ENTRY - SAVE AC
	LAC	VPINT		/GET RETURN ADDRESS
	DAC	VPPC		/SAVE IT
	LAC	(NOP		/DO NOT ALTER STATE OF PI
	DAC	VPSW		/ON AN API INTERRUPT AS WE CAN'T BE INTERRUPTED
	DAC	VPSW1
	DAC	VPSW2
	LAC	VPSKP		/RESTORE SKIP
	DAC	VPINT
VPSTOR	CLC			/SET INTERRUPT FLAG
	DAC	VPINTF
	CDDF			/CLEAR DISPLAY DONE FLAG
VPSW	ION			/THIS INSTRUCTION IS COMPUTED
	LAC	VPIOBY		/SEE IF HANDLER IS BUSY IN CASE
	SZA			/IGNORE INTERRUPT IF ERASE BUTTON PUSHED
VPIN10	XX
/VPIN10 GETS ONE OF THE FOLLOWING JUMPS DEPENDING ON EXPECTED ACTION
VPIN20	JMP	VPEOL		/CLEAR I/O BUSY
VPIN30	JMP	VPIT		/ANY MORE PTS
VPIN40	JMP	VPMPTS		/ANY MORE PTS FROM DUMP MODE
VPIN50	JMP VPDFF		/RETURN FROM FORM FEED.
	.EJECT
VPDCTB	.DSA	VPDCTB+1
	175115; 266336	/COMMERCIAL 'AT' (@)
	374110;	442376		/A
	377114;	462266		/B
	175014;	060242		/C
	377014;	060276		/D
	377114;	462301		/E
	376110;	442201		/F
	175015;	064262		/G
	376100;	402177		/H
	001017;	760200		/I
	141004;	020077		/J
	376101;	210501		/K
	377004;	020100		/L
	376020;	600577		/M
	376020;	202177		/N
	175014;	060276		/O
	376110;	442206		/P
	175015;	050336		/Q
	376111;	452306		/R
	115114;	462262		/S
	002017;	740201		/T
	177004;	020077		/U
	076404;	010037		/V
	376401;	410177		/W
	306240;	405143		/X
	006047;	401003		/Y
	303214;	461303		/Z
	001774;	060200		/[
	004040;	404040		/\
	001014;	077600		/]
	020067;	741410		/^
	020340;	402010		/BACK ARROW
	0;	0;		/SPACE
	000005;	740000		/!
	000070;	001600		/"
	121761;	217612		/#
	115117;	762262		/$
	106230;	431142		/%
	155115;	310120		/&
	0;	340000		/'
	000342;	120200		/(
	001012;	107000		/)
	050103;	702024		/*
	020103;	702010		/+
	660700;	0		/,
	020100;	402010		/-
	301400;	0		/.
	100200;	401002		//
	175014;	057400		/0
	001027;	760000		/1
	345114;	462306		/2
	103114;	662661		/3
	060241;	137620		/4
	137114;	462261		/5
	175114;	462262		/6
	202411;	042207		/7
	155114;	462266		/8
	115114;	462276		/9
	331540;	0		/:
	666730;	0		/;
	000101;	210400		/<
	120502;	412050		/=
	000421;	202000		/>
	004015;	441400		/?
	.EJECT
VPCALP	0			/CAL POINTER
VPARGP	0				/ARGUMENT POINTER
VPAC	0			/SAVE AC IN INTERRUPT HANDLER
VPPC	0			/PIC RETURN
VPWRD1	0				/CHAR TO BE DISPLAYED
VPWRD2	0			/IOPS ASCII UNPACK
VPWRD3	0			/IOPS ASCII UNPACK
VPTEMP	0			/CHAR COUNTER IN  IMAGE AND IOPS ASCII
VPCNT	0			/SET UP IN VPSCAL
VPSPAC	0			/SET UP IN VPSCAL
VPLF	0			/SET UP IN VPSCAL
VPNEWP	0
VPDEL	0			/DELTA FOR PROPER SPACING
VP7BTS	0			/SET UP IN VPUNPK
VPCHAD	0			/FIRST WORD ADDRESS OF CHAR ARRAY
VPCNTW	0			/SET UP IN VPDISP
VPCNTB	0			/SET UP VPDISP
VPTEM	0
VPCNTD	0
VPXPOS	0			/X POSITION
VPYPOS	0			/Y POSITON
VPPICS	0			/PIC STATUS
VPINTF	0			/-1 WHEN PROCESSING INTERRUPT
VPARGQ	0			/RETURN PC ON .WRITE OR .INIT CAL
VPION	ION			/TURN PIC ON CONSTANT
VPWCNT	0		/WORD COUNT FOR IOPS ASCII
LSTFRM	0	/14 IF LAST CHAR. WAS FF, ELSE 0
	.END	VPA.
