/WPCX2 - SECOND FIELD OF THE CX COMMUNICATIONS PACKAGE

/	USED IN DRDFIN
/	
/	059	EMcD	14-Sep-85	Add Nordic translations (conditional)
/	058	EMcD	03-Sep-85	8bit to 7bit NRC conversion for 
/					LLV Vt100 support .
/	057	EMcD	26-Mar-85	Change WPs Ver in Sec dev attr
/	056	EMcD	18-Mar-85	8 bit support
/	055	EMcD	18-Mar-85	Add VT22X mask for 7 bit 8 bit
/	054	TCW	18-OCT-84	Send WPS ver. with sec. dev. attr.
/	053	GDH	28-AUG-84	Conditionalized DSKGCH so that it'll
/					assemble w/ WPCU4.
/	052	WJY	24-AUG-84	Fix "SEND TECH" introducer string
/	051	WJY	20-AUG-84	Add "SEND TECH" introducer support
/	050	ECH	17-AUG-84	TECHNICAL CHARACTERS FROM DOC TO HOST,
/					SCREEN, & PRINTER
/					MOVED DSKGCH FROM WPCOM TO HERE
/					REMOVED SIXEL PRINT AND DUMP SPACE
/	049	TCW	19-JUL-84	VT227 SUPPORT
/	048	TCW	19-JUL-84	DELETE ESC TRANSLATION TABLE TM=DECMATE
/	047	DFB	11-JUN-84	CX GRAPHICS TO RESET CALL TO FLABUZ
/					..... IN WP2CMF WHEN PRTFLD LOADED
/	046	DFB	18-MAY-84	FIX TO GRAPHICS SIXEL DUMP CALL
/	045	DFB	09-MAY-84	SOME VT125 PUT INTO REGIS
/	044	DFB	20-APR-84	DELETE BACKSLASH RETURNS FROM CX
/	043	DFB	12-APR-84	DELETE LOAD OF REGIS AND PRIM LOAD FROM
/					....PANEL MEMORY
/	0042	WJY	17-FEB-84	IMPLEMENT DMIIV1.5 FUNCTIONALITY ON DMI
/	0041	SBB	9-JAN-84	IGNORE $Pp IN VT100 MODE
/	0040	GDH	7-JAN-84	ADDED '\' CHECK TO KBTRAP.
/	0039	SBB	20-OCT-83	ADDED SIXEL DUMP FROM GRFX SCREEN
/	0038	SBB	19-OCT-83	TO LOAD FROM SPECIAL FEATURE DISKETTE
/	0037	SBB	18-OCT-83	ADDED VT125 GRAPHICS STUFF
/	0036	EPS	17-OCT-83	ADD TECHNICAL CHARACTER ANSWERBACK
/					FOR DECMATE II
/------------------------------------------------------------------------------
/EDITS BELOW ARE FOR DECMATE I MAINTENANCE RELEASE

/	0035	GDH	13-SEP-83	FIXED 2NDARY DEVICE ATTRIBUTES RESPONSE
/	0034	GDH	20-JUL-83	ADDED EZ-LINK SUPPORT FOR DM2 MODE.
/	0033	GDH	23-JUN-83	ADDED "SEND TAB NOSPACE".
/					IMPLEMENTED PF4 KEY AS "ATTENTION" KEY.
/	0032	GDH	19-MAY-83	CHANGED EZ-LINK ESC SEQ PER SPEC.
/	0031	GDH	21-APR-83	ADDED EZ-LINK SUPPORT TO HOST-TO-TERMINAL
/	0030	MJS	2-FEB-83	UNCONDITIONALIZED SUBROUTINE "HS2CTL"

/EDITS BELOW ARE FOR DECMATE II

/	0029	GDH	09-DEC-82	BUG FIX FOR HS "SET VT52 MODE". ALSO
/					REWROTE HS CODE FOR TIA COMPATABILITY.
/	0028	EPS	01-DEC-82	FIX BUG WITH CONTROL CHARACTERS IN
/					ESCAPE SEQUENCES
/	0027	EPS	16-NOV-82	FIX BUGS IN KEYBOARD TRAP ROUTINE
/					WHICH DELAYED ESCAPE SEQUENCES GOING OUT
/	0026	SBB	08-NOV-82	ONLY TRAP ESC SEQ'S NOT ESC KEY
/	0025	SBB	05-NOV-82	MOVED IFDEF'S SO WPCU4 WILL ASSEMBLE
/	0024	SBB	22-OCT-82	ADDED KEYBD TRAP FOR TOP ROW ESC SEQ'S
/	0023	SBB	14-OCT-82	PROTECTED ESC SEQ BUFFER FROM TOO BIG STRINGS
/	0022	SBB	12-OCT-82	ONLY ISSUE PRQ3 WHEN TO OR FROM DM2
/	0021	SBB	30-SEP-82	CHANGES TO HS ESC XLATION TABLES&CODE
/	0020	SBB	27-SEP-82	ADD DEFS SO BOTH WPCU4 AND WPCX ASSEM.
/	0019	SBB	15-SEP-82	RESTORED HS PORTION OF ESC FOR CONDOR
/	0018	HLP	27-JUL-82	FIXED CONDOR VERSION OF HST2SC
/	0017	HLP	04-JUN-82	CONDITIONALIZED TERMINAL TRANSLATION CODE
/					(DM-II FIRMWARE DOES IT)
/	0016	GDH	08-FEB-82	ADDED "READ ERROR DETECTION" SUPPORT.
/	0015	GDH	24-DEC-81	ADDED SUPPORT FOR DECWORD/VT278 MODE
/					SWITCH BACK & FORTH VIA VT100/VT278
/					ESCAPE SEQS $[?2L AND $<
/	0014	GDH	14-DEC-81	DECWORD ESCAPE SEQUENCE CHANGES.
/	0013	GDH	17-OCT-81	BUG FIX TO NOT TRANSLATE USER ESC SEQS.
/					ADDED DWORD SUPPORT (TM = 3/4).
/					BUG FIX - ALLOW ANSI GRAFIX SELECTION.
/	0012	GDH	7-OCT-81	BUG FIX FOR "FREEZE-UP" CONDITIONS.
/	0011	GDH	7-OCT-81	KEYPAD TRANSLATION BUG FIX IN KH.
/	0010	GDH	29-SEP-81	BUG FIX FOR VT52 EMULATION OF D.C.A.
/					IGNORE BREAK KEY ($OT).
/	0009	GDH	25-SEP-81	IMPLEMENTED TM VT52/VT278 SUPPORT.
/	0008	GDH	23-SEP-81	ELIMINATED PAGE ZERO CIF/CDF STUFF.
/					ELIMINATE RECOGNITION OF ANSI WHO-R-U
/					IN VT52 MODE, ALSO THROW OUT $\,$[
/					(HOLD-SCREEN-MODE ESC SEQUENCES).
/	0007	GDH	16-SEP-81	BUG FIX TO VT52 KH EMULATION.
/	0006	GDH	21-AUG-81	ADDED VT52 EMULATION FOR VT278.
/	0005	TT	07-JUL-81	REMOVED SUPERFLUOUS CONDITIONALS
/	0004	DM,JM	15-SEPT-80	MERGED SCANDI AND EUROPE/ENGLISH
/	0003	DSS	09-JUL-80	MODIFIED FOR ENGLISH/FRENCH-CANADIAN
/	0002	CMW	6-MAY-80	ADDED CANADA TRANSLATIONS
/	0001	CMW GLT	8-FEB-80	ADDED FRENCH, GERMAN, DUTCH CONDITIONAL CODE
/	FRENCH DIACRITICAL SUBSTITUTIONS:
/	"["=L.A.E, "]"=L.G.E; "&" DOES NOT CAPITALIZE
/	GERMAN DIACRITICAL SUBSTITUTIONS:
/	"["=L.U.A, "\"=L.U.O, "]"=L.U.U


	DRDLMX= 235		/MAX OF THE INPUT BUFFER RDFLIB USED IN DRDFIN
	LF= 12			/VALUE OF A LINE FEED WHICH IS THE EOL
				/CHARACTER FROM RDFILL
	SOPC= 1014		/START OF PRINTER CONTROL
	EOPC= 1414		/VALUE OF AN END OF PRINTER CONTROL CHARACTER

	SRULER= 16		/STARTING VALUE OF A RULER
	ERULER= 17		/AND THE END

/USED IN DGTARG

	DGTABX= 40		/MAX SIZE OF THE ARGUMENT BUFFER

/SPECIAL CHARACTER DEFINITION BUFFERS

	EOLMAX= 100		/MAX LENGTH OF THE END OF LINE BUFFER
	SOLMAX= 100		/START OF LINE
	SODMAX= 100		/START OF TEXT
	EODMAX= 100		/END OF TEXT
	PARAAX= 100		/END OF PARAGRAPH
	EOPMAX= 100		/END OF PAGE

	RCVMAX= 100		/RECEIVE

	SNDMAX= 100		/SEND

	TABMAX= 3		/TAB VALUE

	TECMAX=	10		/TECHNICAL CHARACTER			/A051
	SLDMAX= 5		/Line drawing set			/A056
	FBKMAX=3		/Fall back Buff max			/A056

/CHARACTER USED TO START A COMMAND IN A DEFINITION

	DEFLAB= "<-200

/GETOVL DEFINITIONS

	GETOVM=4

/SPECIAL CHARACTERS

	CR= 15			/VALUE THAT THE EOL BUFFER IS INITALLY SET TO

	PRQ3= 6236		/DEFINE PANEL REQUEST #3		/A021


	IFNDEF DECDEV <
	FIELD 3
	>

	IFDEF DECDEV <
	FIELD 4
	>


	*100			/THE FIRST 100 LOCATIONS ARE USED FOR THE SYSTEM

	CDFMYF=CDFEDT		/WE RUN IN THE EDT FIELD.
	CIFMYF=CIFEDT		/WE RUN IN THE EDT FIELD.

/THESE ARE VARIBLES PUT ON PAGE ZERO BECAUSE THEY ARE USED
/ACROSS PAGES AND ARE IMPORTANT.

WATFLG,	-1		/SET TO THE CHARACTER WAITING FOR IF THE COMMAND IS IN
			/PROCESS.  IT IS LOOKED ON BY DISK AND HOST JOBS.
DBCHRP,	0		/CONTAINS THE CURRENT ADDRESS IN THE BUFFER OPENED
DBCHRC,	0		/CONTAINS THE -LIMIT CNTR FOR THE BUFFER OPEN BY DBFINI.
DBRCHP,	0		/CONTAINS A PNTR TO THE CURRENT ADDRS ON THE RECV BUFFER
DBRCHC,	0		/MAX SIZE OF THE BUFFER
SNDFLG,	0		/SET TO 1 IF THERE IS A BUFFER THAT HAS TO BE SENT NOW.
TESTFL,	0		/IF 1 THEN DISPLAY ALL ERROR MESSAGES
ERRFLG,	0		/IS SET TO 1 ON THE FIRST ERROR DISCOVERED
DGTTM1,	0		/POINTER USED BY DGTARG FOR THE POINTER TO THE NEXT ARG
			/ALSO MOVED BY GETASC WHEN IN AN ASCII STRING
IFDEF	CONFIG	<
/THE NEXT FEW LINES ARE HERE DUE TO LACK OF SPACE IN THE H2K PAGES.
HS2KT1,	0			/TEMP FOR H2TFLX.
HS2KT2,	0			/TEMP FOR H2TCHR.


	IFNDEF	CONDOR	<						/A019
VTMODE,	0			/TERMINAL MODE POINTER..
VTMOLD,	2			/PREVIOUS DECWORD MODE. USED WHEN SWITCHING
				/FROM ANSI (VT278) TO DECWORD (VT52).
				/INITIALIZED TO APPLICATIONS MODE.	/A015
	>		/END NDEF CONDOR				/A019
	IFDEF	CONDOR	<						/A019
VTMODE,	1			/START OUT IN VT100 MODE		/A019
VTMOLD,	1			/FOR STORING PREVIOUS MODE	/M022	/A019
	>		/END CONDOR IFDEF				/A019

H2TPT,	0			/PTR INTO APPROPRIATE H2TXX TABLE.

H2TESC,	0			/1 IFF ESC SEQ IN PROGRESS. 0 OTHERWISE.
	>			/END IFDEF CONFIG			/M042
H2TPTR,	H2TBUF			/PTR INTO ESC SEQ BUFFER.

VT22MSK,0			/ VT22x mask either 7777 for 8 bit	/A055
				/ or 7757 for 7 bit (mask off 200 bit)
TM8BIT,	0			/ 0 for 7 bit , 200 for 8 bit		/A055

NRCREP,	0			/ Temp to contain replaced char		/A058

NRCSWC,	0			/ Saved char for NRCSWP routine		/A058
/
/	The following table lists the characters from the US NRC which 	/A058
/	are replaced in the LLV NRC and the appropriate MCS chars that	/A058
/	replace them.							/A058
/	It is used in the 8 bit to 7 bit NRC conversion when term. type	/A058
/	is VT100							/A058
/


NRCTBL,

	IFDEF V30FAO <		/ Define replacement chars for		/A058
				/ FAO which used the Spanish NRC	/A058
	43 ; 243		/ Hash replaced by Pound		/A058
	100; 247		/ At      "     "  Section		/A058
	133; 241		/ [       "     "  Inverted !		/A058
	134; 321		/ \       "     "  N tilde		/A058
	135; 277		/ ]       "     "  Inverted ?		/A058
	173; 260		/ {       "     "  degree		/A058
	174; 361		/ |       "     "  n tilde		/A058
	175; 347		/ }       "     "  c cedilla		/A058
	>								/A058
	033; 233		/ Convert Esc to proper 33		/A058
				/ Caused by Slushware bug		/A058
	0;0			/ Terminators				/A058





	*200			/KEEP THE PROGRAM OFF PAGE ZERO

/DBTDOC - TESTS A DOCUMENT FOR VALID CX PRINTER CONTROLS.  THE DIFFERENCE
/BETWEEN THIS AND THE ACTUAL SENDING IS THAT ERROR MESSAGES WILL APPEAR
/INSTEAD OF JUST SKIPPING LINES WITH ERRORS IN IT. THE ERROR MESSAGES
/WILL APPEAR IN THE FORMAT:
/** ERROR **
/BAD FORMAT/INVALID CHARACTER IN LINE
/[DISPLAY THE LINE]
/IN [THEN SHOW THE ARG]

/THE ROUTINE IS CALLED FROM SO WITH A -1 IN THE AC AND A 1 IF CALLED
/BY CX SO THE CORRECT THINGS WILL HAPPEN.

/IF IT IS CALLED FROM SO WHAT HAPPENS IS THAT IT READS IN THE DEFAULT
/BUFFER SETTINGS THEN CREATES A NEW SET WITH THE DOCUMENT SPECIFIED BY
/THE MENU IN MNCXP.

/IF CALLED BY CX FOR TD THEN THE USER IS ASKED FOR THE DOCUMENT NAME TO
/TEST BUT DOESNT WRITE ANYTHING.

/IN BOTH CASES THE ERRORS ARE DISPLAYED.  IF ZERO NO ERRORS ARE DISPLAYED.

/CALL:
/JMS	DBTDOC
/ERROR RETURN
/OK RETURN

/AC CONTAINS 1 FOR CX AND A -1 FOR SO

DBTDOC,	XX
	JMS	DBFCX
	DCA	DBTDX2		/MAKE CROSS FIELD CALLABLE
	TAD	T1
	DCA	TESTFL		/STORE THE VALUE THAT TELLS ROUTINE WHO CALLED

	CDFMNU
	DCA I	(MUBUF+MNTMP1)
	CDFMYF			/SET FOR CORRECT MESSAGE
	TAD	TESTFL
	SPA SNA CLA
	JMP	DBTDO2		/DONT ASK FOR THE DOCUMENT NUMBER IF CALLED
				/BY THE SO OPTION SINCE IT IS IN MNCXP
	CIFMNU
	JMS I	MNUCAL
	DLMCX0			/ASK FOR THE DOCUMENT TO TEST
	CDFMNU
	TAD I	(MUBUF+MNTMP1)
	CDFMYF			/SEE IF THE USER SAID RETURN
	SZA CLA
	JMP	DBTDOX		/IF A GOLD MENU WAS TYPED THEN
				/MNTMP1 = 1 ELSE ZERO
	CDFMNU
	TAD I	(MUBUF+MNFNO)
	CDFMYF			/GET FILE NUMBER
	JMP	DBTDO3
DBTDO2,	JMS	CX2RWB		/READ IN THE CURRENT SETTINGS FOR THE CX BUFFERS
	RXERD
	DLCX2D			/STARTING BLOCK ADDRESS

	CIFMNU
	JMS I	IOACAL		/CLEAR THE SCREEN
	0
	CLASCR
	0
	2700

	CDFMNU
	TAD I	(MUBUF+MNCXP)
	CDFMYF			/GET THE DOCUMENT TO TEST
	SNA
	JMP	DBTDX3		/IF ZERO THEN SET TO DEFAULT
				/COMMUNICATIONS SETTINGS
DBTDO3,	CIFFIO
	FILEIO
	XRDFIN
	DCA	ERRFLG		/SET IF AN ERROR OCCURS THIS IS USED FOR
				/THE FINAL ERROR MESSAGE OF NO ERRORS DETECTED
				/OR NUMBER OF ERRORS DETECTED.
DBTLP1,	CDFSYS
	TAD I	HLTFLG
	CDFMYF			/SEE IF THE USER WANTS TO TERMINATE THE
				/TEST
	SZA CLA
	JMP	DBTLPD		/IF SO DISPLAY THE SUMMARY UP TO NOW

	CIFFIO
	FILEIO
	XRDFNC			/GET THE NEXT CHARACTER
	SNA SPA
	JMP	DBTLPD		/IF DONE DISPLAY SUMMARY
	TAD	(-SOPC) 	/CHECK FOR PRINT CONTROLS ONLY
	SZA CLA
	JMP	DBTLP1
	JMS	DRDPCN		/CHECK THE PRINT CONTROL
	CLA
	JMP	DBTLP1

DBTLPD,	CLA			/JUST IN CASE.				/M0016
	TAD	ERRFLG		/DEPENDING IF THE FLAG IS SET OR NOT
	SZA CLA
	JMP	DBTLP2		/THE MESSAGE WILL BE DIFFERENT
	TAD	TESTFL		/IF CALLED FROM SO, DON'T DISPLAY THE MESSAGE
	SPA CLA
	JMP	DBTDX3
	AC0001
	CDFMNU
	DCA I	(MUBUF+MNTMP1)
	CDFMYF			/SET FOR MESSAGE 1 = OK

	CIFMNU
	JMS I	MNUCAL
	DLMCX0

DBTDX3,	ISZ	DBTDOC
	JMP	DBTDOX
DBTLP2,	CIFMNU
	JMS I	IOACAL		/DISPLAY TOTAL
	0
	ERRMS2
	ERRAG2
	ERRFLG
	AC0002			/SET MENU FOR
	CDFMNU
	DCA I	(MUBUF+MNTMP1)
	CDFMYF			/CORRECT MENU
	CIFMNU
	JMS I	MNUCAL
	DLMCX0
DBTDOX,	CLA
	TAD	TESTFL		/IF CALLED FROM SO, WRITE OUT THE NEW SETTINGS
	SMA CLA
	JMP	DBTDX4

	JMS	CX2RWB
	RXEWT
	DLCX2C

DBTDX4,	CLA
	DCA	TESTFL		/CLEAR TEST FLAG

DBTDX2,	XX
	JMP I	DBTDOC

/THE TWO ERROR ROUTINES THAT WILL DISPLAY THE TWO MAJOR TYPED DETECTED.
/THE FIRST DEFER1 WILL DISPLAY THE INVALID NUMBER MESSAGE.  THIS IS A
/CHARACTER VALUE THAT IS NOT NUMERIC OR OVER 377 OCTAL.

/THE SECOND IS DEFER2 WHICH WILL DISPLAY THE DAB FORMAT ERROR MESSAGE.
/THE ERROR MESSAGES WILL NOT APPEAR UNLESS IN TEST MODE
/THAT IS THE FLAG TESTFL = 1.

DEFER1,	TAD	TESTFL		/SEE IF SHOULD DISPLAY THE ERROR MESSAGE
	SNA CLA
	JMP	DRDPCL

	CIFMNU
	JMS I	IOACAL		/PRINT "*** -- IS AN ILLEGAL CHARACTER IN LINE "
	0			/DEFAULT OUTPUT ROUTINE
	ERRMS1			/STRING ADDRESS
	ERRAG1			/STRING ARGUMENT
	DGTABF			/OFFENDING ARGUMENT
	RDFLIB			/OFFENDING LINE
	ERRAG1			/STRING ARGUMENT

	ISZ	ERRFLG
	NOP			/INCREMENT THE ERROR COUNTER
	JMP	DRDPCL
/-----------------
/
/
/	Moved here on edit 058 to make space
/	
/

DISTAB,	ESCDET			/0 LENGTH. LOOK FOR ESC.		/A024
	CK2NDC			/1  SEE IF 2ND CHAR CONFORMS TO TRAP	/A024
	CK3RDC			/2 SEE IF 3RD CHAR CONFORMS		/A024
	CK4THC			/3 WILL ACCEPT ANYTHING BUT A NEW ESC	/A024
	CK5THC			/4 5TH CHAR TERMINATES EVERTHING WE WANT/A024
	EMPTNG			/5 WE ARE EMPTYING A STORED STRING	/A024



	PAGE

DEFER2,	TAD	TESTFL		/SEE IF THE ERRORS SHOULD BE DISPLAYED
	SNA CLA
	JMP	DRDPCL

	CIFMNU
	JMS I	IOACAL		/DISPLAY **ERROR**
	0			/BAD FORMAT
	ERRMS3
	ERRAG1
	DGTABF			/ARG
	RDFLIB			/LINE
	ERRAG1

	ISZ	ERRFLG
	NOP			/INCREMENT THE ERROR FLAG
	JMP	DRDPCL

/CX2RWB - WILL READ OR WRITE THE BUFFER AREA FOR CX2.  THE BUFFER AREA CONTAINS
/THE DEFINITIONS FOR THE SPECIAL EVENTS THAT OCCUR WHEN TRANSFERRING A DOCUMENT
/IN CX.  FOR EXAMPLE IT DEFINES THE EOL, EOD, SOD ECT.

/THE FORMAT OF THE CALL IS :
/JMS	CX2RWB
/THE FUNCTION READ/WRITE
/THE STARTING BLOCK NUMBER OF A 3 BLOCK BUFFER AREA TO BE MOVED
/FROM/TO CORE

/NOTE:	HAVE TO HAVE QU2BLK AND THIS ROUTINE ON THE SAME PAGE OR WILL NOT
/WORK THE WAY INTENDED. IT STORES VALUES FROM THE CALLING FIELD
/INTO QU2BLK BEFORE SETTING TO THIS FIELD.

CX2RWB,	XX
	TAD I	CX2RWB
	ISZ	CX2RWB
	DCA	QU2BLK+RXQFNC	/GET FUNCTION
	TAD I	CX2RWB
	ISZ	CX2RWB
	DCA	QU2BLK+RXQBLK	/STARTING BLOCK NUMBER
	JMS	DBFCX
	DCA	CX2RWX		/MAKE CROSS FIELD CALLABLE
/D045	TAD	USERNO
/D045	TAD	USERNO
	DCA	QU2BLK+RXQDRV	/SET FLOPPY DRIVE
	CDFMYF
	TAD	.-1
	DCA	QU2BLK+RXQBFD	/SET ACTION FIELD
	TAD	(CX2BFA)
	DCA	QU2BLK+RXQBAD	/AND BUFFER ADDRESS
	AC7775
	DCA	CX2RW1		/SET COUNTER OF NUMBER OF BLOCKS
				/TO TRANSFER.
CX2RWL,	JMS	QU2X
	CLA
	ISZ	CX2RW1
	SKP
	JMP	CX2RWX		/WHEN ZERO THEN RETURN
	TAD	(400)
	TAD	QU2BLK+RXQBAD
	DCA	QU2BLK+RXQBAD	/UPDATE THE ADDRESS FOR
				/THE NEXT BUFFER
	ISZ	QU2BLK+RXQBLK	/AND BLOCK POINTER
	JMP	CX2RWL
CX2RWX,	XX
	JMP I	CX2RWB

CX2RW1,	0


/THIS IS THE QUEUE ROUTINE TO RXHAN.  THE REQUEST IS IN QU2BLK
/USED BY DELETE AND SYSTEM OPTIONS

QU2X,	XX
	CIFSYS
	ENQUE
	QU2BK
	CIFSYS
	JWAIT
	TAD	QU2BLK+RXQCOD
	SNA
	JMP	.-4
	JMP I	QU2X

QU2BK,	DSKQUE
	0
	0
QU2BLK,	ZBLOCK 17


/DRDPCN - READ THE PRINT CONTROL AND SEE IF IT IS CX COMMAND.  IF SO IT WILL
/PROCESS THE PRINT CONTROL.

/IT IS CALLED FROM CX FOR ALL PRINT CONTROLS.  IT WILL THROW OUT ANY PRINT
/CONTROLS THAT  ARE NOT CX.  IT IS ALSO CALLED FROM DBTDOC.

DRDPCN,	XX
	CLA
	RDF			/MAKE CROSS FIELD CALLABLE
	TAD	CIDF0
	DCA	DRDPCX
	CDFMYF
	DCA	DRDINF		/CLEAR THE FIRST TIME THROUGH FLAG
DRDPCL,	JMS	DRDFIN		/READ IN THE FIRST LINE
	JMP	DRDPCX		/IF EMPTY THEN RETURN
	TAD	(RDFLIB)
	DCA	DGTTM1		/INITALIZE POINTER FOR DGTARG
	JMS	DGTARG		/GET THE NEXT ARG
	JMP	DRDPCL		/EMPTY LINE
	TAD	DRDINF		/IF FIRST TIME CHECK CX
	SZA CLA
	JMP	DRDPL2
	ISZ	DRDINF
	TAD	(DCXSTR)
	JMS	DCMPAZ
	JMP	DRDPL3		/THROW AWAY THE PRINT CONTROL IF NOT CX
	JMP	DRDPCL		/READ THE NEXT LINE

DRDPL2,	TAD	(CMDTBL)	/SEE WHICH COMMAND IT IS
	JMS	DCKTBL		/GET AN ARG TO COMPARE WITH
	JMP	DEFER2		/IF DOESNT MATCH THEN AN ERROR IN FORMAT
	TAD	(JMP I DJMPAD)	/GET THE CORRECT ADDRESS OF THE CMD TO PROCESS
	DCA	.+1
	XX


DRDPCX,	XX
	JMP I	DRDPCN		/RETURN TO CALLER

DRDPL3,	JMS	DRDFIN		/THROW OUT THE PRINT COMMAND SINCE NOT CX
	JMP	DRDPCX
	JMP	DRDPL3

DRDINF,	0

/COMMAND STARTING ADDRESSES

DJMPAD,	RECCMD			/RECEIVE COMMAND
	SNDCMD			/SEND



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

/THIS IS THE RECEIVE COMMAND.

RECCMD,	JMS	DGTARG		/GET THE CHARACTER THAT DEFINES THE ACTION/TIME
				/INSTEAD OF A PREDEFINED ON LIKE EOL
	JMP	DEFER2		/BAD FORMAT

	JMS	GETOVL		/CONVERT TO A NUMBER
	JMP	DEFER1		/NOT A NUMBER

	MQL
	TAD	TESTFL		/SEE IF SHOULD UPDATE THE RECEIVE VALUE
	SMA SZA CLA
	JMP	RECCM2
	MQA			/IF CALLED BY TD THEN DONT UPDATE ELSE DO SO
	DCA	RECFLG		/STORE SO HOST PROGRAM WILL SEE IT
RECCM2,	TAD	(RCVBOF)
	JMS	DBFINI

	JMP	DEFCML		/FILL THE BUFFER


/SNDCMD - THE SEND COMMAND

SNDCMD,	JMS	DGTARG		/GET THE ARG THAT TELLS WHAT COMMAND IT IS
	JMP	DRDPCL		/EMPTY LINE

	TAD	(DEFARG)
	JMS	DCKTBL		/SEE WHAT IS BEING DEFINED
	JMP	DEFCM4		/CHECK FOR THE REGULAR SEND COMMAND
DEFCM5,	JMS	DBFINI		/INITALIZE THE BUFFER TO MODIFY
DEFCML,	JMS	DGTARG		/SEE WHAT THE SUBSTITUTION STRING IS
	JMP	DRDPCL		/DONE WITH THE COMMAND SEE IF THERE IS ANOTHER
DEFCM6,	TAD	(DEFVCR)	/CHECK FOR VALID CHARACTERS OR COMMANDS
	JMS	DCKTBL
	JMP	DEFCM2		/SEE IF IT IS AN OCTAL VALUE

	TAD	(CHRTBL)	/GET THE CHARACTER VALUE FOR WHAT WAS TYPED
	DCA	T1
	TAD I	T1
DEFCM3,	JMS	DBPCHR		/STORE A CHARACTER IN THE BUFFER SET BY DBFINI
	JMP	DEFCML
	JMP	DEFCML
DEFCM2,	JMS	GETOVL		/GET THE OCTAL VALUE OF THE ARG FOUND
	JMP	DEFCM7		/TRY AN ASCII STRING

	JMP	DEFCM3		/STORE IT
DEFCM4,	AC0001
	DCA	SNDFLG		/TELL THE DISK ROUTINE THERE IS SOMETHING TO
				/SEND

	TAD	(SNDBOF)	/INITALIZE THE BUFFER FOR FILLING
	JMS	DBFINI

	JMP	DEFCM6		/STORE THE FIRST CHARACTER
DEFCM7,	JMS	GETASC		/SEE IF AND ASCII STRING
	JMP	DEFER1		/NO SO ERROR
	JMP	DEFCML


/GETASC - SEE IF THE ARG IS AN ASCII STRING AND IF SO THEN STORE IN THE
/OPENED BUFFER.

/CALL:
/JMS	GETASC
/NOT ASCII RETURN
/ASCII RETURN

GETASC,	XX
	CLA
	TAD	DGTABF		/CHECK FOR THE ASCII TERMINATOR
	TAD	(-"=+200) 
	SZA CLA
	JMP I	GETASC

GETASL,	TAD I	DGTTM1		/COPY THE STRING INTO THE BUFFER
	SNA
	JMP	DEFER1		/IF END OF ARG AND FOUND NO TERMINATOR, ERROR
	ISZ	DGTTM1
	TAD	(-"=+200) 
	SNA
	JMP	GETAND		/FOUND THE END OF A REAL ASCII STRING
	TAD	("=-200) 

	JMS	DBPCHR		/STORE IT
	CLA
	JMP	GETASL
GETAND,	ISZ	GETASC		/OK RETURN
	JMP I	GETASC


/DCKTBL - COMPARE A TABLE FOR A MATCH OF THE STRING IN THE ARG BUFFER DGTABF
/THE ADDRESS OF THE TABLE IS IN THE AC.  THE TABLE CONTAINS A LIST OF STARTING
/ADDRESS OF THE VALID 6-BIT STRINGS THAT THE TEXT IN DGTABF COULD BE.
/THE OFFSET CORRESPONDING WITH THE STRING THAT MATCHED WILL BE IN AC ON RETURN.

DCKTBL,	XX
	DCA	DCKTT2		/STORE THE START OF THE LIST ADDRESS
	AC7777
	DCA	DCKTBT		/SET TO -1 SO VALUE IS REALLY THE OFFSET
DCKTB2,	TAD I	DCKTT2		/FOUND END OF LIST AND STILL NO MATCH
	SNA
	JMP I	DCKTBL
	ISZ	DCKTT2		/INCREMENT THE POINTER
	ISZ	DCKTBT		/INCREMENT OFFSET COUNTER
	NOP			/FOR WHEN IT GOES TO ZERO

	JMS	DCMPAZ		/COMPARE THE ENTRY
	JMP	DCKTB2		/NO MATCH RETURN FROM DCMPAZ

	TAD	DCKTBT		/RETURN VALUE IN AC
	ISZ	DCKTBL
	JMP I	DCKTBL
DCKTBT,	0
DCKTT2,	0


/DCMPAZ - STRING COMPARE.  COMPARES THE STRING IN 6-BIT TEXT FORMAT WHOS
/ADDRESS IS IN THE AC WITH THE ASCIIZ TEXT FOUND IN THE ARGUEMENT BUFFER DGTABF

/CALL:	JMS	DCMPAZ
/NO MATCH RETURN
/MATCH RETURN

DCMPAZ,	XX
	DCA	DCMPT1		/STORE THE ADDRESS OF THE STRING TO COMPARE TO
	DCA	DCMPT2		/CLEAR FLAG FOR ROUTINE DCMPA6 THAT MAKES ASCII
				/CHARACTERS OUT OF SIX BIT.

	TAD	(DGTABF-1)
	DCA	X1		/SET THE STARTING ADDRESS OF THE ARG STRING
DCMPAL,	TAD I	X1
	TAD	(-140)		/MAP UP ALL UPPER CASE
	SPA
	TAD	(40)
	TAD	(100)

	DCA	T2

	JMS	DCMPA6		/GET THE 6-BIT CHARACTER TO COMPARE

	SNA
	JMP	DCMPOK		/IF ZERO DONE WITH COMPARE AND MATCH IS MADE
	CIA
	TAD	T2
	SNA CLA
	JMP	DCMPAL
	JMP I	DCMPAZ		/NO MATCH

DCMPOK,	ISZ	DCMPAZ		/MATCH MADE
	JMP I	DCMPAZ
/-----------------
	PAGE


/DCMPA6 - MAKE AN ASCII CHARACTER OUT OF THE 6-BIT TEXT STRING

DCMPA6,	XX
	CLA
	TAD	DCMPT2
	SZA CLA
	JMP	DCMPJ2		/DCMPT2 IS THE FLAG FOR TELLING
				/WHICH BYTE TO USE
	ISZ	DCMPT2		/SET TO OTHER BYTE
	TAD I	DCMPT1		/GET THE WORD
	BSW			/WANT THE FIRST BYTE
DCMPJ3,	AND	P77
	SNA
	JMP I	DCMPA6
	TAD	(-40)
	SPA
	TAD	(100)
	TAD	(40)
	JMP I	DCMPA6
DCMPJ2,	DCA	DCMPT2		/SET BACK TO FIRST BYTE
	TAD I	DCMPT1		/GET THE CURRENT WORD
	ISZ	DCMPT1		/INCREMENT THE WORD POINTER
	JMP	DCMPJ3

DCMPT1,	0			/ADDRESS OF CURRENT WORD TO MAKE ASCII
				/FROM 6-BIT
DCMPT2,	0			/IF 0 THEN FIRST BYTE AND 1 IS SECOND


/DGTARG - GET THE NEXT ARGUEMENT STARTING AT THE ADDRESS THAT IS CONTAINED
/IN DGTTM1.  WILL PUT THE ARG INTO THE BUFFER DGTABF AND UPDATE DGTTM1 TO
/POINT TO THE START OF THE NEXT ARG.

/CALL:	JMS	DGTARG
/NO MORE ARGS
/ARG FOUND

DGTARG,	XX
	CIFMNU
	JMS I	NXACAL
	DGTTM1
	DGTABF-1		/ADDRESS OF THE BUFFER TO PUT THE ARG -1.
				/THIS LOCATION HAS THE NEGATIVE MAX SIZE
				/THE ARG COULD BE -1

	JMP I	DGTARG		/NO ARG
	ISZ	DGTARG
	JMP I	DGTARG

	1-DGTABX
DGTABF,	ZBLOCK DGTABX

/DBFCX - MAKES A SUBROUTINE CROSS FIELD CALLABLE.  THE AC ON THE CALL IS
/SAVED INTO T1.

DBFCX,	XX
	DCA	T1
	RDF
	TAD	CIDF0
	CDFMYF
	JMP I	DBFCX


/DBFINI - WILL INITALIZE THE BUFFER THAT IS REPRESENTED BY THE VALUE IN T1.
/VALUE IS THE POSTION THE BUFFER INFORMATION IS IN.  FOR EXAMPLE STX IS 0
/1= SOL, 2 = EOL, 3 = EOT, 4 = SND, 5 = RCV, 6 = TAB, 7 = INTRODUCER FOR
/TECH CHARACTER.
/THE TYPE OF BUFFER IS DEFINED BY WHAT IS IN THE AC 0 = SEND AND 1 = RECEIVE.

/THIS WILL SET UP THE POINTERS FOR THE BEGINNING OF THE BUFFER AND -MAX LENGTH
/OF THE BUFFER FOR THE ROUTINES DBGCHR AND DBPCHR.

DBFINI,	XX
	JMS	DBFCX
	DCA	DBFINX		/SET FOR CROSS FIELD RETURN
	TAD	T1
	CLL RAL
	TAD	(DBINFO)	/CONVERT THE POSITION INTO AN ACTUAL ADDRESS
	DCA	T1

	TAD I	T1
	DCA	DBCHRC		/SET THE -MAX LENGTH COUNTER
	ISZ	T1
	TAD I	T1
	DCA	DBCHRP		/AND THE POINTER
DBFINX,	XX
	JMP I	DBFINI

/GETOVL - TRANSLATES THE ASCII STRING IN THE ARG BUFFER INTO AN OCTAL VALUE

/CALL:	JMS	GETOVL
/ERROR RETURN
/OK RETURN

GETOVL,	XX
	CLA
	TAD	(DGTABF-1)
	DCA	X1		/SET THE STARTING ADDRESS
	TAD	(-GETOVM)
	DCA	T1		/SET THE MAX DIGIT COUNTER
	DCA	GETONM		/CLEAR THE NUMBER VALUE TO RETURN
GETOVJ,	TAD I	X1		/GET THE ASCII CHARACTER
	SNA
	JMP	GETOVX		/DONE WITH CONVERSION
	TAD	(-"0+200)
	SPA
	JMP	GETOVE		/NOT VALID OCTAL VALUE
	TAD	("0-"7)
	SMA SZA
	JMP	GETOVE		/TOO LARGE
	TAD	("7-"0)
	DCA	T2		/STORE THE NEW DIGIT
	TAD	GETONM
	CLL RTL
	CLL RAL			/ROTATE FOR THE NEXT DIGIT
	TAD	T2
	DCA	GETONM		/ADD THE NEW DIGIT
	ISZ	T1		/INCREMENT THE CHARACTER COUNTER
	JMP	GETOVJ
GETOVE,	CLA
	JMP I	GETOVL		/RETURN ON ERROR

GETOVX,	TAD	GETONM
	TAD	(-377)		/SEE IF IT IS TOO BIG
	SMA SZA
	JMP	GETOVE
	TAD	P377
	ISZ	GETOVL
	JMP I	GETOVL

GETONM,	0			/THE TEMP WHERE THE OCTAL NUMBER IS BUILT
/-----------------
	PAGE


/DBGCHR - WILL GET THE NEXT CHARACTER FROM THE BUFFER THAT HAS BEEN INITALIZED
/BY DBFINI.  IT WILL RETURN A -1 FOR END OF BUFFER.
/IT WILL DO A SKIP RETURN FOR A CHARACTER AND NO SKIP RETURN FOR A COMMAND.

DBGCHR,	XX
	JMS	DBFCX
	DCA	DBGNX		/MAKE IT CROSS FIELD CALLABLE

	TAD I	DBCHRP		/GET CHARACTER
	SPA
	JMP	DBGNX2		/IF END OF BUFFER THEN RETURN
	AND	(7400)		/CHECK FOR A COMMAND INSTEAD OF A NORMAL CHAR.
	SNA
	JMP	DBGCH2
	BSW
	CLL RTR			/USE THE UPPER 4 BITS TO TELL WHICH COMMAND
	TAD	(JMP I DBGCHT-1)
	DCA	.+1
	XX

/TABLE FOR COMMAND PROCESSING OF THE BUFFERS

DBGCHT,	DBGSND			/RECEIVE ROUTINE'S SEND COMMAND
	DBGWAT			/WAIT ROUTINE
	DBGTAB			/SEND TAB NOSPACE			/A033

DBGWAT,	ISZ	DBCHRP		/INDEX THE POINTER TO GET THE VALUE TO WAIT FOR
	TAD I	DBCHRP
	SMA
	ISZ	DBCHRP		/IF END OF BUFFER, THEN DON'T INCREMENT
	DCA	WATFLG
	JMP	DBGNX

DBGSND,	ISZ	DBCHRP		/INCREMENT THE POINTER
	JMP	DBGNX

DBGTAB,									/A033
DBGCH2,	TAD I	DBCHRP
	SMA
	ISZ	DBCHRP		/IF NOT END OF BUFFFER, INCREMENT POINTER
DBGNX2,	ISZ	DBGCHR
DBGNX,	XX
	JMP I	DBGCHR


/DBPCHR - STORE A CHARACTER INTO THE BUFFER THAT HAS BEEN INITALIZED BY DBFINI.
/IT WILL CHECK FOR BUFFER FULL AND IF NOT STORE THE CHARACTER, UPDATE THE
/POINTER, THEN INCREMENT THE LIMIT COUNTER BY 1. FULL IS WHEN DBCHRC = 0.
/THE CHARACTER TO STORE IS IN THE AC.

/IF FULL IT DOES A NON SKIP RETURN WITH THE CHARACTER IN THE AC

DBPCHR,	XX
	JMS	DBFCX
	DCA	DBPCHX		/SET FOR CROSS FIELD CALL
	TAD	TESTFL		/SEE IF SET FOR ONLY TEST, IF SO STORE NOTHING
	SMA SZA CLA
	JMP	DBPCHJ
	AC0001
	TAD	DBCHRC		/SEE IF THE BUFFER IS FULL
	SMA SZA
	JMP	DBPCH2		/YES
	DCA	DBCHRC

	TAD	T1
	DCA I	DBCHRP		/STORE THE CHARACTER
	ISZ	DBCHRP
	AC7777
	DCA I	DBCHRP		/AND STORE THE TRAILER
DBPCHJ,	ISZ	DBPCHR		/OK RETURN
DBPCHX,	XX
	JMP I	DBPCHR

DBPCH2,	TAD	T1		/RETURN WITH CHARACTER IN AC ON BUFFER FULL
	JMP	DBPCHX		/AND NO SKIP RETURN


/DRDFIN - READ IN A LINE OF TEXT FROM RDFILL. THE ROUTINE IS USED WHEN CX
/IS READING IN A LINE OF A PRINTER CONTROL.  THE TEXT IS STORED IN THE BUFFER
/RDFLIB.

/NOTE: COMMANDS ARE LIMITED TO ONE LINE AND THE BUFFER IS SET TO RDFLMX SIZE.

/CALL:	JMS	DRDFIN
/EOL OR END OF PRINTER COMMAND (EOPC) RETURN
/NORMAL RETURN

DRDFIN,	XX
	CLA
	TAD	(RDFLIB-1)
	DCA	DRDFT2		/INITALIZE THE BUFFER POINTER
	TAD	(1-DRDLMX)
	DCA	DRDFT1		/SET MAX CHARACTERS
	DCA	DRDFRL		/CLEAR THE IN THE MIDDLE OF A RULER FLAG
DRDFLL,	ISZ	DRDFT2
DRDFL2,	CIFFIO								/M0006
	FILEIO								/M0006
	XRDFNC			/READ IN A CHARACTER
	SNA SPA								/M0016
	JMP	DRDEOF		/IF ZERO FOUND END OF FILE
	TAD	(-ERULER)	/SEE IF THERE IS AN END OF RULER CHAR
	SNA
	JMP	DRDFJ3		/IF SO CLEAR THE FLAG
	MQL
	TAD	DRDFRL		/IF IN THE MIDDLE OF A RULER THEN
				/SKIP ALL CHARACTERS TILL END IF FOUND
	SZA CLA
	JMP	DRDFL2
	MQA
	TAD	(ERULER-SRULER) /SEE IF START OF RULER CHARACTER
	SNA
	JMP	DRDFJ2		/IF SO SET FLAG
	TAD	(SRULER-EOPC)	/SEE IF END OF PRINTER CONTROL
	SNA
	JMP	DRDEOF
	TAD	(EOPC)

	AND	P177		/STRIP OFF THE MODE BITS
	SNA
	JMP	DRDEOF		/IF ZERO THE EOF
	TAD	(-LF)
	SNA
	JMP	DRDEOL		/END OF LINE
	TAD	(LF-40)
	SPA
	JMP	DRDFL2		/THROW OUT THE CHARACTERS
	TAD	(40)
	DCA I	DRDFT2		/STORE THE CHARACTER
	ISZ	DRDFT1		/INCREMENT THE MAX COUNTER CHECK
	JMP	DRDFLL
DRDEOL,	ISZ	DRDFIN		/SET RETURN
DRDEOF,	CLA								/M0016
	DCA I	DRDFT2		/MAKE SURE THE STRING TERMINATES WITH A ZERO
	JMP I	DRDFIN

DRDFJ2,	AC0001			/SET THE RULER FLAG
DRDFJ3,	DCA	DRDFRL		/DRDFJ3 CLEARS THE RULER FLAG
	JMP	DRDFL2

DRDFT1,	0
DRDFT2,	0
DRDFRL,	0

/
/	This is just a copy of the code at NRCSWP to handle stuff 	/A058
/	going out from a DOC to the host				/A058
/
/


NRCSWD,	XX
	DCA	NRCSWC		/ Save char in safe place		/A058
	TAD I	(DKTXXX)	/ Find service routine			/A058
	CDFMYF			/
	JMS	NRCSWS		/ Now go try to swap			/A058
	CDFBUF			/					/A058
	CIFBUF			/ Point to return field			/A058
	JMP I	NRCSWD		/ And go back				/A058


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

/DBRINI - WILL INITALIZE THE BUFFER THAT IS REPRESENTED BY THE VALUE IN T1.
/VALUE IS THE POSTION THE BUFFER INFORMATION IS IN.  FOR EXAMPLE STX IS 0
/1= SOL, 2 = EOL, 3 = EOT, 4 = SND, 5 = RCV.
/THE TYPE OF BUFFER IS DEFINED BY WHAT IS IN THE AC 0 = SEND AND 1 = RECEIVE.

/THIS WILL SET UP THE POINTERS FOR THE BEGINNING OF THE BUFFER AND -MAX LENGTH
/OF THE BUFFER FOR THE ROUTINE DBRGCH.

/THE ONLY REASON FOR 2 IS TO ALLOW H2TJOB TO BE ABLE TO SEND AT THE SAME TIME
/DSKJOB IS EXECUTING.

DBRINI,	XX
	JMS	DBFCX
	DCA	DBRINX		/SET FOR CROSS FIELD RETURN
	TAD	T1
	CLL RAL
	TAD	(DBINFO)	/CONVERT THE POSITION INTO AN ACTUAL ADDRESS
	DCA	T1

	TAD I	T1
	DCA	DBRCHC		/SET THE -MAX LENGTH COUNTER
	ISZ	T1
	TAD I	T1
	DCA	DBRCHP		/AND THE POINTER
DBRINX,	XX
	JMP I	DBRINI


/DBRGCH - WILL GET THE NEXT CHARACTER FROM THE BUFFER THAT HAS BEEN INITALIZED
/BY DBRINI.  IT WILL RETURN A -1 FOR END OF BUFFER.
/IT WILL DO A SKIP RETURN FOR A CHARACTER AND NO SKIP RETURN FOR A COMMAND.

DBRGCH,	XX
	JMS	DBFCX
	DCA	DBRNX		/MAKE IT CROSS FIELD CALLABLE

	TAD I	DBRCHP		/GET CHARACTER
	SPA
	JMP	DBRNX2		/IF END OF BUFFER THEN RETURN
	AND	(7400)		/CHECK FOR COMMAND INSTEAD OF A NORMAL CHARACTER
	SNA
	JMP	DBRCH2
	BSW
	CLL RTR			/USE THE UPPER 4 BITS TO TELL WHICH COMMAND
	TAD	(JMP I DBRCHT-1)
	DCA	.+1
	XX

/TABLE FOR COMMAND PROCESSING OF THE BUFFERS

DBRCHT,	DBRSND			/RECEIVE ROUTINE'S SEND COMMAND
	DBRWAT			/WAIT ROUTINE
	DBRTAB			/SEND TAB NOSPACE ROUTINE		/A033

DBRWAT,	ISZ	DBRCHP		/INDEX THE POINTER TO GET THE VALUE TO WAIT FOR
	TAD I	DBRCHP
	SMA
	ISZ	DBRCHP		/IF END OF BUFFER THEN DONT INCREMENT
	JMP	DBRNX

DBRSND,	ISZ	DBRCHP		/INCREMENT THE POINTER
	JMP	DBRNX

DBRTAB,									/A033
DBRCH2,	TAD I	DBRCHP
	SMA
	ISZ	DBRCHP		/IF NOT END OF BUFFFER INCREMENT POINTER
DBRNX2,	ISZ	DBRGCH
DBRNX,	XX
	JMP I	DBRGCH

IFDEF CONFIG	<

/THE FOLLOWING CODE HANDLES GETTING TO AX/DX OR BACK TO MAIN MENU	/A031
/FOR EASY-LINK.								/A031
/TO ACCOMPLISH AX/DX, THE FOLLOWING MUST OCCUR:				/A031
/MNTMP1 SET TO 1/2 FOR AX/DX						/A031
/MNTMP6 SET TO 1 TO INDICATE EASY-LINK IN PROGRESS.			/A031
/MNONUM AND THE FOLLOWING 2 LOCATIONS MUST BE SET TO THE PROPER		/A031
/OLAY INFO FOR LOADING AX/DX (WHICH ARE THE SAME MODULE),		/A031
/THEN THE RETURN ADDRESS OF CX (XBSTRT) IS BUMPED FOR A			/A031
/"CHAIN" RETURN.							/A031
/FINALLY, WE KILL THE HOST JOB & RETURN. THE KB JOB WILL KILL		/A031
/THE REST OF THE JOBS & TAKE US BACK TO WHERE WE'RE GOING.		/A031

GOTODX,	IAC			/SET MNTMP1 TO 2			/A031
GOTOAX,	IAC			/SET MNTMP1 TO 1			/A031
	JMS	EZLNCK		/SEE IF EZLINK IS ENABLED.		/A031
	CDFMNU			/MAP MENU FIELD.			/A031
	DCA I	(MUBUF+MNTMP1)	/SET MNTMP1 TO DESIRED VALUE.		/A031
	AC0001			/NOW SET EZLINK FLAG.			/A031
	DCA I	(MUBUF+MNTMP6)						/A031
	TAD	(MUBUF+MNONUM-1)/NOW GET ADDR OF BLOCK TO INITIALIZE.	/A031
	DCA	IX1		/SAVE IN AN INDEX REGISTER.		/A031
	TAD	(5)		/OLAY ENTRY #5.				/A031
	DCA I	IX1							/A031
	TAD	(200)		/ENTRY ADDRESS IS AT "200".		/A031
	DCA I	IX1							/A031
	TAD	(CIF 10)	/FIELD IS "USER FIELD 1".		/A031
	DCA I	IX1							/A031
	CDFMYF			/GET CURRENT VTMODE			/A031
	TAD	VTMODE							/A031
	CDFSYS			/STUFF IT IN SYS FIELD.			/A031
	DCA I	(EZLNTM)	/SAVE IT HERE!				/A031
	CDFBUF			/NOW BUMP TO "CHAIN" RETURN.		/A031
	ISZ I	(XBSTRT)						/A031
	JMP	GOTOMM		/USE COMMON CODE TO GET BACK TO MM	/A031
GOTOMH,	JMS	EZLNCK		/SEE IF EZLINK IS ENABLED.		/A031
	TAD	(7402)		/THIS CALL HANGS UP THE MODEM.		/A031
	CIFSYS								/A031
	HS2OU			/BYE-BYE!				/A031
	NOP								/A031
GOTOMM,	JMS	EZLNCK		/SEE IF EZLINK IS ENABLED.		/A031
	CDFBUF			/MAP CX FIELD.				/A031
	AC0001			/SET "EXIT" FLAG.			/A031
	DCA I	(EXITFL)						/A031
	JMP	H2ABRT		/GO BYE BYE!!!				/A031

EZLNCK,	XX			/ROUTINE TO DETERMINE IF WE'RE IN EZLINK/A031
	DCA	EZTMP1		/SAVE AC.				/A031
	CDFBUF			/MAP CX FIELD.				/A031
	TAD I	(EZLINK)	/GET EZLINK ENABLED WORD.		/A031
	CDFMYF			/BACK TO OUR FIELD.			/A031
	SNA CLA			/SKIP IF ENABLED. RETURN TO PROCESS.	/A031
	JMP	HSEXIT		/EZLINK NOT ENABLED. IGNORE REQUEST.	/A031
	TAD	EZTMP1		/RESTORE THE AC.			/A031
	JMP I	EZLNCK		/RETURN TO CALLER.			/A031

EZTMP1,	0			/TEMP HOLDING PLACE FOR INPUT AC.	/A031
	>			/DEF CONFIG

NRCSWP,	XX
	DCA	NRCSWC		/ Save char in safe place		/A058
	CDFBUF			/ Point to WPCOM field 			/A058
	TAD I	(KBTXXX)	/ Find service routine			/A058
	CDFMYF			/ And point back again			/A058
	JMS	NRCSWS		/ Now go try to swap			/A058
	CIFBUF			/ Point to return field			/A058
	JMP I	NRCSWP		/ And go back				/A058

NRCSWS,	XX
	TAD	(-HS2OU)	/ Are we outputting to Host ?		/A058
	SZA CLA			/ 					/A058
	JMP	NRCNOS		/ No , dont swap anything		/A058
	TAD	NRCREP		/ Yes , we're talking to a host		/A058
	SNA			/ Had we worked out a replacement char?	/A058
	JMP	NRCNOSWP	/ No , its OK then			/A058
	SKP			/ 					/A058
NRCNOS,	TAD	NRCSWC		/ Get original char back		/A058
	JMP I	NRCSWS		/ And return				/A058

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

/THE FOLLOWING SEVERAL PAGES CONTAIN XLATION CODE USED IN CX FOR KH AND HS.
/DUE TO SPACE CONSTRAINTS THIS CODE HAS BEEN MOVED TO THIS FIELD. BUT THIS
/MODULE (WPCX2) IS ASSEMBLED WITH WPCX AND WPCU4 BECAUSE OF DOCUMENT
/TESTING ROUTINES. THE VT XLATION CODE CONTAINS REFERENCES TO WPCX VARIABLES
/ROUTINES AND/OR LOCATIONS NOT FOUND IN THE OTHER ASSMEBLIES. BUT WPCX2 IS
/WRITTEN OUT BY WPCX AND IS READ IN BY BOTH (WPCX AND WPCU4) FOR
/DISK SPACE REASONS. SO ALL ASSEMBLIES MUST ASSEMBLE THE SAME WAY,
/OTHERWISE REFERENCES IN WPCU4 TO DOCUMENT TESTING ROUTINES WON'T
/BE TO THE SAME PLACE THAT THE ROUTINES ARE AT WHEN THEY ARE ASSEMBLED WITH
/WPCX AND WRITTEN TO THE DISK.

/THEREFORE THE FOLLOWING SEVERAL PAGES ARE ASSEMBLED ONLY FOR WPCX AND ARE
/LEFT BLANK FOR WPCU4.

IFNDEF	CONDOR	<		/DM-II FIRMWARE DOES ALL EMULATIONS	/A017
IFDEF	CONFIG	<

/KB2HST - XLATE KH ESCAPE SEQUENCES FROM VT278 TO VT52/VT278 DEPENDING
/UPON THE SETTING OF VTMODE (0 = VT52, 1=VT278, 2/3 = DECWORD).

/THE ESCAPE SEQUENCES FROM THE KB ARE STORED UNTIL THE TERMINATOR
/IS SEEN. THEN THE PROPER XLATION TABLE IS SEARCHED FOR THE KB
/ESC SEQ. IF FOUND THE ASSOCIATED XLATION ESC SEQ IS SENT. IF NOT
/FOUND THEN THE ORIGINAL ESC SEQ IS SENT.


KB2HST,	XX
	TAD I	(KBTFL1)
	DCA	KB2HT1
	TAD I	(K2HCHR)	/GET CHAR.				/M013
	DCA	KB2HT2
	RDF			/GET DATA FIELD.
	TAD	CDF0
	DCA	KB2HS1
	RDF
	TAD	CIDF0
	DCA	KB2HEX
	CDFMYF			/MAP OUR FIELD.

	TAD	KB2HT1
	AND	(14)		/HOST OUTPUT?
	SNA CLA			/SKIP IF YES.
	JMP	KB2HEX		/RETURN IMMEDIATELY IF NO HOST.

	TAD	KB2HT2		/GET CHARACTER FROM KB.
	DCA I	K2HPTR		/SAVE IT IN INTERMEDIATE BUFFER.
	ISZ	K2HPTR		/BUMP PTR.
	DCA I	K2HPTR		/SET STOPPER.
	TAD	(-ESC)		/CHECK FOR ESC.
	TAD	KB2HT2		/IS CHARACTER AN ESC?
	SNA CLA			/SKIP IF NO.
	JMP	KB2HES		/HANDLE ESCAPE SEQUENCE START.
	TAD	K2HESC		/ARE WE IN THE MIDDLE OF AN ESC SEQ?
	SNA CLA			/SKIP IF YES.
	JMP	KB2HS9		/JMP IF NOT IN ESC SEQ. OUTPUT CHAR.
	TAD	KB2HT2		/GET CHAR FROM KB.
	JMS	CHKTRM		/SEE IF IT IS AN ESC SEQ TERMINATOR.
	JMP	KB2HS2		/THIS RETURN IF TERMINATOR.
				/THIS RETURN IF NOT TERMINATOR.
KB2HS1,	XX			/CDF TO CALLER.
	AC0003			/RETURN TO CALLER AFTER ELIMINATING
	AND I	(KBTFL1)	/"TO HOST" FROM THIS PASS.
	DCA I	(KBTFL1)
KB2HEX,	XX			/CID CALLER FIELD.
	JMP I	KB2HST		/RETURN TO CALLER.

/HERE IF ESC SEQ TERMINATOR SEEN.
/GO THROUGH T2HXX TABLE FOR ESC SEQ XLATION.

KB2HS2,	TAD	VTMODE		/MAP TO TRANSLATION TABLE.
	TAD	(K2HXX)		/GET TABLE POINTER POINTER.
	DCA	KB2HPT		/SAVE.
	TAD I	KB2HPT		/GET TABLE PTR.
	DCA	KB2HPT		/SAVE START ADDRESS OF TABLE.
KB2HS3,	TAD	(K2HBUF)	/GET START OF ESQ SEQ BUFFER.
	DCA	K2HPTR		/SAVE PTR.

KB2HS4,	TAD I	KB2HPT		/GET XLATION TBL CHAR.
	SNA			/SKIP IF THERE IS ONE THERE.
	JMP	KB2HS8		/JMP IF AT END OF XLATION TBL ESQ.
	CIA			/CHECK AGAINST ESC SEQ CHAR.
	TAD I	K2HPTR
	SZA			/SKIP IF CHARS MATCH.
	JMP	KB2HS5		/JMP IF ESC SEQ IS DIFFERENT.
	ISZ	KB2HPT		/BUMP XLATION TBL PTR.
	ISZ	K2HPTR		/BUMP ESC SEQ PTR.
	JMP	KB2HS4		/SEE IF NEXT CHAR MATCHS TOO!

KB2HS5,	SPA CLA			/SKP IF ESC SEQ IS EARLY IN XLATION TBL
	JMP	KB2HS9		/JMP IF MINUS; ESC SEQ NOT IN TBL.
KB2HS6,	TAD I	KB2HPT		
	ISZ	KB2HPT		/BUMP TBL PTR WHILE IN SEQ TO MATCH.
	SZA CLA			/SKIP WHEN SEE STOPPER.
	JMP	KB2HS6		/LOOP WHILE IN ESC SEQ TO MATCH TO.
KB2HS7,	TAD I	KB2HPT		
	ISZ	KB2HPT		/BUMP TBL PTR WHILE IS SEQ TO OUTPUT.
	SZA CLA			/SKIP WHEN SEE STOPPER.
	JMP	KB2HS7		/LOOP WHILE IN ESC SEQ TO OUTPUT.
	JMP	KB2HS3		/TRY NEXT XLATION SEQ IN TBL.

KB2HS8,	TAD I	K2HPTR		/ARE WE AT THE END OF THE ESC SEQ?
	SZA CLA			/SKIP IF YES.
	JMP	KB2HS9		/JMP IF NO. SEQ CANNOT BE XLATED.
	ISZ	KB2HPT		/PT TO XLATION OF ESC SEQ.
	DCA	K2HESC		/SAY NO ESC SEQ IN PROGRESS.
	JMP	KB2H11		/START OUTPUTTING.

KB2HES,	AC0001			/SET ESC SEQ IN PROGRESS FLAG.
	DCA	K2HESC
	TAD	(ESC)		/SET ESC SEQ INTO BUFFER
	DCA	K2HBUF		/IN CASE ESC SEQ INTERRUPTS ESC SEQ.
	DCA	K2HBUF+1	/SET STOPPER.
	AC0001			/SET BUFFER PTR TO K2HBUF+1 & EXIT!
	JMP	KB2H12

KB2HS9,	DCA	K2HESC		/TURN OFF "ESC SEQ IN PROGRESS" FLAG.
	TAD	(K2HBUF)	/GET OUTPUT BUFFER PTR.
	DCA	KB2HPT		/SET OUTPUT PTR...
	JMP	KB2H11		/START OUTPUTTING.

KB2H10,	CLA			/SEE IF HALT FLAG SET.
	CDFSYS
	TAD I	HLTFLG
	CDFMYF
	SNA CLA			/SKIP IF SET.
	JMP	K2H11A		/DO JWAIT & TRY AGAIN.
	TAD	KB2HEX
	DCA .+1
	XX
	JMP	CONFIG		/TREAT HALT FLAG LIKE "\R".

K2H11A,	CIFSYS			/WAIT FOR OUR NEXT TURN.
	JWAIT
KB2H11,	CLA			/GET CHAR TO OUTPUT.
	TAD I	KB2HPT
	AND	P377		/NOT ONLY WANT 7.		/M056	/A013
	AND	VT22MSK		/ Strip to 7 or 8 bit 			/A056
	SNA			/SKIP IF WE HAVE A CHAR TO OUTPUT.
	JMP	KB2H12		/JMP WHEN DONE.
	CIFSYS			/OUTPUT IT.
	HS2OU
	JMP	KB2H10		/BACKED UP. WAIT & TRY AGAIN.
	ISZ	KB2HPT		/PT TO NEXT CHAR TO OUTPUT.
	JMP	KB2H11		/OUTPUT IT TO.

KB2H12,	TAD	(K2HBUF)	/RESET ESC SEQ BUFFER PTR.
	DCA	K2HPTR
	JMP	KB2HS1		/TIME TO EXIT.

K2HESC,	0			/1 IFF ESC SEQ IN PROGRESS. 0 OTHERWISE.

KB2HPT,	0			/PTR INTO APPROPRIATE K2HXX TABLE.

K2HPTR,	K2HBUF			/PTR INTO ESC SEQ BUFFER.
									/M015
	>			/END IFDEF CONFIG			/M042
KB2HT1,	0			/TEMP FOR KBTFL1.
KB2HT2,	0			/TEMP FOR KBTCHR.

	>			/END NDEF CONDOR			/M019

	IFDEF	CONDOR	<						/A019
	IFDEF	CONFIG	<						/A020
/THIS ROUTINE LOOKS FOR ESC SEQUENCES AND EITHER EATS THEM UP,
/TRANSLATES THEM, PASSES THEM ON, OR TAKES SOME SPECIFED ACTION.

KBTRAP,	XX			/ENTER WITH CHAR IN AC			/A024
	SNA
	TAD (200)		/SET PARITY BIT ON NULL CHAR SO THAT	/A029
				/IT WILL EVENTUALLY GET OUTPUT.		/A029
	MQL			/SAVE CHAR FOR AWHILE			/A024
KBTRAK,	RDF			/SEE WHAT FIELD WE CAME FROM		/A024
	TAD	CIDF0		/BUILD A CDIF AROUND IT			/A024
	DCA	KBTRXX		/PLACE INTO EXIT ROUTINE		/A024
	CDFEDT			/NOW WORK IN THIS FIELD		/M027	/A024
	MQA			/GET TYPED KEY BACK			/A024
	DCA I	STRPTR		/PLACE IT IN A MORE CONVENIENT LOCATION	/A024
	TAD	ESCLEN		/GET LENGTH OF PENDING STRING		/A024
	ISZ	ESCLEN		/WE'RE ADDING 1 MORE. GET READY 4 NEXT	/A024
	TAD	(DISTAB)	/GET ADDRESS OF DISPATCH TABLE		/A024
	DCA	DISPTR		/POINT TO APPROPRIATE ENTRY		/A024
	TAD I	DISPTR		/GET THE ADR OF ENTRY POINTED TO	/A024
	DCA	DISPTR		/NOW USE AS AN ADDRESS			/A024
	TAD I	STRPTR		/GET THE CHAR IN QUESTION AGAIN		/A024
	ISZ	STRPTR		/GET READY 4 NEXT TIME (IF THERE IS ONE /A024
	JMP I	DISPTR		/DISPATCH TO DESIRED ROUTINE		/A024
/
/
/	DISTAB table moved out to code at DRDFIN to make space here 
/
/
DISPTR,	DISTAB			/INITIALLY SET TO BEG OF TABLE (IN CASE)/A024

/
/	ESCDET code moved out to DRDPCN to make space here 		/M058
/
/
/
PREEND,				/PREMATURE END				/A024
NFNDEX,	CLA			/PASS ON SEQ'S NOT FOUND IN TABLE	/A024
	DCA I	STRPTR		/SET STRING STOPPER			/A024
	TAD	(ESCSTR		/GET BEGINING ADR OF STRING		/A024
	DCA	EMPPTR		/USE EMPTY ROUTINE FOR OUTPUTING	/A024
	JMP	EMPTNG		/WILL EMPTY 1 CHAR PER PASS		/A024

EMPTNG,	CLA			/NOTHING USEFUL CAME IN AC		/A024
	TAD	(5)		/KEEP LENGTH AT 5 WHILE EMPTYING	/A024
EMPTY1,	DCA	ESCLEN		/OR CLEAR IF JUST 1			/A024
	TAD	(ESCSTR		/GET BEGINING ADDDR.			/A024
	DCA	STRPTR		/KEEP STRPTR AT BEGINING WHILE EMPTYING	/A024
	TAD I	EMPPTR		/GET CHAR FROM STRING			/A024
	TAD	(-33		/LOOK FOR EXTRA ESC'S		/M026	/A024
	SNA			/SKIP IF NOT ESC			/A024
	JMP	NEWESC		/RECOGNIZE AS START OF NEW SEQ		/A024
ESCRET,	TAD	(ESC		/RESTORE CHAR				/A024
	ISZ	EMPPTR		/GET READY FOR NEXT TIME		/A024
	SNA			/SKIP IF NOT STOPPER			/A024
	JMP	NOPEX		/DONE EMPTYING. RESET AND EXIT		/A024
	IFNDEF CONDOR	<
	TAD	(-ATTN)		/IS CHARACTER TO BE RETURNED '\'?	/A040
	SNA			/SKIP IF NO.				/A040
	JMP	KBACXL		/YES. CHANGE TO ALTERNATE RETURN.	/A040
	TAD	(ATTN)		/RESTORE CHARACTER BACK.		/A040
			>		/END IFNDEF CONDOR		/A044
KBTRXX,	CIDF0			/REPLACED WITH CALLING FIELD		/A024
	JMP I	KBTRAP		/GO BACK WHERE YOU CAME FROM		/A024

/THIS ROUTINE IS USED TO SEE IF WE NEED TO EMPTY, OR GET A TTYIN	/A024
KBMTCK,	XX			/WILL EXIT FROM I KBTRAP IF EMPTYING	/A024
	CLA			/JUST IN CASE				/A024
	TAD	ESCLEN		/ARE WE IN THE MIDDLE OF EMPTYING	/A024
	TAD	(-5		/5 SAYS WE STILL NEED TO EMPTY		/A024
	SNA CLA			/SKIP TO RETURN FOR ANOTHER TTYIN	/A024
	JMP	KBTRAK		/ENTER TO EMPTY TRAP			/A024
	RDF			/SEE WHAT FIELD WE CAME FROM		/A024
	TAD	CIDF0		/BUILD A CIDF INSTR AROUND FIELD	/A024
	DCA	KBMTXX		/PLACE IN EXIT PATH			/A024
KBMTXX,	CIDF0			/WILL BE REPLACED WITH CIDF BACK	/A024
	JMP I	KBMTCK		/EXIT TO TTYIN AND KBTRAP		/A024

	>		/END CONFIG IFDEF				/A020
ESCLEN,	0			/DIRECTS DISPATCHING AND POINTING	/A024
EMPPTR,	ESCSTR			/POINTER FOR EMPTYING (OUTPUTING)	/A024
STRPTR,	ESCSTR			/INITIALLY POINTS TO BEGINING OF STRING	/A024
ESCSTR,	ZBLOCK 6		/INPUT STRING BUFFER			/A024
	>		/END CONDOR IFDEF				/A019



/CHKTRM - DETERMINES WHETHER OR NOT THE CHARACTER IN THE AC UPON
/ENTRY IS AN ESCAPE SEQUENCE TERMINATOR.
/IF IT IS A TERMINATOR THEN THE 1ST RETURN IS TAKEN.
/IF IT IS NOT A TERMINATOR THEN THE 2ND RETURN IS TAKEN.
/THE AC IS RETURNED CLEARED.

	CKTM1="=&177
	CKTM2=">&177
	CKTM3="\&177							/A008
	CKTM4="<&177							/A015
	CKTM5="~&177		/TILDA TERMINATOR			/A021
	CKTMO="O&177
	CKTBA="A&177
	CKTBZ="Z&177
	CKTLA="a&177
	CKTLZ="z&177

IFDEF	CONFIG	<

CHKTRM,	XX			/RETURN ADDRESS HERE.
	TAD	(-CKTM1)	/CHECK FOR "=".
	SZA			/SKIP IF TERMINATO.			/M015
	TAD	(-CKTM2+CKTM1)	/CHECK FOR CKTM2.
	SZA			/SKIP IF TERMINATO.			/M015
	TAD	(-CKTM3+CKTM2)	/CHECK FOR "\".				/A008
	SZA			/SKIP IF TERMINATOR.			/M015
	TAD	(-CKTM4+CKTM3)	/CHECK FOR CKTM4			/A015
	SZA			/SKIP IF NOT TERMINATOR			/A021
	TAD	(-CKTM5+CKTM4)	/TEST FOR TILDA TERMINATOR		/A021
	SNA			/SKIP IF NOT TERMINATOR.		/A015
	JMP	CTMYES		/HANDLE TERMINATOR.			/M015

	TAD	(-CKTMO+CKTM5)	/CHECK FOR "O". THAT'S NEVER A TERMINATOR.
	SNA
	JMP	CTMNO		
	TAD	(-CKTBA+CKTMO)	/CHECK FOR LESS THEN "A".
	SPA
	JMP	CTMNO		/JMP IF NOT A TERMINATOR.
	TAD	(-CKTBZ+CKTBA)	/CHECK FOR A-Z.
	SPA SNA
	JMP	CTMYES		/JMP IF TERMINATOR (A-Z).
	TAD	(-CKTLA+CKTBZ)	/CHECK FOR Z-A.
	SPA
	JMP	CTMNO		/JMP IF NOT A TERMINATOR.
	TAD	(-CKTLZ+CKTLA)	/CHECK FOR A-Z.
	SMA SZA			/SKIP IF TERMINATOR.
CTMNO,	ISZ	CHKTRM		/NON-TERMINATORS TAKE 2ND RETURN.
CTMYES,	CLA			/RETURN AC CLEARED.
	JMP I	CHKTRM		/RETURN TO CALLER.
	>			/DEF CONFIG				M042

/
/	Moved here on edit 058 for space reasons			/M058
/
/


HSTCHK,	XX			/SEE IF WE'VE BEEN YANKED BACK.
	CIFSYS			/DO JWAIT.
	JWAIT			
	MQL			/SAVE CHARACTER.			/A0012
	CDFBUF			/MAP CX FIELD.			/A0012	/C017
	TAD I	(H2TFLG)	/SEE IF WE ARE TO STILL RUN.		/A0012
H2ABRT,	CDFMYF			/MAP US AGAIN.				/A0012
	SZA CLA			/SKIP IF TIME TO EXIT.			/A0012
	JMP I	HSTCHK		/RETURN TO CALLER.			/A0012
	TAD	HS2TEX		/GET RETURN CID.			/A0012
	DCA	.+1
	XX			/MAP RETURN FIELD.			/A0012
	JMP	H2TXIT		/CANCEL HOST JOB!			/A0012




/-----------------
	PAGE

IFDEF	CONFIG	<

/HST2SC - XLATE HS ESCAPE SEQUENCES FROM HOST (VT52/VT278) TO VT278 DEPENDING
/UPON THE SETTING OF VTMODE
/(0 = VT52, 1=VT278, 2=DECWORD APPL MODE, 3=DECWORD NUMERIC MODE).

/THE ESCAPE SEQUENCES FROM THE HOST ARE STORED UNTIL THE TERMINATOR
/IS SEEN. THEN THE PROPER XLATION TABLE IS SEARCHED FOR THE HOST
/ESC SEQ. IF FOUND THE ASSOCIATED XLATION ESC SEQ IS SENT. IF NOT
/FOUND THEN THE ORIGIONAL ESC SEQ IS SENT

	TMLP="(&177		/"(" AS A TERMINATOR.			/A013

HST2SC,	XX			/ENTRY POINT.
	TAD I	(H2TCHR)	/GET CHAR.
	DCA	HS2KT2
	RDF			/GET DATA FIELD.
	TAD	CDF0
	DCA	HS2TS1
	RDF
	TAD	CIDF0
	DCA	HS2TEX

	AC0001			/TERMINAL OUTPUT?
	AND I	(H2TFLX		/TEST IF DOING TERMINAL OUTPUT		/M028
	SNA CLA			/SKIP IF YES.
	JMP	HS2TEX		/RETURN IMMEDIATELY IF NO.
	CDFMYF			/MAP TO OUR FIELD			/A028
	TAD 	HS2KT2		/Get char back				/A058
	JMS	NRCSWH		/Swap it				/A058
	DCA	HS2KT2		/And put it back			/A058
	JMS	HS2CTL		/TEST FOR A CONTROL CHARACTER		/A028
	TAD	HS2KT2		/GET CHARACTER FROM HOST.
	DCA I	H2TPTR		/SAVE IT IN INTERMEDIATE BUFFER.
	ISZ	H2TPTR		/BUMP PTR.
	DCA I	H2TPTR		/SET STOPPER.
	TAD	MESC		/CHECK FOR ESC.
	TAD	HS2KT2		/IS CHARACTER AN ESC?
	SNA CLA			/SKIP IF NO.
	JMP	HS2TES		/HANDLE ESCAPE SEQUENCE START.
	TAD	H2TESC		/ARE WE IN THE MIDDLE OF AN ESC SEQ?
	SNA CLA			/SKIP IF YES.
	JMP	HS2FBK		/JMP IF NOT IN ESC SEQ, Check for fall back/M055

/HERE IF IN MIDDLE OF ESCAPE SEQUENCE.
/GO THROUGH H2TXX TABLE FOR ESC SEQ XLATION.

HS2TS2,	TAD	VTMODE		/MAP TO TRANSLATION TABLE.
	TAD	(H2TXX)		/GET TABLE POINTER POINTER.
	DCA	H2TPT		/SAVE.
	TAD I	H2TPT		/GET TABLE PTR.
	DCA	H2TPT		/SAVE START ADDRESS OF TABLE.
HS2TS3,	TAD	(H2TBUF+1)	/GET START OF ESQ SEQ BUFFER.
	DCA	H2TPTR		/SAVE PTR.
	TAD I	H2TPT		/SEE IF ANYTHING TO COMPARE AGAINST?	/A029
	SNA CLA			/SKIP IF YES. NOT AT END OF XLAT TBL.	/A029
	JMP	HS2TS9		/WE'RE AT THE END OF THE XLAT TBL.	/A029
				/SO OUTPUT WHAT WE'VE GOT SO FAR.	/A029

HS2TS4,	TAD I	H2TPT		/GET XLATION TBL CHAR.
	SPA			/SKIP IF NOT SPECIAL.
	JMP	H2T4B		/HANDLE SPECIAL MATCH CHARACTERS.
	SNA			/SKIP IF THERE IS ONE THERE.
	JMP	HS2TS8		/JMP IF AT END OF XLATION TBL ESQ.
	CIA			/CHECK AGAINST ESC SEQ CHAR.
	TAD I	H2TPTR
	SZA			/SKIP IF CHARS MATCH.
	JMP	HS2TS5		/JMP IF ESC SEQ IS DIFFERENT.
H2T4A,	ISZ	H2TPT		/BUMP XLATION TBL PTR.
	ISZ	H2TPTR		/BUMP ESC SEQ PTR.
	JMP	HS2TS4		/SEE IF NEXT CHAR MATCHS TOO!

H2T4B,	CLA			/CURRENTLY HAD TO HAVE BEEN "-1"
				/MEANING MATCH ANY.
	TAD I	H2TPTR		/IS THERE A CHAR TO MATCH TO?
	SZA CLA			/SKIP IF NO. HANDLE NOT-DONE CONDITION.
	JMP	H2T4A		/ACCEPT THE CHAR.
	JMP	HS2TS1		/EXIT UNTIL NEXT TIME.

HS2TS5,	SMA CLA			/SKP IF ESC SEQ NOT IN TABLE.
	JMP	HS2TS6		/JMP TO TEST OUT NEXT TABLE ENTRY.
	TAD I	H2TPTR		/ARE WE AT THE END OF HOST INPUT?	/A029
	SNA CLA			/SKIP IF NO. WE MIS-MATCHED.		/A029
	JMP	HS2TS1		/WAIT 'TIL NEXT CHAR FROM HOST.		/A029
	JMP	HS2TS9		/SEND WHAT WE'VE GOT TO THE TERMINAL.	/A029

HS2TS6,	TAD I	H2TPT		
	ISZ	H2TPT		/BUMP TBL PTR WHILE IN SEQ TO MATCH.
	SZA CLA			/SKIP WHEN SEE STOPPER.
	JMP	HS2TS6		/LOOP WHILE IN ESC SEQ TO MATCH TO.
HS2TS7,	TAD I	H2TPT		
	ISZ	H2TPT		/BUMP TBL PTR WHILE IS SEQ TO OUTPUT.
	SZA CLA			/SKIP WHEN SEE STOPPER.
	JMP	HS2TS7		/LOOP WHILE IN ESC SEQ TO OUTPUT.
	JMP	HS2TS3		/TRY NEXT XLATION SEQ IN TBL.

HS2TS8,	ISZ	H2TPT		/PT TO XLATION OF ESC SEQ.
	DCA	H2TESC		/SAY NO ESC SEQ IN PROGRESS.
HS2T8A,	TAD	(-H2TBUF)	/OUTPUT FROM H2TPT POINTER!!!		/M015
	TAD	H2TPT							/M015
HS2TS9,	JMS	HS2TOU		/OUTPUT ESCAPE STRING.			/A015
	TAD	(H2TBUF)	/RESET ESC SEQ BUFFER PTR.
	DCA	H2TPTR
	JMP	HS2TS1		/DONE SO EXIT.

HS2TES,	TAD	H2TESC		/ARE WE IN THE MIDDLE OF AN ESCAPE SEQ?	/A015
	SZA CLA			/SKIP IF NO.				/A015
	JMS	HS2TOU		/OUTPUT CURRENT ESCAPE STRING.		/A015
	AC0001			/SET ESC SEQ IN PROGRESS FLAG.
	DCA	H2TESC
	TAD	(ESC)		/SET ESC SEQ INTO BUFFER
	DCA	H2TBUF		/(IN CASE ESC SEQ INTERRUPTS ESC SEQ).
	DCA	H2TBUF+1	/SET STOPPER.
	TAD	(H2TBUF+1)	/SET BUFFER POINTER.
	DCA	H2TPTR

HS2TS1,	XX			/CDF TO CALLER.
	AC7776			/RETURN TO CALLER AFTER ELIMINATING
	AND I	(H2TFLX)	/"TO TERMINAL" FROM THIS PASS.
	DCA I	(H2TFLX)
HS2TEX,	XX			/CID BACK TO CALLER FIELD.
	JMP I	HST2SC		/RETURN TO CALLER.

HS2TOU,	XX			/ROUTINE TO OUTPUT CURRENT ESCAPE STRG	/A015
	TAD	(H2TBUF)	/GET OUTPUT BUFFER PTR.
	DCA	H2TPT		/SET OUTPUT PTR...
	DCA	H2TESC		/TURN OFF "ESC SEQ IN PROGRESS" FLAG.
HS2T10,	TAD I	H2TPT		/GET CHARACTER TO OUTPUT.
	SNA			/SKIP IF SOMETHING TO OUTPUT.		/A015
	JMP I	HS2TOU		/RETURN WHEN ALL OUTPUTTED.		/A015
	JMS	HS2TTY		/OUTPUT CHAR TO TTY.
	ISZ	H2TPT		/PT TO NEXT CHAR TO OUTPUT.
	JMP	HS2T10		/OUTPUT IT TO.

	>			/DEF  CONFIG				/C017

MESC,	-ESC			/LITERAL TO FORCE NEW PAGE FOR WPCU4.	/M031
/-----------------
	PAGE

IFDEF	CONFIG	<

HS2TTY,	XX			/ROUTINE TO OUTPUT CHARACTER.
	SPA			/SKIP IF NOT CONTROL INDICATOR.
	JMP	HS2T14		/HANDLE CONTROL SEQUENCE.
	IFDEF VT125R	<		/VT125 CHANGE			/A037
	JMP	HS2REG		/SEE IF NEED TO SEND TO REGIS		/A037
			>		/END IFDEF VT125R		/A037
REGRET,									/A037
	MQL			/SAVE CHARACTER.			/A012
	JMP	HS2T12		/DONT DO WAIT UNTIL BUFFER FULL.
HS2T11,	JMS	HSTCHK		/SEE IF WE ARE STILL TO RUN.		/A0012
HS2T12,	MQA			/GET CHARACTER TO OUTPUT.		/A0012
	CIFSYS			/OUTPUT CHARACTER.
	TTYOU
	JMP	HS2T11		/DO WAIT & TRY AGAIN.
GOTOCX,
HSEXIT,	JMP I	HS2TTY		/RETURN TO CALLER.


HS2T14,	CMA			/MAP -1,-2,-3, ... TO 0,1,2, ...	/A031
	TAD	(JMP I H2TETB)	/MAKE A JMP THROUGH DISPATCH TABLE.	/A031
	DCA	.+1
	XX			/GO SERVICE CONTROL CODE.		/A031

H2TETB,	H2TDCA			/1/0 OUTPUT VT52 DIRECT CURSOR ADDRESS	/A031
	TERMID			/2/1 RESPOND TO TERMINAL ID REQUEST.	/A031
	TODWNM			/3/2 SWITCH TO DECWORD NUMERIC MODE.	/A031
	TODWAM			/4/3 SWITCH TO DECWORD APPLICATION MODE	/A031
	TOVT52			/5/4 SWITCH TO VT52/DECWORD MODE.	/A031
	TOANSI			/6/5 SWITCH TO VT100/ANSI MODE.		/A031
	KBSTTS			/7/6 RESPOND TO REQUEST FOR TERMINAL ID	/A031
	DEVATR			/10/7 REQUEST FOR SECONDARY DEVICE ATTR	/A031
	GOTOCX			/11/8 SWITCH TO CX (NO-OP).		/A031
	GOTOCX			/12/9 RESERVED FOR THE PRO.		/M032
	GOTOAX			/13/10 SWITCH TO AX.			/A031
	GOTOMH			/14/11 EXIT TO MAIN MENU & HANG UP MODEM/A031
	GOTOMM			/15/12 EXIT TO MAIN MENU.		/A031
	GOTODX			/16/13 SWITCH TO DX.			/A032
		IFDEF VT125R <						/A037
	LEAVEG			/17/14 LEAVE 125 GRAPHICS MODE		/A037
	ENTGR0			/20/15 SWITCH TO 125 GRAPHICS		/A037
	ENTGR1			/21/16 SWITCH TO 125 GRAPHICS		/A037
	ENTGR2			/22/17 SWITCH TO 125 GRAPHICS		/A037
	ENTGR3			/23/18 SWITCH TO 125 GRAPHICS		/A037
		>		/END IFDEF VT125R			/A037
IFNDEF	CONDOR	<
H2TDCA,	TAD	H2TBYL		/GET LINE #.
	TAD	(-37)		/UNBIAS FROM 52 TO 278/278.
	DCA	CVTNML		/SAVE LINE #.
	TAD	H2TBYC		/GET COLM #.
	TAD	(-37)		/UNBIAS FROM 52 TO 278/278.
	DCA	CVTNMC		/SAVE COLM #.
	CIFMNU			/USE IOA TO OUTPUT # IN DECIMAL DIGITS.
	JMS I	IOACAL		
		0		
		CVTSTR		/OUTPUT STRING.
		CVTNML		/OUTPUT LINE #.
		CVTNMC		/OUTPUT COLM #.
	JMP I	HS2TTY		/RETURN TO CALLER.

CVTNML,	0			/LINE # TO CONVERT.
CVTNMC,	0			/COLM # TO CONVERT.

TODWNM,	IAC			/NEW MODE IS 3
TODWAM,	IAC			/NEW MODE IS 2
	JMP	TOV100		/MERGE BELOW
TOANSI,	TAD	VTMODE		/BEFORE GOING INTO VT100, SAVE VT52 MODE.
	DCA	VTMOLD
TOV100,	IAC			/NEW MODE IS 1.
	JMP	SETMOD		/MERGE BELOW TO SET MODE.
TOVT52,	TAD	VTMOLD		/GET OLD VT52 MODE.
SETMOD,	DCA	VTMODE		/SET NEW MODE.
	>			/END IFNDEF CONDOR			/M042

IFDEF	CONDOR	<
H2TDCA,				/CANNOT HAPPEN ON DM-II
TODWNM,				/CANNOT HAPPEN ON DM-II
TODWAM,	HLT			/CANNOT HAPPEN ON DM-II

TOANSI,	TAD	VTMOLD		/GET PREVIOUS ANSI MODE (VT100/DMII)	/M031
	DCA	VTMODE		/SAVE AS NEW MODE			/A021
/D049	TAD	VTMODE		/WAS JUST SET TO 1 FOR VT100 2 FOR DM2	/A022
/D049	CIA			/TO 7777 FOR 100, 7776 FOR DM2		/A022
/D049	IAC			/TO 0 FOR 100, 7777 FOR DM2		/A022
/D049	SPA			/JUST EXIT FOR VT100			/A022
/D049	JMS	PRQSUB		/EXECUTE PRQ SUBROUTINE			/A021

	TAD	VTMODE		/0=52 1=100 2=DM 3=125 4=227 5=228 6=22F/A049/M055
	CIA			/0    -1    -2	 -3    -4    -5	   -6	/A049/055
	SNA			/SKIP UNLESS VT52			/A049/M055
	JMP	TOANS2		/JMP IF OLD MODE WAS VT52		/A049/M055
	IAC			/X    0     -1   -2    -3    -4	   -5	/A049/M055
/D055	AND	(1)		/X		1	0	1	/A049/M055
TOANS2,	JMS	PRQSUB		/1 = SEND ESC SEQ. FROM FUNCTION KEYS	/A049/M055
				/0 = SEND ESC/BS/LF  "     "      "	/A049/M055
	CLA								/A049
	JMP	HSEXIT		/EXIT					/A019

TOVT52,	TAD	VTMODE		/GET CURRENT MODE			/A019
	DCA	VTMOLD		/STORE FOR NEXT TIME -6			/A019
	DCA	VTMODE		/SET TO 0 FOR NON ANSI			/A019
/D049	AC7776								/A022
/D049	TAD	VTMOLD		/SEE IF JUST CHANGED FROM DM2		/A022
/D049	SMA			/DON'T SKIP TO SEND 0 WITH PRQ3		/A022
				/AC = 0 SEND ESC/BS/LF			/A049
	JMS	PRQSUB		/EXECUTE PRQ SUBROUTINE			/A021
	CLA			/RETURN ZEROED AC.			/A029
	JMP	HSEXIT		/EXIT					/A019

PRQSUB,	XX			/ENTER WITH AC = 0 OR 7777		/A021
	SNA			/					/A055
	JMP	PRESCK		/Jump to active ESC/BS etc		/A055
	TAD	(2)		/					/A055
	SNA CLA			/Not Vt125				/A055
	JMP	PRESCK							/A055
	AC0001			/Set AC to 1 to active esc seqs		/A055
PRESCK,	PRQ3			/PANEL REQUEST #3			/A021
	10			/EIGHT					/A021
	7777			/1					/A021
	JMP I	PRQSUB		/RETURN					/A021

	>			/END IFDEF CONDOR			/M042

DEVATR,	JMS	EZLNCK		/RET ONLY IF EZLINK IS ENABLED

	CDFMNU			/CK FOR DMII OR DMIII			/A049
	TAD I	(MUBUF+MNOPTN)						/A049
	CDFMYF								/A049
	AND	(MNRX8X)	/DMII BIT				/A049
	SNA CLA			/SKIP IF DMII				/A049
	IAC			/BUMP FOR DMIII				/A049
	TAD	(H2TAB1)	/PICK UP POINTER			/A049
	JMP	HSANS1							/A049

KBSTTS,	TAD	(ABTOK)		/TERMINAL STATUS OK			/A049
	JMP	HSANS2							/A049

TERMID,	TAD	VTMODE		/GET VTMODE TO SEE IF TO ANSWER BACK AS
				/VT52 OR VT278.
HSANSR,	TAD	(H2TABT)	/INDEX INTO THE ANSWER BACK TABLE (ABT).
HSANS1,	DCA	H2TPTO		/SAVE PTR.
	TAD I	H2TPTO		/GET ADDRESS OF ANSWER BACK MSG.
HSANS2,	DCA	H2TPTO		/SAVE.
	JMP	HS2T18		/START OUTPUTTING.

HS2T17,	JMS	HSTCHK		/SEE IF STILL TO OUTPUT.		/A0012
HS2T18,	CLA			/GET CHARACTER BACK.			/A0012
	TAD I	H2TPTO
	SNA			/SKIP IF GOT A CHAR TO OUTPUT.
	JMP I	HS2TTY		/RETURN TO CALLER.
	CIFSYS			/OUTPUT IT.
	HS2OU
	JMP	HS2T17		/BUFFER FULL. WAIT & TRY AGAIN.
	ISZ	H2TPTO		/GET NEXT CHAR.
	JMP	HS2T18		/TRY AGAIN.
	>			/END IFDEF CONFIG			/M042

H2TPTO,	0			/PTR TO ANSWER BACK MESSAGE.

HS2FBK,	TAD	VTMODE		/Find terminal type			/A055
	TAD	(-6)		/Fall Back ?				/A055
	SZA CLA			/					/A055
	JMP	HS2FXT		/No .. output as is			/A055
	TAD 	HS2KT2		/Get Char				/A055
	TAD	(-240)		/8 bit ?				/A055
	SPA SNA			/					/A055
	JMP	HS2FXT		/No .. output as is			/A055
	CLL RAL			/Multiply by 2				/A055
	TAD	(FLBKTB)	/Add Fall back table address		/A055
	DCA	HS2PNL		/Put in line 				/A055
	PRQ3			/read fall back from Panel		/A055
	5035			/To this field from panel 5		/A055
HS2PNL,	XX			/From Panel address			/A055
	H2TBUF			/Into output buffer			/A055
	-2			/Move two words				/A055
	7777			/terinator				/A055
	CLA			/Just in case				/A055
	DCA I	(H2TBUF+2)	/Clear last entry			/A)55
HS2FXT,	CLA
	JMP	HS2TS9		/Back to normal				/A055


/-----------------
	PAGE

IFDEF	CONFIG	<
/[[A028
/THIS SUBROUTINE CHECKS TO MAKE SURE THAT ANY CONTROL CHARACTERS ARE EXECUTED
/IMMEDIATELY (IN HOST TO SCREEN MODE) EVEN IF EMBEDDED IN AN ESCAPE SEQUENCE
HS2CTL,	XX			/ENTRY POINT
	TAD	HS2KT2		/GET CHARACTER
	TAD	(-40
	SMA CLA			/IS THE CHARACTER LESS THAN 40?
	JMP	HS2CT1		/NO, PROCESS NORMALLY
	TAD	HS2KT2		/YES
	TAD	(-33
	SZA			/IS IT AN ESCAPE?
	IAC			/OR A SUB
	SZA
	TAD	(2		/OR A CAN?
	SNA CLA
HS2CT1,	JMP I	HS2CTL		/YES, PROCESS NORMALLY
	TAD	HS2KT2		/NO, PROCESS IMMEDIATELY
	JMS	HS2TTY		/OUTPUT TO SCREEN
	JMP	HS2TS1		/EXIT BACK TO CX DISPATCHER
/A028]]

IFDEF	CONDOR	<							/A024
/INXSCN CHECKS THE 1ST CHAR OF OF EACH ENTRY TO SEE IF KB INPUT		/A024
/STRING MIGHT MATCH A TABLE ENTRY.					/A024
/SCANER CHECKS REST OF ENTRY FOR EQUAL.					/A024
/IF INPUT STRING IS SMALLER THAN AN INDIVIDUAL TABLE ENTRY IT MIGHT	/A024
/MATCH A LATER ENTRY. INPUT PUT STRINGS THAT FIND A MATCH ARE NOT PASSED/A024
/ON. INPUT STRINGS GREATER THAN AN INDIVIDUAL ENTRY WON'T FIND A MATCH	/A024
/LATER IN THE TABLE BECAUSE THE TABLE IS IN ORDER. NOT-FOUND STRINGS	/A024
/ARE PASSED ON.								/A024
/STRINGS IN TABLE ARE TERMINATED WITH A 0 STOPPER TO EAT UP STRING,	/A024
/OR WITH A NEG CODE TO SEND A XLATED SEQ OR TO TAKE A SPECIFIC ACTION	/A024

INXSCN,	TAD	(KBESCT-5)	/INIT	ADR FOR KB ESC TABLE		/A024
	DCA	IDXPTR		/SET UP ROW INDEX POINTER		/A024
INXNXT,	TAD	(5)		/POINT TO 1ST CHAR IN ENTRY		/A024
	TAD	IDXPTR		/GET OLD POINTER			/A024
	DCA	IDXPTR		/BUMP TO 1ST CHAR NEXT ENTRY		/A024
	TAD I	IDXPTR		/GET 1ST CHAR OF ENTRY			/A024
	SNA			/SKIP IF NOT STOPPER			/A024
	JMP	NFNDEX		/FOUND STOPPER TAKE NOT FOUND EXIT	/A024
	CIA			/GET READY TO COMPARE			/A024
	TAD	ESCSTR+1	/1ST CHAR IS OMMITTED FROM TABLE	/A024
	SPA			/PLUS = IF THIS ISN'T IT, IT'S NOT IN TAB/A024
	JMP	INXNXT		/MINUS = THIS ISN'T IT IT MIGHT BE LATER/A024
	SZA CLA			/SKIP IF 1ST IN CHAR = 1ST CHAR IN ENTRY/A024
	JMP	NFNDEX		/THIS ISN'T IT AND IT'S NOT LATER	/A024
/THIS IS BEGINING OF SCAN OF CHARS IN 1 ENTRY
	TAD	IDXPTR		/GET POINTER TO 1ST CHAR OF ENTRY	/A024
	DCA	SCNPTR		/SET SCAN POINTER TO BEGINING OF ENTRY	/A024
	TAD	(ESCSTR+1)	/GET ADR OF IN CHAR FOUND =		/A024
	DCA	OFFPGI		/USE AS INPUT STRING POINTER		/A024
SCANER,	ISZ	SCNPTR		/BUMP TABLE ENTRY POINTER		/A024
	ISZ	OFFPGI		/BUMP INPUT STRING POINTER		/A024
	TAD I	SCNPTR		/GET CHAR FROM TABLE ENTRY		/A024
	SNA			/SKIP IF NOT NOP STOPPER		/A024
	JMP	NOPEX		/NOP EXIT. EAT UP SEQ WITH OUT PASSING	/A024
	SPA			/SKIP IF POS 8 BIT ASCII CODE		/A024
	JMP	KBACXL		/MINUS IS ACTION FLG OR XLATE PTR	/A024
	CIA			/WAS A POS ASCII CODE COMP FOR COMPARE	/A024
	TAD I	OFFPGI		/GET CHAR FROM INPUT STRING		/A024
	SNA CLA			/SKIP IF NO MATCH			/A024
	JMP	SCANER		/= SO FAR. KEEP SCANNING		/A024
	JMP	INXNXT		/NOT = THIS ENTRY INDEX TO NEXT ENTRY	/A024


NEWESC,	TAD	EMPPTR		/SEE WHERE WE ARE POINTING		/A024
	TAD	(-ESCSTR)	/COMPARE IT TO BEGINING OF STRING ADR	/A024
	SNA CLA			/SKIP IF IT'S NOT THE FIRST ESC IN TRAP	/A024
	JMP	ESCRET		/IT'S THE 1ST, GO AHEAD AND PUT IT OUT	/A024
	AC0001			/GET A ONE TO USE AS IF 1ST ESC		/A024
	DCA	ESCLEN		/NEXT PASS WILL KNOW WE HAVE ESC ALREADY/A024
	TAD	(ESCSTR+1)	/NEXT CHAR WILL GO HERE			/A024
	JMP	NOPEX2		/DON'T PUT OUT 2ND ESC			/A024

CK2NDC,	TAD	(-33		/DON'T FORGET WERE IN 7-BIT MODE HERE	/A024
	SNA			/DON'T SKIP IF 2 ESC'S IN A ROW		/A024
	JMP	PREEND		/PREMATURE END OF ESC SEQ		/A024
	TAD	(-100		/[=ESC+100				/A024
	SNA CLA			/SKIP IF NOT [				/A024
	JMP	NOPEX1		/[ THEREFORE STILL TRAPPING		/A024
	JMP	NFNDEX		/THIS IS NOT A STRING WERE LOOKING 4	/A024

CK3RDC,	TAD	(-33		/033 IS ESCAPE CODE FOR 7-BIT		/A024
	SNA			/SKIP IF NOT ESC		/M027	/A024
	JMP	PREEND		/ESC [ ESC IS A PREMATURE ESC		/A024
	TAD	(ESC		/RESTORE IN CHAR			/A024
	JMS	CHKTRM		/RETURN .+1 IF TERMINATOR .+2 IF NOT	/A024
	JMP	NFNDEX		/WILL PUT OUT WHAT WE'VE GOT.		/A024
	JMP	NOPEX1		/NO PRINT EXIT. KEEP ON TRAPPING	/A024

CK4THC,	JMP	CK3RDC		/SAME CONDITIONS AS 3RD FOR NOW		/A024

CK5THC,	TAD	(-33		/033 IS ESCAPE CODE FOR 7-BIT		/A024
	SNA			/SKIP IF NOT ESC			/A024
	JMP	PREEND		/PREMATURE END				/A024
	TAD	(-143		/TILDE IS ESC +143			/A024
	SNA CLA			/SKIP IF NOT TILDE			/A024
	JMP	INXSCN		/START LOOKING IN TABLE			/A024
	JMP	NFNDEX		/WERN'T LOOKING 4 THIS			/A024

NOPEX,	CLA			/YOU NEVER KNOW				/A024
	DCA	ESCLEN		/GET READY FOR NEW STRING		/A024
	TAD	(ESCSTR		/GET BEGINING OF INPUT STRING BUF	/A024
NOPEX2,	DCA	STRPTR		/INIT STRING POINTER			/A024
NOPEX1,	ISZ	KBTRAP		/INC TO NO PRINT EXIT			/A024
	JMP	KBTRXX		/TAKE EXIT				/A024

KBACXL,	CLA			/CURRENTLY, PF4 IS THE ONLY ONE TRAPPED	/A033
	TAD	(KBTATN-1)	/RESET RETURN ADDRESS TO RETURN TO	/A033
	DCA	KBTRAP		/"KBTATN", (-1 BECAUSE OF ISZ).		/A033
	JMP	NOPEX		/SET TO IGNORE THIS ESQ SEQ.		/A033

SCNPTR,	KBESCT			/POINTER USED FOR SCANNING EACH ELEMENT	/A024
IDXPTR,	KBESCT-4		/POINTER FOR 1ST CHAR OF EACH ELEMENT	/A024
	>		/END IFDEF CONDOR				/A024
	>		/END IFDEF CONFIG				/M042

OFFPGI,	0			/TO STORE OFF PAGE INDIRECT REFS	/A024


/
/	This routine is used to "two step" down either side of the NRC	/A058
/	table NRCTBL to find out if a character is either		/A058
/		1.	An 8 bit char which belongs in the NRC		/A058
/		2.	A 7 bit "replaced" char				/A058
/
/	Arguments are 							/A058
/	  AC contains starting address of table				/A058
/	  NRCCHR contains negative value of char we are trying to match /A058
/									/A058
/	Routine returns to						/A058
/		Caller +1 if Matched					/A058
/		Caller +2 if Not matched 				/A058
/									/A058
/	With the ACC zero in either case				/A058




NRCSCH,	XX								/A058
	DCA	NRCPTR			/ Save Table address pointer	/A058
NRCNXT,	TAD I	NRCPTR			/ Get char from table		/A058
	SNA				/ Terminator seen ?		/A058
	JMP	NRCNOM			/ Yes , no match found		/A058
	TAD	NRCCHR			/ Now add char			/A058
	SNA CLA				/ Is it in table		/A058
	JMP	NRCFND			/ Yes 				/A058
	ISZ	NRCPTR			/ No , Bump pointer		/A058
	ISZ	NRCPTR			/ Twice				/A058
	JMP	NRCNXT			/ And try next			/A058
NRCNOM,	ISZ	NRCSCH			/ Bump return address		/A058
NRCFND,	JMP I	NRCSCH			/ And return			/A058

NRCPTR,	0				/ Pointer to NRC table		/A058





/-----------------
	PAGE								/A024

		IFDEF CONFIG	<					/A037
		IFDEF VT125R <						/A037

	DISREG=2600		/START ADDRESS OF SIXEL DISPATCH ROUTINE/A045
	CMDSET=42		/GRAPHICS CURSOR CONTROL
ENTGR3,	AC7777			/TURN ON REGIS ECHO FLAG		/A037
ENTGR1,	DCA	REGECH		/TURN OFF FLAG IF HERE 1ST		/A037
	AC7776			/BOTH 1 &3 NEED TO CAUSE RESYNC		/A037
	DCA	SNKFLG		/SO SET IT UP				/A037
	JMP	ENTERG		/NOW SEE IF IT NEEDS DONE		/A037

ENTGR2,	AC7777			/WANTS TO ECHO				/A037
ENTGR0,	DCA	REGECH		/TURN FLAG OFF OR ON			/A037
ENTERG,	TAD	GRAFON		/IF ALREADY ON (-1) DONT CHANGE		/A037
	SZA CLA			/SKIP TO TURN ON GRAPHICS		/A037
	JMP	ENEXIT		/TO PROTECT FLAGS (IF HERE TWICE)	/A037
	AC7777			/GET ALL ONES FOR GRAPHICS FLAG		/A037
	DCA	GRAFON		/INDICATE GRAPHICS IS ON IN VT125 MODE	/A037
	CDFBUF			/MAP TO FIELD 4				/A037
	TAD	H2TFLG		/GET HOST JOB FLAGS			/A037
	MQL			/SAVE FOR LATER				/A037
	AC0001			/ONLY WANT SCREEN JOB			/A037
	DCA	H2TFLG		/REPLACE ALTERED JOB FLAGS		/A037
	ACL			/RETRIEVE ORG FLAGS			/A037
	CDFMYF			/USE THIS DATA FIELD			/A037
	DCA	FLGSTR		/SAVE LOCALLY				/A037
ENEXIT,	CIF	PRMFLD		/PRIMITIVES FIELD			/A037
	TAD	(SETP2)		/GET ADDR OF ARGS FOR PRIM		/A037
	JMS	PRIM		/GO INIT PRIM				/A037
/D047	CLA			/DONT KNOW IF AC 0			/A037
	TAD	SNKFLG		/SEE IF 1 0R 3				/A037
	SNA			/DONT GO TO REGIS UNLESS SENDING -1	/A037
	JMP	HSEXIT		/USE COMMON EXIT			/A037
	CIF	RGFLD		/SET TO REGIS FIELD			/A037
	JMS	REGIS		/CALL REGIS (WITH -1 STILL IN AC)	/A037
	CLA CLL			/DONT SAVE RETURN AC			/A038
	JMP	HSEXIT		/CONTINUE NEXT HOST TO SCREEN CHAR	/A037

LEAVEG,	TAD	GRAFON		/1 IF GRAPHICS WERE ON. (0=NOT ON)	/A037
	SNA CLA			/SKIP TO RESTORE JOB FLAGS		/A037
	JMP	HSEXIT		/EXIT TO PROTECT JOB FLAGS IF NOT STORED/A037
	DCA	GRAFON		/0 MEANS GRAPHICS IS NOW OFF		/A037
	TAD	FLGSTR		/RETRIEVE STORED JOB FLAGS		/A037
	CDFBUF			/FLAGS ARE NORMALLY IN FIELD 0		/A037
	DCA	H2TFLG		/WILL TURN BACK ON JOBS AS BEFORE GRAPH /A037
	CDFMYF			/BACK TO NORMAL				/A037
	JMP	HSEXIT		/HOST TO SCREEN EXIT			/A037
SNKFLG,	0			/1 TO ENTER REGIS RESYNCING		/A037
REGECH,	0			/1 TO ECHO TEXT TO SCREEN AS WELL AS REG/A037
GRAFON,	0			/1 = GRAPHICS ON FLAG			/A037
FLGSTR,	0			/TEMP STORAGE FOR JOB FLAGS		/A037
POC,	0			/PRIMATIVES CONTROL BLOCK FOR PWR-ON-CLR/A037
INIT,	0035			/CTRL BLOCK FOR INITIALIZE		/A037
SETP,	CMDSET			/CTRL BLOCK FOR SETUP PARAMS		/C045
	1								/A037
SETP2,	CMDSET			/GRAFIX PRIM CONTROL BLOCK		/C045
SETGRC,	0003			/ARGS WILL BE PLACED HERE		/A037

HS2REG,	DCA	SAVCHR		/SAVE CHAR FOR TTY IF WE GOTO REGIS	/A037
	TAD	GRAFON		/HAVE WE ENTERED REGIS (PREVIOUSLY)	/A037
	SNA CLA			/SKIP IF STREAMING DATA TO REGIS	/A037
	JMP	NOTREG		/JUST RETURN WITH CHAR IF NOT IN REGIS	/A037
	TAD	SAVCHR		/GET CHAR BACK				/A037
	CIF	RGFLD		/REGIS IS IN ITS OWN FIELD		/A037
	JMS	REGIS		/GO TO IT				/A037
	SNA			/0 RET =CONTINUE			/A046
	JMP	HS2CNT		/CONTINUE				/A046
	DCA	REGCOD		/SAVE CODE				/A045
	TAD	SETGRC		/GET CURSOR CONTROL IN CASE CALLED FOR	/A045
	MQL			/PASS IT IN MQ				/A045
	TAD	REGCOD		/GET IT					/A045
	CIF	PRGFLD							/A045
	JMS I	DISCOD		/DISPATCH CODE				/A045
HS2CNT,	TAD	REGECH		/1 TO SEND TO TTY ALSO			/A037
	SNA CLA			/0 MEANS DONT ECHO TO SCREEN		/A037
	JMP	HSEXIT		/NORMAL TTY OUT EXIT			/A037
NOTREG,	TAD	SAVCHR		/GET CHAR BACK				/A037
	JMP	REGRET		/RETURN TO IN LINE TESTS		/A037
/LOAD GRAPHICS AND CONTROL PANEL MEMORY					/A037
GRLOAD,	XX								/A037
	RDF			/IN CASE WE DONT COME FROM FIELD 4	/A037
	TAD	CIDF0		/BUILD A RETURN INST			/A037
	DCA	GRLOXX		/PUT CIDF AT EXIT			/A037
	CDFMYF			/OLAY NEEDS TO GET ARG FROM RIGHT FIELD /A037
	AC7775			/VT125 = 3				/C047
	TAD	VTMODE		/VTMODE HAS JUST BEEN LOADED		/A037
	SZA CLA			/SKIP IF VT125 TO LOAD GRAPHIX MODULES	/A037
	JMP	GRLOXX		/RETURN TO CALLER (XBS STUFF)		/A037
	CIF	PRMFLD		/PRIM IS IN FLD 6			/A037
	TAD	(POC)		/ADDR OF PWR-ON-CLR INIT BLOCK		/A037
	JMS	PRIM		/GO TO PRIM				/A037

	CIF	PRMFLD		/SOME MORE INIT				/A037
	TAD	(INIT)		/ADR OF INIT BLOCK			/A037
	JMS	PRIM		/AGAIN					/A037
	CIF	PRMFLD		/PASS SOME MORE PARAMS TO PRIM		/A037
	TAD	(SETP)		/THIS IS THE ADDR OF WHERE THEY START	/A037
	JMS	PRIM		/ONE MORE TIME				/A037

	AC7777			/ARG IN AC TO INIT REGIS		/A037
	CIF	RGFLD		/SET EXECUTE IN REGIS			/A037
	JMS	REGIS		/INIT REGIS				/A037
	CLA			/DONT WANT THE RETURN ARG		/A037
GRLOXX,	CIDF0			/WILL BE LOADED AT RUN TIME		/A037
	JMP I	GRLOAD		/GO BACK WHERE WE CAME FROM IN CX	/A037


/WE MUST RELOAD THE CRITICAL VALUES ON PAGE ZERO BEFORE WE LEAVE	/A044
/....MOVES LOCS 20-76 FIELD 0 TO PRINT FIELD				/A044

SAVCHR,		/LAST CHAR SENT TO REGIS*(DBLE UP LOC SPACE WARS=SETPG0)*/C047
SETPG0,	0			/RESET PAGE 0 LOCS 20-76		/A044
	RDF			/IN CASE WE DONT COME FROM FIELD 4	/A044
	TAD	CIDF0		/BUILD A RETURN INST			/A044
	DCA	SETOXX		/PUT CIDF AT EXIT			/A044
	CDFMYF			/OLAY NEEDS TO GET ARG FROM RIGHT FIELD /A044
	TAD	(20-T1)		/INITIALIZE 10020-10076			/A044
	DCA	T1		/UP TO BUT NOT INCLUDING T1!		/A044
	TAD	(20-1		/ELSE THIS LITTLE SECTION BLOWS AWAY!	/A044
	DCA	X0							/A044
	TAD	(20-1							/A044
	DCA	X1							/A044
WAKEU1,	CDFSYS								/A044
	TAD I	X0							/A044
	CDFPRT								/A044
	DCA I	X1							/A044
	ISZ	T1							/A044
	JMP	WAKEU1							/A044
	TAD	(CIFPRT							/A047
	CDFMNU			/WP2CMF FIELD				/A047
	DCA I	SETFLA		/RESET TO CALL FLABUZ			/A047
SETOXX,	CDFMYF								/A044
	JMP I	SETPG0		/RET					/A044

SETFLA,	TIMDS3			/RESTORE LOC				/A047

REGCOD,	0			/POINTER TO TABLE IN REGIS		/A045
DISCOD,	DISREG			/REGIS DISPATCH ROUTINE			/A045
		>		/END IFDEF VT125R			/A037
		>		/END IFDEF CONFIG			/A037

/--------------
	PAGE

/TECHNICAL CHARACTER TRANSLATION TABLE
/THIS TABLE HAS THE FIRST ENTRY OF A PAIR THAT IS THE KEYBOARD CHARACTER.
/THE SUCCEDING ENTRY IS THE ACTUAL CHARACTER THAT IS TO BE OUTPUT. THE FIRST
/OCTAL CHARACTER OF THE FIRST WORD OF THE PAIR IS THE FONT SELECTOR.

TCHTRN,
	IFDEF ENGLSH <

	1133;	0054			/1,  Left Square Bracket
	1135;	0056			/1.  Right Square Bracket

/Entry 2

	2047;	0113			/2K  Section
	2060;	0157			/2o  Degree
	2061;	0045			/2%  Plus minus
	2065;	0155			/2m  Small mu
	2066;	0110			/2H  Paragraph
	2067;	0042			/2"  Middle Dot

/Entry 3

	3041;	0061			/31  left radical
	3042;	0041			/3!  Top left radical
	3043;	0070 			/38 horizontal connector
	3044;	0046			/3&  Top Integral
	3045;	0067 			/37 bottom intergral
	3046;	0052			/3*  Vertical Connector
	3047;	0137 			/3_ top left square bracket
	3050;	0055			/3-  bottom left square bracket
	3051;	0053			/3+  Top Right Square Bracket
	3052;	0075 			/3= bottom right square bracket
	3053;	0050			/3(  Top Left Parenthesis
	3054;	0071 			/39 bottom left paren
	3055;	0051			/3)  Top Right Parenthesis
	3056;	0060			/30  bottom right paren
	3057;	0063 			/33 left middle brace
	3060;	0064 			/34 right middle brace
	3061;	0136 			/3^ top left summation
	3062;	0066 			/36 bottom left summation
	3063;	0176 			/3~ top vertical summation connector
	3064;	0140 			/3@ bottom vertical summation connector
	3065;	0043			/3#  Top Right Summation
	3066;	0044			/3$  Bottom Right Summation
	3067;	0065 			/35 right middle summation
	3074;	0074 			/3less than  -  less than or equal
	3075;	0134 			/3\ not equal
	3076;	0076 			/3 greater than  -  greater than or equal
	3077;	0174 			/3| integral


	3100;	0100 			/3@ therefore
	3101;	0126 			/3V variation, proportional to
	3102;	0102 			/3B inifinity
	3103;	0047			/3'  Divided By
	3104;	0127 			/3W capital delta
	3105;	0101 			/3A nabla, del
	3106;	0104 			/3D capital phi
	3107;	0121 			/3Q capital gamma
	3110;	0116 			/3N is approximate to
	3111;	0132 			/3Z similar or equal to
	3112;	0122 			/3R capital theta
	3113;	0166 			/3v times, cross product
	3114;	0107 			/3G capital lambda
	3115;	0175 			/3} if and only if
	3116;	0135 			/3] implies
	3117;	0130 			/3X identical to
	3120;	0173 			/3{ capital pi
	3121;	0103 			/3C capital psi
	3123;	0123 			/3S capital sigma
	3126;	0062 			/32 radical
	3127;	0114 			/3L capital omega
	3130;	0125 			/3U capital xi
	3131;	0131 			/3Y capital upsilon
	3132;	0077 			/3? is included in
	3133;	0057			/3/
	3134;	0112 			/3J intersection
	3135;	0152 			/3j union
	3136;	0072 			/3: logical and
	3137;	0073 			/3; logical or
	3140;	0106 			/3F logical not
	3141;	0141 			/3a small alpha
	3142;	0142 			/3b small beta
	3143;	0170 			/3x small chi
	3144;	0167 			/3w small delta
	3145;	0145 			/3e small epsilon
	3146;	0144 			/3d small phi
	3147;	0161 			/3q small gamma
	3150;	0150 			/3h small eta
	3151;	0151 			/3i small iota
	3152;	0162 			/3r small theta
	3153;	0153			/3k small kapa
	3154;	0147 			/3g small lambda
	3156;	0156 			/3n small nu
	3157;	0115 			/3M partial derivative
	3160;	0133 			/3[ small pi
	3161;	0143 			/3c small psi
	3162;	0160 			/3p small rho
	3163;	0163 			/3s small sigma
	3164;	0164 			/3t small tau
	3166;	0146 			/3f function
	3167;	0154 			/3l small omega
	3170;	0165 			/3u small xi
	3173;	0105 			/3E left arrow
	3171;	0171 			/3y small upsilon
	3172;	0172 			/3z small zeta
	3174;	0111 			/3I upward arrow
	3175;	0124 			/3T right arrow
	3176;	0117 			/3O downward arrow
	>

	IFDEF V30NOR <

	1133;	0054			/1,  Left Square Bracket
	1135;	0056			/1.  Right Square Bracket

/Entry 2

	2047;	0113			/2K  Section
	2060;	0157			/2o  Degree
	2061;	0045			/2%  Plus minus
	2065;	0155			/2m  Small mu
	2066;	0110			/2H  Paragraph
	2067;	0042			/2"  Middle Dot

/Entry 3

	3041;	0061			/31  left radical
	3042;	0041			/3!  Top left radical
	3043;	0070 			/38 horizontal connector
	3044;	0046			/3&  Top Integral
	3045;	0067 			/37 bottom intergral
	3046;	0052			/3*  Vertical Connector
	3047;	0137 			/3_ top left square bracket
	3050;	0055			/3-  bottom left square bracket
	3051;	0053			/3+  Top Right Square Bracket
	3052;	0075 			/3= bottom right square bracket
	3053;	0050			/3(  Top Left Parenthesis
	3054;	0071 			/39 bottom left paren
	3055;	0051			/3)  Top Right Parenthesis
	3056;	0060			/30  bottom right paren
	3057;	0063 			/33 left middle brace
	3060;	0064 			/34 right middle brace
	3061;	0136 			/3^ top left summation
	3062;	0066 			/36 bottom left summation
	3063;	0176 			/3~ top vertical summation connector
	3064;	0140 			/3@ bottom vertical summation connector
	3065;	0043			/3#  Top Right Summation
	3066;	0044			/3$  Bottom Right Summation
	3067;	0065 			/35 right middle summation
	3074;	0074 			/3less than  -  less than or equal
	3075;	0134 			/3\ not equal
	3076;	0076 			/3 greater than  -  greater than or equal
	3077;	0174 			/3| integral


	3100;	0100 			/3@ therefore
	3101;	0126 			/3V variation, proportional to
	3102;	0102 			/3B inifinity
	3103;	0047			/3'  Divided By
	3104;	0127 			/3W capital delta
	3105;	0101 			/3A nabla, del
	3106;	0104 			/3D capital phi
	3107;	0121 			/3Q capital gamma
	3110;	0116 			/3N is approximate to
	3111;	0132 			/3Z similar or equal to
	3112;	0122 			/3R capital theta
	3113;	0166 			/3v times, cross product
	3114;	0107 			/3G capital lambda
	3115;	0175 			/3} if and only if
	3116;	0135 			/3] implies
	3117;	0130 			/3X identical to
	3120;	0173 			/3{ capital pi
	3121;	0103 			/3C capital psi
	3123;	0123 			/3S capital sigma
	3126;	0062 			/32 radical
	3127;	0114 			/3L capital omega
	3130;	0125 			/3U capital xi
	3131;	0131 			/3Y capital upsilon
	3132;	0077 			/3? is included in
	3133;	0057			/3/
	3134;	0112 			/3J intersection
	3135;	0152 			/3j union
	3136;	0072 			/3: logical and
	3137;	0073 			/3; logical or
	3140;	0106 			/3F logical not
	3141;	0141 			/3a small alpha
	3142;	0142 			/3b small beta
	3143;	0170 			/3x small chi
	3144;	0167 			/3w small delta
	3145;	0145 			/3e small epsilon
	3146;	0144 			/3d small phi
	3147;	0161 			/3q small gamma
	3150;	0150 			/3h small eta
	3151;	0151 			/3i small iota
	3152;	0162 			/3r small theta
	3153;	0153			/3k small kapa
	3154;	0147 			/3g small lambda
	3156;	0156 			/3n small nu
	3157;	0115 			/3M partial derivative
	3160;	0133 			/3[ small pi
	3161;	0143 			/3c small psi
	3162;	0160 			/3p small rho
	3163;	0163 			/3s small sigma
	3164;	0164 			/3t small tau
	3166;	0146 			/3f function
	3167;	0154 			/3l small omega
	3170;	0165 			/3u small xi
	3173;	0105 			/3E left arrow
	3171;	0171 			/3y small upsilon
	3172;	0172 			/3z small zeta
	3174;	0111 			/3I upward arrow
	3175;	0124 			/3T right arrow
	3176;	0117 			/3O downward arrow
	>
	
	IFDEF V30SWE <

	1133;	0054			/1,  Left Square Bracket
	1135;	0056			/1.  Right Square Bracket

/Entry 2

	2047;	0113			/2K  Section
	2060;	0157			/2o  Degree
	2061;	0045			/2%  Plus minus
	2065;	0155			/2m  Small mu
	2066;	0110			/2H  Paragraph
	2067;	0042			/2"  Middle Dot

/Entry 3

	3041;	0061			/31  left radical
	3042;	0041			/3!  Top left radical
	3043;	0070 			/38 horizontal connector
	3044;	0046			/3&  Top Integral
	3045;	0067 			/37 bottom intergral
	3046;	0052			/3*  Vertical Connector
	3047;	0137 			/3_ top left square bracket
	3050;	0055			/3-  bottom left square bracket
	3051;	0053			/3+  Top Right Square Bracket
	3052;	0075 			/3= bottom right square bracket
	3053;	0050			/3(  Top Left Parenthesis
	3054;	0071 			/39 bottom left paren
	3055;	0051			/3)  Top Right Parenthesis
	3056;	0060			/30  bottom right paren
	3057;	0063 			/33 left middle brace
	3060;	0064 			/34 right middle brace
	3061;	0136 			/3^ top left summation
	3062;	0066 			/36 bottom left summation
	3063;	0176 			/3~ top vertical summation connector
	3064;	0140 			/3@ bottom vertical summation connector
	3065;	0043			/3#  Top Right Summation
	3066;	0044			/3$  Bottom Right Summation
	3067;	0065 			/35 right middle summation
	3074;	0074 			/3less than  -  less than or equal
	3075;	0134 			/3\ not equal
	3076;	0076 			/3 greater than  -  greater than or equal
	3077;	0174 			/3| integral


	3100;	0100 			/3@ therefore
	3101;	0126 			/3V variation, proportional to
	3102;	0102 			/3B inifinity
	3103;	0047			/3'  Divided By
	3104;	0127 			/3W capital delta
	3105;	0101 			/3A nabla, del
	3106;	0104 			/3D capital phi
	3107;	0121 			/3Q capital gamma
	3110;	0116 			/3N is approximate to
	3111;	0132 			/3Z similar or equal to
	3112;	0122 			/3R capital theta
	3113;	0166 			/3v times, cross product
	3114;	0107 			/3G capital lambda
	3115;	0175 			/3} if and only if
	3116;	0135 			/3] implies
	3117;	0130 			/3X identical to
	3120;	0173 			/3{ capital pi
	3121;	0103 			/3C capital psi
	3123;	0123 			/3S capital sigma
	3126;	0062 			/32 radical
	3127;	0114 			/3L capital omega
	3130;	0125 			/3U capital xi
	3131;	0131 			/3Y capital upsilon
	3132;	0077 			/3? is included in
	3133;	0057			/3/
	3134;	0112 			/3J intersection
	3135;	0152 			/3j union
	3136;	0072 			/3: logical and
	3137;	0073 			/3; logical or
	3140;	0106 			/3F logical not
	3141;	0141 			/3a small alpha
	3142;	0142 			/3b small beta
	3143;	0170 			/3x small chi
	3144;	0167 			/3w small delta
	3145;	0145 			/3e small epsilon
	3146;	0144 			/3d small phi
	3147;	0161 			/3q small gamma
	3150;	0150 			/3h small eta
	3151;	0151 			/3i small iota
	3152;	0162 			/3r small theta
	3153;	0153			/3k small kapa
	3154;	0147 			/3g small lambda
	3156;	0156 			/3n small nu
	3157;	0115 			/3M partial derivative
	3160;	0133 			/3[ small pi
	3161;	0143 			/3c small psi
	3162;	0160 			/3p small rho
	3163;	0163 			/3s small sigma
	3164;	0164 			/3t small tau
	3166;	0146 			/3f function
	3167;	0154 			/3l small omega
	3170;	0165 			/3u small xi
	3173;	0105 			/3E left arrow
	3171;	0171 			/3y small upsilon
	3172;	0172 			/3z small zeta
	3174;	0111 			/3I upward arrow
	3175;	0124 			/3T right arrow
	3176;	0117 			/3O downward arrow
	>

	IFDEF ITALIAN <

	1133;	0073			/1;  Left Square Bracket
	1135;	0072			/1:  Right Square Bracket

/Entry 2

	2047;	0113			/2K  Section
	2060;	0157			/2o  Degree
	2061;	0065			/25  Plus minus
	2065;	0054			/2,  Small mu
	2066;	0110			/2H  Paragraph
	2067;	0045			/2%  Middle Dot

/Entry 3

	3041;	0243			/3lira  left radical
	3042;	0041			/31  Top left radical
	3043;	0136 			/3^ horizontal connector
	3044;	0067			/37  Top Integral
	3045;	0350 			/3e-grave bottom intergral
	3046;	0070			/38  Vertical Connector
	3047;	0260 			/3degree top left square bracket
	3050;	0051			/3)  bottom left square bracket
	3051;	0053			/3+  Top Right Square Bracket
	3052;	0055 			/3- bottom right square bracket
	3053;	0071			/39  Top Left Parenthesis
	3054;	0347 			/3c-cedilla bottom left paren
	3055;	0060			/30  Top Right Parenthesis
	3056;	0340			/3a-grave  bottom right paren
	3057;	0042 			/3" left middle brace
	3060;	0047 			/3' right middle brace
	3061;	0066 			/36 top left summation
	3062;	0137 			/3_ bottom left summation
	3063;	0176 			/3~ top vertical summation connector
	3064;	0140 			/3` bottom vertical summation connector
	3065;	0063			/33  Top Right Summation
	3066;	0064			/34  Bottom Right Summation
	3067;	0050 			/3( right middle summation
	3074;	0074 			/3less than  -  less than or equal
	3075;	0052 			/3* not equal
	3076;	0076 			/3 greater than  -  greater than or equal
	3077;	0247 			/3section symbol  integral


	3100;	0062 			/32 therefore
	3101;	0126 			/3V variation, proportional to
	3102;	0102 			/3B inifinity
	3103;	0371			/3u-grave  Divided By
	3104;	0132 			/3Z capital delta
	3105;	0101 			/3A nabla, del
	3106;	0104 			/3D capital phi
	3107;	0121 			/3Q capital gamma
	3110;	0116 			/3N is approximate to
	3111;	0127 			/3W similar or equal to
	3112;	0122 			/3R capital theta
	3113;	0166 			/3v times, cross product
	3114;	0107 			/3G capital lambda
	3115;	0046 			/3& if and only if
	3116;	0044 			/3$ implies
	3117;	0130 			/3X identical to
	3120;	0075 			/3= capital pi
	3121;	0103 			/3C capital psi
	3123;	0123 			/3S capital sigma
	3126;	0351 			/3e-accute radical
	3127;	0114 			/3L capital omega
	3130;	0125 			/3U capital xi
	3131;	0131 			/3Y capital upsilon
	3132;	0041 			/3! is included in
	3133;	0362			/3o-grave
	3134;	0112 			/3J intersection
	3135;	0152 			/3j union
	3136;	0115 			/3M logical and
	3137;	0155 			/3m logical or
	3140;	0106 			/3F logical not
	3141;	0141 			/3a small alpha
	3142;	0142 			/3b small beta
	3143;	0170 			/3x small chi
	3144;	0172 			/3z small delta
	3145;	0145 			/3e small epsilon
	3146;	0144 			/3d small phi
	3147;	0161 			/3q small gamma
	3150;	0150 			/3h small eta
	3151;	0151 			/3i small iota
	3152;	0162 			/3r small theta
	3153;	0153			/3k small kapa
	3154;	0147 			/3g small lambda
	3156;	0156 			/3n small nu
	3157;	0077 			/3? partial derivative
	3160;	0354 			/3i-grave small pi
	3161;	0143 			/3c small psi
	3162;	0160 			/3p small rho
	3163;	0163 			/3s small sigma
	3164;	0164 			/3t small tau
	3166;	0146 			/3f function
	3167;	0154 			/3l small omega
	3170;	0165 			/3u small xi
	3173;	0105 			/3E left arrow
	3171;	0171 			/3y small upsilon
	3172;	0167 			/3w small zeta
	3174;	0111 			/3I upward arrow
	3175;	0124 			/3T right arrow
	3176;	0117 			/3O downward arrow
	>

TCHEND,	0			/STOPPER

/THIS ROUTINE SEARCHES THE ABOVE TABLE AND FINDS THE ASCII KEY THAT CORRESPONDS
/TO THE CODE THAT THE EDITOR PUT IN FOR THAT KEY STROKE COMBINATION. IT PUTS THE
/ASCII CODE IN T1 AND EXITS.

TRANS,	XX
	TAD	(TCHTRN)	/ADDRESS OF BEGINNING OF TABLE
	DCA	TCHPTR
TRANS3,	TAD I	TCHPTR		/CHARACTER WITH PRECEDENCE IN UPPER 3 BITS
	SNA			/STOPPER FOR END OF TABLE WHICH SHOULDN'T
	JMP	TRANS4		/OCCUR.
	CMA IAC			/MAKE TWO'S COMP
	TAD	SAVTCH		/THIS IS THE ONE COLLECTED FROM DOCUMENT
	SZA CLA
	JMP	TRANS2		/NOPE, TRY NEXT ONE
	ISZ	TCHPTR		/YES GET THE KEYPAD CODE.
	TAD I	TCHPTR
	DCA	T1		/PUT IT AWAY
TRANS1,	JMP I	TRANS

TRANS2,	ISZ	TCHPTR
	ISZ	TCHPTR
	JMP	TRANS3
TRANS4,
	TAD	(SPC)		/put out a space for any line drawing 	/A056
	DCA	T1		/drawing chars in 7 bit out	      	/A056
	JMP I	TRANS							/A056


TCHPTR,	0


/
/	Make char 8 bit if its from "font" 2 and we are in 8 bit comms	/A056
/
DSTCHR,	
	TAD	DSKMNC		/Was it a Multi-Nat character		/A056
	SNA CLA			/					/A056
	JMP	DSKLDSI		/Check if line drawing			/A056
	TAD	TM8BIT		/Are we in 8 bit ?			/A056
	SZA CLA			/No , dont add the 200			/A056
	TAD	(200)		/Make it back to 8 bit			/A056
	TAD	T1		/Get char back				/A056
	DCA	T1		/Save it back				/A056
	DCA	DSKMNC		/Clear Multi-National char flag		/A056
	DCA	SAVTCH		/Clear Tech char found flag		/A056
	TAD	VTMODE		/Check terminal type 			/A056
	TAD 	(-6)		/Is it 7 bit fall back	?		/A056
	SZA CLA			/			 		/A056
	JMP	DSKG31		/No output char as normal		/A056
	TAD	T1		/Get char back				/A056
	TAD	(-240)		/Ignore values below space		/A056
	CLL RAL			/Multiply by 2				/A056
	TAD	(FLBKTB)	/Add address offset 			/A056
	DCA	FLPNADR		/Put in line to read panel table	/A056
	PRQ3			/Panel request				/A056
	5035			/Load from panel 5 to User 3		/A056
FLPNADR,0			/Address in Panel			/A056
	FBKBUF			/Into Fallback buffer			/A056
	-2			/Two words				/A056
	7777			/Terminator				/A056
	JMP	DSKGFB		/Output Fallback buffer			/A056



/
/	Output line drawing character as SO -char SI
/

DSKLDSI,
	TAD	DSKLDC		/Is it really Line drawing in 8 bit	/A056
	SNA CLA			/					/A056
	JMP	DSTRNS		/No , must be tech in 8 , translate it	/A056
	DCA	DSKLDC		/Clear Line drawing flag		/A056
	TAD	T1		/Get char				/A056
	DCA	SLDCHR		/Put into Line drawing output buff	/A056
	DCA	SAVTCH		/Switch off start of Tech flag		/A056
	JMP	DSKGLD		/Ouput Line drawing Buffer		/A056


/---------------------
	PAGE

/DSKGCH - GET A CHARACTER FROM THE DOCUMENT OPEN.
/IT WILL INTERPRET THE PRINTER CONTROLS AND TRANSLATE ANY CHARACTERS THAT
/HAVE TO BE.

/CALL:	JMS	DSKGCH
/WAIT RETURN
/END OF DOCUMENT
/NORMAL RETURN WITH THE AC CONTAINS NEXT CHARACTER

DSKGCH,	XX
IFDEF CONFIG < / Assemble only w/ WPCX, so that unresolved symbols don't bug us.
DSKGJ7,	CLA
	TAD 	WATFLG		/CHECK WAIT FLAG
	SMA CLA
	JMP	DSKG7A		/SEE IF SHOULD REALLY WAIT. RETURN TO DSKG7B
				/IF NOT WAIT.				/M017
DSKG7B,	CDFBUF			/CHANGE TO FIELD 4
	TAD I	(RSNFLG)	/SEE IF H2TJOB IS SENDING AND IF SO WAIT
	CDFMYF
	SZA CLA
	JMP	DSKXIT		/RETURN CALL TO DSKGCH+1 (WAIT)
	TAD	DSKSTF		/SEE IF THE INPUT IS COMING FROM A BUFFER
	SZA CLA
	JMP	DSKGJ1		/1= YES

	AC0001			/IF DSKSOD IS -1 THEN TIME TO EXECUTE THE BUFFER
	TAD	DSKSOD		/CHECK FOR STX BEFORE SENDING ANYTHING AND AFTER
				/THE FIRST CHARACTER HAS BEEN FOUND.
	SNA
	JMP	DSKGJ6		/GO EXECUTE BUFFER
	SPA CLA
	JMP	DSKG10		/UNTIL IT IS SET TO 1 BY SENDING STX THEN SKIP
				/AND FLAGS THAT WOULD SEND A BUFFER

	TAD	DSKSOL		/CHECK FOR START OF LINE PROCESSING
	SNA CLA
	JMP	DSKG25		/OPEN (INITIALIZE) SEND BUFFER
	DCA	DSKSOL		/CLEAR FOR THE NEXT TIME CHECKED
	JMP	DSKG20		/START OF LINE

DSKG7A,	CDFBUF
	TAD I	(DKTFLG)	/GET DOC TRANSFER FLAG.			/A017
	AND	(H2T)		/IS DOC GOING TO HOST?			/A017
	CDFMYF
	SZA CLA			/SKIP IF NO. DON'T WAIT!!!!!		/A017
DSKG21,	JMP	DSKXIT		/DOC IS GOING TO HOST SO WAIT FOR WAIT!	/A017
	JMP	DSKG7B		/DOC NOT TO HOST. DONT WAIT.		/A017

DSKXIT,	CDIBUF			/ONLY CALLED FROM FIELD 4
	JMP I	DSKGCH		/RETURN TO SAME

DSKG25,	TAD	SNDFLG		/SEE IF THE SEND IMMEDIATELY FLAG IS SET
	SNA CLA
	JMP	DSKG10
	DCA	SNDFLG		/CLEAR THE FLAG FOR NEXT TIME THROUGH

	TAD	(SNDBOF-EOLBOF) /OPEN INITALIZE (OPEN) THE SEND BUFFER
DSKG11,	TAD	(EOLBOF-SODBOF) /END OF LINE STRING
DSKG14,	TAD	(SODBOF-SOLBOF) /START OF TEXT
DSKG20,	TAD	(SOLBOF-EODBOF) /START OF LINE
DSKG13,	TAD	(EODBOF-EOPBOF) /END OF TEXT
DSKGJ3,	TAD	(EOPBOF-PARAOF) /END OF PAGE
DSKG27,	TAD	(PARAOF-TABBOF) /END OF PARAGRAPH
DSKG30,	TAD	(TABBOF-TECBOF)	/VALUE OF A TAB				/M051
DSKG32,	TAD	(TECBOF-SLDBOF)	/TECH CHAR INTRODUCER STRING		/A051
DSKGLD,	TAD	(SLDBOF-FBKBOF)	/Line drawing string			/A056
DSKGFB,	TAD	(FBKBOF)	/Fall back buffer			/A056

	JMS	DBFINI

	AC0001
	DCA	DSKSTF		/SET FLAG GET FROM BUFFER
	JMP	DSKGJ7		/GO TO BEGINNING OF ROUTINE

DSKG19,	AC0001
	DCA	DSKSOL		/SET THE END OF LINE FLAG
	JMP	DSKG11

DSKG15,	CLA			/INIT AC (JUST IN CASE).		/A0015
	DCA	DSKSOD		/CLEAR FLAG TO SAY NOTHING MORE TO SEND
	JMP	DSKG13

DSKG10,	TAD	DSKSOD		/THEN SEND THE SOD STRING
	SNA CLA
	JMP	DSKG16		/END OF DOCUMENT, EXIT DSKGCH+2
	TAD	DSKBAK		/STORES THE FIRST CHARACTER THAT IS PRINTABLE
				/IN A DOCUMENT.  WE HAVE TO SEARCH UNTIL ONE IS
				/FOUND BEFORE STX IS SENT TO MAKE SURE IT IS
				/DEFINED BEFORE SENDING.
	SNA
	JMP	DSKG23		/NO CHAR, GO READ DISK
	DCA	T1		/DISK IS ALREADY READ
	DCA	DSKBAK		/CLEAR FLAG FOR NEXT TIME
	JMP	DSKG22
> /END IFDEF CONFIG

/
/	Test whether we need to send a Tech char intro 			/A056
/
DSISND,	TAD	SAVTCH		/Get "font" back			/A056
	AND	(7)		/Strip of 60 				/A056
	TAD	(-3)		/Tech char ?				/A056
	SNA CLA			/					/A056
	JMP	DSKG32		/Yes, put out intro anyway		/A056
	AC7777			/Set AC to -1				/A056
	TAD	SAVTCH		/Is this from line drawing set ?	/A056
	AND	(7)		/Strip of 60				/A056
	SNA			/					/A056
	JMP	DSISLN		/Yes , set flag then go get next	/A056
	DCA	DSKMNC		/Multi Nat char , set flag		/A056
	JMP	DSKGJ7		/Go get next				/A056
DSISLN,	AC0001			/Ac to 1				/A056
	DCA	DSKLDC		/Set Line drawing character		/A056
	JMP	DSKGJ7		/And go get next			/A056

DSKMNC,	0			/Multi Nat char flag			/A056
DSKLDC,	0			/Line drawing char flag			/A056



/
/	This subroutine detects if we found a 7 bit replaced char 	/A058
/	for Host out and replaced it with an 8 bit .For output to the	/A058
/	screen we have to put it bac to 7 bit so that escape sequences	/A058
/	are handled correctly eg. ESC [ 1;3H etc !			/A058
/
/


NRCSWH,	XX			
	DCA	NRCHSV		/ Save char				/A058
	TAD	NRCREP		/ Yes , did we already calc a rep value?/A058
	SNA CLA			/					/A058
	JMP	NRCHNO		/ No , forget it 			/A058
	TAD 	NRCCSV		/ Yes , replace it with ACTUAL input	/A058
	SKP			/					/A058
NRCHNO,	TAD 	NRCHSV		/ Get original char back		/A058
	JMP I	NRCSWH		/ And Bi Bi				/A058

NRCHSV,	0			/					/A058


/------------
	PAGE

DSKG23,	CIFFIO			/READ DISK				/M0004
IFDEF CONFIG < / Only assemble w/ WPCX, Save space for WPCU4.
	FILEIO								/M0004
	XRDFNC
	SPA			/SKIP IF NO ERROR.			/A0015
	JMP	DSKG15		/TREAT "READ ERROR" LIKE E-O-F.		/A0015
	DCA	T1

DSKG22,	TAD	T1		/HERE IF CHARACTER IN T1
	TAD	(-ECJSPC)	/SEE IF SOFT SPACE.			/A037
	SNA			/SKIP IF NO.				/A037
	JMP	DSKG17		/SKIP IF YES. SEE IF WE SHOULD IGNORE.	/A037
DSKG26,	TAD	(ECJSPC-NPAGE)	/SEE IF IT IS A NEW PAGE	/M041	/M037
	SZA			/SKIP IF YES.				/M043
	TAD	(NPAGE-GPAGE)	/CHECK FOR GOLD PAGE
	SNA
	JMP	DSKGJ3
	TAD	(GPAGE-PARAGH)	/CHECK FOR PARAGRAPH MARKER 1012
	SNA
	JMP	DSKG27
	TAD	(PARAGH-SOPC)	/CHECK FOR START OF PRINTER CONTROL
	SNA
	JMP	DSKG12		/START OF PRINTER CONTROL
	TAD	(SOPC)		/FIX AC CONTENTS
	AND	P177		/ALL OTHER CHECKS SHOULD BE DONE WITHOUT MODES
	DCA	T1
	TAD	T1
	SNA
	JMP	DSKG15		/END OF DOCUMENT, NOW SEND THE EOT STRING

	TAD	(-ERULER)	/IS IT END OF RULER?
	SNA CLA
	JMP	DSKGJ9		/0= YES, END OF RULER

	TAD	DSKRLF		/SEE IF IN THE MIDDLE OF A RULER IF SO THROW OUT
	SZA CLA
	JMP	DSKGJ7		/ALL CHARACTERS THAT ARE PART OF IT.

	TAD	T1
	TAD	(-SRULER)	/IS IT A START OF RULER?
	SNA
	JMP	DSKGJ5		/0= YES
	AC0002			/SEE IF THIS IS THE FIRST TIME THROUGH THE
				/ROUTINE AND IF SO GET CHARACTERS UNTIL A
				/PRINTABLE ONE IS FOUND.
	TAD	DSKSOD		/TEST FOR FIRST AND NOT SOD SENT YET = - 2
	SZA CLA
	JMP	DSKG24		/GET CHARACTER
	AC7777
	DCA	DSKSOD		/IF TRUE SAVE THE CHARACTER FOUND AND SET
				/FLAG FOR SEND SOD
	TAD	T1
	DCA	DSKBAK
	JMP	DSKGJ7

DSKG24,	TAD	SAVTCH		/IS IT A SAVED PRECEDENCE CHAR FOR TECH CHAR?
	SNA CLA CLL
	JMP	DSKG34		/NO

/PRECEDENCE STRING ALREADY SENT. TRANSLATE THE TECH CHAR
/TO ACTUAL POSITION ON THE KEYBOARD.

	TAD	SAVTCH		/THIS CONTAINS 61 62, OR 63
	AND	(3)		/MASK LEAST SIGNIFICANT 3 BITS
	RTR
	RTR			/POSITION TO UPPER 2 BITS
	DCA	SAVTCH		/SAVE IT
	TAD	T1		/GET TECHNICAL CHARACTER
	AND	P177		/ONLY THE CHARACTER PLEASE
	TAD	SAVTCH		/GET THE 2 BITS OF THE PRECEDENCE CHARACTER
	DCA	SAVTCH		/NOW CONTAINS CHARACTER AND 2 BITS OF PRECEDENCE
	JMP	DSTCHR		/Test if we need to make char 8 bit	/A056
	


/HERE MUST TRANSLATE THE CHARACTER AGAINST THE TABLE TO GET THE CODE OF THE KEY
/REMEMBER THAT THE INTRODUCER WAS ALREADY SENT BEFORE SENDING THE TECH CHARACTER....

DSTRNS,	JMS	TRANS		/TRANSLATE, RETURN WITH CHAR IN T1
	DCA	SAVTCH		/CLEAR FLAG
	JMP	DSKG31		/EXIT NORMAL TO CALLING ROUTINE

DSKG34,	TAD	CHKTCH		/HAVE START DEAD AND SPACE BEEN SEEN?
	SNA CLA
	JMP	DSKG36		/NO
	DCA	CHKTCH		/YES, CLEAR FLAG
	TAD	T1		/CHECK TO SEE IF REQUIRED SPACE (BS,SP,SP)
	TAD	(-SPC)
	SNA CLA
	JMP	DSKGJ2		/THIS IS REQUIRED SPACE, SEND IT

	TAD	T1		/BS,SP, NOT A SPACE
	DCA	SAVTCH		/THIS IS CHAR 1, 2, OR 3  (61, 62, OR 63 OCTAL)
	JMP	DSISND		/Test to send Introducer		/A056


	JMP	DSKG32		/SEND INTRODUCER FOR TECH STRING

DSKG36,	TAD	CHKSPC		/WAS START DEAD SEEN?
	SNA CLA
	JMP	DSKGJ2		/NO, NOT A DEAD KEY SEQUENCE

	DCA	CHKSPC		/YES, SEE IF THIS IS SPACE AND CLEAR FLAG
	TAD	T1
	TAD	(-SPC)		/IS THIS A SPACE?  (BS,SPACE = START DEAD)
	SZA CLA
	JMP	DSKGJ2		/NO, NOT A TECH CHAR COMBINATION
	AC7777
	DCA	CHKTCH		/YES SET FLAG
	JMP	DSKGJ7		/GET NEXT CHARACTER.
> / END IFDEF CONFIG

/
/	Code below moved here on edit 058 to make space 		/A058
/
/
/
ESCDET,	TAD	(-33		/033 IS ESCAPE CODE FOR 7-BIT		/A024
	SNA CLA			/SKIP TO PRINT 1 CHAR NON-ESC STRING	/A024
	JMP	NOPEX1		/JUST TRAPPED ESC. EXIT W/O PRINTING	/A024
	TAD	(ESCSTR		/GET BEGINING OF ESC STRING		/A024
	DCA	EMPPTR		/INIT. STRING POINTER			/A024
	JMP	EMPTY1		/NO ESC IN PROGRESS JUST PRINT 1	/A024



/------------
	PAGE

IFDEF CONFIG < / Allocate space when assembling for WPCU4.
DSKGJ2,	TAD	T1
	TAD	(-LF)		/LOOK FOR END OF LINE
	SNA
	JMP	DSKG19		/0= YES
	TAD	(LF-TAB)	/LOOKING FOR TAB
	SNA
	JMP	DSKG30
	TAD	(TAB-BS)	/IS IT A START DEAD KEY SEQUENCE?
	SNA
	JMP	DSKG33		/*******START OF DEAD KEY SEQUENCE
	TAD	(BS-40)		/GET RID OF ALL OTHER CONTROL CHARACTERS
	SPA CLA
	JMP	DSKGJ7		/GET NEXT CHARACTER

DSKG31,	TAD	T1		/OK RETURN THE CHARACTER IN T1		/M041

DSKGJ8,	ISZ	DSKGCH		/2 SKIPS MEANS GOT A CHARACTER TO RETURN
	DCA	DSKSAV		/SAVE CHARACTER THAT WE ARE RETURNING.	/A037
	TAD	DSKSAV		/GET CHARACTER BACK.			/A037
	AND	P377		/ONLY RETURN THE CHARACTER.		/A037

DSKG16,	ISZ	DSKGCH		/DO A SKIP RETURN
	JMP	DSKXIT		/EXIT

DSKG17,	TAD	DSKSAV		/GET LAST CHAR TO HAVE BEEN SENT.	/A037
	AND	(7400)		/ISOLATE THE "FLAG" BITS.		/A037
	TAD	(-1400)		/SEE IF IT WAS A "NOSPACE"		/A037
	SNA CLA			/SKIP IF NO.				/A037
	JMP	DSKGJ7		/YES. IGNORE CURRENT SOFT SPACE.	/A037
	JMP	DSKG26		/IT WASN'T. SEND THIS SPACE!!!		/A037
DSKGJ1,	JMS	DBGCHR		/GET THE NEXT CHARACTER FROM THE BUFFERS INSTEAD
				/OF RDFILL
	JMP	DSKGJ7		/COMMAND RETURN
	SMA
	JMP	DSKGJ8		/CHECK FOR END OF BUFFER WHICH IS -1

	CLA
	DCA	DSKSTF		/CLEAR THE FLAG SAYING GET THE TEXT FROM A BUFFER
	JMP	DSKGJ7

DSKGJ5,	AC0001			/SET THE RULER FLAG

DSKGJ9,	DCA	DSKRLF		/CLEAR FLAG
	JMP	DSKGJ7

DSKGJ6,	AC0001
	DCA	DSKSOD		/SET THE FLAG 1 SO THE SOD STRING WIL NOT BE
	AC0001
	DCA	DSKSOL		/SET THE START OF LINE FLAG
	JMP	DSKG14		/SET AGAIN UNTIL THE NEXT DOCUMENT

DSKG12,	JMS	DRDPCN		/INTERPRET THE PRINTER CONTROL
	CLA			/THIS MIGHT NOT BE NEEDED.		/A043
	JMP	DSKGJ7

DSKG33,	AC7777
	DCA	CHKSPC		/THIS IS START DEAD (BS) KEY SEQUENCE INTRODUCER
	JMP	DSKGJ7		/GET NEXT CHARACTER

DSKSTF,	0			/1 IF THE NEXT CHARACTER IS TO COME FROM A BUFFER

DSKRLF,	0			/IF NOT ZERO THEN IN THE MIDDLE OF A RULER

DSKSOD,	0			/IF -1 THEN FIRST TIME THROUGH SO SEND STX
				/IF +1 THEN IT SAYS THAT END OF DDOCUMENT SEND EOT
				/0 MEANS RETURN NOTHING ELSE TO SEND

DSKSOL,	0			/SET TO 1 IF THE NEXT TIME IT SHOULD EXEXCUTE THE
				/SOL BUFFER INFORMATION
DSKBAK,	0			/BACK UP CHARACTER USED TO STORE THE FIRST PRINTABLE
				/CHARACTER UNTIL THE SOD IS SENT.
DSKSAV,	0			/RETURNED CHARACTER, USED FOR NOSPACE	/A037
CHKSPC,	0			/SET TO -1 IF START DEAD (BACKSPACE) SEEN
CHKTCH,	0			/SET TO -1 IF START DEAD AND SPACE SEEN
> / END IFDEF CONFIG
SAVTCH,	0			/TEMP STORAGE FOR INTRODUCER 1,2, OR 3
GETTCH,	0			/STORAGE FOR TECH CHARACTER

/
/	This routine acts as a Filter for chars passing through the 	/A058
/	8 bit to 7 bit NRC "hoop".It uses NRCSCH to search for 8 bit	/A058
/	chars outside the NRC and if 7 bit char was input then checks 	/A058
/	the replaced chars in the NRC ({,[,\etc)			/A058
/	Parameters							/A058
/		Called with char in the AC				/A058
/	Return								/A058
/		AC is empty						/A058
/	Calling Seq							/A058
/									/A058
/		Caller +1 		Char is replaced Nrc		/A058
/		Caller +2		Char is 8bit , in NRC		/A058
/		Caller +3		Char is bone fide		/A058
/
/


NRCTRM,	XX								/A058
	DCA	NRCCSV		/ Put char away somewhere		/A058
	DCA	NRCREP		/ Clear out replaced value		/A058
	TAD 	NRCCSV		/ Get it back				/A058
	CDFMYF			/ Point to this data field		/A058
	CIA			/ Negate char				/A058
	DCA	NRCCHR		/ And keep it safe for NRCSCH		/A058
	AC7777			/ Set Acc to -1				/A058
	TAD	VTMODE		/ Get Term type				/A058
	SZA CLA			/ Is it Vt100				/A058
	JMP	NRCEXT		/ No , so get out			/A058
/									/A058
/	Now test for 7/8 bit input 					/A058
/									/A058
	TAD 	NRCCSV		/ Get char back				/A058
	AND	(200)		/ Check if 8 bit			/A058
	SNA CLA			/					/A058
	  JMP 	NRC7BT		/ Only 7 bit so check it		/A058


NRC8BT,	TAD 	(NRCTBL+1)	/ Look down Right hand side of table	/A058
	JMS	NRCSCH		/ Search for MCS in NRC			/A058
	  SKP			/ Found it so fnd repl value and exit	/A058
	  JMP	NRCBAD		/ Didn't find it so ignore it		/A058
	AC7777			/ Set AC to -1				/A058
	JMS	NRCPSET		/ Set the pointer			/A058
	JMP	NRCEXT		/ And exit				/A058

/
/	Check for 7 bit replaced chars					/A058
/
NRC7BT,	TAD	(NRCTBL)	/ Look down Left hand side now		/A058
	JMS	NRCSCH		/ Search for replaced char		/A058
	  JMP	NRC7BAD		/ Found it , get out			/A058
	AC0001			/ Point to next one			/A058
	JMS	NRCPSET		/ Set pointer & get char		/A058
	JMP	NRCEXT		/ And get out				/A058

NRC7BAD,AC0001			/ Set pointer to next one		/A058
	JMS	NRCPSET		/ Set pointer and get char		/A058
	JMP	NRCBAD		/ Pretend it was RFEALLY bad		/A058

NRCEXT,	ISZ	NRCTRM		/ Bump return				/A058
NRCOK,	ISZ	NRCTRM		/ And again				/A058
NRCBAD,	CDFBUF			/ Data back to WPCOM field		/A058
	CIFBUF			/ Instruction back to Buff field	/A058
	JMP I	NRCTRM		/ Bi Bi					/A058

NRCCHR,	0			/ -ve value of input char used by NRCSCH/A058
NRCCSV,	0			/ Saved char				/A058


NRCPSET,XX								/A058
	TAD 	NRCPTR		/ Get current pointer			/A058
	DCA 	XNRCPTR		/ re-save it				/A058
	TAD I	XNRCPTR		/ And get replacement value		/A058
	DCA 	NRCREP		/ and save it				/A058
	JMP I	NRCPSET		/ Return				/A058

XNRCPTR,0			/ Temp for NRCPTR			/A058
/------------
	PAGE

	IFDEF	CONDOR	<						/A024
KBESCT,	"[&177;"1&177;"2&177;"~&177;0					/A024
	"[&177;"1&177;"3&177;"~&177;0					/A024
	"[&177;"1&177;"4&177;"~&177;-1					/M033
	"[&177;"1&177;"5&177;"~&177;0					/A024
	0			/STOPPER				/A024
	>			/END IF DEF CONDOR			/A024

/TRANSLATION TABLE POINTERS. INDEXED BY 'CXTMOD'
/0 = VT52
/1 = VT278
/2 = DECWORD IN APPLICATIONS MODE.
/3 = DECWORD IN NUMERIC MODE.

	IFNDEF	CONDOR	<						/A019
K2HXX,	T2H52			/PTR TO VT278 TO VT52  XLATION TABLE.
	T2H278			/PTR TO VT278 TO VT278 XLATION TABLE.
	T2HDWA			/PTR TO VT278 TO DECWORD APPLICATIONS MODE TABLE.
	T2HDWN			/PTR TO VT278 TO DECWORD NUMERIC MODE TABLE.

/.SBTTL	CONVERSION TABLE FOR TTY TO HOST VT52 MODE.


/THE FOLLOWING TABLE MUST BE IN ASENDING ESCAPE SEQUENCE.
/THE ESCAPE HAS BEEN LEFT OFF AND IS IMPLIED (SPACE REASONS).

T2H52,	/TTY INPUT (VT278)	/HOST OUTPUT (VT52)
	ESC;"O&177;"A&177;0;	ESC;"A&177;0			/MOVE CURSOR UP.
	ESC;"O&177;"B&177;0;	ESC;"B&177;0			/MOVE CURSOR DOWN.
	ESC;"O&177;"C&177;0;	ESC;"C&177;0			/MOVE CURSOR RIGHT.
	ESC;"O&177;"D&177;0;	ESC;"D&177;0			/MOVE CURSOR LEFT.
	ESC;"O&177;"M&177;0;	ESC;"?&177;"M&177;0		/KEYPAD "ENTER" KEY.
	ESC;"O&177;"P&177;0;	ESC;"P&177;0			/KEYPAD "PF1"   KEY.
	ESC;"O&177;"Q&177;0;	ESC;"Q&177;0			/KEYPAD "PF2"   KEY.
	ESC;"O&177;"R&177;0;	ESC;"R&177;0			/KEYPAD "PF3"   KEY.
	ESC;"O&177;"S&177;0;	ESC;"S&177;0			/KEYPAD "PF4"   KEY.
	ESC;"O&177;"T&177;0;	0				/BREAK KEY(IGNORE)/A010
	ESC;"O&177;"l&177;0;	ESC;"?&177;"l&177;0		/KEYPAD ","     KEY.
	ESC;"O&177;"m&177;0;	ESC;"?&177;"m&177;0		/KEYPAD "-"     KEY.
	ESC;"O&177;"n&177;0;	ESC;"?&177;"n&177;0		/keypad "."     key.
	ESC;"O&177;"p&177;0;	ESC;"?&177;"p&177;0		/keypad "0"     key.
	ESC;"O&177;"q&177;0;	ESC;"?&177;"q&177;0		/keypad "1"     key.
	ESC;"O&177;"r&177;0;	ESC;"?&177;"r&177;0		/keypad "2"     key.
	ESC;"O&177;"s&177;0;	ESC;"?&177;"s&177;0		/keypad "3"     key.
	ESC;"O&177;"t&177;0;	ESC;"?&177;"t&177;0		/keypad "4"     key.
	ESC;"O&177;"u&177;0;	esc;"?&177;"u&177;0		/keypad "5"     key.
	ESC;"O&177;"v&177;0;	ESC;"?&177;"v&177;0		/keypad "6"     key.
	ESC;"O&177;"w&177;0;	ESC;"?&177;"w&177;0		/keypad "7"     key.
	ESC;"O&177;"x&177;0;	ESC;"?&177;"x&177;0		/KEYPAD "8"     KEY.
	ESC;"O&177;"y&177;0;	ESC;"?&177;"y&177;0		/keypad "9"     key.
	ESC;"[&177;"A&177;0;	ESC;"A&177;0			/MOVE CURSOR UP.
	ESC;"[&177;"B&177;0;	ESC;"B&177;0			/MOVE CURSOR DOWN.
	ESC;"[&177;"C&177;0;	ESC;"C&177;0			/MOVE CURSOR RIGHT.
	ESC;"[&177;"D&177;0;	ESC;"D&177;0			/MOVE CURSOR LEFT.
	0							/STOPPER.

/.SBTTL	CONVERSION TABLE FOR TTY TO HOST VT52 MODE.


/THE FOLLOWING TABLE MUST BE IN ASENDING ESCAPE SEQUENCE.
/THE ESCAPE HAS BEEN LEFT OFF AND IS IMPLIED (SPACE REASONS).

T2H278,	/TTY INPUT (VT278)	/HOST OUTPUT (VT278)
	"O&177;"T&177;0;	0		/BREAK KEY (IGNORE)	/A010
	0					/STOPPER.

/.SBTTL	CONVERSION TABLE FOR TTY TO HOST DECWORD APPLICATIONS MODE.


/THE FOLLOWING TABLE MUST BE IN ASENDING ESCAPE SEQUENCE.
/THE ESCAPE HAS BEEN LEFT OFF AND IS IMPLIED (SPACE REASONS).

T2HDWA,	/TTY INPUT (VT278)	/HOST OUTPUT (DECWORD APPLICATIONS MODE)
	ESC;"O&177;"A&177;0;	0				/CURSOR UP.
	ESC;"O&177;"B&177;0;	0				/CURSOR DOWN.
	ESC;"O&177;"C&177;0;	ESC;"R&177;0		/CURSOR RIGHT. (SWAP)
	ESC;"O&177;"D&177;0;	0			/CURSOR LEFT.
	ESC;"O&177;"M&177;0;	ESC;"?&177;"M&177;0		/KEYPAD "ENTER" KEY.
	ESC;"O&177;"P&177;0;	ESC;"P&177;0		/KEYPAD "PF1"   KEY.
	ESC;"O&177;"Q&177;0;	ESC;"Q&177;0		/KEYPAD "PF2"   KEY.
	ESC;"O&177;"R&177;0;	ESC;"R&177;0		/M014	/KEYPAD "PF3"   KEY.
	ESC;"O&177;"S&177;0;	ESC;"S&177;0		/M014	/KEYPAD "PF4"   KEY.
	ESC;"O&177;"T&177;0;	0			/BREAK KEY(IGNORE)/A010
	ESC;"O&177;"l&177;0;	ESC;"?&177;"l&177;0/M014/KEYPAD ","     KEY.
	ESC;"O&177;"m&177;0;	ESC;"?&177;"m&177;0/M014/KEYPAD "-"     KEY.
	ESC;"O&177;"n&177;0;	ESC;"?&177;"n&177;0		/KEYPAD "."     KEY.
	ESC;"O&177;"p&177;0;	ESC;"?&177;"p&177;0		/KEYPAD "0"     KEY.
	ESC;"O&177;"q&177;0;	ESC;"?&177;"q&177;0		/KEYPAD "1"     KEY.
	ESC;"O&177;"r&177;0;	ESC;"?&177;"r&177;0		/KEYPAD "2"     KEY.
	ESC;"O&177;"s&177;0;	ESC;"?&177;"s&177;0		/KEYPAD "3"     KEY.
	ESC;"O&177;"t&177;0;	ESC;"?&177;"t&177;0		/KEYPAD "4"     KEY.
	ESC;"O&177;"u&177;0;	ESC;"?&177;"u&177;0		/KEYPAD "5"     KEY.
	ESC;"O&177;"v&177;0;	ESC;"?&177;"v&177;0		/KEYPAD "6"     KEY.
	ESC;"O&177;"w&177;0;	ESC;"?&177;"w&177;0		/KEYPAD "7"     KEY.
	ESC;"O&177;"x&177;0;	ESC;"?&177;"x&177;0		/KEYPAD "8"     KEY.
	ESC;"O&177;"y&177;0;	ESC;"?&177;"y&177;0		/KEYPAD "9"     KEY.
	ESC;"[&177;"A&177;0;	0			/CURSOR UP.
	ESC;"[&177;"B&177;0;	0			/CURSOR DOWN.
	ESC;"[&177;"C&177;0;	ESC;"R&177;0		/CURSOR RIGHT. (SWAP)
	ESC;"[&177;"D&177;0;	0			/CURSOR LEFT.
	0						/STOPPER.

/.SBTTL	CONVERSION TABLE FOR TTY TO HOST DECWORD NUMERIC MODE.


/THE FOLLOWING TABLE MUST BE IN ASENDING ESCAPE SEQUENCE.
/THE ESCAPE HAS BEEN LEFT OFF AND IS IMPLIED (SPACE REASONS).

T2HDWN,	/TTY INPUT (VT278)	/HOST OUTPUT (DECWORD NUMERIC MODE)
	ESC;"O&177;"A&177;0;	ESC;"A&177;0		/MOVE CURSOR UP.
	ESC;"O&177;"B&177;0;	ESC;"B&177;0		/MOVE CURSOR DOWN.
	ESC;"O&177;"C&177;0;	ESC;"C&177;0		/MOVE CURSOR RIGHT.
	ESC;"O&177;"D&177;0;	ESC;"D&177;0		/MOVE CURSOR LEFT.
	ESC;"O&177;"P&177;0;	ESC;"P&177;0		/KEYPAD "PF1"   KEY.
	ESC;"O&177;"Q&177;0;	ESC;"Q&177;0		/KEYPAD "PF2"   KEY.
	ESC;"O&177;"R&177;0;	ESC;"R&177;0		/KEYPAD "PF3"   KEY.
	ESC;"O&177;"S&177;0;	ESC;"S&177;0		/M014	/KEYPAD "PF4"   KEY.
	ESC;"O&177;"T&177;0;	0			/BREAK KEY(IGNORE)/A010
	ESC;"[&177;"A&177;0;	ESC;"A&177;0		/MOVE CURSOR UP.
	ESC;"[&177;"B&177;0;	ESC;"B&177;0		/MOVE CURSOR DOWN.
	ESC;"[&177;"C&177;0;	ESC;"C&177;0		/MOVE CURSOR RIGHT.
	ESC;"[&177;"D&177;0;	ESC;"D&177;0		/MOVE CURSOR LEFT.
	0						/STOPPER.


/TRANSLATION TABLE POINTERS. INDEXED BY 'CXTMOD'
/0 = VT52
/1 = VT278
/2 = DECWORD IN APPLICATIONS MODE.
/3 = DECWORD IN NUMERIC MODE.

H2TXX,	H2T52		/PTR TO VT52  TO VT278 XLATION TABLE.
	H2T278		/PTR TO VT278 TO VT278 XLATION TABLE.
	H2TDWA		/PTR TO DECWORD APPLICATIONS MODE TO VT278 XLATION TBL.
	H2TDWN		/PTR TO DECWORD NUMERIC MODE TO VT278 XLATION TBL.
	>		/END NDEF CONDOR				/A019

	IFDEF	CONDOR	<						/A019

/TRANSLATION TABLE POINTERS. INDEXED BY 'CXTMOD'
/0 = VT52
/1 = VT100
/2 = DECMATE-II
/3 = VT125
/4 = VT227

H2TXX,	H2T52		/PTR TO VT52  XLATION TABLE.
	H2T100		/PTR TO VT100 XLATION TABLE.
	H2TDM2		/PTR TO DECMATE-II XLATION (RESPONSE) TABLE
	H2T125		/PTR TO VT125 XLATION (ACTION) TABLE		/A037
	H2T100		/PTR TO VT100 TABLE USED IN VT227		/A049
	H2T100		/Ptr to VT100 table used in VT228		/A055
	H2T100		/Ptr to VT100 table used in VT22F		/A055
	>		/END IFDEF CONDOR

/.SBTTL	CONVERSION TABLE FOR HOST TO TTY VT52 MODE.


/THE FOLLOWING TABLE MUST BE IN ASENDING ESCAPE SEQUENCE.
/THE ESCAPE HAS BEEN LEFT OFF AND IS IMPLIED (SPACE REASONS).

/ON INPUT SIDE "-1" MEANS ANY CHAR MATCHES -- BUT THERE MUST BE A CHAR.

/ON OUTPUT SIDE "-1" MEANS OUTPUT D.C.A.
/"-2" MEANS RESPOND TO HOST WHAT WE ARE.
/"-3" MEANS SWITCH TO DWNM (DECWORD NUMERIC MODE).
/"-4" MEANS SWITCH TO DWAM (DECWORD APPLICATIONS MODE).
/"-5" MEANS SWITCH TO "DECWORD" MODE.
/"-6" MEANS SWITCH TO PREVIOUS ANSI MODE				/A019
/"-7" MEANS RESPOND TERMINAL OK.
/"-8" MEANS RESPOND W			/2NDARY DEVICE ATTRIBUTES.	/A031
/"-9" MEANS SWITCH TO "CX" PROGRAM.					/A031
/"-10" RESERVED FOR THE "PRO"						/M032
/"-11" MEANS SWITCH TO "AX" PROGRAM.					/A031
/"-12" MEANS SWITCH TO MAIN MENU & HANGUP MODEM.			/A031
/"-13" MEANS SWITCH TO MAIN MENU.					/A031
/"-14" MEANS SWITCH TO "DX" PROGRAM.					/A032
/"-15' MEANS ENTER GRAPHICS MODE					/A037
/"-16' MEANS LEAVE GRAPHICS MODE					/A037

H2T52,	/HOST INPUT (VT52)	/TTY OUTPUT TO SCREEN
/THE ASCII "GREATER THAN" WAS SUBSTITUTED BY ITS OCTAL EQUIVALENT (076)
/IN THE FOLLOWING LINE OF SOURCE CODE TO ELIMINATE PROBLEMS WITH
/CONDITIONAL CODE DELIMITERS		HLP			V017
IFDEF	CONDOR	<						/A019
	74;0;			ESC;74;-6;0		/SET TO PREV ANSI /A019
	>		/ENDIFDEF CONDOR				/A019
IFNDEF	CONDOR	<							/A019
	"=&177;0;		ESC;"=&177;0		/ENTER KEYPAD APPLICATION MODE.
	76;0;			ESC;76;0		/ENTER KEYPAD NUMBERIC MODE.
	"A&177;0;		ESC;"[&177;"A&177;0		/MOVE CURSOR UP.
	"B&177;0;		ESC;"[&177;"B&177;0		/MOVE CURSOR DOWN.
	"C&177;0;		ESC;"[&177;"C&177;0		/MOVE CURSOR RIGHT.
	"D&177;0;		ESC;"[&177;"D&177;0		/MOVE CURSOR LEFT.
	"F&177;0;		ESC;"(&177;"0&177;0		/ENTER GRAPHICS MODE.
	"G&177;0;		ESC;"(&177;"B&177;0		/LEAVE GRAPHICS MODE.
	"H&177;0;		ESC;"[&177;"H&177;0		/CURSOR HOME.
	"I&177;0;		ESC;"M&177;0			/REVERSE INDEX.
	"J&177;0;		ESC;"[&177;"J&177;0		/E-O-S.
	"K&177;0;		ESC;"[&177;"K&177;0		/E-O-L.
	"Y&177;-1;-1;0;		ESC;"[&177;-1;0			/D.C.A.
	>		/END NDEF CONDOR					/A019
	"Z&177;0;		-2;0				/WHO ARE YOU?
IFDEF	CONDOR	<
	"[&177;"1&177;"2&177;"~&177;0 ;0		/NOP. EAT UP ESC SEQ AND EXIT	/A021
	"[&177;"1&177;"3&177;"~&177;0 ;0		/NOP. EAT UP ESC SEQ AND EXIT	/A021
	"[&177;"1&177;"4&177;"~&177;0 ;0		/NOP. EAT UP ESC SEQ AND EXIT	/A019
	"[&177;"c&177;0		;0			/EAT ESC SEQ AND EXIT	/A049
	"[&177;"0&177;"c&177;0		;0		/EAT ESC SEQ AND EXIT	/A049
	"[&177;0			;0		/EAT ESC SEQ AND EXIT	/A049
	"/&177;0			;0		/EAT ESC SEQ AND EXIT	/A049
	>		/END IF CONDOR
	0						/STOPPER.

/.SBTTL	CONVERSION TABLE FOR HOST TO TTY VT278 MODE.


/THE FOLLOWING TABLE MUST BE IN ASENDING ESCAPE SEQUENCE.
/THE ESCAPE HAS BEEN LEFT OFF AND IS IMPLIED (SPACE REASONS).



IFNDEF	CONDOR	<						/A019
H2T278,	/HOST INPUT (VT278)	/TTY OUTPUT (VT278)
	"[&177;"0&177;"!&177;"~&177;0;	-11;0		/SWITCH TO CX	/A031
	"[&177;"1&177;"!&177;"~&177;0;	-12;0		/RESERVED FOR PRO	/M032
	"[&177;"2&177;"!&177;"~&177;0;	-13;0		/SWITCH TO AX	/A031
	"[&177;"3&177;"!&177;"~&177;0;	-14;0		/SWITCH TO MM & HANGUP	/A031
	"[&177;"4&177;"!&177;"~&177;0;	-15;0		/SWITCH TO MAIN MENU	/A031
	"[&177;"5&177;"!&177;"~&177;0;	-16;0		/SWITCH TO DX	/A032
	"[&177;076;"c&177;0;		-10;0		/REQUEST FOR 2NDARY DEV ATR/A031
	"[&177;"?&177;"2&177;"l&177;0;	-5;0		/SWITCH TO DECWORD MODE./A015
	>		/END NDEF CONDOR				/A019

IFDEF	CONDOR	<						/A019

H2TDM2,

/D048	"[&177;"0&177;"!&177;"~&177;0;	-11;0		/SWITCH TO CX	/A031
/D048	"[&177;"1&177;"!&177;"~&177;0;	-12;0		/RESERVED FOR PRO	/M032
/D048	"[&177;"1&177;"2&177;"~&177;0;0		/NOP. EAT UP ESC SEQ AND EXIT	/A021
/D048	"[&177;"1&177;"3&177;"~&177;0;0		/NOP. EAT UP ESC SEQ AND EXIT	/A021
/D048	"[&177;"1&177;"4&177;"~&177;0;0		/NOP. EAT UP ESC SEQ AND EXIT	/A019
/D048	"[&177;"2&177;"!&177;"~&177;0;	-13;0		/SWITCH TO AX	/A031
/D048	"[&177;"3&177;"!&177;"~&177;0;	-14;0		/SWITCH TO MM & HANGUP	/A031
/D048	"[&177;"4&177;"!&177;"~&177;0;	-15;0		/SWITCH TO MAIN MENU	/A031
/D048	"[&177;"5&177;"!&177;"~&177;0;	-16;0		/SWITCH TO DX	/A032
/D048	"[&177;076;"C&177;0;		-10;0		/REQUEST FOR 2NDARY DEV ATR/A031
					/SWITCH TO VT52 (NON-ANSI)	/A019
	"[&177;"?&177;"2&177;"l&177;0;
	ESC;"[&177;"?&177;"2&177;"l&177;-5;0  /M021
	>		/END IFDEF CONDOR				/A019
	0					/STOPPER.

IFNDEF	CONDOR	<						/A019
/.SBTTL	CONVERSION TABLE FOR HOST (DECWORD) TO TTY.


/THE FOLLOWING TABLE MUST BE IN ASENDING ESCAPE SEQUENCE.
/THE ESCAPE HAS BEEN LEFT OFF AND IS IMPLIED (SPACE REASONS).

/ON INPUT SIDE "-1" MEANS ANY CHAR MATCHES -- BUT THERE MUST BE A CHAR.

/ON OUTPUT SIDE "-1" MEANS OUTPUT D.C.A.
/"-2" MEANS RESPOND TO HOST WHAT WE ARE.
/"-3" MEANS SWITCH TO DWNM (DECWORD NUMERIC MODE).
/"-4" MEANS SWITCH TO DWAM (DECWORD APPLICATIONS MODE).
/"-5" MEANS SWITCH TO "DECWORD" MODE.
/"-6" MEANS SWITCH TO "ANSI278" MODE.
/"-7" MEANS RESPOND TERMINAL OK.
/"-8" MEANS RESPOND W/2NDARY DEVICE ATTRIBUTES.				/A031
/"-9" MEANS SWITCH TO "CX" PROGRAM.					/A031
/"-10" RESERVED FOR THE "PRO"						/M032
/"-11" MEANS SWITCH TO "AX" PROGRAM.					/A031
/"-12" MEANS SWITCH TO MAIN MENU & HANGUP MODEM.			/A031
/"-13" MEANS SWITCH TO MAIN MENU.					/A031
/"-14" MEANS SWITCH TO "DX" PROGRAM.					/A032
/"-15' MEANS ENTER GRAPHICS MODE					/A037
/"-16' MEANS LEAVE GRAPHICS MODE					/A037

H2TDWA,	/HOST INPUT (DECWORD)	/TTY OUTPUT (VT278)
H2TDWN,	/HOST INPUT (DECWORD)	/TTY OUTPUT (VT278)
	74;0;			-6;0		/- SWITCH TO ANSI 278 MODE./A015
	"=&177;0;		ESC;"=&177;-4;0		/ENTER KEYPAD APPLICATION MODE.	
	/THE ASCII "GREATER THAN" WAS SUBSTITUTED BY ITS OCTAL EQUIVALENT (076)
	/IN THE FOLLOWING LINE OF SOURCE CODE TO ELIMINATE PROBLEMS WITH
	/CONDITIONAL CODE DELIMITERS		HLP			V017
	076;0;			ESC;076;-3;0			/ENTER KEYPAD NUMERIC MODE.
	"A&177;0;		ESC;"[&177;"A&177;0		/MOVE CURSOR UP.
	"B&177;0;		ESC;"[&177;"B&177;0		/MOVE CURSOR DOWN.
	"C&177;0;		ESC;"[&177;"C&177;0		/MOVE CURSOR RIGHT.
	"D&177;0;		ESC;"[&177;"D&177;0		/MOVE CURSOR LEFT.
	"F&177;0;		ESC;"(&177;"0&177;0		/ENTER GRAPHICS MODE.
	"G&177;0;		ESC;"(&177;"B&177;0		/LEAVE GRAPHICS MODE.
	"H&177;0;		ESC;"[&177;"H&177;0		/CURSOR HOME.
	"I&177;0;		ESC;"M&177;0			/REVERSE INDEX.
	"J&177;0;		ESC;"[&177;"J&177;0		/E-O-S.
	"K&177;0;		ESC;"[&177;"K&177;0		/E-O-L.
	"Y&177;-1;-1;0;		ESC;"[&177;-1;0			/D.C.A.
	"Z&177;0;		-2;0				/WHO ARE YOU?
	"[&177;0;		0				/ENTER HOLD SCREEN MODE.
	"\&177;0;		0				/EXIT  HOLD SCREEN MODE.
	0							/STOPPER.
	>		/END NDEF CONDOR			/A019

IFDEF	CONDOR	<						/A019
/.SBTTL	CONVERSION TABLEFROM HOST IF WE ARE A VT100						/A019


/THE FOLLOWING TABLE MUST BE IN ASENDING ESCAPE SEQUENCE.
/THE ESCAPE HAS BEEN LEFT OFF AND IS IMPLIED (SPACE REASONS).

/ON INPUT SIDE "-1" MEANS ANY CHAR MATCHES -- BUT THERE MUST BE A CHAR.

/ON OUTPUT SIDE "-1" MEANS OUTPUT D.C.A.
/"-2" MEANS RESPOND TO HOST WHAT WE ARE.
/"-3" MEANS SWITCH TO DWNM (DECWORD NUMERIC MODE).
/"-4" MEANS SWITCH TO DWAM (DECWORD APPLICATIONS MODE).
/"-5" MEANS SWITCH TO NON-ANSI MODE.
/"-6" MEANS SWITCH TO PREVIOUS "ANSI" MODE.
/"-7" MEANS RESPOND TERMINAL OK.
/"-8" MEANS RESPOND W/2NDARY DEVICE ATTRIBUTES.				/A031
/"-9" MEANS SWITCH TO "CX" PROGRAM.					/A031
/"-10" RESERVED FOR THE "PRO"						/M032
/"-11" MEANS SWITCH TO "AX" PROGRAM.					/A031
/"-12" MEANS SWITCH TO MAIN MENU & HANGUP MODEM.			/A031
/"-13" MEANS SWITCH TO MAIN MENU.					/A031
/"-14" MEANS SWITCH TO "DX" PROGRAM.					/A032
/"-15' MEANS ENTER GRAPHICS MODE					/A037
/"-16' MEANS LEAVE GRAPHICS MODE					/A037



H2T100,	/HOST INPUT TO VT100	/VT100 OUTPUT TO SCREEN			/A019
		IFDEF VT125R <						/A037
/D041	"p&177;-1;"p&177;0;		0		/EAT UP SEQ	/A037
	"P&177;"0&177;"p&177;0;		0		/EAT UP SEQ	/A041
	"P&177;"1&177;"p&177;0;		0		/EAT UP SEQ	/A041
	"P&177;"2&177;"p&177;0;		0		/EAT UP SEQ	/A041
	"P&177;"3&177;"p&177;0;		0		/EAT UP SEQ	/A041
	"P&177;"p&177;0;		0		/EAT UP SEQ	/A041
		>		/END IFDEF VT125R			/A037
	"Z&177;0;			-2;0		/NON-ANSI  WHO ARE YOU?
	"[&177;"0&177;"!&177;"~&177;0;	-11;0		/SWITCH TO CX	/A031
	"[&177;"0&177;"c&177;0;		-2;0		/ANSI WHO ARE YOU?
	"[&177;"1&177;"!&177;"~&177;0;	-12;0		/RESERVED FOR PRO	/M032
	"[&177;"1&177;"2&177;"~&177;0;	0		/NOP. EAT UP ESC SEQ AND EXIT/A021
	"[&177;"1&177;"3&177;"~&177;0;	0		/NOP. EAT UP ESC SEQ AND EXIT/A021
	"[&177;"1&177;"4&177;"~&177;0;	0		/NOP. EAT UP ESC SEQ AND EXIT/A019
	"[&177;"2&177;"!&177;"~&177;0;	-13;0		/SWITCH TO AX	/A031
	"[&177;"3&177;"!&177;"~&177;0;	-14;0		/SWITCH TO MM & HANGUP	/A031
	"[&177;"4&177;"!&177;"~&177;0;	-15;0		/SWITCH TO MAIN MENU	/A031
	"[&177;"5&177;"!&177;"~&177;0;	-16;0		/SWITCH TO DX	/A032
	"[&177;"5&177;"n&177;0;	-7;0			/FLAG TO RESPOND TERM OK/A019
	"[&177;076;"c&177;0;		-10;0		/REQUEST FOR 2NDARY DEV ATR/A031
	"[&177;"?&177;"2&177;"l&177;0;
							/SW. TO VT52 (NON-ANSI)/A049
	ESC;"[&177;"?&177;"2&177;"l&177;-5;0		/M021
	"[&177;"c&177;0;		-2;0		/ANSI WHO ARE YOU
	0						/STOPPER.

H2T125,	/HOST INPUT TO VT125	/VT125 OUTPUT TO SCREEN	/A037
	/THE FOLLOWING 5 SEQUENCES EACH PUT VT125 INTO GRAPHICS MODE	/A037
	"P&177;"0&177;"p&177;0;		-20;0		/a037
	"P&177;"1&177;"p&177;0;		-21;0		/a037
	"P&177;"2&177;"p&177;0;		-22;0		/a037
	"P&177;"3&177;"p&177;0;		-23;0		/A037
	"P&177;"p&177;0;		-20;0		/A037
	"Z&177;0;			-2;0		/NON-ANSI  WHO ARE YOU?	/A037
	"[&177;"0&177;"!&177;"~&177;0;	0		/EAT ESC SEQ AND EXIT/A037/M049
	"[&177;"0&177;"c&177;0;		-2;0		/ANSI WHO ARE YOU?
	"[&177;"1&177;"!&177;"~&177;0;	0		/EAT ESC SEQ AND EXIT/A037/M049
	"[&177;"1&177;"2&177;"~&177;0;	0		/NOP. EAT UP ESC SEQ AND EXIT/A037
	"[&177;"1&177;"3&177;"~&177;0;	0		/NOP. EAT UP ESC SEQ AND EXIT/A037
	"[&177;"1&177;"4&177;"~&177;0;	0		/NOP. EAT UP ESC SEQ AND EXIT/A037
	"[&177;"2&177;"!&177;"~&177;0;	0		/EAT ESC SEQ AND EXIT/A037/M049
	"[&177;"3&177;"!&177;"~&177;0;	0		/EAT ESC SEQ AND EXIT/A037/M049
	"[&177;"4&177;"!&177;"~&177;0;	0		/EAT ESC SEQ AND EXIT/A037/M049
	"[&177;"5&177;"!&177;"~&177;0;	0		/EAT ESC SEQ AND EXIT/A037/M049
	"[&177;"5&177;"n&177;0;	-7;0			/FLAG TO RESPOND TERM OK/A037
	"[&177;076;"c&177;0;		-10;0		/REQUEST FOR 2NDARY DEV ATR/A037
	"[&177;"?&177;"2&177;"l&177;0;ESC;"[&177;"?&177;"2&177;"l&177;-5;0  /M021
	"[&177;"c&177;0;		-2;0		/ANSI WHO ARE YOU	/A037
	"\&177;0;	ESC;"\&177;-17;0		/LEAVE GRAPHICS MODE	/A037
	0						/STOPPER.		/A037
	>		/END IF DEF CONDOR				/A019

H2TBUF,	ZBLOCK	40		/ESC SEQ BUFFER (NEEDS ONLY TO BE 4).
	IFNDEF	CONDOR	<						/A017
K2HBUF,	ZBLOCK	40		/ESC SEQ BUFFER (NEEDS ONLY TO BE 4).
	>			/END NDEF CONDOR			/A019
H2TBYL=H2TBUF+2			/$YLC ADDRESS OF L.
H2TBYC=H2TBUF+3			/$YLC ADDRESS OF C.
CVTSTR,	TEXT	"!D;!D&H"/USED TO OUTPUT LINE/COL # IN DECIMAL ASCII DIGITS.


	IFNDEF	CONDOR	<						/A019
H2TABT,	AB52			/ANSWERBACK FOR VT52
	0//AB278		/ANSWERBACK FOR VT278.
	AB52W			/ANSWERBACK FOR VT278 IN VT52 MODE.
	0			/NO TERMINAL STATUS RESPONSE.		/A031
	AB2ATR			/ANSWERBACK FOR SECONDARY DEVICE ATTR	/A031
	>		/END IFNDEF CONDOR				/A019

	IFDEF	CONDOR	<						/A019
H2TABT,	AB52			/ANSWERBACK FOR VT52
	AB100			/ANSWERBACK FOR VT100.
	ABDM2			/ANSWERBACK FOR DECMATE-II		/A019
	AB125			/ANSWERBACK FOR VT125			/A037
	AB227			/ANSWERBACK FOR VT227			/A049
	AB227			/ANSWERBACK FOR VT228			/A055
	AB227			/ANSWERBACK FOR VT227			/A055


H2TAB1,	A2DII			/SEC. DEV. ATTR. DMII			/A049
	A2DIII			/SEC. DEV. ATTR. DMIII			/A049

/D049	ABTOK			/ANSWERBACK TERMINAL OK ESC STRING	/A019
/D049	AB2ATR			/ANSWERBACK FOR SECONDARY DEVICE ATTR	/A031
	>		/END IFDEFCONDOR				/A019


	IFNDEF	CONDOR	<						/A019
AB52,	ESC;"/&177;"K&177;0		/VT52 ANSWERBACK NO COPIER.
/AB100,	ESC;"[&177;"?&177;"1&177;";&177;"0&177;"c&177;0		/VT100 ANSWERBACK.
AB52W,	ESC;"[&177;"?&177;"8&177;";&177;"7&177;"c&177;0		/VT278 IN VT52 MODE.
AB2ATR,	ESC;"[&177;076;"4&177;";&177;"1&177;";&177;"1&177;"c&177;0
						/DM1 2NDARY DEV STAT	/M035
	>		/END NDEF CONDOR				/A019
	IFDEF	CONDOR	<						/A019
AB52,	ESC;"/&177;"Z&177;0		/VT52 ANSWERBACK		/M019
AB100,	ESC;"[&177;"?&177;"1&177;";&177;"2&177;"c&177;0		/VT100 ANSWERBACK./M019
ABDM2,	0	/DM II ANS. BACK DONE BY FIRMWARE			/A049
/D049ESC;"[&177;"?&177;"1&177;";&177;"2&177;"c&177;0		/DM2 ANSWERBACK./M019
AB125,	ESC;"[&177;"?&177;"1&177;"2&177;";&177;"7&177;";&177;"0&177;"c&177;0
							/VT125 ANSWERBACK./A037
AB227,	ESC;"[&177;"?&177;"6&177;"2&177;";&177;"1&177;"c&177;0		/A049
							/VT227 ANS.BACK	/A049


A2DII, ESC;"[&177;076;"4&177;";&177;"7&177;";&177;"2&177;";&177
	"0&177;";&177;"2&177;"5&177;"c&177;0			/M057	/C054
					/DM2 2NDARY DEV STAT/M041/M035/M036
A2DIII,ESC;"[&177;076;"4&177;";&177;"5&177;";&177;"3&177;";&177
	"0&177;";&177;"2&177;"5&177;"c&177;0			/M057	/C054
					/DMIII SEC. DEV. ATTR.		/A049
ABTOK,ESC;"[&177;"0&177;"n&177;0		/? STATUS. ANS=OK/A019
	>		/END CONDOR IFDEF				/A019


/THE TEXT AND ASCII STRINGS FOR THE ERROR MESSAGES.

CLASCR,
	TEXT '^P!E     ^P'
ERRMS1,
	IFDEF ENGLSH <
	TEXT "^A*** '^A' IS AN &ILLEGAL &CHARACTER IN LINE '^A' ***^A"
	>
	IFDEF ITALIAN <
	TEXT "^A*** '^A' CARATTERE ILLEGALE ALLA RIGA '^A' ***^A"
	>
	IFDEF V30NOR <
	TEXT "^A*** '^A' ER IKKE ET GYLDIG TEGN I LINJE '^A' ***^A"
	>
	IFDEF V30SWE <
	TEXT "^A*** '^A' \DR ETT UTILL\ETET TECKEN P\E RAD '^A' ***^A"
	>


ERRMS2,
	IFDEF ENGLSH < TEXT '^A&THERE ARE !D LINE(S) WITH ERROR(S)' >
	IFDEF ITALIAN < TEXT '^A !D RIGA/E CON ERRORI' >
	IFDEF V30NOR < TEXT '^A&DET ER FEIL I !D LINJE(R)'>
	IFDEF V30SWE < TEXT '^A&DET FINNS !D RADER MED FEL'>

ERRMS3,
	IFDEF ENGLSH < TEXT "^A*** '^A' HAS &NO &MEANING IN LINE '^A' ***^A" >
	IFDEF ITALIAN < 
	TEXT "^A*** '^A' NON SIGNIFICATIVO ALLA RIGA '^A' ***^A" >
	IFDEF V30NOR < TEXT "^A*** '^A' KAN IKKE BRUKES I LINJE '^A' ***^A" >
	IFDEF V30SWE < TEXT "^A*** '^A' BETYDER INGENTING P\E RAD '^A' ***^A">

ERRAG2,	CR
	LF
	LF
	LF
	40
	40
	40
	40
	40
	0
ERRAG1,	CR
	LF
	0



/THE MAJORITY OF THE TABLES USED

/THE TABLE CONTAINING THE VALID COMMANDS

CMDTBL,
	RECSTR			/RECEIVE
	SNDSTR			/SEND
	0

/THE 6-BIT STRINGS FOR THE TABLE CMDTBL

RECSTR,
	IFDEF ENGLSH < TEXT 'RECEIVE' >
	IFDEF ITALIAN < TEXT 'RICEVI' >
	IFDEF V30NOR <TEXT 'MOTTA'>
	IFDEF V30SWE < TEXT 'TA_EMOT'>

SNDSTR,
	IFDEF ENGLSH < TEXT 'SEND' >
	IFDEF ITALIAN < TEXT 'INVIA' >
	IFDEF V30NOR <TEXT 'SENDE'>
	IFDEF V30SWE < TEXT 'SEND'>

/TABLE OF VARIABLES THAT CAN BE REDEFINED

DEFARG,
	SODSTR			/START OF TEXT
	SOLSTR			/START OF LINE
	EOLSTR			/END OF LINE
	EODSTR			/END OF TEXT
	PARATR			/END OF PARAGRAPH
	EOPSTR			/END OF PAGE
	TABSTR			/TAB
	TECSTR			/TECHNICAL CHARACTER			/A051
	0

/6-BIT STRINGS FOR DEFARG

TECSTR,									/A051
	IFDEF ENGLSH < TEXT 'TECH' >					/A051
	IFDEF ITALIAN < TEXT 'TEC' >
	IFDEF V30NOR <TEXT 'TEKN'>
	IFDEF V30SWE < TEXT 'TEKN'>

TABSTR,
	IFDEF ENGLSH < TEXT 'TAB' >
	IFDEF ITALIAN < TEXT 'TAB' >
	IFDEF V30NOR <TEXT 'TAB'>
	IFDEF V30SWE < TEXT 'TABB'>

EOLSTR,
	IFDEF ENGLSH < TEXT 'EOL' >
	IFDEF ITALIAN < TEXT 'FRIG' >
	IFDEF V30NOR <TEXT 'SAL'>
	IFDEF V30SWE < TEXT 'SAL'>

SODSTR,
	IFDEF ENGLSH < TEXT 'SOD' >
	IFDEF ITALIAN < TEXT 'IDOC' >
	IFDEF V30NOR <TEXT 'BAD'>
	IFDEF V30SWE < TEXT 'BAD'>

EODSTR,
	IFDEF ENGLSH < TEXT 'EOD' >
	IFDEF ITALIAN < TEXT 'FDOC' >
	IFDEF V30NOR <TEXT 'SAD'>
	IFDEF V30SWE < TEXT 'SAD'>

SOLSTR,
	IFDEF ENGLSH < TEXT 'SOL' >
	IFDEF ITALIAN < TEXT 'IRIG' >
	IFDEF V30NOR <TEXT 'BAL'>
	IFDEF V30SWE <TEXT 'BAL'>

PARATR,
	IFDEF ENGLSH < TEXT 'PARA' >
	IFDEF ITALIAN < TEXT 'PARA' >
	IFDEF V30NOR <TEXT 'AVSN'>
	IFDEF V30SWE < TEXT'STYCKE'>

EOPSTR,
	IFDEF ENGLSH < TEXT 'EOP' >
	IFDEF ITALIAN < TEXT 'FPAG' >
	IFDEF V30NOR <TEXT 'SAS'>
	IFDEF V30SWE < TEXT 'SPS'>

/TABLE OF VALID COMMANDS AND SPECIAL CHARACTERS THAT CAN BE PART OF A DEFINITION

DEFVCR,	NULSTR			/CHARACTERS
	LFSTR
	FFSTR
	CRSTR
	XONSTR
	XOFSTR
	NOSSTR								/A033
	SENSTR			/COMMANDS
	WATSTR
	0

/6-BIT STRINGS FOR DEFVCR

XONSTR,
	IFDEF ENGLSH < TEXT 'XON' >
	IFDEF ITALIAN < TEXT 'XON' >
	IFDEF V30NOR <TEXT 'XON'>
	IFDEF V30SWE < TEXT 'XPA'>

XOFSTR,
	IFDEF ENGLSH < TEXT 'XOF' >
	IFDEF ITALIAN < TEXT 'XOF' >
	IFDEF V30NOR <TEXT 'XOFF'>
	IFDEF V30SWE <TEXT 'XAV'>

NULSTR,
	IFDEF ENGLSH < TEXT 'NULL' >
	IFDEF ITALIAN < TEXT 'NULL' >
	IFDEF V30NOR <TEXT 'NULL'>
	IFDEF V30SWE < TEXT 'NOLL'>

LFSTR,
	IFDEF ENGLSH < TEXT 'LF' >
	IFDEF ITALIAN < TEXT 'LF' >
	IFDEF V30NOR <TEXT 'LS'>
	IFDEF V30SWE <TEXT 'RADMATN'>

CRSTR,
	IFDEF ENGLSH < TEXT 'CR' >
	IFDEF ITALIAN < TEXT 'RIT' >
	IFDEF V30NOR <TEXT 'VR'>
	IFDEF V30SWE < TEXT 'RET'>

FFSTR,
	IFDEF ENGLSH < TEXT 'FF' >
	IFDEF ITALIAN < TEXT 'SPAG' >
	IFDEF V30NOR <TEXT 'NF'>
	IFDEF V30SWE < TEXT 'SIDMATN'>


NOSSTR,	IFDEF ENGLSH < TEXT 'NOSPACE' >					/A033
	IFDEF ITALIAN < TEXT 'NOSPAZIO' >
	IFDEF V30NOR <TEXT 'IKKE_PLASS'>
	IFDEF V30SWE <TEXT 'IKKE_PLASS'>

SENSTR,
	IFDEF ENGLSH < TEXT 'SEND' >
	IFDEF ITALIAN < TEXT 'INVIA' >
	IFDEF V30NOR <TEXT 'SENDE'>
	IFDEF V30SWE < TEXT 'SAND'>

WATSTR,
	IFDEF ENGLSH < TEXT 'WAIT' >
	IFDEF ITALIAN < TEXT 'ATTESA' >
	IFDEF V30NOR <TEXT 'VENT'>
	IFDEF V30SWE < TEXT 'VANTA'>

/TABLE OF THE CHARACTER'S ACTUAL VALUES

CHRTBL,
	0
	12
	14
	15
	XON
	XOF
	1411			/TAB CHARACTER WITH 1400 BITS FLAG SET.	/A033

	400
	1000

/THE ONLY VALID PRINT CONTROL

DCXSTR,
	IFDEF ENGLSH < TEXT 'CX' >
	IFDEF ITALIAN < TEXT 'ET' >
	IFDEF V30NOR < TEXT 'TO'>
	IFDEF V30SWE < TEXT 'TX'>

/BUFFER FOR DRDFIN THAT WILL HOLD THE INPUT LINE FROM THE DOCUMENT

RDFLIB,	ZBLOCK DRDLMX


/HERE ARE THE BUFFER FORMATS AND THE POINTERS FOR EACH BUFFER
/FORMAT:
/NEGATIVE THE MAX SIZE OF THE BUFFER
/STARTING ADDRESS OF THE BUFFER

/THIS WILL ALSO DEFINE THE OFFSETS FOR THE BUFFER INFORMATION IN THE FORM
/OF THE FIRST 3 LETTERS CORRESPOND WITH THE BUFFER AND THE NEXT 3 = BOF

	X=0

DBINFO,

/START OF TEXT BUFFER INFORMATION

	SODBOF=X
	X=X+1
	-SODMAX
	SODBUF

/START OF LINE TEXT BUFFER INFORMATION

	SOLBOF=X
	X=X+1
	-SOLMAX
	SOLBUF

/END OF LINE BUFFER INFORMATION

	EOLBOF=X
	X=X+1
	-EOLMAX
	EOLBUF

/END OF TEXT BUFFER INFORMATION

	EODBOF=X
	X=X+1
	-EODMAX
	EODBUF

/END OF PARAGRAPH

	PARAOF=X
	X=X+1
	-PARAAX
	PARAUF

/END OF PAGE INFORMATION

	EOPBOF=X
	X=X+1
	-EOPMAX
	EOPBUF

/TAB INFO

	TABBOF=X
	X=X+1
	-TABMAX
	TABBUF

/TECH CHAR INFO

	TECBOF=X							/A051
	X=X+1								/A051
	-TECMAX								/A051
	TECBUF								/A051

/Line Drawing Buffer Info						/A056
	SLDBOF=X							/A056
	X=X+1								/A056
	-SLDMAX								/A056
	SLDBUF								/A056

/Fall Back Buffer Info		
	FBKBOF=X							/A056
	X=X+1								/A056
	-FBKMAX								/A056
	FBKBUF								/A056


/*** THESE TWO BUFFERS ARE SPECIAL AND HAVE TO BE AFTER ALL THE SEND TYPE
/*** OF BUFFERS THAT DEFINE BUFFERS USED IN DEFARG

/RECEIVE INFORMATION

	RCVBOF=X
	X=X+1
	-RCVMAX
	RCVBUF

/SEND BUFFER INFORMATION

	SNDBOF=X
	X=X+1
	-SNDMAX
	SNDBUF




/THE ACTUAL BUFFERS

CX2BFA,

RECFLG,	-1			/SET TO THE CHARACTER TO MATCH ON THE INCOMING DATA
				/THAT WILL START THE RECEIVE STRING TO BE EXECUTED.

SODBUF,	-1			/1 IS THE TERMINATOR FOR ALL BUFFERS
	ZBLOCK SODMAX

SOLBUF,	-1
	ZBLOCK SOLMAX

EOLBUF,	CR
	0
	-1
	ZBLOCK EOLMAX-2

EODBUF,	-1
	ZBLOCK EODMAX

PARAUF,	12
	-1
	ZBLOCK PARAAX-1

EOPBUF,	14
	-1
	ZBLOCK EOPMAX-1

TABBUF,	11
	-1
	ZBLOCK TABMAX-1

TECBUF,	ESC			/ ESC [ pp ~  pp="27"			/M052
	"[&177								/M052
	"2&177								/M052
	"7&177								/A052
	"~&177								/M052
	-1								/A051
	ZBLOCK TECMAX-5							/M052

	/ Fake "buffer" for line drawing CX in 8 bit 			/A056

SLDBUF,	16			/Shift Out				/A056
SLDCHR,	0			/Line drawing character			/A056					
	17			/Shift In				/A056
	-1
	ZBLOCK SLDMAX-3		/					/A056	

FBKBUF,	0			/Two character fallback representation	/A056
	0			/is put in here				/A056
	-1								/A056
	ZBLOCK FBKMAX-3		/					/A056


SNDBUF,	-1
	ZBLOCK SNDMAX

RCVBUF,	-1
	ZBLOCK RCVMAX



ENDXXX=.


