/U/W-FOCAL 8/I EAE PATCHES  JVZ

/THESE ROUTINES UTILIZE THE STANDARD KE8-I (OR KE12) E.A.E.
/HARDWARE TO IMPROVE FOCAL'S MULTIPLY SPEED BY A FACTOR OF
/ABOUT FOURTEEN.  THE CODING IS ENTIRELY DIFFERENT FROM THE
/PATCH SHOWN ON PAGE 89 OF THE LISTING WHICH ONLY GIVES AN
/IMPROVEMENT OF ABOUT FOUR.  ADVANTAGE IS TAKEN OF TWO FEA-
/TURES OF THE HARDWARE WHICH ARE NOT WIDELY KNOWN: (1) THE
/COMBINATION MQA MQL INTERCHANGES THE AC & MQ AND (2) THE
/MUY INSTRUCTION ADDS THE C(AC) TO THE RESULT.  THE ACTUAL
/MULTIPLY TIME FOR A 36 BIT PRODUCT IS 230 MICROSECONDS,
/BUT SIGN-CHECKING AND NORMALIZATION APPROXIMATELY DOUBLE
/THIS.  A TWO-BIT NORMALIZE REQUIRES 55 MICROSECONDS MORE
/AND IF THE RESULT IS NEGATIVE A FURTHER 140 MICROSECONDS
/ARE NEEDED.  THUS THE OVERALL IMPROVEMENT IN PROGRAM SPEED
/IS CONSIDERABLY LESS THAN FOURTEEN.

/THE HARDWARE DIVIDE INSTRUCTION IS ALSO USED PRIMARILY TO
/SHORTEN TWO ROUTINES.  A TOTAL OF 43 WORDS ARE MADE AVAIL-
/ABLE BY THIS PATCH.

/SYSTEM SYMBOLS:

	MUY=7405
	DVI=7407
	MQL=7421
	MQA=7501
	SWP=MQL MQA

	FIXTAB

/FOCAL SYMBOLS:

	FIELD 1

	AC1H=41
	AC1L=42
	OVER1=43

	HORD=45
	LORD=46
	OVER2=47

	P177=106
	P4000=124
	PRINTC=JMS I 151

	ODG=2501
	FGO6=6101
	PTEN=6311
	DMULT=7004
	SIGN=7124
	*2442

PRNT,	0		/PRINT TWO DECIMAL DIGITS
	AND P177
	MQL DVI		/DIVIDE BY TEN
	    12
	SWP		/GET QUOTIENT
	JMS I ODG
	SWP		/GET REMAINDER
	JMS I ODG
	JMP I PRNT

	ZBLOCK 14	/TWELVE LEFT OVER



	*FGO6+12	/EXPONENT OUTPUT ROUTINE

	MQL DVI		/DIVIDE BY ONE HUNDRED
	    144
	SWP		/PRINT QUOTIENT
	SZA		/UNLESS IT'S ZERO
	JMS OUTDG
	SWP		/NOW PRINT REMAINDER
	JMS I .+2
	JMP I FGO6
	PRNT

	ZBLOCK 7	/+1 IF "=" SIGN DELETED
OUTDG=.+1


	*PTEN+3
	3147		/COMPENSATE PTEN



/LETTER ASSIGNMENTS:

	A=HORD
	B=LORD
	C=OVER2

	D=AC1H
	E=AC1L
	F=OVER1
/THREE WORD BY THREE WORD UNSIGNED MULTIPLY ROUTINE

/  (A+B+C)*(D+E+F) = (ONE+TWO+THREE+FOUR+FIVE+SIX)

/THE METHOD GENERATES ALL 6 WORDS BUT IS MODIFIED
/HERE TO PRESERVE ONLY THE 3 MOST SIGNIFICANT ONES.
/ADDITIONALLY THE RESULT IS ROUNDED OFF RATHER THAN
/TRUNCATED WHICH IMPROVES THE ACCURACY.

	*DMULT+6

CF,	TAD C		/'STL RAR'  FOR 2X2
	DCA .+3		/'JMP BE-1' FOR 2X2
	TAD F
	MQL MUY
	0
	MQL		/SAVE HIGH ORDER AND ERASE SIX

BF,	TAD B
	DCA .+3
	TAD F
	SWP MUY		/USE PREVIOUS HIGH ORDER AS
	0		/REMAINDER IN THIS POSITION
	TAD P4000	/ROUND OFF
	DCA FOUR	/SAVE INTERMEDIATE RESULT
	RAL
	DCA THREE	/SAVE CARRY AND/OR CLEAR THREE

CE,	TAD C
	DCA .+3
	TAD E
	SWP MUY		/ADD IN PREVIOUS
	0		/PARTIAL PRODUCT
	TAD FOUR	/SUM HIGH ORDER PARTS
	MQL		/DISCARD FIVE AND SAVE CARRY
	SZL
	ISZ THREE	/ACCUMULATE CARRIES

AF,	TAD A
	DCA .+3
	TAD F
	SWP MUY
	0
	TAD THREE	/BUILD UP LEAST SIGNIFICANT
	DCA THREE	/PART OF FINAL RESULT

CD,	TAD C
	DCA .+3
	TAD D
	SWP MUY
	0
	TAD THREE
	DCA THREE	/ENTRY POINT FOR 2X2
BE,	TAD B
	DCA .+3
	TAD E
	SWP MUY		/'MQL MUY'  FOR 2X2
	0
	TAD THREE
	JMS I 7152	/CONTINUE IN MP4 SPACE

AD,	TAD A		/FINAL PARTIAL PRODUCT
	DCA .+3
	TAD D
	SWP MUY
	0
	DCA HORD	/SAVE ONE
	SWP
	DCA LORD	/SAVE TWO
	JMS MULDIV	/COMPUTE SIGN & NORMALIZE
	JMP I DMULT
MULDIV=.


	*7200

MP4,	0
	MQL		/DISCARD FOUR
	RAL
	DCA TWO		/BUT SAVE CARRY

AE,	TAD A
	DCA .+3
	TAD E
	SWP MUY
	0
	TAD TWO		/SUM CARRY BITS
	DCA TWO		/WITH CARRY WORD

BD,	TAD B
	DCA .+3
	TAD D
	SWP MUY
	0
	TAD TWO
	SWP		/'MQL' FOR 2X2
	DCA OVER2	/SAVE THREE
	JMP I MP4	/FINISH UP

	ZBLOCK 30	/TWENTY-FOUR FREE WORDS

/NUMBER ASSIGNMENTS:

	TWO=OVER2
	THREE=SIGN
	FOUR=MULDIV

	$
