/ WPSC.PA - DECSPELL STARTUP CODE
/
/		*******  EDIT HISTORY  *******
/
/ 013	EMcD	29-Sep-85	Add Dutch- Spanish Xlations
/ 012	RCME	22-May-85	Enable use of multinational characters in the
/				personal dictionary.
/
/ ---------------- All below refer to V2.0 and earlier -------------------
/
/ 011	WJY	22-OCT-84	Put OpeN FILe flag into MQ & pass control
/				off to WPSPEL to check & report file open
/				error (WPSV2-240).
/ 010	WJY	11-OCT-84	Give error message if drive specified for
/				utility and/or dictionary disk is already
/				in use (WPSV2-225).
/ 009	WJY	09-AUG-84	Return to main menu when the SPELL overlay
/				INITSP is unable to open the file.
/ 008	WJY	02-AUG-84	Support "Update personal dictionary ..."
/ 007	WJY	29-JUN-84	Fix mixed screen on "Loading ...." screen.
/ 006 	BC	 4-JUN-84	Modify FILLIO to do writes as well as reads.
/ 005	WJY	26-MAY-84	XPU support & American/British on same Utility dsk
/ 004	WCE	23-APR-84	ELIMINATED SECOND QURX ROUTINE IN FIELD TWO
/ 003	WCE	12-APR-84	REMOVED NECESSITY FOR MENU INTERPERTER BY
/				ADDING ONCE ONLY MENU MODULE FOR FIELD FOUR
/ 002	WCE	26-MAR-84	CHANGE DISK NAME FROM DECSPL TO WPSUTL
/ 001	GDH/EH	AUG/SEP-83	Initial version
/


/***************************************************************************
/****			WRITE OUT CODE FOR WPSC				****
/***************************************************************************


	FIELD 0			/ FIELD WHERE RXHAN IS LOCATED
	*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
	7605			/ 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

	IFNDEF DECDEV <
	DLOSPI;SPINIT;CDF 10;-DSOSPI	/ Write-out spell check init code.
	DLOSPS;SPSTAT;CDF 10;-DSOSPS	/ Write-out spell check status line stuff.
	DLOSPM;SPMENU;CDF 10;-DSOSPM	/ Write-out spell check menu routine
	>
	IFDEF DECDEV <
	DLOSPI;SPINIT;CDF 50;-DSOSPI	/ Write-out spell check init code.
	DLOSPS;SPSTAT;CDF 50;-DSOSPS	/ Write-out spell check status line stuff.
	DLOSPM;SPMENU;CDF 50;-DSOSPM	/ Write-out spell check menu routine
	>
	DLSPHL;SPHOLE;CDF 60;-DSSPHL	/ Write-out spell hole code	/a012
	0			/ END OF LIST INDICATOR

	IFNDEF DECDEV <
	FIELD	1		/ This is the auxillary field.
	>
	IFDEF DECDEV <
	FIELD	5
	>
/ Note that the editor loads into 6400-7777 of this field and that several
/ editor routines use some of the globaly defined temps (X0, X1, X2, T1, etc.)

IFNDEF	OVLAY1	<OVLAY1=7400>	/ for 1st pass only. OVLAY1 is defined in WPEDIT
IFNDEF	OVLAYM	<OVLAYM=400>	/ for 1st pass only. OVLAYM is defined in WPEDIT

	*SWPBEG			/ Start assembling code at the begining of the SWAP area.
				/ That is where the code will eventually load
				/  at run-time (in field 2).
CDFMYF=CDFMNU			/ A CDF to current field.
SPSTAT=.

DSKBLK=	.-3000%400+DLOSPS	/ DISK BLOCK WHERE PAGE IS LOADED


/***************************************************************************
/****	 TRANSFER VECTOR ENTRY POINTS FOR EDITOR SWAP AREA ROUTINES	****
/***************************************************************************

CALLN1,	XX			/ ENTRY POINT FOR ROUTINE NUMBER 1
	JMS	CALSUB		/ SET UP RETURN ADDRESS AND RETURN FIELD
	JMS	UPDTSC		/ GO UPDATE STATUS LINE (SCREEN) INFO.
	JMP	CALXIT		/ GO TO RETURN TO CALLER CODE

CALLN2,	XX			/ ENTRY POINT FOR ROUTINE NUMBER 2
	JMS	CALSUB		/ SET UP RETURN ADDRESS AND RETURN FIELD
	NOP			/ GO CHECK FOR STATUS VALUE CHANGES
	JMP	CALXIT		/ GO TO RETURN TO CALLER CODE

CALLN3,	XX			/ ENTRY POINT FOR ROUTINE NUMBER 3
	JMS	CALSUB		/ SET UP RETURN ADDRESS AND RETURN FIELD
	NOP			/ GO HANDLE SCROLL DOWN EVENT
	JMP	CALXIT		/ GO TO RETURN TO CALLER CODE

CALLN4,	XX			/ ENTRY POINT FOR ROUTINE NUMBER 4
	JMS	CALSUB		/ SET UP RETURN ADDRESS AND RETURN FIELD
	NOP			/ GO HANDLE SCROLL UP EVENT
	JMP	CALXIT		/ GO TO RETURN TO CALLER CODE

CALLN5,	XX			/ ENTRY POINT FOR ROUTINE NUMBER 5
	JMS	CALSUB		/ SET UP RETURN ADDRESS AND RETURN FIELD
	NOP			/ PLACE FOR TRANSFER TO SPECIAL CODE
	JMP	CALXIT		/ GO TO RETURN TO CALLER CODE

CALLN6,	XX			/ ENTRY POINT FOR ROUTINE NUMBER 6
	JMS	CALSUB		/ SET UP RETURN ADDRESS AND RETURN FIELD
	NOP			/ PLACE FOR TRANSFER TO SPECIAL CODE
	JMP	CALXIT		/ GO TO RETURN TO CALLER CODE

CALLN7,	XX			/ ENTRY POINT FOR ROUTINE NUMBER 7
	JMS	CALSUB		/ SET UP RETURN ADDRESS AND RETURN FIELD
	NOP			/ PLACE FOR TRANSFER TO SPECIAL CODE
	JMP	CALXIT		/ GO TO RETURN TO CALLER CODE

CALLN8,	XX			/ ENTRY POINT FOR ROUTINE NUMBER 8
	JMS	CALSUB		/ SET UP RETURN ADDRESS AND RETURN FIELD
	NOP			/ PLACE FOR TRANSFER TO SPECIAL CODE
	JMP	CALXIT		/ GO TO RETURN TO CALLER CODE

CALLN9,	XX			/ ENTRY POINT FOR ROUTINE NUMBER 9
	JMS	CALSUB		/ SET UP RETURN ADDRESS AND RETURN FIELD
	NOP			/ PLACE FOR TRANSFER TO SPECIAL CODE
	JMP	CALXIT		/ GO TO RETURN TO CALLER CODE



/***************************************************************************
/****	     SET UP RETURN FIELD AND ADDRESS FOR CALLN# ROUTINES 	****
/***************************************************************************

CALSUB,	XX			/ ROUTINE TO SET UP RETURN FIELD AND ADDRESS
	DCA	T1		/ SAVE CONTENTS OF ACCUMULATOR

	RDF			/ READ CALLERS DATA FIELD
	TAD	CIDF0		/ MAKE CDF-CIF INSTRUCTION BACK TO CALLER
	DCA	CALXIT		/ STORE FOR RETURN TO CALLER
	CDFMNU			/ SET DATA FIELD BACK TO MY FIELD

	AC7776			/ SET UP TO SUBTRACT A VALUE OF TWO
	TAD	CALSUB		/ MAKE POINTER TO VECTOR ENTRY POINT
	DCA	T2		/ STORE FOR USE IN AN INDIRECT LOOKUP
	TAD I	T2		/ PICK UP CALLERS RETURN ADDRESS
	DCA	CALRTN		/ STORE ADDRESS FOR LATER RETURN TO CALLER

	JMP I	CALSUB		/ GO TRANSFER TO SPECIALIZED ROUTINES

CALXIT,	XX			/ LOCATION FOR CDF-CIF INSTRUCTION TO CALLER
	JMP I	CALRTN		/ RETURN BACK TO CALLER
CALRTN,	XX			/ LOCATION FOR CALLERS RETURN ADDRESS

/***************************************************************************
/****	THE CODE ASSEMBLED HERE IS USED BY THE EDITOR FOR STATUS LINE	****
/***************************************************************************

/ UPDTSC ROUTINE IS USED TO DISPLAY THE STATUS LINE INFORMATION IN THE EDITOR
/
/ THE STATUS LINE AREA CONSISTS OF TWO LINES AS FOLLOWS:
/ LINE  1 = TOP LINE OF SCREEN - CURRENT PAGE NUMBER, CURRENT LINE NUMBER,
/           DRIVE NUMBER, DOCUMENT NUMBER AND DOCUMENT NAME BEING EDITED
/ LINE 24 = CURRENT RULER IN EFFECT FOR EDITING
/
/ UPON ENTRY, THE VALUE CONTAINED IN THE T1 DETERMINES FUNCTION AS FOLLOWS:
/
/	T1 = 0	CLEAR THE SCREEN AND DISPLAY COMPLETE STATUS AREA
/		DEFINE SCROLLING REGION AND SET RELITIVE SCREEN ADDRESSING
/	T1 = 1	UPDATE DISPLAY OF TOP STATUS LINE ONLY
/	T1 = 2	UPDATE DISPLAY OF BOTTOM STATUS LINE ONLY (DISPLAY RULER)
/	T1 = 3	CLEAR THE SCREEN AND RESET SCROLLING AREA TO FULL SCREEN

UPDTSC,	XX			/ Entry point.
	TAD	T1		/ PICK UP SAVED CONTENTS OF T1CUMULATOR
	TAD	LITSC1		/ Index into dispatch table.
	DCA	.+1;XX		/ Go dispatch to routine to handle request.

LITSC1,	JMP I	UPDTDS		/ Jmp thru dispatch table.
UPDTDS,	UPDT00			/ Case 0.
	UPDT01			/ Case 1.
	UPDT02			/ Case 2.
	UPDT03			/  and Case 3.


UPDT00,	CIFSPL			/ Map speller field.
	JMS I	(SCRNIN)	/ Call screen initialization routine.
UPDT01,
UPDT02,	JMP I	UPDTSC		/ Return to caller.

UPDT03,	JMS I	IOACAL		/ Clear the screen & region area.
		0		/  ....
		SCSTS1		/ All the esc sequences to do it.
	JMP I	UPDTSC		/ Return to caller.

SYPRMP,	XX			/ Prompt for system diskette.
SYPRM1,	JMS I	IOACAL		/  ...
		0		/ Display to the screen.
		SYDISK		/ Replace the system diskette, etc.
		0000		/ Cursor Home address.
		1505		/ Error message address.
		2305		/ posn of 2nd part of prompt.
	JMP	SYPAP2		/ Merge below.

SYPAP1,	CIFSYS			/ JWAIT for a bit.
	JWAIT			/  ...
SYPAP2,	CIFSYS			/ Get an input character.
	XLTIN			/  ...
	 JMP	SYPAP1		/ Loop & wait if none.

	TAD	(-EDNWLN)	/  Return typed?
	SZA CLA			/ Skip if yes. Otherwise repeat error.
	 JMP	SYPRM1		/ Repeat the message.
	CDIEDT			/ Return CIF CDF instruction to EDIT field.
	JMP I	SYPRMP		/ Return to caller.

SYDISK,	IFDEF ENGLSH <
TEXT '^P!E^CG^P&REPLACE THE SYSTEM DISKETTE IN DRIVE 0^P&AND &PRESS !&RETURN'
	>
IFDEF ITALIAN <
	TEXT /^P!E^CG^P&INTORODURRE IL DISCO SISTEMA NELL'UNIT\@ 0 /
	*.-1
	TEXT /^P&E PREMERE RITORNO/
	>
	IFDEF DUTCH <
	TEXT '^P!E^CG^P&ZET DE SYSDISKETTE WEER IN AANDRIJVER 0 '
	*.-1
	TEXT /^P&^P EN DRUK OP !&RETURN'
	>
	IFDEF SPANISH <
	TEXT '^P!E^CG^P&CAMBIE EL DISKETTE SISTEMA EN LA UNIDAD 0^P&Y '
	*.-1
	TEXT 'PULSE !&RETORNO'>



	X=.			/ FIRST FREE LOCATION ON PAGE
/---------------------
	PAGE

DSKBLK=	.-3000%400+DLOSPS	/ DISK BLOCK WHERE PAGE IS LOADED

/FILLIO -- fills queue block with I/O parameters & then does I/O.
/
/CALL:	JMS	FILLIO
/		FUNCTION code						/M006
/		CDF to buffer field.
/		ADDRESS to read/write to/from.
/		-# of disk blocks to read/write.
/		START block #.
/	Rtn1:	Return here if I/O error.
/	Rtn2:	Normal completion return.
/

FILLIO,	XX			/ Entry point.
	TAD I	FILLIO		/ Get FUNCTION code.			/A006
	DCA	FILLFN		/ Store in line.			/A006
	ISZ	FILLIO		/ Bump to CDF.				/A006
	TAD I	FILLIO		/ Get CDF to buffer.
	DCA	CMDBLK+RXQBFD	/ Set into queue block.			/M004
	ISZ	FILLIO		/ Bump to read/write address.
	TAD I	FILLIO		/ Get read/write address.
	DCA	CMDBLK+RXQBAD	/ Set into queue block.			/M004
	ISZ	FILLIO		/ Bump to size (in blocks).
	TAD I	FILLIO		/ Get minus number of blocks to read/write.
	DCA	CMDBLK+RXQRS1	/ Set into queue block.			/M004
	ISZ	FILLIO		/ Bump to startint block #.
	RDF			/ Get return field.
	TAD	CIDF0		/ Convert into a return CIF CDF.
	DCA	FILXIT		/ Save for final return.
	TAD I	FILLIO		/ Get starting block #.
	ISZ	FILLIO		/ Bump to return address.
	CDFMYF			/ Map current field.
	JMS	RDFIO		/ Go do the read/write.
FILLFN,	0			/ ...					/M006
	SMA CLA			/ Skip if error returned.
	 ISZ	FILLIO		/ For normal return, bump address.
FILXIT,	XX			/ Return CIF CDF goes here.
	JMP I	FILLIO		/ Return to caller.


RDFIO,	XX
	DCA	CMDBLK+RXQBLK 	/ STORE BLOCK NUMBER			/M004
	RDF			/ Get field of caller.
	TAD	CIDF0		/ Make a return CIF CDF.
	DCA	RDFXIT		/  and save for the exit.
	TAD I	RDFIO 		/ ++++
	CDFMYF			/ Now map our field.
	DCA	CMDBLK+RXQFNC 	/ AND FUNCTION CODE			/M004
	ISZ	RDFIO
	JMS	CMDQUX		/ USE SYSTEM QURX ROUTINE FOR CALL	/A004

RDFXIT,	XX			/ CIF CDF to return field goes here.
	JMP I	RDFIO 		/ ELSE RETURN STATUS

/ The code immediately below is called by the startup code. This code decides
/ whether or not the SC disk need to be loaded. This code runs in field 2.
/
CHKSC,	XX			/ Entry point.
	TAD I	(OLL301)	/ See if FIELD 5 need be re-loaded.	/M005
	TAD	(-OLL301)	/ Check currently loaded OLAY block.	/M005
	SZA 			/ Skip if no.				/M005
	 DCA	LOADSC		/ Set flag if yes. SC needs to be loaded./M005
	TAD I	(OLL400)	/ Now check FIELD 6.			/M005
	TAD	(-OLL301)	/  ...					/M005
	SZA 			/ Skip if no.				/M005
	 DCA	LOADSC		/ Set flag if yes. SC needs to be loaded./M005
	TAD I	(MUBUF+MNFMAT)	/ Get format word			/A005
	AND	(MNFM3X)	/ Mask off "British dictionary in use" bit/A005
	SNA CLA			/ Skip if British			/A005
	 AC0001			/ AC=1 if American			/A005
	TAD	(-2)		/ AC=-2 if British else AC=-1		/A005
	DCA	T1		/ & save for later			/A005
	TAD I	(MUBUF+MNPULD)	/ Get APU/XPU loaded word		/A005
	AND	(MNRX0X+MNRX1X)	/ Mask off American & British loaded bits/A005
				/   =0 if nothing loaded		/A005
				/   =1 if American loaded		/A005
				/   =2 if British loaded		/A005
	TAD	T1		/ Add back dictionary in use value	/A005
	SNA 			/ Skip if nothing or wrong one loaded	/A005
	 JMP	NOLOAD		/  Else JMP, spell disk isn't needed	/A005
	DCA	LOADSC		/ Set flag. SC needs to be loaded	/A005
	TAD	(MNRX0X+MNRX1X)	/ Get American & British loaded bits	/A005
	CMA			/ Complement to form clearing mask	/A005
	AND I	(MUBUF+MNPULD)	/ & clear them in the APU/XPU loaded wd	/A005
	DCA I	(MUBUF+MNPULD)	/ & save the new APU/XPU loaded word	/A005
NOLOAD,	TAD	LOADSC		/ Do we need to (re)load the spell disk	/A005
	SZA CLA			/ Skip if not				/A005
	ISZ	CHKSC		/ Take bump return to (re)load the spell disk./M005
	CDIEDT			/ Back to caller.
	JMP I	CHKSC		/  ...

LOADSC,	0			/ Set if (re)load of spell disk is needed/A005


SCSTS1,	TEXT '![[?6L![[2&J![[R'	/ ESCAPE SEQUENCES DESCRIBED BELOW	/M004
				/ ESC [ ? 6 l	/ Set absolute mode.
				/ ESC [ 2 J	/ Erase entire screen.
				/ ESC [ r	/ Clear scrolling region.

	X=.			/ FIRST FREE LOCATION ON PAGE
/---------------------
	PAGE

SPINIT=.
CDFMYF=CDFEDT			/ This code loads in the editor field.
	RELOC

	RELOC	OVLAY1		/ This code will load in editor from 7400-7777.

DSKBLK=	.-7400%400+DLOSPI	/ DISK BLOCK WHERE PAGE IS LOADED


STRTUP,	XX			/ Do initialization stuff.
	CDIMNU			/ Map MENU field.
	TAD I	(MUBUF+MNOPTC)	/ Get options word.
	DCA	OPTNWD		/ save it aside.

	TAD	OPTNWD		/ Save it for editing w/o MABIT.
	AND	(-1-MABIT)	/ Isolate all but MABIT.
	DCA I	(MUBUF+MNOPTC)	/  ...

/d008	TAD	(-7)		/ Get a minus 7.			/A006
	TAD I	(MUBUF+MNTMP6)	/ Pick up operation code from menu field
	DCA	SAVET6		/ SAVET6 IS USED AS A THREE WAY SWITCH	/A006
				/ MINUS VALUE = SPELLING CORRECTOR	/A006
				/ ZERO  VALUE = LOAD USER DICTIONARY	/A006
				/ PLUS  VALUE = POST PROCESSING		/A006

	CDFMYF			/ Map data field back to our field.

	TAD	(DLOSPS)	/ Load Spell-Check status line stuff.
	PGSWAP			/  ...
	CIFMNU			/ Map menu field, where FILLIO resides.

	JMS I	(FILLIO)	/ Load ROOT-EDITOR Swap Area Code
		RXERD+4000	/ Function				/A006
		CDFMNU		/ field two.
		SWPBEG+1400	/ load address offset by three blocks.
		-DSSTAT+3	/ size in blocks.
		DLSTAT+3	/ start block #.
	 JMP	MYEXIT		/ If I/O error, abort.

	CIFMNU			/ Map menu field, where FILLIO resides.
	JMS I	(FILLIO)	/ Load Spell-Check menu text module
		RXERD+4000	/ Function				/A006
		CDFBUF		/ field.
		SPLMNU		/ load address.
		-DSOSPM		/ size in blocks.
		DLOSPM		/ start block #.
	 JMP	MYEXIT		/ If I/O error, abort.

	JMS	MOV100		/ Go copy 100 locations from MENU field
		CDFBUF		/ to field four

	JMS	GTDKID		/ Get system disk id.
		SYSID-1		/  ...

	TAD	SAVET6		/ Check for Post Processor Operation	/M006
	TAD	(-12)							/A008
	SNA CLA			/ Is this post processing ?	/M006	/M008
	JMP	UTLOAD		/ YES, skip test of APU loading

	CDIMNU			/ Map menu field.
	JMS I	(CHKSC)		/ See if SC diskette needs to be loaded.
	 JMP	NOSC		/ JMP if no. We are currently loaded.

UTLOAD,	AC0001			/ INDICATE UTILITY DISK REQUIRED
UTLDER,	CDIBUF			/ SWITCH TO BUFFER FIELD
	JMS	GETDRV		/ ASK USER FOR DRIVE NUMBER AND VALIDATE IT
	  JMP	STRTGM		/ USER OPTED FOR GOLD MENU RETURN

	TAD	SAVET6		/ Check for Post Processor Operation	/M006
	TAD	(-12)							/A008
	SZA CLA			/ Is this post processing ?	/M006	/M008
	JMP	SCLOAD		/ NO, go load spelling corrector code

PPLOAD,	CIFMNU			/ Call routine down in menu field.
	JMS I	(FILLIO)	/ Fill queue block parameters.
		RXERD+4000	/ Function				/A006
		CDFSPL		/ Field.
		100		/ load address.
		-DSOFFF		/ Size in blocks.
		DLOFFF		/ Starting block #.
	 JMP	UTLDER		/ Report missing sc disk error.

	JMS	MOV100		/ Go copy 100 locations from MENU field
		CDFSPL		/ to field six
	JMP	NODD		/ Go continue with main loop

SCLOAD,	CIFMNU			/ Call routine down in menu field.
	JMS I	(FILLIO)	/ Fill queue block parameters.
		RXERD+4000	/ Function				/A006
		CDFSPL		/ Field.
		100		/ load address.
		-DSOSPL		/ Size in blocks.
		DLOSPL		/ Starting block #.
	 JMP	UTLDER		/ Report missing sc disk error.

	JMS	MOV100		/ Go copy 100 locations from MENU field
		CDFSPL		/ to field six

	CIFMNU			/ Call routine down in menu field.
	JMS I	(FILLIO)	/ Now read field 5 stuff.
		RXERD+4000	/ Function				/A006
		CDFTXT		/  ...
		200		/ Load address.
		-DSOSPX		/ size in blocks.
		DLOSPX		/ Starting block #.
	 JMP	UTLDER		/ Report missing sc disk error.

	CIFTXT			/ Map field 5 code.
	JMS I	(CHKAPU)	/ Do APU initialization.
	 JMP	STRTGM		/ Return if APU init failure.

NOSC,	CIFSPL			/ Map spelling field.
	JMS I	(LODAPU)	/ Load the APU.

	TAD	SAVET6		/ See if operation is SC (6)		/M006
	TAD	(-6)							/A008
	SZA CLA			/ If this is SC then dictionary required/M006
	 JMP	NODD		/ Not SC, DD is not required.

DDLOAD,	CDFMNU			/ Map to MENU field.			/A005
	TAD I	(MUBUF+MNFMAT)	/ Get format word.			/A005
	AND	(MNFM3X)	/ Mask off "British dictionary" bit	/A005
	SZA CLA			/ Skip if AMERICAN dictionary in use	/A005
	AC0001			/ INDICATE BRITISH DICTIONARY REQUIRED	/A005
	TAD	(2)		/ INDICATE AMERICAN DICTIONARY REQUIRED	/A005

	CDIBUF			/ SWITCH TO BUFFER FIELD
	JMS	GETDRV		/ ASK USER FOR DRIVE NUMBER AND VALIDATE IT
	  JMP	STRTGM		/ USER OPTED FOR GOLD MENU RETURN

NODD,	JMS	INITSP		/ Go execute Spelling Checker editor initialization.
	TAD	OPNFIL		/ See if file was opened.		/A009
/d011	SNA CLA			/ Skip if it was			/A009
/d011	 JMP	STRTGM		/  else just clean up & exit		/A009
	MQL			/ Leave file open flag in MQ register	/A011

	CIFSPL			/ Map spell field.
	JMS I	(SPELL)		/ Start up the spell checker.

STRTGM,	JMS	CHKID		/ Make sure original system diskette is installed.

MYEXIT,	AC7777			/ Restore Menu field stuff.
	CIFMNU			/  ...
	PGSWAP			/   ....

	CDIMNU			/ Return CDI instruction to MENU field
	JMP I	STRTUP		/ Return to caller.

OPTNWD,	0			/ Location for MNOPTC word during spell check.
SAVET6,	0			/ Location for value of MNTMP6 operation word.
				/ *** SAVET6 = (MNTMP6) - 7 ***		/A006
				/ SAVET6 IS USED AS A THREE WAY SWITCH	/A006
				/ MINUS VALUE = SPELLING CORRECTOR	/A006
				/ ZERO  VALUE = LOAD USER DICTIONARY	/A006
				/ PLUS  VALUE = POST PROCESSING		/A006

	X=.			/ FIRST FREE LOCATION ON PAGE
/---------------------
	PAGE

DSKBLK=	.-7400%400+DLOSPI	/ DISK BLOCK WHERE PAGE IS LOADED

/***********************************************************************
/ CHKID - MAKE SURE ORIGINAL SYSTEM DISKETTE IS INSTALLED BEFORE
/ RETURN TO MAIN MENU.
/
/ WHEN WPSPEL IS CALLED, THE NAME AND DISK "RANDOM" ID ARE READ INTO
/ SYSID0-3.  BEFORE WPSPEL IS EXITED, THE NAME AND "RANDOM" ID FOR THE
/ DISK IN DRIVE 0 ARE READ INTO SYSID4-7.  THIS ROUTINE CHECKS TO MAKE
/ SURE THAT BOTH BLOCKS MATCH
/
/ IF NO MATCH IS FOUND, THE OPERATOR IS ASKED TO INSERT THE ORIGINAL SYSTEM
/ DISKETTE.  THE ROUTINE IS NOT EXITED UNTIL THE NAME AND "RANDOM" ID MATCH
/
/***********************************************************************

CHKID,	XX			/ CHECK ORIGINAL SYSTEM DISKETTE
	TAD	OPTNWD		/ Get original option word.
	CDFMNU			/ Map MENU field.
	DCA I	(MUBUF+MNOPTC)	/ Restore it.
	CDFMYF			/ Back to our field.
	TAD	OPNFIL		/ Did we open the file?
	SZA CLA			/ Skip if no. nothing to close.
	 JMS	CLOSEF		/ Call close file routine.
	JMS	GTDKID		/ Go read current drive diskette name & ID.
CHKID0,		SYSID+4-1	/  ...
	TAD	(-4		/
	DCA	T1		/ SET UP COUNTER
	TAD	(SYSID-1	/
	DCA	X1		/ SET UP SOURCE INDEX
	TAD	CHKID0		/  = (SYSID+4-1				/M006
	DCA	X2		/ SET UP COMPARE INDEX
CHKIDL,	TAD I	X1		/ READ OLD WORD
	CIA			/
	TAD I	X2		/ COMPARE WITH NEW WORD
	SZA CLA			/
	 JMP	GTDKER		/ NO, GO ASK FOR ORIGINAL SYSTEM DISKETTE
	ISZ	T1		/ SEE IF LAST WORD
	JMP	CHKIDL		/ NO, LOOP BACK
	JMP I	CHKID		/ RETURN TO CALLER

MOV100,	XX			/ INITIALIZE PAGE ZERO LOCATIONS
	TAD I	MOV100		/ PICK UP FIELD TO MOVE TOO
	DCA	MOV10F		/ STORE CHANGE FIELD INSTRUCTION
	ISZ	MOV100		/ BUMP RETURN ADDRESS OVER FIELD INSTRUCTION

	JMS	CPYBUF		/ Copy locations 0-77 to memory field X
		-100		/ 100 locations
		CDFMNU		/ from MENU field
		0000-1		/  location 0,
MOV10F,		XX		/   to field X,
		0000-1		/    location 0.

	JMP I	MOV100		/ RETURN TO CALLER

/***********************************************************************
/
/	GTDKID GETS THE DISK ID OF THE SYSTEM DISK
/	THE ID IS THE THREE NAME WORDS AND THE "RANDOM" WORD
/	IT IS USED TO INSURE THAT THE SAME SYSTEM DISK IS REINSERTED
/	IN CASES WHERE IT MUST BE REMOVED.
/
/***********************************************************************

GTDKID,	XX
	TAD I	GTDKID		/ Get buffer address to copy NAME & ID into.
	ISZ	GTDKID		/ Bump to return address.
	DCA	GTDKIA		/ save buffer address.

GTDK1,	CDIMNU			/ Get density of drive 0.
	DCA I	(CMDBLK+RXQDRV)	/ Set the drive # to 0.			/M004

	CDFMYF			/ Back to our field & Call RDFIO in MENU field.
	JMS I	(RDFIO)		/ Do a GET DENSITY to establish drive density.
		RXEDN+4000	/ "GET DENSITY" code.

	SPA CLA			/ Skip if no error.
	 JMP	GTDKER		/ Error. Display "replace" msg.

	CIFMNU			/ Go read in the home block.
	JMS I	(FILLIO)	/  ...
		RXERD+4000	/ Function				/A006
		CDFTXT		/ Read home block into block buffer.
		BUFADR		/  buffer address.
		-1		/ Size (1 block).
		DLDIR		/ Read the home block.
	 JMP	GTDKER		/ Error. Display "replace" msg.

	JMS	CPYBUF
		-4		/ Size
		CDFTXT		/ Source field.
		BUFADR+2-1	/ Source Address
		CDFMYF		/ DESTINATION FIELD
GTDKIA,		XX		/ DESTINATION ADDRESS

	JMP I	GTDKID		/ RETURN TO CALLER AFTER OBTAINING ID WORDS

GTDKER,	CDIMNU			/ Prompt user to insert the system diskette.
	JMS I	(SYPRMP)	/  ...
	JMP	GTDK1		/ Go retry.

SYSID,	0;0;0;0			/ System disk ID.
	0;0;0;0			/ ID of diskette in drive 0 at exit time.


	X=.			/ FIRST FREE LOCATION ON PAGE
/---------------------
	PAGE

RELOC				/ RESET RELOCATION COUNTER

CDFMYF=	CDFBUF			/ DEFINE OUR FIELD AS FIELD FOUR.
SPMENU= .			/ DEFINE OUR LOAD POINT.
SPLMNU= 200			/ DEFINE OUR RUN LOCATION.

RELOC	SPLMNU			/ RELOCATE TO WHERE CODE RUNS IN FIELD FOUR


/***************************************************************************
/****		     PAGE ZERO LOCATIONS IN FIELD FOUR			****
/***************************************************************************

			/ SET COUNTER TO LOCATION 100 ON PAGE ZERO

X= 100;	SPLFUN=	X	/ LOCATION FOR SPELL FUNCTION CODE
X= X+1;	SPLDRV=	X	/ LOCATION FOR USER SPECIFIED DRIVE NUMBER
X= X+1;	SPLMAX=	X	/ LOCATION FOR MAXIMUM DRIVE NUMBER
X= X+1;	SPLDOC=	X	/ LOCATION FOR CURRENT DOCUMENT NUMBER
X= X+1;	SPLMS1=	X	/ LOCATION FOR POINTER TO UTILITY/DICTIONARY TEXT
X= X+1;	SPLMS2=	X	/ LOCATION FOR POINTER TO DRIVE - DRIVE/DEVICE TEXT
X= X+1; SPLOPT=	X	/ LOCATION FOR SYSTEM OPTION CONFIGURATION BITS
X= X+1; SPLSDR=	X	/ LOCATION FOR USER DRIVE SELECTION FOR SPELL

X= X+1;	REDFLG=	X	/ LOCATION FOR READ ROUTINE DRIVE REQUEST FLAG
X= X+1;	REDDRV=	X	/ LOCATION FOR READ ROUTINE DRIVE NUMBER
X= X+1;	REDNUM=	X	/ LOCATION FOR READ ROUTINE CHARACTER COUNTER
X= X+1;	REDCHR=	X	/ LOCATION FOR READ ROUTINE INPUT CHARACTER

X= X+1;	VALADD=	X	/ LOCATION FOR VALIDATION TABLE POINTER ADDRESS
X= X+1;	SPLFNR=	X	/ LOCATION FOR FOOTNOTE RESULT DOC DRIVE NUMBER	/A010
X= X+1;	SPLOPR=	X	/ LOCATION FOR SPell OPeRation flag		/A010
			/	0 IF FOOTNOTING, NOT 0 IF DECSPELL	/A010

DSKBLK=	.-200%400+DLOSPM	/ DISK BLOCK WHERE PAGE IS LOADED

/ GETDRV IS CALLED BY THE EDITOR TO OBTAIN A VALID DRIVE NUMBER FOR THE
/ UTILITY DISK AND THE DICTIONARY DISK.  IT CALLS SPLGET TO PROMPT THE
/ USER FOR THE DRIVE NUMBER AND THEN CHECKS TO SEE IF THE USER SUPPLIED
/ NUMBER IS A VALID DRIVE NUMBER WITH THE PROPER DISKETTE LOADED.
/ IF NOT, IT CALLS SPLGET TO REPORT THE ERROR.
/
/ GETDRV IS CALLED AS FOLLOWS:
/
/	CDIBUF			/ CHANGE TO BUFFER FIELD
/	JMS I	GETDRV		/ CALL ROUTINE TO GET DRIVE NUMBER
/	JMP	GOLDMN		/ GOLD MENU RETURN
/	....			/ NORMAL RETURN
/
/	UPON ENTRY, THE AC CONTAINS ONE OF THE FOLLOWING VALUES:
/
/	AC = 0	ERROR CALL INDICATING AN ERROR DETECTED WHILE READING
/	AC = 1	REQUEST FOR WPS UTILITY DISKETTE
/	AC = 2	REQUEST FOR AMERICAN DICTIONARY DISKETTE
/	AC = 3	REQUEST FOR BRITISH DICTIONARY DISKETTE

GETDRV,	XX			/ ROUTINE TO GET DRIVE # VIA MENU.
GETBAD,	DCA	SPLFUN		/ SAVE SPELL FUNCTION CODE
	CDIBUF			/ SWICH TO FIELD FOUR FOR MENU ROUTINE
	JMS	SPLGET		/ GO PROMPT USER FOR DRIVE NUMBER
	  JMP	GETXIT		/  USER OPTED FOR GOLD:MENU RETURN.

	CIFMNU			/ MAP MENU FIELD.
	JMS	FILLIO		/ FIRST, READ IN THE ALLOC BLOCK.
		RXERD+4000	/ FUNCTION				/A006
		CDFTXT		/ USE THE BUFFER DEFINED IN TXT FIELD.
		BUFADR		/ BUFFER ADDRESS.
		-1		/ 1 BLOCK.
		DLALOC		/ ALLOCATION BLOCK.
	 JMP	GETBAD		/ REPORT BAD DISKETTE.

	CDFTXT			/ MAP BUFFER
	TAD I	(BUFADR+1)	/ SEE IF DOCUMENT DISKETTE.
	TAD	(-40)		/  40 MEANS DOCUMENT DISKETTE.
	SZA CLA			/ SKIP IF DOCUMENT DISKETTE.
	 JMP	GETBAD		/ REPORT VALIDATION ERROR.
	TAD I	(BUFADR+2)	/ CHECK MAX NUMBER OF DOCUMENTS ALLOWED.
	SZA CLA			/ SKIP IF NONE.
	 JMP	GETBAD		/ REPORT VALIDATION ERROR.

	CDFMYF			/ BACK TO OUR FIELD.
	CIFMNU			/ MAP MENU FIELD
	JMS	FILLIO		/ NOW READ THE HOME BLOCK.
		RXERD+4000	/ FUNCTION				/A006
		CDFTXT		/ USE THE SAME 2 PAGES.
		BUFADR		/  ...
		-1		/ 1 BLOCK.
		DLDIR		/ HOME BLOCK.
	 JMP	GETBAD		/ REPORT BAD DISKETTE.

VALDAT,	TAD	VALADD		/ GET TABLE ADDRESS POINTER TO NAME
	DCA	X0		/ SAVE IN AUTO INDEX REGISTER
	AC7775			/ SET UP TO COMPARE 3 WORDS.
	DCA	T1		/ STORE COUNT IN COUNTER
	TAD	(BUFADR+2-1)	/ POINTER TO ACTUAL DOCUMENT NAME.
	DCA	X1		/ SAVE IN AUTO INDEX REGISTER

VAL001,	CDFMYF			/ SWITCH BACK TO THIS FIELD
	TAD I	X0		/ PICK UP PART OF DESIRED NAME.
	CIA			/ SEE IF IT'S SAME AS DOCUMENT NAME.
	CDFTXT			/ SWITCH TO TEXT FIELD BUFFER
	TAD I	X1		/ GET WORD OF ACTUAL DOCUMENT NAME.
	SZA CLA			/ SKIP IF THE SAME.
	 JMP	GETBAD		/ REPORT VALIDATION ERROR.
	ISZ	T1		/ BUMP COUNT OF WORDS TO COMPARE.
	JMP	VAL001		/ LOOP UNTIL DONE WITH WORDS TO COMPARE

	ISZ	X1		/ POINT TO DATE OF BUILD.
	ISZ	X1		/  ...
X=BLDDY^100+BLDMO		/ COMPUTE EXPECTED DAY-MONTH VALUE.
	TAD	(-X)		/ SEE IF DATE OF BUILD MATCHES DISKETTE.
	TAD I	X1		/  IF NOT THEN DISKETTE IS OF A DIFFERENT BUILD
	SZA CLA			/  AND THEREFORE IS TO BE REJECTED.
	 JMP	GETBAD		/ REJECT DISKETTE IF FROM A DIFFERENT BUILD.

	TAD	(-BLDYR)	/ COMPARE YEAR OF BUILD TOO.
	TAD I	X1		/  THAT SHOULD MATCH AS WELL.
	SZA CLA			/ SKIP IF MATCH.
	 JMP	GETBAD		/ REJECT DISKETTE IF FROM A DIFFERENT BUILD.

	CDFMYF			/ SWITCH BACK TO THIS FIELD
	ISZ	GETDRV		/ BUMP RETURN POINT PAST GOLD MENU RETURN
	TAD	SPLMS1		/ GET THE MESSAGE POINTER TO UTL OR DIC
	TAD	(-SPLUTL)	/ SUBTRACT POINTER TO UTILITY DISK
	SZA CLA			/ ARE WE ABOUT TO LOAD THE UTILITY DISK ?
	JMP	GETXIT		/ NO, WE ARE DOING THE DICTIONARY DISK

	CIFMNU			/ YES, DISPLAY MESSAGE "LOADING SOFTWARE"
	JMS I	IOACAL		/ CALL STANDARD MESSAGE OUTPUT ROUTINE
	    0			/ USE DEFAULT OUTPUT CHANNEL
	    WRKTXT		/ POINTER TO MESSAGE CONTROL STRING
	    0200		/ CLEAR SCREEN FROM TIME DISPLAY FIRST	/A007
	    1020		/ SCREEN POSITION FOR FIRST TEXT LINE
	    SPLUTL		/ POINTER TO "WPS UTILITY SOFTWARE"

GETXIT,	CDIEDT			/ SWITCH BACK TO EDITOR FIELD
	JMP I	GETDRV		/ RETURN TO CALLER.

/
/
/	SPLINU	-	Report IF Drive(/device) in use by spell (or footnoting)
/			for a document & accept user response.
/
/

SPLINU,	XX								/A010
	TAD	SPLDOC		/ Get Spell or Footnote source drive no./A010
	CIA			/					/A010
	TAD	SPLDRV		/ Compare to Utility drive		/A010
	SNA CLA			/ They're different, we're ok so far	/A010
	 JMP	INUDSP		/  Same - ERROR - Go tell user &get resp./A010
	TAD	SPLOPR		/ See if we're footnoting		/A010
	SZA CLA			/ Yes we are - continue checking	/A010
	 JMP	INUOK		/  No we're not - take OK exit		/A010
	TAD	SPLFNR		/ Get Footnote result drive no.		/A010
	CIA			/					/A010
	TAD	SPLDRV		/ Compare to Utility drive		/A010
	SNA CLA			/ They're different - take OK exit	/A010
	 JMP	INUDSP		/  Same - ERROR - Go tell user &get resp./A010
INUOK,	ISZ	SPLINU		/ Begin setup of a RETURN+2 exit	/A010
	JMP	INUXIT		/ Go finish housekeeping		/A010
	

INUDSP,	CIFMNU			/ Display IN USE message		/A010
	JMS I	IOACAL		/					/A010	
	    0			/					/A010
	    INUERR		/					/A010
	    0			/					/A010
	    1002		/					/A010
	    SPLMS2		/					/A010

	AC7777			/ Signal RETURN & GOLD MENU as only resp./A010
	JMS	REDSPL		/ & get the user response		/A010
	 JMP	INUDSP		/  Invalid response - redisplay msg.	/A010
	  SKP			/   GOLD MENU - take "NORMAL" return	/A010
				/ RETURN - take "RETURN+1" return	/A010
INUXIT,	ISZ	SPLINU		/					/A010
	JMP I	SPLINU		/					/A010


VALTAB,		7061		/ 'WP'
		6466		/    'SU'
		6555		/       'TL' Utility diskette name.
		6664		/ 'US'	     American
		4552		/    'DI'
		4465		/       'CT' Dictionary diskette name.
		6654		/ 'UK'	     British
		4552		/    'DI'
		4465		/       'CT' Dictionary diskette name.


	X=.			/ FIRST FREE LOCATION ON PAGE
/---------------------
	PAGE

DSKBLK=	.-200%400+DLOSPM	/ DISK BLOCK WHERE PAGE IS LOADED

/ SPLGET IS CALLED FROM THE GETDRV ROUTINE TO PROMPT THE USER FOR A DISK
/ DRIVE NUMBER WHICH SHOULD CONTAIN EITHER THE WPS UTILITY SOFTWARE OR THE
/ AMERICAN OR BRITISH DICTIONARY.  THIS ROUTINE IS ALSO CALLED TO HANDLE A
/ DISK ERROR THAT MAY BE CAUSED BY THE USER NOT HAVING THE PROPER DISKETTE
/ LOADED IN THE SPECIFIED DRIVE OR A READ ERROR ON THE SPECIFIED DRIVE.
/
/ UPON ENTRY, THE VALUE STORED IN SPLFUN DETERMINES WHAT KIND OF REQUEST IS
/ BEING MADE.  A ZERO ENTRY INDICATES THAT THIS ROUTINE HAS BEEN CALLED
/ BEFORE AND THAT ALL TEXT POINTERS ARE CORRECTLY SET UP.  A NON-ZERO ENTRY
/ WILL CAUSE THE ROUTINE TO SET ITSELF UP TO HANDLE THE PROPER REQUEST.

/ AFTER THE USER HAS ENTERED A DRIVE NUMBER, IF NECESSARY, THE INDICATED
/ DRIVE NUMBER IS CHECKED VIA A GET-DENSITY CALL TO SEE IF IT CONTAINS A
/ DISKETTE OR FOR A WINCHESTER SYSTEM, THAT THE VOLUME IS MOUNTED.

/ UPON EXIT, CONTROL IS PASSED TO THE FIRST LOCATION FOLLOWING THE CALL IF
/ THE USER TYPED GOLD MENU TO ABORT THE OPERATION AND RETURN TO MAIN MENU.
/ CONTROL IS PASSED TO THE SECOND LOCATION FILLOWING THE CALL WHEN THE USER
/ ENTERS A VALID DRIVE NUMBER CONTAINING A MOUNTED DISKETTE OR VOLUME.

SPLGET,	XX			/ ENTRY POINT TO GET A DRIVE NUMBER FROM USER
	TAD	SPLFUN		/ PICK UP THE SPELL FUNCTION CODE
	SNA			/ IS THIS A VALIDATION ERROR OPERATION ?
	JMP	SPLVER		/ YES, GO HANDLE THE VALIDATION ERROR

	CLL RAL			/ MULTIPLY BY TWO
	TAD	SPLFUN		/ MULTIPLY BY THREE
	TAD	(VALTAB-1-3)	/ CONSTRUCT VALIDATION POINTER
	DCA	VALADD		/ STORE TABLE POINTER ADDRESS

	TAD	SPLFUN		/ GET THE FUNCTION CODE BACK
	TAD	(-1)		/ DECREMENT THE FUNCTION CODE
	SNA			/ IS THIS A UTILITY DISK REQUEST ?
	JMP	SPLGT1		/ YES, GO SET UP FOR THE UTILITY DISK

	TAD	(-1)		/ DECREMENT THE FUNCTION CODE
	SZA CLA			/ IS THIS AN AMERICAN DICTIONARY REQUEST ?
	TAD	(SPLUKD-SPLUSD)	/ NO,  SET UP FOR THE BRITISH DICTIONARY
	TAD	(SPLUSD-SPLUTL)	/ YES, SET UP FOR THE AMERICAN DICTIONARY
SPLGT1,	TAD	(SPLUTL)	/ ELSE SET UP FOR WPS UTILITY DISK
	DCA	SPLMS1		/ STORE POINTER TO UTL. OR DIC. TEXT STRING

	CDFMNU			/ CHANGE DATA FIELD TO THE MENU FIELD

	TAD	MNMXDR+MUBUF	/ PICK UP THE MAXIMUM DRIVE NUMBER ALLOWED
	DCA	SPLMAX		/ SAVE FOR LATER USE
/D010	TAD	MNFNO+MUBUF	/ PICK UP THE CURRENT DOCUMENT DRIVE NUMBER
	TAD	MNUTFN+MUBUF	/ PICK UP SPELL/FOOT.SRC. DRIVE/DOC NO.	/A010
	BSW;RTR;AND (17)	/ & ISOLATE DRIVE NO.			/A010
	DCA	SPLDOC		/ SAVE FOR LATER USE
	TAD	MNFNO+MUBUF	/ PICK UP FOOTNOTE RESULT DRIVE/DOC NO.	/A010
	BSW;RTR;AND (17)	/ & ISOLATE DRIVE NO.			/A010
	DCA	SPLFNR		/ SAVE FOR LATER USE			/A010
	TAD	MNTMP6+MUBUF	/ PICK UP OPERATION CODE		/A010
	TAD	(-12)		/ ADD IN NEGATIVE VALUE OF FOOTNOTE OPER./A010
	DCA	SPLOPR		/ & SAVE RESULT AS SPeLl OPeRation flag	/A010
	TAD	MNOPTN+MUBUF	/ PICK UP THE SYSTEM OPTION CONFIGURATION BITS
	DCA	SPLOPT		/ SAVE FOR LATER USE
	TAD	MNSDRV+MUBUF	/ PICK UP THE USER DRIVE SELLECTION FOR SPELL
	DCA	SPLSDR		/ SAVE FOR LATER USE
	CDFMYF			/ RETURN DATA FIELD TO OUR FIELD

	TAD	SPLOPT		/ GET OPTION CONFIGURATION BITS
	AND	(MNRX2X)	/ MASK OFF THE WINCHESTER ON LINE BIT
	SZA CLA			/ CHECK TO SEE IF THE WINCHESTER IS ON LINE
	TAD  (DEVTXT-DRVTXT)	/ YES, SET UP TO DISPLAY "DRIVE/DEVICE"
	TAD	(DRVTXT)	/ NO, SET UP TO DISPLAY "DRIVE"
	DCA	SPLMS2		/ STORE FOR MESSAGE DISPLAYS

	AC7776			/ SET THE AC EQUAL TO A MINUS 2
	TAD	SPLMAX		/ COMBINE WITH THE MAXIMUM DRIVE NUMBER
	SMA CLA			/ IS THIS A MULTI DRIVE SYSTEM ?
	JMP	SPLGDR		/ YES, GO REQUEST THE DRIVE NUMBER
				/ NO, THIS IS A TWO DRIVE SYSTEM
	TAD	SPLDOC		/ PICK UP THE DOCUMENT DRIVE NUMBER
	SNA CLA			/ IS DOCUMENT ON DRIVE NUMBER ONE ?
	AC0001			/ NO, DOCUMENT IS ON DRIVE ZERO
	DCA	SPLDRV		/ SELECT OTHER DRIVE FROM DOCUMENT
	JMP	SPLVE1		/ GO HANDLE AS A VALIDATION ERROR

SPLGDR,	CLA CLL CMA		/ SET AC TO MINUS ONE AND CLEAR THE LINK
	TAD	SPLFUN		/ COMBINE WITH FUNCTION CODE - SETS LINK
	SNA CLA			/ IS THIS A UTILITY DISK REQUEST ?
	CLL			/ YES, CLEAR THE LINK FOR INDICATOR
	TAD	SPLSDR		/ PICK UP THE USER DRIVE SELECTION FOR SPELL
	SNL			/ IS THE FLAG SET FOR THE DICTIONARY DISK
	JMP	SPLGD1		/ NO, GO HANDLE UTILITY DRIVE NUMBER
	BSW			/ YES, SWAP HIGH ORDER FOR LOW ORDER
	RTR			/ SHIFT DOWN TWO MORE PLACES
SPLGD1,	AND	(17)		/ MASK OFF THE DIRVE BITS
	DCA	SPLDRV		/ SAVE INDICATED DRIVE NUMBER
	TAD	SPLDRV		/ GET DRIVE NUMBER BACK AGAIN
	SZA CLA			/ WAS A DRIVE NUMBER SPECIFIED BY USER
	JMP	SPLDEN		/ YES, GO CHECK ITS DENSITY

SPLGD2,	CIFMNU			/ NO, PRINT "TYPE THE DRIVE/DEVICE NUMBER ..."
	JMS I	IOACAL		/ CALL STANDARD MESSAGE OUTPUT ROUTINE
	    0			/ USE DEFAULT OUTPUT CHANNEL
	    NUMTX1		/ POINTER TO MESSAGE CONTROL STRING
	    0			/ ADDRESS FOR CLEAR SCREEN COMMAND
	    1020		/ SCREEN POSITION FOR FIRST TEXT LINE
	    SPLMS2		/ POINTER TO "DRIVE" OR "DRIVE/DEVICE"
	    1220		/ SCREEN POSITION FOR SECOND TEXT LINE
	    SPLMS1		/ POINTER TO "UTILITY" OR "DICTIONARY"
	    SPLAND		/ POINTER TO "AND PRESS RETURN"

	JMS	REDSPL		/ GO HANDLE USER INPUT REQUEST
	    JMP	SPLGD2		/ USER ERROR - GO HANDLE IT
	    JMP	SPLGMR		/ USER TYPED "GOLD MENU", GO HANDLE IT
	    			/ USER TYPED "RETURN" - DO A DENSITY CHECK
SPLDEN,	TAD	SPLMAX		/ PICK UP THE MAXIMUM ALLOWABLE DRIVE NUMBER
	CMA			/ MAKE IT NEGATIVE
	TAD	SPLDRV		/ COMBINE WITH USER SELECTED DRIVE NUMBER
	SMA CLA			/ IS USER SELECTED DRIVE NUMBER WITHIN RANGE
	JMP	SPLGD2		/ NO, GO REQUEST A VALID DRIVE NUMBER

/d010	TAD	SPLDOC		/ PICK UP CURRENT DOCUMENT DRIVE NUMBER
/d010	CIA			/ MAKE IT NEGATIVE
/d010	TAD	SPLDRV		/ COMBINE WITH USER SELECTED DRIVE NUMBER
/d010	SNA CLA			/ DID USER SELECT THE DOCUMENT DRIVE ?
/d010	JMP	SPLGD2		/ YES, GO REQUEST A VALID DRIVE NUMBER

	JMS	SPLINU		/ CHECK TO SEE IF DRIVE ALREADY IN USE	/A010
	 JMP	SPLGMR		/  YES & USER GAVE GOLD-MENU		/A010
	  JMP	SPLGD2		/   "  "  "    "   RETURN -  TRY AGAIN	/A010

	TAD	SPLDRV		/ PICK UP THE DRIVE NUMBER
	CDIMNU			/ GET DENSITY OF SC/DD DISKETTE.
	DCA I	(CMDBLK+RXQDRV)	/ SET TO USER SPECIFIED DRIVE NUMBER.
	CDFMYF			/ BACK TO OUR FIELD & CALL RDFIO IN MENU FIELD.
	JMS I	(RDFIO)		/ DO A GET DENSITY TO ESTABLISH DRIVE DENSITY.
		RXEDN+4000	/ "GET DENSITY" CODE.
	SPA CLA			/ SKIP IF NO ERROR.
	  JMP	DENERR		/ GET DENSITY ERROR DETECTED, REPORT TO USER

	ISZ	SPLGET		/ BUMP THE RETURN ADDRESS POINTER
SPLGMR,	JMP I	SPLGET		/ RETURN TO CALLER


	X=.			/ FIRST FREE LOCATION ON PAGE
/---------------------
	PAGE

DSKBLK=	.-200%400+DLOSPM	/ DISK BLOCK WHERE PAGE IS LOADED

/ TEXT SUBROUTINES TO PLACE COMMON TEXT STRINGS ON THE SCREEN

SPLTX1,	XX			/ PRINT "REMOVE THE DISKETTE FROM DRIVE ..."
	CIFMNU			/ CHANGE INDTRUCTION FIELD TO MENU FIELD
	JMS I	IOACAL		/ CALL STANDARD MESSAGE OUTPUT ROUTINE
	    0			/ USE DEFAULT OUTPUT CHANNEL
	    REMTXT		/ POINTER TO MESSAGE CONTROL STRING
	    0			/ ADDRESS FOR CLEAR SCREEN COMMAND
	    1020		/ SCREEN POSITION FOR FIRST TEXT LINE
	    SPLDRV		/ POINTER TO DRIVE NUMBER
	    1220		/ SCREEN POSITION FOR SECOND TEXT LINE
	    SPLMS1		/ POINTER TO "UTILITY" OR "DICTIONARY"
	    SPLAND		/ POINTER TO "AND PRESS RETURN"
	JMP I	SPLTX1		/ RETURN TO CALLER

SPLTX2,	XX			/ PRINT "INSERT THE DISKETTE INTO DRIVE ..."
	CIFMNU			/ CHANGE INDTRUCTION FIELD TO MENU FIELD
	JMS I	IOACAL		/ CALL STANDARD MESSAGE OUTPUT ROUTINE
	    0			/ USE DEFAULT OUTPUT CHANNEL
	    INSTXT		/ POINTER TO MESSAGE CONTROL STRING
	    0			/ ADDRESS FOR CLEAR SCREEN COMMAND
	    1020		/ SCREEN POSITION FOR FIRST TEXT LINE
	    SPLMS1		/ POINTER TO "UTILITY" OR "DICTIONARY"
	    1220		/ SCREEN POSITION FOR SECOND TEXT LINE
	    SPLDRV		/ POINTER TO DRIVE NUMBER
	    SPLAND		/ POINTER TO "AND PRESS RETURN"
	JMP I	SPLTX2		/ RETURN TO CALLER

SPLTX3,	XX			/ PRINT "TYPE THE DRIVE/DEVICE NUMBER ..."
	CIFMNU			/ CHANGE INDTRUCTION FIELD TO MENU FIELD
	JMS I	IOACAL		/ CALL STANDARD MESSAGE OUTPUT ROUTINE
	    0			/ USE DEFAULT OUTPUT CHANNEL
	    NUMTX1		/ POINTER TO MESSAGE CONTROL STRING
	    1600		/ ADDRESS FOR CLEAR SCREEN COMMAND
	    1620		/ SCREEN POSITION FOR FIRST TEXT LINE
	    SPLMS2		/ POINTER TO "DRIVE" OR "DRIVE/DEVICE"
	    2020		/ SCREEN POSITION FOR SECOND TEXT LINE
	    SPLMS1		/ POINTER TO "UTILITY" OR "DICTIONARY"
	    SPLAND		/ POINTER TO "AND PRESS RETURN"
	JMP I	SPLTX3		/ RETURN TO CALLER

SPLTX4,	XX			/ PRINT "OR TYPE THE DRIVE/DEVICE NUMBER ..."
	CIFMNU			/ CHANGE INDTRUCTION FIELD TO MENU FIELD
	JMS I	IOACAL		/ CALL STANDARD MESSAGE OUTPUT ROUTINE
	    0			/ USE DEFAULT OUTPUT CHANNEL
	    NUMTX2		/ POINTER TO MESSAGE CONTROL STRING
	    1620		/ SCREEN POSITION FOR FIRST TEXT LINE
	    SPLMS2		/ POINTER TO "DRIVE" OR "DRIVE/DEVICE"
	    2020		/ SCREEN POSITION FOR SECOND TEXT LINE
	    SPLMS1		/ POINTER TO "UTILITY" OR "DICTIONARY"
	    SPLAND		/ POINTER TO "AND PRESS RETURN"
	JMP I	SPLTX4		/ RETURN TO CALLER

/ COME HERE TO HANDLE VALIDATION ERRORS

SPLVER,	AC7776			/ SET THE AC EQUAL TO A MINUS 2
	TAD	SPLMAX		/ COMBINE WITH THE MAXIMUM DRIVE NUMBER
	SMA CLA			/ IS THIS A MULTI DRIVE SYSTEM ?
	JMP	SPLTYP		/ YES, GO CHECK DRIVE TYPE

SPLVE1,	JMS	SPLTX1		/ PRINT "REMOVE THE DISKETTE FROM DRIVE ..."
	AC7777			/ SET UP FOR NO DRIVE NUMBER ALLOWED
	JMS	REDSPL		/ GO HANDLE USER INPUT REQUEST
	    JMP	SPLVE1		/ USER ERROR - GO HANDLE IT
	    JMP	SPLGMR		/ USER TYPED "GOLD MENU", GO HANDLE IT
	    JMP SPLDEN		/ USER TYPED "RETURN", GO HANDLE IT

SPLTYP,	JMS	SPLSEL		/ CHECK IF DRIVE IS WINCHESTER OR FLOPPY
	JMP	SPLVE3		/ WINCHESTER, DISPLAY "VOLUME DOES NOT ..."

SPLVE2,	JMS	SPLTX1		/ PRINT "REMOVE THE DISKETTE FROM DRIVE ..."
	JMS	SPLTX4		/ PRINT "OR TYPE THE DRIVE/DEVICE NUMBER ..."
	AC0001			/ SET UP FOR OPTIONAL DRIVE NUMBER
	JMS	REDSPL		/ GO HANDLE USER INPUT REQUEST
	    JMP	SPLVE2		/ USER ERROR - GO HANDLE IT
	    JMP	SPLGMR		/ USER TYPED "GOLD MENU", GO HANDLE IT
	    JMP SPLDEN		/ USER TYPED "RETURN", GO HANDLE IT

SPLVE3,	CIFMNU			/ YES, HANDLE VOLUME DOES NOT CONTAIN...
	JMS I	IOACAL		/ CALL STANDARD MESSAGE OUTPUT ROUTINE
	    0			/ USE DEFAULT OUTPUT CHANNEL
	    SPLVNC		/ POINTER TO MESSAGE CONTROL STRING
	    0			/ ADDRESS FOR CLEAR SCREEN COMMAND
	    1020		/ SCREEN POSITION FOR FIRST TEXT LINE
	    SPLDRV		/ POINTER TO DRIVE NUMBER
	    SPLMS1		/ POINTER TO "UTILITY" OR "DICTIONARY"
	JMS	SPLTX3		/ PRINT "TYPE THE DRIVE/DEVICE NUMBER ..."
	JMS	REDSPL		/ GO HANDLE USER INPUT REQUEST
	    JMP	SPLVE3		/ USER ERROR - GO HANDLE IT
	    JMP	SPLGMR		/ USER TYPED "GOLD MENU", GO HANDLE IT
	    JMP SPLDEN		/ USER TYPED "RETURN", GO HANDLE IT

/ COME HERE TO HANDLE DENSITY ERRORS

DENERR,	AC7776			/ SET THE AC EQUAL TO A MINUS 2
	TAD	SPLMAX		/ COMBINE WITH THE MAXIMUM DRIVE NUMBER
	SMA CLA			/ IS THIS A MULTI DRIVE SYSTEM ?
	JMP	DENTYP		/ YES, GO CHECK DRIVE TYPE

SPLDE1,	JMS	SPLTX2		/ PRINT "INSERT THE DISKETTE INTO DRIVE ..."
	AC7777			/ SET UP FOR NO DRIVE NUMBER ALLOWED
	JMS	REDSPL		/ GO HANDLE USER INPUT REQUEST
	    JMP	SPLDE1		/ USER ERROR - GO HANDLE IT
	    JMP	SPLGMR		/ USER TYPED "GOLD MENU", GO HANDLE IT
	    JMP SPLDEN		/ USER TYPED "RETURN", GO HANDLE IT

DENTYP,	JMS	SPLSEL		/ CHECK IF DRIVE IS WINCHESTER OR FLOPPY
	JMP	SPLDE3		/ WINCHESTER, DISPLAY "VOLUME NOT ASSIGNED"

SPLDE2,	JMS	SPLTX2		/ PRINT "INSERT THE DISKETTE INTO DRIVE ..."
	JMS	SPLTX4		/ PRINT "OR TYPE THE DRIVE/DEVICE NUMBER ..."
	AC0001			/ SET UP FOR OPTIONAL DRIVE NUMBER
	JMS	REDSPL		/ GO HANDLE USER INPUT REQUEST
	    JMP	SPLDE2		/ USER ERROR - GO HANDLE IT
	    JMP	SPLGMR		/ USER TYPED "GOLD MENU", GO HANDLE IT
	    JMP SPLDEN		/ USER TYPED "RETURN", GO HANDLE IT

SPLDE3,	CIFMNU			/ YES, HANDLE VOLUME NOT ASSIGNED
	JMS I	IOACAL		/ CALL STANDARD MESSAGE OUTPUT ROUTINE
	    0			/ USE DEFAULT OUTPUT CHANNEL
	    SPLNAS		/ POINTER TO MESSAGE CONTROL STRING
	    0			/ ADDRESS FOR CLEAR SCREEN COMMAND
	    1020		/ SCREEN POSITION FOR FIRST TEXT LINE
	    SPLDRV		/ POINTER TO DRIVE NUMBER
	JMS	SPLTX3		/ PRINT "TYPE THE DRIVE/DEVICE NUMBER ..."
	JMS	REDSPL		/ GO HANDLE USER INPUT REQUEST
	    JMP	SPLDE3		/ USER ERROR - GO HANDLE IT
	    JMP	SPLGMR		/ USER TYPED "GOLD MENU", GO HANDLE IT
	    JMP SPLDEN		/ USER TYPED "RETURN", GO HANDLE IT

	X=.			/ FIRST FREE LOCATION ON PAGE
/---------------------
	PAGE

DSKBLK=	.-200%400+DLOSPM	/ DISK BLOCK WHERE PAGE IS LOADED

/ REDSPL IS THE ROUTINE THAT HANDLES THE USER RESPONSE.  IT DISPLAYS
/ THE COMMON TEXT MESSAGE AND SELECTIVLY ACCEPTS ONLY THE KEYS FOR
/ "RETURN" AND "GOLD-MENU" OR IT ALSO ACCEPTS A DIRVE NUMBER OF ONE DIGIT
/ AND ALLOWS THE USER TO RUB-OUT A MISTAKE.
/
/ UPON ENTRY:
/
/ A NEGATIVE VALUE IN THE AC MEANS THAT NO DRIVE NUMBER IS ALLOWED AND THAT
/ ONLY THE "RETURN" KEY AND THE "GOLD-MENU" KEYS ARE VALID.
/
/ A POSITIVE VALUE IN THE AC MEANS THAT THE DRIVE NUMBER IS OPTIONAL AND
/ THAT THE "RETURN" KEY AND THE "GOLD-MENU" KEYS ARE VALID.
/
/ A ZERO VALUE IN THE AC MEANS THAT THE DRIVE NUMBER IS REQUIRED AND THAT
/ A NUL-RESPONSE WILL GENERATE AN ERROR.  THE DRIVE NUMBER CAN ONLY BE ONE
/ DECIMAL CHARACTER AND IS TERMINATED BY PRESSING THE "RETURN" KEY.
/ THE RUBOUT KEY CAN BE USED TO CORRECT AN ERROR IN THE FIRST DIGIT.
/ TWO DIGITS OR ANY NON DIGIT KEY TERMINATES WITH AN ERROR.
/
/ UPON EXIT:
/
/ CONTROL IS TRANSFERED TO THE FIRST LOCATION FOLLOWING THE CALL WHEN A USER
/ INPUT ERROR IS DETECTED AND CAUSES THE TERMINAL BELL TO RING.  AC IS CLEAR.
/
/ CONTROL IS TRANSFERED TO THE SECOND LOCATION FOLLOWING THE CALL IF THE USER
/ PRESSES THE "GOLD-MENU" KEYS.  AC IS CLEAR.
/
/ CONTROL IS TRANSFERED TO THE THIRD LOCATION FOLLOWING THE CALL WHEN THE USER
/ SUCCESSFULLY PRESSES THE RETURN KEY OR ENTERS A ONE DIGIT DRIVE NUMBER AND
/ THEN PRESSES THE RETURN KEY.  THE LOCATION SPLDRV IS UPDATED WITH THE
/ VALUE FROM REDDRV IF THE USER ACTUALLY TYPED A DRIVE NUMBER.  AC IS CLEAR.

REDSPL,	XX			/ HANDLE THE USER RESPONSE
	DCA	REDFLG		/ SAVE DRIVE NUMBER REQUEST VALUE

	CIFMNU			/ CHANGE INDTRUCTION FIELD TO MENU FIELD
	JMS I	IOACAL		/ CALL STANDARD MESSAGE OUTPUT ROUTINE
	    0			/ USE DEFAULT OUTPUT CHANNEL
	    REDTXT		/ POINTER TO MESSAGE CONTROL STRING
	    2520		/ ADDRESS FOR LINE OF COMMON TEXT
	    GMTXT		/ "OR PRESS GOLD MENU ..."
	    2700		/ POSSITION CURSOR TO BOTTOM SCREEN LINE
	DCA	REDDRV		/ CLEAR THE SAVED DRIVE NUMBER

REDNXT,	DCA	REDNUM		/ STORE NEW CHARACTER COUNT
	CIFMNU			/ CHANGE INDTRUCTION FIELD TO MENU FIELD
	JMS I	(INAIN)		/ GO GET A CHARACTER AND DISPLAY TIME
	DCA	REDCHR		/ SAVE CHARACTER THAT USER TYPED

	TAD	REDFLG		/ GET THE DRIVE NUMBER REQUESTED FLAG
	SPA CLA			/ CAN USER ENTER A DRIVE NUMBER ?
	JMP	RETTST		/ NO, ONLY RETURN AND GOLD MENU ALLOWED

	AC7777			/ SET THE AC EQUAL TO A MINUS ONE
	TAD	REDNUM		/ COMBINE WITH THE CHARACTER COUNT
	SNA CLA			/ HAS THE USER ENTERED ONE CHARACTER ?
	JMP	RUBTST		/ YES, THEN NO MORE DIGITS ARE ALLOWED

	TAD	REDCHR		/ GET CHARACTER THAT USER ENTERED
	SPA			/ IS IT A SPECIAL CHARACTER ?
	JMP	RUBTST		/ YES, GO CHECK FOR A VALID ONE
	TAD	(-60)		/ NO, CHECK FOR AN ASCII "0" CHARACTER
	SPA CLA			/ IS CHARACTER AT LEAST A "0" ?
	JMP	REDERR		/ NO, IT'S LESS THAN "0", GO REPORT ERROR

	TAD	REDCHR		/ GET CHARACTER THAT USER ENTERED
	TAD	(-72)		/ CHECK FOR AN ASCII "9" CHARACTER
	SMA CLA			/ IS CHARACTER GREATER THAN A "9"
	JMP	REDERR		/ YES, GO REPORT THE ERROR

	TAD	REDCHR		/ PICK UP CHARACTER USER TYPED
	AND	(17)		/ MASK OFF DRIVE BITS
	DCA	REDDRV		/ SAVE DRIVE NUMBER

	TAD	REDCHR		/ PICK UP CHARACTER THAT USER TYPED
	JMS	REDOUT		/ ECHO CHARACTER ON SCREEN
	AC0001			/ SET UP FOR AN INCREMENT
	JMP	REDSET		/ GO UPDATE THE CHARACTER COUNT

RUBTST,	TAD	REDCHR		/ PICK UP CHARACTER THAT USER TYPED
	TAD	(-EDRBCH)	/ CHECK FOR THE "RUB-OUT" KEY
	SZA CLA			/ IS IT A MATCH ?
	JMP	RETTST		/ NO, GO CHECK FOR THE OTHER CHARACTERS
	TAD	REDNUM		/ YES, PICK UP THE CHARACTER COUNT
	SNA CLA			/ IS THERE ANYTHING TO RUB-OUT
	JMP	REDNXT		/ NO, JUST IGNORE THE KEY

	TAD	(10)		/ PICK UP THE BACK SPACE CHARACTER CODE
	JMS	REDOUT		/ OUTPUT IT TO THE SCREEN
	TAD	(40)		/ PICK UP THE SPACE CHARACTER CODE
	JMS	REDOUT		/ OUTPUT IT TO THE SCREEN
	TAD	(10)		/ PICK UP THE BACK SPACE CHARACTER CODE
	JMS	REDOUT		/ OUTPUT IT TO THE SCREEN

	DCA	REDDRV		/ CLEAR DRIVE NUMBER
	AC7777			/ SET UP FOR A DECREMENT
REDSET,	TAD	REDNUM		/ COMBINE WITH CHARACTER COUNT
	JMP	REDNXT		/ GO STORE NEW CHARACTER COUNT

RETTST,	TAD	REDCHR		/ PICK UP CHARACTER THAT USER TYPED
	TAD	(-EDMENU)	/ COMBINE WITH GOLD MENU CODE
	SNA CLA			/ DID USER TYPE "GOLD-MENU" ?
	JMP	GMXIT		/ YES, GO TAKE GOLD MENU EXIT

	TAD	REDCHR		/ PICK UP CHARACTER THAT USER TYPED
	TAD	(-EDNWLN)	/ COMBINE WITH RETURN KEY CODE
	SZA CLA			/ DID USER TYPE "RETURN" ?
	JMP	REDERR		/ NO, GO REPORT ERROR

	TAD	REDFLG		/ GET DRIVE NUMBER REQUEST FLAG
	SZA CLA			/ MUST THE USER ENTER A DRIVE NUMBER ?
	JMP	RETXIT		/ NO, TAKE NORMAL RETURN WITH CLEAR AC

	TAD	REDNUM		/ PICK UP THE CHARACTER COUNT
	SNA CLA			/ DID THE USER TYPE ANYTHING ?
	JMP	REDERR		/ NO, GO REPORT THE ERROR

RETXIT,	TAD	REDNUM		/ PICK UP THE CHARACTER COUNT
	SNA CLA			/ DID THE USER ENTER A DRIVE NUMBER
	JMP	REDXIT		/ NO, THEN DO NOT UPDATE THE DRIVE NUMBER
	TAD	REDDRV		/ PICK UP THE USER SPECIFIED DRIVE NUMBER
	DCA	SPLDRV		/ SET UP THE NEW DRIVE NUMBER

REDXIT,	ISZ	REDSPL		/ BUMP RETURN ADDRESS TO NORMAL RETURN
GMXIT,	ISZ	REDSPL		/ BUMP RETURN ADDRESS TO GOLD MENU RETURN
	JMP I	REDSPL		/ RETURN TO CALLER

REDERR,	CIFMNU			/ CHANGE INDTRUCTION FIELD TO MENU FIELD
	JMS I	IOACAL		/ CALL STANDARD MESSAGE OUTPUT ROUTINE
	    0			/ USE DEFAULT OUTPUT CHANNEL
	    ERRTXT		/ POINTER TO CONTROL STRING TO RING BELL
	JMP I	REDSPL		/ TAKE ERROR RETURN TO CALLER

REDOUT,	XX			/ ROUTINE TO OUTPUT A CHARACTER
	JMP	REDOT2		/ SKIP OVER JWAIT INSTRUCTION

REDOT1,	CIFSYS			/ CHANGE INSTRUCTION FIELD TO SYSTEM FIELD
	JWAIT			/ WAIT FOR NEXT SIGNIFICENT EVENT

REDOT2,	CIFSYS			/ CHANGE INSTRUCTION FIELD TO SYSTEM FIELD
	TTYOU			/ TRY TO OUTPUT THE CHARACTER TO THE SCREEN
	JMP	REDOT1		/ BUSY, GO TO SYSTEM WAIT ROUTINE
	JMP I	REDOUT		/ DONE, RETURN TO CALLER

/ SPLSEL IS A ROUTINE THAT WILL DETERMINE IF THE SPECIFIED DRIVE NUMBER
/ BELONGS TO A WINCHESTER DEVICE OR A FLOPPY DISK DRIVE.
/ RETURN IS TO CALL+1 FOR WINCHESTER AND CALL+2 FOR FLOPPY.

SPLSEL,	XX			/ CHECK DRIVE SELECTION FOR DEVICE TYPE
	TAD	SPLOPT		/ GET OPTION CONFIGURATION BITS
	AND	(MNRX2X)	/ MASK OFF WINCHESTER ON LINE BIT
	SNA CLA			/ CHECK FOR WINCHESTER ON LINE
	JMP	SPLFLP		/ NO, DRIVE MUST BELONG TO A FLOPPY
	TAD	SPLDRV		/ PICK UP THE DRIVE NUMBER
	TAD	(-10)		/ SUBTRACT FOR DRIVES 0 TO 7
	SMA CLA			/ CHECK FOR DRIVES 8 AND 9
	JMP	SPLFLP		/ YES, THEN DRIVES ARE FLOPPY
	TAD	SPLOPT		/ GET OPTION CONFIGURATION BITS
	AND	(MNRX4X)	/ MASK OFF DRIVE 0 ASSIGNED TO WINNI BIT
	SZA CLA			/ CHECK FOR SYSTEM RUNNING ON WINCHESTER
	JMP	SPLWIN		/ YES, DRIVE MUST BELONG TO WINCHESTER
	TAD	SPLDRV		/ PICK UP THE DRIVE NUMBER
	SNA			/ CHECK FOR DRIVE ZERO
	JMP	SPLFLP		/ YES, THEN IT'S A FLOPPY
	TAD	(-1)		/ DECREMENT THE DRIVE COUNT
	SZA CLA			/ CHECK FOR DRIVE ONE
	JMP	SPLWIN		/ NO, DRIVE MUST BELONG TO WINCHESTER
	TAD	SPLOPT		/ GET OPTION CONFIGURATION BITS
	AND	(MNRX3X)	/ MASK OFF DRIVE ONE ASSIGNED TO WINNI BIT
	SNA CLA			/ CHECK FOR DRIVE ONE ASSIGNED TO WINCHESTER
SPLFLP,	ISZ	SPLSEL		/ NO, DRIVE BELONGS TO FLOPPY DRIVE
SPLWIN,	JMP I	SPLSEL		/ YES, DRIVE BELONGS TO WINCHESTER


	X=.			/ FIRST FREE LOCATION ON PAGE
/---------------------
	PAGE

/ TEXT MESSAGES DISPLAYED WHEN REQUESTING THE WPS UTILITY SOFTWARE
/
/-----------------------------------------------------------------------------
/ TWO DRIVE SYSTEM	|  REMOVE THE DISKETTE FROM DRIVE 0 AND INSERT THE
/ VALIDATION ERROR  VE1	|  WPS UTILITY SOFTWARE DISKETTE AND PRESS RETURN
/ DRIVE NUMBER ERROR	|
/ RETURN OR GOLD MENU	|  OR PRESS GOLD MENU TO RECALL THE MAIN MENU.
/-----------------------------------------------------------------------------
/ TWO DRIVE SYSTEM	|  INSERT THE WPS UTILITY SOFTWARE DISKETTE
/ GET DENSITY ERROR DE1	|  INTO DRIVE 1 AND PRESS RETURN
/ DRIVE NUMBER ERROR	|
/ RETURN OR GOLD MENU	|  OR PRESS GOLD MENU TO RECALL THE MAIN MENU.
/-----------------------------------------------------------------------------
/ MULTI DRIVE SYSTEM	|  TYPE THE DRIVE NUMBER THAT CONTAINS THE
/ NO DEFAULT SET    GDR	|  WPS UTILITY SOFTWARE AND PRESS RETURN
/ DRIVE NUMBER REQURIED	|
/ GOLD MENU		|  OR PRESS GOLD MENU TO RECALL THE MAIN MENU.
/-----------------------------------------------------------------------------
/ MULTI DRIVE SYSTEM	|  REMOVE THE DISKETTE FROM DRIVE 0 AND INSERT THE
/ VALIDATION ERROR  VE2	|  WPS UTILITY SOFTWARE DISKETTE AND PRESS RETURN
/ 			|
/ 			|  OR TYPE THE DRIVE NUMBER THAT CONTAINS THE
/ 			|  WPS UTILITY SOFTWARE AND PRESS RETURN
/ DRIVE NUMBER OPTIONAL	|
/ RETURN OR GOLD MENU	|  OR PRESS GOLD MENU TO RECALL THE MAIN MENU.
/-----------------------------------------------------------------------------
/ MULTI DRIVE SYSTEM	|  INSERT THE WPS UTILITY SOFTWARE DISKETTE
/ GET DENSITY ERROR DE2	|  INTO DRIVE 1 AND PRESS RETURN
/ 			|
/ 			|  OR TYPE THE DRIVE NUMBER THAT CONTAINS THE
/ 			|  WPS UTILITY SOFTWARE AND PRESS RETURN
/ DRIVE NUMBER OPTIONAL	|
/ RETURN OR GOLD MENU	|  OR PRESS GOLD MENU TO RECALL THE MAIN MENU.
/-----------------------------------------------------------------------------
/ WINCHESTER SYSTEM	|  TYPE THE DRIVE/DEVICE NUMBER THAT CONTAINS THE
/ NO DEFAULT SET    GDR	|  WPS UTILITY SOFTWARE AND PRESS RETURN
/ DRIVE NUMBER REQURIED	|
/ GOLD MENU		|  OR PRESS GOLD MENU TO RECALL THE MAIN MENU.
/-----------------------------------------------------------------------------
/ WINCHESTER SYSTEM	|  VOLUME 5 DOES NOT CONTAIN THE WPS UTILITY SOFTWARE
/ VALIDATION ERROR  VE3	|
/ 			|  TYPE THE DRIVE/DEVICE NUMBER THAT CONTAINS THE
/ 			|  WPS UTILITY SOFTWARE AND PRESS RETURN
/ DRIVE NUMBER REQURIED	|
/ GOLD MENU		|  OR PRESS GOLD MENU TO RECALL THE MAIN MENU.
/-----------------------------------------------------------------------------
/ WINCHESTER SYSTEM	|  VOLUME 5 IS NOT ASSIGNED.
/ GET DENSITY ERROR DE3	|
/ 			|  TYPE THE DRIVE/DEVICE NUMBER THAT CONTAINS THE
/ 			|  WPS UTILITY SOFTWARE AND PRESS RETURN
/ DRIVE NUMBER REQURIED	|
/ GOLD MENU		|  OR PRESS GOLD MENU TO RECALL THE MAIN MENU.
/-----------------------------------------------------------------------------

/ TEXT MESSAGES DISPLAYED WHEN REQUESTING THE AMERICAN DICTIONARY
/
/-----------------------------------------------------------------------------
/ TWO DRIVE SYSTEM	|  REMOVE THE DISKETTE FROM DRIVE 0 AND INSERT THE
/ VALIDATION ERROR  VE1	|  AMERICAN DICTIONARY DISKETTE AND PRESS RETURN
/ DRIVE NUMBER ERROR	|
/ RETURN OR GOLD MENU	|  OR PRESS GOLD MENU TO RECALL THE MAIN MENU.
/-----------------------------------------------------------------------------
/ TWO DRIVE SYSTEM	|  INSERT THE AMERICAN DICTIONARY DISKETTE
/ GET DENSITY ERROR DE1	|  INTO DRIVE 1 AND PRESS RETURN
/ DRIVE NUMBER ERROR	|
/ RETURN OR GOLD MENU	|  OR PRESS GOLD MENU TO RECALL THE MAIN MENU.
/-----------------------------------------------------------------------------
/ MULTI DRIVE SYSTEM	|  TYPE THE DRIVE NUMBER THAT CONTAINS THE
/ NO DEFAULT SET    GDR	|  AMERICAN DICTIONARY AND PRESS RETURN
/ DRIVE NUMBER REQURIED	|
/ GOLD MENU		|  OR PRESS GOLD MENU TO RECALL THE MAIN MENU.
/-----------------------------------------------------------------------------
/ MULTI DRIVE SYSTEM	|  REMOVE THE DISKETTE FROM DRIVE 0 AND INSERT THE
/ VALIDATION ERROR  VE2	|  AMERICAN DICTIONARY DISKETTE AND PRESS RETURN
/ 			|
/ 			|  OR TYPE THE DRIVE NUMBER THAT CONTAINS THE
/ 			|  AMERICAN DICTIONARY AND PRESS RETURN
/ DRIVE NUMBER OPTIONAL	|
/ RETURN OR GOLD MENU	|  OR PRESS GOLD MENU TO RECALL THE MAIN MENU.
/-----------------------------------------------------------------------------
/ MULTI DRIVE SYSTEM	|  INSERT THE AMERICAN DICTIONARY DISKETTE
/ GET DENSITY ERROR DE2	|  INTO DRIVE 1 AND PRESS RETURN
/ 			|
/ 			|  OR TYPE THE DRIVE NUMBER THAT CONTAINS THE
/ 			|  AMERICAN DICTIONARY AND PRESS RETURN
/ DRIVE NUMBER OPTIONAL	|
/ RETURN OR GOLD MENU	|  OR PRESS GOLD MENU TO RECALL THE MAIN MENU.
/-----------------------------------------------------------------------------
/ WINCHESTER SYSTEM	|  TYPE THE DRIVE/DEVICE NUMBER THAT CONTAINS THE
/ NO DEFAULT SET    GDR	|  AMERICAN DICTIONARY AND PRESS RETURN
/ DRIVE NUMBER REQURIED	|
/ GOLD MENU		|  OR PRESS GOLD MENU TO RECALL THE MAIN MENU.
/-----------------------------------------------------------------------------
/ WINCHESTER SYSTEM	|  VOLUME 5 DOES NOT CONTAIN THE AMERICAN DICTIONARY
/ VALIDATION ERROR  VE3	|
/ 			|  TYPE THE DRIVE/DEVICE NUMBER THAT CONTAINS THE
/ 			|  AMERICAN DICTIONARY AND PRESS RETURN
/ DRIVE NUMBER REQURIED	|
/ GOLD MENU		|  OR PRESS GOLD MENU TO RECALL THE MAIN MENU.
/-----------------------------------------------------------------------------
/ WINCHESTER SYSTEM	|  VOLUME 5 IS NOT ASSIGNED.
/ GET DENSITY ERROR DE3	|
/ 			|  TYPE THE DRIVE/DEVICE NUMBER THAT CONTAINS THE
/ 			|  AMERICAN DICTIONARY AND PRESS RETURN
/ DRIVE NUMBER REQURIED	|
/ GOLD MENU		|  OR PRESS GOLD MENU TO RECALL THE MAIN MENU.
/-----------------------------------------------------------------------------

/ TEXT MESSAGES DISPLAYED WHEN REQUESTING THE BRITISH DICTIONARY
/
/-----------------------------------------------------------------------------
/ TWO DRIVE SYSTEM	|  REMOVE THE DISKETTE FROM DRIVE 0 AND INSERT THE
/ VALIDATION ERROR  VE1	|  BRITISH DICTIONARY DISKETTE AND PRESS RETURN
/ DRIVE NUMBER ERROR	|
/ RETURN OR GOLD MENU	|  OR PRESS GOLD MENU TO RECALL THE MAIN MENU.
/-----------------------------------------------------------------------------
/ TWO DRIVE SYSTEM	|  INSERT THE BRITISH DICTIONARY DISKETTE
/ GET DENSITY ERROR DE1	|  INTO DRIVE 1 AND PRESS RETURN
/ DRIVE NUMBER ERROR	|
/ RETURN OR GOLD MENU	|  OR PRESS GOLD MENU TO RECALL THE MAIN MENU.
/-----------------------------------------------------------------------------
/ MULTI DRIVE SYSTEM	|  TYPE THE DRIVE NUMBER THAT CONTAINS THE
/ NO DEFAULT SET    GDR	|  BRITISH DICTIONARY AND PRESS RETURN
/ DRIVE NUMBER REQURIED	|
/ GOLD MENU		|  OR PRESS GOLD MENU TO RECALL THE MAIN MENU.
/-----------------------------------------------------------------------------
/ MULTI DRIVE SYSTEM	|  REMOVE THE DISKETTE FROM DRIVE 0 AND INSERT THE
/ VALIDATION ERROR  VE2	|  BRITISH DICTIONARY DISKETTE AND PRESS RETURN
/ 			|
/ 			|  OR TYPE THE DRIVE NUMBER THAT CONTAINS THE
/ 			|  BRITISH DICTIONARY AND PRESS RETURN
/ DRIVE NUMBER OPTIONAL	|
/ RETURN OR GOLD MENU	|  OR PRESS GOLD MENU TO RECALL THE MAIN MENU.
/-----------------------------------------------------------------------------
/ MULTI DRIVE SYSTEM	|  INSERT THE BRITISH DICTIONARY DISKETTE
/ GET DENSITY ERROR DE2	|  INTO DRIVE 1 AND PRESS RETURN
/ 			|
/ 			|  OR TYPE THE DRIVE NUMBER THAT CONTAINS THE
/ 			|  BRITISH DICTIONARY AND PRESS RETURN
/ DRIVE NUMBER OPTIONAL	|
/ RETURN OR GOLD MENU	|  OR PRESS GOLD MENU TO RECALL THE MAIN MENU.
/-----------------------------------------------------------------------------
/ WINCHESTER SYSTEM	|  TYPE THE DRIVE/DEVICE NUMBER THAT CONTAINS THE
/ NO DEFAULT SET    GDR	|  BRITISH DICTIONARY AND PRESS RETURN
/ DRIVE NUMBER REQURIED	|
/ GOLD MENU		|  OR PRESS GOLD MENU TO RECALL THE MAIN MENU.
/-----------------------------------------------------------------------------
/ WINCHESTER SYSTEM	|  VOLUME 5 DOES NOT CONTAIN THE BRITISH DICTIONARY
/ VALIDATION ERROR  VE3	|
/ 			|  TYPE THE DRIVE/DEVICE NUMBER THAT CONTAINS THE
/ 			|  BRITISH DICTIONARY AND PRESS RETURN
/ DRIVE NUMBER REQURIED	|
/ GOLD MENU		|  OR PRESS GOLD MENU TO RECALL THE MAIN MENU.
/-----------------------------------------------------------------------------
/ WINCHESTER SYSTEM	|  VOLUME 5 IS NOT ASSIGNED.
/ GET DENSITY ERROR DE3	|
/ 			|  TYPE THE DRIVE/DEVICE NUMBER THAT CONTAINS THE
/ 			|  BRITISH DICTIONARY AND PRESS RETURN
/ DRIVE NUMBER REQURIED	|
/ GOLD MENU		|  OR PRESS GOLD MENU TO RECALL THE MAIN MENU.
/-----------------------------------------------------------------------------

/***************************************************************************
/****				N O T E					****
/****	IF YOU CHANGE ANY OF THE TEXT STRINGS BELOW, MAKE SURE YOU	****
/****	CHANGE THE MESSAGE LISTINGS ON THE THREE PREVIOUS PAGES		****
/***************************************************************************

DSKBLK=	.-200%400+DLOSPM	/ DISK BLOCK WHERE PAGE IS LOADED

SPLUTL,	IFDEF ENGLSH <TEXT '!&WPS &UTILITY &SOFTWARE' >
	IFDEF ITALIAN<TEXT /PROGRAMMI DI UTILIT\@ !&WPS/ >
	IFDEF DUTCH <TEXT '!&WPS &UTILITY &SOFTWARE'>
	IFDEF SPANISH <TEXT '&SOFTWARE &UTILIDAD !&WPS'>

SPLUSD,	IFDEF ENGLSH <TEXT '&AMERICAN &DICTIONARY' >
	IFDEF ITALIAN<TEXT // >
	IFDEF DUTCH <TEXT '&AMERICAN DICTIONARY'>
	IFDEF SPANISH < TEXT '&DICCIONARIO &AMERICANO'>


SPLUKD,	IFDEF ENGLSH <TEXT '&BRITISH &DICTIONARY' >
	IFDEF ITALIAN<TEXT // >
	IFDEF DUTCH <TEXT '&BRITISH &DICTIONARY'>
	IFDEF SPANISH <TEXT '&DICCIONARIO &BRIT\ANICO'>


DRVTXT,	IFDEF ENGLSH <TEXT ' DRIVE '>
	IFDEF ITALIAN<TEXT 'UNIT\@ ' >
	IFDEF DUTCH <TEXT ' AANDRIJVER'>
	IFDEF SPANISH <TEXT ' UNIDAD'>


DEVTXT,	IFDEF ENGLSH <TEXT ' DRIVE/DEVICE '>
	IFDEF ITALIAN<TEXT /UNIT\@ / >
	IFDEF DUTCH <TEXT '  AANDRIVJER'>
	IFDEF SPANISH <TEXT ' UNIDAD/DISPOSITIVO'>


REMTXT,	IFDEF ENGLSH <
	TEXT '^P!E^P&REMOVE THE DISKETTE FROM DRIVE !D AND INSERT THE '
	*.-1
	TEXT '^P!S DISKETTE^S'
	>
	IFDEF ITALIAN <
	TEXT /^P!E^P&TOGLIERE IL DICHETTO DALL'UNIT\@ !D ED INSERIRE IL /
	*.-1
	TEXT /^PDISCHETTO DEI !S/
	>
	IFDEF DUTCH <
	TEXT '^P!E^P&VERVANG DE DISKETTE UIT AANDRIJVER !D DOOR DE  '
	*.-1
	TEXT '^P!S DISKETTE^S'>
	IFDEF SPANISH <
	TEXT '^P!E^P&RETIRE EL DISKETTE DE LA UNIDAD !D E INSERTE LOS '
	*.-1
	TEXT '^P!S DISKETTE^S'> 


SPLAND,	IFDEF ENGLSH <TEXT ' AND PRESS !&RETURN'>
	IFDEF ITALIAN<TEXT / E PREMERE !&RITORNO/ >
	IFDEF DUTCH < TEXT ' EN DRUK OP !&RETURN'>
	IFDEF SPANISH < TEXT ' Y PULSE RETORNO'>


INSTXT,	IFDEF ENGLSH <TEXT '^P!E^P&INSERT THE !S DISKETTE^PINTO DRIVE !D^S'>
	IFDEF ITALIAN<
	TEXT /^P!E^P&INSERIRE IL DISCHETTO DEI !S NELL'UNIT\@ !D^S/ >
	IFDEF DUTCH <TEXT '^P!E^P&ZET DE !S DISKETTE^P!S BEVAT^S'>
	IFDEF SPANISH <TEXT '^P!E^P&INSERTE EL !S DISKETTE^PEN UNIDAD !D^S'>


NUMTX1,	IFDEF ENGLSH <TEXT '^P!E^P&TYPE THE!SNUMBER THAT CONTAINS THE^P!S^S'>
	IFDEF ITALIAN<
	TEXT /^P!E^P&INTORDURRE IL NUMERO DELL'!SCHE CONTIENE I^P!S^S/>
	IFDEF DUTCH <TEXT '^P!E^P&TYP HET!SNUMMER DAT DE^P^S BEVAT^S'>
	IFDEF SPANISH <TEXT '^P!E^P&TECLEE EL!SN\ZMBERO QUE CONTIENE EL^P!S^S'>


NUMTX2,	IFDEF ENGLSH <TEXT '^P&OR TYPE THE!SNUMBER THAT CONTAINS THE^P!S^S'>
	IFDEF ITALIAN<
	TEXT /^P&O INTRODURRE IL NUMERO DELL'!SCHE CONTIENE I^P!S^S/>
	IFDEF DUTCH <TEXT '^P&OF, TYP HET!SNUMMER DAT DE ^P!S BEVAT^S'>
	IFDEF SPANISH <TEXT '^P&O TECLEE EL!SN\ZMENO QUE CONTIENE EL ^P!S^S'>


SPLVNC,	IFDEF ENGLSH <TEXT '^P!E^P&VOLUME !D DOES NOT CONTAIN THE !S'>
	IFDEF ITALIAN<TEXT /^P!E^P&IL SUPPORTO !D NON CONTIENE I !S/>
	IFDEF DUTCH <TEXT '^P!E^P&!S NIET AANWEZIG IN GEBIED !D'>
	IFDEF SPANISH <TEXT '^P!E^P&EL &VOLUMEN !D NO CONTIENE EL !S'>


SPLNAS,	IFDEF ENGLSH <TEXT '^P!E^P&VOLUME !D IS NOT ASSIGNED.'>
	IFDEF ITALIAN<TEXT /^P!E^P&SUPPORTO !D NON DEFINITO./>
	IFDEF DUTCH <TEXT '^P!E^P&GEBIED !D IS NIET TOEGEWEZEN.'>
	IFDEF SPANISH <TEXT '^P!E^P&EL &VOLUMEN !D NO EST\A ASIGNADO.'>


WRKTXT,	IFDEF ENGLSH <TEXT '^P!E^P&LOADING ^S - &PLEASE &STAND &BY'>	/M007
	IFDEF ITALIAN<TEXT /^P!E^P&ATTIVAZIONE DEI ^S. &ATTENDERE.../>
	IFDEF DUTCH <TEXT '^P!E^P&^S WORDT GEACTIVEERD, EVEN GEDULD.'>
	IFDEF SPANISH < TEXT '^P!E^P&CARGANDO ^S - &ESPERE'>
	


REDTXT,	TEXT '^P^S^P'

GMTXT,	IFDEF ENGLSH <
	TEXT '!&OR &PRESS &GOLD !&MENU TO RECALL THE &MAIN &MENU.'>
	IFDEF ITALIAN <
	TEXT /&O PREMERE &ORO !&MENU PER TORNARE AL &MENU &PRINCIPALE./>
	IFDEF DUTCH <
	TEXT '!&DRUK OP &GOUD !&MENU OM TERUG TE GAAN NAAR HET &HOOFDMENU'>
	IFDEF SPANISH <
	TEXT '!&O &PULSE &DORADA !&MENU PARA VOLVER AL &MEN\Z &PRINCIPAL.'>



ERRTXT,	TEXT '^CG'	/ CONTROL STRING TO RING THE TERMINAL BELL

INUERR,	IFDEF ENGLSH <
	TEXT '^P!E^P&THAT!SIS ALREADY IN USE.  &PRESS !&RETURN TO '	/A010
	*.-1								/A010
	TEXT 'ENTER ANOTHER NUMBER.'					/A010
	>
	IFDEF ITALIAN <
	TEXT /^P!E^P&!SGI\@ UTILIZZATA. &PREMERE !&RITORNO, USARE UN /
	*.-1
	TEXT /ALTRO NUMERO./
	>
	IFDEF DUTCH <
	TEXT '^P!E^P&DIE!S IS AL IN GEBRUIK. DRUK OP !&RETURN EN '
	*.-1
	TEXT 'PROBEER OPNIEUW.'>
	IFDEF SPANISH <
	TEXT '^P!E^P&ESTE!S YA EST\A EN USO. &PULSE !&RETORNO PARA'
	*.-1
	TEXT ' TECLEE OTRO N\ZMERO.'>

/***************************************************************************
/****				N O T E					****
/****	IF YOU CHANGE ANY OF THE TEXT STRINGS ABOVE, MAKE SURE YOU	****
/****	CHANGE THE MESSAGE LISTINGS ON THE THREE PREVIOUS PAGES		****
/***************************************************************************

	RELOC



