

/ here only if the -1 GTP desc. found.					/A154
/	if GOLD_BOTTOM flag negative then pursue GOLD_BOTTOM		/A154
/		else pursue PAGE_NOT_FOUND error condition		/A154
/
TRYBOT,	TAD	RPBOTF		/ get the GOLD_BOTTOM flag		/A154
	SPA CLA			/ skip if NOT GOLD_BOTTOM		/A154
	JMP	TORPSURL	/ jump to perform a GOLD_BOTTOM		/A154

	TAD	CURPG1		/ these 2 words will contain pages	/A154
	TAD	CURPG3		/ found upto the -1 desc. word		/A154
	SNA CLA			/ if pages counted, then this is a	/A154
/				  paginated doc.			/A154
	AC7776			/ else, no pages so GO-TO-TOP		/A154
	DCA	RPPG0		/ will = 0 when page # too large	/A154
	JMP	RPPGER		/       -2 when no pages avail. to	/A154
/				           paint screen after err-report/A154
CURPG3, 0			/count of # of 1000's pages		/A154

/ user has depressed the GOLD_BOTTOM key and GTP has found the
/ logical end_of_file (-1 desc. word).  Backup the descriptor
/ pointer to indirectly point at the last text block.
/ intialize CURPG1 to 1 for two reasons: enables correct flow
/ thru RPRULE with a GOLD_BOTTOM using a doc. without pages and
/ secondly, insures that RPADVNW reads all of the BOTTOM block into
/ the edit-buffer before filling PTRBLK prior to exit...


TORPSURL,			/ -1 desc. word OK when doing GOLD_BOT	/A154
	AC7777			/ get to GTP desc. word immediately	/A154
	JMS	ADJUST		/ preceeding the -1 to find the ruler	/A154
	AC0001			/ init.'d in order to share		/A154
	DCA	CURPG1		/ GTP exit logic
	JMP	RPSURL		/ SETUP TO LOAD RULER			/A157


/ FOLLOWING CODE WAS MOVED IN SPACE WAR					/A157
/D157 /   if  PAGE (or BOTTOM)  & RULER are within the SAME block
/D157 /       then  use previous RULER block (RPMTBK) in case
/D157 /             the ruler within the desired PAGE block is
/D157 /             beyond the desired PAGE
/D157 /     else  use the latest RULER block (RPMTRL) found
/D157
/D157 RPSURL,				/ Set-Up RuLer
/D157 	TAD	RPCUOF		/ POINTS TO DESIRED PAGE or BOTTOM BLOCK
/D157 	CIA			/ FOR COMPARE TO
/D157 	TAD	RPMTRL		/ LATEST RULER BLOCK POINTER
/D157 	SZA CLA			/ SKIP TO MAKE PRIOR THE LATEST RULER
/D157 	JMP	SURLEX		/ JUMP TO RETAIN LATEST RULER
/D157 	TAD	RPMTBK		/ RULER PRIOR TO LATEST RULER
/D157 	DCA	RPMTRL		/ INSURE PRESENCE OF A RULER
/D157
/D157 	TAD	RPPRRL		/ BLK ID # FOR PREVIOUS RULER
/D157 	DCA	RPRLHN		/ TO BE LOADED
/D157
/D157 SURLEX,	TAD	(-55)		/ OFFSET TO 1ST TEXT-BLOCK
/D157 	TAD	RPCUOF		/ IF PAGE NOT IN 1ST TEXT-BLOCK
/D157 	SNA CLA			/ THEN LOAD ITS' RULER NOW
/D157 	JMP	RPPAGE		/ ELSE, LOAD IT W/ PAGE or BOTTOM
/D157 	JMP	RPRULE		/ GO SET-UP WPFILS SCTOP&SCBOT


/ the block being loaded into the EDIT buf. is pointed at by
/  the offset within RPMTRL; SCBOT points at this block -2 (COS).
/  when all chars. within this block have been moved into the
/  EDIT buf., WPFILS will automatically read in the next seq.
/  block and bump SCBOT.  when SCBOT and RPMTRL no longer match
/  then a new block has just been read (we are done w/ current blk)

RPCKBT,	0			/ ChecK scBoT
	DCA	T2		/ CHAR. JUST LOADED INTO ED. BUF.
	TAD	(-5)		/ F.C. TO REQ. SCBOT CONTENTS
	JMS	DSKCAL		/ WPFILS WILL SUPPLY SCBOT IN AC
	XRPRD
	CDFMYF			/ BACK FROM BUFFER FIELD

	CIA			/ FOR COMPARE TO
	TAD	RPMTRL		/ CURRENT BLOCK OFFSET
	SNA CLA			/ NO CHANGE MEANS SAME BLOCK
	ISZ	RPCKBT		/ CHANGED WHEN NEXT SEQ. BLK. READ
	JMP I	RPCKBT	/ RETURN + 1 = CONTINUE W/ THIS BLK.
				/ RETURN + 0 =  ENTIRE BLOCK PROCESSED



/	SPA			/ SKIP NEXT IF POSITIVE MEANING ADJUST FORWARD
/	JMP	ADJBACK		/ ADJUST IN THE REVERSE DIRECTION

/ adjust in the forward direction

/	ISZ	RPCUOF		/ ADJUST FORWARD BY 1 COUNT (ALWAYS)
/	CLA
/	TAD	RPCUOF
/	TAD	(-400)
/	SPA CLA
/	JMP I	ADJUST		/ EXIT

/ gone to far forward

/	AC0002		/ 2
/\	DCA	RPCUOF
/	ISZ	RPCUBK
/	JMP	ADJEX2		/ EXIT

/ adjust in the backward direction

/ ADJBACK,TAD	RPCUOF		/ GET POINTER VALUE BEFORE ADJUSTMENT
/	DCA	RPCUOF		/ SAVE BACKWARD ADJUSTED VALUE
/	TAD	RPCUBK
/	CLL RAR
/	SNA CLA
/	JMP	RPPH01
/	AC7776		/ -2
/	TAD	RPCUOF
/	SMA
/	JMP	ADJEX1		/ STILL WITHIN LIMITS OF RPPGDS BLOCK AFTER ADJUSTMENT

/ the contents of the AC is a negative number
/  which means out of the logical boundries
/   of the RPPGDS block after the backward adjustment

/	TAD	(400)
/	DCA	RPCUOF		/ RPCUOF IS NOW CORRECTED
/	AC7777		/ -1
/	TAD	RPCUBK
/	DCA	RPCUBK
/	JMP I	ADJUST		/ EXIT

/ special boundry testing
/  because the pointer adjusted
/   is in the 1st RPPGDS descriptor block
/    (which has unique limits)

/  55 - is the 'top' of the block where the 1st RPPGDS descriptor word is
/ 377 - is  the 'bottom' of the block where the last descriptor word is

/ RPPH01,	TAD	(-55)
/	TAD	RPCUOF
/ ADJEX1,	SMA CLA
/	JMP I	ADJUST		/ EXIT - STILL WITHIN LIMITS AFTER ADJUSTMENT
/	TAD	(55)
/ ADJEX2,	DCA	RPCUOF
/	JMP I	ADJUST		/ EXIT

/ after reporting that the desired page was not found,
/  backup to the previous descriptor word to get the block
/   containing the last available page.....

SETBLK,	XX			/ SAVE CALLERS RETURN ADDRESS
	TAD	(-5)		/ F.C. TO REQ. SCBOT CONTENTS
	JMS	DSKCAL		/ WPFILS WILL SUPPLY SCBOT IN AC
	XRPRD			/ GTP ENTRY POINT
	CDFMYF

	TAD	(1)		/ INIT. RPMTRL TO BE THE
	DCA	RPMTRL		/ BLK BEING LOADED

	AC7775			/ -3
	TAD	RPCUBK		/ ARE WE IN THE 3RD EXT??
	SZA CLA			/ SKIP IF 3RD EXT
	TAD	(16)
	TAD	(360)		/ IF IN 3RD EXT. SCBOT CANNOT BE >= 360
				/ ANY OTHER EXT. SCBOT CANNOT BE >= 376
	CIA			/ MAKE NEG FOR COMPARE
	TAD	RPMTRL		/ TO BLK BEING LOADED
	SNA CLA			/ SKIP W/ VALID BLOCK
	DCA	RPMTRL		/ CORRECT BLOCK OFFSET

	JMP I	SETBLK		/ RETURN

	X=.			/ INDICATE FIRST FREE LOCATION ON PAGE
/---------------------
	PAGE

/ can delete all this because GOLD_BOTTOM now takes GTP path...		/A154

/D157 / ENTRY TO 'RPXRULE' FROM 'TRYBOT'
/D157 /  A -1 RPPGDS DESCRIPTOR LIST TERMINATOR WAS FOUND
/D157 /   BACKUP THE LIST POINTER 10 POSITIONS
/D157 /	10 POSITIONS = 1 TO GET BEFORE -1 DESCRIPTOR
/D157 /	              9 TO INSURE THAT THERE WILL BE ENOUGH TEXT
/D157 /	                TO PAINT THE SCREEN
/D157
/D154 RPXRULE,			/ was called only by TRYBOT		
/D154	TAD	(-12)		/ ADJUST BACK 10 BLOCKS
/D154	JMS	ADJUST		/ ADJUST 'RPCUOF'
/D154	CIFLP			/ FIELD 5
/D154	JMS	RULCHK		/ CHECK TO LOAD CORRECT RULER
/D154	TAD	RPBKID		/ RESTORE BLK ID #
/D154	DCA	RPCUBK		/ FOR SCROLL...
/D154	JMP	RPRUL1

/ IF DESIRED PAGE (OR BOT DOC) & LATEST RULER ARE WITHIN THE SAME BLOCK THEN/A157
/	USE PREVIOUS RULER BLOCK (RPMTBK,RPPRRL) IN CASE		/A157
/	  THE RULER WITHIN THE DESIRED PAGE BLOCK IS			/A157
/	  BEYOND THE DESIRED PAGE;					/A157
/ ELSE	(NOT WITHIN THE SAME BLOCK)					/A157
/	USE THE LATEST RULER BLOCK (RPMTRL,RPRLHN) FOUND.		/A157
									/A157
RPSURL,				/ Set-Up RuLer				/A157
	TAD	RPCUOF		/ OFFSET OF DESIRED PAGE OR BOTTOM BLOCK/A157
	CIA			/ FOR COMPARE TO			/A157
	TAD	RPMTRL		/ LATEST RULER BLOCK OFFSET		/A157
	SZA CLA			/ SKIP IF BLOCKS MAY BE THE SAME	/A157
	JMP	SURLEX		/ JUMP TO RETAIN LATEST RULER		/A157
	TAD	RPCUBK		/ DO BLOCK ID #S ALSO MATCH?		/A157
	CIA			/ (COMPARE BLK ID # FOR DESIRED PAGE	/A157
	TAD	RPRLHN		/  WITH BLK ID # FOR LATEST RULER)	/A157
	SZA CLA			/ SKIP IF YES:SET LATEST RUL:=PREVIOUS RUL/A157
	JMP	SURLEX		/ NO: RETAIN LATEST RULER		/A157
									/A157
	TAD	RPMTBK		/ RULER PRIOR TO LATEST RULER		/A157
	DCA	RPMTRL		/ INSURE PRESENCE OF A RULER		/A157
									/A157
	TAD	RPPRRL		/ BLK ID # FOR PREVIOUS RULER		/A157
	DCA	RPRLHN		/ TO BE LOADED				/A157
									/A157
SURLEX,	TAD	(-55)		/ OFFSET TO 1ST TEXT BLOCK		/A157
	TAD	RPCUOF		/ IS PAGE OR BOTTOM IN 1ST TEXT BLOCK?	/A157
	SZA CLA								/A157
	JMP	RPRULE		/ NO: GO LOAD IT'S RULER		/A157
	AC7777			/ (MAYBE: CHECK BLOCK ID #S)		/A157
	TAD	RPCUBK							/A157
	SNA CLA			/ SKIP IF NO: LOAD RULER SEPARATELY	/A157
	JMP	RPPAGE		/ YES: LOAD RULER W/ PAGE OR BOTTOM	/A157

/ Request the initialization of WPFILS' SCTOP & SCBOT to enable
/  the READ of our RULER block.  The contents of SCTOP & SCBOT
/  are used as offsets within the HEADER BLOCK BLOCK-LIST to
/  obtain the block # of the desired text block.  They are always
/  a -2 away from the desired block list offset.  SCGETR of WPFILS
/  takes the contents of SCTOP or SCBOT and adds 2 to obtain the
/  desired text block # from the block list.  This module does not
/  alter the actual contents of either SCTOP or SCBOT.

/ Load the RULER into the edit buffer ; fill the edit ruler area  (NWRUL)
/  with the contents of this RULER.

RPRULE,	TAD	CURPG1		/ PAGE NUMBER
	SNA CLA			/ SKIP IF VALID
	JMP	RPPAG1		/ USER SUPPLIED A PAGE VALUE
				/ = OR < 0, OR NON-PAGINATED

	TAD	RPRLHN		/ RPCUBK - IDENTIFY WHICH HEADER BLOCK CONTIANS
	MQL			/ THE RULER BLOCK OFFSET
	AC7776		/ -2	/ MAKES FOR WPFILS 'SCBOT'
				/	/ COS-310 COMPATABILITY
	TAD	RPMTRL		/ RPCUOF - OFFSET TO THE BLOCK -2
				/	   CONTAINING THE RULER
	JMS	DSKCAL		/ REQUEST THAT SCBOT & SCTOP BE SETUP
				/ FOR OUR READ
	XRPRD			/ ENTRY POINT FOR V2 GOTO PAGE
				/ RANDOM BLOCK READ
	JMS	RPBFIN		/ GO INITIALIZE THE EDIT BUFFER

/ the EDIT BUFFER is now logically empty.
/ WPFILS has been primed to start reading text blocks  (SCBOT & SCTOP).
/  using ADVPTR because CURMOV doesn't know what to do with
/   an END-RULER (17) that may come before a START-RULER (16)
/   which is possible now with random block access employed
/   by GOTO-PAGE...


	JMS	SETBLK		/ SET UP RPMTRL TO POINT AT THE
				/ BLOCK TO BE LOADED
RPRLSR,				/ START SEARCH FOR START-OF-RULER
	ADVPTR			/ READ/ LOAD 1 CHAR.
	NOP			/ ETX WILL NOT OCCUR
	CDFMYF			/ BACK TO THIS FIELD
	JMS	RPCKBT		/ SEE IF ENTIRE BLOCK LOADED
	JMP	RPPAGE		/ YES - ALL RULERS LOADED

	TAD	T2		/ CHAR. JUST LOADED
	TAD	(-ECSTRL)	/ IS IT START-OF-RULER?
	SZA CLA			/ SKIP IF RULER FOUND
	JMP	RPRLSR		/ NO RULER - KEEP LOOKING

/ load BOTTOM ruler just like GTP ruler					/A154

/D154	TAD	RPBOTF		/ IF THIS IS A
/D154	SPA CLA			/ GOLD-BOTTOM REQUEST
/D154	JMP	TOBOTF		/ THEN JUMP TO CONT. IT

	JMS	ADVRUL		/ LOAD RULER JUST FOUND
	NOP			/ ETX WILL NOT OCCUR
	JMS	RPCKBT		/ DID IT FORCE READ OF NEW BLOCK?
	JMP	RPPAGE		/ YES - ENTIRE BLOCK PROCESSED
	JMP	RPRLSR		/ NO - DO UNTIL ENTIRE BLOCK READ


/ request the initialization of WPFILS' SCTOP & SCBOT to enable the
/   read of our PAGE block.
/  Exit to final overlay to paint the screen with the first  line of
/    the new page in the bottom line of the screen.  Set scroll pointers
/    with the edit buffer lines preceeding the first line of the new page.


RPPAGE,	JMS	RPBFIN		/ GO INIT. THE EDIT BUFFER
	OVLJMP; OVRPWP		/ GO INIT. WPFILS'S SCTOP & SCBOT AND
				/ TEST FOR ACTIVE CONTROL-BLOCK

RPPAG1,	OVLJMP;	OVRPEX		/ LOAD PAGE INTO BUFFER;PAINT SCREEN; EXIT


/ can delete all this now because GOLD_BOTTOM handled like GTP		/A154
/   was called by RPRLSR only...					/A154

/D154TOBOTF,	TAD	RPCUBK		/ HEADER BLOCK ID #
/D154	CLL RAR
/D154	SZA CLA			/ SKIP IF THIS IS 1ST HEADER BLOCK
/D154	JMP	BOTRLR		/ GO LOAD THE RULER INTO EDITOR RULER AREA
/D154	TAD	(-55)		/ 1ST TEXT BLOCK POINTER OFFSET
/D154	TAD	RPCUOF		/ COMPARE TO CURRENT BLOCK (BOTTOM OF DOC)
/D154	SNA CLA			/ IF NOT 1ST DESCRIPTOR WORD
/D154	JMP	BOTEM		/ GO LOAD RULER
/ IF WE ARE IN THE FIRST BLOCK OF THE FIRST EXTENSION, LOAD THE RULER
/D154BOTRLR,	TAD	(376)		/ READ IN THE NEWEST RULER
/D154	CURMOV
/D154	NOP
/D154BOTRL1,	JMS	RPBFIN		/ CLEAN-UP EDIT BUFFER FROM RULER
/D154	OVLJMP; OVRPWP		/ INIT. WPFIL'S SCTOP & SCBOT,
				/ AND READ PAGE DESC. FOR PRINT CONTROL

/ error condition recognized....

RPPGER,	TAD	CURPG1		/ -1 DESCRIPTOR FOUND
	SNA			/ IF NO PAGES IN THE DOCUMENT
	TAD	CURPG3		/ THEN REPORT ERROR AND
	SNA CLA
	JMP	RPPAG1		/  GO TO TOP OF DOCUMENT
				/ ELSE

	AC2000			/ ERROR RECOVERY FLAG
	DCA	RPBOTF		/ FOR -1 DESC. FOUND CONDITION

	OVLJMP;	RPPER7		/  GO REPORT ERROR: RAN OUT OF
				/ DESCRIPTOR WORDS BEFORE PAGE FOUND


/ INIT. THE EDIT BUFFER JUST LIKE AT OVINIT TIME...

RPBFIN,	XX
	CDFBUF
	AC7777			/ TAKE 1 AWAY FROM THE FOLLOWING ADDR.
	TAD	BUFBEG		/ START OF THE EDIT BUFFER
	DCA	X0		/ X0 = EDIT BUFFER LOC. POINTER
	TAD	(ECBFBG)	/ BUFFER BEGIN WORD
	DCA I	X0		/ INTO 1ST EDIT BUFFER WORD
	TAD	(ECSTX)		/ START OF TEXT WORD
	DCA I	X0		/ INTO 2ND EDIT BUFFER WORD
	TAD	(ECETX)		/ END OF TEXT WORD
	DCA I	X0		/ INTO 3RD EDIT BUFFER WORD
	TAD	BUFSIZ		/ # OF TOTAL BUFFER WORDS
	CIA			/ INTO A COUNTER
	TAD	(4)		/ ACCOUNT FOR WORDS WE ALREADY INIT'D
	DCA	X1		/ X1 = # OF WORDS TO CLEAR
	TAD	X0
	DCA	CURPTR
	DCA I	X0		/ CLEAR A BUFFER LOC.
	ISZ	X1		/ SKIP IF ENTIRE BUFFER = 0
	JMP	.-2		/ NOT DONE CLEARING YET
	TAD	(ECBFND)	/ PHYSICAL END OF BUFFER WORD
	DCA I	X0		/ INTO LAST BUFFER LOC.
	CDFMYF

/ INITIALIZE SCREEN

	TAD	(PTRBLK-1)
	DCA	X0
	TAD	(-NPTRS+1)
	DCA	X1
	DCA I	X0
	ISZ	X1
	JMP	.-2
				/ GPT MUST USE INIT PTR BLK,
	DCA I	X0		/ UNLIKE OVINIT THAT INITS BOTTOM ENTRY TO 2
	TAD	CURPTR
	DCA	LINE23 		/ INIT SEPARATE LINE 23 POINTER
	DCA	CURSOR
	JMP I	RPBFIN		/ RETURN TO CALLER


/ this routine was moved to field 5 for more room
/ offset ADJUSTMENT subroutine

/ adjust (INCREMENT OR DECREMENT) the offset to the rppgds;
/ and the pointer to the rppgds block

/ the contents of the AC at entry = positive for forward adjustment, or
/ = negative for backward adjustment

ADJUST,	XX			/ THE CONTENTS OF THE AC IS THE COUNT
	CIFLP			/ FOR ROOM.....
	JMS	ADJUS0
	JMP I	ADJUST		/ RETURN TO CALLER

/ BOTEM called by TOBOTF only.  Just deleted TOBOTF logic so this call	/A154
/	can also be deleted.						/A154

/ IF WE ARE IN THE FIRST BLOCK OF THE FIRST EXTENTION, LOAD THE RULER

/D154BOTEM,	OVLJMP;OVRBTM		/ MUST LOAD RULER, ELSE IT WON'T GET
				/ PAINTED IF PTRBLK ISN'T FULL

	X=.			/ INDICATE FIRST FREE LOCATION ON PAGE
/---------------------
	PAGE

/***************************************************************************
/****			   START OF OVERLAY				****
/***************************************************************************

	OVRNUM=OVRNUM+200
	OVRBLK=OVRNUM%200+DLOEDO-1 / DISK BLOCK WHERE OVERLAY IS LOADED

	RELOC
	RELOC OVLAY1
	OVRNUM


/D155 OVRPEX=	.-OVLAY1+OVRNUM
/D155	JMP	RPFPG		/ CONTINUE NORMAL GOTO PAGE


/D157 OVRPWP=	.-OVLAY1+OVRNUM	/ INIT. WPFILS;TEST FOR PRINT-CONTROL AREA
/D157 	JMP	TORPWP


/ BOTEM just deleted, so this goes also				/A154
/D154 OVRBTM=	.-OVLAY1+OVRNUM
/D154	JMP	BOTRUL		/ LOAD RULER FOR SHORT DOC. GOLD BOTTOM


	OVRRP2=	.-OVLAY1+OVRNUM
/
/ COME HERE FOR GOTO-PAGE, GOLD:BOTTOM, AND GOTO-RULER.
/
/ THE DOCUMENT HAS BEEN CLOSED,
/ THEN RE-OPENED, AND NOW WE FIND OURSELVES HERE.
/
/ IF THIS IS GOTO-PAGE REQUEST, THEN
/	GOTO OVRPP2 TO COMPUTE WHICH BLOCK # HAS DESIRED
/	  PAGE AND RULER(S);
/ IF THIS IS GOTO-RULER, THEN
/	WE ALREADY HAVE BLOCK # OF DESIRED RULER IN RPCUOF & RPCUBK,
/	SO OPEN DOCUMENT AT THAT BLOCK & POSITION CURSOR AT RULER.
/
	TAD	RRDIR		/ IS THIS GOTO-RULER?
	SZA CLA
	JMP	RRPOS		/ YES
	OVLJMP			/ NO: GOTO ORIGINAL GOTO-PAGE,GOLD:BOTTOM
	OVRPP2			/     OVERLAY (CURRENT OVERLAY DOESN'T DO
				/     MUCH FOR GOTO-PAGE UNTIL LATER!)

/ OPEN DOCUMENT AT BLOCK WITH RULER (PHYSICAL BLOCK RPCUBK)
/  (ALSO INITIALIZES PCTLFL FROM GOTO-PAGE DESCRIPTOR WORD)

RRPOS,	JMS	RROPP

	JMS	MNUPUT		/ MAKE LINE # IN STATUS LINE = "N/A" (UNKNOWN)
	LINNUM-MUBUF		/ DONE AS EARLY AS POSSIBLE TO MAXIMIZE THE
				/ CHANCE IT WILL BE SET TO SOMETHING USEFUL.

/ TURN MATH OFF BECAUSE 'RRPS' EXPECTS IT TO BE OFF

	AC0001			/ FUNCTION TO SAVE "MA" SWITCH
	JMS	SWTHMA		/   AND DEACTIVATE MATH

/ SET UP PTRBLK IF NECCESSARY.  (MOVING CURSOR BACKWARDS (SCRLDN)
/ REQUIRES THAT AT LEAST LAST 2 ENTRIES IN PTRBLK BE FILLED.)

	TAD	RRDIR		/ BACKING UP TO RULER?
	SPA CLA
	 JMS	RRPS		/ YES: MUST FILL PTRBLK NOW

/ CLEAR ENTRY POINT OF SUBROUTINE SETRUL, WHICH IS USED DURING RULER PROCESSING.
/ ENTRY POINT IS USED AS FLAG WHICH TELLS WHEN CURMOV HAS ENCOUNTERED A RULER.

	DCA	SETRUL

/ BEGIN LOOP TO ADVANCE ( OR BACKUP) CURSOR TO RULER.
/ (NEXT RULER IS DESTINATION RULER.)

RRJMLP,	TAD	RRDIR		/ GET DIRECTION
	CURMOV			/ MOVE CURSOR
	 JMP	RRJMET		/   ETX OR STX-MAYBE RULER NOT FOUND

/D214	CDFSYS			/ IF USER PRESSED GOLD:HALT THEN ABORT
/D214	TAD I	HLTFLG		/ IS GOLD:HALT REQUEST PENDING?
/D214	SZA CLA
/D214	 JMP	RREXT		/ YES: ABORT LOOP

	CDFMYF			/ LOOP BACK UNTIL CURSOR HAS PASSED OVER RULER
	TAD	SETRUL		/ DID CURMOV PROCESS A RULER?
	SNA CLA
	 JMP	RRJMLP		/ NO: LOOP BACK

/ FOUND DESTINATION RULER.  IF WE WERE BACKING UP, CURSOR WILL BE
/ BEFORE RULER.  MAKE SURE CURSOR IS JUST AFTER DESIRED RULER.

	TAD	RRDIR		/ ADVANCING OR BACKING UP?
	SPA CLA
	 AC0001			/ BACKING UP: MOVE CURSOR AFTER RULER(DIST=1)
RRJMET,	CURMOV			/ ADVANCING: DON'T MOVE CURSOR(DIST=0)
	 NOP			/   HIT ETX-THAT'S OK

/ CURSOR HIT ETX (OR STX).  IF RULER NOT FOUND THEN BEEP TO WARN USER;
/ GO EXIT FROM GOTO-RULER (COMMON CODE WITH GTP, GOLD:BOT)

	CDFMYF
	TAD	SETRUL		/ DID CURSOR PASS RULER JUST BEFORE ETX(STX)?
	SNA CLA
	 JMS	BUZZER		/ NO: BEEP TO WARN USER			/M163
	JMP	RREXT		/ PREPARE TO PAINT SCREEN

/ CONTINUE NORMAL GOTO-PAGE OR GOLD:BOTTOM

	OVRPWP=	.-OVLAY1+OVRNUM	/ --OVERLAY ENTRY POINT--
	JMS	RROPR		/ OPEN FILE FOR SCROLLING AT RELATIVE	/A157
				/ BLOCK DEFINED BY RPCUOF,RPCUBK	/A157

/ CONTINUE NORMAL GOTO-PAGE OR GOLD:BOTTOM				/A155

	OVRPEX=	.-OVLAY1+OVRNUM	/ --OVERLAY ENTRY POINT--		/A155
	AC0001			/ SET UP TO SHUT "MA" SWITCH & DEACTIVATE MATH
	JMS	SWTHMA		/ GO SHUT OFF "MA" SWITCH & SAVE ORIGINAL
				/ SETTING THIS KEEPS GO-TO-PAGE FUNCTION FROM
				/ REACTIVATING MATH AS IT USES "CURMOV" IN THE
				/ PROCESS OF POSITIONING ITSELF CORRECTLY FOR
				/ THE RIGHT PAGE. (NOTE: "CKCTRL"CALLED BY
				/ "SCRLUP" CALLED BY "CURMOV" THUS ACTIVATING
				/ EDITOR MATH.)
/D157 				/ IF GOLD-HLT IS HIT DURING G-T-P THE EXIT TO
/D157 				/ G-T-P IS DONE VIA "EIBOT2" (I.E. GOLD-BOTTOM)
/D157 				/ WHICH IS SET TO HANDLE A "HLTTST".
				/ IF G-T-P OR GOLD:BOTTOM EXITS NORMALLY THEN
				/ MATH "MA" IS RESTORED IN "RREXT"
/									/A158
/ CONTINUE GOTO-PAGE AFTER ERROR MSG RE REQUEST FOR PAGE ABOVE --TOP--.	/A158
/ SKIPS "JMS SWTHMA" BECAUSE IT HAS ALREADY BEEN CALLED (WE'VE COME	/A158
/   THROUGH HERE BEFORE!);						/A158
/ WILL GO TO 'RPPTOP', THEN 'TOTOP'.					/A158
/									/A158
	OVRPZZ=	.-OVLAY1+OVRNUM	/ --OVERLAY ENTRY POINT--		/A158

	/ SET STATUS LINE # = "N/A" (UNKNOWN).				/A157
	/ THIS IS DONE AS EARLY AS POSSIBLE TO MAXIMIZE			/A157
	/ THE CHANCE IT WILL BE SET TO SOMETHING MEANINGFUL.		/A157
	JMS	MNUPUT							/A157
	 LINNUM-MUBUF							/A157

	/ CHECK DESTINATION PAGE "OFFSET"
	TAD	CURPG1		/ - # OF PAGES TO READ INTO BUFFER
	SNA CLA			/ SKIP IF VALID
	JMP	RPPTOP		/ EITHER THIS DOC. IS NOT PAGINATED, OR
				/ THE USER SUPPLIED A PAGE # = < 0

/ start loading text into the EDIT BUFFER,
/ from the block containing the desired page (or end of GTP structure),
/ stopping when the top of the desired page (or the bottom of
/ the document) has been loaded...

	JMP	RPADV2		/ CHECK CHAR CURSOR IS ON		/A158

/ LOOP TO ADVANCE TO DESIRED PAGE (FOR GOTO-PAGE),			/A158
/   OR BOTTOM OF DOCUMENT (FOR GOLD:BOTTOM)				/A158

RPADV1,
/D214	CDFSYS			/ HAS USER PRESSED GOLD:HALT?		/A158
/D214	TAD I	HLTFLG							/A158
/D214	SZA CLA								/A158
/D214	 JMP	RREXT		/ YES-ABORT: LEAVE CURSOR WHERE IT IS.	/A158

	AC0001			/ ADVANCE CURSOR TO NEXT CHARACTER	/A158
RPADV2,	CURMOV								/A158
	 JMP	RREXT		/   HIT ETX (NORMAL EXIT FOR GOLD:BOT)	/A158
	TAD I	CURPTR		/ GET CURRENT CHAR			/A158
	AND	P177		/ IGNORE ATTRIBUTE BITS			/A158
	TAD	(-ECNWPG)	/ IS CURRENT CHAR A NEW-PAGE-MARKER?	/A158
	CDFMYF								/A158
	SNA CLA								/A158
	 ISZ	CURPG1		/ YES: IS MARKER FOR DESIRED PAGE?	/A158
	 JMP	RPADV1		/ NO OR NO: LOOP BACK TO KEEP LOOKING	/A158
	/ HANDLE CASE OF HAVING MORE THAN 4095 PAGES AFTER LOGICAL	/A158
	/ END OF DOCUMENT (AS DETERMINED BY THE END OF THE GOTO-PAGE	/A158
	/ DESCRIPTOR WORDS)						/A158
	TAD	RPBOTF		/ IS THIS GOLD:BOTTOM?			/A158
	SPA CLA			/ SKIP IF GOTO-PAGE			/A158
	 JMP	RPADV1		/ YES: ADVANCE UNTIL ETX		/A158

/									/A158
/ FOUND DESIRED PAGE.							/A158
/ ADVANCE CURSOR TO NEXT PRINTABLE CHAR.				/A158
/									/A158
RPADV3,	AC0001			/ ADVANCE CURSOR			/A158
	CURMOV								/A158
	 JMP	RREXT		/   HIT ETX				/A158
	TAD I	CURPTR		/ GET CURRENT CHAR			/A158
	JMS	WRDTST		/ IS IT A WORD TERMINATOR?		/A158
	SNA CLA								/A158
	 JMP	RPADV3		/ YES: LOOP TO FIND NON-TERMINATOR	/A158
				/ NO: FOUND PRINTABLE CHARACTER		/A158

/D158 / ADVANCE PAGE to desired page...
/D158
/D158 RPADVUNT,			/ EMULATE ADVANCE PAGE
/D158 	AC0006			/ AC => 6 FOR PAGE ID
/D158 	DCA	GRAMUN		/ SUPPLY UNIT ID
/D158 	JMS	SETUNT		/ SET PAGE-UNIT
/D158
/D158 	JMS	LODCHR		/ LOOK FOR PAGE-MARKER
/D158 	JMP	RREXT		/ ETX WILL now occur if GOLD_BOTTOM	/M154
/D158 	JMS	RPGETUNT	/ SEE IF A PAGE-MARKER FOUND
/D158 RPADVNW,
/D158 	.-.
/D158 	SZA CLA			/ RECOGNIZE PAGE-UNIT?
/D158 	JMP I	RPADVNW		/ NO, KEEP SCROLLING...
/D158 	/ CHECK GOLD:HALT AFTER EVERY PAGE				/A157
/D158 	/ (THERE MAY BE NO PAGES!  IS THIS A BUG?)			/A157
/D158 	CDFSYS								/A157
/D158 	TAD I	HLTFLG		/ IS THERE A PENDING GOLD:HALT?		/A157
/D158 	SZA CLA			/ SKIP IF NO				/A157
/D158 	 JMP	RREXT		/ YES: ABORT, LEAVE CURSOR WHERE IT IS	/A157
/D158 	/ LOOP BACK IF NOT AT DESIRED PAGE
/D158 	CDFMYF			/ FROM BUFFER FIELD
/D158 	ISZ	CURPG1		/ SKIP W/DESIRED PAGE IN BUFFER
/D158 	JMP	RPADVUNT	/ JUMP TO SCROLL ANOTHER PAGE
/D158
/D158 	/ HANDLE CASE OF HAVING MORE THAN 4095 PAGES AFTER LOGICAL	/A157
/D158 	/ END OF DOCUMENT (AS DETERMINED BY THE END OF THE GOTO-PAGE	/A157
/D158 	/ DESCRIPTOR WORDS)						/A157
/D158 	TAD	RPBOTF		/ IS THIS GOLD:BOTTOM?			/A157
/D158 	SPA CLA			/ SKIP IF GOTO-PAGE			/A157
/D158 	 JMP	RPADVUNT	/ YES: ADVANCE UNTIL ETX		/A157
/D157 	JMP	RPGBOT		/ can't use CURPG1 for GOLD_BOTTOM	/A154



/
/ CURSOR IS AT DESIRED FINAL PLACE IN TEXT FOR GOTO-PAGE, GOTO-RULER
/ OR GOLD-BOTTOM, BUT PTRBLK MIGHT NOT BE COMPLETELY FULL.
/
RREXT,	JMS	RRPS		/ FILL PTRBLK IF NECESSARY & POSSIBLE	/A157
	AC2000			/ SET FLAG THAT TELLS FXSCRL TO
	DCA	SCRNFL		/   REPAINT THE ENTIRE SCREEN

/ THE BLOCK CONTAINING THE DESIRED PAGE, RULER, OR DOCUMENT BOTTOM
/ IS IN THE EDIT BUFFER, AND THE CURSOR IS POSITIONED AT THE
/ DESIRED ENTITY IF IT EXISTS; OTHERWISE THE CURSOR IS AT THE
/ BOTTOM OF THE DOCUMENT -- UNLESS THE USER PRESSED GOLD:HALT!
/ IN ANY EVENT, PTRBLK HAS BEEN SET UP TO PAINT THE SCREEN PROPERLY.

	JMS	SWTHMA		/ GO RESTORE THE ORIGINAL "MA" SWITCH SETTING
				/ FROM BEFORE ENTERING GTP, G:BOT, OR GTR
				/ (SEE COMMENT AT START OF "OVRPEX"
				/  OR "RRPOS" ROUTINES.)

/D157 	CDFSYS			/ GET TO FIELD 0 TO
/D157 	DCA I	HLTFLG		/ CLEAR A POSSIBLE GOLD-HALT FLAG
/D157 	CDFLP			/ NOW TO FIELD 5 TO
/D157 	DCA	RPACTIVE 	/ CLEAR GTP 'ACTIVE' FLAG

/ GO FINISH UP SOME BUSY WORK,
/    CALCULATE & SET THE STATUS LINE'S PAGE NUMBER LOCATIONS, AND THEN
/ GO RE-PAINT THE SCREEN, CLEAR MOVEMENT AND EDIT MODES, AND
/    WAIT FOR NEXT EDIT COMMAND
	OVLJMP;OVBOTB		/ END OF REPOSITIONING REQUEST

/
/ SUBR RRPS -- PTRBLK SETUP
/ FILLS UP PTRBLK WITH THE DESIRED SCREEN IMAGE,
/ AND LEAVES THE CURSOR AT THE SAME PLACE IN THE TEXT WHEN DONE.
/
/ ENTRY CONDITIONS:
/   RRPS ASSUMES THE CURSOR IS IN COLUMN 0.				/A157
/   PTRBLK MAY BE TOTALLY EMPTY, PARTIALLY FULL, OR COMPLETELY FULL,	/A157
/     BUT IT MUST NOT BE GARBAGE.					/A157
/   MATH MUST BE TURNED OFF.						/A157
/   IT IS BEST IF EDITOR'S STATUS LINE'S LINE # IS INITIALIZED
/     (SO IF PAGE IS FOUND BY RRPS, THEN LINE # WILL BE SET).
/
RRPS,	XX
	/ CHECK WHETHER PTRBLK IS PRIMED FOR SCRLDN			/A157
	/ (SCRLDN REQUIRES THAT LAST 2 PTRBLK ENTRIES BE FULL)		/A157
	CDFMYF								/A157
	TAD	PTRBLK+26	/ GET PTRBLK ENTRY FOR LAST LINE - 1	/A157
	SZA CLA			/ IS PTRBLK PRIMED?			/A157
	 JMP	RRPS1		/ YES-DON'T PRIME IT AGAIN		/A157
	/ PTRBLK NOT PRIMED - SO PRIME IT FOR MOVING CURSOR BACKWARDS	/A157
	/ SCRLDN WILL ACT STRANGE THE 1ST TIME IT'S CALLED		/A157
	/ (IT WILL PLACE CURSOR AFTER CURRENT POSITION, NOT BEFORE),	/A157
	/ BUT IF WE CONTINUE BACKING UP LINES (WHICH WE WILL),		/A157
	/ THEN EVERYTHING WILL BE OK.					/A157
	TAD	LINE23							/A157
	DCA	PTRBLK+26	/ SET UP LAST LINE-1 IN WINDOW		/A157
	TAD	LINE23							/A157
	DCA	PTRBLK+27	/ SET UP LAST LINE IN WINDOW		/A157
RRPS1,	/ PREPARE TO BACKUP A LINE					/M157
	AC0001			/ AC:=1 FOR "LINE" UNIT MODE
	DCA	GRAMUN		/ 1 = "LINE" MOVEMENT
	/ INSERT MARKER TO REMEMBER CURRENT PLACE IN DOCUMENT
	TAD	(ECTMRK)	/ POSITION MARK UNAFFECTED BY JUSTIFICATION
	JMS	INSRL1		/ INSERT POSITION MARKER		/M155
				/ NOTE: INSRL1 LEAVES CURPTR AFTER	/A155
				/ INSERTED CHAR. THUS RULER MODIFIED	/A155
				/ FLAG WILL BE INSERTED AFTER ECTMRK,	/A155
				/ ELSE THE ECTMRK MIGHT BE REJUSTIFIED!	/A155
	/
	/ BACKUP A LINE UNTIL PTRBLK IS FULL OR STX IS REACHED.
	/
/D157 RRPSLP,	CLA
/D157 	CDFMYF
/D157 	TAD	PTRBLK		/ IS PTRBLK FULL?
/D157 				/   (COULD BE FINE TUNED FOR WIDE
/D157 				/    SCREEN AND STATUS LINE)
/D157 	SZA CLA
/D157 	JMP	RRPSFM		/ YES: GO FIND POSITION MARKER
RRPSLP,	JMS	BACKUN		/ BACK CURSOR UP A LINE.		/M157
				/ FOR SOME OBSCURE REASON, BACKUN
				/ FILLS IN AN EXTRA ENTRY TOWARD THE
				/ TOP OF PTRBLK (AND THE SCREEN)
				/ EACH TIME IT IS CALLED.
				/ IF THIS WERE NOT SO, THIS ROUTINE
				/ WOULD BACKUP TO STX! (OHHHH NOOOO!)
	 JMP	RRPSGM		/   HIT STX: GO FIND POSITION MARKER	/M158
	CDFMYF
	TAD	PTRBLK		/ IS PTRBLK FULL YET?
	SNA CLA
	 JMP	RRPSLP		/ NO: LOOP UNTIL IT IS			/M157

	/
	/ PTRBLK IS NOW AS FULL AS IT CAN GET BY BACKING UP.
	/ MOVE FORWARD TO POSITION MARKER (WHICH MARKS DESIRED
	/ RULER OR PAGE).
	/
	/ AS WE MOVE FORWARD TO POSITION MARKER,
	/ PTRBLK MAY FILL UP MORE IF WE HAD REACHED STX;
	/ REJUSTIFICATION WILL OCCUR IF NEEDED (USUALLY IT WON'T BE);
	/ AND MATH MUST BE TURNED OFF IN CASE CURSOR PASSES OVER
	/ A WPSMATH CONTROL BLOCK (SEE SWTHMA).
	/
	/
/D158 RRPSFM,	JMS	LODCHR		/ AC=CURRENT CHAR
/D158 	JMP	RRPSLM		/   AT EOT: BUG-LOST MARKER
/D158 				/   MARKER IS PROBABLY STILL IN TEXT
/D158 				/   SOMEWHERE-TRY SEMI GRACEFUL RECOVERY
/D158 	TAD	(-ECTMRK)	/ IS CURSOR AT POSITION MARKER?
/D158 	SNA CLA
/D158 	JMP	RRPSAM		/ YES-AT MARKER

	SKP CLA			/ Start checking w/ current char.	/A200
RRPSFM,	AC0001			/ ADVANCE CURSOR			/M158
RRPSGM,	CURMOV								/M158
	 JMP	RRPSLM		/   AT EOT: BUG-LOST MARKER
				/   MARKER IS PROBABLY STILL IN TEXT
				/   SOMEWHERE-TRY SEMI GRACEFUL RECOVERY
	TAD I	CURPTR		/ GET CURRENT CHAR			/A158
	TAD	(-ECTMRK)	/ IS IT THE POSITION MARKER?		/A158
	SZA CLA								/A158
	 JMP	RRPSFM		/ NO: LOOP BACK TO FIND MARKER
	/
	/ FOUND POSITION MARKER.
	/ DELETE POSITION MARKER, THEN
	/ ADVANCE TO CHAR BEING MARKED (CURSOR'S FINAL RESTING PLACE)
	/
RRPSAM,	DCA I	CURPTR		/ DELETE POSITION MARKER
	ADVPTR			/ MOVE TO 1ST REAL CHAR ON LINE
	NOP			/   REACHED ETX-THAT'S OK
	/
RRPSLM,	CLA			/ FORGET CURRENT CHAR
	CDFMYF
	JMP I	RRPS		/ EXIT RRPS!


	X=.			/ INDICATE FIRST FREE LOCATION ON PAGE
/---------------------
	PAGE

/ here when this document has not been paginated or, if it has,
/  the user supplied a page # value = or < 0.
/ for either case, go to the top of the document and continue the edit cycle

/ Pseudo-OVINIT... Want to set the pointers to the top of the document.  Upon
/ entering, the buffer contains the start of a ruler, which we want to remove.
/ When entering, the edit buffer looks like:   7777  When exiting:   7777
/					       7775		     7775
/					       0016		     7775
/					       7775		     0000
/					       0000		     0000
/					        .		      .
/					        .		      .
/					        .		      .

RPPTOP,	TAD	RPPG0		/ --TOP-- FLAG
	SMA CLA			/ SKIP IF ABSOLUTE PAGE 0 OR,
				/ NEG. OFFSET WENT BEYOND --TOP--

	JMP	TOTOP		/ JUMP IF PAGE 1 OR,
				/ NEG. OFFSET = CURRENT PAGE #
	OVLJMP;RPPER7		/ REPORT ERROR AND RETURN AT OVRPEX...

TOTOP,				/ GET TO ---TOP---
	JMS	RPOVIN		/ CLEAR EDIT BUFFER			/M157
	JMS	RRPBIN		/ CLEAR PTRBLK & INIT LAST ENTRY	/A157
	OVLJMP			/ JUMP TO OVERLAY WITH ABOVE CODE
	 OVRPTP


/D157 TORPWP,	JMS	RROPR		/ OPEN DOCUMENT AT DESIRED BLOCK
/D157 	CDFMYF
/D154	TAD	RPBOTF		/ GET THE 'GOLD BOTTOM' FLAG
/D154	SPA CLA			/ SKIP IF NOT GOLD BOTTOM
/D154	JMP	EIBOTA		/   JUMP IF GOLD BOTTOM
/D157 	JMP	RPFPG		/ CONTINUE GOTO-PAGE and GOLD_BOTTOM


/D155 /
/D155 / SUBR RRRAND -- RANDOM-ACCESS OPEN
/D155 /
/D155 /
/D155 / PSUEDO-CODE:
/D155 /
/D155 / CALL WPFILS TO OPEN DOCUMENT FOR SCROLLING AT DESIRED BLOCK
/D155 /   (DEFINED BY RPCUOF,RPCUBK);
/D155 / READ GOTO-PAGE DESCRIPTOR WORD FOR THIS BLOCK (CHANGES BLOCK);
/D155 / IF BIT RPMTHB IS ON THEN
/D155 /	PCTLFL := 1	( INDICATE WITHIN CONTROL BLOCK )
/D155 / ELSE
/D155 /	PCTLFL := 0	( INDICATE NOT WITHIN CONTROL BLOCK )
/D155 / CALL WPFILS TO OPEN DOCUMENT FOR SCROLLING AT DESIRED BLOCK
/D155 /   (DEFINED BY RPCUOF,RPCUBK);
/D155 /
/D155 /
/D155 / CALL:
/D155 /	/ IT IS ASSUMED TEXT, ETX, & STX BUFFERS ARE ALL EMPTY
/D155 /	/ RPCUOF= OFFSET INTO DOCUMENT HEADER BLOCK FOR DESIRED BLOCK
/D155 /	/ RPCUBK= HEADER BLOCK ID # FOR DESIRED BLOCK
/D155 /	CDFMYF
/D155 /	CLA
/D155 /	JMS	RRRAND		/ RANDOM-ACCESS OPEN FOR SCROLLING
/D155 /	/ DOCUMENT IS NOW OPEN FOR SCROLLING USING STANDARD METHODS
/D155 /	/   (ADVPTR,BAKPTR,ETC.).
/D155 /	/ PCTLFL IS SET UP TO INDICATE WHETHER OR NOT CURSOR IS
/D155 /	/   IN A CONTROL BLOCK.
/D155 /	/ AC= 0.
/D155 /	/ DF= CDFBUF
/D155 /
/D155 /
/D155 RRRAND,	XX
/D155 	/
/D155 	/ OPEN DOCUMENT AT DESIRED BLOCK
/D155 	/
/D155 	JMS	RRRAOP
/D155 	/
/D155 	/ READ GOTO-PAGE DESCRIPTOR WORD OF "DESIRED BLOCK"
/D155 	/
/D155 	AC7777			/ SUBFUNCTION TO READ "NEXT" DESC WORD
/D155 	JMS	DSKCAL
/D155 	XRPRD
/D155 	/
/D155 	/ SET PCTLFL FROM GOTO-PAGE DESCRIPTOR WORD
/D155 	/
/D155 	AND	(RPMTHB)	/ TEST "WITHIN CONTROL BLOCK" BIT
/D155 	SZA CLA			/ SKIP IF NOT IN CONTROL BLOCK
/D155 	AC7777			/ INDICATE IN CONTROL BLOCK
/D155 	DCA	PCTLFL
/D155 	/
/D155 	/ RE-OPEN DOCUMENT AT "DESIRED BLOCK",
/D155 	/ SINCE "READ DESC WORD" ABOVE INCREMENTED BLOCK POINTERS
/D155 	/
/D155 	JMS	RRRAOP
/D155 	JMP I	RRRAND		/ EXIT
/D155
/D155 /
/D155 / SUBR RRRAOP -- OPEN DOCUMENT AT "DESIRED BLOCK"
/D155 /
/D155 RRRAOP,	XX
/D155 	CDFMYF
/D155 	TAD	RPCUBK		/ HEADER BLOCK ID #
/D155 	MQL
/D155 	AC7776			/ ADJUST OFFSET TO 0..375
/D155 	TAD	RPCUOF		/ OFFSET INTO HEADER FOR DESIRED BLOCK
/D155 	JMS	DSKCAL		/ OPEN DOCUMENT AT THIS BLOCK
/D155 	XRPRD			/   (SPECIAL GOTO-PAGE FUNCTION)
/D155 	JMP I	RRRAOP		/ EXIT

/ START OF "/A155" BLOCK ...						/A155


/
/ SUBR RROPR -- RANDOM-ACCESS OPEN FILE FOR SCROLLING
/		AT RELATIVE BLOCK RPCUOF,RPCUBK
/ CLEARS TEXT BUFFER AND PTRBLK.
/ FIRST FILE SCROLLING OPERATION MAY BE ADVPTR OR BAKPTR.
/ RROPR IS USED BY GOTO-PAGE AND GOLD:BOTTOM.
/
/ CALL:
/	/ RPCUOF= OFFSET INTO DOCUMENT HEADER BLOCK FOR DESIRED BLOCK
/	/ RPCUBK= HEADER BLOCK ID # FOR DESIRED BLOCK
/	CDFMYF
/	CLA
/	JMS	RROPR		/ RANDOM-ACCESS OPEN AT RELATIVE BLOCK
/	/ AC= 0
/	/ DF= CDFMYF
/
RROPR,	XX
	TAD	RPCUBK		/ HEADER BLOCK ID #
	MQL
	AC7776			/ ADJUST OFFSET TO 0..375
	TAD	RPCUOF		/ OFFSET INTO HEADER FOR DESIRED BLOCK
	JMS	RROPN		/ OPEN DOCMT AT RELATIVE BLOCK
	JMP I	RROPR


/
/ SUBR RROPP -- RANDOM-ACCESS OPEN FILE FOR SCROLLING
/		AT PHYSICAL BLOCK RPCUBK
/ ASSUMES FILE IS OPEN AND SCTOP,SCTPH POINT TO FIRST DOCMT BLOCK-1.	/A157
/ CLEARS TEXT BUFFER AND PTRBLK.
/ FIRST FILE SCROLLING OPERATION MAY BE ADVPTR OR BKPPTR.
/ RROPR IS USED BY GOTO-RULER.
/
/ CALL:
/	/ RPCUBK= PHYSICAL BLOCK # OF DESIRED BLOCK
/	CDFMYF
/	CLA
/	JMS	RROPP		/ RANDOM-ACCESS OPEN AT PHYSICAL BLOCK
/	/ AC= 0
/	/ DF= CDFMYF
/
RROPP,	XX
	/								/A157
	/ TRANSLATE PHYSICAL BLOCK # (RPCUBK)				/A157
	/ TO RELATIVE BLOCK # (HDR BLOCK OFFSET, HDR BLK ID #)		/A157
	/								/A157
RROPPL,	/ GET GTP DESC WORD FOR NEXT DOCMT BLK				/A157
	AC7777			/ FUNCTION=INC SCTOP,SCTPH & READ DESC	/A157
	JMS	DSKCAL							/A157
	 XRPRD								/A157
	CMA			/ HIT ETX?				/A157
	SNA CLA								/A157
	 HLT			/ YES-COULDN'T FIND PHYS BLK # IN DOCMT	/A157
	/ GET CURRENT SCTOP (WPFILS MAKES THIS AWKWARD)			/A157
	TAD	(CURID-1)	/ RETURN SCTOP,SCTPH AT CURID,CURID+1	/A157
	MQL			/   (USES CURID AS A TEMP)		/A157
	AC7775			/ FUNCTION=RETURN SAVED & CURRENT	/A157
	JMS	DSKCAL		/   SCTOP,SCTPH IN AC,MQ & @(ORIG MQ)	/A157
	 XRPRD								/A157
	CLA			/ FORGET SAVED SCTOP IF ANY		/A157
	CDFLP								/A157
	TAD I	(CURID+1)	/ GET SCTOP (FINALLY!)			/A157
	/ GET PHYSICAL BLOCK # CORRESPONDING TO SCTOP			/A157
	TAD	(HDRBUF+2)	/ CONVERT SCTOP TO PTR INTO DOCMT HDR BLK/A157
	DCA	T1		/ SAVE PTR TO PHYS BLK #		/A157
	CDFBUF			/ FIELD OF DOCMT HDR BLOCK BUFFER	/A157
	TAD I	T1		/ GET PHYSICAL BLOCK #			/A157
	/ LOOP IF NOT AT DESIRED PHYSICAL BLOCK #			/A157
	CIA			/ COMPARE CURRENT PHYSICAL BLK # TO ...	/A157
	CDFMYF								/A157
	TAD	RPCUBK		/ ... DESIRED PHYSICAL BLOCK #		/A157
	SZA CLA								/A157
	 JMP	RROPPL		/ NO MATCH: KEEP LOOKING		/A157
	/ FOUND PHYSICAL BLOCK!						/A157
	/ PUT RELATIVE BLOCK # IN AC,MQ FOR OPEN			/A157
	CDFLP			/ FIELD OF CURID, WHERE CURRENT SCTOP,	/A157
				/ SCTPH WERE STORED BY WPFILS CALL ABOVE/A157
	TAD I	(CURID)		/ GET CURRENT SCTPH			/A157
	MQL			/ MQ=DOCMT HDR BLOCK ID (0..17?)	/A157
	TAD I	(CURID+1)	/ GET CURRENT SCTOP=OFFSET INTO HDR BLK	/A157
	/ RANDOM-ACCESS OPEN AT DESIRED PHYSICAL BLOCK (USING REL BLK)	/A157
	JMS	RROPN							/A157
	/ WPFILS HAS A BUG SUCH THAT IF BKPPTR IS FIRST FILE SCROLLING
	/ OPERATION AFTER A RANDOM-ACCESS OPEN, THE FILE MODE (LOWER CASE,
	/ UNDERLINE, ETC) CAN BE LOST.  THIS PROBLEM IS AVOIDED
	/ BECAUSE RROPN ALWAYS DOES AN ADVPTR FIRST.
	JMP I	RROPP		/ EXIT


/
/ SUBR RROPN -- RANDOM-ACCESS OPEN FILE FOR SCROLLING
/		AT BLOCK IN AC (OFFSET), MQ (HEADER ID #)
/
RROPN,	XX
	/
	/ OPEN DOCUMENT AT DESIRED BLOCK
	/
	JMS	DSKCAL
	 XRPRD
	/
	/ NOTE: SCBOT,SCBTH POINT TO DESIRED BLOCK;
	/	SCTOP,SCTPH POINT TO DESIRED BLOCK - 1.
	/ READ GOTO-PAGE DESCRIPTOR WORD OF "DESIRED BLOCK"
	/
	AC7777			/ (FUNCTION=READ "NEXT" DESC WORD)
	JMS	DSKCAL		/ INC SCTOP,SCTPH TO "DESIRED BLOCK"
	 XRPRD
	AC7777			/ FORGET DESC WORD(WE'LL GET IT AGAIN)
	MQL			/ DEC SCTOP,SCTPH TO ORIGINAL BLOCK
	TAD	(-6)		/ BUT FIRST READ GTP DESC WORD
	JMS	DSKCAL		/   FOR "DESIRED BLOCK" INTO AC AGAIN
	 XRPRD
	/
	/ SET PCTLFL FROM GOTO-PAGE DESCRIPTOR WORD
	/
	AND	(RPMTHB)	/ TEST "WITHIN CONTROL BLOCK" BIT
	SZA CLA			/ SKIP IF NOT IN CONTROL BLOCK
	 AC7777			/ INDICATE IN CONTROL BLOCK
	DCA	PCTLFL
	/								/A157
	/ ADVANCE TO START OF LINE.					/A157
	/ (CURMOV IS CLEANER IF IT STARTS AT THE START OF A LINE.	/A157
	/  THIS AVOIDS A COUPLE OF RATHER UNLIKELY BUGS.)		/A157
	/								/A157
	JMS	RPOVIN		/ CLEAR EDIT BUFFER			/A157
RROPLN,	ADVPTR			/ GET NEXT CHAR FROM START OF "DESIRED BLOCK"/A157
	 JMP	RROPX		/   AT ETX				/A157
	AND	P177		/ IGNORE ATTRIBUTE BITS			/A157
	ZZCASE			/ AT START OF NEW LINE?			/A157
	 RROPTB-1							/A157
	 / ECSTRL; RROPX	/ YES					/A157
	 / ECNWPG; RROPX	/ YES					/A157
	 / ECNWLN; RROPL2	/ ALMOST (NEXT CHAR IS START OF LINE)	/A157
	JMP	RROPLN		/ NO: ADVANCE UNTIL START OF LINE	/A157
									/A157
RROPL2,	ADVPTR			/ SKIP OVER LINE END			/A157
	 NOP			/   REACHED ETX				/A157
	CLA			/ THROW OUT LINE ENDING CHAR		/A157
RROPX,	JMS	RRPBIN		/ CLEAR PTRBLK & INIT LAST ENTRY	/A157
	JMP I	RROPN		/ EXIT					/A157
									/A157
/ ZZCASE JUMP TABLE							/A157
RROPTB,	ECSTRL; RROPX		/ START OF RULER			/A157
	ECNWPG; RROPX		/ NEW PAGE				/A157
	ECNWLN; RROPL2		/ NEW LINE				/A157
	0

/ END OF "/A155" BLOCK ...						/A155


/
/ SUBR RPOVIN -- INITIALIZE EDIT BUFFER					/M157
/
/ ASSUMES EDIT BUFFER STARTS AT LOC 0000 AND IS 6000(8) WORDS LONG;	/M155
/ THUS WILL NOT WORK WITH LIST PROCESSING.
/ ADDITIONAL ASSUMPTIONS COULD BE MADE WHICH WOULD
/ SHORTEN THE CODE EVEN MORE.
/
RPOVIN,	XX
	CDFBUF			/ GET TO BUFFER FIELD
	AC7777			/ POINTER TO START
	DCA	X0		/ X0 => EDIT BUFFER POINTER
/D155 	TAD	(ECBFBG)	/ 7777
	IFNZRO	ECBFBG-7777	< ? >	/ PREFIX FILE CHANGED		/A155
	AC7777			/ AC := ECBFBG				/A155
	DCA I	X0		/ 1ST LOC.
/D155 	TAD	(ECSTX)		/ 7775
	IFNZRO	ECSTX-7775	< ? >	/ PREFIX FILE CHANGED		/A155
	AC7775			/ AC := ECSTX				/A155
	DCA I	X0		/ 2ND LOC.
/D155 	TAD	(ECETX)		/ 7775
	IFNZRO	ECETX-7775	< ? >	/ PREFIX FILE CHANGED		/A155
	AC7775			/ AC := ECETX				/A155
	DCA I	X0		/ 3RD LOC.

/D155 	TAD	BUFSIZ		/ SIZE OF EDIT BUFFER
/D155 	CIA			/ - # OF WORDS IN EDIT BUFFER
/D155 	TAD	(4)		/ ALREADY USED THESE MANY
	TAD	(-6000+4)	/ -(LENGTH OF EDIT BUFFER - 4)		/A155
				/ (WILL FAIL DURING LIST PROCESSING)	/A155
	DCA	X1		/ X1 => # OF LOC. TO CLEAR
	TAD	X0		/ 2ND LOC.
	DCA	CURPTR		/ CURPTR => PTR. AT ETX
	DCA I	X0		/ CLEAR A LOC.
	ISZ	X1		/ SKIP IF EDIT BUFFER CLEARED
	JMP	.-2		/ LOOP UNTIL CLEARED
/D155 	TAD	(ECBFND)	/ 7776
	IFNZRO	ECBFND-7776	< ? >	/ PREFIX FILE CHANGED		/A155
	AC7776			/ AC := ECBFND				/A155
	DCA I	X0		/ LAST BUFFER LOC.

/D157	JMS	RRPBIN		/ INITIALIZE PTRBLK
/D157 	TAD	CURPTR		/ POINTS AT ETX
/D157 	DCA	LINE23		/ INIT. SCREEN LINE
/D157 	DCA	CURSOR		/ INIT.
	JMP I	RPOVIN		/ RETURN TO CALLER


/ called by OVRBTM which was called by BOTEM to do old GOLD_BOTTOM	/A154
/	don't need this anymore...					/A154
/D154 BOTRUL,	JMS	RRPBIN		/ INITIALIZE PTRBLK
/D154	AC0001			/ finish loading the ruler
/D154	CURMOV
/D154	NOP			/ etx will never occur
/D154 EIBOTA,	OVLJMP;OVBOTA		/ GO TO NEXT OVERLAY TO FINISH UP


/
/ SUBR RRPBIN - PTRBLK INITIALIZATION
/
/ CLEARS PTRBLK & INITIALIZES LAST ENTRY;
/ INITIALIZES LINE23 & CURSOR.						/A157
/ ASSUMES CURPTR IS AT THE START OF A LINE.
/
RRPBIN,	XX
	CDFMYF			/ FROM BUFFER FIELD
	TAD	(PTRBLK-1)	/ START OF SCROLL POINTERS
	DCA	X0
	TAD	(-NPTRS+1)	/ # OF POINTERS
	DCA	X1
	DCA I	X0		/ CLEAR A POINTER
	ISZ	X1		/ SKIP IF ALL POINTERS CLEARED
	JMP	.-2		/ LOOP UNTIL ALL CLEARED

	TAD	CURPTR		/ GET PTR TO (ASSUMED) START OF LINE	/M157
	DCA I	X0		/ INIT. 1ST SCROLL POINTER

	TAD	CURPTR		/ POINTS AT ETX				/A157
	DCA	LINE23		/ INIT. SCREEN LINE			/A157
	DCA	CURSOR		/ INIT.					/A157
 	JMP I	RRPBIN


/D157 / here to close a very small GOLD_BOTTOM window, that being the presence
/D157 / of a document that contains 4095 page markers between the logical_EOF
/D157 / ( -1 desc. word) and physical_EOF
/D157
/D157 RPGBOT,	TAD	RPBOTF		/ get the GOLD_BOTTOM flag		/A154
/D157 	SMA CLA			/ skip if doing a GOLD_BOTTOM		/A154
/D157 	JMP	RRPS		/ jump to conclude GTP			/A154
/D157 	AC0001			/ initial for furthur scrolling		/A154
/D157 	DCA	CURPG1		/ won't come here for every page	/A154
/D157 	JMP	RPADVUNT	/ scroll_until_EOF			/A154

	X=.			/ INDICATE FIRST FREE LOCATION ON PAGE
/---------------------
	PAGE

/***************************************************************************
/****			   START OF OVERLAY				****
/***************************************************************************

	OVRNUM=OVRNUM+200
	OVRBLK=OVRNUM%200+DLOEDO-1 / DISK BLOCK WHERE OVERLAY IS LOADED

	RELOC
	RELOC	OVLAY1
	OVRNUM


/
/ DISPLAY THE GOTO-PAGE SCREEN
/ ("REPOSITIONING TO YOUR DESIRED PAGE...")
/
	OVPAGE=	.-OVLAY1+OVRNUM	/ --OVERLAY ENTRY POINT--

	JMS	CLR132		/ CLEAR 132 MODE ON GOLD BOTTOM

	CIFMNU			/ CHANGE TO MENU INSTRUCTION FIELD
	AC0003			/ SET UP FOR CLEAR SCREEN REQUEST
	JMS I	(CALLN1)	/ GO TO STATUS LINE ROUTINE FOR CLEAR

	CIFMNU			/ ...GOING TO 'IOA' FOR SCREEN DISPLAYS
	JMS I	IOACAL
	0			/   NO SPECIAL OUTPUT ROUTINE
	M2PAGE			/   ADDR OF MESSAGE
	1125			/   ^P (SCREEN POSITION)
	M2PAG			/   ^S (STRING ARG="PAGE")
	1437			/   ^P
	2700			/   ^P
	JMP	XVGOPG


/
/ DISPLAY THE GOTO-RULER SCREEN
/ ("REPOSITIONING TO YOUR DESIRED RULER...")
/
	OVRRDS=	.-OVLAY1+OVRNUM
	/
	/ SET UP SOME FLAGS TO DO GOTO-RULER
	/ SEE LARGE COMMENT BLOCK SHORTLY AFTER 'RRFND1' FOR DETAILS
	/
	AC4000			/ INHIBITS CLEARING OF SCREEN
	DCA	RPBIN1		/   WE ARE ABOUT TO CREATE
	/
	/ DISPLAY "REPOSITIONING TO DESIRED RULER..." SCREEN
	/
	JMS	CLR132		/ CLEAR 132 MODE ON GOLD BOTTOM

	CIFMNU			/ CHANGE TO MENU INSTRUCTION FIELD
	AC0003			/ SET UP FOR CLEAR SCREEN REQUEST
	JMS I	(CALLN1)	/ GO TO STATUS LINE ROUTINE FOR CLEAR

	CIFMNU			/ ...GOING TO 'IOA' FOR SCREEN DISPLAYS
	JMS I	IOACAL
	0			/   NO SPECIAL OUTPUT ROUTINE
	M2PAGE			/   ADDR OF MESSAGE
	1125			/   ^P (SCREEN POSITION)
	M2RUL			/   ^S (STRING ARG="RULER")
	1437			/   ^P
	2700			/   ^P
	/
	/ GO TO COMMON CODE
	/
	JMP	RPTOP		/ GO CLOSE DOCUMENT, OPEN AT TOP, ETC,


/ GOLD_BOTTOM now paints the screen and exits in the same way as	/A154
/   GTP does...								/A154


/
/ FINISH GO-TO-PAGE, GOLD:BOTTOM AND GO-TO-RULER FOR STATUS LINE
/
	OVBOTB=	.-OVLAY1+OVRNUM	/ --OVERLAY ENTRY POINT--

/D157 	CLA								/A154
/D157 	DCA	RPBOTF		/ clear doing GOLD_BOTTOM flag		/A154

	CDFLP			/ NOW TO FIELD 5 TO 			/A157
	DCA	RPACTIVE 	/ CLEAR GTP 'ACTIVE' FLAG		/A157

	AC7777			/ SET FLAG TO RETURN THE VALUES
	CDILP			/ SET TO FIELD FIVE FOR ROUTINE
	JMS	RPPMENU		/ CALCULATE CURRENT PAGE VALUE

	TAD	CURPG2		/ PICK UP THOUSANDS COUNT OF PAGES
	JMS	MNUPUT		/ STORE VALUE IN HIGH ORDER PAGE COUNT
	LINPGH-MUBUF		/ STATUS LINE HIGH ORDER PAGE NUMBER

	TAD	CURPG1		/ PICK UP HUNDREDS COUNT OF PAGES
	JMS	MNUPUT		/ STORE VALUE IN LOW ORDER PAGE COUNT
	LINPGL-MUBUF		/ STATUS LINE LOW ORDER PAGE NUMBER

	JMP	EIFIX		/ GO PUT UP THE SCREEN CONTENTS


/
/ "GOLD:BOTTOM" COMMAND
/
	OVRBOT=	.-OVLAY1+OVRNUM	/ --OVERLAY ENTRY POINT--
				/ DISPLAY THE GOLD BOTTOM SCREEN

/D158 	AC0001			/ SET UP TO SHUT DOWN THE "MA" SWTCH
/D158 	JMS	SWTHMA		/ DEACTIVATE MATH & SAVE ORIGINAL "MA".
	AC4000
	DCA	RPBIN1
	AC0100
	DCA	RPBIN2
/D157 	AC7777
/D157 	DCA	RPBOTF		/ [-1] MEANS GOLD BOTTOM REQUEST
	DCA	RPPG0		/ 0 = NOT AT ---TOP-- FLAG

	JMS	CLR132		/ CLEAR 132 MODE ON GOLD BOTTOM

	CIFMNU			/ CHANGE TO MENU INSTRUCTION FIELD
	AC0003			/ SET UP FOR CLEAR SCREEN REQUEST
	JMS I	(CALLN1)	/ GO TO STATUS LINE ROUTINE FOR CLEAR

	CIFMNU			/ ...GOING TO 'IOA' FOR SCREEN DISPLAYS
	JMS I	IOACAL
	 0			/ NO SPECIAL OUTPUT ROUTINE
	 M2BOT			/ ADDR OF MESSAGE
	 1125			/ ^P
	 1437			/ ^P
	 2700			/ ^P
	AC7777			/ NEG RPBOTF MEANS DO GOLD:BOTTOM	/A157
XVGOPG,	DCA	RPBOTF		/ POS RPBOTF MEANS DO GOTO-PAGE		/A157

/ initialize common GOLD:BOTTOM and GOTO-PAGE pointers

	DCA	RRDIR		/ INDICATE THIS IS NOT GOTO-RULER	/M157
	TAD	(55)
	DCA	RPCUOF		/ POINTS AT 1ST DESCRIPTOR WORD
	TAD	(55)
	DCA	RPMTRL		/ DEFAULT RULER-BLOCK OFFSET
	DCA	RPMTBK		/ NO MATH BLOCK
	AC0001
	DCA	RPCUBK		/ START WITH 1ST RPPGDS BLOCK
	AC0001
	DCA	RPRLHN		/ DEFAULT RULER IN 1ST RPPGDS BLOCK

/ DOING A GTP or GOLD_BOTTOM REQUEST, IGNORE GOLD-HALT WHILE
/ PREPARING THE SCREEN AND LOADING A RULER
/ NOTE: I DON'T THINK THIS IS NEEDED--MY BET IS THAT ALL		/A157
/	REFERENCES TO 'RPACTIVE' COULD BE DELETED!			/A157
	CDFLP			/ FIELD 5 FOR OUR FLAG
	AC7777			/ WAS 0; SET TO 'ACTIVE'
	DCA	RPACTIVE	/ SO GOLD-HALT GETS IGNORED BY HLTTST
	CDFMYF			/ BACK TO THIS FIELD
	JMP	RPTOP		/ 'TOP' THE DOC THEN TO OVERLAY OVRRP2

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

TRANTP=.			/ TOP OF TRANSLATION PAGE		/A240

M2BOT,	
	IFDEF ENGLSH <
	TEXT	'^P&REPOSITIONING TO BOTTOM OF DOCUMENT.   '		/ 1133
    *.-1
	TEXT	'^P&PLEASE STAND BY.^P'				/ 1450	/ 2700
	>

	IFDEF V30NOR <
	TEXT	'^P&MARK\XREN FLYTTES TIL BUNNEN AV DOKUMENTET.   '		/ 1133
    *.-1
	TEXT	'^P&VENT.^P'				/ 1450	/ 2700
	>

	IFDEF V30SWE <
	TEXT	'^P&FLYTTAR TILLBAKA TILL SLUTET AV DOKUMENTET.   '		/ 1133
    *.-1
	TEXT	'^P&V\DNTA.^P'				/ 1450	/ 2700
	>

	IFDEF SPANISH <							/A236
	TEXT	'^P&REAJUSTE DE PARTE INFERIOR DEL DOCUMENTO.   '		/ 1133
    *.-1
	TEXT	'^P&ESPERE.^P'				/ 1450	/ 2700
	>								/A236

	IFDEF ITALIAN <
	TEXT	'^P&REPOSIZIONAMENTO ALLA FINE DEL DOCUMENTO.^P&ATTENDERE.^P'
	>
	IFDEF DUTCH <
	TEXT	'^P&OP WEG NAAR HET EINDE VAN HET DOCUMENT.'
    *.-1
	TEXT	'^P&EVEN GEDULD...^P'
	>

M2PAGE,	
	IFDEF ENGLSH <
	TEXT	'^P&REPOSITIONING TO YOUR DESIRED ^S.   '		/ 1133
    *.-1
	TEXT	'^P&PLEASE STAND BY.^P'				/ 1450	/ 2700
	>

	IFDEF V30NOR <
	TEXT	'^P&MARK\XREN FLYTTES TIL ANGITT ^S.   '		/ 1133
    *.-1
	TEXT	'^P&VENT^P'				/ 1450	/ 2700
	>

	IFDEF V30SWE <
	TEXT	'^P&FLYTTAR TILLBAKA TILL \VNSKAD ^S.   '		/ 1133
    *.-1
	TEXT	'^P&V\DNTA^P'				/ 1450	/ 2700
	>

	IFDEF SPANISH <							/A236
	TEXT	'^P&REAJUSTE COMO DESEE ^S.   '		/ 1133
    *.-1
	TEXT	'^P&ESPERE.^P'				/ 1450	/ 2700
	>								/A236

	IFDEF ITALIAN <
	TEXT	'^PRIPOSIZIONAMENTO SUL^S.^P&ATTENDERE.^P'
	>

	IFDEF DUTCH <
	TEXT	'^P&OP WEG NAAR DE GEWENSTE ^S.'
   *.-1
	TEXT	'^P&EVEN GEDULD...'
	>

M2PAG,	
	IFDEF ENGLSH < TEXT 'PAGE' >
	IFDEF V30NOR < TEXT 'SIDE' >
	IFDEF V30SWE < TEXT 'SIDA' >
	IFDEF SPANISH < TEXT 'P\AGINA' >				/A236
	IFDEF ITALIAN < TEXT 'LA PAGINA VOLUTA' >
	IFDEF DUTCH < TEXT 'PAGINA' >
M2RUL,	
	IFDEF ENGLSH < TEXT 'RULER' >
	IFDEF V30NOR < TEXT 'FORMATERINGSLINJE' >
	IFDEF V30SWE < TEXT 'LINJAL' >
	IFDEF SPANISH < TEXT 'REGLA' >					/A236
	IFDEF ITALIAN < TEXT ' DESCRITTORE RIGA VOLUTO' >
	IFDEF DUTCH < TEXT 'REGELINDELING' >

	X=.			/ INDICATE FIRST FREE LOCATION ON PAGE
/---------------------
	PAGE
IFNZRO	.	<?TRANS TOO BIG>				/A240


/***************************************************************************
/****			   START OF OVERLAY				****
/***************************************************************************

	OVRNUM=OVRNUM+200
	OVRBLK=OVRNUM%200+DLOEDO-1 / DISK BLOCK WHERE OVERLAY IS LOADED

	RELOC
	RELOC	OVLAY1
	OVRNUM
	RPPER7=	.-OVLAY1+OVRNUM	/ --OVERLAY ENTRY POINT--
/	JMP	XPPER7

/D192	CDFEDT
	JMS	CLR132		/ 80 column mode for error display	/A192

	CIFMNU			/ CHANGE TO MENU INSTRUCTION FIELD
	AC0003			/ SET UP FOR CLEAR SCREEN REQUEST
	JMS I	(CALLN1)	/ GO TO STATUS LINE ROUTINE FOR CLEAR

	CIFMNU			/ ...GOING TO 'IOA' FOR SCREEN DISPLAYS
	JMS I	IOACAL
	0
	MER7
	0031			/ ^P
	0431			/ ^P
	1317			/ ^P
	1417			/ ^P

	OVLJMP;	RPER7B		/ 2ND HALF OF GOTO PAGE ERROR #7

/ =========================================================================
/ +++ CHANGES FOR EDIT HISTORY #176 FOR GOLD:TAB			+++
/ =========================================================================
/
/	Double Entry Point routine to process either
/		Gold:tab or Gold:ruler.
/
/
	OVRULR=	.-OVLAY1+OVRNUM	/ Gold:Ruler				/c176

VECFLG,	DCA	VECFLG		/ VECFLG="0"				/a176

	OVGLTB=	.-OVLAY1+OVRNUM	/ Gold:Tab				/a176

				/ VECFLG="DCA VECFLG" (Non-Zero)	/a176

/ PREPARE TO MODIFY RULER BY CONCATENATING ADJACENT RULERS, IF ANY.

	JMS	RLCKNR		/ CHECK FOR NEW RULER
	JMP	RLCONA		/   NO NEW RULER

/ THERE IS A NEW RULER.
/ CHECK FOR ADJACENT RULER.

	BKPPTR			/ BACKUP TO ECNDRL OF ADJ RULER, IF ANY
	JMP	RLCONB		/   NO ADJACENT RULER
	TAD	(-ECNDRL)	/ IS THERE AN ADJACENT RULER?
	SNA CLA
	JMP	RLCONC		/ YES: CONCATENATE ADJACENT RULERS

/ THERE IS A NEW RULER, BUT NO ADJACENT RULER(S), SO
/ THERE IS NO INITIAL RULER CONCATENATION, AND
/ CURPTR IS RESTORED TO VALUE ON ENTRY TO OVRULR.

RLCONB,	TAD	RLCURP
	DCA	CURPTR
	JMP	RLCONA
/
/ +++	RLCONA was moved to the next page for space			/m176
/
	/ THERE ARE ADJACENT RULERS.
	/ TO SIMPLIFY THE "DELETE RULER" FUNCTION WHICH MAY
	/ BE INVOKED LATER, WE WILL NOW CONCATENATE THESE
	/ ADJACENT RULERS (WHICH MAY BE DELETED IN THE PROCESS).
	/
	/ WE WILL CONCATENATE ADJACENT RULERS BY MOVING THE CURSOR
	/ BACK THEN FORWARD OVER THEM.  WHEN WE DO THIS,
	/ WE WILL FORGET THE CURRENT CURSOR LOCATION WITHIN
	/ THE LINE, SINCE THERE IS A TINY CHANCE THAT THERE
	/ ARE 50 OR MORE ADJACENT RULERS, AND THAT MOVING
	/ OVER THEM WILL CAUSE DATA TO BE SCROLLED IN FROM
	/ DISK OVER THE PLACE IN THE EDIT BUFFER CORRESPSN$.
	/
	/ WE WILL CONCATRSOR LOCATION!
	/ PARANOID, ISN'T IT?
	/
	/ AT ANY RATE, THE CURSOR WILL BE LEFT AT THE
	/ BEGINNING OF THE LINE.

RLCONC,	TAD	LINE23		/ MOVE TO BEGINNING OF THE LINE
	DCA	CURPTR
	DCA	CURSOR
	AC7777			/ BACK UP CURSOR OVER ALL ADJACENT RULERS
	CURMOV
	SKP CLA		/ AT STX: GLIDE OVER RULER(S) TO 1ST TEXT CHAR
	AC0001			/ ADVANCE CURSOR OVER ALL ADJACENT RULERS,
	CURMOV			/   AND CONCATENATE OR DELETE THEM.
	JMP	RLCONA
	JMP	RLCONA


/
/ DELETE RULER COMMAND
/

	OVRLDL=	.-OVLAY1+OVRNUM

/ IF CURPTR IS AT A RULER, THEN
/     IF CURPTR IS AT THE FIRST RULER IN THE DOCUMENT, THEN
/         BEEP TO WARN THE USER;
/     ELSE  (* NOT FIRST RULER *)
/         SET NWRUL := BACKWARD POINTING HALF OF RULER;
/         (*WHEN THIS RULER IS INSERTED AFTER THE EXISTING RULER,
/           THE RULER CLEAN-UP CODE WILL DELETE BOTH RULERS.
/           NOTE THAT IF THERE IS A NEW RULER, IT CANNOT HAVE AN
/           ADJACENT RULER, SINCE WE CAREFULLY CONCATENATED ANY
/           SUCH RULERS WHEN WE STARTED (AT OVRULR).
/         *)
/     RESTORE CURPTR TO VALUE AT TIME OF ENTRY TO OVRLDL;
/ ELSE (* NO NEW RULER *)
/     (* SAME AS "=" COMMAND *)
/     SET NWRUL := CURUL;
/ GOTO DISPLAY NWRUL AND ACCEPT RULER EDITING COMMAND

	JMS	RLCKNR		/ CHECK FOR EXISTING RULER
	JMP	RLOJER		/   NONE: SAME AS "="
	BKPPTR			/ AT STX?
	JMP	RLDLER		/ YES: AT FIRST RULER, CAN'T DELETE IT
	ADVPTR			/ NO: RESTORE CURPTR
	NOP			/   (AT ETX--THAT'S OK)
	CLA			/ FORGET ECSTRL IN AC FROM ADVPTR
	JMS	SETRUL		/ SET NWRUL FROM BACKWARDS POINTING
				/   HALF OF EXISTING RULER
	ESADRL			/   (GET RULER CHAR ROUTINE)
RLDL2,	TAD	RLCURP		/ RESTORE CURPTR
	DCA	CURPTR
	OVLJMP			/ GO DISPLAY RULER AND WAIT FOR CMD
	OVDRUL

	/ THERE IS NO NEW RULER IN TEXT TO DELETE, SO
	/ JUST AVOID INSERTING A NEW ONE.
RLOJER,	OVLJMP			/ PERFORM "=" COMMAND
	OVERUL

	/ ERROR: ATTEMPT TO DELETE FIRST RULER IN DOCUMENT
RLDLER,	JMS	BEEPER		/ CHASTISE USER SEVERELY
	JMP	RLDL2		/ EXIT, LEAVING THINGS AS THEY WERE


/
/ SUBR RLCKNR -- CHECK FOR NEW RULER JUST BEFORE CURRENT LINE
/
/ CALL:
/	CLA
/	JMS	RLCKNR		/ CHECK FOR NEW RULER
/				/
/	JMP	NORULR		/ NONE THERE.
/				/ 'CURPTR' AND 'CURSOR' ARE UNCHANGED.
/				/
/	JMP	RULR		/ FOUND NEW RULER.
/				/ 'CURPTR' POINTS TO START OF RULER
/				/   (ANOTHER RULER MAY IMMEDIATELY
/				/   PRECEED 'CURPTR').
/				/ 'CURSOR' IS UNCHANGED.
/				/ 'RLCURP' = VALUE OF 'CURPTR' ON
/				/   ENTRY TO RLCKNW.
/	/ ON ALL EXITS, AC=0, DF=CDFBUF
/

RLCKNR,	XX			/ CHECK FOR NEW RULER
	TAD	CURPTR		/ SAVE 'CURPTR' (STILL SAME VALUE AS BEFORE
	DCA	RLCURP		/   USER HIT GOLD:RULER).
				/   THIS IS NEEDED SO THAT IF RULER IS NOT
				/   MODIFIED, CURSOR CAN BE RESTORED TO
				/   WHERE IT WAS BEFORE GOLD:RULER CMD.
	TAD	LINE23		/ MOVE TO START OF LINE
	DCA	CURPTR
	BKPPTR			/ MOVE TO END OF RULER, IF ANY
	JMP	RLCKNB		/   (HIT TOP, NO RULER)
	TAD	(-ECNDRL)	/ IS A RULER THERE?
	SNA CLA
	JMP	RLCKNA		/ YES
RLCKNB,	TAD	RLCURP		/ NO: RESTORE CURPTR
	DCA	CURPTR
	JMP I	RLCKNR		/ TAKE "NO NEW RULER" RETURN

	/ THERE IS A NEW RULER.
	/ BACKUP TO START OF NEW RULER.

RLCKNA,	BKPPTR
	HLT			/ BUG (BROKEN RULER--MISSING ECSTRL)
	TAD	(-ECSTRL)	/ AT START OF RULER?
	SZA CLA
	JMP	RLCKNA		/ NO: BACKUP UNTIL WE ARE

/ CURPTR IS AT START OF NEW RULER.  (IGNORE POSSIBILITY
/ THAT ANOTHER NEW RULER MAY IMMEDIATELY PRECEED CURRENT
/ NEW RULER.)

	ISZ	RLCKNR		/ TAKE "FOUND NEW RULER" RETURN
	JMP I	RLCKNR

RLCURP,	0			/ VARIABLE: SAVE CURPTR


/									/M155
/ CONTINUATION OF CODE TO GET TO ---TOP---				/M155
/									/M155
	OVRPTP=	.-OVLAY1+OVRNUM						/M155
	JMS	CLSSET		/ INITIALIZE SCROLL VALUES FOR STATUS	/M155
									/M155
	AC0001								/M155
	MQL			/ MAIN HEADER BLOCK			/M155
	TAD	(53)							/M155
	JMS	DSKCAL		/ INITIALIZE SCTOP & SCBOT TO		/M155
	XRPRD			/ BE 52 & 53 RESPECTIVELY		/M155
									/M155
/	INITIALIZE BUFFER AND SCREEN					/M155
									/M155
/D155 	JMS	RPOVIN		/ CLEAR EDIT BUFFER AND PTRBLK		/M155
	JMS	SWTHMA		/ TAKE CARE OF MATH-FLAG SETTINGS	/M155
									/M155
	CDFSYS			/ GET TO FIELD 0 TO			/M155
	DCA I	HLTFLG		/ CLEAR A POSSIBLE GOLD-HALT FLAG	/M155
	CDFLP			/ NOW TO FIELD 5 TO			/M155
	DCA	RPACTIVE 	/ CLEAR GTP 'ACTIVE' FLAG		/M155
	CDFMYF			/ BACK TO THIS FIELD			/M155
									/M155
	JMS	LODCHR		/ GET FIRST CHAR (RULER)		/M155
	NOP								/M155
									/M155
	AC0001			/ SET UP FOR PAGE NUMBER ONE		/M155
	JMS	MNUPUT		/ STORE LOW ORDER PAGE NUMBER		/M155
	LINPGL-MUBUF		/ STATUS LINE LOW ORDER PAGE NUMBER	/M155
									/M155
	JMS	MNUPUT		/ CLEAR HIGH ORDER PAGE NUMBER		/M155
	LINPGH-MUBUF		/ STATUS LINE HIGH ORDER PAGE NUMBER	/M155
									/M155
	AC0001			/ SET UP TO INDICATE FIRST LINE OF FILE	/M155
	JMS	MNUPUT		/ STORE NEW LINE NUMBER			/M155
	LINNUM-MUBUF		/ LOCATION OF LINE NUMBER IN MENU FIELD	/M155
									/M155
	AC0001			/ SET UP TO INDICATE STATUS HAS CHANGED	/M155
	JMS	MNUPUT		/ STORE VALUE IN STATUS CHANGE FLAG	/M155
	LINDIF-MUBUF		/ STATUS CHANGE FLAG IN MENU FIELD	/M155
	JMP	EIFIX		/ FIX UP SCREEN AND GET NEXT CHARACTER	/M155


	X=.			/ INDICATE FIRST FREE LOCATION ON PAGE
/---------------------
	PAGE

/ =========================================================================
/ +++	MOVED HERE PER EDIT #176					+++
/ =========================================================================
/
/ PREPARE TO EDIT RULER.

RLCONA,	CDFMYF
	TAD	SPLTFL		/ KEEP A COPY OF SPLTFL
	DCA	WIDPRV
	JMS	RLEQTE		/ EQUATE THIS RULER TO OLD ONE
	JMS	FXSCRL 		/ GET SCREEN UP TO DATE
	TAD	CURSOR		/ GET CURRENT CURSOR POSN.
	DCA	CURSAV		/ SAVE.
/
	TAD	VECFLG		/ SAVE VECFLG FOR OTHER ROUTINES	/a176
	JMS	MNUPUT		/ (PUT IT IN THE MENU FIELD)		/a176
	 MNTMP1								/a176

	TAD	VECFLG		/ HOW DID WE GET HERE			/a176
	SZA	CLA							/a176
	 JMP	RLCOND		/ GOLD:TAB				/a176
/
	OVLJMP			/ GOLD:RULER
	 OVXRL1
/
RLCOND,	OVLJMP								/a176
	 OVINTB								/a176




MER7,	(0)		/ GIVES PE ERROR IF XLATIONS O/F		/A236
	IFDEF ENGLSH <
	TEXT '^P-- !&GO-!&TO-!&PAGE !&ERROR --   '			/ 0031
    *.-1
	TEXT '^P&YOUR PAGE WAS NOT FOUND.   '				/ 0431
    *.-1
	TEXT '^P&YOU MAY USE A !&GO-!&TO-!&PAGE REQUEST, BUT ONLY   '	/ 1317
    *.-1
	TEXT '^PENTER A PAGE NUMBER WITHIN THE RANGE OF PAGES   '	/ 1417
	>

	IFDEF V30NOR <
	TEXT '^P-- &FEIL I !&G\E-!&TIL-!&SIDE --   '			/ 0031
    *.-1
	TEXT '^P&FANT IKKE ANGITT SIDE.   '				/ 0431
    *.-1
	TEXT '^P&N\ER DU BRUKER FUNKSJONEN !&G\E-!&TIL-!&SIDE, M\E DU   '	/ 1317
    *.-1
	TEXT '^PANGI ET SIDETALL SOM FINNES I DETTE   '	/ 1417
	>

	IFDEF V30SWE <
	TEXT '^P-- "!&G\E-!&TILL-!&SIDA"-FEL -- '			/ 0031
    *.-1
	TEXT '^P&DEN SIDAN KUNDE INTE HITTAS   '				/ 0431
    *.-1
TEXT '^P&DU KAN S\VKA EN SIDA MED HJ\DLP AV "!&G\E-!&TILL-!&SIDA", MEN ENDAST '
    *.-1
TEXT '^POM DU SKRIVER ETT SIDNUMMER SOM INTE \VVERSKRIDER DET ANTAL SIDOR '
	/ 1417
	>

	IFDEF SPANISH <							/A236
	TEXT '^P-- !&IR-!&A-!&ERROR !&PAGINA --   '			/ 0031
    *.-1
	TEXT '^P&IMPOSIBLE ENCONTRAR SU P\AGINA.   '			/ 0431
    *.-1
	TEXT '^P&PUEDE USAR EL PEDIDO DE !&IR-&A-!&PAGINA, PERO S\SLO   '/ 1317
    *.-1
	TEXT '^PTECLEE UN N\ZMERO DE P\AGINA DENTRO DEL MARGEN DE P\AGINAS   '	/ 1417
	>								/A236

	IFDEF DUTCH <							/A236
	TEXT '^P-- !&FOUT !&BIJ !&ZOEKEN !&PAGINA --   '			/ 0031
    *.-1
	TEXT '^P&PAGINA NIET GEVONDEN   '			/ 0431
    *.-1
	TEXT '^P&GEBRUIK ALLEEN PAGINA-NUMMERS BINNEN DE GRENZEN   '/ 1317
    *.-1
	TEXT '^PVAN HET DOCUMENT.   '	/ 1417
	>								/A236

	IFDEF ITALIAN <
	TEXT '^P-- !&ERRORE !&DI !&RICERCH !&PAGINA --  '
	*.-1
	TEXT '^P&LA PAGINA RICHIESTA NON \H STATA TROVATA.  '
	*.-1
	TEXT '^P&\H POSSIBILE EFFETTUARE UN !&CERCA !&PAGINA SOLO  '
	*.-1
	TEXT '^PINTRODUCENDO UN NUMERO DI PAGINA MINORE O UGUALE AL  '
	>

	X=.			/ INDICATE FIRST FREE LOCATION ON PAGE
/---------------------
	PAGE

/***************************************************************************
/****			   START OF OVERLAY				****
/***************************************************************************

	OVRNUM=OVRNUM+200
	OVRBLK=OVRNUM%200+DLOEDO-1 / DISK BLOCK WHERE OVERLAY IS LOADED

	RELOC
	RELOC	OVLAY1
	OVRNUM

	RPER7B=	.-OVLAY1+OVRNUM	/ --OVERLAY ENTRY POINT--
/	JMP	XPER7B

RPCHKREPLY,			/ RETURN-KEY only valid terminator FOR INPUT /M154
	CIFMNU			/ CHANGE TO MENU FIELD
	JMS I	IOACAL
	0
	MER7B
	1517			/ ^P
	1717			/ ^P
	2017			/ ^P
	2700			/ ^P

/D154	JMS	CLREOL		/ done, when needed, by BEEPER
	CIFMNU			/ menu-field (fix to automatic exit-problem)/A154
	JMS I	INACAL		/ get reply to PAGE NOT FOUND msg.
	ER7BUF			/ arg 1

	SKP			/ for normal INA return
	TAD	(EDNWLN)	/ for special INA return
	TAD	(-EDNWLN)	/ look for RETURN key
	SZA CLA			/ skip if valid-input
	JMP	CHKAGAIN	/ inform user of invalid-input

	JMS	SET132		/ SET TO 132 COL. MODE IF WIDE FLAG SET	/A192
	TAD	RPPG0		/ ---TOP-- DOC. FLAG
	SZA CLA			/ SKIP IF NOT PAGE0 PROBLEM
	JMP	RPOVRT		/ JUMP IF BEYOND --TOP--

/ INPUT PAGE # WAS TOO LARGE.  BACKUP TO DESC. CONTAINING
/ LAST AVAILABLE PAGE AND GOTO IT...
FIXPTR,	AC7777			/ BACKUP 1 DESCRIPTOR WORD
	CIFLP			/ LP FIELD
	JMS	ADJUS0		/ CHECKING RPCUOF FOR <55 OR <2

	TAD	RPCUBK		/ CURRENT HDR #
	MQL
	AC7776			/ FC TO SET SCTOP AND SCBOT
	TAD	RPCUOF		/ IDENTIFIES CURRENT BLOCK
	JMS	DSKCAL		/ SET TO DESIRED BLOCK/ HDR #
	XRPRD			/ GTP ENTRY POINT
	CDFMYF

	AC7777			/ FC TO READ A DESC.
	JMS	DSKCAL
	XRPRD

	CDFMYF			/ BACK TO THIS FIELD

	MQL			/ SAVE CONTENTS OF DESC.
	TAD	RULFLG		/ IF POSITIVE
	SPA CLA			/ LOOKING FOR PAGE
	JMP	TSTRUL		/ ELSE LOOKING FOR RULER

	ACL			/ RETRIEVE CURRENT DESC. WRD
	AND	(37)		/ SAVE # OF PAGES IN THIS BLOCK
	SNA CLA			/ SKIP IF PAGES IN THIS BLOCK
	JMP	FIXPTR		/ NO PAGES, FIND LAST ONE

	TAD	RPCUBK
	DCA	CUBKTMP		/ SAVE HDR ID # FOR LAST PG
	TAD		RPCUOF
	DCA	CUOFTMP		/ AND OFFSET FOR LAST PG

	AC7777
	DCA	RULFLG		/ INDICATE PG FOUND, LOOK FOR VALID RULER
	JMP	FIXPTR

TSTRUL,	ACL			/ RETRIEVE DESC.
	AND	(4000)		/ RULER IN THIS DESC???
	SNA CLA			/ SKIP W/ RULER
	JMP	FIXPTR		/ BACK UP ANOTHER

	TAD	RPCUOF		/ CURRENT OFFSET FOR RULER
	DCA	RPMTRL		/ LATEST RULER
	TAD	RPCUOF
	DCA	RPMTBK		/ SAME AS PREVIOUS RULER

	TAD	RPCUBK		/ HDR ID # FOR RULER
	DCA	RPRLHN		/ LATEST RULER HDR
	TAD	RPCUBK
	DCA	RPPRRL		/ PREVIOUS RULER HDR

	TAD	CUBKTMP
	DCA	RPCUBK		/ RESTORE PAGE HDR ID #
	TAD	CUOFTMP
	DCA	RPCUOF		/ AND PAGE OFFSET

	TAD	RPCUBK		/ HDR ID #
	MQL
	AC7776			/ F.C. TO SET SCTOP & SCBOT
	TAD	RPCUOF		/ BLK CONTAINING DESIRED PG
	JMS	DSKCAL
	XRPRD			/ GTP ENTRY PT
	CDFMYF

	OVLJMP; OVRPRL		/ REPAINT SCREEN--THEN EXIT BACK TO EDITOR

RULFLG,	0			/ + = LOOKING FOR LAST PAGE
				/ - = LOOKING FOR VALID RULER
CUBKTMP, 0			/ PAGE HDR ID # TMP STORAGE
CUOFTMP, 0			/ PAGE OFFSET TMP STORAGE


RPOVRT,	DCA	RPPG0		/ CLEAR ---TOP--- FLAG TO RESUME
	OVLJMP;OVRPZZ		/ RESUME EDIT AT ---TOP---		/M158


ER7BUF,	-1
	ZBLOCK	1

CHKAGAIN,			/ input wasn't RETURN key
	JMS	BEEPER		/ inform the user
	JMP	RPCHKREPLY	/ do until RETURN key

	X=.			/ INDICATE FIRST FREE LOCATION ON PAGE
/---------------------
	PAGE

MER7B,	(0)
	IFDEF ENGLSH <
	TEXT '^PCONTAINED IN THIS DOCUMENT, OR   '			/ 1517
    *.-1								/ 1717
	TEXT '^P&YOU MAY USE &GOLD !&BOT !&DOCMT OR &GOLD !&ADVANCE TO UPDATE   '
    *.-1
	TEXT '^PTHE RANGE OF PAGES FOR THIS DOCUMENT.   '		/ 2017
    *.-1
	TEXT '^P&BUT FIRST PRESS !&RETURN TO CONTINUE.  '		/ 2700
	>

	IFDEF V30NOR <
	TEXT '^PDOKUMENTET. &DU KAN OGS\E BRUKE   '			/ 1517
    *.-1								/ 1717
	TEXT '^P&GULL !&BUNN EL. &GULL !&FREM FOR \E AJOURF\XRE   '
    *.-1
	TEXT '^PANTALL SIDER I DETTE DOKUMENTET.   '		/ 2017
    *.-1
	TEXT '^P&TRYKK P\E !&RETUR FOR \E FORTSETTE.  '		/ 2700
	>

	IFDEF V30SWE <
TEXT '^PSOM FINNS I DETTA DOKUMENT. &DU KAN OCKS\E ANV\DNDA GULD SLUT DOK   '			/ 1517
    *.-1								/ 1717
TEXT '^P&ELLER GULD FRAM\ET F\VR ATT \DNDRA ANTAL SIDOR I DETTA   '
    *.-1
	TEXT '^PDOKUMENT.   '		/ 2017
    *.-1
	TEXT '^P&TRYCK F\VRST P\E RETUR F\VR ATT FORTS\DTTA  '		/ 2700
	>

	IFDEF SPANISH <							/A236
	TEXT '^PCONTIEN ESTE DOCUMENTO, O   '			/ 1517
    *.-1								/ 1717
TEXT '^P&PUEDE USAR &DORADA !&FINAL !&DOCUMENTO O &DORADA !&ADELANTE PARA   '
    *.-1
	TEXT 'PONER AL D\MA   '
    *.-1
	TEXT '^PLAS P\AGINAS PARA ESTE DOCUMENTO SON.   '		/ 2017
    *.-1
	TEXT '^P&PERO PRIMERO PULSE !&RETORNO PARA CONTINUAR.  '	/ 2700
	>								/A236

	IFDEF DUTCH <							/A236
	TEXT '^P   '			/ 1517
    *.-1								/ 1717
	TEXT '^P&DEZE FUNCTIE WERKT NIET MET DOCUMENTEN   '
    *.-1
	TEXT '^PAANGEMAAKT MET VORIGE VERSIES VAN !&WPS.   '
    *.-1
	TEXT '^P&DRUK OP !&RETURN OM VERDER TE GAAN.  '	/ 2700
	>								/A236

	IFDEF ITALIAN <
	TEXT '^PNUMERO DELLE PAGINE DI CUI \H COMPOSTO IL DOCUMENTO.  '
	*.-1
	TEXT '^P&OPPURE \H POSSIBILE USARE &ORO !&FINE !&DOCUMEN OPPURE  '
	*.-1
	TEXT '^P&ORO !&AVANTI PER AGGIORNARE LA NUMERAZIONE DELLE PAGINE.  '
	*.-1
	TEXT /^P&PRIMA PER\R PREMERE !&RITORNO PER CONTINUARE L'OPERAZIONE./
	>

	X=.			/ INDICATE FIRST FREE LOCATION ON PAGE


/---------------------
	PAGE

/***************************************************************************
/****			   START OF OVERLAY				****
/***************************************************************************

	RELOC

	RELOC	OVLAY1

	OVRNUM=	OVRNUM+200
	OVRBLK=OVRNUM%200+DLOEDO-1 / DISK BLOCK WHERE OVERLAY IS LOADED

	OVRNUM

	OVSSTP=	.-OVLAY1+OVRNUM	/SETUP COLUMN STRIP PARAMETERS

	JMP	ESSSTP

/	ESCLPS	COLUMNAR PASTE
/
/
	OVCLPS=	.-OVLAY1+OVRNUM

ESCLPS,	JMS	FNCLLM		/FIND THE LIMITS OF THE COLUMN IN WHICH
				/PASTE
	DCA	PSBFOF		/CLEAR PASTE FLAG
	JMS	SETPST
	TAD	(-PSTEBG)	/FIRST BLOCK OF PASTE BUFFER ONLY BLOCK?
	TAD	PSTBLK
	JMP	ESCP01

/	ESCLCT	COLUMNAR CUT
/
/
	OVCLCT=	.-OVLAY1+OVRNUM

ESCLCT,	JMS	SETCUT		/INITIALIZE COLUMNAR CUT VARIABLES
	CDFMYF
	TAD	(DCA I CURPTR)	/SET FOR CUT NOT COPY
	JMP	ESCLCX		/GO JOIN COMMON CODE			/A213
/D213	DCA	CLCTSW
/D213	OVLJMP			/GO DO CUT
/D213	OVDOCC

/	ESCLGC	COLUMNAR GOLD CUT
/
/
	OVCGCT=	.-OVLAY1+OVRNUM

ESCLGC,	JMS	SETCUT		/INITIALIZE COLUMNAR CUT VARIABLES
	CDFMYF
	TAD	(CLA)		/SET TO COPY NOT CUT
ESCLCX,	DCA	CLCTSW							/C213
	OVLJMP			/GO DO CUT
	OVDOCC

/	CLCTER	COLUMNAR CUT ERROR PROCESSING
/
/

CLCTER,	CLA
	JMS	BEEPER		/RING DA BELL
	JMP	UNSLCT		/AND UNSELECT THE TEXT

/	FNCLLM	FIND COLUMN LIMITS
/
/	THIS ROUTINE WILL FIND THE UPPER AND LOWER CHARACTER POSITION
/	LIMITS OF A COLUMN; RELATIVE TO THE CURRENT CURSOR POSITION.
/
/	INPUTS ARE CURPTR POINTING TO A CHARACTER OR TRAILING TAB FOR THE
/	DESIRED COLUMN.
/

FNCLLM,	XX			/ENTRY POINT

FCLM01,	BKPSPC			/SEARCH BACKWARDS FOR THE BEGINNING OF THE
				/BEGINNING OF THE COLUMN OR FOR AN INVALID
				/CONDITION
	JMP	FCLM03		/START OF FILE IS LEGAL COLUMN BOUNDARY BUT
				/SHOULD NEVER HAPPEN DUE TO INITIAL RULER
	AND	P177		/STRIP THE MODE BITS FOR COMPARISONS

	ZZCASE			/MATCH AGAINST SPECIAL CHARACTERS
	FCLTB1-1

/	ECNWLN;	FCLM04		/NEW LINE COULD BE COLUMN DELIMITER
/	ECNWPG;	FCLM07		/NEW PAGE IS COLUMN DELIMITER
/	ECNDRL;	FCLM06		/END RULER IS COLUMN DELIMITER
/	ECTAB;	FCLM05		/TAB IS COLUMN DELIMITER
/	ECMDFL;	FCLM01		/MODIFIED FLAG IS BOGUS CHAR SO SKIP
/	0

	AC7777			/NO MATCH SO DECREMENT CURSOR POSITION
	TAD	CURSOR
	SPA			/SHOULD NEVER GET BELOW POSITION ZERO
	JMP	CLCTER		/DID GO TO NEGATIVE POSITION SO ERROR
	DCA	CURSOR		/SAVE UPDATED CURSOR
	JMP	FCLM01		/AND TRY AGAIN

FCLM06,	ADVSPC			/POSITION BAK AT FIRST CHAR AFTER END RULER/C213
	NOP
	CLA			/ELIMINATE UNWANTED CHARACTER VALUE	/A213
	JMP	FCLM08							/C213

FCLM04,	TAD I	CURPTR		/CHECK THAT THE NEW LINE IS A HARD RETURN
	TAD	(-ECNWLN)
	SZA CLA
	JMP	CLCTER		/NOT A CARRIAGE RETURN SO ERROR
FCLM07,	ADVSPC			/ADVANCE OVER THE CHARACTER
	NOP			/SHOULD NEVER HAPPEN BUT REALLY DON'T CARE
	AC7777			/BACKUP KEEPING PTRBLK HAPPY
	CURMOV
	HLT			/HAVE ALREADY BEEN AT THIS CHAR SO NO END OF
				/FILE IS POSSIBLE.
	JMP	FCLM02

FCLM05,	AC7777			/dec cursor pos
	TAD	CURSOR
	DCA	CURSOR
FCLM02,	AC0001			/POSITION AT FIRST CHAR IN COLUMN
FCLM08,	CURMOV			/SET CURSOR POSITION			/C213
	NOP	

FCLM03,	CLA			/MAKE SURE EVERYTHING OK
	TAD	CURSOR		/AND SEE IF THERE IS A TAB STOP HERE
	JMS	GTRLCD
	DCA	T2		/SAVE RULER CODE
	TAD	T2
	TAD	(FCLJTB-1)	/BUILD JUMP ADDRESS
	DCA	T1
	TAD I	T1
	DCA 	T1
	JMP I	T1		/GO DO APPROPRIATE

/	FCLMRJ			/"-" DO RIGHT JUSTIFIED
/	FCLMRJ			/"." DO RIGHT JUSTIFIED
/	FCLMRJ			/">" DO RIGHT JUSTIFIED
/	FCLMLJ			/"T" DO LEFT JUSTIFIED
/	FCLMLJ			/"L" DO LEFT JUSTIFIED
/	FCLMRJ			/"R" DO RIGHT JUSTIFIED
/	FCLMLJ			/"D" DO LEFT JUSTIFIED
/	FCLMRJ			/"J" DO RIGHT JUSTIFIED
/	FCLMLJ			/"W" DO LEFT JUSTIFIED
/	FCLMLJ			/"P" DO LEFT JUSTIFIED
/	FCLMRJ			/"C" DO RIGHT JUSTIFIED
/	FCLMLJ			/"N" DO LEFT JUSTIFIED
/	FCLMRJ			/"H" DO RIGHT JUSTIFIED
/	FCLMLJ			/"F" DO LEFT JUSTIFIED


/	FCLMLJ	FIND COLUMN LIMITS FOR LEFT JUSTIFIED TAB
/
/	BEGIN;
/	TEMP:=CLMPLL:=CURSOR;
/	WHILE(	CURUL[TEMP+1] <> NOSTOP OR
/		CURUL[TEMP+1] <> HSTOP OR
/		CURUL[TEMP+1] <> CSTOP) TEMP:=TEMP+1;
/	CLMPUL:=TEMP;
/	END;
/

FCLMLJ,	TAD	CURSOR		/GET CURRENT POSITION
	DCA	CLMPLL		/SAVE AS COLUMN LOWER LIMIT
	TAD	CLMPLL		/SET UP COUNTER TO FIND UPPER LIMIT
	DCA	T1

FCLLJ1,	AC0001			/EXAMINE FOLLOWING TAB STOP
	TAD	T1
	JMS	GTRLCD

	ZZCASE			/MATCH AGAINST NON-TABS
	FCLTB2-1

/	1;	FCLLJ2		/"-"
/	12;	FCLLJ2		/"C"
/	14;	FCLLJ2		/"H"
/	0

	TAD	T1		/SAVE UPPER LIMIT
	DCA	CLMPUL
	JMP I	FNCLLM		/DONE!

/
/

FCLLJ2,	ISZ	T1		/BUMP TO NEXT POSITION
	JMP	FCLLJ1		/AND TRY NEXT


/	FCLMRJ	FIND COLUMN LIMITS FOR RIGHT JUSTIFIED TAB STOP
/
/
/	BEGIN;
/	TEMP:=CURSOR;
/	WHILE( CURUL[TEMP-1] = NOSTOP OR
/		CURUL[TEMP-1] = CSTOP OR
/		CURUL[TEMP-1] = HSTOP) TEMP:=TEMP-1;
/	IF CURUL[TEMP-1] = RIGHT.MARGIN OR
/		CURUL[TEMP-1] = RIGHT.JUST.STOP THEN TEMP:=TEMP+1;
/	CLMPLL:=TEMP;
/	TEMP:=CURSOR-1;
/	SEEN.DECIMAL.FLAG=FALSE;
/	WHILE( CURUL[TEMP+1] = NOSTOP OR
/		CURUL[TEMP+1] = CSTOP OR
/		CURUL[TEMP+1] = HSTOP OR
/		( CURUL[TEMP+1 = DECIMAL.STOP AND
/			SEEN.DECIMAL.FLAG = FALSE))
/		BEGIN;
/			TEMP:=TEMP+1;
/			IF CURUL[TEMP] = DECIMAL.STOP THEN
/				SEEN.DECIMAL.FLAG = TRUE;
/		END;
/	CLMPUL:=TEMP;
/	END;
/

FCLMRJ,	DCA	FTHRU		/FIRST TIME THRU FLAG
	TAD	CURSOR		/SETUP FOR BACK COUNT
	DCA	T1
FCLRJ1,	AC7777			/DECREMENT COUNT
	TAD	T1		/AND CHECK PREVIOUS POSITION
	SPA			/IF IT GOES BELOW ZERO THEN DEEP SHIT
	JMP	CLCTER		/ERROR, ERROR, DIVE! DIVE! DIVE!
	JMS	GTRLCD
	TAD	(FCLJT3-1)	/BUILD PTR TO PROCESSING LOCATION
	DCA	T2
	TAD I	T2
	DCA	T2
	JMP I	T2		/AND EXECUTE

/	FCLRJ2			/"-"
/	FCLRJ3			/"."
/	FCLRJ4			/">"
/	FCLRJ3			/"T"
/	FCLRJ3			/"L"

/	FCLRJ2			/"R"
/	FCLRJ3			/"D"
/	FCLRJ2			/"J"
/	FCLRJ3			/"W"

/	FCLRJ3			/"P"
/	FCLRJ2			/"C"
/	FCLRJ3			/"N"
/	FCLRJ2			/"H"
/	FCLRJ3			/"F"



FCLRJ4,	ISZ	FTHRU
	JMP	FCLRJ2
	AC0001			/INCREMENT POSITION

FCLRJ3,	TAD	T1		/SAVE POSITION AS LOWER LIMIT
	DCA	CLMPLL
	AC7777			/STARTING FROM CURSOR POS -1
	TAD	CURSOR		/EXAMINE FOR UPPER LIMIT
	DCA	T1	
	DCA	T3		/CLEAR DECIMAL POINT TAB SEEN FLAG
FCLRJ5,	AC0001			/EXAMINE FOLLOWING TAB STOP
	TAD	T1
	JMS	GTRLCD

	ZZCASE			/MATCH AGAINST NON-TABS
	FCLTB3-1

/	1;	FCLRJ6		/"-"
/	2;	FCLRJ7		/"."
/	12;	FCLRJ6		/"C"
/	14;	FCLRJ6		/"H"
/	0

FCLRJ8,	AC0002
	TAD	T1		/SAVE UPPER LIMIT
	DCA	CLMPUL
	JMP I	FNCLLM		/DONE!

FTHRU,	ZBLOCK	1
	X=.
/---------------------
	PAGE

/
/
FCLRJ2,	AC7777			/DECREMENT POSITION AND TRY AGAIN
	TAD	T1
	DCA	T1
	AC7777
	DCA	FTHRU
	JMP	FCLRJ1

FCLRJ7,	TAD	T3		/FIRST TIME THROUGH?
	SZA
	JMP	FCLRJ8		/NO, FINISH UP
	ISZ	T3		/SET FLAG

FCLRJ6,	ISZ	T1		/BUMP TO NEXT POSITION
	JMP	FCLRJ5		/AND TRY NEXT



/	GTRLCD	GET RULER CODE
/
/	THIS ROUTINE IS PASSED A VALUE CORRESPONDING TO A POSITION IN THE
/	CURRENTLY ACTIVE RULER.  IT RETURNS THE TAB STOP TYPE CODE FOR THE
/	DESIGNATED POSITION.
/
/	CALL:
/
/	(AC := POSITION IN RULER)
/	JMS	GTRLCD
/	<RETURN AC := RULER TAB STOP TYPE CODE>
/

GTRLCD,	XX			/ENTRY POINT
	CLL RAR			/DIVIDE BY TWO SAVE ODD FLAG
	TAD	(CURUL)		/BUILD PTR TO RULER CODE
	CDFMYF
	DCA	GRCTMP		/SAVE PTR FOR ACCESS
	TAD I	GRCTMP		/AND ACCESS RULER
	SNL			/HIGH BYTE OR LOW?
	BSW			/HIGH BYTE SO SWAP
	AND	P77		/MASK CODE
	JMP I	GTRLCD		/RETURN

GRCTMP,	ZBLOCK	1

/	SETCUT	SETUP COLUMNAR CUT VARIABLES
/
/

SETCUT,	XX			/ENTRY POINT
	TSTSLT			/IN SELECT MODE?
	JMP	EIBAD		/NO, ERROR! ERROR! THAT DOES NOT COMPUTE!
	JMS	FNCLLM		/GO FIND COLUMN LIMITS
	TAD	CLMPLL		/SELECT >= LOWER LIMIT?
	CIA
	TAD	SLCRPT
	SPA CLA
	JMP	CLCTER		/NEGATIVE NEGATIVE DIE!
	TAD	SLCRPT		/SELECT <=UPPER LIMIT?
	CIA
	TAD	CLMPUL
	SPA CLA
	JMP	CLCTER		/NFW BADASS
	TAD	(PSTEBG)	/SET BEGINNING BLOCK NUMBER
	DCA	PSTBLK
	DCA	PSBFOF		/CLEAR BUFFER OVERFLOW FLAG
	JMS	SETPST		/SETUP PASTE BUFFER I/O
	JMP I	SETCUT		/RETURN

/	ESCP01	SETUP PASTE BUFFER FOR PASTE
/
/

ESCP01,	SNA CLA
	JMP	ESCP02		/YES
	TAD	(PSTEBG)	/SETUP PASTE BUFFER AND READ IN FIRST BLOCK
	DCA	PSTBLK
	TAD	(RXERD)
	JMS	PSTIO
ESCP02,	JMS	OV2JMP		/DO THE PASTE
	OVDOPS

/	SETUP COLUMN STRIP PARAMETERS
/
/

ESSSTP,	JMS	SETCUT
	JMP	OVJRTN


/	COLUMNAR CUT SETUP CASE TABLES
/
/

FCLTB1,	ECNWLN;	FCLM04		/NEW LINE COULD BE COLUMN DELIMITER
	ECNWPG;	FCLM07		/NEW PAGE IS COLUMN DELIMITER
	ECNDRL;	FCLM06		/END RULER IS COLUMN DELIMITER
	ECTAB;	FCLM05		/TAB IS COLUMN DELIMITER
	ECMDFL;	FCLM01		/MODIFIED FLAG IS BOGUS CHAR SO SKIP
	0

FCLTB2,	1;	FCLLJ2		/"-"
	12;	FCLLJ2		/"C"
	14;	FCLLJ2		/"H"
	0

FCLTB3,	1;	FCLRJ6		/"-"
	2;	FCLRJ7		/"."
	12;	FCLRJ6		/"C"
	14;	FCLRJ6		/"H"
	0

/	COLUMNAR CUT SETUP JUMP TABLES
/
/

FCLJTB,	FCLMRJ			/"-" DO RIGHT JUSTIFIED
	FCLMRJ			/"." DO RIGHT JUSTIFIED
	FCLMRJ			/">" DO RIGHT JUSTIFIED
	FCLMLJ			/"T" DO LEFT JUSTIFIED
	FCLMLJ			/"L" DO LEFT JUSTIFIED
	FCLMRJ			/"R" DO RIGHT JUSTIFIED
	FCLMLJ			/"D" DO LEFT JUSTIFIED
	FCLMRJ			/"J" DO RIGHT JUSTIFIED
	FCLMLJ			/"W" DO LEFT JUSTIFIED
	FCLMLJ			/"P" DO LEFT JUSTIFIED
	FCLMRJ			/"C" DO RIGHT JUSTIFIED
	FCLMLJ			/"N" DO LEFT JUSTIFIED
	FCLMRJ			/"H" DO RIGHT JUSTIFIED
	FCLMLJ			/"F" DO LEFT JUSTIFIED

FCLJT3,	FCLRJ2			/"-"
	FCLRJ3			/"."
	FCLRJ4			/">"
	FCLRJ3			/"T"
	FCLRJ3			/"L"

	FCLRJ2			/"R"
	FCLRJ3			/"D"
	FCLRJ2			/"J"
	FCLRJ3			/"W"

	FCLRJ3			/"P"
	FCLRJ2			/"C"
	FCLRJ3			/"N"
	FCLRJ2			/"H"
	FCLRJ3			/"F"

	PAGE
	RELOC

/***************************************************************************
/****			   START OF OVERLAY				****
/***************************************************************************

	RELOC

	RELOC	OVLAY1

	OVRNUM=	OVRNUM+200
	OVRBLK=OVRNUM%200+DLOEDO-1 / DISK BLOCK WHERE OVERLAY IS LOADED

	OVRNUM

	CLCTDN=	X5
	TBCTFL=	X4

/	OVDOER	DO COLUMN ERROR HANDLING
/
/
	OVDOER=	.-OVLAY1+OVRNUM

CCDOER,	JMP	DOCCER


/	ESDOCC	DO COLUMN CUT/COPY
/
/
	OVDOCC=	.-OVLAY1+OVRNUM

ESDOCC,	TAD	CLCTSW		/SET FOR CUT OR COPY
	DCA	CONCTC		/CUTTING CHARACTERS

/
/	THE LOCATION CONCTC IS LOADED WITH A DCA I CURPTR OR
/	A CLA DEPENDING ON WHETHER THE TEXT IS TO BE CUT TO
/	THE PASTE BUFFER OR COPIED.
/
	DCA	CLCTDN		/CLEAR DONE FLAG

	OVDCC5=	.-OVLAY1+OVRNUM

DOCC05,	TAD	(ECTMRK)	/MARK THE BEGINNING OF THE COLUMN
	JMS	INSERT
	DCA	TBCTFL		/CLEAR TAB CUT FLAG
	ADVPTR			/SKIP OVER THE MARK
	JMP	DOC1ER		/ERROR PREMATURE EOF
	TAD	(-ECSLPT)	/IS IT A SELECT POINT AT BEGINNING OF COLUMN
	SZA CLA
	JMP	DOCC24		/NO GO PROCESS
	ISZ	CLCTDN		/YES, SO MARK LAST COLUMN
	DCA I	CURPTR		/CLEAR IT OUT OF THE TEXT BUFFER
	BKPPTR			/KILL THE MARKER
	HLT
	CLA
	DCA I CURPTR
	SLNMOD			/REJUSTIFY THE LINE
	JMS	REJUST
	JMP	DOCC05		/AND START PROCESSING AT THE BEGINNING OF
				/THE COLUMN
DOCC24,	TAD I	CURPTR
	JMP	DOCC23

DOCC01,	ADVSPC			/FORWARD SPACE UNTIL AN END OF COLUMN
				/DELIMITER IS FOUND
	JMP	DOCC06		/END OF FILE - TREAT AS END OF LINE	/C218
DOCC23,	AND	P177		/STRIP MODE BITS

	ZZCASE			/MATCH AGAINST DELIMITERS
	DCCTB1-1

/	ECNWLN;	DOCC03		/NEW LINE COULD BE
/	ECNWPG;	DOC1ER		/NEW PAGE HERE IS ERROR
/	ECSTRL;	DOC1ER		/START RULER ALWAYS ERROR
/	ECTAB;	DOCC02		/TAB IS GOOD BOY
/	ECMDFL;	DOCC01		/SKIP MODIFIED FLAG
/	0

	ISZ	CURSOR		/BUMP CURSOR COUNT
	JMP	DOCC01		/AND TRY NEXT CHAR

DOCC03,	TAD I	CURPTR		/CHECK EOL CHAR
	TAD	(-ECNWLN)	/HARD RETURN BONAFIDE
	SNA
	JMP	DOCC02		/GOOD BOY GO CUT
	TAD	(ECNWLN-ECSLPT)	/SELECT POINT?
	SZA CLA
	JMP	DOC1ER		/NOPE ERROR ERROR
	DCA I	CURPTR		/DELETE SELECT POINT
	DCA	CURSOR		/RESET POINTER		/A201
	ISZ	CLCTDN		/SET DONE FLAG
	JMP	DOCC01		/AND FETCH NEXT CHAR

DOCC02,	CDFMYF
	TAD	CURSOR		/CHECK POSITION AGAINST UPPER LIMIT
	CIA
	TAD	CLMPUL
	SPA CLA			/IF CLMPUL >= CURSOR THEN OK
	JMP	DOC1ER		/ERROR YOU GRAVY SUCKING PIG
	JMS	LODCHR		/GET EOC CHAR
	HLT			/EOF CAN'T BE HERE
	TAD	(-ECTAB)	/IF TAB DO CUT OPERATION	
	SZA CLA
	JMP	DOCC06		/DON'T CUT HARD RETURN
	JMS	CUTNOT		/CUT OR COPY
	ISZ	TBCTFL		/SET EOC TAB CUT FLAG

DOCC06,	TAD	(ECTMRK)	/MARK END OF COLUMN
	JMS	INSERT

DOCC09,	BKPPTR			/FIND BEGINNING OF COLUMN MARK
	HLT			/CAN'T HAPPEN UNLESS TOTALLY CORRUPTED
	TAD	(-ECTMRK)	/FOUND MARKER?
	SZA CLA
	JMP	DOCC09		/NO, PERSEVERE THEN

	TAD	TBCTFL		/CHECK FOR A TAB CUT?
	SZA CLA
	JMP	DOCC07		/YES EVERYTHING IS HUNKY DORY

DOCC19,	BKPPTR			/SEE IF PREVIOUS TAB TO CUT
	JMP	DOCC08		/NO, NEVER GETS HERE ANYWAY
	ZZCASE
	DCCTB2-1

/	ECTAB;	DOCC20		/YES GO DO IT
/	ECNWLN;	DOCC08
/	ECNWPG;	DOCC08
/	ECNDRL;	DOCC08
/	0
	JMP	DOCC19

DOCC20,	JMS	CUTNOT		/CUT OR COPY

DOCC08,	ADVPTR			/FIND THE MARK AGAIN
	HLT
	TAD	(-ECTMRK)
	SZA CLA
	JMP	DOCC08

DOCC07,	DCA I	CURPTR		/KILL THE MARKER

DOCC10,	ADVPTR			/GET CHARACTER
	HLT			/NO WAY
	TAD	(-ECTMRK)	/END OF COLUMN?
	SNA CLA
	JMP	DOCC11		/YES, GO FINISH UP THE COLUMN
	TAD I	CURPTR		/REFETCH CHAR
	DCA	T1		/SAVE CHAR
	JMS	CUTNOT		/CUT OR COPY
	TAD	T1		/GET CHAR
	JMS	PUTPST		/PUT IT TO PASTE BUFFER
	JMP	DOCC10		/DO NEXT CHARACTER
	JMP	DNCCOV		/BUFFER OVERFLOW GO CLEAN UP


/D203	OVDC11=	.-OVLAY1+OVRNUM

DOCC11,	DCA I	CURPTR		/KILL END MARKER

	OVDC12=	.-OVLAY1+OVRNUM						/A203

DOCC12,	TAD	(ECNWLN)	/PUT COLUMN MARKER IN PASTE BUFFER	/C203
	JMS	PUTPST
	SKP CLA			/PUT AWAY OK SKIP ERROR RETURN
	JMP	DNCCOV		/BUFFER OVERFLOW GO CLEAN UP
	TAD	LINE23		/SETUP AND REJUSTIFY THE LINE
	DCA	CURPTR
	DCA	CURSOR
	SLNMOD
	JMS	REJUST
	CLA			/SEE IF THAT WAS LAST COLUMN
	TAD	CLCTDN
	SZA CLA
	JMP	DONCCT		/YES, HURRAY!!!!!
	JMS	OV2JMP
	OVDCEL

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

	PAGE


/	DOC1ER	ERROR HANDLING AFTER COLUMN FOUND
/
/

DOC1ER,	TAD	LINE23		/SEARCH FOR THE MARKER TO DELETE
	DCA	CURPTR		/FROM THE BEGINNING OF THE LINE
	DCA	CURSOR
	SKP			/DON'T FORWARD SPACE THE FIRST TIME

DOC1E1,	AC0001			/SEARCH FOR MARKER
	CURMOV
	HLT			/EOF BEFORE MARKER FOUND MEANS
				/CATASTROPHIC DOCUMENT FAILURE
	TAD I	CURPTR
	TAD	(-ECTMRK)	/FOUND?
	SZA CLA
	JMP	DOC1E1		/NO, TRY NEXT

	DCA I	CURPTR		/DELETE MARK
	SLNMOD			/REJUSTIFY THE LINE
	JMS	REJUST


/	DOCERR	ERROR FINISH UP HANDLING
/
/

DOCCER,	JMS	BEEPER		/RIND DA BELL
	JMS	PUTPST		/CLOSE PASTE BUFFER
	NOP
	TAD	(RXEWT+2000)
	JMS	PSTIO
	SLNMOD
	TAD	CLCTDN		/CHECK IF SELECT FOUND
	SNA CLA
	JMP	UNSLCT		/NO SO GO FIND IT
	DCA	EDMODE		/CLEAR MODES
	JMP	EIBAD		/AND LEAVE


/	DNCCOV	COLUMN CUT ABORTED DUT TO OVERFLOW HANDLING
/
/

DNCCOV,	AC0001			/SEARCH FOR SELECT POINT AND MARKER
	CURMOV
	HLT			/BETTER NOT FIND EOF
	TAD I	CURPTR
	TAD	(-ECTMRK)	/MARKER?
	SNA
	JMP	DNCOV1		/YES DELETE IT
	TAD	(ECTMRK-ECSLPT)	/SELECT POINT?
	SZA
	JMP	DNCCOV		/NO, TRY NEXT CHAR

	DCA I	CURPTR		/DELETE SELECT MARK
	JMS	BEEPER		/SIGNAL ERROR
	JMP	DNCCT1		/GO TERMINATE CUT

DNCOV1,	DCA I	CURPTR		/DELETE MARKER
	SLNMOD			/REJUSTIFY LINE
	JMS	REJUST
	JMP	DNCCOV		/SEARCH FOR SELECT POINT

/	DONCCT	DONE COLUMN CUT HANDLING
/
/
DONCCT,	JMS	PUTPST		/PUT TERMINATOR BYTE INTO BUFFER
	NOP			/IGNORE OVERFLOW
	TAD	(RXEWT+2000)	/WRITE OUT FINAL BLOCK
	JMS	PSTIO

DNCCT1,	TAD	LINE23		/RESET POINTERS
	DCA	CURPTR
	DCA	CURSOR
	DCA	EDMODE		/RESET MODE
	SLNMOD			/REJUSTIFY LINE
	JMS	REJUST
	JMP	EIFIX		/CONTINUE PROCESSING

/	PUTPST	WRITE TO PASTE BUFFER
/
/	THIS ROUTINE TAKES CHARACTERS PASSED IN THE AC AND PUTS THEM IN
/	THE PASTE DISK BUFFER.  WHEN THE BUFFER IS FULL IT WRITES THE
/	BUFFER TO DISK.  WHEN THE LAST ALLOCATED DISK BLOCK IS WRITTEN
/	IT SETS THE CUT OVERFLOW FLAG AND TAKES A SKIP RETURN.
/
/	CALL:
/
/	JMS	PUTPST	(AC := CHARACTER TO WRITEOUT)
/	<RETURNS HERE IF OK>
/	<RETURNS HERE ON END OF PASTE BUFFER>
/	
/	RETURNS WITH AC:=0 IN ALL CASES
/
PUTPST,	XX			/ENTRY POINT
	CDFBUF			/SET TO BUFFER FIELD
	DCA I	PSTPTR		/PUT CHARACTER IN BUFFER
	ISZ	PSTPTR		/BUMP PTR AND CHECK FOR BLOCK FULL
	JMP I	PUTPST		/BLOCK NOT FULL SO RETURN DIRECTLY
	TAD	(RXEWT+2000)	/BLOCK I/O WRITE CODE
	JMS	PSTIO		/PERFORM WRITE TO DISK
	ISZ	PSTBLK		/INCREMENT BLOCK NO
	TAD	PSTBLK		/CHECK FOR END OF ALLOCATED BLOCKS
	TAD	(-PSTEND)	/FOR PASTE BUFFER
	SZA CLA			/END OF ALLOCATION?
	JMP I	PUTPST		/NO, SO STRAIGHT RETURN
	AC7777			/EOA FOR PASTE BUFFER
	DCA	PSBFOF		/SET PASTE BUFFER OVERFLOW FLAG
	ISZ	PUTPST		/AND TAKE A SKIP RETURN
	JMP I	PUTPST		/B-B

/	CUTNOT	CUT OR COPY A CHARACTER
/
/

CUTNOT,	XX
CONCTC,	HLT			/THIS LOCATION HAS EITHER A DCA I CURPTR
				/OR A CLA WRITTEN IN UPON ENTRY.  THE
				/DCA I CURPTR WILL CUT THE TAB.  THE CLA
				/DOES NOTHING.
	JMP I	CUTNOT


/	CASE TABLES FOR COLUMNAR CUT
/
/

DCCTB1,	ECNWLN;	DOCC03		/NEW LINE COULD BE
	ECNWPG;	DOC1ER		/NEW PAGE HERE IS ERROR
	ECSTRL;	DOC1ER		/START RULER ALWAYS ERROR
	ECTAB;	DOCC02		/TAB IS GOOD BOY
	ECMDFL;	DOCC01		/SKIP MODIFIED FLAG
	0

DCCTB2,	ECTAB;	DOCC20		/YES GO DO IT
	ECNWLN;	DOCC08
	ECNWPG;	DOCC08
	ECNDRL;	DOCC08
	0

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

	PAGE


/***************************************************************************
/****			   START OF OVERLAY				****
/***************************************************************************

	OVRNUM=OVRNUM+200
	OVRBLK=OVRNUM%200+DLOEDO-1 / DISK BLOCK WHERE OVERLAY IS LOADED

	RELOC
	RELOC	OVLAY1
	OVRNUM

/	BEGIN HELP OVERLAY........
	OVHELP=	.-OVLAY1+OVRNUM
	JMP	OVHLP1		/ CALL CLEAR SCREEN AND SAVE MENU DATA	/A185

/
/	Moved here on edit 225 for space reasons
/
	OVSWAP= .-OVLAY1+OVRNUM
	JMP	XVSWAP		/ Call Gold swap routine		

	OVTIME= .-OVLAY1+OVRNUM
	JMP	XVTIME


/D185	OVHLP1=	.-OVLAY1+OVRNUM	/ --OVERLAY ENTRY POINT--

/ OVERLAY HELP EDIT

OVHLP0,	CIFMNU
	JMS I	MNUCAL		/ PRINT HELP MENU
	DLHLP0			/ BLOCK NUM ARG..
	JMP	HLPBKC		/ SKIP INC FIRST TIME AND DISPLAY

HLPADV,	TAD	HLPSPC		/ GET SPACE CHAR
	JMS	HLPDP0		/ PRINT IT
	ISZ	NOWPTR
	JMP	HLPBKC		/ PRINT '*'

/ BACKUP POINTER

HLPBAK,	TAD	HLPSPC		/ GET SPACE CHAR
	JMS	HLPDP0		/ PRINT IT
	CLA CMA			/ -1	FOR BACKUP
HLPBKC,	TAD	NOWPTR
  	SNA			/ BEG OF SCREEN
	JMP	HLPDST		/ YES IS OK
	SPA			/ IS IT BEFORE 1ST COMMENT
	JMP	HLPSTZ		/ YES SET TO LAST
	TAD	HLPNMX		/ CHECK END (-HLPMAX)
	SPA			/ PAST LAST?
HLPSTZ,	TAD	HLPMAX		/ YES RESET
HLPDST,	DCA	NOWPTR		/ SET POINTER
  	TAD	HLPCSR		/ GET CURSOR CHAR
  	JMS	HLPDP0		/ PRINT IT

HLPNXT,	GETINP			/ GET A CHAR
	SNA			/ IS=0
	JMP	HLPNXT		/ YES MAY BE NULL FROM PRINT SCREEN
	TAD	(-EDHELP)	/ =HELP
	SNA
	JMP	HLPHLP		/ IS HELP MENU 2ND LEVEL
	TAD	(-EDADVN+EDHELP)/ ADVANCE CHAR
	SNA
	JMP	HLPADV		/ IS ADVANCE
	TAD	(-EDBKUP+EDADVN)/ CHECK BACKUP
	SNA
	JMP	HLPBAK		/ IS BACKUP PTR

	IFDEF	HELPDO 	<
	TAD	(-EDDO+EDBKUP)	/ ****UPPER IS TEMP****IS DO IT COMMAND
	SNA
	JMP	HLPDO		/ YES EXEC COMMAND
	TAD	(-EDNWLN+EDDO)	/ IS RETURN
			>	/ END IFDEF HELPDO

	IFNDEF	HELPDO	<
	TAD	(-EDNWLN+EDBKUP)
			>	/ END IFNDEF HELPDO

	SNA
	JMP	HLPRET		/ RETURN TO EDIT MODE
	TAD	(-EDMENU+EDNWLN)/ GOLD MENU?
	SNA CLA
	JMP	HLPRET		/ RETURN TO EDIT MODE
	JMS	BUZZER		/ ILLEGAL CHAR
	JMP	HLPNXT		/ GET ANOTHER CHAR

/ SET UP LINE AND COL PRINT POSITION

HLPDP0,	0
	DCA	HLPCHR		/ SAVE CHAR TO BE DISPLAYED
	TAD	NOWPTR		/ GET POSITION
	DCA	HLPTM1		/ SAVE POSITION PTR
	DCA	COLCNT		/ INIT COL PTR
	DCA	HLPRW1		/ INIT ROW PTR
	DCA	COLNUM		/ TAB COLUMN NUMBER

HLPNX1,
SETLSC,	JMS	SETLST		/ CHECK LAST COLUMN

SETCOL,	TAD	COLNUM		/ GET TAB COL NUMBER
	CLL RAL			/ *2
	TAD	COLPT1		/ POINTER TO TABLE
	DCA	COLPT2		/ TEMP POINTER
	TAD I	COLPT2		/ GET 1ST CHAR ENTRY
	DCA	HLPCL1		/ SET 2ND POS(0,2,5)
	ISZ	COLPT2		/ GET 2ND ENTRY IN TABLE
	TAD I	COLPT2		/ SET L/ O=(3,7,1)
	DCA	HLPCL2		/ SET L/ O POS. PNTR

	TAD	HLPK04		/ 4=FIRST PRINT LINE
	TAD	HLPTM1		/ LINE OFFSET
	DCA	HLPTM1
SETCLB,	TAD	HLPKM9		/ -9
	TAD	HLPTM1
	SPA			/ IS GREATER THAN 9
	JMP	HLPST1		/ NO CONT
	DCA	HLPTM1		/ SAVE LINE #
	ISZ	HLPRW1		/ INC ROW NUMBER ASSUMES L.T.20
	JMP	SETCLB		/ REPEAT (FOR G.T. 20

HLPST1,	CLA CLL CML RAR		/ 4000
	TAD	HLPRW1
	TAD	HLPK60		/ ASCII
	DCA	HLPRW1		/ ADD ROW NUM
	CLA CLL CML RAR		/ 4000
	TAD	HLPK60		/ ASCII
	TAD	HLPTM1
	DCA	HLPRW2

/	PUT COMMAND STRING

	PUTESC
	"[+4000-200
HLPRW1,	"0+4000-200		/ ROW TENS DIGIT
HLPRW2,	"1+4000-200		/ ROW L/ O DIGIT
	";+4000-200		/ SEPARATOR
	"0+4000-200		/ COL H/ O
COLCNT,
HLPCL1,	"0+4000-200		/ =0,3,6
HLPCL2,	"3+4000-200
	"H+4000-200		/ CUROR POSITION
HLPCHR,	"0-200			/ CHARACTER TO PRINT
	JMP I	HLPDP0

/	THIS ROUTINE COMPARES ARG PASSED AGAINST NOWPTR
/	LIKE RESULTS RETURN +1 ELSE+2

CHKSPL,	0
	TAD	NOWPTR		/ POINTER TO CODE
	TAD I	CHKSPL		/ GET CODE TO COMPARE AGAINST
	SZA CLA			/ IS IT SPECIAL CODE?
	ISZ	CHKSPL		/ NO SET RETURN
	ISZ	CHKSPL
	JMP I	CHKSPL

/	SET DIRECTION FOR ADV/ BACKUP LINE  OR PARA

SETDIR,	0
	MODSET			/ SET IT
	MOVMOD
	JMP I	SETDIR		/ RET

IFDEF	CONDOR	<LSTLNT=120>	/ TOTAL NUM OF LIST IN MENU		/C212

IFNDEF	CONDOR	<LSTLNT=104>						/C222
NUMLPC,	-17			/ NUMBER LINES PER COLUMN

HLPTM1,	0			/ TEMP STOREAGE
HLPMAX,	LSTLNT			/ MAX NUM COMMANDS
HLPNMX,	-LSTLNT			/ NEG HLP MAX
HLPSPC,	" -200			/ SPACE
HLPCSR,	"*-200			/ CURSOR CHAR=*
HLPK60,	60			/   "
HLPKM9,	-12			/ -9

	IFDEF	HELPDO	<
HLPPTR,	HLPTBL			/ POINTER TO COMMAND TABLE
			>	/ END IFDEF HELPDO
NOWPTR,	0			/ CURRENT POSITION POINTER
HLPK04,	4			/ FIRST LINE OF PRINT
COLNUM,	0			/ TAB POSITION
COLPT1,	COLPT3			/ POINTER TO TABLE
COLPT2,	0			/ TEMP POINTER POS.


	X=.			/ INDICATE FIRST FREE LOCATION ON PAGE
/---------------------
	PAGE

	IFDEF	HELPDO	<

/ DO COMMAND POINTED TO PY CURSOR POSITION
HLPCOD,	0			/ POINTER TO COMMAND LOC

HLPDO,	TAD	NOWPTR		/ GET POINTER TO CURRENT COMMAND
	CLL RAR			/ DIV 2  2 ENTRIES PER WD.
	TAD	HLPPTR		/ ADD START OF TABLE
	DCA	HLPCOD		/ SET POINTER TO COMMAND
	TAD I	HLPCOD		/ GET COMMAND CODE
	SNL			/ HI OR LO BYTE 0=HI
	BSW			/ =HI
	AND	(77)		/ MASK 6 BITS
	SZA			/ 0=NO CODE
	TAD	(7700)		/ REPLACE 6 BITS IN CODE

	DCA	HLPCOD		/ SAVE NEW CODE
	JMS	CHKSPL		/ CHECK SPECIAL CODE
	-BAKLIN			/ IS = BACKUP LINE(UP ARRW)
	JMP	SETBKW		/ SET TO BACKWARD
	JMS	CHKSPL		/ CHECK SPECIAL CODE
	-ADVLIN			/ IS = ADV LINE(DWN ARRW)
	JMP	SETFWD		/ SET TO FORWARD
	JMS	CHKSPL		/ CHECK SPECIAL CODE
	-NXTSCR			/ IS = ADVANCE PARA(NXT SCREEN)
	JMP	SETFWD		/ SET TO FORWARD
	JMS	CHKSPL		/ CHECK SPECIAL CODE
	-PRVSCR			/ IS = BACKUP PARA(PREV SCREEN)
	JMP	SETBKW		/ SET TO FORWARD
	JMP	SETCNT		/ CONTINUE
SETBKW,	IAC			/ 1=BACKUP DIRECTION
SETFWD,				/ 0=FORWARD DIRECTION
	DCA	MOVMOD+1	/ 0=BACK 1=FWRD
	JMS	SETDIR		/ SET THE DIRECTION
SETCNT,	TAD	HLPCOD		/ GET THE CODE
			>	/ END IFDEF HELPDO

/	RETURN TO EDIT MODE

HLPRET,	DCA	T2		/ SAVE RETURN CODE
	TAD	T3		/ GET BASKET COUNT
	DCA	BASKCT		/ RESET

/D185	OVLJMP;OVHLPE	/ END HELP OVERLAY RESTORE MENU DATA AND POINTERS

	TAD	WIDNAR		/ CHECK FOR WIDE SCREEN			/M192
	SNA CLA								/M192
	JMS	SET132		/ CONVERT TO 132 COLUMN MODE		/A185
	JMS	CLSSET		/ INITIALIZE SCROLL VALUES FOR STATUS	/A185

	AC7777			/ SET AC = -1				/A185
	CIFMNU			/ CHANGE INSTRUCTION FIELD TO MENU FIELD/A185
	PGSWAP			/ AC=-1 SO JUST LOAD IN THE SAVE AREA	/A185

	TAD	T2		/ FINISH  - GET RETURN CODE		/A185
	SNA			/ IS CODE OR NULL(RET TO EDITOR)	/A185
	JMP	EINEXT		/ RETURN TO NORMAL EDITOR FUNCTIONS	/A185
	JMP	EINEXB		/ RETURN TO EDITOR ...WITH NEG CODE IN AC/A185



OVHLP1,	TAD	BASKCT		/ GET WASTEBASKET COUNT			/A185
	DCA	T3		/ SAVE FOR HELP UNDELETE		/A185
	DCA	PSTBLK							/A185
	DCA	BASKCT 		/ CLEAR PASTE BUF FLAGS			/A185

	JMS	CLR132		/ MAKE SURE THE SCREEN IS IN NARROW MODE/A185
	AC0003			/ SET UP TO RESET SCROLL REGION		/A185
	CIFMNU			/ CHANGE INSTRUCTION FIELD TO MENU FIELD/A185
	JMS I	(CALLN1)	/ RESET SCROLL REGION SET ABSOLUTE MODE	/A185
	CIFMNU			/ CHANGE INSTRUCTION FIELD TO MENU FIELD/A185
	PGSWAP			/ AC=0, SAVE SWAP AREA & RELOAD MENU CODE/A185

	JMP	OVHLP0		/ START OF HELP OVERLAY

HLPHLP,	TAD	NOWPTR		/ NEXT LEVEL HELP TEXT - GET ARG
	CDFMNU
	DCA I	(MUBUF+MNTMP1)
	CDFEDT
	CIFMNU
	JMS I	MNUCAL		/ CAL MENU
	DLHL01			/ MENU BLOK(ARG PASSED IN MNTMP1)
	CDFMNU
	TAD I	(MUBUF+MNTMP1)	/ ARG RET HERE(0=NEXT NOT 0=DO)
	CDFEDT

	IFNDEF	HELPDO	<
	SNA CLA			/ IS DISPLAY MENU?
	JMP	OVHLP0		/ YES
	JMP	HLPRET		/ YES RESUME EDITING
			>	/ END END IFNDEF HELP DO

	IFDEF	HELPDO	<
	SNA			/ IS DISPLAY MENU?
	JMP	OVHLP0		/ YES
	SMA CLA			/ IS IT GOLD MENU
	JMP	HLPRET		/ YES RESUME EDITING
	JMP	HLPDO		/ DO FUNCTION CODE
			>	/ END IFDEF HELPDO

IFDEF ENGLSH <
COLPT3,	"0+4000-200		/ (01)
	"1+4000-200
	"1+4000-200		/ (19)
	"9+4000-200
	"3+4000-200		/ (37)					/C212
	"7+4000-200							/C212
	"5+4000-200		/ (52)					/C212
	"2+4000-200							/C212
	"6+4000-200		/ (65)					/C212
	"5+4000-200							/C212
		>
IFDEF V30SWE <
COLPT3,	"0+4000-200		/ (01)
	"1+4000-200
	"1+4000-200		/ (19)
	"9+4000-200
	"3+4000-200		/ (37)					/C212
	"7+4000-200							/C212
	"5+4000-200		/ (52)					/C212
	"2+4000-200							/C212
	"6+4000-200		/ (65)					/C212
	"5+4000-200							/C212
		>
IFDEF V30NOR <
COLPT3,	"0+4000-200		/ (01)
	"1+4000-200
	"1+4000-200		/ (19)
	"9+4000-200
	"3+4000-200		/ (37)					/C212
	"7+4000-200							/C212
	"5+4000-200		/ (52)					/C212
	"2+4000-200							/C212
	"6+4000-200		/ (65)					/C212
	"5+4000-200							/C212
		>
IFDEF SPANISH <
COLPT3,	"0+4000-200		/ (01)					/A236
	"1+4000-200							/ "
	"1+4000-200		/ (19)					/ "
	"9+4000-200							/ "
	"3+4000-200		/ (37)					/ "
	"7+4000-200							/ "
	"5+4000-200		/ (52)					/ "
	"2+4000-200							/ "
	"6+4000-200		/ (65)					/ "
	"5+4000-200							/A236
		>
IFDEF ITALIAN <
COLPT3,	"0+4000-200		/ (01)
	"1+4000-200
	"2+4000-200		/ (20)
	"0+4000-200
	"3+4000-200		/ (41)					/C212
	"9+4000-200							/C212
	"5+4000-200		/ (52)					/C212
	"2+4000-200							/C212
	"6+4000-200		/ (65)					/C212
	"5+4000-200							/C212
		>
IFDEF DUTCH	<	
COLPT3,	"0+4000-200		/ (01)
	"1+4000-200
	"1+4000-200		/ (19)
	"9+4000-200
	"3+4000-200		/ (36)					/C212
	"6+4000-200							/C212
	"5+4000-200		/ (52)					/C212
	"2+4000-200							/C212
	"6+4000-200		/ (65)					/C212
	"5+4000-200							/C212
	>

SETLST,	XX			/ CHECK LAST COLUMN
	TAD	LNTPTR		/ LENGTH TABLE POINTER
	DCA	LNTTMP		/ SAVE TEMP
SETNXT,	TAD	HLPTM1		/ POSITION POINTER
	TAD I	LNTTMP		/ GET LNGTH
	SPA			/ L.T. THAN POINTER
	JMP	SETEXT		/ YES
	DCA	HLPTM1		/ NO
	ISZ	COLNUM		/ INC COL NUMBER
	ISZ	LNTTMP		/ INC PTR
	JMP	SETNXT
SETEXT,	CLA			/ SET POSITION IN COL
	JMP I	SETLST		/ RET
LNTPTR,	LNTTBL			/ POINTER
LNTTMP,	0			/ TEMP

LNTTBL,									/A166
	IFNDEF	CONDOR	<						/A166
	-17			/ NEG LNTH COL 1			/C212
	-20			/ NEG LNTH COL 2			/C212
	-15			/ NEG LNTH COL 3			/C222
	-21			/ NEG LNTH COL 4			/A166
	-7			/ NEG LNTH COL 5			/C222
			>	/ END IFNDEF CONDOR			/A166

	IFDEF	CONDOR	<						/A166
	-21			/ NEG LNTH COL 1			/C212
	-21			/ NEG LNTH COL 2			/C212
	-16			/ NEG LNTH COL 3			/C212
	-21			/ NEG LNTH COL 4
	-17			/ NEG LNTH COL 5			/C212
			>	/ END IFDEF CONDOR			/A166
	0			/ END TABLE

	IFDEF	HELPDO	<

/	FOLLOWING TABLE ASSUMES ALL CODES START WITH 77XX IN H/ O 6 BITS
/	IT IS USED WITH 6 BITS FROM 1ST CODE STORED IN H/ O 6 BITS
/	AND 6 BITS FROM NEXT CODE STORED IN L/ O 6 BITS

HLPTBL,				/ COMMAND TABLE
	EDDICT^100+EDGADV+100  	/ ABBREVIATION  	/ GOLD ADVANCE
	EDGBKP^100+EDUBLD+100  	/ GOLD BACKUP  		/ GOLD:BOLD
	EDBOTM^100+EDCENT+100  	/ BOTTOM  		/ CENTER
	EDPCMD^100+EDSRCH+100  	/ COMMAND  		/ CONT. SEARCH
	EDCONT^100+EDRBSE+100  	/ CONTINUE SEARCH & SELECT/ RUB SENTENCE
	EDGCUT^100+EDTIME+100	/ GOLD CUT		/ GOLD:DATE & TIME
	EDDEAD^100+EDUDLT+100  	/ DEAD KEY 		/ GOLD:DELETE
	EDFILE^100+EDDCMT+100  	/ FILE  		/ GOLD:G	GET DOC
	0000000^100+EDHYPL+100	/ NO HELP CODE RESUME EDITEDHALT / HYPHEN PULL
	EDGPST^100+EDGETC+100	/ INSERT HERE=GOLD PASTE/ LIBRARY
	EDMENU^100+EDNPAG+100  	/ MENU  		/ NEW PAGE
	EDGPGE^100+EDPMRK+100  	/ GOLD:PAGE  		/ PAGE MARKER
	EDCRET^100+EDGPST+100	/ PARAGRAPH MARKER	/ GOLD:PASTE
	EDHYP1^100+EDGCUT+100  	/ PRINT HYP		/ GOLD REMOVE= GOLD CUT
	EDREPL^100+EDRBLN+100  	/ REPLACE  		/ RUB LINE
	EDRULR^100+EDHYP2+100  	/ RULER  		/ INVISIBLE HYP
	EDFIND^100+EDFIND+100  	/ SEARCH		/ SEARCH PAGE    (TEMP DO SEARCH)
	EDSUBS^100+EDSUPS+100  	/ SUBSCRIPT  		/ SUPERSCRIPT
	EDSWAP^100+EDTOP+100  	/ SWAP 			/ TOP
	EDUUDL^100+EDLOWR+100  	/ GOLD:UNDERLINE	/ GOLD:UPPERCASE
	EDVIEW^100+EDGBKP+100  	/ VIEW			/ UP ARROW=BACKUP LINE(**)
	EDGADV^100+EDGBKP+100	/ DN ARROW=ADVANCE LINE(**)/ LFT ARROW=BACKUP LINE(**)
	EDGADV^100+EDADVN+100	/ RHT ARROW=ADVANCE LINE(**)	/ ADVANCE
	EDBKUP^100+EDBOLD+100	/ BACKUP		/ BOLD
	EDSCUT^100+EDDLTC+100	/ CUT			/ DELETE CHAR
	EDDLTW^100+EDLINE+100	/ DELTE WORD		/ LINE
	EDPAGE^100+EDPARA+100	/ PAGE			/ PARAGRAPH
	EDPSTE^100+EDSLCT+100	/ PASTE			/ SELECT
	EDSENT^100+EDTABP+100	/ SENTENCE		/ TABPOSITION
	EDUNDL^100+EDUPPR+100	/ UNDERLINE		/ UPPERCASE
	EDWORD^100+EDENTR+100	/ WORD			/ ENTER
	EDFIND^100+EDHYPS+100	/ FIND=GOLD SRCH	/ HYPH PULL(**)

/ FOLLOWING DEFINE USED TO DETERMINE OFFSET IN TABLE
/	USED TO LOCATE FUNCTIONS REQUIRING 2 CODES TO BE EXECUTED

	NXTSCR=.-HLPTBL^2+1	/ NXT SCRN=ADV PARA L/ O BYTE
	EDPSTE^100+EDPARA+100	/ INSERT HERE=PASTE/NEXT SCREEN=ADVANCE PARA(**)
	PRVSCR=.-HLPTBL^2	/ PREV SCRN=BKUP PARA H/ O BYTE
	EDPARA^100+EDSCUT+100	/ PREV SCREEN=BACKUP PARA(**)/REMOVE=CUT
	BAKLIN=.-HLPTBL^2+1	/ UP ARROW=BK LINE L/ O BYTE
	EDSLCT^100+EDLINE+100	/ SELECT=SEL/ UP ARROW=BACKUP LINE(**)
	ADVLIN=.-HLPTBL^2	/ DWN ARROW=ADV LINE L/ O BYTE
	EDLINE^100+EDBKUP+100	/ DN ARROW=ADVANCE LINE(**)/ LFT ARROW=BACKUP LINE(**)
	EDADVN^100+007700+100	/ RHTARROW=ADVANCE LINE(**)

HLPTBE,				/ END OF TABLE+1
			>	/ END IFDEF HELPDO
				/ END HELP MENU


/
/	Moved here on edit 225 for space reasons
/
/	Modified on edit 229 to allow Swap on dead key sequences.
/

XVSWAP,	JMS	BHOOK		/ Call Blaster				/A229
	SWPDED			/ To swap a dead thing 			/A229
	  JMP	EIBAD		/ Bad Swap				/A229
	  JMP	EIFIX		/ Char has been inserted , wait for more/A229



EISWPA,	XX			/ Check current char for Swap
	JMS	LODCHR		/
	JMP	EISWBD		/ Bad if ETX
	AND	P177
	TAD	(-ECNWLN)	/ Or if EOL
	SNA
	JMP	EISWBD		/
	TAD	(ECNWLN-ECNWPG)	/ Or if PAGE
	SNA CLA			/ 					/M229
/D229	TAD	(ECNWPG-ECSTOV)	/ Or if Overstruck
/D229	SNA CLA
	JMP	EISWBD
	ISZ	EISWPA
EISWBD,	JMP I	EISWPA		/ Return only if OK


/	OVTIME moved here on edit 231 to allow room for hyphenation of 	/A231
/	8 bit chars							/A231

/	OVTIME= .-OVLAY1+OVRNUM	/TIME ENTRY

XVTIME,	CIFMNU
	JMS I	TIMCAL
	NOP			/ UPDATE TIMER
	CDFMNU
	AC7777
	TAD I	(DATESP)	/ GET DATE STRING
	DCA	OVTIMX		/ SAVE PTR-1
XVTIM1,	CDFMNU
	TAD I	OVTIMX		/ GET NEXT CHAR
	SNA
	JMP 	EIFIX		/ QUIT IF NULL
	INSCHR			/ ELSE INSERT
	JMP	XVTIM1		/ AND LOOP FOR MORE
	
	OVTIMX=X5		/ STRING INDEX REGISTER



	X=.			/ INDICATE FIRST FREE LOCATION ON PAGE

/---------------------
	PAGE

/***************************************************************************
/****			   START OF OVERLAY				****
/***************************************************************************

	OVRNUM=OVRNUM+200
	OVRBLK=OVRNUM%200+DLOEDO-1 / DISK BLOCK WHERE OVERLAY IS LOADED

	RELOC
	RELOC	OVLAY1
	OVRNUM

/***************************************************************************
/****	MOVED DURING EDIT #176 FOR GOLD:TAB STUFF			****
/***************************************************************************


	OVXRUL=	.-OVLAY1+OVRNUM

/
/	RULER CLEAN UP CODE
/
/	ENTERED HERE FROM EDIT-RULER MODE AND COMPLETION OF GOLD:TAB
/
/		"GOLD:TAB"
/		"GOLD:RULER"
/		"ENTER"
/		"GOLD:ADVANCE"  OR  "GOLD:BACKUP"
/
	JMS	CHKRUL		/ CHECK NEW RULER
	 JMP	RLBADX		/ NEW RULER IS BAD, RETURN TO RULER OR TAB

	TAD	CURSAV		/ GET SAVED CURSOR POSN FROM RESIDENT
	DCA	CURSOR		/ RESTORE CURSOR POSN.

	TAD	(ECTMRK)	/ PUT THE TEMP MARKING IN THE DOCUMENT	/a176
	JMS	INSERT							/a176

	JMS	CMPRUL
	 JMP	RLEXIT		/ NO CHANGE IN RULER
/
/ +++	THE RULER CHANGED.						/a176
/	WE JUST PUT THE MARKER IN THE EDIT BUFFER, NOW, INSERT		/a176
/	THE NEW RULER AND RULER-MODIFIED CODE.  THEN WHEN WE		/a176
/	GET TO THE NEXT OVERLAY, WE WILL PLACE THE CURSOR AT THE	/a176
/	SCREEN LOCATION BEFORE THE GOLD:TAB OR GOLD:RULER COMMAND.	/a176
/	WAS ISSUED.							/a176
/
/	Also, we are going to Erase the Current line from the screen	/a177
/	Because of problems with Gold:tab and Editor-Status-Word	/a177
/	Defined to Display the Ruler on the 24th Line (but not in	/a177
/	the body of the text).						/a177
/									/a177
	PUTESC			/ LETS OUTPUT AN ESCAPE SEQUENCE	/a177
	 "[&177+4000		/ WHICH WILL ERASE THE CURRENT LINE	/a177
	 "2&177+4000							/a177
	 "K&177								/a177
/
/
	TAD	LINE23		/ MOVE EDIT BUFFER POINTER		/c177
	DCA	CURPTR 		/ AND SCREEN CURSOR POINTER
	DCA	CURSOR 		/ TO LEFT MARGIN

	JMS	INSRUL 		/ INSERT NEW RULER

	TAD	(ECRMFL)
	DCA	LINMOD 		/ SET RULER MODIFIED FLAG
	JMS	SAVLMD 		/ INSERT IT

	TAD	LINE23		/ MOVE EDIT PTR TO BEFORE NEW RULER
	DCA	CURPTR

RLEXIT,	OVLJMP			/ TRANSFER TO ANOTHER OVERLAY TO FINISH
	 OVRLXT

/
/
/ +++	THERE IS SOME KIND OF PROBLEM WITH THE NEW-RULER		/a176
/									/a176
/	IF WE GOT HERE FROM GOLD:RULER, IT COULD BE ANYTHING.		/a176
/	IF WE GOT HERE FROM GOLD:TAB, THEN WE MUST HAVE TOO MANY TABS	/a176
/									/a176
/	WE RETURN TO THE PROPER OVERLAY BY VECTORING ON MNTMP1 IN THE	/a176
/	MENU FIELD.							/a176
/

RLBADX,	JMS	MNUGET							/a176
	 MNTMP1			/ GET VECTOR FLAG			/a176
	SZA	CLA		/ .EQ.0 = RULER   .NE.0 = TAB		/a176
	 JMP	RLBAD1		/ TAB					/a176

	OVLJMP			/ RULER					/a176
	 OVRBAD								/a176

RLBAD1,	OVLJMP			/ TAB					/a176
	 INTBAD								/a176


	OVGSRL=	.-OVLAY1+OVRNUM

	JMS	CHKRUL 		/ CHECK FOR VALID RULER
	 JMP	RLBADX 		/ ERROR - INVALID RULER

/ READ THE BLOCK WHICH CONTAINS THE STORED RULER WE WANT TO		/A184
/  OVERWRITE AND THEN COPY THE NWRUL BUFFER INTO THAT READ BUFFER.	/A184
/   THE MODIFIED BUFFER IS THEN WRITTEN OUT TO THE DISK.		/A184

	TAD	T3 		/ RULER VALID - PUT IT TO DISK		/A184
	JMS	RLGETX 		/ GO READ EDITOR RULER BLOCK		/A184
	DCA	RLPUT1 		/ RETURN WITH ADDRESS - 1 OF RULER AND	/A184
				/  SET UP FOR COPY			/A184

	JMS	CPYBUF		/ COPY NWRUL TO WRITE OUT BUFFER	/A184
	-RULSIZ			/ MINUS SIZE OF NEW RULL		/A184
	CDFMNU			/ RESIDES IN MENU FIELD			/A184
	NWRUL-1			/ AT THIS LOCATION			/A184
	CDFBUF			/ COPY TO THIS FIELD			/A184
RLPUT1,	.-.			/ AT THIS LOCATION			/A184
	
	TAD	(RXEWT+2000) 	/ GET WRITE OUT FUNCTION CODE		/A184
	JMS	PSTIO 		/ WRITE TO DISK				/A184

	OVLJMP			/ GOTO RULER MODIFICATION ROUTINE TO
	OVPRUL			/ DISPLAY RULER AND GET NEXT INPUT CHAR.


	X=.			/ INDICATE FIRST FREE LOCATION ON PAGE

/------------------------------

	PAGE

/
/ SUBR CHKRUL -- CHECK NEW RULER TO SEE IF IT ADHERES TO THE FOLLOWING
/   RULES:
/   (1)	THERE MUST BE A LEFT MARGIN;
/   (2)	THE LEFT MARGIN, WORD WRAP INDENT MARK, PARA INDENT MARK,
/	AND CENTERING POINT MUST ALL BE TO THE LEFT OF THE
/	RIGHT MARGIN;
/   (3) # OF MARKERS (TABS, ETC) < (20 IF RIGHT MARGIN<80, ELSE 41);
/	ALSO DELETES MARKERS PAST RIGHT MARGIN.
/
/ CALL:
/	TAD	JUNK		/ AC DOESN'T MATTER
/	JMS	CHKRUL		/ CHECK NEW RULER (NWRUL)
/	JMP	RULBAD		/ RULER BAD (VIOLATES 1 OR MORE RULES)
/	JMP	RULOK		/ RULER OK
/
CHKRUL,	XX			/ CHECK NEW RULER
	AC0001
	DCA	T1 		/ INIT POSN
	CDFMNU
	TAD	NWLMAR
	SNA
	JMP	MCHK1 		/ ERROR IF NO L
	JMS	MCHK
	TAD	NWWMAR
	JMS	MCHK
	TAD	NWPMAR
	JMS	MCHK
	TAD	NWCMAR
	JMS	MCHK
	TAD	NWRMAR
	TAD	(-COLM81)	/ NOW CHECK TOTAL SIZE OF RULER
	SMA CLA
	TAD	(-25)
	TAD	(-25)
	DCA	RLTMP 		/ -(MAX COUNT OF MARKS)-1
	DCA	MCHK
RLXCH1,	ISZ	MCHK 		/ BUMP POSITION
	TAD	MCHK
	JMS	GETBYT
	NWRUL 			/ LOOK AT IT
	SNA
	JMP	RLXCH2 		/ JUMP IF DONE
	TAD	(-1)
	SNA CLA
	JMP	RLXCH1 		/ IGNORE IF NOTHING THERE
	TAD	MCHK
	CIA
	CDFMNU
	TAD	NWRMAR
	SMA CLA
	JMP	RLXCH3 		/ COUNT IF INSIDE MARGIN
	TAD	MCHK
	MQL
	IAC 			/ ELSE DELETE
	JMS	PUTBYT
	NWRUL
	JMP	RLXCH1

/ COUNT MARKER AT LEFT OF RIGHT MARGIN

RLXCH3,	ISZ	RLTMP
	JMP	RLXCH1 		/ IGNORE IF OK SO FAR
	TAD	MCHK 		/ ELSE COMPLAIN IF TOO MANY MARKS
	JMP	MCHK2

RLTMP,	0

/ NEW RULER IS OK.  TAKE OK RETURN.

RLXCH2,	ISZ	CHKRUL
RLXCH4,	CDFMYF
	JMP I	CHKRUL

/
/ SUBR MCHK --
/ ENTER WITH AC = NEW RULER SETTING.
/ *** THIS SUBROUTINE MAY ONLY BE CALLED FROM WITHIN SUBR CHKRUL!
/ MCHK MAKES SURE NEW RULER SETTING IS TO THE LEFT OF NEW RIGHT MARGIN.
/ IF IT IS, THEN EXIT MCHK WITH AC=0;
/ ELSE (BAD NEW RULER) TAKE ERROR RETURN FROM ***CHKRUL*** !!

MCHK,	XX
	DCA	T1
	TAD	T1
	CIA
	TAD	NWRMAR
	SMA SZA CLA
	JMP I	MCHK
MCHK1,	TAD	T1
MCHK2,	DCA	RLPOSN
	JMP	RLXCH4




	X=.			/ INDICATE FIRST FREE LOCATION ON PAGE

/------------------------------

	PAGE

/***************************************************************************
/****			   START OF OVERLAY				****
/***************************************************************************

	OVRNUM=OVRNUM+200
	OVRBLK=OVRNUM%200+DLOEDO-1 / DISK BLOCK WHERE OVERLAY IS LOADED

	RELOC
	RELOC	OVLAY1
	OVRNUM

	OVINCH=.-OVLAY1+OVRNUM
	JMP	INOVCH			/ Handle chars in Overstrike	/A235
					/ mode				/A235

	OVINOF=.-OVLAY1+OVRNUM		/ Switch INSOV Flag On - Off	/A235


INONOF,	CLA				/ Clear Acc			/A235
	TAD 	INSOVF			/ Get Overstrike flag		/A235
	CMA				/ Flip bits			/A235
	AND	(1)			/ Mask out everything else	/A235
	DCA	INSOVF			/ Now re-store it		/A235
	AC0001				/ Set Acc up			/A235
	CDFMNU				/ Point to Menu field		/A235
	DCA I	XLINDIF			/ Set line different flag	/A235
	CDFMYF				/ and back here			/A235
	JMP	EIFIX			/ Go back for more		/A235

INOVCH,	CDFBUF				/ Point to User buff		/A235
	TAD I	CURPTR			/ Get next char			/A235
	AND 	P177			/ Strip off attributes		/A235
	CDFMYF				/ Now back here			/A235
	TAD	(-ECSPC)		/ Check if alpha		/A235
	SPA				/				/A235
	JMP	INONAL			/ Not alpha			/A235
	CLA				/ Clear out results of test	/A235
	CDFBUF				/ Point to user buffer		/A235
	DCA I	CURPTR			/ And kill char			/A235
	CDFMYF				/ Now point back here		/A235
	TAD	INCHTM			/ Get char just input		/A235
	JMP	EINSRT			/ And wait for more		/A235
INONAL,	TAD	(ECSPC-ECSTOV)		/ Is it the start of a dead seq	/A235
	SNA CLA				/				/A235
	JMP	INOVDED			/ yes , Kill it then return	/A235
	TAD 	INCHTM			/ No get char back		/A235
	JMP	EINSRT			/ And insert it instead		/A235

INOVDED,JMS	INVKIL			/ Kill char			/A235
	ADVPTR				/ Get next			/A235
	NOP				/				/A235
	TAD	(-ECNDOV)		/ End of the dead seq ?		/A235
	SZA CLA				/ 				/A235
	JMP	INOVDED			/ No , keep trying		/A235
	JMS 	INVKIL			/ Yes , kill it			/A235
	TAD	INCHTM			/ Now get back original char	/A235
	JMP	EINSRT			/ And insert it			/A235
/
/	Small routine to kill next char in user buffer			/A235
/

INVKIL,	XX
	CDFBUF				/ Point to user buffer		/A235
	DCA I	CURPTR			/ And kill char			/A235
	CDFMYF				/ Point back here		/A235
	JMP I	INVKIL			/ And return			/A235


XLINDIF,LINDIF				/ Pointer to LINDIF in Menu field/A235






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

	ZBLOCK	1		/ RESERVE SPACE FOR SECOND OVERLAY PAGE


	X=.			/ INDICATE FIRST FREE LOCATION ON PAGE
/---------------------
	PAGE

/***************************************************************************
/****			   START OF OVERLAY				****
/***************************************************************************

	OVRNUM=OVRNUM+200
	OVRBLK=OVRNUM%200+DLOEDO-1 / DISK BLOCK WHERE OVERLAY IS LOADED

	RELOC
	RELOC	OVLAY1
	OVRNUM

	OVTCHR=	.-OVLAY1+OVRNUM	/ USER TYPED "TECHNICAL CHARACTER KEY"
	JMS	OV2JMP		/ CALL REST OF ROUTINE IN OVERLAY 2 AREA
	OVTC			/ NECESSARY TO LOAD THIS OVERLAY & TABLE

	XXFIND=	.-OVLAY1+OVRNUM	/ USER TYPED "GOLD:SEARCH"
	ISZ	NOMOVE		/ KEEP CURSOR FROM PRE-INCREMENTING
	JMS	FXSCRL 		/ UPDATE SCREEN
	JMS	PROMPT		/ PROMPT USER 'ENTER PHRASE:'
	EIFND1
	JMS	OV2JMP		/ CALL ROUTINE IN SECOND OVERLAY AREA
	OVAGET			/ ALTERNATE GETLIN ROUTINE

	TAD	GETTRM		/ TEST TERMINATOR FOR...
	TAD	(-EDRULR)	/ RULER CODE ?
	SNA			/  .
	JMP	XXGOTO		/ USER TYPED "GOLD:SEARCH - GOLD:RULER"
	TAD	(EDRULR-EDPAGE)	/ PAGE CODE ?
	SNA CLA			/  .					/C206
	JMP	XPGOTO		/ USER TYPED "GOLD:SEARCH - PAGE"

	JMS	CPYBUF		/ COPY INPUT AREA CONTAINING SEARCH STRING
ALTLIM,		-63		/ NUMBER OF WORDS TO COPY		/C196
		CDFMNU		/ FIELD TO COPY FROM
		MUBUF+MNIBUF-1	/ ADDRESS TO COPY FROM
		CDFMYF		/ FIELD TO COPY TO
		EIGES4		/ ADDRESS TO COPY TO

	TAD	GETTRM		/ TEST TERMINATOR FOR...
	TAD	(-EDCONT)	/ CONTINUE SEARCH AND SELECT ?		/C206
	SNA			/  .
	JMP	XXCONT		/ USER TYPED "GOLD:CONTINUE SEARCH & SELECT"
	TAD	(EDCONT-EDBKUP)	/ BACKUP?
	SNA CLA			/  .
	AC7776 			/ MODIFY INDICATORS ACCORDINGLY...
	DCA	SRCDIR		/  .
	OVLJMP; OVSRCH		/ CONTINUE WITH "CONTINUE SEARCH"

XXGOTO,	OVLJMP; OVGSGR		/ USER TYPED "GOLD:SEARCH - GOLD:RULER"
XPGOTO,	OVLJMP; OVRPPG		/ USER TYPED "GOLD:SEARCH - PAGE"

/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ GET GLOBAL SEARCH AND REPLACE
/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

	OVGSRP=	.-OVLAY1+OVRNUM	/ GLOBAL SEARCH AND REPLACE MAIN ENTRANCE

	JMS	CLR132		/ KEEP SCREEN WIDTH AT 80
	TAD	GSRPRV		/ GET PREVIOUS GLOBAL SEARCH FLAG
	SZA CLA			/ WAS THERE A PREVIOUS GLOBAL SEARCH?
	AC0001			/ YES, ALLOW RE-START
	JMS	GETALT		/ CALL MENU AND GET STRING

	TAD	GETLEN		/ GET LENGTH OF INPUT STRING
	SZA CLA			/ WAS ANYTHING TYPED ?
	JMP	GS2		/ YES, GO HANDLE STRING

	TAD	GSRPRV		/ NO, GET PREVIOUS GLOBAL SEARCH FLAG
	SZA CLA			/ WAS THERE A PREVIOUS GLOBAL SEARCH?
	JMP	XVGSGO		/ YES, THEN GO CONTINUE IT

	JMS	SET132		/ SET TO 132 COL. IF WIDNAR=WIDE	/M192
	JMS	GS1SWP		/ RESTORE THE SWAP AREA
	JMP	EIFIX		/ AND RETURN TO EDITOR IF FOUND

GS2,	JMS	CPYBUF		/ COPY INPUT AREA CONTAINING SEARCH STRING
		-63		/ NUMBER OF WORDS TO COPY
		CDFMNU		/ FIELD TO COPY FROM
		MUBUF+MNIBUF-1	/ ADDRESS TO COPY FROM
		CDFMYF		/ FIELD TO COPY TO
		EIGES4		/ ADDRESS TO COPY TO

/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ GET SUBSTITUTION SCREEN
/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	AC0002			/ INDICATE REPLACEMENT MENU TEXT
	JMS	GETALT		/ CALL MENU AND GET STRING

	TAD	GETTRM		/ GET THE TERMINATING CHARACTER
	TAD	(-EDPSTE)	/ COMBINE WITH PASTE KEY VALUE
	SNA CLA			/ IS IT THE PASTE KEY ?
	JMP	XVGSGO		/ YES, GO USE CURRENT PASTE BUFFER

	TAD	(PSTEBG)	/ SET UP THE PARAMETERS TO RESET THE
	DCA	PSTBLK		/ CUT-PASTE BLOCK HANDLING LOGIC.
	JMS	SETPST		/ GO SET ADRS POINTERS

	JMS	OV2JMP		/ CALL ROUTINE IN SECOND OVERLAY AREA
	OVFIXP			/ TRANSFER MENU BUFFER TO PASTE BUFFER

	TAD	(RXEWT+2000)	/ SET UP THE CALL TO WRITE THE CUT-PASTE BLOCK
	JMS	PSTIO		/ TO THE USER SCRATCH AREA ON THE DISK.
	CDFMYF			/ RESET BACK TO THIS FIELD

XVGSGO,	TAD	(SKP)		/ PICK UP THE SKIP INSTRUCTION
	DCA	GSKILN		/ STORE SO THAT GSR WILL RUN

	ISZ	GSRPRV		/ SET THE PREVIOUS GSR FLAG
	ISZ	GSRF		/ SET THE GSR IN PROGRESS FLAG

	JMS	SET132		/ SET TO 132 COL. IF WIDNAR=WIDE	/M192

	JMS	GS1SWP		/ RESTORE THE SWAP AREA			/A189
XXCONT,	OVLJMP; OVCONT		/ GO TO CONTINUE SEARCH & SELECT OVERLAY

GETALT,	XX			/ COMMON GSR STRING INPUT ROUTINE
	JMS	MNUPUT		/ TRANSFER MESSAGE CODE TO MENU TEMP
	MNTMP2			/ USE MENU TMEP NUMBER 2

	CIFMNU			/ CHANGE TO MENU FIELD
	JMS I	MNUCAL		/ AND CALL THE MENU
	DLMGS1			/ USE THE FIRST GSR MENU BLOCK

	JMS	OV2JMP		/ CALL ROUTINE IN SECOND OVERLAY AREA
	OVAGET			/ ALTERNATE GETLIN ROUTINE

	TAD	GETTRM		/ GET TERMINATING CHARACTER
	TAD	(-EDMENU)	/ COMBINE WITH VALUE FOR GOLD MENU
	SZA CLA			/ WAS GOLD MENU PRESSED ?
	JMP I	GETALT		/ NO, RETURN TO CALLER

	JMS	GS1SWP		/ YES, GO RESTORE THE SWAP AREA
	OVLJMP;OVMENU		/ GO CALL UP THE EDITOR MENU

GS1SWP,	XX			/ SUBROUTINE TO RESTORE THE SAVE AREA
	JMS	CLSSET		/ INITIALIZE SCROLL VALUES FOR STATUS
	AC7777			/ SET AC = -1
	CIFMNU			/ CHANGE INSTRUCTION FIELD TO MENU FIELD
	PGSWAP			/ AC=-1 SO JUST LOAD IN THE SAVE AREA
	JMP I	GS1SWP		/ RETURN TO CALLER

	X=.			/ INDICATE FIRST FREE LOCATION ON PAGE
/---------------------
	PAGE


/		Mapping table for the Technical Character Set
/	
/** Note:  If octal code of mapped character is 0 the user input will
/	   be ignored and no technical character will be generated.
/
/	.-- Character set selection G1, G2, G3
/	| .-- 7 bit octal code of Technical Character
/	| |        .-- 7 bit octal code of character to be mapped
/	| |        |  .-- ASCII character of octal code to be mapped
/	| |        |  |	  .-- Mapped Technical Character description
/	|/ \       |  |	  |
TCMAP,
	IFDEF DUTCH <
	  3042	/ 041 !	Top left radical
	  2067	/ 042 " Middle dot
	  3065	/ 043 # Top right summation
	  3066	/ 044 $ Bottom right summation
	  2061	/ 045 % Plus minus
	  3044	/ 046 & Top integral
	  3103	/ 047 ' Divided by
	  3053	/ 050 ( Top left paren
	  3055	/ 051 ) Top right paren
	  3046	/ 052 * Vertical connentor
	  3051	/ 053 + Top right square bracket
	  1133	/ 054 , Left square bracket
	  3050	/ 055 - Bottom left square bracket
	  1135	/ 056 . Right square bracket
	  3133	/ 057 / Includes
	  3056	/ 060 0 Bottom right paren
	  3041	/ 061 1 Left radical
	  3126	/ 062 2 Radical
	  3057	/ 063 3 Left middle brace
	  3060	/ 064 4 Right middle brace
	  3067	/ 065 5 Right middle summation
	  3062	/ 066 6 Bottom left summation
	  3045	/ 067 7 Bottom intergral
	  3043	/ 070 8 Horizontal connector
	  3054	/ 071 9 Bottom left paren
	  3136	/ 072 : Logical and
	  3137	/ 073 ; Logical or
	  3074	/ 074 Less than  -  Less than or equal
	  3052	/ 075 = Bottom right square bracket
	  3076	/ 076 Greater than  -  Greater than or equal
	  3132	/ 077 ? Is included in
	  3100	/ 100 @ Therefore
	  3105	/ 101 A Nabla, del
	  3102	/ 102 B Inifinity
	  3121	/ 103 C Capital psi
	  3106	/ 104 D Capital phi
	  3173	/ 105 E Left arrow
	  3140	/ 106 F Logical not
	  3114	/ 107 G Capital lambda
	  2066	/ 110 H Paragraph
	  3174	/ 111 I Upward arrow
	  3134	/ 112 J Intersection
	  2047	/ 113 K Section
	  3127	/ 114 L Capital omega
	  3157	/ 115 M Partial derivative
	  3110	/ 116 N Is approximate to
	  3176	/ 117 O Downard arrow
	  0000	/ 120 P (Spare location rings bell to indicate error)
	  3107	/ 121 Q Capital gamma
	  3112	/ 122 R Capital theta
	  3123	/ 123 S Capital sigma
	  3175	/ 124 T Right arrow
	  3130	/ 125 U Captial xi
	  3101	/ 126 V Variation, proportional to
	  3104	/ 127 W Capital delta
	  3117	/ 130 X Identical to
	  3131	/ 131 Y Capital upsilon
	  3111	/ 132 Z Similar or equal to
	  3160	/ 133 [ Small pi
	  3075	/ 134 \ Not equal
	  3116	/ 135 ] Implies
	  3061	/ 136 ^ Top left summation
	  3047	/ 137 _ Top left square bracket
	  3064	/ 140 ` Bottom vertical summation connector
	  3141	/ 141 a Small alpha
	  3142	/ 142 b Small beta
	  3161	/ 143 c Small psi
	  3146	/ 144 d Small phi
	  3145	/ 145 e Small epsilon
	  3166	/ 146 f Function
	  3154	/ 147 g Small lambda
	  3150	/ 150 h Small eta
	  3151	/ 151 i Small iota
	  3135	/ 152 j Union
	  3153	/ 153 k Small kapa
	  3167	/ 154 l Small omega
	  2065	/ 155 m Small mu
	  3156	/ 156 n Small nu
	  2060	/ 157 o Degree
	  3162	/ 160 p Small rho
	  3147	/ 161 q Small gamma
	  3152	/ 162 r Small theta
	  3163	/ 163 s Small sigma
	  3164	/ 164 t Small tau
	  3170	/ 165 u Small xi
	  3113	/ 166 v Times, cross product
	  3144	/ 167 w Small delta
	  3143	/ 170 x Small chi
	  3171	/ 171 y Small upsilon
	  3172	/ 172 z Small zeta
	  3120	/ 173 { Captial pi
	  3077	/ 174 | Integral
	  3115	/ 175 } If and only if
	  3063	/ 176 ~ Top vertical summation connector
	  0000	/ 177   Delete key is not allowed
	  >

	IFDEF ENGLSH <
	  IFNDEF V30FAO <
	  3042	/ 041 !	Top left radical
	  2067	/ 042 " Middle dot
	  3065	/ 043 # Top right summation
	  3066	/ 044 $ Bottom right summation
	  2061	/ 045 % Plus minus
	  3044	/ 046 & Top integral
	  3103	/ 047 ' Divided by
	  3053	/ 050 ( Top left paren
	  3055	/ 051 ) Top right paren
	  3046	/ 052 * Vertical connentor
	  3051	/ 053 + Top right square bracket
	  1133	/ 054 , Left square bracket
	  3050	/ 055 - Bottom left square bracket
	  1135	/ 056 . Right square bracket
	  3133	/ 057 / Includes
	  3056	/ 060 0 Bottom right paren
	  3041	/ 061 1 Left radical
	  3126	/ 062 2 Radical
	  3057	/ 063 3 Left middle brace
	  3060	/ 064 4 Right middle brace
	  3067	/ 065 5 Right middle summation
	  3062	/ 066 6 Bottom left summation
	  3045	/ 067 7 Bottom intergral
	  3043	/ 070 8 Horizontal connector
	  3054	/ 071 9 Bottom left paren
	  3136	/ 072 : Logical and
	  3137	/ 073 ; Logical or
	  3074	/ 074 Less than  -  Less than or equal
	  3052	/ 075 = Bottom right square bracket
	  3076	/ 076 Greater than  -  Greater than or equal
	  3132	/ 077 ? Is included in
	  3100	/ 100 @ Therefore
	  3105	/ 101 A Nabla, del
	  3102	/ 102 B Inifinity
	  3121	/ 103 C Capital psi
	  3106	/ 104 D Capital phi
	  3173	/ 105 E Left arrow
	  3140	/ 106 F Logical not
	  3114	/ 107 G Capital lambda
	  2066	/ 110 H Paragraph
	  3174	/ 111 I Upward arrow
	  3134	/ 112 J Intersection
	  2047	/ 113 K Section
	  3127	/ 114 L Capital omega
	  3157	/ 115 M Partial derivative
	  3110	/ 116 N Is approximate to
	  3176	/ 117 O Downard arrow
	  0000	/ 120 P (Spare location rings bell to indicate error)
	  3107	/ 121 Q Capital gamma
	  3112	/ 122 R Capital theta
	  3123	/ 123 S Capital sigma
	  3175	/ 124 T Right arrow
	  3130	/ 125 U Captial xi
	  3101	/ 126 V Variation, proportional to
	  3104	/ 127 W Capital delta
	  3117	/ 130 X Identical to
	  3131	/ 131 Y Capital upsilon
	  3111	/ 132 Z Similar or equal to
	  3160	/ 133 [ Small pi
	  3075	/ 134 \ Not equal
	  3116	/ 135 ] Implies
	  3061	/ 136 ^ Top left summation
	  3047	/ 137 _ Top left square bracket
	  3064	/ 140 ` Bottom vertical summation connector
	  3141	/ 141 a Small alpha
	  3142	/ 142 b Small beta
	  3161	/ 143 c Small psi
	  3146	/ 144 d Small phi
	  3145	/ 145 e Small epsilon
	  3166	/ 146 f Function
	  3154	/ 147 g Small lambda
	  3150	/ 150 h Small eta
	  3151	/ 151 i Small iota
	  3135	/ 152 j Union
	  3153	/ 153 k Small kapa
	  3167	/ 154 l Small omega
	  2065	/ 155 m Small mu
	  3156	/ 156 n Small nu
	  2060	/ 157 o Degree
	  3162	/ 160 p Small rho
	  3147	/ 161 q Small gamma
	  3152	/ 162 r Small theta
	  3163	/ 163 s Small sigma
	  3164	/ 164 t Small tau
	  3170	/ 165 u Small xi
	  3113	/ 166 v Times, cross product
	  3144	/ 167 w Small delta
	  3143	/ 170 x Small chi
	  3171	/ 171 y Small upsilon
	  3172	/ 172 z Small zeta
	  3120	/ 173 { Captial pi
	  3077	/ 174 | Integral
	  3115	/ 175 } If and only if
	  3063	/ 176 ~ Top vertical summation connector
	  0000	/ 177   Delete key is not allowed
	  >

	  IFDEF V30FAO <
	  3042	/ 041 !	Top left radical
	  3100	/ 042 " Therefore
	  0000	/ 043 # -----
	  3066	/ 044 $ Bottom right summation
	  2061	/ 045 % Plus minus
	  3061	/ 046 & Top left summation
	  3050	/ 047 ' Bottom left square bracket
	  3046	/ 050 ( Vertical connector
	  3053	/ 051 ) Top left paren
	  3115	/ 052 * Iff (if and only if)
	  3116	/ 053 + Implies
	  1133	/ 054 , Left square bracket
	  3133	/ 055 - Includes
	  1135	/ 056 . Right square bracket
	  3044	/ 057 / Top integral
	  3056	/ 060 0 Bottom right paren
	  3041	/ 061 1 Left radical
	  3126	/ 062 2 Radical
	  3057	/ 063 3 Left middle brace
	  3060	/ 064 4 Right middle brace
	  3067	/ 065 5 Right middle summation
	  3062	/ 066 6 Bottom left summation
	  3045	/ 067 7 Bottom intergral
	  3043	/ 070 8 Horizontal connector
	  3054	/ 071 9 Bottom left paren
	  1135	/ 072 : Right square bracket
	  1133	/ 073 ; Left square bracket
	  3074	/ 074 Less than  -  Less than or equal
	  3055	/ 075 = Top right paren
	  3076	/ 076 Greater than  -  Greater than or equal
	  3047	/ 077 ? Top left square bracket
	  0000	/ 100 @ -----------
	  3105	/ 101 A Nabla, del
	  3102	/ 102 B Inifinity
	  3121	/ 103 C Capital psi
	  3106	/ 104 D Capital phi
	  3173	/ 105 E Left arrow
	  3140	/ 106 F Logical not
	  3114	/ 107 G Capital lambda
	  2066	/ 110 H Paragraph
	  3174	/ 111 I Upward arrow
	  3134	/ 112 J Intersection
	  2047	/ 113 K Section
	  3127	/ 114 L Capital omega
	  3157	/ 115 M Partial derivative
	  3110	/ 116 N Is approximate to
	  3176	/ 117 O Downard arrow
	  0000	/ 120 P (Spare location rings bell to indicate error)
	  3107	/ 121 Q Capital gamma
	  3112	/ 122 R Capital theta
	  3123	/ 123 S Capital sigma
	  3175	/ 124 T Right arrow
	  3130	/ 125 U Captial xi
	  3101	/ 126 V Variation, proportional to
	  3104	/ 127 W Capital delta
	  3117	/ 130 X Identical to
	  3131	/ 131 Y Capital upsilon
	  3111	/ 132 Z Similar or equal to
	  0000	/ 133 [ ------
	  0000	/ 134 \ ------
	  0000  / 135 ] ------
	  3120  / 136 ^ Capital Pi
	  3132  / 137 _ Is included in
	  3160  / 140 ` Small Pi
	  3141	/ 141 a Small alpha
	  3142	/ 142 b Small beta
	  3161	/ 143 c Small psi
	  3146	/ 144 d Small phi
	  3145	/ 145 e Small epsilon
	  3166	/ 146 f Function
	  3154	/ 147 g Small lambda
	  3150	/ 150 h Small eta
	  3151	/ 151 i Small iota
	  3135	/ 152 j Union
	  3153	/ 153 k Small kapa
	  3167	/ 154 l Small omega
	  2065	/ 155 m Small mu
	  3156	/ 156 n Small nu
	  2060	/ 157 o Degree
	  3162	/ 160 p Small rho
	  3147	/ 161 q Small gamma
	  3152	/ 162 r Small theta
	  3163	/ 163 s Small sigma
	  3164	/ 164 t Small tau
	  3170	/ 165 u Small xi
	  3113	/ 166 v Times, cross product
	  3144	/ 167 w Small delta
	  3143	/ 170 x Small chi
	  3171	/ 171 y Small upsilon
	  3172	/ 172 z Small zeta
	  0000	/ 173 { Captial pi
	  0000	/ 174 | Integral
	  0000	/ 175 } If and only if
	  3077	/ 176 ~ Integral
	  0000	/ 177   Delete key is not allowed
	  >
	>


	IFDEF V30NOR <
	3042	/ 041 ! Top left Radical
	3100	/ 042 " Therefor
	3065	/ 043 # Top Right Summ
	3066	/ 044 $ Bott Right Summ
	2061	/ 045 % +/-
	3061	/ 046 & Top Left Summ
	3052	/ 047 ' Divide by
	3046	/ 050 ( Vertical Conn
	3053	/ 051 ) Top Left Paren
	3077	/ 052 * Vertical Bar
	3050	/ 053 + Bott left Square bracket
	1133	/ 054 , Left Sq Bracket
	3133	/ 055 - Includes
	1135	/ 056 . Right Sq Bracket
	3044	/ 057 / Top Integral
	3056	/ 060 0 Bott Right Paren
	3041	/ 061 1 Left Radical
	3126	/ 062 2 Radical
	3057	/ 063 3 Left Midd Brace
	3060	/ 064 4 Right Midd Brace
	3067	/ 065 5 Right Midd Summ
	3062	/ 066 6 Bott Right Summ
	3045	/ 067 7 Bott Integral
	3043	/ 070 8 Horr Conn
	3054	/ 071 9 Bott Left Paren
	1135	/ 072 : Right Sq Bracket
	1133	/ 073 ; Left Sq Bracket
	3074	/ 074 Less than - Lessthan or =
	3055	/ 075 = Top Right Paren
	3076	/ 076 G.T. Greater than Or =
	3047	/ 077 ? Top Left Sq Bracket
	0000	/ 100 @ -------
	  3105	/ 101 A Nabla, del
	  3102	/ 102 B Inifinity
	  3121	/ 103 C Capital psi
	  3106	/ 104 D Capital phi
	  3173	/ 105 E Left arrow
	  3140	/ 106 F Logical not
	  3114	/ 107 G Capital lambda
	  2066	/ 110 H Paragraph
	  3174	/ 111 I Upward arrow
	  3134	/ 112 J Intersection
	  2047	/ 113 K Section
	  3127	/ 114 L Capital omega
	  3157	/ 115 M Partial derivative
	  3110	/ 116 N Is approximate to
	  3176	/ 117 O Downard arrow
	  0000	/ 120 P (Spare location rings bell to indicate error)
	  3107	/ 121 Q Capital gamma
	  3112	/ 122 R Capital theta
	  3123	/ 123 S Capital sigma
	  3175	/ 124 T Right arrow
	  3130	/ 125 U Captial xi
	  3101	/ 126 V Variation, proportional to
	  3104	/ 127 W Capital delta
	  3117	/ 130 X Identical to
	  3131	/ 131 Y Capital upsilon
	  3111	/ 132 Z Similar or equal to
	0000	/ 133 ] -------
	0000	/ 134 \ -------
	0000	/ 135 ) ------- 
	3115	/ 136 ^ Iff
	3132	/ 137 _ Is included in
	3051	/ 140 ` Top Right Sq Bracket
	  3141	/ 141 a Small alpha
	  3142	/ 142 b Small beta
	  3161	/ 143 c Small psi
	  3146	/ 144 d Small phi
	  3145	/ 145 e Small epsilon
	  3166	/ 146 f Function
	  3154	/ 147 g Small lambda
	  3150	/ 150 h Small eta
	  3151	/ 151 i Small iota
	  3135	/ 152 j Union
	  3153	/ 153 k Small kapa
	  3167	/ 154 l Small omega
	  2065	/ 155 m Small mu
	  3156	/ 156 n Small nu
	  2060	/ 157 o Degree
	  3162	/ 160 p Small rho
	  3147	/ 161 q Small gamma
	  3152	/ 162 r Small theta
	  3163	/ 163 s Small sigma
	  3164	/ 164 t Small tau
	  3170	/ 165 u Small xi
	  3113	/ 166 v Times, cross product
	  3144	/ 167 w Small delta
	  3143	/ 170 x Small chi
	  3171	/ 171 y Small upsilon
	  3172	/ 172 z Small zeta
	0000	/ 173 { -------
	0000	/ 174 | -------
	0000	/ 175 } -------
	3064	/ 176 ~ Bott Vertical Summ Conn
	>



	IFDEF V30SWE <
	3042	/ 041 ! Top left Radical
	3100	/ 042 " Therefor
	3065	/ 043 # Top Right Summ
	3066	/ 044 $ Bott Right Summ
	2061	/ 045 % +/-
	3061	/ 046 & Top Left Summ
	3052	/ 047 ' Divide by
	3046	/ 050 ( Vertical Conn
	3053	/ 051 ) Top Left Paren
	3077	/ 052 * Vertical Bar
	3050	/ 053 + Bott left Square bracket
	1133	/ 054 , Left Sq Bracket
	3133	/ 055 - Includes
	1135	/ 056 . Right Sq Bracket
	3044	/ 057 / Top Integral
	3056	/ 060 0 Bott Right Paren
	3041	/ 061 1 Left Radical
	3126	/ 062 2 Radical
	3057	/ 063 3 Left Midd Brace
	3060	/ 064 4 Right Midd Brace
	3067	/ 065 5 Right Midd Summ
	3062	/ 066 6 Bott Right Summ
	3045	/ 067 7 Bott Integral
	3043	/ 070 8 Horr Conn
	3054	/ 071 9 Bott Left Paren
	1135	/ 072 : Right Sq Bracket
	1133	/ 073 ; Left Sq Bracket
	3074	/ 074 Less than - Lessthan or =
	3055	/ 075 = Top Right Paren
	3076	/ 076 G.T. Greater than Or =
	3047	/ 077 ? Top Left Sq Bracket
	0000	/ 100 @ -------
	  3105	/ 101 A Nabla, del
	  3102	/ 102 B Inifinity
	  3121	/ 103 C Capital psi
	  3106	/ 104 D Capital phi
	  3173	/ 105 E Left arrow
	  3140	/ 106 F Logical not
	  3114	/ 107 G Capital lambda
	  2066	/ 110 H Paragraph
	  3174	/ 111 I Upward arrow
	  3134	/ 112 J Intersection
	  2047	/ 113 K Section
	  3127	/ 114 L Capital omega
	  3157	/ 115 M Partial derivative
	  3110	/ 116 N Is approximate to
	  3176	/ 117 O Downard arrow
	  0000	/ 120 P (Spare location rings bell to indicate error)
	  3107	/ 121 Q Capital gamma
	  3112	/ 122 R Capital theta
	  3123	/ 123 S Capital sigma
	  3175	/ 124 T Right arrow
	  3130	/ 125 U Captial xi
	  3101	/ 126 V Variation, proportional to
	  3104	/ 127 W Capital delta
	  3117	/ 130 X Identical to
	  3131	/ 131 Y Capital upsilon
	  3111	/ 132 Z Similar or equal to
	0000	/ 133 ] -------
	0000	/ 134 \ -------
	0000	/ 135 ) ------- 
	0000	/ 136 ^ -------
	3132	/ 137 _ Is included in
	3051	/ 140 ` Top Right Sq Bracket
	  3141	/ 141 a Small alpha
	  3142	/ 142 b Small beta
	  3161	/ 143 c Small psi
	  3146	/ 144 d Small phi
	  3145	/ 145 e Small epsilon
	  3166	/ 146 f Function
	  3154	/ 147 g Small lambda
	  3150	/ 150 h Small eta
	  3151	/ 151 i Small iota
	  3135	/ 152 j Union
	  3153	/ 153 k Small kapa
	  3167	/ 154 l Small omega
	  2065	/ 155 m Small mu
	  3156	/ 156 n Small nu
	  2060	/ 157 o Degree
	  3162	/ 160 p Small rho
	  3147	/ 161 q Small gamma
	  3152	/ 162 r Small theta
	  3163	/ 163 s Small sigma
	  3164	/ 164 t Small tau
	  3170	/ 165 u Small xi
	  3113	/ 166 v Times, cross product
	  3144	/ 167 w Small delta
	  3143	/ 170 x Small chi
	  3171	/ 171 y Small upsilon
	  3172	/ 172 z Small zeta
	0000	/ 173 { -------
	0000	/ 174 | -------
	0000	/ 175 } -------
	3064	/ 176 ~ Bott Vertical Summ Conn
	>




	  IFDEF SPANISH <
	  3042	/ 041 !	Top left radical
	  3100	/ 042 " Therefore
	  0000	/ 043 # -----
	  3066	/ 044 $ Bottom right summation
	  2061	/ 045 % Plus minus
	  3061	/ 046 & Top left summation
	  3050	/ 047 ' Bottom left square bracket
	  3046	/ 050 ( Vertical connector
	  3053	/ 051 ) Top left paren
	  3115	/ 052 * Iff (if and only if)
	  3116	/ 053 + Implies
	  1133	/ 054 , Left square bracket
	  3133	/ 055 - Includes
	  1135	/ 056 . Right square bracket
	  3044	/ 057 / Top integral
	  3056	/ 060 0 Bottom right paren
	  3041	/ 061 1 Left radical
	  3126	/ 062 2 Radical
	  3057	/ 063 3 Left middle brace
	  3060	/ 064 4 Right middle brace
	  3067	/ 065 5 Right middle summation
	  3062	/ 066 6 Bottom left summation
	  3045	/ 067 7 Bottom intergral
	  3043	/ 070 8 Horizontal connector
	  3054	/ 071 9 Bottom left paren
	  1135	/ 072 : Right square bracket
	  1133	/ 073 ; Left square bracket
	  3074	/ 074 Less than  -  Less than or equal
	  3055	/ 075 = Top right paren
	  3076	/ 076 Greater than  -  Greater than or equal
	  3047	/ 077 ? Top left square bracket
	  0000	/ 100 @ -----------
	  3105	/ 101 A Nabla, del
	  3102	/ 102 B Inifinity
	  3121	/ 103 C Capital psi
	  3106	/ 104 D Capital phi
	  3173	/ 105 E Left arrow
	  3140	/ 106 F Logical not
	  3114	/ 107 G Capital lambda
	  2066	/ 110 H Paragraph
	  3174	/ 111 I Upward arrow
	  3134	/ 112 J Intersection
	  2047	/ 113 K Section
	  3127	/ 114 L Capital omega
	  3157	/ 115 M Partial derivative
	  3110	/ 116 N Is approximate to
	  3176	/ 117 O Downard arrow
	  0000	/ 120 P (Spare location rings bell to indicate error)
	  3107	/ 121 Q Capital gamma
	  3112	/ 122 R Capital theta
	  3123	/ 123 S Capital sigma
	  3175	/ 124 T Right arrow
	  3130	/ 125 U Captial xi
	  3101	/ 126 V Variation, proportional to
	  3104	/ 127 W Capital delta
	  3117	/ 130 X Identical to
	  3131	/ 131 Y Capital upsilon
	  3111	/ 132 Z Similar or equal to
	  0000	/ 133 [ ------
	  0000	/ 134 \ ------
	  0000  / 135 ] ------
	  3120  / 136 ^ Capital Pi
	  3132  / 137 _ Is included in
	  3160  / 140 ` Small Pi
	  3141	/ 141 a Small alpha
	  3142	/ 142 b Small beta
	  3161	/ 143 c Small psi
	  3146	/ 144 d Small phi
	  3145	/ 145 e Small epsilon
	  3166	/ 146 f Function
	  3154	/ 147 g Small lambda
	  3150	/ 150 h Small eta
	  3151	/ 151 i Small iota
	  3135	/ 152 j Union
	  3153	/ 153 k Small kapa
	  3167	/ 154 l Small omega
	  2065	/ 155 m Small mu
	  3156	/ 156 n Small nu
	  2060	/ 157 o Degree
	  3162	/ 160 p Small rho
	  3147	/ 161 q Small gamma
	  3152	/ 162 r Small theta
	  3163	/ 163 s Small sigma
	  3164	/ 164 t Small tau
	  3170	/ 165 u Small xi
	  3113	/ 166 v Times, cross product
	  3144	/ 167 w Small delta
	  3143	/ 170 x Small chi
	  3171	/ 171 y Small upsilon
	  3172	/ 172 z Small zeta
	  0000	/ 173 { Captial pi
	  0000	/ 174 | Integral
	  0000	/ 175 } If and only if
	  3077	/ 176 ~ Integral
	  0000	/ 177   Delete key is not allowed
	  >



	IFDEF ITALIAN <
	3132	/ 041 !	Is included in
	3057	/ 042 " Left middle brace
	0000	/ 043 # ---------------
	3116	/ 044 $ Implies
	2067	/ 045 % Middle dot
	3115	/ 046 & If and only if
	3060	/ 047 ' Right middle brace
	3067	/ 050 ( Right middle summation
	3050	/ 051 ) Bottom left square bracket
	3075	/ 052 * Not equal
	3051	/ 053 + Top right square bracket
	2065	/ 054 , Small mu
	3052	/ 055 - Bottom right square bracket
	1133	/ 056 . Left square bracket
	1135	/ 057 / Right square bracket
	3055	/ 060 0 Top right paren
	3042	/ 061 1 Top left radical
	3100	/ 062 2 Therefore
	3065	/ 063 3 Top right summation
	3066	/ 064 4 Bottom right summation
	2061	/ 065 5 Plus/minus
	3061	/ 066 6 Top left summation
	3044	/ 067 7 Top intergral
	3046	/ 070 8 Vertical connector
	3053	/ 071 9 Top left paren
	1135	/ 072 : Right square bracket
	1133	/ 073 ; Left square bracket
	3074	/ 074 Less than  -  Less than or equal
	3120	/ 075 = Capital Pi
	3076	/ 076 Greater than  -  Greater than or equal
	3157	/ 077 ? Partial derivative
	0000	/ 100 @ ------------
	3105	/ 101 A Nabla, del
	3102	/ 102 B Inifinity
	3121	/ 103 C Capital psi
	3106	/ 104 D Capital phi
	3173	/ 105 E Left arrow
	3140	/ 106 F Logical not
	3114	/ 107 G Capital lambda
	2066	/ 110 H Paragraph
	3174	/ 111 I Upward arrow
	3134	/ 112 J Intersection
	2047	/ 113 K Section
	3127	/ 114 L Capital omega
	3136	/ 115 M Logical and
	3110	/ 116 N Is approximate to
	3176	/ 117 O Downard arrow
	0000	/ 120 P (Spare location rings bell to indicate error)
	3107	/ 121 Q Capital gamma
	3112	/ 122 R Capital theta
	3123	/ 123 S Capital sigma
	3175	/ 124 T Right arrow
	3130	/ 125 U Captial xi
	3101	/ 126 V Variation, proportional to
	3111	/ 127 W Similar or equal to
	3117	/ 130 X Identical to
	3131	/ 131 Y Capital upsilon
	3104	/ 132 Z Capital Delta
	0000	/ 133 [ --------------
	0000	/ 134 \ --------------
	0000	/ 135 ] --------------
	3043	/ 136 ^ Horizantal Connector
	3062	/ 137 _ Bottom left summation
	3064	/ 140 ` Bottom vertical summation connector
	3141	/ 141 a Small alpha
	3142	/ 142 b Small beta
	3161	/ 143 c Small psi
	3146	/ 144 d Small phi
	3145	/ 145 e Small epsilon
	3166	/ 146 f Function
	3154	/ 147 g Small lambda
	3150	/ 150 h Small eta
	3151	/ 151 i Small iota
	3135	/ 152 j Union
	3153	/ 153 k Small kapa
	3167	/ 154 l Small omega
	3137	/ 155 m Logical or
	3156	/ 156 n Small nu
	2060	/ 157 o Degree
	3162	/ 160 p Small rho
	3147	/ 161 q Small gamma
	3152	/ 162 r Small theta
	3163	/ 163 s Small sigma
	3164	/ 164 t Small tau
	3170	/ 165 u Small xi
	3113	/ 166 v Times, cross product
	3172	/ 167 w Small zeta
	3143	/ 170 x Small chi
	3171	/ 171 y Small upsilon
	3144	/ 172 z Small delta
	0000	/ 173 { ---------------
	0000	/ 174 | ---------------
	0000	/ 175 } ---------------
	3063	/ 176 ~ Top vertical summation connector
	0000	/ 177   Delete key is not allowed
	>

/			E N D    O F    T A B L E

/ ROUTINE TO VALIDATE AND EXTRACT A TECH CHARACTER CODE FROM THE TABLE

TECVAL,	XX			/ VALIDATE TECH CHARACTER
	JMS	BHOOK	/ HOOK to BLAST to
	TEC8VAL		/ check for 8 bit character comming in	/a233
	JMP	TEC8CH	/ No skip return if char was 8 bit		/A237

				/ Skip return if 7 bit was I/P		/A237
/ NEXT BIT DONE IN BLAST AS NO ROOM FOR IT HERE				/A237
/D237TEC7BIT,TAD	TECTMP		/ Get the character for translation	/a233
/D237	AND	P177		/ MASK OFF TO 7 BIT CHARACTER
/D237	TAD	(-41)		/ SUBTRACT OFF UNUSED CODES
	SPA			/ IS CHARACTER IN LEGAL RANGE?
	JMP I	TECVAL		/ NO, TAKE ERROR RETURN
	TAD	(TCMAP)		/ YES, COMBINE WITH TABLE ADDRESS
	DCA	TECTMP		/ STORE POINTER INTO MAP TABLE
	TAD I	TECTMP		/ PICK UP MAPED TECH CHARACTER CODE
	SNA			/ IS IT A VALID CHARACTER ?
	JMP I	TECVAL		/ NO, TAKE ERROR RETURN
	
TEC8CH,				/ HERE IF 8 BIT I/P. 			/A237
	SNA			/ AC=0 IF NOT IN 8 BIT TABLE		/A237
	JMP	TEC8RTN		/ IF SO, JUST RETURN			/A237

	DCA	TECTMP		/ STORE CHARACTER FOR LATER USE		/m233
	TAD	TECTMP		/ BUILD GRAPHIC SET SELECTION
				/ G1 = 61, G2 = 62, G3 = 63
	R3L			/ SELECTION CONTAINED IN AC 0 - 2
	AND	(3)		/ MASK OFF LOW ORDER BITS
	TAD	(60)		/ BUILD ASCII CHARACTER
	DCA	TECSET		/ STORE ASCII CHARACTER IN LIST
	TAD	TECTMP		/ GET SAVED TECH CHARACTER
	AND	P177		/ MASK FOR 7 BIT CHARACTER
	DCA	TECMAP		/ STORE ASCII CHARACTER IN LIST
	ISZ	TECVAL		/ BUMP TO NORMAL RETURN
TEC8RTN,JMP I	TECVAL		/ RETURN TO CALLER			/m233

TECTMP,	.-.			/ TEMPORARY LOCATION TO HOLD TECH CHARACTER
TECSET,	.-.			/ VALUE OF G SET FOR TECH CHARACTER
TECMAP,	.-.			/ VALUE OF MAPPED TECH CHARACTER

	X=.			/ INDICATE FIRST FREE LOCATION ON PAGE

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


	FIELD	5
	RELOC
	*0

/***************************************************************************
/****			   START OF OVERLAY				****
/***************************************************************************

	OV2NUM=OV2NUM+200 	/ NEW OVERLAY
	OVRBLK=OV2NUM%200+DLOEDO+36 / DISK BLOCK WHERE OVERLAY IS LOADED

	RELOC
	RELOC OVLAY2
	OV2NUM

/***************************************************************************
/ ALTERNATE INPUT LINE ROUTINE ENTRY POINT (RETURNS TO SEARCH OVERLAY)
/***************************************************************************

	OVAGET=	.-OVLAY2+OV2NUM	/ ALTERNATE GET OVERLAY ENTRY

ALTGET,	JMS	CLREOL		/ CLEAR TO END OF LINE AFTER PROMPT TEXT

ALTCLR,	CLA			/ SET UP FOR A CLEAR OPERATION
	DCA	GETLEN		/ CLEAR NUMBER OF CHARACTERS IN BUFFER

ALTNXT,	JMS	ALTCHR		/ GO GET CHARACTER FROM KEYBOARD
	DCA	GETTRM		/ SAVE THE CHARACTER JUST ENTERED BY USER

	TAD	GETTRM		/ PICK UP THE CHARACTER JUST ENTERED BY USER
	TAD	(-40)		/ COMBINE WITH SPACE CODE
	SZA CLA			/ IS CHARACTER A SPACE ?		/C189
	JMP	ALTNEG		/ NO, GO CHECK FOR A NEGATIVE VALUE

	TAD	(176)		/ YES, PICK UP GRAPHIC DISPLAY CHARACTER
	DCA	ALTMS2		/ STORE FOR GRAPHIC DISPLAY ROUTINE
	JMP 	ALTGRA		/ GO DISPLAY SPACE.			/C190

ALTNEG,	TAD	GETTRM		/ PICK UP THE CHARACTER JUST ENTERED BY USER
	SPA			/ CHECK FOR A REGULAR CHARACTER
	JMP	ALTCAS		/ IT'S MINUS, IT'S A SPECIAL CHARACTER

/ DISPLAY REGULAR TEXT CHARACTER

	JMS	ALTTST		/ CHECK FOR OVERFLOW			/A196
	TAD	GETTRM		/ GET CHARACTER ENTERED BY THE USER
	JMP	ALTOX2		/ SKIP OVER INITIAL JWAIT INSTRUCTION
ALTOX1,	CIFSYS			/ CHANGE TO SYSTEM FIELD
	JWAIT			/ WAIT FOR SIGNIFICANT EVENT

ALTOX2,	JMP	ALT8BF		/ Test for 8 bit 			/A228
/
/	Here because the char is NOT 8 bit
/
ALT7DP,	TAD	GETTRM		/ Get char back				/A228
	CIFSYS			/ CHANGE TO SYSTEM FIELD
	TTYOU			/ OUTPUT THE CHARACTER TO THE SCREEN
	JMP	ALTOX1		/ BUSY, GO WAIT SOME MORE
	JMP	ALTBUF		/ GO STORE CHARACTER IN MENU TEXT BUFFER


ALTCAS,	ZZCASE			/ CASE CHECK CHARACTER IN AC
	XXFTBL-1		/ CHARACTER TABLE.

/	EDPWFL; ALTRO		/ POWER FAIL CODE
/	EDRBCH; ALTRO		/ RUBOUT CHARACTER CODE
/	EDRBWD; ALTRW		/ RUB WORD CHARACTER CODE
/	EDNWLN; ALTCR		/ CARRIAGE RETURN CODE
/	EDTAB;  ALTTAB		/ TAB
/	EDRULR; ALTXIT		/ GOLD:RULER KEYS
/	EDPAGE; ALTCHK		/ PAGE KEY
/	EDCONT; ALTXIT		/ CONTINUE
/	EDADVN; ALTXIT		/ ADVANCE KEY
/	EDBKUP; ALTXIT		/ BACKUP KEY
/	EDSRCH; ALTXIT		/ SEARCH KEY
/	EDCONT; ALTXIT		/ CONTINUE SEARCH KEY
/	EDPSTE; ALTCHK		/ PASTE KEY
/	EDDO;   ALTXIT		/ DO KEY
/	EDENTR; ALTXIT		/ ENTER KEY
/	EDMENU; ALTXIT		/ GOLD:MENU KEY
/	EDRQSP;	ALTRQS		/ GOLD:SPACE (REQUIRED SPACE)
/	EDTC;	ALTTEC		/ TECHNICAL CHARACTER KEY
/	0

ALTBAD,	JMS	BEEPER		/ ELSE ERROR
	JMP 	ALTNXT		/ AND IGNORE RETURN

ALTTEC,	JMS	ALTCHR		/ GO GET A CHARACTER FROM THE USER
	SPA			/ CHECK FOR A COMMAND CODE
	JMP	ALTCAS		/ YES, IGNORE TECH CHAR KEY
	JMS	TECVAL		/ GO VALIDATE AND MAP TECH CHARACTER CODE
	JMP	ALTBAD		/ NOT A VALID KEY, GO REPORT THE ERROR
ALTFND,	TAD	TECTMP		/ PICK UP THE MAPPED TECH CHARACTER CODE
	CMA			/ MAKE IT NEGATIVE FOR SEARCH STRING
	DCA	GETTRM		/ SAVE CHARACTER FOR SEARCH
	TAD	TECMAP		/ GET THE MAPPED ASCII CHARACTER CODE
	DCA	ALTMS2		/ STORE FOR GRAPHIC DISPLAY ROUTINE
	TAD	TECSET		/ PICK UP THE GRAPHICS SET NUMBER
	TAD	(-62)		/ SUBTRACT OFF MIDDLE VALUE
	SZA			/ CHECK FOR G2 CHARACTER SET
	JMP	ALTTC1		/ NO, GO CONTINUE CHECK
	TAD	(7400)		/ YES, SET DEC MULTI NATIONAL SET
	JMP 	ALTSET		/ GO SAVE IT & DISPLAY GRAPHIC CHARACTER
ALTTC1,	SPA CLA			/ CHECK FOR G3 CHARACTER SET
	JMP	ALTTC2		/ NO, GO SET UP FOR THE G1 SET
	TAD	(7600)		/ YES, SET DEC TECHNICAL CHARACTER SET
	JMP 	ALTSET		/ GO SAVE IT & DISPLAY GRAPHIC CHARACTER
ALTTC2,	TAD	("B&77^100)	/ G1 SET, SET TO US ASCII CHARACTER SET
	JMP 	ALTSET		/ GO SAVE IT & DISPLAY GRAPHIC CHARACTER

ALTRQS,	TAD	(166)		/ REQUIRED SPACE. DISPLAY GRAPHIC BOTTOM "T"
	DCA	ALTMS2		/ STORE FOR GRAPHIC DISPLAY ROUTINE
	AC7777			/ GET EDIT BUFFER CHARACTER FOR SEARCH
	JMP 	ALTSAV		/ GO SAVE IT & DISPLAY GRAPHIC CHARACTER

ALTTAB,	TAD	("b&177)	/ TAB CHARACTER.  DISPLAY GRAPHIC "HT" CODE
	DCA	ALTMS2		/ STORE FOR GRAPHIC DISPLAY ROUTINE
	TAD	(ECTAB)		/ GET EDIT BUFFER CHARACTER FOR SEARCH
	JMP 	ALTSAV		/ GO SAVE IT & DISPLAY GRAPHIC CHARACTER

ALTCR,	TAD	("d&177)	/ CARRIAGE RETURN.  DISPLAY GRAPHIC "CR" CODE
	DCA	ALTMS2		/ STORE FOR GRAPHIC DISPLAY ROUTINE
	TAD	(ECNWLN)	/ GET EDIT BUFFER CHARACTER FOR SEARCH

ALTSAV,	DCA	GETTRM		/ SAVE CHARACTER FOR SEARCH
ALTGRA,	TAD	("0&77^100)	/ PICK UP GRAPHIC CHARACTER SET SELECTION
ALTSET,	DCA	ALTMS1		/ STORE FOR CHARACTER SET SELECTION

	JMS	ALTTST		/ CHECK FOR OVERFLOW			/A220
	JMS	MNUGET		/ GET VALUE OF LANGUAGE WORD
	MNLANG			/ LOCATION OF LANGUAGE WORD
	DCA	ALTMS3		/ SAVE WORD FOR SCREEN OUTPUT

	CIFMNU			/ CHANGE TO MENU FIELD
	JMS I	IOACAL		/ CALL SYSTEM DISPLAY ROUTINE
	0			/ USE DEFAULT OUTPUT ROUTINE
	ALTMSG			/ CONTROL STRING TO SELECT LANGUAGE
	ALTMS1			/ POINTER TO CHARACTER SET SELECTION CODE
	ALTMS2			/ ASCII CHARACTER TO BE OUTPUT
	ALTMS3			/ POINTER TO COPY OF LANGUAGE WORD

ALTBUF,	TAD	GETTRM		/ GET CHARACTER ENTERED BY THE USER
	JMS	ALTST1		/ SAVE CHARACTER IN MENU FIELD BUFFER
	ISZ	GETLEN		/ INCREMENT THE CHARACTER COUNTER
	JMP	ALTNXT		/ GO GET NEXT CHARACTER

/ TEST FOR OVERFLOW

ALTTST,	XX			/ CHECK FOR CHARACTER OVERFLOW
	AC0001			/ BUMP THE COUNT FOR THIS CHARACTER
	TAD	GETLEN		/ COMBINE WITH THE CHARACTER COUNT
	TAD	ALTLIM		/ COMPARE AGAINST THE LIMIT
	SMA CLA			/ OVERFLOW IF POSITIVE OR ZERO
	JMP	ALTBAD		/ ERROR - OVERFLOW HAS OCCURED
	JMP I	ALTTST		/ RETURN TO CALLER

/  SEE IF OK TO DO PAGE OR PASTE EXIT.

ALTCHK,	TAD	GETLEN		/ GET CURRENT LENGTH
	SZA CLA			/ ACC ZERO ?
	JMP	ALTBAD		/ NO, GO BEEP THE BUZZER --
/\	JMP	ALTXIT		/ YES, ALLOW EXIT --

ALTXIT,	JMS	ALTST1		/ STORE ZERO IN LAST LOCATION OF BUFFER
	JMP	OV2JRT		/ RETURN TO CALLER IN SEARCH OVERLAY

ALTMS1,	XX			/ CHARACTER SET SELECTION CODE
ALTMS2,	XX			/ ASCII CHARACTER TO BE OUTPUT
	0			/ TERMINATOR FOR ASCII STRING
ALTMS3,	XX			/ COPY OF LANGUAGE WORD FROM MENU

	X=.			/ INDICATE FIRST FREE LOCATION ON PAGE

/------------------------------
	PAGE

/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/  EXIT DISPATCH TABLE.
/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
XXFTBL,	EDPWFL; ALTRO		/ POWER FAIL CODE
	EDRBCH; ALTRO		/ RUBOUT CHARACTER CODE
	EDRBWD; ALTRW		/ RUB WORD CHARACTER CODE
	EDNWLN; ALTCR		/ CARRIAGE RETURN CODE
	EDTAB;  ALTTAB		/ TAB
	EDRULR; ALTXIT		/ GOLD:RULER KEYS
	EDPAGE; ALTCHK		/ PAGE KEY
	EDCONT; ALTXIT		/ CONTINUE
	EDADVN; ALTXIT		/ ADVANCE KEY
	EDBKUP; ALTXIT		/ BACKUP KEY
	EDSRCH; ALTXIT		/ SEARCH KEY
	EDCONT; ALTXIT		/ CONTINUE SEARCH KEY
	EDPSTE; ALTCHK		/ PASTE
/D189	EDDO;   ALTXIT		/ DO
	EDDO;   ALTBAD		/ DO		- DISABLE KEY FOR NOW	/A189
	EDENTR; ALTXIT		/ ENTER KEY
/D189	EDENTR; ALTBAD		/ ENTER KEY	- DISABLE KEY FOR NOW	/A189
	EDMENU; ALTXIT		/ GOLD:MENU KEY
	EDRQSP;	ALTRQS		/ GOLD:SPACE (REQUIRED SPACE)
	EDTC;	ALTTEC		/ TECHNICAL CHARACTER KEY
	0			/ END OF TABLE INDICATOR


/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ RUBOUT.
/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ALTRO,	JMS	ALTROR		/ CALL RUBOUT ROUTINE ONCE
	JMP	ALTNXT		/ GO GET NEXT CHARACTER

/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ RUBOUT WORD.
/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ALTRW,	JMS	ALTROR		/ DO A RUBOUT
	JMS	ALTGT1		/ PICK UP CHARACTER FROM MENU TEXT BUFFER
	TAD	(-40)		/ SUBTRACT VALUE FOR A SPACE
	SZA CLA			/ SITTING ON A BLANK?
	JMP	ALTRW		/ NO - DO RUBOUT AGAIN
	JMP	ALTNXT		/ YES - DONE, GO GET NEXT CHARACTER

/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/  DO SCREEN RUBOUT.
/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ALTROR,	XX			/ ROUTINE TO RUBOUT A CHARACTER
	AC7777			/ SET UP TO DECREMENT THE COUNT
	TAD	GETLEN		/ GET THE COUNT OF CHARACTERS ENTERED SO FAR
	SPA			/ CHECK FOR A ZERO COUNT
	JMP	ALTCLR		/ NONE, SO JUST IGNORE THE RUBOUT FUNCTION

	DCA	GETLEN		/ STORE THE DECREMENTED COUNT OF CHARACTERS
	CIFMNU			/ CHANGE TO MENU FIELD
	JMS I	IOACAL		/ CALL SYSTEM DISPLAY ROUTINE
	0			/ USE DEFAULT OUTPUT ROUTINE
	ALTRUB			/ CONTROL STRING TO RUBOUT FUNCTION
	JMP I	ALTROR		/ RETURN TO CALLER

ALTRUB,	TEXT '^R'		/ RUBOUT BY BAKSPACE-SPACE-BACKSPACE

/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/  SETUP ADDRESS VECTOR INTO MENU TEXT BUFFER.
/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ALTADR,	XX			/ ROUTINE TO SET THE BUFFER POINTER
	AC0001			/ SET THE ACCUMULATOR TO A VALUE OF ONE
	TAD	GETLEN		/ PICK UP THE CHARACTER COUNT
	TAD	(MNIBUF-1) 	/ ADD TO THE USER'S BUFFER ADDRESS
	JMP I	ALTADR		/ RETURN TO CALLER

/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/  STORE CHARACTER IN THE MENU TEXT BUFFER.
/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ALTST1,	XX
	DCA	T1		/ SAVE ACCUMULATOR FOR NOW.
	JMS	ALTADR		/ COMPUTE CURRENT ADDRESS
	DCA	ALTS04		/ SAVE ADDRESS.
	TAD	T1		/ RESTORE ACCUMULATOR
	JMS	MNUPUT		/ SAVE IN MENU BUFFER
ALTS04,	.-.
	JMP I	ALTST1

/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/  GET CHARACTER FROM MENU TEXT BUFFER.
/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ALTGT1,	XX
	JMS	ALTADR		/ COMPUTE CURRENT ADDRESS
	DCA	ALTG04		/ SAVE ADDRESS.
	JMS	MNUGET		/ SAVE IN MENU BUFFER
ALTG04,	.-.
	JMP I	ALTGT1

/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/  GET CHARACTER FROM KEYBOARD BUFFER.
/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ALTCHR,	XX			/ GET CHARACTER FROM USER
	JMP	ALTINP		/ SKIP OVER JWAIT INSTRUCTION

ALTWAT,	CIFSYS			/ CHANGE TO SYSTEM FIELD
	JWAIT			/ WAIT FOR SIGNIFICANT EVENT

ALTINP,	CIFSYS			/ CHANGE TO SYSTEM FIELD
	XLTIN			/ GET A CHARACTER FROM THE KEYBOARD
	JMP 	ALTWAT		/ NONE THERE, GO WAIT FOR SOME
	JMP I	ALTCHR		/ RETURN TO CALLER

ALTMSG,	TEXT '![(&^S^A![(&^S'	/ CONTROL STRING FOR GRAPHICS OUTPUT


ALT8BF,	AND	(200)		/ Check 8th bit				/A228
	SNA CLA			/ 					/A228
	JMP 	ALT7DP		/ 7 bit job display and Insert it	/A228
	TAD	(62)		/ Its 8 bit so must be MNC		/A228
	DCA	TECSET		/ Pretend its a tech			/A228
	TAD	GETTRM			/ Get char				/A228
	AND	P177		/ Strip 8th bit				/A228
	DCA	TECMAP		/ Store it				/A228
	TAD	TECMAP		/ Get it back				/A228
	TAD	(2000)		/ Set precedence of 2			/A228
				/ We can now rejoin main code as if we 	/A228
				/ had found a Tech Char  and set up the	/A228
				/ things that TECVAL would do !		/A228
	JMP	ALTFND

	X=.			/ INDICATE FIRST FREE LOCATION ON PAGE

/------------------------------

	PAGE


/***************************************************************************
/****			   START OF OVERLAY				****
/***************************************************************************

	OV2NUM=OV2NUM+200 	/ NEW OVERLAY
	OVRBLK=OV2NUM%200+DLOEDO+36 / DISK BLOCK WHERE OVERLAY IS LOADED

	RELOC
	RELOC OVLAY2
	OV2NUM
/
/ THIS IS A CONTINUATION OF OVVIEW.
/ IT IS A LOOP THAT PUTS UP THE VIEW MODE SCREEN.
/

	OVVWB1=	.-OVLAY2+OV2NUM

/ COPY VARIABLES FROM LAST OVERLAY TO THIS OVERLAY
/ FROM SUBR ENTRY POINTS USED AS TEMP VARIABLES ACROSS OVLJMP

/D219	TAD I	ADVSPC&177
	TAD	VWX1							/A219
	DCA	VIEWX1
/D219	TAD I	BKPSPC&177
	TAD	VWX2							/A219
	DCA	VIEWX2
	/
	TAD	CURPTR		/ SAVE CURRENT TEXT PTR
	DCA	VIEWCP
	/
	/ DISPLAY NEXT TEXT LINE
	/
VIEWB1,	JMS	VIEWAC 		/ POSITION CURSOR AT NEXT TEXT LINE
	TAD I	VIEWX1
	DCA	CURPTR 		/ SET TO START OF LINE
	JMS	LODCHR
	JMP	VIEWB2 		/ QUIT IF EOF
	/
	/ DISPLAY NEXT TEXT LINE
	/
VIEWB3,	JMS	VIEWLK 		/ LOOK UP IN SPECIAL TABLE
	JMP	VIEWB4 		/ JUMP IF NORMAL (NOT IN TABLE)
	SNA			/ AC=SPECIAL GRAPHICS CHAR TO DISPLAY
	JMP	VIEWB5 		/ JUMP IF IGNORE CHAR
	DCA	VIEWTP 		/ ELSE SAVE TYPE
	TAD	VIEWTP 		/ CHECK FOR PAGE-RULER
	RAL
	SMA CLA
	JMP	VIEWB6 		/ JUMP IF NOT
	TAD	VIEWX3 		/ PAGES AND RULERS
	SZA CLA
	JMP	VIEWC1 		/ QUIT IF NOT WHOLE LINE
	TAD	VIEWTP
	RTL
	SMA CLA
	JMP	VIEWPG 		/ JUMP IF PAGE
	JMS	DSPRLN 		/ ELSE DO RULER
	JMP	VIEWC1 		/ AND QUIT


/D190	JMS	VWMODE
/D190	IFDEF	ENGLSH	<
/D190	IFNDEF	ENGCAN	<
/D190	"B&177 			/ LEAVE GRAPHICS MODE
/D190			>	/ END IFNDEF ENGCAN
/D190	IFDEF	ENGCAN	<
/D190	"3-200
/D190			>	/ END IFDEF ENGCAN
/D190			>	/ END ENGLSH
/D190	IFDEF	CANADA	<
/D190	"3-200
/D190			>	/ END IFDEF CANADA
/D190	IFDEF	FRENCH	<
/D190	"R-200
/D190			>	/ END IFDEF FRENCH
/D190	IFDEF	DUTCH	<
/D190	"4-200
/D190			>	/ END IFDEF DUTCH

VIEWB4,	CDFBUF			/ PUT NORMAL CHAR
	TAD I	CURPTR
	DCA	VIEWTP		/ SAVE IN TEMP.
	TAD	VIEWTP		/ GET BACK.
	AND	P177		/ CHECK FOR TAB CHARACTER.
	TAD	LITV01		/  ...
	SNA CLA			/ SKIP IF NOT TAB.
	JMP	VIEWB8		/ JMP TO PROCESS THE TAB CHARACTER.
	/
	/ NOW CONSIDER WHAT TO DISPLAY BELOW TEXT CHAR.
	/ IF CHAR WAS A "REQUIRED SPACE", THEN DISPLAY A "^" UNDERNEATH;
	/ ELSE ATTRIBUTES WILL DETERMINE CHAR BELOW.
	/
	TAD	VIEWTP		/ GET TEXT CHAR
	TAD	(-ECSTOV)	/ WAS CHAR AN OVERSTRIKE SEQUENCE?
	SNA CLA								/M231
	JMP	VIEWBZ		/ Dead , find out what type bypass test	/A231
	JMP	VIEWBA		/ Not dead , display text char		/A231
/d231	TAD	PUTSC6		/ YES: WAS IT REALLY A REQUIRED SPACE?
/d231	AND	P177		/   (IGNORE ATTRIBUTES)
/d231	TAD	(-ECSPC)
/d231	SZA CLA
/d231	JMP	VIEWBA		/ NOT REQ SPC , CHECK MCS		

/
/	We are here because we found a required space
/

VIEWSP,	TAD	VIEWTP		/ GET CHARACTER TO OUTPUT BACK.		/A231
	JMS	PUTSCH		/ DISPLAY TEXT CHAR			/A231
	TAD	("^&177+4000)	/ YES: DISPLAY "^" BELOW REQUIRED SPACE
	JMP	VIEWB9

	/ SHOW ATTRIBUTES (SUPERSCRIPT, SUBSCRIPT, "BREAKING", AND
	/ REDUNDANT BOLD) BENEATH TEXT CHAR.
	/

VIEWBA,	TAD	VIEWTP		/ GET CHARACTER TO OUTPUT BACK.		/M231
	JMS	PUTSCH		/ DISPLAY TEXT CHAR			/M231
	JMP	VIEWBC		/ And now attributes			/M231
VIEWBB,
	CDFMYF			/ Rejoined here from VIEWBZ so change	/A231
				/ back to buffer field			/A231
	DCA	VIEWTP		/ Save char with attributes		/A231


VIEWBC,	TAD	VIEWTP		/ GET CHAR BACK (FOR ATTRIBUTE BITS)
	RAR
	BSW
	AND	(17)
	TAD	(VIEWTD)
	DCA	T1
	TAD I	T1
	SNA
	JMP	VIEWB7		/ DON'T BOTHER WITH SPACES.
VIEWB9,	DCA	ATR		/ AND OUTPUT IT (ON THE NEXT LINE).
	PUTESC			/  ...
		"[&177+4000	/ "CURSOR DOWN"
		"B&177+4000	/  ...
		10+4000		/ "BACK SPACE"
ATR,		0+4000		/ THE ATTRIBUTE OF CHARACTER (OR "^")
		33+4000		/ "CURSOR UP".
		"[&177+4000	/  ...
		"A&177		/   ....
VIEWB7,	JMS	VIEWAD 		/ BUMP COUNTER
	JMP	VIEWC1 		/ JUMP IF DONE
VIEWB5,	ADVSPC
	JMP	VIEWB2 		/ ELSE ADVANCE PTR
	JMP	VIEWB3 		/ AND LOOP

VIEWB8,	TAD	VIEWTP		/ GET THE TAB BACK (WITH ATTRIBUTES)
	TAD	LITV02		/ TRANSLATE TO GRAPHICS
VIEWB2,	TAD	(4000+EXGETX) 	/ ETX SYMBOL
	DCA	VIEWTP

/D190	JMS	VWMODE
/D190	"0-200 			/ ENTER GRAPHICS MODE

VIEWB6,	CDFMYF			/					/A192
	PUTESC			/ ENTER GRAPHICS MODE			/A192
	"(+3600			/					/A192
	"0-200			/					/A192
	TAD	VIEWTP 		/ GET CHAR
	JMS	PUTSCH
	JMS	MNUGET		/ PICK UP CURRENT LANGUAGE WORD		/A192
	MNLANG			/ LOCATION FOR LANGUAGE WORD		/A192
	SMA			/ SKIP IF A NUMBER CODE			/A192
	IAC			/ CONVERT TO UPPER CASE ASCII		/A192
	BSW			/ PUT BITS INTO PROPER ORDER		/A192
	DCA	VWLNG		/ STORE IN LINE FOR PUTESC ROUTINE	/A192

	PUTESC
	"(+3600
VWLNG,	"0			/ OVERLAYED WITH LANGUAGE CODE VALUE	/A224


	TAD	VIEWTP 		/ CHECK FOR END
	SMA CLA
	JMP	VIEWB7 		/ JUMP IF NOT

/D190	JMS	VWMODE
/D190	IFDEF	ENGLSH	<
/D190	IFNDEF	ENGCAN	<
/D190	"B-200 			/ LEAVE GRAPHICS MODE
/D190			>	/ END IFNDEF ENGCAN
/D190	IFDEF	ENGCAN	<
/D190	"3-200
/D190			>	/ END IFDEF ENGCAN
/D190			>	/ END IFDEF ENGLSH
/D190	IFDEF	CANADA	<
/D190	"3-200
/D190			>	/ END IFDEF CANADA
/D190	IFDEF	FRENCH	<
/D190	"R-200
/D190			>	/ END IFDEF FRENCH
/D190	IFDEF	DUTCH	<
/D190	"4-200
/D190			>	/ END IFDEF DUTCH

VIEWC1,	JMP	VIEWD1 		/ GET FIRST CHAR

LITV01,	-ECTAB
LITV02,	EXGTAB-ECTAB-4000-EXGETX

VIEWX1,	0 			/ -(# OF TEXT BUF LINES LEFT TO DISPLAY)
VIEWX2,	0 			/ PTR INTO PTRBLK FOR CURRENT DISPLAY LINE
VIEWX3,	0 			/ CURRENT COLUMN #
VIEWCP,	0 			/ SAVED CURPTR
VIEWTP,	0 			/ CURRENT CHARACTER BEING DISPLAYED

	OVRLOF=	.-OVLAY2+OV2NUM							
	JMP	RLONOF							/A192

	X=.			/ INDICATE FIRST FREE LOCATION ON PAGE
/---------------------
	PAGE

VIEWPG,	CDFBUF 			/ GET CHAR BACK
	TAD I	CURPTR
	JMS I	TLITEA 		/ PUT PROPER PAGE MARKER
	JMP	VIEWC1 		/ AND QUIT

TLITEA,	PGECHO 			/ **TEMP FOR OS/ 8 LIT POOL LIMIT BYPASS

/
/ SET LOOP COUNTER AND CURLIN AND CURSOR POSITION
/
VIEWAC,	XX
	CDFMYF
	TAD	VIEWX2 		/ GET LINE LOOP COUNTER
	STL RAL 		/ TIMES 2, +1
	DCA	CURLIN 		/ =LINE NUMBER FOR PCUR
	DCA	VIEWX3 		/ CLEAR CHAR LOOP COUNTER
	JMS	PCUR 		/ MOVE CURSOR TO START OF LINE
	JMP I	VIEWAC 		/ AND RETURN


/
/ TEST LOOP COUNTER, TAKE SKIP RTN IF NOT DONE
/
VIEWAD,	XX
	CDFMYF
	ISZ	VIEWX3 		/ BUMP COUNTER
	TAD	WIDNAR		/ WIDE SCREEN MODE?			/M192
	SNA CLA			/ SKIP IF NOT. COMPUTE MAX NARO WIDTH	/M192
	TAD	(-WIDTH+COLM81)	/ COMPUTE MAX WIDE WIDTH
	TAD	(-COLM81)	/ COMPUTE MAX NARO WIDTH
	TAD	LOWLIM		/ Bais by start colm #.
	TAD	VIEWX3		/ SEE IF WITHIN LINE
	SPA CLA			/ SKIP IF YES.
	ISZ	VIEWAD		/ SKIP RETURN WHEN DONE
	JMP I	VIEWAD

/D190	/ SUBR VWMODE -- ENTER/EXIT GRAPHICS MODE.
/D190	/ DOES NOT OUTPUT REDUNDANT ESCAPE SEQUENCES.
/D190	/ CHANGED TO PUT OUT "(" BEFORE CHARACTER FOR VT-278.
/D190	/
/D190	/ CALL:
/D190	/	/ AC & DF DON'T MATTER
/D190	/	JMS	VWMODE
/D190	/	CHAR			/ ASCII CODE OF CHAR TO OUTPUT
/D190	/
/D190	VWMODE,	XX
/D190		CLA
/D190		CDFMYF
/D190		TAD I	VWMODE
/D190		CIA
/D190		TAD	VWMOD1
/D190		SNA CLA
/D190		JMP	VWMOD2
/D190		TAD I	VWMODE
/D190		DCA	VWMOD1
/D190		PUTESC
/D190		"(+3600
/D190	VWMOD1,	.-.
/D190	VWMOD2,	ISZ	VWMODE
/D190		JMP I	VWMODE

VIEWD1,	CDFMYF
	ISZ	VIEWX1 		/ BUMP LINE PTR
	ISZ	VIEWX2 		/ AND COUNTER
	JMP	VIEWB1 		/ LOOP IF MORE LINES TO DO
	TAD	VIEWCP		
	DCA	CURPTR 		/ ELSE RESTORE CURPTR

	TAD	CURTMP		/ RESTORE CURSOR POSITION
	DCA	CURSOR

	OVLJMP
		OVVWDX

VIEWLK,	XX 			/ LOOK UP FOR SPECIALS
	CDFMYF
	AND	(7777-200) 	/ IGNORE BOLD BIT
	DCA	T1
	TAD	(VIEWTB-1)
	DCA	X0 		/ INIT TABLE SEARCH PTR
VIEWL1,	TAD I	X0
	SNA
	JMP I	VIEWLK 		/ ZERO MARKS END (NOT SPECIAL)
	TAD	T1 		/ COMPARE
	SZA CLA
	JMP	VIEWL1 		/ LOOP IF NOT EQUAL
	TAD	(VIEWTC-VIEWTB) / ELSE GET VALUE
	TAD	X0
	DCA	T1
	TAD I	T1
	SMA SZA
	TAD	CHRATR		/ ADD ATTRIBUTES TO SOFT SPACES
	ISZ	VIEWLK 		/ BUMP TO OK RETURN
	JMP I	VIEWLK 		/ AND TAKE IT

VIEWTB,				/ LOOK UP TABLE
	-ECMDFL 		/ LINE MOD FLAG
	-ECNWLN 		/ NEW LINE
	-ECWWLN 		/ WORD WRAP
	-ECHYLN 		/ HYPH WRAP
	-ECPGRF 		/ END PARA
	-ECENLN 		/ CENTERED LINE
	-ECSLPT 		/ SELECT POINT
	-ECNWPG 		/ NEW PAGE
	-ECPMRK 		/ PAGE MARKER
	-ECPCT1 		/ START PRINT CONT.
	-ECPCT2 		/ END PRINT CONT.
	-ECSTRL 		/ RULER START
	-ECJSPC 		/ JUSTIFY SPACE
VIEWTC,	0 			/ *** BELONGS TO TWO TABLES:
				/ VIEWTB: END OF TABLE
				/ VIEWTC: VALUE FOR ECMDFL
/ FLAG BITS USED IN VIEWTC:
/	4000=END OF LINE
/	6000=PAGE
/	7000=RULER

	4000+EXGNLN 		/ NEW LINE (CR)
	4000+EXGWLN 		/ WORD WRAPPED LINE (DEGREE)
	4000+EXGHLN 		/ HYPH WRAPPED (-)
	4000+EXGPGF 		/ PARA (T)
	4000+EXGCEN 		/ CENTERED LINE (+)
	4000+EXGSLC 		/ SELECT POINT (SOLID DIAMOND)
	6000
	6000
	6000
	6000
	7000
	EXGJSP

/
/ VIEWTD -- ATTRIBUTE TRANSLATE TABLE
/
/ TABLE VIEWTD IS INDEXED BY THE ATTRIBUTE FIELD OF THE
/ CURRENT CHAR (BITS 1-4).
/ VIEWTD CONTAINS THE CHARACTER THAT APPEARS DIRECTLY BELOW
/ EACH DOCUMENT CHARACTER IN VIEW MODE TO REVEAL THE
/ ATTRIBUTES OF THE DOCUMENT CHARACTER.
/
VIEWTD,				/ ATTRIBUTE TRANSLATE TABLE
	0			/ " " - NO ATTRIBUTE
	0			/ " " - BOLDED - NO SPECIAL CHAR
	0			/ " " - UNDERLINED - NO SPECIAL CHAR
	0			/ " " - BOLD & UNDERLINED - NO SPEC CHR

	IFNDEF	FRENCH	<
	"Q&177+40+4000 		/ "q" - SUPERSCRIPT
	"Q&177+4000 		/ "Q" - BOLDED SUPERSCRIPT
	"A&177+40+4000 		/ "a" - SUBSCRIPT
	"A&177+4000 		/ "A" - BOLDED SUBSCRIPT
			>	/ END IFNDEF FRENCH

	IFDEF	FRENCH	<
	"A+40+4000 		/ "a" - SUPERSCRIPT
	"A+4000 		/ "A" - BOLDED SUPERSCRIPT
	"Q+40+4000 		/ "q" - SUBSCRIPT
	"Q+4000 		/ "Q" - BOLDED SUBSCRIPT
			>	/ END IFDEF FRENCH

	"/&177+4000 		/ "/" - HYPHEN
	"/&177+4000 		/ "/" - HYPHEN & BOLDED
	"/&177+4000 		/ "/" - HYPHEN & UNDERLINED
	"/&177+4000 		/ "/" - HYPHEN, UNDERLINED, & BOLDED

	IFNDEF	FRENCH	<
	"Q&177+40+4000 		/ "q" - HYPHEN & SUPERSCRIPT
	"Q&177+4000 		/ "Q" - HYPHEN & BOLDED SUPERSCRIPT
	"A&177+40+4000 		/ "a" - HYPHEN & SUBSCRIPT
	"A&177+4000 		/ "A" - HYPHEN & BOLDED SUBSCRIPT
			>	/ END IFNDEF FRENCH

	IFDEF	FRENCH	<
	"A+40+4000 		/ "a" - HYPHEN & SUPERSCRIPT
	"A+4000 		/ "A" - HYPHEN & BOLDED SUPERSCRIPT
	"Q+40+4000 		/ "q" - HYPHEN & SUBSCRIPT
	"Q+4000 		/ "Q" - HYPHEN & BOLDED SUBSCRIPT
			>	/ END IFDEF FRENCH



/ +++	WE JUST GOT CALLED FROM EITHER OVINIT OR OVMENU IN OVERLAY #1	/A177
/									/A177
/	THIS ROUTINE IS CALLED FROM OVINIT AND OVMENU TO CHECK		/A177
/	THE MNSTAT (EDITOR STATUS WORD) AND MODIFY THE CASE-TABLE	/A177
/	AT RULOFF (IN WPEDIT) SUCH THAT RULERS ARE EITHER ON OR OFF	/A177
/									/A177
/	MNSTAT = 0 OR 1	... RULERS ON					/A177
/	MNSTAT = 2 OR 3 ... RULERS OFF					/A177
/									/A177

RLONOF,	JMS	MNUGET		/ GET THE EDITOR-STATUS-WORD		/A177
	 MNSTAT								/A177
	TAD	(-2)							/A177

	CLA			/ (FORCE RULERS TO BE ON ALL THE TIME)
/D177	SPA	CLA		/ RULERS ON OR OFF?			/A177
	TAD	(PUTLNR-PUTLN3)	/ ...ON...				/A177
	TAD	(PUTLN3)	/ ...OFF..				/A177
	DCA	RULOFF		/ MODIFY THE TABLE			/A177
	JMP	OV2JRT		/ RETURN TO OVERLAY 2 JUMP ROUTINE	/A177

	X=.			/ INDICATE FIRST FREE LOCATION ON PAGE
/---------------------
	PAGE

/***************************************************************************
/****			   START OF OVERLAY				****
/***************************************************************************

	OV2NUM=OV2NUM+200
	OVRBLK=OV2NUM%200+DLOEDO+36 / DISK BLOCK WHERE OVERLAY IS LOADED

	RELOC
	RELOC OVLAY2
	OV2NUM

	OVSLID=	.-OVLAY2+OV2NUM	/ SOLIDIFY TEXT ENTRY

	JMP	ESOLID

	OVSOFT=	.-OVLAY2+OV2NUM	/ SOFTEN TEXT ENTRY

	JMP	ESOFT

	OVDCEL=	.-OVLAY2+OV2NUM	/ FIND NEXT SEGMENT PROCESSING

DOCCEL,	CDFBUF
	TAD I	CURPTR
	JMP	DOCC21
DOCC22,	ADVPTR				/FIND THE EOL MARK
	HLT				/SHOULDN'T HAPPEN TO A DOG
DOCC21,	AND	P177
	TAD	(-ECNWLN)
	SZA CLA
	JMP	DOCC22			/NOT FOUND YET

	TAD I	CURPTR			/CHECK IT BETTER BE A HARD RETURN
	TAD	(-ECNWLN)
	SZA CLA
	JMP	GODOER			/ERROR WRAP RETURN
DOCC17,	AC0001				/FORWARD TO BEGINNING OF NEXT LINE
	CURMOV
	NOP				/DON'T CAR ABOUT EOF
	TAD	CURPTR			/SAVE CURRENT PTR
	DCA	IX1
	TAD	LINE23			/FIND OUT WHAT PREVIOUS LINE ENDER
	DCA	CURPTR			/WAS
	BKPPTR
	HLT				/CAN'T HAPPEN
	TAD	(-ECNDRL)		/END RULER?
	SNA CLA
	JMP	GODOER			/YES ERROR
	TAD	IX1			/RESTORE PTR
	DCA	CURPTR
	TAD I	CURPTR			/CHECK IF SKIPPING IS NECESSARY
	AND	P177			/STRIP MODE BITS
	TAD	(-ECNWPG)		/SKIP PAGE MARKS CONTROL BLOCKS ETC.
	SNA CLA
	JMP	DOCCPG			/GO CHECK IT OUT

DOCC13,	CDFMYF
	TAD	CLMPLL			/CHECK FOR LOWER LIMIT OF COLUMN
	CIA				/<=CURSOR
	TAD	CURSOR
	SMA CLA
	JMP	DOCC18			/YES GO EXECUTE

DOCC14,	JMS	LODCHR			/GET CHAR UNDER PTR
	HLT				/CATASTROPHIC ERROR
	AND	P177			/CHECK FOR TAB OR EOL
	ZZCASE
	DCCTB3-1

/	ECTAB;	DOCC15			/TAB DO LIMIT CHECK
/	ECNWLN;	GODO11			/NEWLINE DO EMPTY COLUMN
/	ECMDFL;	DOCC16			/MODIFIED FLAG SKIP
/	ECSTRL;	GODOER			/START RULER ERROR
/	ECNWPG;	GODOER			/NEW PAGE ERROR
/	0

	ISZ	CURSOR			/BUMP CURSOR
DOCC16,	ADVSPC				/TRY NEXT CHARACTER
	HLT
	JMP	DOCC14

DOCC15,	AC0001				/FIND FIRST CHAR OF COLUMN
	CURMOV
	HLT
	JMP	DOCC13			/GO CHECK BOUNDARIES

DOCC18,	OVLJMP				/GO TRY NEXT COLUMN
	OVDOCC


/	DOCCPG	DO PAGE AND CONTROL BLOCK HANDLING
/
/

DOCCPG,	TAD I	CURPTR		/GET CHARACTER AND CHECK TYPE
	ZZCASE
	DCCTB4-1

/	ECNWPG;	DOCC17		/NEW PAGE CHECK NEXT LINE
/	ECPMRK;	DOCC17		/PAGE MARK GO CHECK NEXT LINE
/	ECPCT1;	DCPG01		/CONTROL BLOCK SKIP
/	ECPCT2;	GODOER		/END CONTROL BLOCK IS ERROR
/	0

	HLT			/SHOULD NOT BE ABLE TO GET HERE

DCPG01,	CDFMYF
	DCA	SETRUL		/SET FLAG TO FIND OUT IF RULER PASSED

DCPG02,	AC0001			/SEARCH FOR END CONTROL
	CURMOV
	HLT
	TAD I	CURPTR		/CHECK FOR END CONTROL AND SELECT POINT
	TAD	(-ECPCT2)
	SNA
	JMP	DCPG03		/END CONTROL FOUND BREAK OUT
	TAD	(ECPCT2-ECSLPT)
	SZA
	JMP	DCPG02		/NOT THIS TIME CHARLEY
	
	DCA I	CURPTR		/DELETE SELECT POINT
	SLNMOD			/SET LINE MODIFIED
	JMS	REJUST		/REJUSTIFY THE LINE
	JMP	EIFIX		/DONE

DCPG03,	CDFMYF
	TAD	SETRUL		/RULER PASSED?
	SNA CLA
	JMP	DOCC17		/NO GO DO NEXT COLUMN
	JMS	BEEPER		/DIE YOU GRAVY SUCKING PIG
	JMP	UNSLCT

/	GODO11	-  SELECT OR END OF LINE DETECTED

GODO11,	TAD I	CURPTR		/PICK UP THE BUFFER CHARACTER		/A221
	TAD	(-ECNWLN)	/COMPARE AGAINST END OF LINE		/A221
	SZA CLA			/IS THIS A REAL END OF LINE		/A221
	JMP	GODOSE		/NO, GO HANDLE SELECT ERROR		/A221
	OVLJMP			/OVERLAY TRANSFER TO DOCC11
	OVDC12								/C203

/	GODOSE  -  SELECT MARK ERROR DETECTED ON TEXT LINE		/A221

GODOSE,	TAD	LINE23		/PICK UP BEGINNING OF LINE POINTER	/A221
	JMP	GODOBP		/GO STORE BUFFER POINTER		/A221

/	GODOER	-  ERROR CONDITION DETECTED

GODOER,	TAD	IX1		/PICK UP THE SAVED BUFFER POINTER
GODOBP,	DCA	CURPTR		/RESET THE BUFFER POINTER		/C221
	OVLJMP			/OVERLAY TRANSFER TO DOCCER
	OVDOER

/	COLUMNAR CUT CASE TABLES
/
/

DCCTB3,	ECTAB;	DOCC15		/TAB DO LIMIT CHECK
	ECNWLN;	GODO11		/NEWLINE DO EMPTY COLUMN
	ECMDFL;	DOCC16		/MODIFIED FLAG SKIP
	ECSTRL;	GODOER		/START RULER ERROR
	ECNWPG;	GODOER		/NEW PAGE ERROR
	0

DCCTB4,	ECNWPG;	DOCC17		/NEW PAGE CHECK NEXT LINE
	ECPMRK;	DOCC17		/PAGE MARK GO CHECK NEXT LINE
	ECPCT1;	DCPG01		/CONTROL BLOCK SKIP
	ECPCT2;	GODOER		/END CONTROL BLOCK IS ERROR
	0

	X=.
/---------------------
	PAGE

/	ESOLID	SOLIDIFY TEXT BY REPLACINF SOFT RETURNS
/
/

ESOLID,	TSTSLT
	JMP	EIBAD
SOLID1,	CDFBUF
	TAD I	CURPTR
	JMP	SOLID2
SOLID3,	ADVSPC
	JMP	EIBAD
SOLID2,	ZZCASE
	SLIDTB-1

/	ECNWLN;	SOLID4		/ HARD RETURN DO NOTHING
/	ECPGRF;	SOLID4		/ PARA. MARK DO NOTHING
/	ECENLN;	SOLID4		/ CENTER DO NOTHING
/	ECWWLN;	SOLID5		/ WORD WRAP SOLIDIFY
/	ECHYLN;	SOLID5		/ HYPHEN WRAP SOLIDIFY
/	ECSLPT;	SDSFEX		/ SELECT POINT DELETE AND EXIT
/	ECMDFL;	SOLID7		/ MODIFIED FLAG EXECUTE
/	ECRMFL;	SOLID7		/ DITTO
/	ECSTRL;	SOLID4		/ SKIP RULERS
/	ECPMRK;	SOLID4		/ SKIP PAGE MARKS
/	ECPCT1;	SOLID4		/ SKIP PRINT CONTROL
/	ECPCT2;	SOLID4		/ DITTO
/	ECNWPG;	SOLID4		/ SKIP NEW PAGE
/	0

	ISZ	CURSOR		/ BUMP CURSOR TO REFLECT
	CURMOV			/ KEEP CURMOV HAPPY
	JMP	EIBAD		/ CATASTROPHIC ERROR
	JMP	SOLID3		/ DO NEXT CHAR

SOLID5,	TAD	(ECNWLN)		/ SOLIDIFY LINE ENDER
	DCA I	CURPTR

SOLID4,	AC0001
	CURMOV
	JMP	EIBAD
	JMP	SOLID1

SOLID7,	CURMOV			/ REJUSTIFY ON FLAG
	JMP	EIBAD
	JMP	SOLID1		/ FETCH CHAR DIRECT

/	ESOFT	SOFTEN TEXT BY REPLACING HARD RETURNS
/
/

ESOFT,	TSTSLT
	JMP	EIBAD
	CDFBUF
	JMP	SOFT2
SOFT3,	AC0001
	CURMOV
	JMP	EIBAD
SOFT2,	TAD I	CURPTR
	TAD	(-ECNWLN)
	SNA
	JMP	SOFT5
	TAD	(ECNWLN-ECSLPT)
	SZA CLA
	JMP	SOFT3

SDSFEX,	TAD	(ECMDFL)		/ PUT MODIFIED FLAG IN TO
	DCA I	CURPTR		/ DELETE SELECT POINT
	DCA	EDMODE		/ RESET EDIT MODE
	JMP	EIFIX		/ GO GET NEXT COMMAND

SOFT5,	TAD	(ECMDFL)		/ SOFTIFY LINE ENDER
	DCA I	CURPTR
	CURMOV
	JMP	EIBAD
	JMP	SOFT2

/	SOLIDIFY AND SOFTEN TEXT CASE TABLES
/
/
SLIDTB,	ECNWLN;	SOLID4		/ HARD RETURN DO NOTHING
	ECPGRF;	SOLID4		/ PARA. MARK DO NOTHING
	ECENLN;	SOLID4		/ CENTER DO NOTHING
	ECWWLN;	SOLID5		/ WORD WRAP SOLIDIFY
	ECHYLN;	SOLID5		/ HYPHEN WRAP SOLIDIFY
	ECSLPT;	SDSFEX		/ SELECT POINT DELETE AND EXIT
	ECMDFL;	SOLID7		/ MODIFIED FLAG EXECUTE
	ECRMFL;	SOLID7		/ DITTO
	ECSTRL;	SOLID4		/ SKIP RULERS
	ECPMRK;	SOLID4		/ SKIP PAGE MARKS
	ECPCT1;	SOLID4		/ SKIP PRINT CONTROL
	ECPCT2;	SOLID4		/ DITTO
	ECNWPG;	SOLID4		/ SKIP NEW PAGE
	0

	X=.
/---------------------
	PAGE

/***************************************************************************
/****			   START OF OVERLAY				****
/***************************************************************************

	OV2NUM=OV2NUM+200 	/ NEW OVERLAY
	OVRBLK=OV2NUM%200+DLOEDO-1+37 / DISK BLOCK WHERE OVERLAY IS LOADED

	RELOC

	RELOC OVLAY2
	OV2NUM

/	DOCLPS	DO COLUMN PASTE
/
/	PASTE CHARACTERS INTO THE TEXT BUFFER UNTIL THE PASTE BUFFER IS
/	EMPTY, OR THE END OF A LINE SEGMENT IS REACHED, OR AN ILLEGAL
/	CHARACTER IS FOUND IN THE PASTE BUFFER.

	OVDOPS=	.-OVLAY2+OV2NUM

DOCLPS,	CDFBUF
	TAD I	PSTPTR		/GET CHAR FROM PASTE BUFFER
	SNA			/ZERO IS END OF PASTE BUFFER		/M215
				/(SHOULDN'T HAPPEN HERE)		/M215
	JMP	EIFIX		/DONE NO MORE TO PASTE			/M215

DCP001,	AND	P177		/STRIP MODE BITS
	ZZCASE			/COMPARE AGAINST LIST
	CLPTB1-1

/	ECNWLN;	DCP002		/END OF SEGMENT
/	ECNWPG;	DCP003		/ILLEGAL CHAR TO PASTE DUMP TEXT
/	ECSTRL;	DCP021		/START OF RULER, SKIP TO END OF RULER
/	0

	TAD I	PSTPTR		/RETRIEVE CHAR
	INSCHR			/PASTE IT IN

DCP017,	JMS	DCPGNC		/GO GET NEXT CHAR
	JMP	DCPXIT		/RAN OUT OF PASTE TEXT SO QUIT		/C215
	SZA			/ZERO IS END OF PASTE BUFFER		/A215
	JMP	DCP001		/GO PASTE NEXT CHAR IN
DCPXIT,	JMS	DCPEOL		/DO END OF SEGMENT PROCESSING		/A215
	NOP			/END OF BUFFER RETURN			/A215
	JMP	EIFIX		/ALL DONE, GO GET NEXT EDIT COMMAND	/A215


/	DCP003	DUMP PASTE TO TEXT BUFFER
/
/	UNDER AN ERROR CONDITION THE PASTE BUFFER IS DUMPED TO THE
/	TEXT BUFFER WITHOUT AND FURTHER FORMATTING.

DCP003,	CDFBUF			/CHANGE TO BUFFER FIELD			/A215
	TAD I	PSTPTR		/FETCH PASTE CHAR
DCP004,	SNA
	JMP	EIFIX		/END OF PASTE BUFFER
	TAD	(-ECSTRL)	/IS IT A RULER?
	SNA CLA
	JMP	DCP005		/SKIP TO END OF RULER BEFORE RESUMING
				/PASTE
	TAD I	PSTPTR		/PASTE CHAR INTO TEXT BUFFER
	INSCHR	
DCP006,	JMS	DCPGNC		/FETCH NEXT CHARACTER
	JMP	EIFIX		/DONE NO MORE PASTE
	JMP	DCP004		/PROCESS NEXT CHARACTER

DCP005,	JMS	DCPGNC		/SKIP TO END OF RULER
	JMP	EIFIX
	TAD	(-ECNDRL)
	SNA CLA
	JMP	DCP006
	JMP	DCP005

/	DCP021	SKIP RULERS IN PASTE BUFFER

DCP021,	JMS	DCPGNC		/SKIP TO END OF RULER
	JMP	EIFIX
	TAD	(-ECNDRL)
	SNA CLA
	JMP	DCP017
	JMP	DCP021




/	DCPEOL	END OF SEGMENT PROCESSING				/C215
/
/	WHEN AN EOL MARK IS FOUND IN THE PASTE BUFFER THIS IS TAKEN AS
/	DELIMITING A SEGMENT OF COLUMN TEXT.  IF THE NEXT CHARACTER AFTER
/	THE END OF THE SEGMENT IS A HARD RETURN THEN DON'T INSERT A
/	TRAILING TAB AFTER THE SEGMENT.

DCPEOL,	XX			/DO END OF SEGMENT PROCESSING		/A215
	JMS	LODCHR		/GET NEXT CHAR FROM TEXT BUFFER
	JMP I	DCPEOL		/END OF FILE - RETURN TO CALLER		/C215
	TAD	(-ECNWLN)
	SNA CLA
	JMP	DCP007		/GO FIND THE NEXT PLACE TO PASTE TEXT
	TAD	(ECTAB)
	INSCHR	

DCP007,	SLNMOD
	JMS	REJUST
	ISZ	DCPEOL		/BUMP RETRUN ADDRESS			/A215
	JMP I	DCPEOL		/RETURN TO CALLER			/A215



/	FOUND END OF SEGMENT IN PASTE BUFFER

DCP002,	JMS	DCPEOL		/GO DO END OF SEGMENT PROCESSING	/C215
	SKP			/END OF TEXT BUFFER DETECTED		/C215
	JMP	DCP008		/GO FIND THE NEXT LINE ENDER

DCPNWL,	TAD	(ECNWLN)	/PICK UP LINE ENDER TO FINISH COLUMN	/A215
	INSCHR			/INSERT THE LINE ENDER			/A215
	SLNMOD			/SET THE LINE MODIFIED FLAG		/A215
	JMS	REJUST		/FIX THE LINE				/A215
	JMP	DCP009		/NOW TREAT END OF TEXT AS A SHORT LINE	/A215

/	DCP008	FIND NEXT LINE ENDER
/
/	THE LINE FOLLOWING THE NEXT LINE ENDING IN A HARD RETURN IS THE
/	LINE IN WHICH TO INSERT THE NEXT COLUMN SEGMENT FROM THE PASTE
/	BUFFER.  IF A PAGE MARK/CONTROL BLOCK IS FOUND THEN THE PAGE
/	MARK OR THESTART CONTROL END CONTROL PAIR IS SKIPPED AND THE
/	SEARCH PROCEEDS FOR THE HARD RETURN.  IF A RULER OR END OF
/	TEXT IS FOUND PRIOR TO A LINE ENDING IN A HARD RETURN THEN
/	DUMP THE TEXT WITHOUT CROSSING THIS VIRTUAL BOUNDARY.  IF THE
/	HARD RETURN IS FOUND THEN GO FIND THE CORRECT COLUMN POSITION.

DCP008,	TAD I	CURPTR		/FETCH THE NEXT CHAR FROM THE TEXT	/C216
	TAD	(-ECNWLN)	/HARD RETURN?				/C216
	SNA CLA
	JMP	DCP009		/YES GO FIND COLUMN POSITION
	TAD I	CURPTR		/IS CHAR A PAGE MARK?
	AND	P177
	TAD	(-ECNWPG)
	SNA CLA								/C216
	JMP	DCP010		/YES, GO SKIP TO NEXT LOGICAL POSITION
	SKP			/ NOT NECESSARY TO SET THE LINE MOD 	/A193
DCP011,	SLNMOD			/ FLAG AFTER EVERY CHARACTER
	ADVSPC			/GO GET NEXT CHAR
	JMP	DCPNWL		/RAN OUT OF TEXT SO GO ADD A LINE ENDER	/C215
	TAD	(-ECSTRL)	/IS CHAR A RULER?			/C216
	SNA CLA								/M216
	JMP	DCP006		/YES, GO DUMP THE REST OF TEXT		/M216
	CURMOV			/FIXUP PTRBLK				/M216
	HLT			/SHOULD NEVER HIT EOF HERE		/M216
	JMP	DCP008		/TEST NEXT CHARACTER

/	DCP010	CHECK PAGE MARKS
/
/	IF WHILE SEARCHING FOR THE HARD RETURN EOL A PAGE MARK, NEW
/	PAGE, OR START/END CONTROL IS SEEN THEN CHECK.  SKIP NEW PAGE
/	AND PAGE MARK.  SKIP TO END OF CONTROL BLOCK ON START CONTROL
/	AND DUMP TEXT DUE TO ERROR ON END CONTROL.

DCP010,	TAD I	CURPTR
	ZZCASE
	CLPTB2-1

/	ECNWPG;	DCP011		/NEW PAGE
/	ECPMRK;	DCP011		/PAGE MARK
/	ECPCT1;	DCP012		/START CONTROL
/	ECPCT2;	DCP006		/END CONTROL
/	0

DCP012,	AC0001
	CURMOV
	JMP	DCP006
	TAD I	CURPTR
	TAD	(-ECPCT2)
	SNA CLA
	JMP	DCP011
	JMP	DCP012


/	DCP015	SKIP TO END OF CONTROL BLOCK

DCP015,	AC0001			/MOVE FORWARD A CHARACTER
	CURMOV
	JMP	DCP006		/END OF TEXT DUMP PASTE BUFFER
	TAD I	CURPTR		/FETCH CHARACTER
	TAD	(-ECPCT2)	/END CONTROL?
	SNA CLA
	JMP	DCP009		/YES GO PROCESS BEGINNING OF LINE
	JMP	DCP015		/TRY NEXT CHARACTER

/	DCP013	DUMP TEXT BEFORE RULER
/
/	IF A RULER CHANGE OCCURS DUMP THE PASTE BUFFER BEFORE THE
/	RULER.

DCP013,	TAD	X5		/RESTORE THE CURSOR POSITION
	DCA	CURPTR
	AC7777			/BACK UP OVER THE RULER
	CURMOV
	HLT
	JMP	DCP006		/AND DUMP THE REST OF THE PASTE BUFFER

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

	PAGE

/	DCP009	CHECK LINE FOLLOWING
/
/	FINDING THE CORRECT COLUMN POSITION REQUIRES THAT THE LINE IN
/	WHICH THE HARD RETURN LINE ENDER WAS FOUND HAVE NO INTERVENING
/	RULERS BETWEEN IT AND THE LINE IN WHICH THE COLUMN IS TO GO.
/	IF THE LINE IMMEDIATELY FOLLOWING THE LINE WITH A HARD RETURN IS
/	A PAGE MARK OR CONTROL BLOCK THEN YOU WANT TO SKIP OVER THAT AND
/	GO TO THE NEXT TEXT LINE FOLLOWING SO AS TO CONFORM WITH COLUMN
/	CUT.

DCP009,	AC0001			/POSITION TO FIRST CHAR OF NEXT LINE
	CURMOV
	JMP	DCPCHK		/RAN OUT OF TEXT - TREAT AS SHORT LINE	/C215
	TAD	CURPTR		/SAVE CURRENT PTR POSITION
	DCA	X5
	TAD	LINE23		/AND CHECK LINE ENDER IMMEDIATELY
	DCA	CURPTR		/PRECEDING
	BKPPTR
	HLT			/NFW
	TAD	(-ECNDRL)	/WASN'T A RULER WAS IT?
	SNA CLA
	JMP	DCP013		/BACKUP OVER IT AND DUMP THE TEXT OUT
	TAD	X5		/RESTORE PTR
	DCA	CURPTR
	TAD I	CURPTR		/CHECK FOR PAGE MARK OR CONTROL BLOCK
	ZZCASE
	CLPTB3-1

/	ECNWPG;	DCP009		/NEW PAGE SKIP TO NEXT LINE
/	ECPMRK;	DCP009		/PAGE MARK SKIP TO NEXT LINE
/	ECPCT1;	DCP015		/START CONTROL SKIP TO LINE AFTER END CONTROL
/	ECPCT2;	DCP006		/END CONTROL ERROR DUMP REMAINING TEXT
/	0

/\	JMP	DCPCHK		/NOT A BAD SITUATION GO DO COLUMN FIND	/C215

/	DCPCHK	CHECK TO SEE IF THERE IS ANY MORE TEXT IN PASTE BUFFER	/A215

DCPCHK,	JMS	DCPGNC		/GO GET NEXT CHAR FROM PASTE BUFFER	/A215
	JMP	EIFIX		/RAN OUT OF PASTE TEXT SO QUIT		/A215
	SNA CLA			/ZERO IS END OF PASTE BUFFER		/A215
	JMP	EIFIX		/DONE NO MORE TO PASTE			/A215
/\	JMP	DCP014		/FALL INTO DCP014 ROUTINE		/A215


/	DCP014	FIND PROPER COLUMN POSITION
/
/	THE CURSOR POSITION IN THE LINE IS CHECKED AGAINST THE UPPER
/	AND LOWER LIMITS OF THE COLUMN.  IF IT IS WITHIN THE RANGE
/	THEN THE COLUMN IS FOUND AND THE NEXT LINE SEGMENT IS PASTED
/	IN.  OTHERWISE THE SEARCH CONTINUES FOR THE COLUMN.

DCP014,	CDFMYF			/CHECK POSITION AGAINST LOWER LIMIT OF
	TAD	CLMPLL		/COLUMN
	CIA
	TAD	CURSOR
	SPA CLA
	JMP	DCP016		/MOVE FORWARD
	TAD	CURSOR		/CHECK UPPER LIMIT
	CIA
	TAD	CLMPUL
	SMA CLA
	JMP	DOCLPS		/GO PASTE IN NEXT SEGMENT		/C215

/	IF THERE IS NO COLUMN BREAK IN THE APPROPRIATE POSITION THEN
/	THE CURSOR IS MOVE BACKED TO THE BEGINNING OF THE LINE AND THE
/	REST OF THE PASTE BUFFER IS DUMPED THERE.

	TAD	LINE23		/LINE HAS NO COLUMN BREAK
	DCA	CURPTR		/DUMP PASTE BEFORE BEGINNING OF LINE
	DCA	CURSOR
	CURMOV
	HLT			/NO CAN DO CHARLIE
	JMP	DCP003		/GO DUMP THE PASTE BUFFER		/C215

/	DCP016	CHECK FOR THE NEXT COLUMN DELIMITER
/
/	

DCP016,	JMS	LODCHR		/GET CHAR UNDER PTR
	JMP	DCP019		/END OF TEXT - TREAT AS SHORT LINE	/C215
	AND	P177		/CHECK FOR TABS AND EOLS
	ZZCASE
	CLPTB4-1

/	ECTAB;	DCP018		/TAB DO LIMIT CHECK
/	ECNWLN;	DCP019		/EOL SAYS SHORT LINE OF BAD LINE
/	ECMDFL;	DCP020		/DON'T COUNT MODIFIED FLAGS
/	ECSTRL;	DCP003		/GO DUMP THE REST OF PASTE ON A RULER	/C215
/	ECNWPG;	DCP003		/SAME AS RULER FOR PAGE AND CONTROL	/C215
/	0

	ISZ	CURSOR		/UPGRADE POSITION
	ADVSPC			/TRY OUT NEXT CHAR
	JMP	DCP019		/END OF TEXT - TREAT AS SHORT LINE	/C215
	JMP	DCP016		/GO CHECK NEXT

DCP020,	DCA I	CURPTR		/DELETE LINE MODIFIED FLAG
	SLNMOD			/AND REJUSTIFY LINE
	JMS	REJUST
	JMP	DCP016		/GO CHECK NEXT

DCP019,	TAD I	PSTPTR		/GET CHARACTER FROM PASTE BUFFER	/A215
	TAD	(-ECNWLN)	/CHECK FOR A HARD RETURN		/A215
	SNA CLA			/IS THIS A BLANK PASTE LINE ?		/A215
	JMP	DCP002		/YES, GO DO END OF SEGMENT PROCESSING	/A215
	TAD	(ECTAB)		/NO, INSERT TAB TO PAD OUT LINE
	JMS	INSERT
	SLNMOD

DCP018,	AC0001			/JUSTIFY THE DAMN TAB SO AS TO FIND
	CURMOV			/FIRST CHAR IN COLUMN
	JMP	DCP003		/RAN OUT OF TEXT SO DUMP PASTE BUFFER	/C215
	JMP	DCP014		/GO CHECK COLUMN BOUNDARY


/	DCPGNC	GET NEXT CHAR FROM PASTE BUFFER
/
/	THIS ROUTINE RETRIEVES THE NEXT CHARACTER FROM THE PASTE BUFFER.
/	IF A CHARACTER IS FETCHED THEN A SKIP RETURN IS TAKEN.  ON
/	FAILURE THE DIRECT RETURN.  THE CHARACTER IS RETURNED IN THE AC.
/

DCPGNC,	XX
	ISZ	PSTPTR		/POINT TO NEXT CHAR IN PASTE BUFFER
	JMP	DCGNC1		/THERE IS ANOTHER CHAR IN THE CURRENT
				/BUFFER
	ISZ	PSTBLK		/LAST BUFFER EMPTY TRY NEXT
	TAD	PSTBLK		/WAS THAT THE LAST BLOCK AVAILABLE
	TAD	(-PSTEND)
	SNA CLA
	JMP I	DCPGNC		/YES NO MORE AVAILABLE
	TAD	(RXERD)		/READ NEXT BLOCK OF PASTE BUFFER
	JMS	PSTIO
DCGNC1,	CDFBUF			/FETCH A CHAR
	TAD I	PSTPTR
	ISZ	DCPGNC		/TAKE SKIP RETURN
	JMP I	DCPGNC

/	COLUMN PASTE CASE TABLES
/
/

CLPTB1,	ECNWLN;	DCP002		/END OF SEGMENT
	ECNWPG;	DCP003		/ILLEGAL CHAR TO PASTE DUMP TEXT
	ECSTRL;	DCP021		/START OF RULER, SKIP TO END OF RULER	/C208
	0

CLPTB2,	ECNWPG;	DCP011		/NEW PAGE
	ECPMRK;	DCP011		/PAGE MARK
	ECPCT1;	DCP012		/START CONTROL
	ECPCT2;	DCP006		/END CONTROL
	0

CLPTB3,	ECNWPG;	DCP009		/NEW PAGE SKIP TO NEXT LINE
	ECPMRK;	DCP009		/PAGE MARK SKIP TO NEXT LINE
	ECPCT1;	DCP015		/START CONTROL SKIP TO LINE AFTER END CONTROL
	ECPCT2;	DCP006		/END CONTROL ERROR DUMP REMAINING TEXT
	0

CLPTB4,	ECTAB;	DCP018		/TAB DO LIMIT CHECK
	ECNWLN;	DCP019		/EOL SAYS SHORT LINE OF BAD LINE
	ECMDFL;	DCP020		/DON'T COUNT MODIFIED FLAGS
	ECSTRL;	DCP003		/GO DUMP THE REST OF PASTE ON A RULER	/C215
	ECNWPG;	DCP003		/SAME AS RULER FOR PAGE AND CONTROL	/C215
	0

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

	PAGE

/***************************************************************************
/****			   START OF OVERLAY				****
/***************************************************************************

	OV2NUM=OV2NUM+200
	OVRBLK=OV2NUM%200+DLOEDO+36 / DISK BLOCK WHERE OVERLAY IS LOADED

	RELOC
	RELOC OVLAY2
	OV2NUM

	OVTC=	.-OVLAY2+OV2NUM	/ USER REQUESTED A TECHNICAL CHARACTER

/	BUILD A TECHNICAL CHARACTER
/
/	FORMAT
/
/	SD SP GS CH TC ED
/
/	SD = START DEAD
/	SP = SPACE
/	GS = GRAPHICS SET G1 - G3  (OCTAL CODE 61 - 63)
/	TC = TECHNICAL CHARACTER
/	ED = END DEAD

TCCHAR,	DCA	LNDSUB		/ Clear temp for line drawing set
	GETINP			/ GET NEXT CHARACTER
	SPA			/ -AC MEANS COMMAND KEY
	JMP	LNDTST		/ Test for line drawing set	/M223

	JMS	TECVAL		/ GO VALIDATE AND MAP TEC CHARACTER
	  JMP	EIBAD		/ BEEP USER, NOT A VALID TECHNICAL CHARACTER
TCINS,	SLNMOD			/ SET LINE MODIFIED FLAG
	TAD	(ECSTOV)	/ YES. BUILD DEAD KEY SEQUENCE
	JMS	INSRL1		/ INSERT START DEAD CODE
	TAD	(ECSPC)
	JMS	INSRL1		/ INSERT SPACE
	TAD	TECSET		/ GRAPHIC SET G1 = 61, G2 = 62, G3 = 63
	JMS	INSRL1		/ AND INSERT IT
	TAD	TECMAP		/ GET MAPPED TECH CHARACTER
	JMS	INSRL1		/ AND INSERT IT
	TAD	(ECNDOV)	/ INSERT END DEAD CODE
	JMS	INSRL1
	JMP	EIFIX		/ ALL DONE.  GET NEXT INPUT

	OVFIXP=	.-OVLAY2+OV2NUM	/ TRANSFER MENU BUFFER TO PASTE BUFFER

	TAD   (MUBUF+MNIBUF-1)	/ ADDRESS TO COPY FROM
	DCA	X0		/ SET UP POINTER ADDRESS
	TAD	(PSTEBF-1)	/ ADDRESS TO COPY TO
	DCA	X1		/ SET UP POINTER ADDRESS

AAFIXP,	CDFMNU			/ FIELD TO COPY FROM
	TAD I	X0		/ PICK UP WORD FROM MENU BUFFER
	CDFBUF			/ FIELD TO COPY TO
	SNA			/ CHECK FOR THE LAST WORD TO COPY
	JMP	XXFIXP		/ GO STORE A FINAL ZERO TO END PASTE BUFFER
	SPA			/ CHECK FOR A TECHNICAL CHARACTER CODE
	JMP	CCFIXP		/ YES, GO HANDLE SPECIAL CODE
BBFIXP,	DCA I	X1		/ NO, STORE WORD IN PASTE BUFFER
	JMP	AAFIXP		/ GO GET NEXT WORD

CCFIXP,	CMA			/ INVERT TO CORRECT FORM
	SZA			/ CHECK FOR A REQUIRED SPACE CODE
	JMP	DDFIXP		/ NO, GO HANDLE TECHNICAL CHARACTER

/ BUILD REQUIRED SPACE IN PASTE BUFFER

	TAD	(ECSTOV)	/ PICK UP START DEAD CODE
	DCA I	X1		/ STORE WORD IN PASTE BUFFER
	TAD	(ECSPC)		/ PICK UP SPACE CHARACTER CODE
	DCA I	X1		/ STORE WORD IN PASTE BUFFER
	TAD	(ECSPC)		/ PICK UP SPACE CHARACTER CODE
	JMP	EEFIXP		/ GO STORE WORD AND FINISH SEQUENCE

/ BUILD TECHNICAL CHARACTER IN PASTE BUFFER

DDFIXP,	DCA	ZZFIXP		/ SAVE MAPPED TECHNICAL CHARACTER
	TAD	(ECSTOV)	/ PICK UP START DEAD CODE
	DCA I	X1		/ STORE WORD IN PASTE BUFFER
	TAD	(ECSPC)		/ PICK UP SPACE CHARACTER CODE
	DCA I	X1		/ STORE WORD IN PASTE BUFFER
	TAD	ZZFIXP		/ PICK UP SAVED TECHNICAL CHARACTER
	R3L			/ POSITION SELECTION BITS IN AC, 0 - 2
	AND	(3)		/ MASK OFF LOW ORDER BITS
	TAD	(60)		/ GRAPHIC SET G1 = 61, G2 = 62, G3 = 63
	DCA I	X1		/ STORE WORD IN PASTE BUFFER
	TAD	ZZFIXP		/ GET MAPPED TECH CHARACTER
	AND	P177		/ MASK OFF 7 BIT ASCII CHARACTER
EEFIXP,	DCA I	X1		/ STORE WORD IN PASTE BUFFER
	TAD	(ECNDOV)	/ PICK UP END DEAD CODE
	JMP	BBFIXP		/ GO STORE WORD IN PASTE BUFFER

XXFIXP,	DCA I	X1		/ STORE ZERO IN PASTE BUFFER
	JMP	OV2JRT		/ ALL DONE, RETURN TO CALLER

ZZFIXP,	.-.			/ LOCATION TO SAVE MAPPED TECHNICAL CHARACTER

/ THE FOLLOWING ROUTINE MOVED TO BLASTER ON EDIT 237 ////////////////////////
/ The following code handles 8 bit characters typed after the ALT key	/a233
/ as the table for TECVAR would be sparse and too large if it was just	/a233
/ extended to cope with 8 bits.  So a table search algorithm is used	/a233
/ here for the few keys returning 8 bit characters on multinational	/a233
/ keyboards.								/a233
/
/TEC8VAL,DCA	TECTMP		/ Save temprarily			/a233
/	TAD	TECTMP		/ Get it back for test			/a233
/	AND	(200)		/ Is this a multinational character	/a233
/	SNA CLA			/ .....?				/a233
/	JMP	TEC7BIT		/ No, deal with it elsewhere		/a233
/	TAD	TECTMP		/ Yes, get the char to be translated.	/a233
/	AND	P377		/ Make sure its only 8 bits		/a233
/	CIA			/ Make it negative to subtract from	/a233
/	DCA	TECTMP		/ table entries.  Store for later	/a233
/	TAD	(TEC8TB-2)	/ Get the address of the 8 bit TEC table/a233
/	DCA	X0		/ We know X0 is free as is reset later	/a233
/				/ (Famous last words)			/a233
/TEC8LP,	ISZ	X0		/ Skip over TEC char			/a233
/	TAD I	X0		/ Get first 8 bit char			/a233
/	TAD	TECTMP		/ Compare with the 8 bit char entered	/a233
/	SMA SZA			/ Are we still before the table entry?	/a233
/	JMP	TEC8RTN		/ No, therefore not in table		/a233
/	SZA CLA			/ Same?					/a233
/	JMP	TEC8LP		/ No, check rest of table		/a233
/	TAD I	X0		/ Yes, get the representative TEC char	/a233
/	JMP	TEC8FND		/ and process it			/a233
/
/ The next table is  O R D E R   I M P O R T A N T  ---------------------
/
/TEC8TB,	IFDEF ENGLSH <
/	IFDEF V30FAO <
/	0241;  3063		/ Upsidedown Bang	= Top Vert Summ Connect
/	0243;  3065		/ Pound Sterling	= Top right Summ
/	0252;  3051		/ a ordinal		= Top right Sq Brkt
/	0272;  3052		/ o ordinal		= Bot right Sq Brkt
/	0277;  3064		/ Upsidedown Question	= Bot Vert sum Connect
/	0321;  3136		/ N tilde		= Logical And
/	0347;  3075		/ c cedilla		= Not Equal
/	0361;  3137		/ n tilde		= Logical Or
/	>
/	7777
/	>
/
/	IFDEF SPANISH <
/	0241;  3063		/ Upsidedown Bang	= Top Vert Summ Connect
/	0243;  3065		/ Pound Sterling	= Top right Summ
/	0252;  3051		/ a ordinal		= Top right Sq Brkt
/	0272;  3052		/ o ordinal		= Bot right Sq Brkt
/	0277;  3064		/ Upsidedown Question	= Bot Vert sum Connect
/	0321;  3136		/ N tilde		= Logical And
/	0347;  3075		/ c cedilla		= Not Equal
/	0361;  3137		/ n tilde		= Logical Or
/	7777
/	>
/
/	IFDEF ITALIAN <
/	0243;	3041		/ Lira symbol		= Radical
/	0247;	3077		/ Section symbol	= Integral
/	0260;	3047		/ Degree symbol		= Top left square bkt
/	0340;	3056		/ a-grave		= Bottom right paren
/	0347;	3054		/ c-cidila		= Bottom left paren
/	0350;	3045		/ e-grave		= Bottom integral
/	0351;	3126		/ e-accute		= Radical
/	0354;	3160		/ i-grave		= Small pi
/	0362;	3133		/ o-grave		= Includes
/	0371;	3103		/ u-grave		= Divide
/	7777
/	>
/	IFDEF DUTCH <
/	7777
/	>
/
/ End of -------------- O R D E R   I M P O R T A N T --------------------
/D237D237D237D237D237D237D237D237D237D237D237D237D237D237D237D237D237D237D237


	
	X=.			/ INDICATE FIRST FREE LOCATION ON PAGE

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


/
/	The next "bit" tests for line drawing characters typed from
/	the F11 alt char key.
/
/	The  characters are arranged to coincide with the keys on the
/	alternate keypad  i.e.
/
/	Sent   Tab    Under		 -      - -       -
/              Pos    Line 		|        |         |
/
/
/					|	 |	   |
/	Word   Para   Bold		 -      - -       -
/					|	 |	   |
/
/
/	Back   Line   Upper		|    	 | 	   |
/	Up            Case		 -      - -       -  
/
/
/	Horizontal line is the Advance key or Left/Right arrows
/	Vertical   line is the Enter   key or Up/Down    arrows.
/


LNDTST,
	ZZCASE					/ Check Input command	/A223
	LNDTBL-1				/ Against Despatch table/A223

	JMP	EIBAD				/ Not matched , Beep BiBi/A223

TLHC,	ISZ	LNDSUB			/Top Left hand Corner		/A223
TMT,	ISZ	LNDSUB			/Top Middle T			/A223
TRHC,	ISZ	LNDSUB			/Top Right hand corner		/A223
LMT,	ISZ	LNDSUB			/Left Middle T			/A223
MCRS,	ISZ	LNDSUB			/Middle Cross			/A223
RMT,	ISZ	LNDSUB			/Right Middle T			/A223
BLHC,	ISZ	LNDSUB			/Bottom Left Hand Corner	/A223
BMT,	ISZ	LNDSUB			/Bottom Middle T		/A223
BRHC,	ISZ	LNDSUB			/Bottom Right Hand Corner	/A223
VLINE,	ISZ	LNDSUB			/Vertical Line			/A223
HLINE,	ISZ	LNDSUB			/Horizontal line		/A223

	CLA				/				/A223
	TAD	(LNDCHRS-1)		/Address of correspoding chars	/A223
	TAD	LNDSUB			/Add offset into table		/A223
	DCA	LNDPTR			/Save as a pointer		/A223
	TAD I	LNDPTR			/Get Line drawing character	/A223
	DCA	TECMAP			/Put that away			/A223
	TAD	(61)			/Line drawing from set 1	/A223
	DCA	TECSET			/Put that away too		/A223
	JMP	TCINS			/Rejoin main code		/A223


LNDCHRS,	161	/ Horiz line			/q		/A223
		170	/ Vert Line			/x		/A223
		152	/ Bottom Right Hand Corner	/j		/A223
		166	/ Bottom Middle T		/v		/A223
		155	/ Bottom Left Hand Corner	/m		/A223
		165	/ Right Hand middle T		/u		/A223
		156	/ Middle Cross			/n		/23
		164	/ left Middle T			/t		/A223
		153	/ Top Right Hand Corner		/k		/A223
		167	/ Top Middle T			/w		/A223
		154	/ Top Left Hand Corner		/l		/A223




LNDTBL,		EDSENT;	TLHC						/A223
		EDTABP;	TMT						/A223
		EDUNDL;	TRHC						/A223
		EDWORD;	LMT						/A223
		EDPARA;	MCRS						/A223
		EDBOLD;	RMT						/A223
		EDBKUP;	BLHC						/A223
		EDLINE;	BMT						/A223
			EDUPPR;	BRHC						/A223
		EDUPAR;	VLINE						/A223
		EDDNAR; VLINE						/A223
		EDRARO;	HLINE						/A223
		EDLARO;	HLINE						/A223
		EDENTR;	VLINE						/A223
		EDADVN; HLINE						/A223
		0							/A223

LNDPTR,	0			/Pointer to Char table			/A223
LNDSUB,	0			/ temp subscript for line drawing table	/A223

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


/***************************************************************************
/****			   START OF OVERLAY				****
/***************************************************************************

	OV2NUM=OV2NUM+200
	OVRBLK=OV2NUM%200+DLOEDO+36	/ DISK BLOCK WHERE OVERLAY IS LOADED

	RELOC

	RELOC OVLAY2
	OV2NUM

	OVSNFG=	.-OVLAY2+OV2NUM

	JMP	STPNFG

	OVSEXB=	.-OVLAY2+OV2NUM

	JMP	STPEXB

	OVCLRS=	.-OVLAY2+OV2NUM		/ESCLRS	RIGHT STRIP FUNCTION

ESCLRS,	TAD	SLCRPT			/SAVE BEGINNING STRIP POS
	DCA	CLCTSW
	OVLJMP
	OVSSTP				/SETUP STRIP PARAMETERS
	CDFMYF
	TAD	CLCTSW			/SET UP BEGIN AND END POINTS
	DCA	CLSBEG
	TAD	CLMPUL
	DCA	CLSEND
	AC7777
	JMP	ESCLGO			/GO DO STRIP			/C213
/D213	DCA	CLCTSW
/D213	JMP	ESTRIP-1		/GO DO STRIP

	OVCLLS=	.-OVLAY2+OV2NUM		/ESCLLS	LEFT STRIP FUNCTION

ESCLLS,	TAD	SLCRPT			/SAVE BEGINNING STRIP POS
	DCA	CLCTSW
	OVLJMP
	OVSSTP				/SETUP STRIP PARAMETERS
	CDFMYF
	TAD	CLMPLL
	DCA	CLSBEG
	TAD	CLCTSW			/SET UP BEGIN AND END POINTS
	DCA	CLSEND
ESCLGO,	DCA	CLCTSW							/C213
	DCA	CLCTDN			/FALL INTO STRIP CODE

	OVSTRP=	.-OVLAY2+OV2NUM		/ESTRIP	STRIP TEXT FROM A COLUMN

ESTRIP,	OVLJMP
	OVSTLD
	CDFMYF
	TAD	CLCTSW			/CHECK IF LEFT STRIP
	SZA CLA
	JMP	STRP05			/NO RIGHT DOES'NT NEED COL CHECK
	AC7777				/CHECK PREVIOUS CHAR
	CURMOV
	JMP	STRPA5			/START OF FILE GO FIX UP RULER	/C213
	TAD I	CURPTR			/CHECK FOR COL DELIMITER
	AND	P177
	ZZCASE
	STPTB4-1

/	ECNWLN;	STRP28
/	ECNWPG;	STRP28
/	ECTAB;	2TRP28
/	0

STRP29,	AC0001				/FORWARD SPACE TO NEXT COLUMN
	CURMOV
	JMP	STPNFG
	TAD I	CURPTR
	AND	P177
	ZZCASE
	STPTB5-1

/	ECNWLN;	STRP12			/NO COLUMN TO STRIP
/	ECNWPG;	STPNFG			/BAD DATA FORMAT
/	ECTAB;	STRP28
/	0

	JMP	STRP29

STRP28,	AC0001				/FORWARD TO BEGINNING CHAR OF COLUMN
STRPA5,	CURMOV				/HERE TO MOVE OFF START OF RULER/C213
	JMP	STPNFG

STRP05,	CDFMYF
	TAD	CURSOR			/CHECK FOR LOWER LIMIT OF STRIP
	CIA
	TAD	CLSBEG
	SPA SNA CLA
	JMP	STRP01			/STRIP BEGINNING FOUND
	CDFBUF
	TAD I	CURPTR
	AND	P177
	ZZCASE
	STPTB1-1

/	ECMDFL;	STRP02			/MODIFIED FLAG REJUST REST
/	ECNWLN;	STRP03			/NEWLINE CHECK CONDITIONS
/	ECNWPG;	STPEXB			/BAD MOVE CHARLIE SHOULD BE HARD
					/RETURN
/	ECSTRL;	STPEXB			/SO ARE RULERS AND OTHER TYRANTS
/	0

	ADVSPC				/FORWARD SPACE ONE PRINT POS
	JMP	STPNFG			/REALLY A CATO. ERROR CAN'T HAPPEN
	CLA
	ISZ	CURSOR			/UP THE BODY COUNT
	JMP	ESTRIP			/AND TRY FOR A TRUE KILL

/	STRP01	INSERT MARKERS FOR STRIP DELIMITING
/
/

STRP01,	CDFMYF
	TAD	CURSOR			/CHECK AGAINST UPPER LIMIT
	CIA
	TAD	CLSEND
	SPA SNA CLA
	JMP	STPNFG			/NO WAY BEYOND THE REALM
	CDFBUF
	TAD	(ECTMRK)		/INSERT LOWER MARKER
	JMS	INSERT
STRP04,	AC7777				/ CURSOR LESS ONE BECAUSE OF INSERT
	TAD	CURSOR
	DCA	CURSOR
STRP06,	ADVSPC
	JMP	STRP07			/INSERT OTHER MARKER
	AND	P177
	ZZCASE
	STPTB2-1
/	ECNWLN;	STRP08
/	ECNWPG;	STPNFW
/	ECSTRL;	STPNFW
/	ECTAB;	STRP07
/	ECMDFL;	STRP06
/	0

	ISZ	CURSOR
	NOP				/FIX FOR CURSOR = 0		/A213
	CDFMYF
	TAD	CURSOR
	CIA
	TAD	CLSEND
	SMA SZA CLA
	JMP	STRP06

/	STRP07	INSERT END MARKER
/
/

STRP07,	CDFBUF
	TAD	(ECTMRK)
	JMS	INSERT
STRP09,	BKPPTR
	HLT
	TAD	(-ECTMRK)
	SZA CLA
	JMP	STRP09
	TAD	(ECMDFL)


/	STRP10	STRIP BETWEEN MARKERS
/
/

STRP10,	DCA I	CURPTR			/DELETE MARKER
	ADVPTR
	HLT
	TAD	(-ECTMRK)		/END OF STRIP?
	SNA CLA
	JMP	STRP11
	TAD I	CURPTR
	JMS	PUTSTP
	JMP	STRP10			/PROCESS NEXT CHAR
	JMP	STPNFW			/PASTE BUFFER OVERFLOW

	X=.
/--------------------------
	PAGE

/	STRP11	PROCESS END OF STRIP
/
/

STRP11,	DCA I	CURPTR			/DELETE MARKER
STRP12,	TAD	(ECNWLN)		/PUT EOS IN PASTE
	JMS	PUTSTP
	SKP
	JMP	STPNFG			/BUFFER OVERFLOW EXIT
	TAD	LINE23			/RESET LINE PTRS FOR EOL SEARCH
	DCA	CURPTR
	DCA	CURSOR
	SLNMOD
	JMS	REJUST
	TAD	CLCTDN			/CHECK IF STRIP DONE
	SZA CLA
	JMP	STPGEX
	OVLJMP
	OVSTPX

/	STRP03	HANDLE NEWLINE IN COLUMN
/
/

STRP03,	TAD I	CURPTR
	TAD	(-ECNWLN)		/END OF COLUMN AND LINE?
	SNA
	JMP	STRP12			/YES
	TAD	(ECNWLN-ECSLPT)		/SELECT POINT
	SZA CLA
	JMP	STPEXB			/NO WRAPPED OR CENTERED IS A SCREW UP
	TAD	(ECMDFL)		/PROCESS AS MODIFIED FLAG
	DCA I	CURPTR
	ISZ	CLCTDN			/MARK DONE

/	STRP02	HANDLE MODIFIED FLAG IN COLUMN
/
/

STRP02,	CURMOV
	JMP	STPNFG
	JMP	ESTRIP

/	STRP08	HANDLE NEWLINE IN COLUMN
/
/

STRP08,	TAD I	CURPTR			/CHECK FOR NEWLINE
	TAD	(-ECNWLN)
	SNA
	JMP	STRP07
	TAD	(ECNWLN-ECSLPT)		/CHECK FOR SELECT POINT
	SZA CLA
	JMP	STPNFW
	TAD	(ECMDFL)
	DCA I	CURPTR
	ISZ	CLCTDN
	CURMOV
	JMP	STPNFW
	BKPPTR
	HLT
	JMP	STRP04

/	BAD EXITS FROM STRIP
/
/

STPNFW,	TAD	LINE23			/RESET PTRS TO BEGINNING OF LINE
	DCA	CURPTR
	DCA	CURSOR
STPNF1,	CURMOV				/SEARCH FORWARD FOR MARKER
	HLT
	TAD I	CURPTR
	TAD	(-ECTMRK)
	SNA CLA
	JMP	STPNF2
	AC0001
	JMP	STPNF1
STPNF2,	DCA I	CURPTR			/DELETE MARKER
	SLNMOD
	JMP	STPNFG

STPEXB,	BKPPTR				/BACKUP TO PREVIOUS LINE
	HLT				/SEVERE CORRUPTION
STPNFG,	CLA
	TAD	PSBFOF			/PASTE FILLED?
	SNA CLA
	JMS	PUTSTP
	NOP
	OVLJMP
	OVDOER

STRP17,	DCA I	CURPTR
STPGEX,	DCA	EDMODE
	JMS	PUTSTP
	NOP
	JMP	EIFIX

/	PUTSTP	WRITE TO PASTE BUFFER
/
/	THIS ROUTINE TAKES CHARACTERS PASSED IN THE AC AND PUTS THEM IN
/	THE PASTE DISK BUFFER.  WHEN THE BUFFER IS FULL IT WRITES THE
/	BUFFER TO DISK.  WHEN THE LAST ALLOCATED DISK BLOCK IS WRITTEN
/	IT SETS THE CUT OVERFLOW FLAG AND TAKES A SKIP RETURN.
/
/	CALL:
/
/	JMS	PUTSTP	(AC := CHARACTER TO WRITEOUT)
/	(RETURNS HERE IF OK)
/	(RETURNS HERE ON END OF PASTE BUFFER)
/	
/	RETURNS WITH AC:=0 IN ALL CASES
/
PUTSTP,	XX			/ENTRY POINT
	CDFBUF			/SET TO BUFFER FIELD
	DCA I	PSTPTR		/PUT CHARACTER IN BUFFER
	ISZ	PSTPTR		/BUMP PTR AND CHECK FOR BLOCK FULL
	JMP I	PUTSTP		/BLOCK NOT FULL SO RETURN DIRECTLY
	TAD	(RXEWT+2000)	/BLOCK I/O WRITE CODE
	JMS	PSTIO		/PERFORM WRITE TO DISK
	ISZ	PSTBLK		/INCREMENT BLOCK NO
	TAD	PSTBLK		/CHECK FOR END OF ALLOCATED BLOCKS
	TAD	(-PSTEND)	/FOR PASTE BUFFER
	SZA CLA			/END OF ALLOCATION?
	JMP I	PUTSTP		/NO, SO STRAIGHT RETURN
	AC7777			/EOA FOR PASTE BUFFER
	DCA	PSBFOF		/SET PASTE BUFFER OVERFLOW FLAG
	ISZ	PUTSTP		/AND TAKE A SKIP RETURN
	JMP I	PUTSTP		/B-B

STPTB1,	ECMDFL;	STRP02		/ Modified Flag rejust REST
	ECNWLN;	STRP03		/ Newline Check conditions
	ECNWPG;	STPEXB		/ Bad move Charlie should be hard
				/ return
	ECSTRL;	STPEXB		/ So are rulers and other tyrants
	0
STPTB2,	ECNWLN;	STRP08
	ECNWPG;	STPNFW
	ECSTRL;	STPNFW
	ECTAB;	STRP07
	ECMDFL;	STRP06
	0
	X=.


