/	WPCX - CHARACTER-ORIENTED COMMUNICATION PROGRAM
/
/
/	059	EMcD	4-Sep-85	8 bit to 7 bit NRC conversion
/					support
/	058	MART	09-JUL-85	RESTART ON RETURN FROM GRAPHICS
/	057	EMcD	27-Jun-85	Stop CX with Printer while
/					Print Screen going
/	051-056 EMcD	02-Apr-85	Patches for 8 bit and hole blaster
/	050	EMCD	28-FEB-85	Add DECDEV switch
/	049	DFB	29-NOV-84	Fix DS, DH, DP problems when Gold Halt
/	048	ECH	30-AUG-84	ALLOW GOLD HALT TEST IN HP AND DP MODES
/					MOVED KBTICH AND KBTOCH TO WPCOM
/	047	ECH	17-AUG-84	CHANGES BECAUSE OF MOVING DSKGCH FROM
/					WPCOM PHICS
/	045	DFB	20-APR-84	FIX TO LOAD PAGE 0 PRTFLD VT125 MODE
/	044	DFB	27-MAR-84	CHANGE GRAPHICS TO LOAD EVERY TIME
/	043	WJY	17-FEB-84	IMPLEMENT DMIIV1.5 FUNCTIONALITY ON DMI
/	042	SBB	20-JAN-84	STOP CRASH IN VT52 HD DOC ALMOST FULL
/	041	SBB	26-SEP-83	CHANGES FOR VT125 EMULATION
/	040	HLP	13-SEP-83	DELETE PRLOCK SINCE DECMATE
/					IS SINGLE USER
/	039	GDH	20-JUL-83	CHANCE DECMATE
/					IS SINGLE USER
/	039	GDH	20-JUL-83	CHANGES TO ACCOMODATE LOGON ENTRY TO
/					NOT CLEAR SCREEN WHEN ENTRING.
/	038	HLP	10-JUN-83	CHANGE PRINTER PAGE SIZE FROM CT TO
/					SIZE OF LAST DOCUMENT PRINTED
/	037	DFB	31-MAY-83	FIX TO HALT WHEN CX TD
/	036	GDH	18-MAY-83	MOVED LARGE BUFFER TO FIELD 6.
/	035	GDH	14-APR-83	ALTER RETURN TO MAIN MENU CODE TO
/					CALL COMM CLEANUP CODE.
/	034	GDH	1-APR-83	FIX SO THAT HD REMEMBERS DOC NAME.
/	033	HLP	25-FEB-83	PRASF NOW PART OF LPONLN
/					IN PRINTER FIELD
/	032	GDH	10-JAN-83	SET TERMINAL TO NUMERIC KEYPAD & CURSOR
/					TO CURSOR MODE ON START UP.
/	031	HLP	16-DEC-82	REMOVE JSTRT ON PRJOB WHEN EXIT CX
/	030	HLP	02-DEC-82	FIX NO SHEETS FED TO LQPSE BUG #273
/	029	GJP	15-OCT-82	FIX WPCRE BUG
/	028	SBB	15-OCT-82	CORRECTLY INITIALIZE TERMINAL MODES
/	027	HLP	14-OCT-82	REWORKED HANDLING OF PRSTTS AND PRLOCK
/					ON ENTERING AND LEAVING BLANK SCREEN
/					(THIS FIXED DM-II BUG #152)
/					DELETED REFERENCES TO USERNO
/	026	MJS	07-OCT-82	MOVED THE CALL TO "DLMCX2" TO "CONFG2"
/					(THIS MENU CALL WILL BE EXECUTED BEFORE
/					THE "AC7777; HS2OU" WHICH DOES AN "XON")
/					THEREFORE THE "XON" WILL BE ISSUED
/					AFTER THE USER SELECTS OPTIONS
/	025	HLP	01-OCT-82	DO DCA PRSTTS ONLY IF "BUSY"
/	024	HLP	29-SEP-82	RESET PRLOCK WHEN EXIT CX
/	023	HLP	23-SEP-82	DELETED DCA PRSTTS SO PRINTER ERRORS
/					WILL NOT BE ERASED WHEN RETURN TO MENU
/	022	HLP	09-SEP-82	CONDOR CONDITIONALIZED EDIT 021
/	021	HLP	03-SEP-82	FURTHER TERMINAL MODE CHANGES
/	0020	HLP	29-JUL-82	APPARENT BUG AT CONFG2 FIXED
/					ELIMINATE EXTRA DEFINITIONS OF IO CALLS
/	0019	GJP	16-JUN-82	DURING CX, USER CHOSE GOLD MENU, HUNG
/					SYSTEM BUG FIXED.
/	0018	GDH	25-MAR-82	ALLOW CX TO RUN W/O HARDWARE BUT MAKE
/					SURE HARDWARE IS PRESENT FOR HOST.
/	0017	GDH	15-MAR-82	FIXED CONDITIONAL FOR WPMAG.
/	0016	GDH	08-MAR-82	CLEAR DOC TRANSFER "WAIT" FLAG.
/	0015	GDH	24-DEC-81	RETRIEVE CXTMOD INTO VTMODE ON STARTUP.
/	0014	GDH	17-NOV-81	DETECT NON-EXISTENT PRINTER FOR XP.
/	0013	GDH	19-OCT-81	MERGED SOME BUG FIXES FROM THE WS200
/					SYSTEM (V4.4).
/	0012	GDH	18-OCT-81	REMOVED WS102 CONDITIONALS.
/	0011	GDH	17-OCT-81	ADDED TM OPTION SUPPORT FOR DWORD.
/					ALSO BUG FIX FOR USER ESC SEQS.
/	0010	GDH	13-OCT-81	DE-IMPLEMENTED LOCK/UNLOCK.
/	0007	GDH	5-OCT-81	AUTO PAGINATION FOR ASF PRINTERS.
/	0006	GDH	23-SEP-81	ELIMINATED PAGE ZERO CIF/CDF STUFF.
/	0005	GDH	26-AUG-81	WPFILS CALLING SEQ CHANGES.
/	0004	GDH	21-AUG-81	REMOVED SUPERFLUOUS CONDITIONALS.
/					ADDED VT52 EMULATION.
/	0003	JM	17-JUN-81	ADDED WS80 TERMINAL MODE
/	0002	JM	02-JUN-81	RESTORE TERMINAL ATTRIBUTES AFTER
/					GOLD MENU (FOR WS80 AND VT278)
/					AND SET TERMINAL TO VT100 MODE AFTER
/					\R (FOR WS80)
/	0001	JM	12-MAY-81	CHANGES TO ALLOW COM TO WS80
/					SERIAL LQP
/
/	3.0	MB	8-AUG-78	ADD FORMATABLE SEND DOCUMENT FEATURE
/	QA3.4	KEE	13-APR-78	FIX CX BUG WHEN DISKETTE OVERFLOWS
/	III.C	KEE	27-FEB-78	REMOVE COMM SETTINGS STUFF AND FIX SO
/					THAT MAGCRD HAS SEPARATE BINARIES
/					FROM CX
/	III.3	KEE	3/7/78		CHANGE TRANSFER LOCATION FOR MAGCRD
/	2.7-3	KEE	1/14/78		FIXES FOR MAG CRD INSTALATION
/	2.7-2	KEE	1/5/78		MOVE CLEAR SCREEN AFTER OPTIONS
/					SPECIFIED
/	2.5.1	KEE	11/9/77		FIX BUG IN \R PROCESSING WHEN ONLY
/					AN INPUT FILE AND NO OUTPUT FILE
/					IS SPECIFIED.
/	2.5.1	KEE	11/7/77		PUT IN DISK OVERFLOW TESTS
/	2.4B	KEE	10/10/77	CLEAN UP CODE
/	2.P-5	RLT	9/23/77		FIX FOR WT ASM
/	2.P-4	KEE	9/21/77		PUT CX MENU DISPLAYS INTO 'MN'
/	2.K-1	RLT	8/31/77		CHANGE PAGINATION TO ASSEMBLE FOR WS78
/	2.J	KEE			ADD 4-FLOPPY SPECIFICATIONS
/	2.G-1	MB			GET IT FROM THE 78 PACK	8/8/77

/WTXBAR - WRITES OUT XBAR

	*200
	JMP I	.+3
	JMP I	.+1
	7605
	RXLOAD
	*RXLDLS
	RXEWT=4
	RXEWT
	0
	RXQBLK=11
	RXQBLK
	.

	DLOCX1
	100
	IFNDEF DECDEV <
	CDF 20								/M050
	>
	IFDEF DECDEV <
	CDF 30								/A050
	>
	-DSOCX1			/WRITE OUT NORMAL CX

	DLOCX2
	100
	IFNDEF DECDEV <
	CDF 30								/M050
	>
	IFDEF DECDEV <
	CDF 40								/A050
	>

	-DSOCX2								/M004

	DLCX2C
	CX2BFA

	IFNDEF DECDEV <	
	CDF 30								/M050
	>
	IFDEF DECDEV <	
	CDF 40								/A050
	>

	-DSCX2C

	DLCX2D
	CX2BFA

	IFNDEF DECDEV <	
	CDF 30								/M050
	>

	IFDEF DECDEV <	
	CDF 40								/A050
	>
	-DSCX2D
	
	
	DLCXHL			/Start at block				/A055
	CXHOLE			/From address				/A055
	CDF 60			/Resides in field 6			/A055
	-DSCXHL			/Size of CX Hole			/A055

	0





/WPCX - CHARACTER-ORIENTED COMMUNICATION PROGRAM

/PATCH WRITE OUT ROUTINE FOR DISKETTE LOAD


	IFNDEF DECDEV <
	FIELD 2
	>

	IFDEF DECDEV <
	FIELD 3
	>

	ADRASM=1		/INHIBIT CREATE ERROR MESSAGES

/RE-CONFIGURE THE SWITCHES

	BKSPAC=10
	LF=12
	CR=15
	BS=10
	TAB=11
	SRULER=16
	ERULER=17
	BLANK=40
	SPACE=BLANK
	SPC=SPACE
	SP=SPC
	QUEST="?-200
	RUBOUT=177
	CNTRLG=7
	ESC=33
	BELL=7
	FF=14
	VT=13
	NPAGE=14
	GPAGE=2014
	PARAGH=1012

	CREATE=3
	CUB1=6400		/THE BUFFER ADDRESS USED FOR THE CREATE

	*100			/THE FIRST 100 LOCATIONS ARE USED FOR THE SYSTEM

	CIFOTH=CIFEDT		/OTHER FIELD.				/A005
	CDFOTH=CDFEDT		/""     ""				/A005

	CIFMYF=CIFBUF		/WE RUN IN THE EDT FIELD.
	CDFMYF=CDFBUF		/WE RUN IN THE EDT FIELD.
	IFDEF	VT125R	<	/FOR VT125				/A041
	RGFLD=10		/REGIS RUN-TIME FIELD=1			/C046
	PRMFLD=50		/PRIMITIVES RUN TIME FIELD=5		/C046
	PRGFLD=60		/PRIM/REGIS COMBO FIELD=6		/C046
	PRIM= 200		/CALLING ADR FOR PRIMITIVES		/A041
	REGIS=177		/CALLING ADR FOR REGIS			/A041
			>	/END IFDEF VT125R			/A041

/HERE ARE SOME FLAGS AND IMPORTANT LOCATIONS USED BY THE ROUTINES

/THE NEXT 4 LOCATIONS MUST BE IN THIS ORDER FOR MAGCRD ASSEMBLIES - THEY
/ARE COPIED TO THE OTHER FIELD PRIOR TO CALLING THE COMM ROUTINES

/ACTION FLAGS, WITH VALUES AS FOLLOW
/THE FLAG WORD IS NONZERO WHEN THERE THERE IS SOMETHING COMING FROM
/THE CORRESPONDING DEVICE.  FOR EXAMPLE, THE KEYBOARD, OR A DISK FILE
/TO BE READ.
/THE BIT(S) WHICH ARE NONZERO CORRESPOND TO WHERE THE SOMETHING IS TO BE
/PUT.  FOR INSTANCE, TO THE PRINTER, THE SCREEN, ETC.

DKTFLG,	0			/DISK INPUT
H2TFLG,	0			/INPUT FROM THE HOST
KBTFLG,	0			/KEYBOARD INPUT
LPTCNT,	0			/# OF LINES LEFT ON THE PRINTER PAGE	/A007

/THE BITS WHICH CAN BE SET ARE -

CRT=1				/TO THE SCREEN
LQP=2				/TO THE PRINTER
HST=4				/TO THE SECONDARY COMMUNICATIONS LINE
H2T=10				/PRIMARY COMMUNICATIONS LINE (H2T)
IBM=H2T
DOC=20				/WITH OUTPUT FILE (DISK)

ERFLG,	0			/NONZERO CORRESPONDING TO TYPE OF ERROR DETECTED
				/(LAST OF THE 4 CRITICAL LOCATIONS)
EXITFL,	0			/TIME TO EXIT WHEN SET!			/A035

/THE KEYBOARD PROGRAM

CRLFFL,	0
KBTCHR,	0
K2HCHR,	0			/TTY CHAR W/ 200 BIT (FOR USER ESC).	/A011
KBTFL1,	0
KBTOXL,	0

/SOME VALUES USED BY HOST2

H2TCHR,	0
H2TOXL,	0
H2TFLX,	0

/LOCATIONS USED FOR THE DOCUMENT NUMBERS FOR READ AND WRITE
/WHEN BOTH ARE NON-ZERO, THE DISK JOB IS ACTIVE AND THE CORRESPONDING
/DOCUMENTS ARE OPEN.  WHEN BOTH ARE ZERO, NO ASSUMPTIONS CAN BE MADE ABOUT
/THE DISK JOB.

OTFILE,	0
ITFILE,	0

/LOCATIONS CONTAINING THE FILE NUMBERS FOR UNOPENED FILES WHICH HAVE BEEN
/SPECIFIED.  IT IS ASSUMED THAT THE CORRESPONDING FILE NUMBERS (OTFILE AND
/ITFILE) ARE ZERO WHEN THESE ARE NON-ZERO.

OTFIL2,	0
ITFIL2,	0

/FLAG FOR THE PRINTER

CNGPFG,	0

/THE FLAG THAT SAYS THAT THERE IS SOMETHING WORTH DOING

NONBNK,	0
DKACTF,	0			/THE ACTION FLAG BETWEEN THE DISK ROUTINE
				/TO THE MAIN PROG.
TSTFLG,	0			/FLAG INDICATING TEST MODE
EXRLR,	0			/FLAG USED BY DSKJOB TO TELL IF IN A RULER
RSNFLG,	0			/IF NON ZERO THIS TELLS DSKJOB TO PAUSE AND
				/WAIT FOR HT2JOB TO FINISH USING THE HOST
				/LINE FOR SENDING.


TSTACF,	0			/SET WHEN THE TEST JOB IS RUNNING.	/A013
HSTACF,	0			/SET WHEN THE HOST JOB IS RUNNING.	/A013
DSKACF,	0			/SET WHEN THE DISK JOB IS RUNNING.	/A013

EZLINK,	0			/SET WHEN TM=EZLINK.			/A035
PLDADR,	PRTLOD			/Address of print load routine		/A051
PRFLBK,	0			/Print Fallback flag			/A051
PRTREQ,	0			/ Printer requested flag		/A051
/
/	N O T E ......
/
/	The "Options" tables TAB1 to TAB4 which used to reside in WPCOM /A059
/	have been moved here for space reasons				/A059
/

TAB1,
	IFDEF ENGLSH <
	"K-200							/A059
	"H-200							/A059
	"T-200							/A059
	"D-200							/A059
	>
	IFDEF ITALIAN <
	"T-200							/A059
	"O-200							/A059
	"C-200							/A059
	"D-200							/A059
	>
	IFDEF V30NOR <
	"T-200
	"V-200
	"K-200
	"D-200
	>
	IFDEF V30SWE <
	"T-200
	"A-200
	"D-200
	"X-200
	>



	-1							/A059

TAB2,	KBTFLG							/A059
	H2TFLG							/A059
	TSTFLG							/A059
	DKTFLG							/A059
	-1							/A059

TAB3,	
	IFDEF ENGLSH <
	"S-200							/A059
	"P-200							/A059
	"H-200							/A059
	"D-200							/A059
	>
	IFDEF ITALIAN <
	"V-200							/A059
	"S-200							/A059
	"O-200							/A059
	"D-200							/A059
	>

	IFDEF V30NOR <
	"B-200							/A059
	"S-200							/A059
	"V-200							/A059
	"D-200							/A059
	>

	IFDEF V30SWE <
	"B-200
	"S-200
	"A-200
	"D-200
	>

	-1							/A059
TAB4,	CRT			/ Screen			/A059
	LQP			/ LQP Printer			/A059
	H2T			/ Primary Host			/A059
	DOC			/ Output Document		/A059

	




/------------------
	PAGE

/CX 

XBSTRT,	XX			/CALLED BY JMS FROM CVOVRL
	CLA
	RDF
	TAD	CIDF0
	DCA	RTNCER
	CDFMYF

	JMS	XBSBUF		/SET THE BUFFERS UP FOR CX IN EDITOR
				/FIELD FOR CX2 AND SET UP TERMINAL
				/MODE FROM CXTMOD			/A021
	JMP	CONFG1		/SKIP GOLD-HALT STUFF

/CONFIG IS THE ENTRY POINT WHEN WE RETURN TO THE CX MENU		/A021
/FROM A \R OR \H, OR FROM A GOLD HALT					/A021
CONFIG,  IFDEF CONDOR <							/A022
	JMS	CFGXXX		/SAVE TERMINAL MODE & STOP DISK JOB	/C021
	>	/IFDEF CONDOR						/A022
	IFNDEF CONDOR <							/A022
	JMS	DKACTS		/STOP THE DISK JOB			/A002
	>	/NDEF CONDOR						/A022

CONFG0,	CIFSYS
	TTYIN
	JMP	CONFG1		/READ CHARACTERS UNTIL EMPTY BUFFER
	JMP	CONFG0

CONFG1,	JMS	CLRFLG		/CLEAR FLAGS				/M003
/D049	DCA	RSNFLG							/A048
/D049	DCA	HSTACF							/A048
/D049	DCA	DSKACF							/A048

CONFG2,	CLA			/ Clear out Rubbish			/A057
	TAD	PRTREQ		/ Check if Print required flag was set	/A057
	SNA CLA			/ 					/A057
	JMP	CNFG2A		/ Wasn't set so forget it		/A057
	DCA	PRTREQ		/ Was , so Unset it			/A057
	CDFMNU			/ Point to Menu field			/A057
	TAD I	(MUBUF+MNPULD)	/ Get "Non Printer Printer Busy" Flag 	/A057
	AND	(3777)		/ Strip of the 4000 bit			/A057
	DCA I	(MUBUF+MNPULD)	/ And replace it			/A057
	CDFMYF			/ Point back here			/A057

CNFG2A,	CIFMNU			/CALL COMMUNICATIONS MENU		/A026
	JMS I	MNUCAL							/A026
	DLMCX2								/A026

	AC7777
	CIFSYS
	HS2OU
	CLA
	TAD	(CNLINE-1)
	DCA	X2
CON1,	TAD I	X2
	SNA
	JMP	CON2		/DONE IF 0
	JMS	KBTOCH
	JMP	CON1

CON2,	JMS	KBTICH		/GET EDIT INPUT
	TAD	(-EDMENU)						/M057
	SNA								/M057
	JMP	RTNSY		/GOLDM					/M057

/
/	The "stuff" to handle most of the input cosmetics is now 	/A057
/	Blasted in							/A057
/

	JMS	CLRPAN		/ clear panel if VT125			/a058
	JMS	BHOOK		/ Call Blaster				/A057
 	CXKBIN								/A057
	  JMP	CONCR1		/ End of Input seen			/A057
	JMS	RESPAN		/ restore panel if			/a058
	  JMP	CON2		/ Go try for more			/A057

CONCR1,	JMS	RESPAN		/ restore panel if vt125		/a058
	JMP	CONCR		/ end of inpt screen			/a058

/***********************************************************************/a058
/ CLRPAN Clear out the first block of panel memoryry before 
/        blaSTING IF it is a VT125 GRAPHICS term emulator
/***********************************************************************/a058

CLRPAN,	XX			/ return address			/a058
	DCA	RESPAC		/ save ac				/a058
	JMS	CHK125		/ ARE WE A VT125?			/A058
	SKP			/ yes					/a058	
	JMP	CLRPN1		/ NO JUST RETURN			/A058
	JMS	BHOOK		/ CALL BLASTR				/A058
	-MVSWEN			/ MOVE OUT SWAP AREA TABLES		/A058
CLRPN1,									/A058
	TAD	RESPAC		/ restore ac				/a058
	JMP I	CLRPAN		/ RETURN		


/***********************************************************************/a058
/ RESPAN restore the fisrst block of panel memory once we have blasted	/a058
/	 if it is a VT125 emulator					/a058
/***********************************************************************/a058

RESPAN,	XX			/ RETURN ADDRESS			/A058
	DCA	RESPAC		/ save ac				/a058
	JMS	CHK125		/ ARE WE A VT125?			/A058
	SKP			/ yes					/a058
	JMP	RESPN1		/ NO JUST RETURN			/A058
	JMS	BHOOK		/ CALL BLASTR				/A058
	MVSWEN			/ MOVE BACK SWAP AREA GRAPHICS TABLES	/A058
RESPN1,									/A058
	TAD	RESPAC		/ restore ac				/a058
	JMP I	RESPAN		/ RETURN				/A058

RESPAC,	0								/a058

/****************************************************************************
/ TSTJB2 moved here from WPCOM because of the lake of the space
/***********************************************************************/a058

TSTJB2,									/a058
	JMS	BHOOK		/ call the blastr			/a058
	CXHLTB			/ run testst from blastr		/a058
	JMP	TSTJB1		/ return 1 go restore the swap if VT125	/a058
	JMS	RESPAN		/ restore here if return 2		/a058
	JMP 	TSTXIT		/ and exit				/a058
TSTJB1,	JMS	RESPAN		/ restore swap   			/a058
	JMP	TSTJOB		/ cont					/a058
	
/****************************************************************************


CKCOMM,	XX			/ROUTINE TO SEE IF HOST IS REQUESTED	/A018
	TAD	(H2T)		/IF SO VALIDATE HARDWARE IS PRESENT.	/A018
				/SEE IF HOST IS ANY			/A018
	JMS	CHKFLG		/OF THE DESTINATIONS.			/A018
	SKP			/SKIP IF NO. SEE IF IT IS A SOURCE.	/A018
	JMP	CKHDWR		/HOST IS A DESTINATION. CHECK HARDWARE.	/A018
	TAD	H2TFLG		/SEE IF HOST IS A SOURCE.		/A018
	SNA CLA			/SKIP IF YES. VALIDATE THE HARDWARE.	/A018
	JMP I	CKCOMM		/HST NOT SRC & NOT DST SO OK TO RETURN.	/A018
CKHDWR,	AC0001			/LOAD THE HARDWARE PRESENT BIT MASK	/A030
	CDFMNU								/C030
	AND I	(MUBUF+MNOPTC)						/C030
	CDFMYF			/SEE IF COMM HARDWARE IS PRESENT	/A018
	SZA CLA			/SKIP IF NO. REPORT ERROR.		/A018
	JMP I	CKCOMM		/HARDWARE IS PRESENT SO OK TO RETURN.	/A018
	JMP	PTERM5		/PUT OUT ERROR MESSAGE			/A030

RTNCER,	XX			/EXIT CIDF			/MOVED	/M041
	JMP I	XBSTRT		/RETURN TO CALLER		/MOVED	/M041

	/ Moved here on edit 057 for space reasons

CLRSCN,	TEXT	'^P!E'							/M044

/
/	Moved here on edit 07 for space reasons				/A057
/

LPRINT,	XX
	JMP	LPTTSF
LPTTSE,	CIFSYS
	JWAIT
LPTTSF,	CIFSYS
	LPTOU
	JMP	LPTTSE		/NOT READY, WAIT
	JMP I	LPRINT


/------------------
	PAGE

/RELOAD PRINTER FOR VT125 MODE




CXHOLE,	
	/---------------------------------------------------------------/a055
	/	N.B.							/A055
	/ 	THIS Page is used by Blaster as an overlay area for 	/A055
	/	dumping into (and restoring of course )			/A055
	/								/A055
	/---------------------------------------------------------------/A055


PRTLOD,	0
/D058	DCA	QUQBLK+RXQDRV	/SET SYSTEM DRIVE			/A044
/D058	TAD	(DLFD1)		/START BLOCK NUMBER			/A044
/D058	DCA	QUQBLK+RXQBLK						/A044
/D058	TAD	(-DSFD1)	/BLOCK COUNT				/A044
/D058	DCA	QUQBLK+RXQRS1						/A044
/D058	TAD	PRTFLD		/PRINTER FIELD				/A044
/D058	DCA	QUQBLK+RXQBFD	/PUT IT IN QBLK				/A044
/D058	TAD	(PRBOTM)	/START OF BUFFER			/A044
/D058	DCA	QUQBLK+RXQBAD	/PUT IT IN QBLK				/A044
/D058	TAD	(RXERD)		/NO RETURN MUST REBOOT			/A044
/D058	DCA	QUQBLK+RXQFNC	/FUNCTION CODE				/A044
/D058	JMS	QURX		/DO IT					/A024
/D058	CLA			/MUST REBOOT ON ERROR AS PRINT FIELD
/D058				/NOT IN MEM.				/A044
/D058	TAD	(PRJOB)		/STATUS BLOCK POINTER			/A044
/D058	CIFSYS								/A044
/D058	JSTRT			/RESTART JOB				/A044
/D058	JMP I	PRTLOD		/RETURN					/A044
/D058PRTFLD,	CDFPRT			/PRINTER FIELD				/A044
/************************************************
/ NOW RESTART THE SYSTEM
/************************************************			/A058

/ 	HLT
	CDFSYS			/ system field				/a058
	TAD I	WRMSTR		/ get date for start			/a058
	CMA			/ make neg 				/a058
	DCA I	WRMSTR		/ and store 				/a058
	JMS	BHOOK		/ call BLASTR				/a058
	-GRESEN			/ to restore restart code from panel	/a058
	IOF			/ don't allow interrupts		/a058
	CLA
/	AC4000			/ Get system type			/a058
/	CDFFIO			/					/a058
/	TAD I 	PTR7		/ 					/a058
	CDISYS			/ call restart in sys			/a058
	DCA I 	VFYPTR		/ save type first			/a058
	JMP I	RESPTR		/ now restart				/a058

RESPTR,	RXDRIN+1		/ address of restart			/a058
VFYPTR,	SVFVFY-CLOCK+RANDOM						/a058
WRMSTR,	DAMNTH			/ date for restart			/a058
	
CONCR,	TAD	(CR)
	JMS	KBTOCH
	TAD	(LF)
	JMS	KBTOCH
CNMERG,	TAD	(CNLINE-1)
	DCA	X2
CNSCAN,	TAD I	X2		/ANOTHER FIELD THEN REINSERT IT
	SNA
	JMP	CNDONE
	TAD	(-BLANK)
	SNA
	JMP	CNSCAN
	TAD	(BLANK)
	MQL
	TAD	(TAB1-1)
	JMS	LOOKUP
	JMP	CNERR
	TAD	(TAB2-TAB1-1)
	DCA	X3
	TAD I	X3
	DCA	CNLOC
	TAD I	X2
	SNA
	JMP	CNERR
	MQL
	TAD	(TAB3-1)
	JMS	LOOKUP
	JMP	CNERR
	TAD	(TAB4-TAB3-1)
	DCA	X3
	TAD I	X3
	MQL
	TAD I	CNLOC
	MQA
	DCA I	CNLOC
	TAD	DKTFLG
	AND	(20)
	SZA CLA
	JMP	CNERR
	TAD	TSTFLG
	AND	(20)
	SZA CLA
	JMP	CNTDOC		/TEST A DOCUMENT FOR VALID CX
				/PRINT CONTROLS
	AC0001
	DCA	NONBNK
	JMP	CNSCAN
CNERR,	AC7777
	TAD	X2
	DCA	X2
	TAD	(QUEST)
	DCA I	X2
	DCA I	X2
	JMP	CONFIG

CNLOC,	0

/CHECK FOR A TRANSFER TO A DOCUMENT

CNDONE,	TAD	NONBNK		/IF ZERO DON'T CONTINUE
	SNA CLA
	JMP	CONFIG
	JMS	CKCOMM		/CHECK FOR HOST I/O BUT NO HARDWARE.	/A018
	TAD	(DOC)		/SET THE MQ FOR DOCUMENT

	JMS	CHKFLG		/SEE IF A FLAG IS SET FOR OUTPUT TO A DOCUMENT
	JMP	CHKREQ		/NO

	TAD	OTFILE		/YES IS THE FILE ALREADY OPENED ?
	SNA CLA			/SKIP IF YES. CONTINUE.			/A035
	JMS	PMESFN		/NO OPEN IT
	JMP	CNTNUE
CHKREQ,	JMS	CXSKCL		/CLOSE THE FILE

/CHECK FOR FILE NEEDED TO BE READ

CNTNUE,	TAD	DKTFLG
	SNA CLA
	JMP	CNTU1		/IF NOTHING FROM AN INPUT DOCUMENT
	JMS	RDOCMS
	JMP	CNTNU

CNTU1,	JMS	CXRDCL		/CLOSE IF OPEN FOR READ

/IN THE NEW SYSTEM THE COM FLAG IS SET BEFORE ENTERING CX
/BY CU3COM IN WPCU3

CNTNU,	JMS	PRTTST		/SEE IF INITIALIZATION TO PRINTER TO BE DONE
	JMP	CNTN6

/
/	The code below was moved here on edit 059 to free up a few 	/A059
/	words in WPCOM and allow easier changing of NRC on term reset	/A059
/	
/
RESNRC,	XX			/ Restore terminal NRC			/A059
	JMS	DMTOSC		/ Output an escape seq			/A059
	ESC			/ 					/A059
	"(&177			/					/A059
RESNRX,	"B&177			/					/A059
	ESC			/					/A059
	")&177			/					/A059
	"0&177			/					/A059
	0			/					/A059
	JMP I 	RESNRC		/ And return				/A059




/------------------
	PAGE

/*********** MOVED HERE VER 044 ***********SPACE WARS

LOOKUP,	XX
	DCA	X3
	MQA
	CIA
	DCA	LOOKC
LOOKC1,
	TAD I	X3
	SPA
	JMP I	LOOKUP
	TAD	LOOKC
	SZA CLA
	JMP	LOOKC1
	TAD	X3
	ISZ	LOOKUP
	JMP I	LOOKUP
LOOKC,	0

/CHKFLG - CHECKS FOR THE VALUE IN THE MQ TO THE FLAGS

CHKFLG,	XX
	MQL
	TAD	(TAB2-1) 	/GET STARTING ADDRESS
	DCA	CHKFLT
CHKFLJ,
	ISZ	CHKFLT
	TAD I	CHKFLT
	DCA	T1
	TAD	T1
	SPA CLA
	JMP I	CHKFLG		/IF -1 THEN END OF STRING
	MQA
	AND I	T1
	SNA CLA
	JMP	CHKFLJ
	ISZ	CHKFLG
	JMP I	CHKFLG

CHKFLT,	0

/ROUTINES FOR ACCESSING DOCUMENTS

PMESFN,	XX
	CIFMNU			/INSERT A CDF TO THE MENU FIELD
	JMS I	MNUCAL		/CALL MENU
	DLMCM1

	AC7776
	CDFMNU
	TAD I	(MUBUF+MNTMP1)	/GET TEMP 1 TO SEE ABOUT GOLD-M
	CDFMYF			/A CDF FOR THIS FIELD
				/WILL BE INSERTED AT RUN TIME
	SNA
	JMP	CONFIG		/IF 2 RETURN TO MENU

	TAD	(2-CREATE)	/ELSE SEE IF THE DOCUMENT HAS TO BE CREATED
	SZA			/NEED TO CREATE?
	JMP	PMESF1		/NO, JUMP

	DCA	OPFLOP		/WILL OVERWRITE THE DOCUMENT

	JMS	ADRCRT		/CREATE THE FILE
	JMP	CRTERR		/ERROR ENCOUNTERED
	CDFMNU			/SET "REMEMBERED" FILE NUMBER.		/A034
	DCA I	(MUBUF+MNFNO)						/A034
	TAD I	(MUBUF+MNFNO)	/GET DOC NUMBER.			/A034
	AND	P377							/A034
	DCA I	(MUBUF+MNDOCN) /STORE IT TOO.				/A034
	JMP	PMESF2

PMESF1,	TAD	(CREATE)
	DCA	OPFLOP		/STORE THE VALUE
	CDFMNU			/INSERT A CDF FOR THE MENU FIELD
				/TO PICK UP AN ARG.
PMESF2,	TAD I	(MUBUF+MNFNO)
	CDFMYF

	CIA
	TAD	ITFIL2		/ASSUME AT MOST ONE OF ITFILE AND ITFIL2
				/ARE NON-ZERO
	TAD	ITFILE		/COMPARE TO WHAT WAS THERE LAST
	SNA
	JMP	FLERR		/CAN'T READ AND WRITE TO SAME FILE
	CIA
	TAD	ITFIL2
	TAD	ITFILE
	DCA	OTFIL2
	JMS	CXSKOP		/OPEN SCROLL FILE.			/A013
	SKP			/IF ERROR SET ERFLG.			/A013
	JMP I	PMESFN		/RETURN					/A013
	AC0001
	DCA	ERFLG		/SET RETURN ERROR FLAG.			/A013
	JMP I	PMESFN		/RETURN TO CALLER.

OPFLOP,	0

RDOCMS,	XX			/TAKES CARE OF THE READ FILE
	CIFMNU			/CALL THE MENU
	JMS I	MNUCAL		/MENU CALL
		DLMSO2							/M034
	AC7776			/TEST FOR GOLD-M
	CDFMNU			/GET AN ARGUEMENT FROM THE MENU FIELD
	TAD I	(MUBUF+MNTMP1)
	CDFMYF			/A CDF FOR THIS FIELD
				/WILL BE INSERTED AT RUN TIME

	SNA CLA
	JMP	RDOCM2		/IF 2 START AGAIN

	CDFMNU			/GET TO THE MENU FIELD
	TAD I	(MUBUF+MNFNO)	/GET FILE NUMBER WITH DRIVE NUMBER
	CDFMYF			/A CDF FOR THIS FIELD
				/WILL BE INSERTED AT RUN TIME
	CIA
	TAD	OTFIL2		/ASSUME THAT AT LEAST ONE
				/OF OTFIL2 AND OTFILE IS ZERO
	TAD	OTFILE
	SNA
	JMP	FLERR		/CHECK FOR R &W TO SAME FILE
	CIA
	TAD	OTFIL2
	TAD	OTFILE
	DCA	ITFIL2
	JMP I	RDOCMS

CHK125,	0			/CHECK VT125 MODE			/A044
	CDFMNU								/A044
	AC7775			/CHECK FOR VT125 MODE(=3)		/A044
	TAD I	(MUBUF+CXTMOD)	/MODE SW				/A044
	CDFMYF								/A044
	SZA CLA			/=VT125?				/A044
	ISZ	CHK125		/NOT VT125 MODE..NO GRAPHICS LOADED	/A044
	JMP I	CHK125		/RET					/A044

/Moved here on edit 51 to make space at ID routine to check if fallback	/A051
/required on printer (LA100 non PC etc)					/A051
/MOVED HERE FROM NEXT PAGE TO MAKE ROOM					/A041
/PRSTTS SHOULD BE NOT BE RESET WHEN LEAVING CX.				/A030
/PRTID NO LONGER SETS IT TO 1 (BUSY) SO IT REMAINS (0) AS LONG		/A030
/AS NO ERROR OCCURS.  IF AN ERROR DOES OCCUR, IT WILL BE SEEN		/A030
/WHEN THE USER RETURNS TO MAIN MENU					/A030
/THE PRINTER JOB DOES NOT NEED TO BE STARTED WHEN WE LEAVE CX		/A031
/SINCE IT CANNOT BE RUNNING.  WE HAVE ELIMINATED THE WINDOW ON		/A031
/PRSTTS BETWEEN JOBS, SO CX TO THE PRINTER CAN NOT BE UNLESS THE	/A031
/PRINTER JOB IS NOT RUNNING.						/A031

XPRTPT,	XX
	IFDEF VT125R	<						/A044
	JMS	CHK125		/CHECK VT125 MODE			/A044
	SKP			/IS VT125 MODE				/A044
	JMP I	XPRTPT

	CIFEDT			/CALL IN WPCX2				/A045
	JMS I	(SETPG0)	/DO IT					/A045
	JMS I	PLDADR		/LOAD PRINTER CODE FIELD 1		/A044
			>	/END IFDEF VT125R			/A044
	JMP I	XPRTPT
				
/------------------
	PAGE

/WHEN A GOLD-M WAS ISSUED, MAKE SURE THAT ANY PREVIOUSLY SPECIFIED
/(BUT NOT OPENED) OUTPUT FILE IS UNLOCKED.

/THIS ASSUMES THAT, SHOULD BOTH AN INPUT AND AN OUTPUT FILE BE NEEDED AT
/THE SAME TIME, THE MENU PROMPT FOR THE OUTPUT FILE WILL BE ISSUED FIRST.

RDOCM2,	DCA	OTFIL2
	TAD	DSKACF		/IS THE DISK JOB CURRENTLY ACTIVE?	/A013
	SZA CLA			/SKIP IF NOT ACTIVE			/A019
	JMP	CONFIG		/TELL DSK JOB, KILL ITSELF & CLOSE FILE	/A013
	JMS	CXSKCL		/CLOSE ANY OPEN SCROLL FILE.		/A013
	JMP	CONFG0		/SET UP FOR CX MENU.			/A013


/PRTTST - checks for cx using the printer and if the printer is in use...

PRTTST,	XX
	TAD	(LQP)		/SET THE MQ FOR PRINTER
	JMS	CHKFLG		/SKIP IF PRINTER REQUESTED
	JMP	PRTTSN		/NO REQUEST FOR THE PRINTER
	JMS	CHK125		/CHECK VT125 MODE			/A044
	JMP I	PRTTST		/YES SKIP BUSY CHECK(ALREADY DONE)	/A044

	CDFMNU			/ Point to Menu field			/A057
	AC4000			/ Test for bit 0			/A057
	AND I	(MUBUF+MNPULD)	/ Check "Non-Printer Print Busy Flag"	/A057
	SZA CLA			/					/A057
	JMP	PTERM7		/ Print Screen must be active		/A057

	CDFPRT
	TAD I	(PRSTTS) 	/SEE IF THE STATUS IS ZERO
	SZA CLA
	JMP	PTERM2		/NO, CX CANNOT BE DONE			/C027
PRTTSC,	ISZ	CNGPFG		/SET THE CHANGE FLAG			/A025
	TAD I	(PRTID)		/GET PRINTER ID ROUTINE ADDRESS.	/A007
	CDFMYF			/BACK TO THE FUNNY FARM!		/A007
	CIFPRT			/MAP SPOOLER.				/A007
	DCA	T1		/SAVE ROUTINE ADDRESS.			/A007
	AC0001			/SAY THAT WE WANT TO TRAP THE ERROR!!!	/A014
	JMS I	T1		/CHECK THE PRINTER ID.			/A007
	SKP			/SUCCESS RETURN.			/A014
	JMP	PTERM3		/NON-EXISTENT PRINTER RETURN.		/A014
				/PRTID WILL SET PRSTTS TO SOMETHING	/A027

/
/	References to printing fallback for 8 bit (with 8 bit terminal	/A056
/	type) has been dropped since Martyn now gets the print driver to/A056
/	handle 8 bit stuff to LQP's					/A056
/
	

/d056	TAD I	(LPONLN)	/Get printer status			/A051
/d056	AND 	(MNMSK)		/Has it got multinational capability?	/A051
/d056	SZA CLA			/					/A051
/d056	JMP	PRCKASF		/Yes , check sheet feeder		/A051
/d056	AC0001			/					/A051
/d056	DCA	PRFLBK		/Set print fallback flag		/A051

PRCKASF,CDFPRT			/MAP PRINTER				/A007
	TAD I	(LPONLN)	/GET PRINTER ASF STATUS.		/A007
	AND	(ASFMSK)						/A033
	SZA CLA			/SKIP IF NOT ASF.			/A007
	TAD	(FF)		/SET FF IF ASF.				/A007
	DCA	PRTSTS		/DO INITIAL FF FOR ASF PRINTERS.	/A007
	CDFPRT			/GET DEFAULT PAGE SIZE		/A007	/C038
	TAD I	(PRQPSZ)					/A007	/C038
	CDFMYF
	CIA			/COMPUTE THE NUMBER OF PAGES.		/A007
	DCA	LPTCNT		/SAVE.					/A007
	CDFMNU			/ Point to menu field			/A057
	AC4000			/ Now set the flag			/A057
	TAD I	(MUBUF+MNPULD)	/ to say the printer is busy		/A057
	DCA I	(MUBUF+MNPULD)	/ and put it back			/A057
	AC0001			/ Set Printer requested flag		/A057
	DCA	PRTREQ		/ On					/A057
	CDFMYF			/ Back to this field			/A057

/SEND EITHER NOTHING OR A FORM FEED TO PRINTER

	TAD	PRTSTS		/GET CHR				/C038
	SNA
	JMP I	PRTTST		/NOTHING, RETURN.
/D057	JMP	PRTTSF

PRTTSE,	JMS	LPRINT		/PRINT CHAR IN AC			/A057
	JMP I	PRTTST		/FF ACCEPTED, DONE			/C038

PRTTSN,	DCA	CNGPFG		/CLEAR THE CHANGE FLAG
	JMP I	PRTTST

PTERM7,	TAD	(2)		/ Print screen and printer requested	/A056
PTERM5,	TAD	(2)		/NO HARDWARE				/A030
PTERM3,	IAC			/NON EXISTENT				/A024
PTERM2,	TAD	(2)		/BUSY					/A024
PTERMS,	CDFMNU
	DCA I	(MUBUF+MNTMP1)	/SAVE ERROR CODE FOR MENU
	CDFMYF
	CIFMNU
	JMS I	MNUCAL		/DISPLAY THE MESSAGE
	DLMAD7
	JMP	RTNSY							/M013


PRTSTS,	0			/TABLE OF CHARACTERS TO SEND TO THE PRINTER
				/FF INSERTED HERE FOR ASF PRINTERS.	/A007
FLERR,	CLA
	JMP	ERROUT

INTERR,	CDFMYF	
	AC0001
	TAD	ERFLG		/ADD INTERNAL ERROR TYPE (1 FOR BAD BLOCK,
				/2 FOR OVERFLOW.
	JMP	ERROUT

/PUT THE ERROR TYPE INTO A TEMP TO CALL THE MENU.
/THEN, CLEAN UP AS FOLLOWS -
/CLEAR ALL ACTION FLAGS TO STOP ALL NON-DISK JOBS
/CLEAR ERROR INDICATION FLAG (ERFLG)
/CLOSE ANY DISK INPUT FILE (CALL DKACTS ONCE)
/FINALLY, CALL THE ERROR MENU TO DISPLAY THE ERROR.

CRTERR,	AC0001

ERROUT,	CDFMNU
	DCA I	(MUBUF+MNTMP1)
	CDFMYF

/CLEAR ALL ACTION FLAGS AND -ERFLG-

	JMS	CLRFLG							/M003

/CLOSE INPUT FILE

	TAD	DSKACF		/IS THE DISK JOB ACTIVE?		/A013
	SNA CLA			/SKIP IF YES. TELL IT TO CLOSE UP SHOP.	/A013
	JMP	ERROU1		/CLOSE THE OPENED FILES.		/A013
	DCA	DSKCNT		/DISK JOB WILL CLOSE FILE ONLY WHEN NO
				/CHAR TO OUTPUT
	JMS	DKACTS

	JMP	ERROU2		/MERGE BELOW TO DISPLAY ERROR MESSAGE.	/A013

ERROU1,	JMS	CXRDCL		/CLOSE ANY OPENED READ FILE (PROBABLY	/A013
				/NONE OPENED AT THIS POINT!)		/A013
	JMS	CXSKCL		/CLOSE THE OPENED SCROLL FILE (WHICH	/A013
				/MAY BE OPENED AT THIS POINT).		/A013

/DISPLAY ERROR MENU

ERROU2,	JMS	DMTOSC		/OUT PUT STRING TO SET ANSI MODE	/A042
	ESC;74;0		/IS ESCAPE ANGLE BRACKET		/A042
	CIFMNU
	JMS I	MNUCAL
	DLMCX1
	JMP	CONFG2		/DISPLAY COMMUNICATIONS MENU

/THIS IS THE CROSS FIELD CALL FOR THE CX PRINT CONTROL TEST  ROUTINE

CNTDOC,	AC0001			/SINCE THE ROUTINE CAN BE CALLED BY SO AND CX
				/THE 1 TELLS THE ROUTINE THAT CX IS CALLING
	CIFEDT
	JMS I	(DBTDOC)
	NOP								/A037
	JMP	CONFIG

CXRDCL,	XX
	CLA
	DCA	ITFILE
	JMP I	CXRDCL


/------------------
	PAGE

/SEE IF THERE ARE DOCUMENTS TO BE OPENED

CXRDOP,	XX
	TAD	ITFIL2
	SNA
	JMP I	CXRDOP		/IF THERE IS NO INPUT FILE TO OPEN, JUMP

	DCA	ITFILE
	DCA	ITFIL2
	CDFEDT								/A047
	DCA I	(DSKRLF)	/CLEAR THE FLAG USED BY DSKGCH THAT	/A047
				/SAYS IT IS IN THE MIDDLE OF A RULER	/A047
	DCA I	(DSKSTF)	/CLEAR THE FLAG IN DSKGCH THAT SAYS TO
				/GET INPUT FROM A BUFFER AND NOT RDFILL	/A047
	AC7776
	DCA I	(DSKSOD)	/SET FOR FIRST TIME THROUGH DSKGCH	/A047
	DCA I	(DSKBAK)	/CLEAR THE TEMP CHAR WHEN LOOKIN FOR SOD/A047
	DCA I	(DSKSOL)	/CLEAR THE START OF LINE FLAG		/A047
	CDFMYF								/A047
	TAD	ITFILE
	CIFFIO
	FILEIO
	XRDFIN
	JMP I	CXRDOP

/OPEN THE OUTPUT FILE IF THERE IS ONE WAITING TO OPEN

CXSKOP,	XX
	TAD	OTFIL2
	SNA
	JMP	XSKOP3		/NOBODY TO OPEN, RETURN.
	MQL
	TAD	OPFLOP		/PICK UP TYPE OF OPEN (TOP, BOTTOM, OVERWRITE)
	CIFFIO
	FILEIO
	XDSKIN
	SZA CLA			/ERROR?
	JMP I	CXSKOP		/YES, JUMP

	TAD	OTFIL2
	DCA	OTFILE
	DCA	OTFIL2
/INITIALIZE THE OUTPUT BUFFER AND PUT AN INITIAL WORD-WRAP INDICATION IN
/FOR THE EDITOR.

	TAD	(DSKBUF)
	DCA	DSKPT1
	TAD	(DSKBUF)
	DCA	DSKPT2
	DCA	DSKCNT

	TAD	(200+CNTRLG)
	JMP	XSKOP2

XSKOP1,	CIFSYS
	JWAIT
XSKOP2,	JMS	DSKPUT
	JMP	XSKOP1

XSKOP3,	ISZ	CXSKOP		/SKIP OVER ERROR RETURN
	JMP I	CXSKOP

CXSKCL,	XX
	CLA
	TAD	OTFILE		/CHECK THE INPUT FLAG FOR A FILE OPEN
	SNA CLA
	JMP I	CXSKCL
	DCA	OTFILE		/CLOSE IT AND CLEAR FLAG
	CIFFIO
	FILEIO
	XDSKCL
	JMP I	CXSKCL

/FOLLOWING CODE MADE INTO A SUBROUTINE TO SAVE SPACE			/A003

CLRFLG,	XX			/CLEAR FLAGS				/A003
	CDFEDT			/CLEAR THE DOC XFR "WAIT" FLAG.		/A016
	AC7777			/SAY NOT "WAITING".			/A016
	DCA I	(WATFLG)						/A016
	IFDEF	VT125R	<	/VT125 ONLY				/A041
	DCA I	(GRAFON)	/SO HS CHARS GO TO SCREEN (NOT REGIS)	/A041
			>	/END IFDEF VT125R			/A041
	CDFMYF			/BACK TO OUR FIELD.			/A016
	DCA	NONBNK		/CLEAR THE SOMETHING TO DO FLAG		/A003
	DCA	KBTFLG		/CLEAR OUR FLAGS			/A003
	DCA	EXRLR							/A003
	DCA	H2TFLG							/A003
	DCA	TSTFLG							/A003
	DCA	DKTFLG							/A003
	DCA	ERFLG							/A003
	JMP I	CLRFLG							/A003

/THIS IS THE RETURN LOGIC (GOLD MENU)

RTNSY,	JMS	RESTOR		/RESET TERMINAL CHARACTERISTICS		/A002
	JMS	CXSKCL		/CLOSE ANY OPEN SCROLL FILE.		/A013
RTNCE1,	TAD	DSKACF		/SEE IF ANY JOBS STILL RUNNING.		/A013
	TAD	HSTACF							/A013
	TAD	TSTACF							/A013
	SNA CLA			/SKIP IF YES.				/A013
	JMP	RTNCE2		/RETURN TO MAIN-MENU.			/A013
	CIFSYS			/WAIT FOR JOBS TO FINISH-UP.		/A013
	JWAIT
	JMP	RTNCE1		/CHECK AGAIN.				/A013

RTNCE2,	JMS	XPRTPT		/RETURN THE PRINTER			/M044
	CDFMNU			/GET LINKAGE FLAG.			/A035
	TAD I	(MUBUF+MNTMP6)	/(IE, THE EZ-LINK FLAG).		/A035
	CDFMYF			/BACK TO OUR FIELD.			/A035
	SZA CLA			/SKIP IF NORMAL EXIT. (IE BACK TO MM)	/A035
	JMP	RTNCER		/JMP TO HANDLE CHAIN CALL TO AX/DX.	/A035
	IFDEF VT125R	<
	JMS	CHK125		/IS VT125 GRAPHICS MODE			/A044
	JMP	CLRGRF		/AVOID JUMPING TO NON EXISTING BUFFER	/A041
				>/END IFDEF VT125R			/A041
	CIF	60		/MAP COMM BUFFER FIELD.			/A036
	JMS I	(COMXIT)	/CALL COMM CLEAN-UP CODE.		/A036
NOBUFF,	CDFSYS
	DCA I	(CMADSX)
	CDFMYF			/CLEAR SYSTEM COMM FLAG
	JMP	RTNCER		/NEED TO EXIT ON SAME PAGE CALLED	/A041

	IFDEF	VT125R	</FOR VT125					/A041
CLRGRF,	CIF	PRMFLD		/SET TO PRIMITIVES FIELD		/A041
	TAD	(TRMADR)	/ADR OF TERMINATE GRFX OPCODE		/A041
	JMS	PRIM		/GO TO PRIM				/A041
	JMP	NOBUFF		/NOW GET BACK IN LINE			/A041
TRMADR,	41			/TERMINATE GRFX OP CODE			/A041
			>/END IFDEF VT125R				/A041


/
/	The code below is from H2TIO area moved here to give some space	/A059
/
/

NRCTRN,	CDFEDT			/					/A059
	TAD I	(NRCREP)	/ Get replaced char			/A059
	CDFBUF			/ Point back here			/A059
	JMP	NRCRPD		/ and rejoin main code			/A059
	

/------------------
	PAGE


