/ WPCU4 - COMMAND UTILITIES VI
/
/	032	EMcD	12-Sep-85	Add Nordic translations 
/					(conditionalised)
/	031	RCME	1-MAY-85	Change DBTDOC to CU4DBT for global
/					definition and stand-alone assembly
/	030	EMcD	12-Mar-85	Save terminal as Lvl2 , 8 bit
/	029	TCW	06-SEP-84	Disable Modem if not present
/	028	TCW	21-AUG-84	Change Integral Modem response loop
/	027	TCW	25-JUL-84	Repos. cursor after disp. of CD name
/	026	TCW	16-JUL-84	Expand # of terminal modes
/	025	TCW	26-JUN-84	Change Integral Modem response loop
/	024	WCE	13-JUN-84	SUPPORT DIFERENT DRIVES FOR ACTIVATE
/	023	TCW	01-MAY-84	Integral modem support
/	022	WCE	18-JAN-84	Removed BUILD code from unbundling
/	021	GDH	 4-AUG-83	Conditionalized MNSECN for DM2.
/	020	GDH	 2-AUG-83	Fixed BC YES/NO reboot problem.
/					Fixed Date Bits 6/7 DM2 bug.
/	019	GDH	 8-APR-83	Added TM = EASYLINK to SO options.
/	018	MJS	 6-JAN-83	added a "PAGE" at "CU4ST" to enable
/					wpcu4.pa to be assembled for either
/					DECmate I or DECmate II
/
/	017	EPS	18-NOV-82	CHANGE REV LEVEL FOR EF/SD FLOPPY
/
/	016	MJS	13-OCT-82	Added a subroutine called by 'CU4GVL"
/				 	to "stuff" into panel memory
/					field 0 locations 24,25,26
/					the "terminal characteristics"
/					the user selected in "SO" menu
/					(printer & communication baud rates)
/
/	015	DFB	06-SEP-82	Fix to set CD to correct doc.
/
/	014	MJS	10-AUG-82	Added code within "CU4GVL" to init
/					the comm line (H2INIT) if the "SO"
/					values change--added "ZBLOCK CXSETZ"
/
/	013	HLP	17-JUN-82	Added GETDNS in Build activate disk
/					Conditionalized for DM-II (CONDOR)
/
/ ------------------------------------
/ | EDIT HISTORY BELOW FOR DECmate I |
/ ------------------------------------
/	012	EH	13-JAN-82	Added GETDNS before activating features
/	011	GDH	27-OCT-81	SO menu enhancements. don't erase
/					screen when not necessary.
/	010	GDH	16-OCT-81	Added 3rd TM option (DWORD).
/	009	GDH	21-Sep-81	Primary/Secondary port support.
/	008	DIM	3-SPET-81	Entered French and Dutch translations
/	007	GDH	27-Aug-81	Deleted old CIF/CDF subroutines.
/	006	TT	07-JUL-81	Removed superfluous conditionals
/	005	AJF	01-MAY-81	FIXED SO CD LOSS BUG
/	004	DIM	12-MAR-81	Changed message that appears when trying
/					to activate sort on the WS78
/	003	JM	10-MAR-81	Added CANADIAN text
/	003	JM	09-MAR-81	Added DUTCH text
/	002	JM	06-MAR-81	Added FRENCH text
/	001	WCE	17-N0V-80	ADDED CHANGES FOR FEATURE UNBUNDLING
/	X3.5	JLZ	??-???-??	Changed VT78 to VT78C
/	3.0+	MB	11-AUG-78	FOR THE 3.1 THERE WAS ENOUGH ADDED TO
/					SUPPORT THE CD OPTION THAT ANOTHER
/					COMMAND UTILITY HAD TO BE CREATED FOR
/					TIME 2 FIELDS HAVE TO BE OVERLAYED FOR
/					THIS TO WORK

/	WRITES OUT WPCU4
/
	*200
	JMP I	.+3
	JMP I	.+1
	7600
	RXLOAD
	*RXLDLS
	RXEWT=4
	RXEWT
	0
	RXQBLK=11
	RXQBLK
	.
	DLOCU4 			/ ++++
	100 			/ ++++
	CDF 20 			/ ++++
	-DSOCU4								/A001
	0

	FIELD 2
/
	*100		/ THE FIRST 100 LOCATIONS ARE USED FOR THE SYSTEM
/
CDFMYF=	CDFBUF		/ DEFINE OUR FIELD.
H2DTR=6362		/ DEFINE MODEM CONTROL IOT			/A023
/
/ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
/ !!!!!!!! o  r  d  e  r   i  m  p  o  r  t  a  n  t !!!!!!!!
/ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
/
/ THE FOLLOWING LOCATIONS ARE COPIED INTO THE MENU FIELD AND ARE
/ ASSUMED TO BE IN THE ORDER EXPECTED BY THE 'CX3' MENU.
/
CX0AD,	0 			/ DATA BITS
CX0AP,	0 			/ PARITY
CX0AS,	0 			/ STOP BITS
CX0AB,	0 			/ PRIMARY LINE BAUD RATE (0-17 OCTAL)
CX1AD,	0 			/ DATA BITS
CX1AP,	0 			/ PARITY
CX1AS,	0 			/ STOP BITS
CX1AB,	0 			/ SECONDARY LINE BAUD RATE (0-17 OCTAL)
CUPORT,	0			/ PORT SELECT.
CUBRTM,	0			/ BREAK TIME.
CUTMOD,	0			/ TERMINAL MODE
PRTBAB,	0			/ PRINTER BAUD RATE.

/
/ IF ANY ENTRIES ARE ADDED TO THIS AREA, 'CXSETZ' MUST BE ADJUSTED.
/
/ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
/ !!! E  N  D    o  r  d  e  r   i  m  p  o  r  t  a  n  t !!
/ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
	IFNZRO PRTBAB-CX0AD-CXSETZ+1 <?CXSETZISWRONG>

SAVPRI,	0		/ Saved value of MNPRIM word.			/A020
SAVSEC,	0		/ Saved value of MNSECN word.			/A020
SAVPRT,	0		/ Saved value of MNPRTB word.			/A020
SAVXON,	0		/ Saved value of MNXONF word.			/A020
SAVMOD,	0		/ Saved value of INTEGRAL MODEM BIT (MNFMAT)	/A023

IFDEF	CONDOR	< 							/A014
PRQBLK,	ZBLOCK	3		/					/a016
		>	/ END IFDEF CONDOR 				/A014

SAVDRV,	0		/ Saved value of Activate Features Drive Number	/A024


/	AXDST - WILL READ OR WRITE THE COMMUNICATIONS SETTINGS DEPENDING ON THE
/	VALUE IN THE AC.  THE AC CONTAINS THE FUNCTION TO EXECUTE.

CU4ST,	XX
	DCA	QUQBLK+RXQFNC 	/ SET THE FUNCTION

	CDFMYF
	TAD	.-1 		/ SET THE BUFFER FIELD
	DCA	QUQBLK+RXQBFD

	DCA	QUQBLK+RXQDRV	/ SET TO SYSTEM DRIVE

	TAD	(DLSVAL) 	/ SET THE BLOCK TO READ
	DCA	QUQBLK+RXQBLK

	TAD	(CU4BF1) 	/ SET THE BUFFER TO READ INTO
	DCA	QUQBLK+RXQBAD

	JMS	QURX 		/ GET THE BLOCK
	CLA

	JMP I	CU4ST

/	THIS IS THE QUEUE ROUTINE TO RXHAN.  THE REQUEST IS IN QUQBLK
/	USED BY UNBUNDLING AND SYSTEM OPTIONS

QURX,	XX			/ ENTER TO QUEUE A REQUEST TO RXHAN
	CIFSYS 			/ CHANGE TO SYSTEM FIELD
	ENQUE 			/ CAUSE REQUEST TO BE ENTERED INTO SYSTEM
	QUBLK			/ ADDRESS OF REQUEST BLOCK TO BE QUEUED

	CIFSYS 			/ CHANGE TO SYSTEM FIELD
	JWAIT			/ WAIT FOR A SIGNIFICENT EVENT
	TAD	QUQBLK+RXQCOD	/ GET THE COMPLETION CODE FROM REQUEST BLOCK
	SNA 			/ ARE WE DONE YET ?
	JMP	.-4		/ NO, GO CHECK AGAIN
	JMP I	QURX		/ YES, RETURN TO CALLER

QUBLK,	DSKQUE 			/ ADDRESS OF DISK QUEUE
	0 			/ CDF TO NEXT QUEUE ENTRY
	0			/ ADDRESS TO NEXT QUEUE ENTRY
QUQBLK,	ZBLOCK 17		/ QUEUE BLOCK

	X=.			/ LOCATION OF FIRST FREE LOCATION ON PAGE
/-----------------------
	PAGE

/	CU4OPT - THE SYSTEM OPTIONS ROUTINE.  THE REASON THAT THERE IS A CU4
/	IS THAT CU3 WAS GETTING TOO CROUDED AND THIS IS THE ONLY ROUTINE THAT
/	TOOK UP TWO FIELDS.  SO AS NOT TO SLOW DOWN THE OTHERS THEY WERE
/	SEPERATED.  WHAT SHOULD BE NOTICED IS THAT WPCX2 IS ASSEMBLED TOGETHER
/	WITH WPCU4 BUT NOT LOADED OUT WITH IT. THERE IS ONLY ONE COPY LOADED
/	OUT WITH WPCX.
/
	CU4BF1=5400 		/ TEMP BUFFER THAT CAN BE USED BY ANY OF THE
				/ RROUTINES IS CURRENTLY USED ONLY IN CU4OPT

	XX 			/ FIRST ENTRY FROM OVERLAY PROCESSOR
	JMS	CU4OPT 		/ CU4OPT - SET SYSTEMS OPTIONS
	CDIMNU 			/ SET UP FOR RETURN TO MENU FIELD
	JMP I	.-3 		/ RETURN BACK TO CALLER

IFDEF	UNBUND	<							/A001
	XX			/ SECOND ENTRY FROM OVERLAY PROCESSOR	/A001
	JMS	CU4UNB		/ CU4UNB - FEATURE UNBUNDLING OPERATION /A001
	CDIMNU 			/ SET UP FOR RETURN TO MENU FIELD	/A001
	JMP I	.-3 		/ RETURN BACK TO CALLER			/A001
		>		/ END IFDEF UNBUND			/A001

/ ROUTINE TO HANDLE THE OPTION UNBUNDLING OPERATIONS			/A001

/	CALLED BY A COMMAND CALL IN DLMDU2 IN MN1 MODULE		/A001
/
/	CALLS ACTIVATE MENU IN DLMUB1 TO DISPLAY OPTIONS AVAILABLE	/A001
/
/	RETURN FROM MENU WITH MNTMP3 SET UP TO DEFINE ACTIONS		/A001
/
/	MNTMP3 VALUES ARE:						/A001
/		0 = JUST RETURN TO MAIN MENU				/A001
/		1 = STORE OPTION SETTINGS AND RETURN TO ACTIVATE MENU	/A001
/		2 = VERIFY OPTION DISKETTE, INSTALL OPTION, AND		/M022
/		    RETURN TO ACTIVATE MENU				/A001
/

IFDEF	UNBUND	<							/A001

CU4UNB,	XX								/A001
CU4OVR,	CIFMNU								/A001
	JMS I	MNUCAL		/ CALL OPTIONS ACTIVE MENU		/A001
	DLMUB1								/A001
	CDFMNU			/ MAKE CDF INSTRUCTION FOR MENU FIELD	/A001
	TAD I	(MUBUF+MNTMP2)	/ GET ACTIVATE FEATURE DRIVE NUMBER	/A024
	DCA	SAVDRV		/ SAVE DRIVE NUMBER FOR LATER USE	/A024
	AC7776			/ SET A.C. EQUAL TO MINUS 2		/M022
	TAD I	(MUBUF+MNTMP3)	/ PICK UP TEMP 3 VALUE FROM MENU FIELD	/A001
	CDFMYF			/ MAKE DCF INSTRUCTION FOR MY FIELD	/A001
	SNA			/ TEST FOR VALUE OF TWO			/M022
	JMP	INSOPT		/ TEST FOR OPTION DISK & INSTALL OPTION /A001
	IAC			/ INCREMENT VALUE FOR NEXT TEST		/A001
	SZA CLA			/ TEST FOR VALUE OF ONE			/A001
UNBRTN,	JMP I	CU4UNB		/ ZERO VALUE - RETURN TO MAIN MENU	/A001

				/ UPDATE OPTIONS ON SYSTEM DISK		/A001
CU4WRT,	JMS	CU4SET		/ COPY SYSTEM OPTIONS AND XFER TO DISK	/A001
	JMP	CU4OVR		/ GO RETURN TO ACTIVATE MENU		/A001
		>		/ END IFDEF UNBUND			/A001

/ ROUTINE TO MOVE A BLOCK OF MENORY WITHIN THIS FIELD			/A001
/
/ CALL IS A FOLLOWS:							/A001
/
/	JMS	CU4MOV		/ CALL MOVE ROUTINE			/A001
/	ADDRESS OF FROM		/ DEFINE FROM ADDRESS			/A001
/	ADDRESS OF TO		/ DEFINE TO ADDRESS			/A001
/	NUMBER TO MOVE		/ DEFINE NUMBER OF WORDS TO MOVE	/A001
/	RETURN			/ NORMAL RETURN ADDRESS			/A001

CU4MOV,	XX								/A001
	AC7777			/ SET A.C. EQUAL TO MINUS ONE		/A001
	TAD I	CU4MOV		/ SUBTRACT ONE FROM THE FROM ADDRESS	/A001
	ISZ	CU4MOV		/ INCREMENT RETURN ADDRESS		/A001
	DCA	X0		/ STORE VALUE IN AUTOINDEXING REGISTER	/A001

	AC7777			/ SET A.C. EQUAL TO MINUS ONE		/A001
	TAD I	CU4MOV		/ SUBTRACT ONE FROM THE TO ADDRESS	/A001
	ISZ	CU4MOV		/ INCREMENT RETURN ADDRESS		/A001
	DCA	X1		/ STORE VALUE IN AUTOINDEXING REGISTER	/A001

	TAD I	CU4MOV		/ GET VALUE FOR NUMBER OF WORDS		/A001
	ISZ	CU4MOV		/ INCREMENT RETURN ADDRESS		/A001
	CIA			/ MAKE THE VALUE NEGATIVE		/A001
	DCA	X2		/ STORE VALUE IN AUTOINDEXING REGISTER	/A001

CU4MOR,	TAD I	X0		/ GET MEMORY VALUE FROM "FROM" ADDRESS	/A001
	DCA I	X1		/ STORE MEMORY VALUE IN "TO" ADDRESS	/A001
	ISZ	X2		/ INCREMENT NUMBER OF WORDS TO TRANSFER	/A001
	JMP	CU4MOR		/ NOT DONE, GO DO SOME MORE		/A001

	JMP I	CU4MOV		/ RETURN BACK TO CALLER			/A001

/ CUCOPY - ROUTINE TO COPY BLOCK OF MEMORY
/
/	JMS	CUCOPY
/	ADDR OF FROM
/	CDF FROM FIELD
/	ADDR OF TO
/	CDF TO FIELD
/	NUMBER OF WORDS TO COPY
/	RETURN, AC = 0

CUCOPY,
	0
	AC7777 			/ GET FIRST ADDR - 1 FOR INDEX REGISTER
	TAD I	CUCOPY
	ISZ	CUCOPY
	DCA	X0
	TAD I	CUCOPY 		/ AND FIELD
	ISZ	CUCOPY
	DCA	CUCPY0 		/ SAVE FOR LATER USE
	AC7777 			/ DO SAME FOR TO VALUES
	TAD I	CUCOPY
	ISZ	CUCOPY
	DCA	X1
	TAD I	CUCOPY
	ISZ	CUCOPY
	DCA	CUCPY1
	TAD I	CUCOPY
	ISZ	CUCOPY 		/ GET COUNT
	CIA 			/ MAKE ISZ COUNT
	DCA	CUCPYC 		/ AND SAVE FOR USE

CUCPYL,
CUCPY0,	.-. 			/ ACDF FOR FIRST FIELD
	TAD I	X0 		/ GET WORD
CUCPY1,	.-. 			/ ACDF FOR THE RECEIVING FIELD
	DCA I	X1 		/ STORE WORD
	ISZ	CUCPYC 		/ DONE?
	JMP	CUCPYL 		/ NO - DO NEXT WORD

	CDFMYF 			/ YES - BACK TO OUR FIELD
	JMP I	CUCOPY 		/ RETURN TO CALLER

CUCPYC,	0

IFDEF	CONDOR	<							/A016

PR3=	6236			/ panel request #3

/ SET THE USER DEFINED TERMINAL CHARACTERISTICS
/ (printer and comm baud rates)
/ SELECTIONS FROM THE "SO" MENU
/ INTO FIRMWARE PANEL MEMORY FIELD 0 LOCATIONS 24,25,26
/ THEN A "RST" (RESTORE TERMINAL CHARACTERISTICS) ESCAPE SEQUENCE (ESC c)
/ WON'T BLOW US UP

SETTC,	XX			/
	CDFMNU
	TAD I	(MUBUF+MNSECN)	/ (note that ansi mode and 80 col mode forced)
	TAD	(1200)		/ Lvl 2 8 bit also			/A030
	DCA	PRQBLK		/ terminal characteristics from "SETUP" mode
	TAD I	(MUBUF+MNPRTB)	/
	AND	(17)		/
	DCA	PRQBLK+1	/ printer baud rate
	TAD I	(MUBUF+MNPRIM)	/
	AND	(17)		/
	DCA	PRQBLK+2	/ communications baud rate
	CDFMYF
	PR3			/
	  4004			/ 40 (dest field) (source field)
	  PRQBLK		/ source address
	  24			/ destination address
	  -3			/ # of words to transfer (neg)
	  7777			/ pr3 terminator
	CLA			/ cla just in case ac is dirty from prq
	JMP I	SETTC		/ EXIT

		>		/ END IFDEF CONDOR 			/A016

/	CU4DCD - DISPAY THE CD DOCUMENT NAME

CU4DCD,	XX
	CLA
	CDFMNU
	TAD I	(MUBUF+MNCXP) 	/ SEE IF A DOCUMENT HAS BEEN DEFINED
	CDFMYF
	SNA CLA 		/ ++++
	JMP I	CU4DCD
	CIFMNU
	JMS I	IOACAL
	0
	CU4DC1
	1012
	CU4BF1+SOCDV
	CU4BF1+SOCNO
	CU4BF1+SOFAD
	2700			/ REPOS. CURSOR AT BOTTOM OF SCREEN	/A027
	JMP I	CU4DCD

CU4DC1,	TEXT '^P(!D.!D) ^A^P'	/					/M027

	X=.			/ LOCATION OF FIRST FREE LOCATION ON PAGE
/-----------------------
	PAGE

/	CU4OPT - SYSTEM OPTIONS ROUTINE
/
/	THIS IS THE ROUTINE THAT CHANGES THE SYSTEM VALUES. IT NOW ONLY DEALS WITH THE
/	COMMUNICATIONS SETTINGS OF MAGCARD, XON/XOF CONTROL IN HOST BUFFER.
/
/	WHAT IS ASUMED IS THAT THE SETTINGS DEALING WITH THE 78 WILL BE SET RIGHT AWAY
/	THAT IS IF THEY ARE LEAGAL.  WHAT IS NOT LEGAL IS TO SET THE SLU3 BAUD RATE IF
/	SET FOR A WT78.
/	THE OTHER VALUES WILL BE SET AT THE TIME THAT A COMMUNICATIONS PROGRAM IS
/	CALLED SINCE IT COULD BE A 102 SYSTEM AND EACH USER COULD HAVE DIFFERENT SE
/	SETTING FOR THEIR COMMUNICATIONS.
/
/	FIRST THE CONSTANTS THAT ARE USED.
/
/	OFFSETS USED WITH CU4BF1 WHERE THE SYSTEM OPTIONS BUFFER IS READ INTO.

	SOOPTC=MUSYSL		/ UNBUNDLING OPTIONS WORD	/M001	/C015

	SOCDV=SOOPTC+1		/ DRIVE NUMBER IN DISPLAYABLE FORMAT	/M001
	SOCNO=SOCDV+1		/ DOCUMENT NUMBER IN DISPLAYABLE FORMAT	/M001
	SOFAD=SOCNO+1		/ STARTING ADDRESS OF THE DOCUMENT'S ASCII NAME STRING /M001

/	HERE ARE THE VALUES RETURNED FROM THE SO MENUS

	CU4SO0=1 		/ GO TO THE MAIN SYSTEM OPTION MENU
	CU4GM=2 		/ GO BACK TO MAIN MENU
	CU4CD=3 		/ RETURNED FROM THE CD OPTION
	CU4CC=4

/	MISC CONSTANTS

CTLB=2			/ DEFINE CONTROL B				/A023
CR=15			/ DEFINE A <CR> CHAR				/A023


/	THE MAIN PROGRAM

CU4OPT,	XX
	JMS	CUSM 		/ SET THE MENU VALUES FOR THE DISPLAYS
	JMS	CU4MNU 		/ DISPLAY THE MENUS FOR THE SO OPTION
	JMS	CU4GVL 		/ STORE THE MENU VALUES IN PACKED FORMAT AGAIN
	JMS	CU4CPY		/ COPY OPTION SETTINGS AND XFER TO DISK	/A001
CU4OPX,	JMP I	CU4OPT

/	ROUTINE TO COPY THE COMMUNICATION AND OPTION SETTINGS TO THE	/A001
/	TEMPORARY BUFFER AND THEN TRANSFER THEM TO THE SYSTEM DISK	/A001

CU4SET,	XX								/A001
	CLA			/ MAKE SURE ACCUMULATOR IS CLEAR	/A001
		TAD	(RXERD)	/ READ COMMAND FOR QUEUING TO RXHAN	/A001
	JMS	CU4ST		/ READ SYSTEM OPTION WORDS INTO BUFFER	/A001
	JMS 	CU4CPY		/ COPY OPTIONS SETTINGS AND XFER TO DISK/A005
	JMP I 	CU4SET		/ EXIT

CU4CPY,	XX			/					/A001
	CLA			/					/A001
	JMS	CUCOPY 		/ COPY NEW VALUES FROM THE MENU AREA	/M001
	MUSYSV 			/ ++++					/M001
	CDFMNU 								/M001
	CU4BF1 			/ ++++					/M001
	CDFMYF 								/M001
	MUSYSL 								/M001

	TAD	(RXEWT) 	/ WRITE COMMAND FOR QUEUING TO RXHAN	/M001
	JMS	CU4ST 		/ TRANSFER THE SETTINGS TO DISK		/M001
	JMP I	CU4CPY		/ RETURN TO CALLER			/M005

/	CUSM - SETS THE VALUES FOR THE MENU TO BE DISPLAYED
/	THE VALUES THAT ARE SET FOR THE MENU ARE ALL VALUES PERTAINING TO SLU2 AND 3
/	IN THE VT78.  ALL VALUES ARE PACKED IN A FORM THAT CAN BE BROKEN DOWN FOR DISPLAY
/	AND USED BY THE ACTUAL SET COMMAND EASIER BUT IT MAY NOT LOOK THAT WAY.
/	ALL VALUES FOR SLU2 ARE FOUND IN PACKED FORMAT IN SLU2PM.
/
/	THE SLU3 PORT CAN ONLY HAVE THE BAUS RATE CHANGED SO THIS IS THE ONLY VALUE
/	IT CONTAINS.
/
/	FORMAT:
/	BITS		INFORMATION
/
/	11 - 8		THE CHARACTER SIZE ONLY COUNTING THE BITS IN THE
/			CHARACTER NOT PARITY OR STOP BITS
/
/	7,6		PARITY
/
/	5,4		STOP BITS
/
/	3-0		/BAUD
/
/	FORMAT FOR THE MNPRTB WORD:
/	BITS		INFORMATION
/
/	11-10		TERMINAL MODE (0=VT52, 1=VT278, 2=DECWORD52, 3=EASYLINK)
/
/	 9-6		BREAK TIME (IN TENTHS OF A SECOND).
/
/	  5		UNUSED
/
/	  4		PORT SELECT (0=PRIMARY, 1=ALTERNATE)
/
/	 3-0		PRINTER BAUD RATE.
/
/	**********************************************************

/	LIMITS - VALUES THAT ARE CHECKED FOR IN THE MENU
/
/	CHARACTER SIZE - CAN BE FROM 5 - 8
/
/	PARITY - 2 = NO PARITY, 1 = ODD, 0 = EVEN
/
/	STOP BITS - 1 OR 2 NOTE: IF SET FOR 5 FOR CHARACTER SIZE AND 1 FOR STOP
/	IT WILL AUTOMATICALLY SET FOR 1.5 STOP BITS
/
/	AND BAUD:
/
/	VALUE	BAUD
/	0	50
/	1	75
/	2	110
/	3	134.5	(MAGCARD)
/	4	150
/	5	300	(DEFAULT)
/	6	600
/	7	1200
/	10	1800
/	11	2000
/	12	2400
/	13	3600
/	14	4800
/	15	7200
/	16	9600
/	17	19200
/

/	CUSM - SETS THE VALUES FOR THE MENU TO BE DISPLAYED
/	FIRST THE VALUE MNPRIM, MNSECN AND MNPRTB HAVE TO BE BROKEN DOWN TO READABLE VALUES
/	FOR THE MENU PROGRAM THEN COPIED OVER TO MENU FIELD.  THE AREA USED FOR THE
/	VALUES IN THE MENU FIELD IS THE SAME AS THE ARE USED FOR THE PRINTER SETTINGS

CUSM,	XX			/ DISPLAY SETTINGS, AND CHANGE THEM, IF NEC.
	TAD	(CX0AD-1)	/ SET PTR TO UNPACK AREA.		/A009
	DCA	X0		/ 					/A009
	CDFMNU
	TAD I	(MUBUF+MNPRIM)	/ GET PORT 0 SETTINGS.
	CDFMYF
	DCA	SAVPRI		/ Save for later check.			/A020
	TAD	SAVPRI		/ Get primary port settings.		/A020
	JMS	CUXUPK		/ UNPACK.

IFNDEF CONDOR <								/A023
	CDFMNU			/ GET SECONDARY PORT SELECTIONS.
	TAD I	(MUBUF+MNSECN)	/  ...
	CDFMYF			/
	DCA	SAVSEC		/ Save for later check.			/A020
	TAD	SAVSEC		/ Get secondary port settings.		/A020
	JMS	CUXUPK		/ UNPACK PORT 1 SETTINGS.
	>	/ END IF NDEF CONDOR					/A023

	CDFMNU
	TAD I	(MUBUF+MNFMAT)	/ GET INTEGRAL MODEM VALUE		/A023
	AND	(MNFM4X		/ MASK IM BIT				/A023
	DCA	SAVMOD		/ SAVE					/A023
	TAD I	(MUBUF+MNXONF)	/ Get XON/XOF value.			/A020
	DCA	SAVXON		/ Save for later check.			/A020
	TAD I	(MUBUF+MNPRTB) 	/ SAME FOR PRINTER BAUD RATE
	CDFMYF
	DCA	SAVPRT		/ Save for later check.			/A020

/ (SAVPRT)= |TM TM xx|xx BT BT|xx PS BA|BA BA BA			/a016
/ THIS DEF. CHANGED FOR (026), TO EXPAND # OF TERMINAL MODES		/A026
/ (SAVPRT)= |TM TM TM|BT BT BT|BT PS BA|BA BA BA			/A026
/									/a016
/ TM=terminal mode, BT=break time, PS=port select, BA=baud rate		/a016
/ xx=don't care (or don't know)						/a016

IFNDEF	CONDOR	<							/A016
	TAD	SAVPRT
	RTR			/
	RTR			/
	AND	(1)		/
		>		/ END IFNDEF CONDOR			/A016

	DCA	CUPORT		/ SAVE PORT SELECT. (always 0 for DEcmate II)
	TAD	SAVPRT
	CLL RAL			/ SHIFT BREAK TIME OVER ONE POSITION	/A026
	BSW
	AND	(17)
	DCA	CUBRTM		/ SAVE BREAK TIME.
	TAD	SAVPRT		/
	RTL			/					/M010
/D026	RAL			/					/M010
/D026	AND	(3)		/					/M010
	RTL			/ TM IS 3 BITS NOW			/A026
	AND	(7)		/ 					/A026
	DCA	CUTMOD		/ SAVE TERMINAL MODE.
	TAD	SAVPRT
	AND	(17)
	DCA	PRTBAB		/ PRINTER BAUD RATE.

	JMS	CUCOPY
	CX0AD 			/ COPY SETTINGS TO MENU FIELD
	CDFMYF
	MUBUF+MNPROP		/ USE COMMON AREA FOR MENU COMMUNICATIONS.
	CDFMNU
	CXSETZ
	JMP I	CUSM

IFNDEF	CONDOR	<							/A014
/	CU4GVL - GETS THE VALUES FROM THE MENU FOR WT78 AND PUTS THEN
/	BACK INTO THE PACKET FORMAT.

CU4GVL,	XX
	JMS	CUCOPY
	MUBUF+MNPROP 		/ COPY SETTINGS FROM MENU BACK
	CDFMNU
	CX0AD
	CDFMYF
	CXSETZ

	TAD	(CX0AD-1)	/ SET INDEX REG.
	DCA	X0		/  ...

	JMS	CUPACK		/ PACK CX0 SETTINGS.
	CDFMNU
	DCA I	(MUBUF+MNPRIM)
	CDFMYF

	JMS	CUPACK		/ PACK CX1 SETTINGS.
	CDFMNU
	DCA I	(MUBUF+MNSECN)
	CDFMYF

	TAD	CUPORT		/CUPORT					/M010
	BSW			/ NOW DO HI BYTE.			/M010
	TAD	CUTMOD		/TERMINAL MODE				/M010
	CLL RTL								/M010
	RTL								/M010
	TAD	CUBRTM		/CUBRTM					/M010
	BSW								/M010
	TAD	PRTBAB		/PRTBAB					/M010
	CDFMNU
	DCA I	(MUBUF+MNPRTB)
	CDFMYF
	JMP I	CU4GVL
		>		/ END IFNDEF CONDOR			/A014

IFDEF	CONDOR	<							/A014
/ CU4GVL - GETS THE USER DEFINED VALUES FROM THE COMMUNICATIONS MENU

CU4GVL,	XX
	JMS	CUCOPY
	  MUBUF+MNPROP 		/ COPY SETTINGS FROM MENU BACK
	  CDFMNU
	  CX0AD
	  CDFMYF
	  CXSETZ
	TAD	(CX0AD-1)	/ SET INDEX REGISTER
	DCA	X0		/  ...
	JMS	CUPACK		/ PACK CX0 SETTINGS.
	CDFMNU
	DCA I	(MUBUF+MNPRIM)
	CDFMYF
/D021;	JMS	CUPACK		/ PACK CX1 SETTINGS.
/D021;	CDFMNU
/D021;	DCA I	(MUBUF+MNSECN)
/D021;	CDFMYF
/D026	TAD	CUPORT
/D026	BSW			/ NOW DO HI BYTE.
	TAD	CUTMOD		/ TERMINAL MODE
				/ TERMINAL MODE IS NOW 3 BITS		/A026
	CLL RTL
	RTL
	TAD	CUBRTM
/D026	BSW
	RTL			/ SHIFT OVER 5 PLACES			/A026
	RTL			/					/A026
	RAL			/					/A026
	TAD	PRTBAB
	CDFMNU
	DCA I	(MUBUF+MNPRTB)

/ IF THE "CC" VALUES OF THE COMMUNICATIONS LINE REMAIN THE SAME
/ THEN DO NOT "H2INIT"
/
/ THE "CC" VALUES COMPARED ARE FROM "CX0AD" THRU "CX0AD+10" INCLUSIVE

	TAD I	(MUBUF+MNPRIM)	/ Get new PRIMARY port settings.	/A020
	CIA			/ compare to original setting.		/A020
	TAD	SAVPRI		/  ...					/A020
	SZA;JMP CU4INI		/ Init host line if different.		/A020
/D021;	TAD I	(MUBUF+MNSECN)	/ Now check SECONDARY port settings.	/A020
/D021;	CIA			/ compare to original setting.		/A020
/D021;	TAD	SAVSEC		/  ...					/A020
/D021;	SZA;JMP	CU4INI		/ Init host line if different.		/A020
	TAD I	(MUBUF+MNXONF)	/ Check BC setting.			/A020
	CIA			/ compare to original setting.		/A020
	TAD	SAVXON		/  ...					/A020
	SZA			/					/A023
	JMP	CU4INI		/ INIT IF DIFF				/A023
	TAD I	(MUBUF+MNFMAT)	/ CK INTEGRAL MODEM SETTING		/A023
	AND	(MNFM4X		/ MASK IM BIT				/A023
	CIA			/ 					/A023
	TAD	SAVMOD		/ ORIGINAL SETTING			/A023
CU4INI,	CDFMYF			/ Map back to our field.		/A020
	SNA			/ SKIP IF DIFFERENCE IN SETTINGS	/M023
	JMP CU4IOK		/ Jmp if settings are the same.		/A020
	DCA	CU4DFF		/ SET FLAG FOR INTEGRAL MOD. CK		/A023
	CIFSYS
	H2INIT			/ COMMUNICATIONS LINE INITIALIZATION
CU4IOK,	JMS	SETTC		/ SET THE CHARACTERISTICS INTO P.M.	/A016
	JMP I	CU4GVL
		>		/ END IFDEF CONDOR 			/A014


	X=.			/ LOCATION OF FIRST FREE LOCATION ON PAGE
/-----------------------
	PAGE

CUXUPK,	XX
	DCA	T1 		/ GET SAVED SETTINGS
	TAD	T1
	BSW 			/ ++++
	RTR
	AND	(17)

IFDEF	CONDOR	<		/					/A020
	TAD	(DBMAP-5)	/ Map 5,7,6,8 to 5,6,7,8.		/A020
	DCA	T2		/  ...					/A020
	TAD I	T2		/ Voila..				/A020
		>		/ENDIF CONDOR				/A020
	DCA I	X0		/ DATA BITS.
	TAD	T1
	BSW
	AND	(3)
	DCA I	X0		/ PARITY.
	TAD	T1
	RTR 			/ ++++
	RTR
	AND	(3)
	DCA I	X0		/ STOP BITS.
	TAD	T1 		/ AND SEPARATE THEM FOR DISPLAY/MODIFY
	AND	(17)
	DCA I	X0		/ BAUD RATE.
	JMP I	CUXUPK		/ RETURN TO CALLER.

CUPACK,	XX			/ PACK CX SETTINGS INTO PACKED WORD.
	TAD I	X0		/CXAD

IFDEF	CONDOR	<		/					/A020
	TAD	(DBMAP-5)	/ Map 5,6,7,8 to 5,7,6,8.		/A020
	DCA	T2		/  ...					/A020
	TAD I	T2		/ Voila..				/A020
		>		/ENDIF CONDOR				/A020
	CLL RTL
	TAD I	X0		/CXAP
	CLL RTL
	TAD I	X0		/CXAS
	RTL 			/ ++++
	RTL
	TAD I	X0		/CXAB
	JMP I	CUPACK		/ RETURN TO CALLER.


DBMAP,	5;7;6;10		/ table to map 5,6,7,8 to 5,7,6,8	/A020

/	CU4MNU - READS IN THE BUFFER WITH THE SETTINGS TO GET THE DOCUMENT NAME
/	FOR CD OPTION IN SO THAT IS THE CX DOCUMENT TRANSFER PROTOCOL OPTION.
/	IT WILL THEN DISPLAY THE APPROPRIATE MENUS WHEN CHOSEN.  THE ONLY REALLY
/	WIERD MENU DISPLAY IS THE FIRST THAT CAN CONTAIN THE CD DOCUMENT NAME SINCE
/	THE MENU DOES THE MAJORITY OF THE DISPLAY BUT THE ROUTINE DISPLAYS THE NAME.

CU4MNU,	XX
	CLA
	TAD	(RXERD) 	/ READ COMMAND FOR THE QUEUING TO RXHAN
	JMS	CU4ST 		/ READ IT IN
	CDFMNU			/ MAP MENU FIELD.			/A011
	AC0001			/ SET REFRESH FLAG TO			/A011
	DCA I	(MUBUF+MNTMP4)	/  REFRESH THE SO MENU THE INITIAL TIME./A011
	CDFMYF			/ BACK TO US.				/A011

CU4MN1,	CIFMNU 			/ DISPLAY THE SO MENU EXCEPT THE CD DOCUMENT NAME IF ANY
	JMS I	MNUCAL
	DLMSO0
	JMS	CU4DCD 		/ DISPLAY THE NAME

	CIFMNU
	JMS I	MNUCAL 		/ HAVE MENU DO THE READ AND DISPLAY ANY SUB MENUS
	DLMSO1

	CDFMNU 			/ ++++
	TAD I	(MUBUF+MNTMP2) 	/ ++++
	CDFMYF 			/ GET THE RETURN VALUE

	TAD	(-CU4CC)	/ CK FOR "CC" MENU			/A023
	SNA			/					/A023
	JMP	CU4MCC		/ "CC" MENU IS NOW A SPECIAL CASE	/A023

	TAD	(CU4CC-CU4CD)	/ CK FOR CONTROL DOCUMENT		/A023
	SNA			/					/A023
	JMP	CU4MCD		/					/A023

	TAD	(CU4CD-CU4GM)	/ GOLD:M - IS RET TO MAIN MENU		/A023
	SNA	CLA		/					/A023
	JMP I	CU4MNU		/ PATH TO MAIN MENU			/A023

	JMP	CU4MN1		/ REDISPLAY  "SO" MENU			/A023

/	TAD	(-CU4GM) 	/ SEE IF THE VALUE RETURNED IS TO RETURN TO
/				/ MAIN MENU
/	SNA 			/ ++++
/	JMP I	CU4MNU
/	TAD	(CU4GM-CU4SO0) 	/ OR GO TO THE MAIN SYSTEM OPTION MENU
/	SNA CLA 		/ ++++
/	JMP	CU4MN1
/	AC7777 			/ SEE IF DOCUMENT HAS NO ERRORS
/				/ -1 MEANS THAT DBTDOC IS CALLED BY SO
CU4MCD,	AC7777
	CIFEDT
	JMS I	(CU4DBT)
	JMP	CU4MN5 		/ ERROR SO DONT CONTINUE

	CDFMNU 			/ ++++
	TAD I	(MUBUF+MNFNAM) 	/ ++++
	CDFMYF
	DCA	CU4MN2 		/ GET ADDRESS OF THE BUFFER THAT HAS THE NAME
				/ HERE ASSUME IT IS A SPECIAL RETURN TO SYSTEM
				/ OPTION MENU FROM THE CD SUB MENU SO THE NAME
				/ HAS TO BE UPDATED AND THE DOCUMENT CHECKED

	JMS	CUCOPY
CU4MN2,	XX 			/ COPY FILE NAME
	CDFMNU
	CU4BF1+SOFAD
	CDFMYF
	121 			/ LENGTH OF THE MNFNAM STRING

	CDFMNU 			/ ++++
	TAD I	(MUBUF+MNDRV)
	CDFMYF 			/ ++++
	DCA	CU4BF1+SOCDV 	/ GET THE DRIVE NUMBER
	CDFMNU 			/ ++++
	TAD I	(MUBUF+MNDOCN)
	CDFMYF 			/ ++++
	DCA	CU4BF1+SOCNO 	/ AND DOCUMENT NUMBER
	JMP	CU4MN1 		/ GO TO THE MAIN DISPLAY

CU4MN5,	CLA 			/ BEFORE CONTINUING ERASE THE VALID DOCUMENT FLAG
	CDFMNU 			/ ++++
	DCA I	(MUBUF+MNCXP) 	/ ++++
	CDFMYF
	JMP	CU4MN1

CU4MCC,	CIFMNU			/ MENU FIELD				/A023
	JMS I	MNUCAL		/ 					/A023
	DLMSO4			/ DISPLAY "CC" MENU			/A023

	JMS	CU4DMC		/ DO MODEM CHECK			/A023
	SZA CLA			/ RETURNS AC=0 IF OK			/A023
	JMP	CU4MCC		/ IM WILL NOT RESPOND - REDISPLAY "CC"	/A023

	CDFMNU			/					/A023
	TAD I	(MUBUF+MNTMP2)	/ FETCH RETURN VALUE FROM MENU		/A023
	CDFMYF			/					/A023

	TAD	(-CU4GM)	/					/A023
	SZA CLA			/					/A023
	JMP	CU4MN1		/ DISPLAY "SO" MENU			/A023
	ISZ	CU4MNU		/ SKIP THE JMS CU4GVL			/A023
	JMP I	CU4MNU		/ GOLD MENU RETURN			/A023



	X=.			/ LOCATION OF FIRST FREE LOCATION ON PAGE
/-----------------------
	PAGE


/ INTEGRAL MODEM SUPPORT

CU4DMC,	XX		/						/A023
	DCA	CU4DFF	/ RESET DIFFERENCE FLAG				/A023
	JMS	CU4GVL	/ COPY & COMPARE VALUES				/A023
	TAD	CU4DFF	/ HAVE SETTINGS CHANGED ?			/A023
	SNA CLA		/ 						/A023
	JMP	CU4DME	/ NO - EXIT					/A023
	CDFMNU		/ SEE IF IM IS ENABLED				/A023
	TAD I	(MUBUF+MNFMAT)	/					/A023
	CDFMYF		/						/A023
	AND	(MNFM4X	/ MASK IM BIT					/A023
	SNA CLA		/						/A023
	JMP	CU4DME	/ NO - EXIT					/A023
	JMS	CU4DSM	/ YES - FIRST ISSUE A DISABLE TO RESET MODEM	/A029
	JMS	CU4WTT	/ WAIT						/A029
	JMS	CU4ENM	/ ISSUE ENABLE					/A023
	JMS	CU4CMP	/ IS MODEM PRESENT ?				/A023
	SZA CLA		/						/A023
	JMP	CU4ME1	/ NO - GO DISABLE & EXIT			/A029
	JMS	CU4SCB	/ YES - SEND ^B					/A023
	JMS	CU4WTT	/ WAIT 						/A023
	JMS	CKMRES	/ CK FOR "READY" RESPONSE			/A023
	SNA CLA		/						/A023
	JMP	CU4DME	/ YES - EXIT					/A023
	JMS	CU4MER	/ NO - SEND ERROR MESSAGE			/A023
	AC0001		/ SET ERROR RETURN VALUE			/A023
CU4DME,	JMP I	CU4DMC	/ RETURN					/A023
CU4ME1,	JMS	CU4DSM	/ DISABLE MODEM SIGNAL				/A029
	JMP I	CU4DMC	/ RETURN					/A029
CU4DFF,	0		/ FLAG - DIFFERENCE IN COMM SETTINGS		/A023

CU4MER,	XX
	CIFMNU		/ DISPLAY ERROR MESSAGE				/A023
	JMS I 	IOACAL	/						/A023
	0		/						/A023
	CU4MET		/ TEXT STRING					/A023
	2205		/ POSITION CURSOR				/A023
	2305		/ POSITION CURSOR				/A023
CU4MEW,	JMS	CU4INC	/ WAIT FOR USER TO TYPE "RET"			/A023
	TAD	(-CR	/ 						/A023
	SZA CLA		/						/A023
	JMP	CU4MEW	/ TRY AGAIN					/A023
	JMP I CU4MER

CU4INC,	XX		/ INPUT A CHAR FROM THE KB			/A023
	JMP	C4INC2	/						/A023
C4INC1,	CIFSYS		/						/A023
	JWAIT		/						/A023
C4INC2,	CIFSYS		/						/A023
	TTYIN		/						/A023
	JMP	C4INC1	/ NOTHING RETURN				/A023
	JMP I	CU4INC	/ HAVE A CHAR - RETURN				/A023




/			CHECK MODEM RESPONSE				/A025
/			RETURNS	AC = 0 IF "Dialer Ready" RESPONSE	/A025
/				AC NOT EQUAL 0 IF NO MATCH		/A025
/
CKMRES,	XX		/						/A025
	TAD	(-22		/ MAX COUNT TO "R"			/A025
CMPLP,	DCA	T3		/					/A025
	JMS	HSINPT		/ ASK FOR CHAR				/A025
	JMP	CKMREE		/ NONE PRESENT - ERROR			/A025
	DCA	T1		/ SAVE CHAR				/A029
	TAD	T1		/					/A029
	AND	(3400		/ CK FOR TRANSMISSION ERRORS		/A029
	SZA CLA			/					/A029
	JMP	CKMREE		/ 					/A029
	TAD	T1		/					/A020
	AND	P177		/ 7 BITS				/A028
	CIA			/ CHAR PRESENT - COMPARE		/A025
	TAD	("D-200		/ UPPER CASE "D"			/A028
	SNA			/					/A025
	JMP	CMPLP1		/ FOUND - CLEAR INPUT BUFFER		/A029
	AC0001			/ NOT YET - DEC. COUNT & CK LIMIT	/A025
	TAD	T3		/ LIMIT REACHED ?			/A025
	SZA			/					/A025
	JMP	CMPLP		/ NO - CONTINUE				/A025
CKMREE,	AC0001			/ SET ERROR FLAG			/A025
	JMP I	CKMRES		/					/A025
CMPLP1,	CIFSYS			/ EMPTY INPUT BUFFER			/A029
	HS2IN			/ 					/A029
	SZA CLA			/					/A029
	JMP	CMPLP1		/ LOOP UNTIL EMPTY			/A029
	JMP I	CKMRES		/					/A029

X=.
/-----------------------------------------------------------------------

PAGE



HSINPT,	XX		/ INPUT FROM HOST INPUT BUFFER			/A023
	CIFSYS		/						/A023
	HS2IN		/						/A023
	JMP I	HSINPT	/ NOTHING RETURN				/A023
	ISZ	HSINPT	/ HAVE A CHAR - TAKE SKIP RETURN		/A023
	JMP I	HSINPT	/ 						/A023

HSOUT,	XX		/ OUTPUT CHAR TO COMM CHIP			/A023
HSOUT1,	CIFSYS		/						/A023
	HS2OU		/						/A023
	SKP		/ OUTPUT BUFFER FULL - WAIT			/A023
	JMP I HSOUT	/ CHAR GONE - RETURN				/A023
	CIFSYS		/						/A023
	JWAIT		/						/A023
	JMP	HSOUT1	/ TRY AGAIN					/A023

CU4SCB,	XX		/ SEND A ^B					/A023
	TAD	(CTLB)	/ CONTROL B CHAR				/A023
	JMS	HSOUT	/						/A023
	JMP I	CU4SCB	/						/A023

CU4CMP,	XX		/ CK FOR IM PRESENT				/A023
	CLA		/						/A023
	LAS		/ READ BITS					/A023
	AND	(4000)	/ MASK MODEM BIT				/A023
	JMP I	CU4CMP	/ 						/A023

CU4ENM,	XX		/ ENABLE INTEGRAL MODEM				/A023
	AC0003		/ SET BITS 10 & 11				/A023
	TAD	(4000)	/ MODEM BIT					/A023
	H2DTR		/ IM IOT					/A023
	CLA		/						/A023
	JMP I	CU4ENM	/						/A023

CU4DSM,	XX		/ DISABLE INTEGRAL MODEM			/A023
	AC0003		/ SET BITS 10 & 11, MODEM BIT = 0		/A023
	H2DTR		/ IM IOT					/A023
	CLA		/						/A023
	JMP I	CU4DSM	/						/A023



CU4WTT,	XX		/ WAIT 1 SECOND					/A028
	DCA	T1	/ CLEAR STORAGE					/A028
	CDFSYS		/ FETCH CLOCK VALUE				/A028
	TAD I (CLOCK+2)	/						/A028
	CDFMYF		/						/A028
	CIA		/						/A028
	DCA	T1	/ SAVE						/A028
CU4WLP,	CDFSYS		/ FETCH NEW VALUE				/A028
	TAD I (CLOCK+2)	/						/A028
	CDFMYF		/						/A028
	TAD	T1	/ COMPARE WITH OLD VALUE			/A028
	SNA CLA		/ ANY CHANGE					/A028
	JMP	CU4WJW	/ NO - JWAIT					/A028
	JMP I	CU4WTT	/ YES - RETURN					/A028

CU4WJW,	CIFSYS		/ JWAIT HERE					/A028
	JWAIT		/						/A028
	JMP	CU4WLP	/						/A028

CU4MET,
	IFNDEF V30NOR <							/A032
	TEXT '^P!E&THE &INTEGRAL &MODEM WILL'				/A023
	*.-1								/A023
	TEXT ' NOT RESPOND TO THESE SETTINGS. '				/A023
	*.-1								/A023
	TEXT '^P&PRESS !&RETURN TO CHANGE THE SETTINGS.'		/A023
	>
	IFDEF V30NOR <							/A032
	TEXT '^P!E&INTEGRALMODEMET GODTAR IKKE DISSE VERDIENE.'		/A032
	*.-1								/A032
	TEXT '^P&TRYKK P\E !&RETUR FOR \E ENDRE VERDIENE.'		/A032
	>
X=.
/-----------------------------------------------------------------------

PAGE


IFDEF	UNBUND	<							/A001

/ ACTIVATE OPTIONAL FEATURE

/ ROUTINE TO READ SPECIAL FEATURE DISKETTE AND EXTRACT OPTION WORD	/A001

/ PUT UP ACTIVATION MESSAGE AND PERFORM INITIALIZATION OPERATIONS	/A001

INSOPT,	CIFMNU			/MAKE CIF INSTRUCTION FOR MENU FIELD	/A001
	JMS I IOACAL		/CALL THE IOA DISPLAY ROUTINE		/A001
		0		/DEFAULT OUTPUT ROUTINE			/A001
		INSMNU		/ADDRESS OF "ACTIVATING FEATURE MENU" MESSAGE /A001
		0		/CURSOR POSITION TO CLEAR THE SCREEN	/A001
		23		/CURSOR POSITION TO BEGIN DISPLAY	/A001
/IFDEF	DUTCH	<160>							/A003
	TAD	INSMYF		/GET POINTER TO THIS MENORY FIELD	/M022
	DCA	QUQBLK+RXQBFD	/SET UP BUFFER FIELD IN QUEUE BLOCK	/M022
	TAD	(BLDBUF)	/GET POINTER TO BUFFER ADDRESS		/A001
	DCA	QUQBLK+RXQBAD	/SET UP BUFFER ADDRESS IN QUEUE BLOCK	/M022
	TAD	SAVDRV		/SET TO DOCUMENT DRIVE			/M024
	DCA	QUQBLK+RXQDRV	/AND STORE IT IN QUEUE BLOCK		/M022

/ GET THE DENSITY OF THE ACTIVATION DISKETTE				/A012

	TAD	(4000+RXEDN)	/GET AND SET DENSITY			/A012
	DCA	QUQBLK+RXQFNC	/FUNCTION CODE				/M022
	JMS	BLDQR0		/DO IT ....				/A012

/ READ THE ALLOCATION BLOCK						/A001

	TAD	(RXERD+4000)	/READ THE ALLOCATION BLOCK		/A001
	DCA	QUQBLK+RXQFNC						/M022
	TAD	(DLALOC)	/GET ALLOCATION BLOCK NUMBER		/A001
	DCA	QUQBLK+RXQBLK	/SET THE BLOCK COUNTER			/M022
	JMS	BLDQR0		/REQUEST THE READ			/A001

/ PERFORM VALIDATION OF ALLOCATION BLOCK				/A001

	TAD I	(BLDBUF+1)	/GET SECOND LOCATION OF ALLOC BLOCK	/A001
	TAD	(-40)		/40 MEANS DOCUMENT DISKETTE		/A001
	SZA CLA			/CHECK IF THIS IS A DOCUMENT DISKETTE	/A001
	JMP	INSERR		/NO - NOT A VALID OPTIONS DISKETTE	/A001
	TAD I 	(BLDBUF+2)	/GET THIRD LOCATION OF ALLOC BLOCK	/A001
	SZA CLA			/IS NUMBER OF FILE SYSTEM BLOCKS = 0	/A001
	JMP	INSERR		/NO - NOT A VALID OPTIONS DISKETTE	/A001

/ READ HOME BLOCK							/A001

	TAD	(DLDIR)		/LOCATION OF HOME BLOCK			/A001
	DCA	QUQBLK+RXQBLK						/M022
	JMS	BLDQR0		/REQUEST THE READ			/A001

/ ESTABLISH COMPATIBILITY OF OPTION WITH CURRENT SYSTEM REVISION LEVEL	/A001
/ BY EXTRACTING THE OPTION VERSION NUMBER FROM THE ACTIVATION DISK	/A001

	OCTAL			/SET OCTAL MODE				/A001
	TAD I	(BLDBUF+341)	/SYSTEM 278 VERSION LEVEL FOR OPTION	/A001
	DCA	T1		/SAVE FOR CURRENT USE			/A001
	TAD	T1		/GET THE VERSION LEVEL NUMBER		/A001
	BSW			/SWAP BYTES IN THE ACCUMULATOR		/A001
	AND	(77)		/MASK OF THE HIGH ORDER BITS		/A001
	TAD	(200)		/CONVERT TO ASCII VALUE			/A001
	DCA	INSVER		/STORE IN LIST FOR ERROR MESSAGE	/A001

	TAD	T1		/GET THE VERSION LEVEL NUMBER		/A001
	AND	(77)		/MASK OFF THE HIGH ORDER BITS		/A001
	TAD	(200)		/CONVERT TO ASCII VALUE			/A001
	DCA	INSREV		/STORE IN LIST FOR ERROR MESSAGE	/A001

	TAD	(SYSVER)	/GET CURRENT SYSTEM VERSION LEVEL	/A001
	AND	(77)		/MASK OFF HIGH ORDER BITS		/A001
	BSW			/MOVE TO HIGH ORDER POSITION		/A001
	MQL			/SAVE IN MQ FOR INCLUSIVE OR OPERATION	/A001
	TAD	(SYSBAS)	/GET CURRENT SYSTEM BASE LEVEL REVISION	/A001
	AND	(77)		/MASK OFF HIGH ORDER BITS		/A001
	MQA			/PERFORM INCLUSIVE OR OPERATION		/A001

	CMA CLL			/MAKE ONE'S COMPLEMENT OF VALUE FOR TEST /A001
	TAD	T1		/COMBINE WITH OPTION VERSION NUMBER	/A001
	SZL CLA			/LINK SET MEANS SYSTEM VERSION IS TOO LOW /A001
	JMP	INSLOW		/GO REPORT THE ERROR			/A001

/ EXTRACT OPTION WORD AND COMBINE WITH EXISTING OPTIONS			/A001

	TAD I	(BLDBUF+340)	/GET OPTION MASK WORD			/A001
	MQL			/SAVE IN MQ FOR INCLUSIVE OR OPERATION	/A001
	CDFMNU			/MAKE CDF INSTRUCTION FOR MENU FIELD	/A001
	TAD I	(MUBUF+MNOPTC)	/GET CURRENT OPTION WORD		/A001
	MQA			/OR IN THE OPTION MASK WORD		/A001
	DCA I	(MUBUF+MNOPTC)	/STORE NEW OPTION WORD IN MENU FIELD	/A001
INSMYF,	CDFMYF			/MAKE CDF INSTRUCTION FOR MY FIELD	/M022

/ ADD BLUFF TIME TO MAKE CUSTOMER THINK SOMETHING REALY IS ON THIS DISK	/A001

	CIFMNU			/MAKE CIF INSTRUCTION FOR MENU FIELD	/A001
	JMS I IOACAL		/CALL THE IOA DISPLAY ROUTINE		/A001
		0		/DEFAULT OUTPUT ROUTINE			/A001
		INSPRG		/ADDRESS OF "IN PROGRESS" MESSAGE	/A001
		1221		/CURSOR POSITION TO BEGIN DISPLAY	/A001

	TAD	(-20)		/SET UP FOR SIXTEEN PASSES		/A001
	DCA	T1		/USE TEMPORARY REGISTER AS COUNTER	/A001
INSOVR,	DCA	QUQBLK+RXQDRV	/SET TO SYSTEM DRIVE			/M022
	JMS	BLDQR0		/REQUEST THE READ OPERATION		/A001
	ISZ	QUQBLK+RXQDRV	/SET TO DOCUMENT DRIVE			/M022
	JMS	BLDQR0		/REQUEST THE READ OPERATION		/A001
	ISZ	T1		/INCREMENT THE COUNT			/A001
	JMP	INSOVR		/NOT DONE, GO DO SOME MORE		/A001

	JMP	CU4WRT		/GO UPDATE OPTIONS WORD ON SYSTEM DISK	/A001

INSERR,	CIFMNU			/MAKE CIF INSTRUCTION FOR MENU FIELD	/A001
	JMS I IOACAL		/CALL THE IOA DISPLAY ROUTINE		/A001
		0		/DEFAULT OUTPUT ROUTINE			/A001
		INSVAL		/ADDRESS OF "DISKETTE NOT VALID" MESSAGE /A001
		1316		/CURSOR POSITION FOR ERROR MESSAGE	/A001
	JMP	BLDERN		/GO PRINT "GOLD MENU" MESSAGE & RETURN	/A001

INSLOW,	CIFMNU			/MAKE CIF INSTRUCTION FOR MENU FIELD	/A001
	JMS I IOACAL		/CALL THE IOA DISPLAY ROUTINE		/A001
		0		/DEFAULT OUTPUT ROUTINE			/A001
		INSMS0		/ADDRESS OF TEXT CONTROL STRING		/A022
		1013		/CURSOR POSITION FOR ERROR MESSAGE	/M022
		INSMS1		/ADDRESS OF "THE FEATURE ---" MESSAGE	/M022
		1213		/CURSOR POSITION FOR ERROR MESSAGE	/M022
		INSMS2		/ADDRESS OF "WITH THIS VERSION" MESSAGE	/M022
		1413		/CURSOR POSITION FOR ERROR MESSAGE	/M022
		INSMS3		/ADDRESS OF "REQUIRES VERSION" MESSAGE	/M022
		INSVER		/ADDRESS OF VERSION NUMBER LIST		/M022
		INSMS4		/ADDRESS OF "OR LATER..." MESSAGE	/A022

	JMP	BLDERN		/GO PRINT "GOLD MENU" MESSAGE & RETURN	/A001

INSMS0,	TEXT '^P^S^P^S^P^S^A^S'	/CONTROL STRING FOR VERSION MESSAGE	/A022

INSVER,	0;".			/VERSION NUMBER FOR ERROR MESSAGE	/M022
INSREV,	0;0			/REVISION NUMBER FOR ERROR MESSAGE	/M022

	X=.			/ LOCATION OF FIRST FREE LOCATION ON PAGE
/-----------------------
	PAGE								/A001

/***************************************************************************
/***************************************************************************
/****	CAUTION - THE CODE ON THIS PAGE WAS WRITTEN SO THAT IT DOESN'T	****
/****	GENERATE ANY LITERAL OR OFF PAGE DEFINITIONS.  THIS WAS DONE	****
/****	SO THAT THE MESSAGES COULD FOLLOW THE CODE AND SAVE DISK SPACE	****
/***************************************************************************
/***************************************************************************

BLDBAK,	UNBRTN			/RETURN ADDRESS FOR TYPING GOLD MENU	/A022
BLDBEL,	7			/ASCII CODE FOR RINGING THE BELL	/A022
BLDC1,	1			/MASK VALUE OF 1			/A022
BLDC77,	77			/MASK VALUE OF 77			/A022
BLDFNR,	BLDRED			/ADDRESS OF "READ" FOR ERROR MESSAGE	/A022
BLDFNW,	BLDWRT			/ADDRESS OF "WRITE" FOR ERROR MESSAGE	/A022
BLDLIN,	EDMENU-EDNWLN		/CHECK VALUE FOR TESTING RETURN		/A022
BLDM4,	-4			/CKECK VALUE FOR TESTING BLOCK WRITE	/A022
BLDMNU,	-EDMENU			/CHECK VALUE FOR TESTING GOLD MENU	/A022
BLDOVR,	CU4OVR			/RETURN ADDRESS FOR TYPING RETURN	/A022

BLDQR0,	XX			/REQUEST A DISK FUNCTION & HANDLE ERRORS/A001
	JMS	QURX		/QUEUE THE DISK REQUEST			/M022
	SMA CLA			/WAS THERE AN ERROR ?			/M022
	JMP I	BLDQR0		/NO, WE ARE DONE, RETURN TO CALLER	/M022
				/YES, HANDLE DISK DRIVE ERROR		/M022
	TAD	QUQBLK+RXQDRV	/GET THE ERROR DRIVE NUMBER		/M022
	DCA	BLDDRV		/STORE THE ERROR DRIVE NUMBER		/A001
	TAD	BLDFNR		/GET POINTER TO READ MESSAGE		/M022
	DCA	BLDFNC		/SET UP FOR READING ERROR		/A001
	TAD	QUQBLK+RXQFNC	/CHECK TO SEE IF IT IS READING ERROR	/M022
	AND	BLDC77		/GET RID OF THE 4000			/A001
	TAD	BLDM4		/CHECK FOR A BLOCK WRITE		/M022
	SZA CLA								/M022
	JMP	BLDER1		/NO, IT WAS A READ			/M022
	TAD	BLDFNW		/GET POINTER TO WRITE MESSAGE		/M022
	DCA	BLDFNC		/SET UP FOR WRITTING ERROR		/M022

BLDER1,	CIFMNU								/M022
	JMS I	IOACAL		/THE ERROR MESSAGE			/A001
		0							/A001
		BLDERM							/A001
		520		/POSITION ON THE SCREEN ROW 5 COL.20	/A001
BLDDRV,		0		/THE DRIVE				/A001
BLDFNC,		0		/THE ADDRESS OF THE MESSAGE READ/WRITE	/A001
		QUQBLK+RXQBLK	/THE BLOCK NUMBER			/M022

/	FALL INTO RETURN ROUTINE					/M022


/***************************************************************************
/***************************************************************************
/****	CAUTION - THE CODE ON THIS PAGE WAS WRITTEN SO THAT IT DOESN'T	****
/****	GENERATE ANY LITERAL OR OFF PAGE DEFINITIONS.  THIS WAS DONE	****
/****	SO THAT THE MESSAGES COULD FOLLOW THE CODE AND SAVE DISK SPACE	****
/***************************************************************************
/***************************************************************************

BLDERN,	CIFMNU			/MAKE CIF INSTRUCTION FOR MENU FIELD	/A001
	JMS I	IOACAL		/CALL DISPLAY ROUTINE			/A001
		0		/DEFAULT OUTPUT ROUTINE			/A001
		BLDTXT		/ADDRESS OF TEXT CONTROL STRING		/M022
		2315		/CURSOR POSITION TO DISPLAY MESSAGE	/M022
		BLDRET		/ADDRESS "PRESS RETURN" MESSAGE		/M022
		2523		/CURSOR POSITION TO DISPLAY MESSAGE	/M022
		BLDGMR		/ADDRESS "PRESS GOLD MENU" MESSAGE	/M022
		2700		/MOVE CURSOR TO BOTTOM OF SCREEN	/M022

/THIS ROUTINE WILL WAIT FOR A GOLD MENU OR RETURN TO BE TYPED		/A001
/BY THE USER.  A GOLD MENU WILL CAUSE A RETURN TO THE MAIN MENU,	/A001
/AND A RETURN WILL CAUSE A RETURN TO THE ACTIVATE FEATURES MENU.	/A001
/ALL OTHER CHARACTERS WILL RING THE BELL.				/A001

	JMP	BLDWFR		/CHECK FOR CHARACTER FROM THE KEYBOARD	/A001

	CIF	0		/CHANGE TO USER FIELD ZERO		/A001
	JWAIT			/WAIT FOR SYSTEM INTERRUPT		/A001
BLDWFR,	CIF	0		/CHANGE TO USER FIELD ZERO		/A001
	XLTIN			/READ THE KEYBOARD			/A001
	JMP	.-4		/IF NOTHING TYPED THEN WAIT		/A001

	TAD	BLDMNU		/CHECK FOR A GOLD MENU			/M022
	SNA								/A001
	JMP I	BLDBAK		/A GOLD MENU TYPED - GO TO MAIN MENU	/M022
	TAD	BLDLIN		/NOW CHECK FOR A RETURN			/M022
	SNA CLA								/A001
	JMP I	BLDOVR		/RETURN WAS TYPED - GO TO ACTIVATE	/M022

/THIS ROUTINE WILL RING THE BELL IN RESPONSE TO SOME USER ERROR		/A001

	TAD	BLDBEL		/GET ASCII BELL CODE			/M022
	JMP	.+3		/SKIP OVER WAIT COMMAND			/A001
	CIF	0		/CHANGE TO USER FIELD ZERO		/A001
	JWAIT			/WAIT FOR SYSTEM INTERRUPT		/A001
	CIF	0		/CHANGE TO USER FIELD ZERO		/A001
	TTYOU			/TRY TO TYPE THE CHARACTER		/A001
	JMP	.-4		/NOT SUCCESSFUL - GO TRY AGAIN		/A001
	JMP	BLDWFR		/GO BACK FOR ANOTHER CHARACTER		/A001

BLDTXT,	TEXT '^P^S^P^S^P'	/CONTROL STRING FOR RETURN MESSAGE	/A022

/THESE ARE THE CONSTANTS AND ADDRESSES USED BY THE ERROR MESSAGE.	/A001

IFDEF	ENGLSH	<							/A002
BLDWRT,	TEXT 'WRITE'							/A001
BLDRED,	TEXT 'READ'							/A001

BLDRET,	TEXT '&PRESS !&RETURN TO RECALL THE &ACTIVATE &FEATURES &MENU, OR'
BLDGMR,	TEXT '&PRESS &GOLD !&MENU TO RECALL THE &MAIN &MENU.'		/M022

BLDERM,	TEXT '^P&ERROR ON DRIVE ^D WHILE TRYING TO ^S BLOCK !D'		/M022

INSMNU,	TEXT '^P!E^P-- &ACTIVATING &SPECIAL &FEATURE &OPTION --'	/A001
INSPRG,	TEXT '^P&ACTIVATION IN PROGRESS, PLEASE STAND BY ...'		/A001
INSVAL,	TEXT '^P&DRIVE 1 DOES NOT CONTAIN A VALID !&FEATURE DISKETTE.'

INSMS1,	TEXT '&THE FEATURE YOU ARE TRYING TO ACTIVATE IS NOT COMPATIBLE'/M022
INSMS2,	TEXT 'WITH THIS VERSION OF THE SYSTEM DISKETTE.  &THIS FEATURE' /M022
INSMS3,	TEXT 'REQUIRES VERSION '					/M022
INSMS4,	TEXT ', OR LATER, OF THE !&WPS-8 &D&E&CMATE SOFTWARE.' 		/M022
		>	/END ENGLSH					/A002

IFDEF	SPANISH	<							/A002
BLDWRT,	TEXT 'ESCRIBIR'							/A001
BLDRED,	TEXT 'LEER'							/A001

BLDRET,	TEXT '&PULSE !&RET. PARA VOLVER AL &MEN\Z DE &CHARACTER\MSTICAS,O'
BLDGMR,	TEXT '&PULSE &DOR. !&MENU PARA VOLVER AL &MENU &PRINC.'		/M022

BLDERM,	TEXT '^P&ERROR EN UNIDAD ^D MIENTRA TRATABA DE ^S BLOQUE !D'		/M022

INSMNU,	TEXT '^P!E^P-- &CARACTER\MSTICAS &ESPECIALES --'	/A001
INSPRG,	TEXT '^P&ACTIVACI\SN EN CURSO, ESPERE ...'		/A001
INSVAL,	TEXT '^P&LA UNI. 1 NO CONTIENE UN DISK. DE &CARACTER\MSTICA V\ALIDO'

INSMS1,	TEXT '&LA CARACTER\MSTICA NO ES COMPATIBLE'/M022
INSMS2,	TEXT 'CON RSTA VERSI\SN DEL DISK. SISTEMA.  &ESTA CARACTER\MSTICA'
INSMS3,	TEXT 'REQUIERE VERSI\SN '					/M022
INSMS4,	TEXT ', O POSTERIOR, DEL SOFTWARE !&WPS-8 &D&E&CMATE.' 		/M022
		>	/END SPANISH					/A002

IFDEF ITALIAN <
BLDWRT,	TEXT 'SCRITTURA'							/A001
BLDRED,	TEXT 'LETTURA'							/A001

BLDRET,	
TEXT '&PREMERE !&RITORNO PER TORNARE AL &MENU DELLE &FUNZIONI &ADDIZIONALI,'
BLDGMR,	
TEXT 'OPPURE PREMERE &ORO !&MENU PER TORNARE AL &MENU &PRINCIPALE.'	/M022

BLDERM,	TEXT "^P&ERRORE SULL'UNIT\A ^D IN ^S BLOCCO !D"		/M022

INSMNU,	TEXT '^P!E^P-- &ABILITAZIONE &FUNZIONE &ADDIZIONALE --'	/A001
INSPRG,	TEXT '^P&ABILITAZIONE IN CORSO, PREGO ATTENDERE...'		/A001
INSVAL,	TEXT "^P&L'UNIT\A 1 NON CONTIENE &FUNZIONE &ADDIZIONALE VALIDA."

INSMS1,	TEXT '&FUNZIONI &ADDIZIONALI NON COMPATIBILI'/M022
INSMS2,	TEXT 'CON LA VERSIONE ATTUALE DEL SISTEMA. &NECESSITA' /M022
INSMS3,	TEXT 'LA VERSIONE '					/M022
INSMS4,	TEXT ', O UNA SUCCESSIVA, DEL SISTEMA !&WPS-8 &D&E&CMATE.' 		/M022
	>

IFDEF	V30NOR	<						/A032	/A002
BLDWRT,	TEXT 'SKRIVE'							/A001
BLDRED,	TEXT 'LESE'							/A001

BLDRET,	TEXT '&TRYKK P\E !&RETUR FOR \E F\E MENYEN !&ACTIVERE !&FUNKSJONER, EL'
BLDGMR,	TEXT '&TRYKK P\E &GULL !&MENY FOR \E F\E &HJOVEDMENYEN.'		/M022

BLDERM,	TEXT '^P&FEIL P\E STASJON ^D VED FORS\XK P\E \E ^S BLOKK !D'	/M022

INSMNU,	TEXT '^P!E^P-- &AKTIVERING AV &SPESIALFUNKSJON --'	/A001
INSPRG,	TEXT '^P&ACTIVERING P\EG\ER.&VENT...'		/A001
INSVAL,	TEXT '^P&STASJON 1 HAR IKKE RIKTIG DISKETT FOR SPESIALFUNKSJON.'

INSMS1,	TEXT '&DEN FUNKSJONEN DU FORS\XKER \E AKTIVERRE, STEMMER IKKE.'
INSMS2,	TEXT 'OVERENS MED VERSJONEN P\E DIN SYSTEMDISKETT. &DENNE' /M022
INSMS3,	TEXT 'FUNKSJONEN FORUTSETTER VERSJON'				/M022
INSMS4,	TEXT ', ELLER NYERE , AV PROGRAMMET !&WPS-8 &D&E&CMATE .'	/M022
		>	/END V30NOR					/A002



IFDEF	DUTCH	<							/A002
BLDWRT,	TEXT 'SCHRIJVEN'						/M003
BLDRED,	TEXT 'LEZEN'						/M003

BLDRET,	TEXT '&DRUK !&RETURN OM TEREG TE GAAN NAAR HET MENU'	/M008
BLDGMR,	TEXT '&DRUK OP &GOUD !&MENU OM TERUG TE GAAN NAAR HET &HOOFDMENU.'			/M008

BLDERM,	TEXT '^P&FOUT OP AANDRIJVER ^D BIJ ^S VAN BLOK !D'		/M003

INSMNU,	TEXT '^P!E^P-- &ACTIVEREN VAN OPTIES --'	/M003
INSPRG,	TEXT '^P&BEZIG MET ACTIVEREN, EVEN GEDULD. ...'	/M003
INSVAL,	TEXT '^P&IN AANDRIJVER 1 ZIT GEEN OPTIE-DISKETTE.' /M003

INSMS1,	TEXT '&DEZE OPTIE KAN NIET WORDEN GEACTIVEERD'	/M003
INSMS2,	TEXT 'MET DEZE VERSIE VAN DE SYSTEEMDISKETTE. &DEZE OPTIE'	/M003
INSMS3,	TEXT 'VEREIST VERSIE '							/M003
INSMS4,	TEXT ' OF EEN LATERE VERSIE VAN !&WPS-8 &D&E&CMATE.'		/M003
		>		/END DUTCH				/A002

BLDBUF,	ZBLOCK	400							/A001

BLDEND=.			/LAST LOCATION USED THIS FIELD		/A001

		>		/END IFDEF UNBUND			/A001

XLIST



