/ WPCU2 - COMMAND UTILITIES II FLAGGED ESCAPE SEQUENCES

/	043	Mart	08-jul-85	warm restart on return from GRAPHICS
/					to restore PANEL etc
/	042	EMcD	06-Mar-85	Save term as 8bit Lvl 2
/	041	TCW	06-SEP-84	Disable Modem if not present
/	040	DFB	31-AUG-84	FIX TO AUTO CALL VERIFY AT WARM STARTUP
/	039	TCW	27-AUG-84	Change to Integral Modem init. routine
/	038	WCE	23-AUG-84	ADD CHECKS FOR DMI SYSTEM - NO PRQ'S
/					REORGANIZED WPCU2 LAYOUT
/	037	WCE	20-AUG-84	CHANGES FOR NEW RD MENU VALUES
/	036	DFB	18-AUG-84	FIX FIX TO AUTO CALL VERIFY
/	035	DFB	08-AUG-84	FIX TO AUTO CALL VERIFY AT WARM STARTUP
/	034	DFB	07-AUG-84	FIX TO DATE FOR MASTER MENU VER 1.0
/	033	JAC	05-JUL-84	FIX UP F11 FOR TECH CHARS
/	032	DFB	02-JUL-84	DATE FORMAT SUPPORT FROM MASTER MENU
/	031	TCW	29-JUN-84	CLOCK ADJUSTMENT FOR #030
/	030	TCW	26-JUN-84	INTEGRAL MODEM SUPPORT
/	029	JAC	19-JUN-84	100 UDK DEVELOPMENT
/	028	WCE	06-JUN-84	CHANGES FOR BRITISH DATE & CURRENCY
/	027	TCW	02-MAR-84	INIT. COMM LINE ON WARM BOOT
/
/	WRITES OUT WPCU2
/
/ ** NOTE -- WPEDIT USES THIS OVERLAY, AND KNOW ABOUT ITS LENGTH AND ENTRIES **
/
	*200			/ START ADDRESS USED BY OS8 "GO" COMMAND
	JMP I	.+3		/ LOCATION USED TO START UP RXHAN
	JMP I	.+1		/ LOCATION USED TO RETURN TO OS8 MONITOR
	7600			/ ADDRESS OF OS8 MONITOR RETURN POINT
	RXLOAD			/ ADDRESS OF START LOCATION FOR RXHAN

	*RXLDLS			/ ADDRESS WITHIN RXHAN TO OVERLAY
	RXEWT			/ WRITE FUNCTION CODE
	0
	RXQBLK			/ ADDRESS OF QUEUE BLOCK TO USE
	.			/ ADDRESS OF TABLE OF DISK COMMANDS

	DLOCU2			/ DISK BLOCK TO WRITE
	0			/ STARTING AT MEMORY ADDRESS
	CDF 20			/ IN THIS FIELD
	-DSOCU2			/ FOR THIS MANY DISK BLOCKS
	0			/ END OF LIST INDICATOR


	CU2FLD=	4		/ CU2 FIELD (THIS FIELD)		/A032
	PMFLD=	6		/ PANEL MEMORY FIELD=6			/A032
	WRPMEM=	4000		/ WRITE PANEL MEM FRM MAIN (40XY)Y=INPUT FLD /A032
	RDPMEM=	5000		/ READ PANEL MEM. TO MAIN (50XY)Y=INPUT FLD /A032
	CDFMYF=	CDFBUF		/ DEFINE INSTRUCTION TO RETURN TO THIS FIELD
	CLKSK2=	6131		/ DECMATE II CLOCK IOT
	PRQ3=	6236		/ COMMAND CODE				/A032
	H2DTR=	6362		/ DEFINE MODEM CONTROL REG. IOT		/A030
	PMDATE=	7600		/ PANEL MEMORY DATE LOCATION		/A032
	PMSIGN=	PMDATE+143+6	/ LOC OF SIGNATURE IN P.M. (ALLOW FOR TIME) /A032
	DTLEN=	-10		/ -LENGTH OF DATE FIELD"MM/DD/YY"	/A032

/D038	SIGNAT=	-7531		/ -SIGNATURE FOR MASTER MENU		/A032
/D038	SLASH=	257		/ ASCII SLASH				/A032
/D038	PR3=	6236		/ PANEL MEMORY REQUEST SEQUENCE #3

	FIELD 2			/ FIELD TO ASSEMBLE THIS CODE INTO

	*76			/ LOCATION OF TEMP REGISTER NUMBER TWO (T2)
CUDTMP,	0			/ LOCATION FOR INTERNAL DATA VERSION	/A037
	0			/ LOCATION FOR INTERNAL ROM  VERSION	/A037

	*100			/ FIRST 100 LOCATIONS ARE USED FOR THE SYSTEM

CUDEXM,	-EXPMN			/ SOFTWARE EXPIRATION MONTH		/A038
CUDEXY,	-EXPYR			/ SOFTWARE EXPIRATION YEAR		/A038

CUDSYR,	0
CUDSMO,	0
CUDSDY,	0
CUDSMN,	0
CUDSHR,	0

F1DATE,	ZBLOCK 2		/ DATE FIELD 1				/A032
	"/			/ ASCII CODE FOR A "/"			/A032
F2DATE,	ZBLOCK 2		/ DATE FIELD 2				/A032
	"/			/ ASCII CODE FOR A "/"			/A032
F3DATE,	ZBLOCK 2		/ DATE FIELD 3				/A032

CUDFM4,	MNFM4X			/ INTEGRAL MODEM BIT			/A038
CUDC7,	7			/ CONSTANT VALUE OF 7			/A038
CUDTP1, MUBUF+MNTMP1		/ LOCATION OF MNTMP1 IN MENU FIELD	/A038
CUDFMT,	MUBUF+MNFMAT		/ LOCATION OF MNFMAT IN MENU FIELD	/A038
CUDONL,	CMONLN			/ LOCATION OF COM ON LINE FLAG WORD	/A038
CUDDMT,	DAMNTH			/ LOCATION OF DAY OF MONTH IN SYS FIELD	/A038
CUDMTH,	MONTH			/ LOCATION OF MONTH VALUE IN SYS FIELD	/A038
CUDEAR,	YEAR			/ LOCATION OF YEAR VALUE IN SYS FIELD	/A038
CUDERD,	RXERD			/ DISK HANDLER READ FUNCTION CODE	/A038
CUDEWT,	RXEWT+2000		/ DISK HANDLER WRITE FUNCTION CODE	/A038
CUDFOW,	CUDBUF+MNOPTC-MNABRV	/ LOCATION OF MNOPTC FEATURE OPTION WORD/A038

VFYNUM,	14			/ OVLAY NUMBER FOR VERIFY		/A035
VFYADR,	200			/ START ADDRESS OF VERIFY		/A035
VFYFLD,	CIF	10		/ VERIFY FIELD -2			/A035

/ ******************************* ORDER IMPORTANT ***********************
PRQBLK,
XSETUP,	MUBUF+MNSECN
XPBAUD,	MUBUF+MNPRTB
XCBAUD,	MUBUF+MNPRIM
/ ******************************* END ORDER IMPORTANT *******************


QURX,	XX
	CIFSYS			/ CHANGE TO SYSTEM FIELD
	ENQUE			/ CAUSE QUEUE BLOCK TO BE ENQUEUED
	QUBLK			/ ADDRESS OF QUEUE BLOCK

	CIFSYS			/ CHANGE TO SYSTEM FIELD
	JWAIT			/ WAIT FOR A SIGNIFICENT EVENT
	TAD	QUQBLK+RXQCOD	/ PICK UP THE COMPLETION CODE
	SNA CLA			/ TEST AND CLEAR COMPLETION CODE	/M028
	JMP	.-4		/ IF ZERO, GO WAIT SOME MORE
	JMP I	QURX		/ DONE, RETURN TO CALLER

QUBLK,	DSKQUE			/ ++++
	0			/ ++++
	0
QUQBLK,	ZBLOCK 17

	X=.			/ INDICATE FIRST FREE LOCATION ON PAGE
/--------------------
	PAGE

/***************************************************************************
/****			OVERLAY ENTRY POINT NUMBER ONE			****
/***************************************************************************

CUDRST,	XX			/ LABEL ADDED FOR WARM RESTART		/A035
	JMS	CUDSET		/ CUDSET - SETS DATE/TIME
	CDIMNU			/ CIF CDF MENU FIELD
	JMP I	.-3

/***************************************************************************
/****			OVERLAY ENTRY POINT NUMBER TWO			****
/***************************************************************************

	XX			/ CUAK - ACTIVATE UDKS (YES/NO)
/D038	JMS	CUAK		/ WS-78 FUNCTION NO LONGER EXISTS
/D038	.-.
/D038	JMP I	.-3
	HLT			/ NOBODY SHOULD BE CALLING THIS ENTRY	/A038
	JMP	.-1		/ DO NOT ALLOW USER TO CONTINUE		/A038
	JMP	.-2		/ USED TO PRESERVE SPACE TILL NEXT CALL	/A038

/***************************************************************************
/****			OVERLAY ENTRY POINT NUMBER THREE		****
/***************************************************************************

CUFINI,	XX			/ CUFINS - FINISH COMMAND
	JMP	CUFINS							/C038
CUFINX,	CDIMNU			/ RETUNR TO CALLER			/C038
	JMP I	.-3

/***************************************************************************
/****			OVERLAY ENTRY POINT NUMBER FOUR			****
/***************************************************************************

	XX			/ CUWOUD - WRITE OUT SYS VALUES BLOCK
/D029	JMS	CUWOUD
/D038	CLA			/ DON'T DO *ANYTHING* (WAS JMS CUWOUD)	/C029
/D038	CDIMNU			/ CUWOUD NO LONGER EXISTS		/C029
/D038	JMP I	.-3		/ CALL TO THIS VECTOR IS UNKNOWN	/C029
	HLT			/ NOBODY SHOULD BE CALLING THIS ENTRY	/A038
	JMP	.-1		/ DO NOT ALLOW USER TO CONTINUE		/A038

/	CUFINS - FINISH COMMAND

CUFINS,	CIFMNU			/ ++++					/C038
	JMS I	MNUCAL		/ CALL MENU FOR RETURN PRESSING
	DLMFN1

	ISZ	CUFINI		/ SET FOR CHAIN CALL
	JMP 	CUFINX		/ DO IT					/C038


/ CUDPUT - SUBROUTINE TO UPDATE THE SYSTEM OPTIONS AREA ON DISK AFTER	/A028
/ THE DATE AND TIME MENU.  THIS ROUTINE IS ACTUALLY ONLY USED ONCE TO	/A028
/ SAVE THE VALUE OF MNFMAT SO THAT THE STARTUP MENU IS ONLY USED ONCE.	/A028

CUDPUT,	XX			/ SAVE THE VALUE OF MNFMAT IF NEEDED	/A028
	TAD	(-CUDTST)	/ PICK UP TEST ADDRESS			/A028
	TAD	QURX		/ COMBINE WITH LAST QURX CALL		/A028
	SZA CLA			/ CHECK TO SEE IF WE JUST READ IN VALUES/A028
	JMP I	CUDPUT		/ NO, THEN RETURN TO CALLER		/A028

	TAD	CUDBUF+MNFMAT-MNABRV	/ PICK UP THE VALUE FROM DISK	/A028
	AND	(3)		/ MASK OFF THE DATE FORMAT BITS		/A028
	SZA CLA			/ CHECK IF THEY HAVE BEEN INITIALIZED	/A028
	JMP I	CUDPUT		/ YES, THEN RETURN TO CALLER		/A028

	JMS	CUCOPY		/ TRANSFER SYSTEM WORDS TO BUFFER	/A028
	    MUSYSV		/ START OF SYSTEM VALUES		/A028
	    CDFMNU		/ FIELD WHERE THEY RESIDE		/A028
	    CUDBUF		/ OUR BUFFER TO USE			/A028
	    CDFMYF		/ OUR FIELD				/A028
	    MUSYSL		/ LENGTH OF SYSTEM VALUES AREA		/A028
	TAD	CUDEWT		/ PICK WRITE FUNCTION CODE		/C038
	DCA	QUQBLK+RXQFNC	/ STORE FUNCTION CODE IN QUEUE BLOCK	/A028
	JMS	QURX		/ TRANSFER VALUES TO DISK		/A028
	JMP I	CUDPUT		/ RETURN TO CALLER			/A028


/ ROUTINE TO CHECK FOR A DECMATE I DEVELOPMENT SYSTEM			/A038

DM1TST,	XX			/ CHECK FOR DECMATE I DEVELOPMENT SYSTEM /A038
	CDFSYS			/ CHANGE TO SYSTEM FIELD		/A038
	TAD I	(XCLKSKP)	/ PICK UP THE CLOCK IOT			/A038
	CDFMYF			/ RESET BACK TO THIS FIELD		/A038
	TAD	(-CLKSK2)	/ COMBINE WITH DECMATE II CLOCK IOT	/A038
	SZA CLA			/ IS THIS A DECMATE II SYSTEM ?		/A038
	ISZ	DM1TST		/ NO, BUMP RETURN ADDRESS		/A038
	JMP I	DM1TST		/ YES, RETURN TO CALLER			/A038

IFDEF	CONDOR	<
RSTCON, TEXT '![C'		/ ISSUE AN ESCAPE "c" RESET COMMAND	/C038
/D038	RSTESC, ESC; "c; 0
		>		/ END IFDEF CONDOR


/ INTEGRAL MODEM SUPPORT						/A030
/ ISSUE ENABLE - CK FOR HARDWARE PRESENT AND AUTO BAUD IF TRUE		/A030


IMINIT,	XX			/					/A030
	TAD	(4003)		/ ENABLE BITS				/A030
	H2DTR			/ IOT - TURN MODEM ON			/A030
	JMS	IMWAIT		/ WAIT FOR MODEM TO INIT ITSELF		/A030

	LAS			/ SEE IF ITS PRESENT			/A030
	AND	(4000)		/ MODEM PRESENT BIT			/A030
	SZA CLA			/ BIT <0> = 0 IF PRESENT		/A030
	JMP	IMINTE		/ NOT PRESENT - GO DISABLE		/A041

IMINTL,	CIFSYS			/ CLEAR INPUT BUFFER			/A039
	HS2IN			/					/A039
	SZA CLA			/ SKIP WHEN EMPTY			/A039
	JMP	IMINTL		/ LOOP UNTIL EMPTY			/A039

	AC0002			/ SEND A ^B TO AUTO-BAUD		/A039
	CIFSYS			/					/A030
	HS2OU			/					/A030
	CLA			/ BUFFER SHOULD HAVE ROOM		/A030
	JMP I	IMINIT		/					/A030

IMINTE,	AC0003			/ DISABLE MODEM				/A041
	H2DTR			/					/A041
	CLA			/ AC MUST BE CLEARED			/A041
	JMP I	IMINIT		/					/A041

IMWAIT,	XX			/ WAIT HERE  1 SEC.			/A030
	CLA			/					/A030
	DCA	T1		/ CLEAR STORAGE				/A030

	CDFSYS			/ FETCH CLOCK VALUE			/A030
	TAD I	(CLOCK+2)	/					/A031
	CDFMYF			/					/A030
	CIA			/					/A030
	DCA	T1		/ SAVE					/A030

IMWTLP,	CDFSYS			/ FETCH NEW VALUE			/A030
	TAD I	(CLOCK+2)	/					/A031
	CDFMYF			/					/A030
	TAD	T1		/ COMPARE WITH OLD VALUE		/A030
	SZA CLA			/ ANY CHANGE ?				/A030
	JMP I	IMWAIT		/ YES - RETURN				/A030

IMWJW,	CIFSYS			/ NO - JWAIT HERE			/A030
	JWAIT			/					/A030
	JMP	IMWTLP		/ 					/A030

/D038	CUAK,	XX		/ ACTIVATE/DEACTIVATE UDKS
/D038		RDF		/ ++++
/D038		TAD	CIDF0	/ GET RETURN FIELD
/D038		CDFMYF		/ ++++
/D038		DCA I	CUAK	/ STORE IN CALL SEQUENCE
/D038		JMP I	CUAK
/D038	/THIS CODE WAS PUT IN FOR FIELD TEST PURPOSES SO THAT SOFTWARE PUT OUT FOR
/D038	/FIELD TEST IS NOT AROUND FOREVER.
/D038	CHKDAT,	CDFSYS			/ CHANGE TO SYSTEM FIELD
/D038		TAD I	(YEAR)		/ GET YEAR INPUT
/D038		TAD	(-EXPYR)	/ GET EXPIRATION YEAR
/D038		SMA SZA			/ YEAR BEYOND LIMIT?
/D038		JMP	CHKDT2		/ YES, CLOBBER DISKETTE
/D038		SZA CLA			/ TIME OUT YEAR?
/D038		JMP	CHKDT1		/ NO, MUST BE EARLIER, OK, EXIT
/D038		TAD I	(MONTH)		/ NO, EXPIRATION YEAR, CHECK MONTH
/D038		TAD	(-EXPMN)	/ GET EXPIRATION MONTH
/D038		SPA CLA			/ OK?
/D038	CHKDT1,	JMP	CUDXIT		/ YES, EXIT
/D038	CHKDT2,	CDFMYF			/ NO, TIME TO CLOBBER DISKETTE
/D038		DCA	QUQBLK+RXQBAD	/ SET BUFFER ADDRESS TO 0 (OR CLOSE TO IT)
/D038		DCA	QUQBLK+RXQDRV	/ SET DRIVE TO 0
/D038		TAD	CDF0
/D038		DCA	QUQBLK+RXQBFD	/ SET FIELD OF BUFFER TO 0
/D038		TAD	(RXEWT+2000)
/D038		DCA	QUQBLK+RXQFNC	/ SET FUNCTION TO WRITE
/D038		DCA	QUQBLK+RXQBLK	/ SET BLOCK NUMBER TO 0
/D038		JMS	QURX		/ CLOBBER BOOT BLOCK
/D038		JMP	CUDXIT		/ EXIT, NEXT TIME SYSTEM WILL NOT BOOT


	X=.			/ INDICATE FIRST FREE LOCATION ON PAGE
/--------------------
	PAGE

/D038	CUDSET,	XX
/D037		CDFMNU
/D038		JMS	CUDVAL		/ SET UP MENU VALUES, BACK WITH DF=MENU	/A037
/D038		TAD I	(MUBUF+MNTMP1)	/ FROM START MENU? OR MAIN MENU?
/D038		CDFMYF
/D038		SPA CLA
/D037		JMP	CUDCHG		/ RD, JUST CHANGE TIME/DATE
/D038		JMP	CUDLUP		/ MAIN MENU, CALL TIME/DATE MENU	/A037
/D038		DCA	QUQBLK+RXQDRV	/ SET SYSTEMS DRIVE TO READ UDK'S
/D038		TAD	(RXERD)
/D038		DCA	QUQBLK+RXQFNC
/D029		TAD	(DLUDKS)
/D029		DCA	QUQBLK+RXQBLK
/D029		TAD	(UDKSTR)
/D029 		DCA	QUQBLK+RXQBAD
/D029 		TAD	(CDFMNU)
/D029 		DCA	QUQBLK+RXQBFD
/D029 		JMS	QURX		/ READ THEM IN
/D029 		CDFMNU
/D029 		DCA I	(UDKPTR)	/ MAKE SURE UDK STACK PTR IS EMPTY
/D038		CDFSYS								/A029
/D038		DCA  I	(U1STPT)						/A029
/D038		CDFMYF
/D038		CIFSYS			/ ++++
/D038		UDKOPS			/ TURN ON UDK'S
/D038		TAD	(DLSVAL)
/D038		DCA	QUQBLK+RXQBLK
/D038		TAD	CUDBAD		/ PICK UP POINTER TO BUFFER AREA	/M037
/D038		DCA	QUQBLK+RXQBAD
/D038		TAD	CUDMYF		/ PICK UP CDF INSTRUCTION TO THIS FIELD	/M028
/D038		DCA	QUQBLK+RXQBFD
/D038		JMS	QURX		/ READ IN SYSTEM VALUES
/D038	CUDMOV,	JMS	CUCOPY		/ TRANSFER THEM
/D038	CUDBAD,	    CUDBUF		/ BUFFER ADDRESS			/M037
/D038	CUDMYF,	    CDFMYF							/M028
/D038		    MUSYSV		/ ++++
/D038		    CDFMNU
/D038		    MUSYSL
/D038		JMS	CUDOPT		/ SET UP UNBUNDLING OPTIONS WORD
/D038	/ SET JSWAP IN DSKHND LOCATION RDOSWP AFTER PROPER INITIALIZATION
/D038		CDFSYS
/D038		TAD	(JSWAP)
/D038		DCA	RDOSWP
/D038	IFDEF WINNIE	<
/D038	/ SET JSWAP IN DSKHND LOCATION RDOSWQ AFTER PROPER INITIALIZATION
/D038		TAD	(JSWAP)
/D038		DCA	RDOSWQ
/D038			>		/ END IFDEF WINNIE
/D038		CDFMYF			/					/A027
/D038		IFDEF CONDOR	<
/D038		JMS	DTFRMT		/FORMAT DATE				/A032
/D038		AC0001			/SET SLUSHWARE FOR DECmate MODE		/A033
/D038		PR3			/ISSUE PANEL REQUEST TO SLUSHWARE	/A033
/D038		10			/FUNCTION CODE ARGUMENT			/A033
/D038		7777			/END OF LIST INDICATOR			/A033
/D038		CLA			/SAFETY CLEAR THE SLATE			/A033
/D038			>		/END IFDEF CONDOR			/A032
/D038	/ ****** DO THE COMM LINE INIT ON A WARM BOOT				/A027
/D038	IFDEF	CONDOR	<
/D038		CIFSYS
/D038		H2INIT			/ NO, INIT COMM LINE AND
/D038		JMS	INITTC		/ INITIALIZE TERMINAL CHARACTERISTICS
/D038		CIFMNU
/D038		JMS I	IOACAL		/
/D038		  0			/
/D038		  RSTCON		/ ^A
/D038		  RSTESC		/ "ESC c"
/D038	/ ****** CHECK FOR INTEGRAL MODEM ENABLED 				/A030
/D038	
/D038		CDFMNU			/ SEE IF ITS ENABLED IN SYS AREA	/A030
/D038		TAD I	(MUBUF+MNFMAT)	/					/A030
/D038		CDFMYF			/					/A030
/D038		AND	(20)		/ INTEGRAL MODEM BIT			/A030
/D038		SZA CLA			/ SKIP IF DISABLED			/A030
/D038		JMS	IMINIT		/ ENABLE AND AUTO-BAUD IF PRESENT	/A030
/D038			>		/ END IFDEF CONDOR
/D038		CDFSYS			/ SYSTEM DATA FIELD			/A027
/D038		TAD I	(DAMNTH)	/ SEE IF ANYONE SET THE DATE YET
/D038		CDFMYF
/D038		SZA CLA			/ ON ACP ERROR IS SET TO - FOR WARM START /C036
/D038		JMP	CUDWRM		/ WARM STARTUP..CALL VERIFY		/C035
/D038	CUDLUP,	CIFMNU			/ CALL DATE/TIME MENU
/D038		JMS I	MNUCAL
/D038		DLMSM0								/M037
/D038		JMS	CUDPUT		/ ONCE ONLY CALL TO SAVE MNFMAT		/A028
/D038		TAD  (MNDTYR-1+MUBUF)	/ SET UP X0 TO GET YEAR, ETC.
/D038		DCA	X0
/D038		CDFMNU
/D038		TAD I	X0		/ GET VALUES AND SAVE HERE
/D038		DCA	CUDSYR
/D038		TAD I	X0
/D038		DCA	CUDSMO
/D038		TAD I	X0
/D038		DCA	CUDSDY
/D038		TAD I	X0
/D038		DCA	CUDSHR
/D038		TAD I	X0
/D038		DCA	CUDSMN
/D038		CDFMYF
/D038		TAD	CUDSDY
/D038		SPA CLA			/ DON'T CHANGE IF NEGATIVE
/D038	IFDEF	FLDTST	<JMP	CUDLUP>	/ IF FIELD TEST, DON'T ALLOW NO INPUT
/D038	IFNDEF	FLDTST	<JMP	CUDSND>	/ IF NOT FIELD TEST, ALLOW NO INPUT
/D038		TAD	CUDSDY
/D038		CDFSYS
/D038		DCA I	(DAMNTH)
/D038		TAD	CUDSMO
/D038		DCA I	(MONTH)
/D038		TAD	CUDSYR
/D038		DCA I	(YEAR)
/D038		CDFMYF
/D038		JMS	FIXDAT
/D038	CUDSND,	TAD	CUDSHR		/ DO WE CHANGE TIME?
/D038		SPA CLA
/D038		JMP	CUDCHK		/ NO - JUST RETURN
/D038		CDFSYS
/D038		TAD	(CLOCK)		/ ++++
/D038		DCA	X0
/D038		DCA I	X0		/ TENTHS
/D038		DCA I	X0		/ SECONDS
/D038		TAD	CUDSMN		/ ++++
/D038		DCA I	X0		/ MINUTES
/D038		TAD	CUDSHR		/ ++++
/D038		DCA I	X0		/ HOURS
/D038	CUDCHK,
/D038	IFDEF	FLDTST	<JMP	CHKDAT>	/ CHECK DATE ENTERED IF FIELD TEST
/D038	IFNDEF	FLDTST	<JMP I	CUDSET>	/ RETURN IF NOT FIELD TEST
/D038	CUDXIT,	JMP I	CUDSET		/ YES, BACK TO MAIN MENU

/	CUDSET - SETS DATE/TIME

CUDSET,	XX
	JMS	DM1TST		/ CHECK FOR DECMATE I DEVELOPMENT SYSTEM/A038
	JMS	CUDVAL		/ NO, SET UP DECMATE II MENU VALUES	/A037

	CDFMNU			/ SET DATA FIELD TO MENU FIELD
	TAD I	CUDTP1		/ FROM START MENU? OR MAIN MENU?	/C038
	CDFMYF			/ MAIN MENU SETS VALUE TO -1
	SPA CLA			/ START MENU SETS VALUE TO +1
	JMP	CUDLUP		/ MAIN MENU, CALL TIME/DATE MENU	/C037

	JMS	CUDOPT		/ READ SYSTEM VALUES & SET OPTIONS WORD	/C038

/ SET JSWAP IN DSKHND LOCATION RDOSWP AFTER PROPER INITIALIZATION
	CDFSYS
	TAD	(JSWAP)
	DCA	RDOSWP

	IFDEF	WINNIE	<
/ SET JSWAP IN DSKHND LOCATION RDOSWQ AFTER PROPER INITIALIZATION
	TAD	(JSWAP)
	DCA	RDOSWQ
			>	/ END IFDEF WINNIE
	CDFMYF			/					/A027

	IFDEF	CONDOR	<
	JMS	DM1TST		/ CHECK FOR DECMATE I DEVELOPMENT SYSTEM/A038
	JMS	DM2INT		/ NO, GO INITIALIZE DECMATE II VALUES	/A037

/ ****** DO THE COMM LINE INIT ON A WARM BOOT				/A027

	CIFSYS
	H2INIT			/ INIT COMM LINE

/ ****** CHECK FOR INTEGRAL MODEM ENABLED 				/A030

	CDFMNU			/ SEE IF ITS ENABLED IN SYS AREA	/A030
	TAD I	CUDFMT		/ PICK UP VALUE OF MNFMAT		/C038
	CDFMYF			/					/A030
	AND	CUDFM4		/ INTEGRAL MODEM BIT			/C038
	SZA CLA			/ SKIP IF DISABLED			/A030
	JMS	IMINIT		/ ENABLE AND AUTO-BAUD IF PRESENT	/A030
			>	/ END IFDEF CONDOR

/ CHECK FOR POSSIBLE ERROR ENTRY FROM A DISK HANDLER FAILURE		/A027

	CDFSYS			/ SYSTEM DATA FIELD			/A027
	TAD I	CUDDMT		/ SEE IF ANYONE SET THE DATE YET	/C038
	CDFMYF
	SNA			/ ON ACP ERROR IS SET TO - FOR WARM START /C036
	JMP	CUDLUP		/ COLD STARTUP..CALL START UP MENU	/C035
	SMA CLA			/ CHECK FOR "F" COMMAND			/A036
	JMP I	CUDSET		/ YES, RETURN WITH CLEAN ACCUMULATOR	/A036
				/ NO, WARM START ERROR			/A036

/ WARM START ROUTINE TO SET UP OVERLAY TO CALL VERIFY			/A035

	CDFSYS								/A036
	TAD I	CUDDMT		/ GET DAY OF WEEK VALUE			/C038
	CMA			/ WARM START SET ON ERROR IN DSKACP	/A036
	DCA I	CUDDMT		/ RESET FOR DISLPAY			/C038
	TAD I	(SVFVFY-CLOCK+RANDOM	/LOCATION PARAMETER PASSED FROM	/A040
	SNA			/ test for graphics restart		/a043
	JMP	CUDGRE		/ go exit				/a043
	CDFMNU								/A035
	DCA I	(MUBUF+MNTMP2)	/SET IT FOR VERIFY			/A040
	TAD   (MUBUF+MNONUM-1)	/ START OF OVLY TABLE -1 		/A035
	DCA	X0							/A035
	TAD	VFYNUM		/ VERIFY OVERLAY NUMBER			/A035
	DCA I	X0							/A035
	TAD	VFYADR		/ START ADDRESS OF VERIFY		/A035
	DCA I	X0							/A035
	TAD	VFYFLD		/ VERIFY FIELD				/A035
	DCA I	X0							/A035
	CDFMYF			/ RESET FIELD				/A035
	ISZ	CUDRST		/ SET RETURN TO CALL OVLAY		/A035
CUDGRE, CLA			/ make sure the acc is clear		/a043
	CDFMYF			/ RESET FIELD				/A043
	JMP I	CUDSET		/ RETURN TO TRANSFER TO VERIFY		/A035

/ CALL THE RESET DATE AND TIME MENU

CUDLUP,	CIFMNU			/ CALL DATE/TIME MENU
	JMS I	MNUCAL
	DLMSM0								/M037
	JMS	CUDPUT		/ ONCE ONLY CALL TO SAVE MNFMAT		/A028

	TAD  (MNDTYR-1+MUBUF)	/ SET UP X0 TO GET YEAR, ETC.
	DCA	X0
	CDFMNU
	TAD I	X0		/ GET VALUES AND SAVE HERE
	DCA	CUDSYR
	TAD I	X0
	DCA	CUDSMO
	TAD I	X0
	DCA	CUDSDY
	TAD I	X0
	DCA	CUDSHR
	TAD I	X0
	DCA	CUDSMN
	CDFMYF

	TAD	CUDSDY
	SPA CLA			/ DON'T CHANGE IF NEGATIVE
	JMP	CUDLUP		/ DON'T ALLOW NO INPUT			/C038
	JMS	FIXDAT

CUDSND,	TAD	CUDSHR		/ DO WE CHANGE TIME?
	SPA CLA
	JMP	CHKDAT		/ NO - GO CHECK THE DATE		/C038

	CDFSYS
	TAD	(CLOCK)		/ ++++
	DCA	X0
	DCA I	X0		/ TENTHS
	DCA I	X0		/ SECONDS
	TAD	CUDSMN		/ ++++
	DCA I	X0		/ MINUTES
	TAD	CUDSHR		/ ++++
	DCA I	X0		/ HOURS

/ THIS CODE WAS PUT IN FOR FIELD TEST PURPOSES SO THAT SOFTWARE
/ PUT OUT FOR FIELD TEST IS NOT AROUND FOREVER.

CHKDAT,	CDFSYS			/ CHANGE TO SYSTEM FIELD
	TAD I	CUDEAR		/ GET YEAR INPUT			/C038
	TAD	CUDEXY		/ GET EXPIRATION YEAR			/C038
	SMA SZA			/ YEAR BEYOND LIMIT?
	JMP	CHKDT1		/ YES, CLOBBER DISKETTE

	SZA CLA			/ TIME OUT YEAR?
	JMP	CUDXIT		/ NO, MUST BE EARLIER, OK, EXIT

	TAD I	CUDMTH		/ NO, EXPIRATION YEAR, CHECK MONTH	/C038
	TAD	CUDEXM		/ GET EXPIRATION MONTH			/C038

CHKDT1,	CDFMYF			/ RESET BACK TO THIS FIELD
	IFDEF	FLDTST	<SPA CLA> / POSITIVE VALUE MEANS CLOBBER BOOT BLOCK
	IFNDEF	FLDTST	<CLA>	/ RETURN IF NOT FIELD TEST
CUDXIT,	JMP I	CUDSET		/ DATE OK, BACK TO MAIN MENU
				/ DATE BAD, TIME TO CLOBBER DISKETTE
	DCA	QUQBLK+RXQBAD	/ SET BUFFER ADDRESS TO 0
	DCA	QUQBLK+RXQDRV	/ SET DRIVE TO 0
	TAD	CDF0
	DCA	QUQBLK+RXQBFD	/ SET FIELD OF BUFFER TO 0
	TAD	CUDEWT		/ GET DISK HANDLER WRITE FUNCTION CODE	/C038
	DCA	QUQBLK+RXQFNC	/ SET FUNCTION TO WRITE
	DCA	QUQBLK+RXQBLK	/ SET BLOCK NUMBER TO 0
	JMS	QURX		/ CLOBBER BOOT BLOCK
	JMP I	CUDSET		/ EXIT, NEXT TIME SYSTEM WILL NOT BOOT

	X=.			/ INDICATE FIRST FREE LOCATION ON PAGE
/--------------------
	PAGE

/ ROUTINE TO READ THE SYSTEM VALUES FOR MENU FIELD

CUDOPT,	XX			/ READ THE SYSTEM VALUES
	DCA	QUQBLK+RXQDRV	/ SET TO SYSTEMS DRIVE
	TAD	CUDERD		/ PICK UP READ FUNCTION CODE		/C038
	DCA	QUQBLK+RXQFNC	/ STORE IN QUEUE BLOCK
	TAD	(DLSVAL)	/ PICK UP DISK BLOCK FOR SYSTEM VALUES
	DCA	QUQBLK+RXQBLK	/ STORE IN QUEUE BLOCK
	TAD	CUDBAD		/ PICK UP POINTER TO BUFFER AREA	/M037
	DCA	QUQBLK+RXQBAD	/ STORE IN QUEUE BLOCK
	TAD	CUDMYF		/ PICK UP CDF INSTRUCTION TO THIS FIELD	/M028
	DCA	QUQBLK+RXQBFD	/ STORE IN QUEUE BLOCK
	JMS	QURX		/ READ IN SYSTEM VALUES

/ SET THE UNBUNDLING OPTIONS WORD INTO MNOPTC
				/ GET HARDWARE OPTIONS BIT
CUDTST,	CDFSYS			/ CHANGE TO SYSTEM FIELD
	DCA I	(U1STPT)	/ CLEAR UDK STACK POINTER		/A029
	TAD I	CUDONL		/ GET COM ON LINE FLAG WORD		/C038
	CDFMYF			/ RETURN TO CURRENT DATA FIELD
	SZA CLA			/ CHECK FOR PRESENCE OF HARDWARE BIT
	AC0001			/ SET BIT IF COMM INTERFACE PRESENT
	DCA	T1		/ USE LOCATION AS TEMPORARY STORAGE

	AC7776			/ SET UP HARDWARE BIT MASK
	AND I	CUDFOW		/ CLEAR BITS BAISED ON OPTIONS WORD	/C038
	TAD	T1		/ COMBINE WITH HARDWARE BIT
	DCA I	CUDFOW		/ STORE NEW FEATURE OPTIONS WORD	/C038

	JMS	CUCOPY		/ TRANSFER THEM TO MENU FIELD
CUDBAD,	    CUDBUF		/ BUFFER ADDRESS TO START FROM		/M037
CUDMYF,	    CDFMYF		/ FIELD OF SOURCE			/M028
	    MUSYSV		/ LOCATION TO MOVE TO
	    CDFMNU		/ FIELD OF DESTINATION
	    MUSYSL		/ NUMBER OF WORDS TO MOVE

/ TURN ON UDK'S

	CIFSYS			/ SET UP TO GO TO SYSTEM FIELD
	UDKOPS			/ GO TURN ON UDK'S

	JMP I	CUDOPT		/ RETURN TO CALLER

FIXDAT,	XX
	CDFSYS
	TAD	CUDSDY
	DCA I	CUDDMT		/ STORE DAY OF MONTY VALUE		/C038

	TAD	CUDSMO
	DCA I	CUDMTH		/ STORE MONTH VALUE			/C038

	TAD	CUDSYR
	DCA I	CUDEAR		/ STORE YEAR VALUE			/C038

	TAD I	CUDMTH		/ GET MONTH VALUE			/C038
	CIA			/ ++++
	DCA	T1

	AC0003			/ ++++
	AND I	CUDEAR		/ MASK OFF YEAR VALUE			/C038
	SNA CLA			/ ++++
	IAC
	CDFMYF
	TAD	(34)		/ ++++
	DCA	CUDSMT+1	/ SET FEB DAYS

	TAD	(CUDSMT-1)	/ ++++
	DCA	X0
	SKP
	TAD I	X0		/ GET DAYS SO FAR THIS YEAR
	ISZ	T1		/ ++++
	JMP	.-2

	CDFSYS
	TAD I	CUDDMT		/ GET DAY OF MONTH VALUE		/C038
	DCA I	(DAYEAR)

	AC7777			/ ++++
	TAD I	CUDEAR		/ GET DAY OF WEEK			/C038
	CLL RAR
	CLL RAR
	TAD I	CUDEAR							/C038
	TAD I	(DAYEAR)
	TAD	(-7)
	SMA			/ ++++
	JMP	.-2
	TAD	(10)		/ ++++
	DCA I	(DAWEEK)	/ 1-7 = SUN-SAT

	TAD I	CUDDMT		/ GET DAY OF MONTH VALUE		/C038
	BSW			/ ++++
	TAD I	CUDMTH		/ GET MONTH VALUE			/C038
	DCA I	(PAKDAT)

	CDFMYF
	JMP I	FIXDAT

/ 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,	XX
	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	T1		/ AND SAVE FOR USE

CUCPY0,	.-.			/ A CDF FOR FIRST FIELD
	TAD I	X0		/ GET WORD
CUCPY1,	.-.			/ A CDF FOR THE RECEIVING FIELD
	DCA I	X1		/ STORE WORD
	ISZ	T1		/ DONE?
	JMP	CUCPY0		/ NO - DO NEXT WORD			/C038
	CDFMYF			/ YES - BACK TO OUR FIELD
	JMP I	CUCOPY		/ RETURN TO CALLER

/	TABLE OF DAYS IN THE MONTHS, USED BY 'RD' PROCESSING

	DECIMAL
CUDSMT,	31			/ JANUARY
	28			/ FEBRUARY
	31			/ MARCH
	30			/ APRIL
	31			/ MAY
	30			/ JUNE
	31			/ JULY
	31			/ AUGUST
	30			/ SEPTEMBER
	31			/ OCTOBER
	30			/ NOVEMBER
	31			/ DECEMBER
	OCTAL

/D038	IFDEF	CONDOR	<
/D038	/ NOTE:: THIS CODE IS EXECUTED ONCE AFTER POWER-UP
/D038	/
/D038	/ This code issues a PRQ3 request to panel memory to set the WPS user
/D038	/ defined terminal characteristics into panel memory program locations
/D038	/ 24, 25, and 26 thereby powering up to the WPS characteristics
/D038	INITTC,	XX			/
/D038		JMS	DM1TST		/ IS THIS A DECMATE I SYSTEM ?		/A038
/D038		JMP I	INITTC		/ YES, DO NOT EXECUTE PRQ REQUESTS	/A038
/D038	/ SET THE WPS DEFINED TERMINAL CHARACTERISTIC INTO THE TERMINAL REMEMBERING
/D038	/ THAT SCREEN WIDTH IS FORCED TO 80 COLUMNS & TERMINAL MODE IS FORCED TO ANSI
/D038		CDFMNU
/D038		TAD I	XSETUP		/ terminal characterics from "SETUP"
/D038		DCA	PRQBLK		/ TERMINAL CHARACTERISTICS
/D038		TAD I	XPBAUD		/ printer baud rate
/D038		AND	(17)		/
/D038		DCA	PRQBLK+1	/ PRINTER BAUD RATE
/D038		TAD I	XCBAUD		/ communications baud rate
/D038		AND	(17)		/
/D038		DCA	PRQBLK+2	/ COMMUNICATIONS BAUD RATE
/D038		CDFMYF
/D038		PRQ3			/ EXECUTE PANEL REQUEST
/D038		CDFMYF&70%10+4000	/ 40 (dest field 0) (src field MYF)
/D038		  PRQBLK		/ source starting address
/D038		  24			/ destination starting address
/D038		  -3			/ three words to move
/D038		  7777			/ PRQ3 terminator
/D038		AC7777			/ Disable blanking screen
/D038		PRQ3
/D038		17			/ Code
/D038		7777			/ Terminator
/D038		CLA			/ (just in case ac dirty after prq)
/D038	/ NOTE THAT A "RST" (ESC c) IS ISSUED AFTER THE RETURN FROM THIS ROUTINE.
/D038		JMP I	INITTC
/D038	/ Order important
/D038	PRQBLK,
/D038	XSETUP,	MUBUF+MNSECN
/D038	XPBAUD,	MUBUF+MNPRTB
/D038	XCBAUD,	MUBUF+MNPRIM
/D038	/ End order important
/D038			>		/ END IFDEF CONDOR

	X=.			/ INDICATE FIRST FREE LOCATION ON PAGE
/--------------------
	PAGE

/D038	/WARM START ROUTINE TO SET UP OVERLAY TO CALL VERIFY			/A035
/D038	CUDWRM,	CDFSYS								/A036
/D038		TAD I	(DAMNTH)	/ RESET FOR DISPLAY			/A036
/D038		SPA			/ CHECK FOR "F" COMMAND			/A036
/D038		JMP	CUDWRP		/ NO, WARM START ERROR			/A036
/D038		CLA			/ RETURN WITH CLEAN ACCUMULATOR		/A036
/D038		CDFMYF			/ HERE THROUGH "F" COMMAND		/A036
/D038		JMP	CUDXIT							/A036
/D038	CUDWRP,	CMA			/ WARM START SET ON ERROR IN DSKACP	/A036
/D038		DCA I	(DAMNTH)						/A036
/D038		CDFMNU								/A035
/D038		TAD   (MUBUF+MNONUM-1)	/ START OF OVLY TABLE -1 		/A035
/D038		DCA	X0							/A035
/D038		TAD	VFYNUM		/ VERIFY OVERLAY NUMBER			/A035
/D038		DCA I	X0							/A035
/D038		TAD	VFYADR		/ START ADDRESS OF VERIFY		/A035
/D038		DCA I	X0							/A035
/D038		TAD	VFYFLD		/ VERIFY FIELD				/A035
/D038		DCA I	X0							/A035
/D038		CDFMYF			/ RESET FIELD				/A035
/D038		ISZ	CUDRST		/ SET RETURN TO CALL OVLAY		/A035
/D038		JMP	CUDXIT		/ RETURN				/A035
/D038	VFYNUM,	14			/ OVLAY NUMBER				/A035
/D038	VFYADR,	200			/ START ADDRESS OF VERIFY		/A035
/D038	VFYFLD,	CIF	10		/ VERIFY FIELD -2			/A035
/D038		IFDEF CONDOR	<
/D038	/ ROUTINE TO SET VALUES INTO MENU FIELD TEMP REGISTERS FOR RD DISPLAY	/A037
/D038	CUDVAL,	XX			/ GET PANEL VALUES INTO MENU TEMPS	/A037
/D038		PRQ3			/ ISSUE A PANEL REQUEST			/A037
/D038		5041			/ 50XY - X=DEST FIELD, Y=SRC FIELD	/A037
/D038		20			/ SOURCE ADDRESS IN PANEL MEMORY	/A037
/D038		CUDTMP			/ DESTINATION ADDRESS IN THIS FIELD	/A037
/D038		-2			/ NUMBER OF WORDS TO MOVE		/A037
/D038		-1			/ TERMINATOR FOR PANEL REQUEST FUNCTION	/A037
/D038		TAD   (MUBUF+MNTMP5-1)	/ GET POINTER TO MENU FIELD TEMPS	/A037
/D038		DCA	X0		/ STORE POINTER FOR INDIRECT STORAGE	/A037
/D038		CDFMNU			/ CHANGE TO MENU FIELD			/A037
/D038		TAD	CUDTMP		/ GET INTERNAL DATA VALUE TO BE SPLIT	/A037
/D038		BSW			/ SWAP HIGH ORDER WITH LOW ORDER BYTE	/A037
/D038		AND	(7)		/ MASK OFF LOW ORDER BITS		/A037
/D038		DCA I	X0		/ STORE VALUE IN MENU TEMP		/A037
/D038		TAD	CUDTMP		/ GET INTERNAL DATA VALUE TO BE SPLIT	/A037
/D038		RTR;RAR			/ SHIFT VALUE THREE PLACES TO THE RIGHT	/A037
/D038		AND	(7)		/ MASK OFF LOW ORDER BITS		/A037
/D038		DCA I	X0		/ STORE VALUE IN MENU TEMP		/A037
/D038		TAD	CUDTMP		/ GET INTERNAL DATA VALUE TO BE SPLIT	/A037
/D038		AND	(7)		/ MASK OFF LOW ORDER BITS		/A037
/D038		DCA I	X0		/ STORE VALUE IN MENU TEMP		/A037
/D038		TAD	CUDTMP+1	/ GET INTERNAL ROM  VALUE TO BE SPLIT	/A037
/D038		BSW			/ SWAP HIGH ORDER WITH LOW ORDER BYTE	/A037
/D038		AND	P77		/ MASK OFF LOW ORDER BITS		/A037
/D038		DCA I	X0		/ STORE VALUE IN MENU TEMP		/A037
/D038		TAD	CUDTMP+1	/ GET INTERNAL ROM  VALUE TO BE SPLIT	/A037
/D038		BSW			/ SWAP HIGH ORDER WITH LOW ORDER BYTE	/A037
/D038		AND	P7700		/ MASK OFF HIGH ORDER BITS		/A037
/D038		DCA I	X0		/ STORE VALUE IN MENU TEMP		/A037
/D038		JMP I	CUDVAL		/ RETURN WITH DATA FIELD SET TO MENU 	/A037
/D038	/ THIS ROUTINE TAKES THE DATE FROM PANEL MEMORY, WHEN CALLED FROM
/D038	/ MASTER MENU, AND PUTS IT INTO THE FORMAT REQUIRED BY WPS.
/D038	/ MASTER MENU STORES THE DATE IN THE FOLLOWING WAY: MM/DD/YY.
/D038	/
/D038	/ WPS LOCATION "MNFMAT" DEFINES THE WAY THE DATE IS TO BE ENTERED:
/D038	/    CODE 0 = INVALID, 1= DD/MM/YY, 2=MM/DD/YY, 3=YY/MM/DD
/D038	/
/D038	DTFRMT,	0								/A032
/D038		TAD	(PMDATE)	/ START OF DATE BUFFER			/A032
/D038		DCA	DTINBF		/ DATE INPUT BUFFER			/A032
/D034	PRQ3			/ READ SIGNATURE			/A032
/D034	CU2FLD^10+PMFLD+RDPMEM	/ 50XY Y=INPUT FLD X=OUTPUT FIELD	/A032
/D034	PMSIGN			/ LOC OF SIGNATURE IN P.M.		/A032
/D034	F1DATE			/ TEMP USE				/A032
/D034	-1			/ -NUMBER WORDS TO BE READ		/A032
/D034	-1			/ TERMINATOR				/A032
/D034	TAD	(SIGNAT)	/ SIGNATURE=-7531			/A032
/D034	TAD	F1DATE		/ WHAT IS SIGNATURE?			/A032
/D034	SZA CLA			/ IS DATE IN P.M. IN FORMAT		/A032
/D034	JMP	DTSAME		/ NO DON'T WORRY ABOUT IT		/A032
/D038		AC0003			/ SET UP MASK FOR DATE BITS		/A032
/D038		AND	CUDBUF+MNFMAT-MNABRV	/ ISOLATE THE DATE BITS		/A032
/D038		SNA			/ 0=INVALID				/A032
/D038		JMP	DTSAME		/ IGNORE				/A032
/D038		CLL RAR			/ 1 INTO LINK 2 BIT TO 1 BIT		/A032
/D038		SNA CLA			/ IS THIS CODE 1?  FORMAT=DD/MM/YY	/A032
/D038		JMP	DTCOD1		/ YES.. GO SET UP DD/MM/YY		/A032
/D038		SNL			/ NO.. MUST BE CODE 2 OR 3		/A032
/D038		JMP	DTSAME		/ CODE 2=MM/DD/YY (SET ALREADY)		/A032
/D038	DTCOD3,	JMS	RDDATE		/ CODE 3=YY/MM/DD - READ DATE TO BUFFER	/A032
/D038		F2DATE			/ MONTH TO 2ND DATE FIELD		/A032
/D038		F3DATE			/ DAY TO 3RD DATE FIELD			/A032
/D038		F1DATE			/ YEAR TI FIRST DATE FIELD		/A032
/D038		0			/ TERMINATOR				/A032
/D038		JMP	DTWRIT		/ CONT					/A032
/D038	DTCOD1,	JMS	RDDATE		/ CODE 1 DD/MM/YY - READ DATE TO BUFFER	/A032
/D038		F2DATE			/ MONTH TO 2ND DATE FIELD		/A032
/D038		F1DATE			/ DAY TO FIRST DATE FIELD		/A032
/D038		F3DATE			/ YEAR TO 3RD DATE FIELD		/A032
/D038		0			/ TERMINATOR				/A032
/D038	DTWRIT,	PRQ3			/ WRITE IT OUT				/A032
/D038		PMFLD^10+CU2FLD+WRPMEM	/ 4064- WRITE TO FIELD 6 P.M. FROM THIS	/A032
/D038		F1DATE			/ START LOC				/A032
/D038		PMDATE			/ PAN MEM DATE LOC			/A032
/D038		DTLEN			/ =-8   DD/MM/YY  OR OTHER FORMAT	/A032
/D038		-1			/ TERMINATOR				/A032
/D038	DTSAME,	JMP I	DTFRMT		/ RETURN				/A032
/D038	/READ DATE.... STORED IN FORMAT  MM/DD/YY READ INTO PROPER FORMAT	/A032
/D038	/..............2 CHARS. AT A TIME  INTO LOCATION SPECIFIED BY PARAMS	/A032
/D038	/
/D038	RDDATE,	0								/A032
/D038	
/D038	RDDAT2,	TAD I	RDDATE		/ GET ARG				/A032
/D038		ISZ	RDDATE		/ INC RET				/A032
/D038		SNA			/ END READ?				/A032
/D038		JMP I	RDDATE		/ YES					/A032
/D038		DCA	DTOTBF		/ SET OUTPUT				/A032
/D038		PRQ3								/A032
/D038		CU2FLD^10+PMFLD+RDPMEM	/ FROM P.M. TO CU2 BUFFER		/A032
/D038	DTINBF,	PMDATE			/ LOCATION IN P.M. DATE IS STORED 	/A032
/D038	DTOTBF,	F1DATE			/ TO BE STORED				/A032
/D038		-2			/ #WORDS TO BE READ			/A032
/D038		-1			/ TERMINATOR				/A032
/D038		AC0003			/ LENGTH OF FLD +"/"			/A032
/D038		TAD	DTINBF		/ RESET INPUT FLD			/A032
/D038		DCA	DTINBF							/A032
/D038		JMP	RDDAT2		/ NEXT					/A032
/D038			>		/END IFDEF CONDOR			/A032

IFDEF	CONDOR	<

/ NOTE:: THIS CODE IS EXECUTED ONCE AFTER POWER-UP FOR DECMATE II SYSTEM /A038

/ THIS ROUTINE TAKES THE DATE FROM PANEL MEMORY, WHEN CALLED FROM 	/A038
/ MASTER MENU, AND PUTS IT INTO THE FORMAT REQUIRED BY WPS.		/A038
/ MASTER MENU STORES THE DATE IN THE FOLLOWING WAY: MM/DD/YY.		/A038

/ WPS LOCATION "MNFMAT" DEFINES THE WAY THE DATE IS TO BE ENTERED:	/A038
/    CODE 0 = INVALID, 1= DD/MM/YY, 2=MM/DD/YY, 3=YY/MM/DD		/A038

DM2INT,	0								/A032
	TAD	(PMDATE)	/ START OF DATE BUFFER			/A032
	DCA	DTINBF		/ DATE INPUT BUFFER			/A032

	AC0003			/ SET UP MASK FOR DATE BITS		/A032
	AND	CUDBUF+MNFMAT-MNABRV	/ ISOLATE THE DATE BITS		/A032
	SNA			/ 0=INVALID				/A032
	JMP	DTSAME		/ IGNORE				/A032
	CLL RAR			/ 1 INTO LINK 2 BIT TO 1 BIT		/A032
	SNA CLA			/ IS THIS CODE 1?  FORMAT=DD/MM/YY	/A032
	JMP	DTCOD1		/ YES.. GO SET UP DD/MM/YY		/A032
	SNL			/ NO.. MUST BE CODE 2 OR 3		/A032
	JMP	DTSAME		/ CODE 2=MM/DD/YY (SET ALREADY)		/A032

DTCOD3,	JMS	RDDATE		/ CODE 3=YY/MM/DD - READ DATE TO BUFFER	/A032
	F2DATE			/ MONTH TO 2ND DATE FIELD		/A032
	F3DATE			/ DAY TO 3RD DATE FIELD			/A032
	F1DATE			/ YEAR TI FIRST DATE FIELD		/A032
	0			/ TERMINATOR				/A032
	JMP	DTWRIT		/ CONT					/A032

DTCOD1,	JMS	RDDATE		/ CODE 1 DD/MM/YY - READ DATE TO BUFFER	/A032
	F2DATE			/ MONTH TO 2ND DATE FIELD		/A032
	F1DATE			/ DAY TO FIRST DATE FIELD		/A032
	F3DATE			/ YEAR TO 3RD DATE FIELD		/A032
	0			/ TERMINATOR				/A032

DTWRIT,	PRQ3			/ WRITE IT OUT				/A032
	PMFLD^10+CU2FLD+WRPMEM	/ 4064- WRITE TO FIELD 6 P.M. FROM THIS	/A032
	F1DATE			/ START LOC				/A032
	PMDATE			/ PAN MEM DATE LOC			/A032
	DTLEN			/ =-8   DD/MM/YY  OR OTHER FORMAT	/A032
	-1			/ TERMINATOR				/A032

/ THIS CODE ISSUES A PRQ3 REQUEST TO PANEL MEMORY TO SET THE WPS USER
/ DEFINED TERMINAL CHARACTERISTICS INTO PANEL MEMORY PROGRAM LOCATIONS
/ 24, 25, AND 26 THEREBY POWERING UP TO THE WPS CHARACTERISTICS

/ SET THE WPS DEFINED TERMINAL CHARACTERISTIC INTO THE TERMINAL REMEMBERING
/ THAT SCREEN WIDTH IS FORCED TO 80 COLUMNS & TERMINAL MODE IS FORCED TO ANSI

DTSAME,	CDFMNU
	TAD I	XSETUP		/ TERMINAL CHARACTERICS FROM "SETUP"
	TAD	(1200)		/ Set term Lvl 8 , 8 bit host		/A042
	DCA	PRQBLK		/ TERMINAL CHARACTERISTICS

	TAD I	XPBAUD		/ PRINTER BAUD RATE
	AND	CUDC17		/ MASK OFF LOW ORDER BITS
	DCA	PRQBLK+1	/ PRINTER BAUD RATE

	TAD I	XCBAUD		/ COMMUNICATIONS BAUD RATE
	AND	CUDC17		/ MASK OFF LOW ORDER BITS
	DCA	PRQBLK+2	/ COMMUNICATIONS BAUD RATE
	CDFMYF

	PRQ3			/ EXECUTE PANEL REQUEST
	CDFMYF&70%10+4000	/ 40 (DEST FIELD 0) (SRC FIELD MYF)
	  PRQBLK		/ SOURCE STARTING ADDRESS
	  24			/ DESTINATION STARTING ADDRESS
	  -3			/ THREE WORDS TO MOVE
	  7777			/ PRQ3 TERMINATOR

	AC7777			/ DISABLE BLANKING SCREEN
	PRQ3
CUDC17,	17			/ CODE
	7777			/ TERMINATOR

	CLA
	PRQ3			/ Switch cursor on as disabled by V25st	/a042
	0025			/ on start-up.  Do this using PRQ3, #25	/a042
	7777			/ with AC=0				/a042



	AC0001			/ SET SLUSHWARE FOR DECMATE MODE	/A033
	PRQ3			/ ISSUE PANEL REQUEST TO SLUSHWARE	/A033
	10			/ FUNCTION CODE ARGUMENT		/A033
	7777			/ END OF LIST INDICATOR			/A033

	CIFMNU			/ ISSUE RESET TO TERMINAL TO SET VALUES	/A038
	JMS I	IOACAL		/ CALL SYSTEM DISPLAY ROUTINE		/A038
	  0			/ USE DEFAULT OUTPUT ROUTINE		/A038
	  RSTCON		/ "ESC c"				/A038

	JMP I	DM2INT		/ RETURN TO CALLER			/A038

/ SUBROUTINE TO READ DATE - STORED IN FORMAT  MM/DD/YY READ INTO PROPER /A032
/ FORMAT 2 CHARS. AT A TIME  INTO LOCATION SPECIFIED BY PARAMS		/A032

RDDATE,	XX								/A032
RDDAT2,	TAD I	RDDATE		/ GET ARG				/A032
	ISZ	RDDATE		/ INC RET				/A032
	SNA			/ END READ?				/A032
	JMP I	RDDATE		/ YES					/A032

	DCA	DTOTBF		/ SET OUTPUT				/A032
	PRQ3								/A032
	CU2FLD^10+PMFLD+RDPMEM	/ FROM P.M. TO CU2 BUFFER		/A032
DTINBF,	PMDATE			/ LOCATION IN P.M. DATE IS STORED 	/A032
DTOTBF,	F1DATE			/ TO BE STORED				/A032
	-2			/ #WORDS TO BE READ			/A032
	-1			/ TERMINATOR				/A032

	AC0003			/ LENGTH OF FLD +"/"			/A032
	TAD	DTINBF		/ RESET INPUT FLD			/A032
	DCA	DTINBF							/A032
	JMP	RDDAT2		/ NEXT					/A032

/ ROUTINE TO SET VALUES INTO MENU FIELD TEMP REGISTERS FOR RD DISPLAY	/A037

CUDVAL,	XX			/ GET PANEL VALUES INTO MENU TEMPS	/A037
	PRQ3			/ ISSUE A PANEL REQUEST			/A037
	5041			/ 50XY - X=DEST FIELD, Y=SRC FIELD	/A037
	20			/ SOURCE ADDRESS IN PANEL MEMORY	/A037
	CUDTMP			/ DESTINATION ADDRESS IN THIS FIELD	/A037
	-2			/ NUMBER OF WORDS TO MOVE		/A037
	-1			/ TERMINATOR FOR PANEL REQUEST FUNCTION	/A037

	TAD   (MUBUF+MNTMP5-1)	/ GET POINTER TO MENU FIELD TEMPS	/A037
	DCA	X0		/ STORE POINTER FOR INDIRECT STORAGE	/A037
	CDFMNU			/ CHANGE TO MENU FIELD			/A037

	TAD	CUDTMP		/ GET INTERNAL DATA VALUE TO BE SPLIT	/A037
	BSW			/ SWAP HIGH ORDER WITH LOW ORDER BYTE	/A037
	AND	CUDC7		/ MASK OFF LOW ORDER BITS		/C038
	DCA I	X0		/ STORE VALUE IN MENU TEMP		/A037

	TAD	CUDTMP		/ GET INTERNAL DATA VALUE TO BE SPLIT	/A037
	RTR;RAR			/ SHIFT VALUE THREE PLACES TO THE RIGHT	/A037
	AND	CUDC7		/ MASK OFF LOW ORDER BITS		/C038
	DCA I	X0		/ STORE VALUE IN MENU TEMP		/A037

	TAD	CUDTMP		/ GET INTERNAL DATA VALUE TO BE SPLIT	/A037
	AND	CUDC7		/ MASK OFF LOW ORDER BITS		/C038
	DCA I	X0		/ STORE VALUE IN MENU TEMP		/A037

	TAD	CUDTMP+1	/ GET INTERNAL ROM  VALUE TO BE SPLIT	/A037
	BSW			/ SWAP HIGH ORDER WITH LOW ORDER BYTE	/A037
	AND	P77		/ MASK OFF LOW ORDER BITS		/A037
	DCA I	X0		/ STORE VALUE IN MENU TEMP		/A037

	TAD	CUDTMP+1	/ GET INTERNAL ROM  VALUE TO BE SPLIT	/A037
	BSW			/ SWAP HIGH ORDER WITH LOW ORDER BYTE	/A037
	AND	P7700		/ MASK OFF HIGH ORDER BITS		/A037
	DCA I	X0		/ STORE VALUE IN MENU TEMP		/A037

	JMP I	CUDVAL		/ RETURN WITH DATA FIELD SET TO MENU 	/A037

	X=.			/ INDICATE FIRST FREE LOCATION ON PAGE
/--------------------
	PAGE
		>		/ END IFDEF CONDOR			/A032

/CUDBUF,	ZBLOCK	400	/ MOVED TO 7000	(DEFINED IN WPF1)	/C029


