
	.IFUND	%NFLOP
/COPYRIGHT 1969, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
/FLOP	/FLOATING POINT OUTPUT
/THE INPUT ARGUMENT
/SPECIFIES THE DEVICE AND NUMBER OF
/DECIMAL DIGITS REQUIRED.
/
FLOP	0
	JMS	%FLIOK
	LAC*	FLOP		/GET THE ARGUMENT
	AND	(17		/DECIMAL DIGIT COUNT
	SNA			/IF 0 DIGITS REQ
	JMP	%FLOPF		/EXIT IMMEDIATELY
	DAC	%DPFLG
	TAD	(-12
	SMA			/IF RESULT .GE. 0
	JMP	%FLOPD		/NUMBER IS .GT. 10
/
/DETERMINE THE DEVICE
/
%FLOPE	LAC*	FLOP	/GET ARG AGAIN
	RCL			/BIT 0 TO LINK
	LAC	(JMS %PTP	/ASSUME PAPER TAPE PUNCH
	SNL			/IF LINK = 0 OUTPUT DEVICE = TTY
	LAC	(JMS %OTTY	/INSERT CALL
	DAC	%FLOUT+1		/IN DISPATCH ROUTINE.
	JMS	%FLOSC		/SCALE TO RAW DECIMAL
	JMS	%PKSGN	/OUTPUT SIGN OF MANTISSA (%OSIGN)
	LAW	256		/LOAD A DECIMAL POINT
	JMS	%FLOUT		/PACK IT INTO OUTPUT STREAM
	LAC	%DPFLG
	JMS	%ANEG.
	DAC	%DPFLG
	JMS	%FLODD		/GET A DECIMAL DIGIT
	JMS	%FLOUT	/OUTPUT
	ISZ	%DPFLG		/FINISHED?
	JMP	.-3		/NO .... GET ANOTHER DECIMAL DIGIT
/
	LAW	53		/SET EXPONENT SIGN TO PLUS CHARACTER
	DAC	%IOSIN		/UNTIL PROVED OTHERWISE
	DZM	%ODIG1		/ZERO EXPONENT DIGIT 1
	LAC	%POT		/ENTIRE EXP VALUE IN %POT
	SMA			/IF NEGATIVE NEGATE THE EXPONENT.
	JMP	%FLOPA
	JMS	%ANEG.
	DAC	%POT
	ISZ	%IOSIN		/MINUS SIGN
	ISZ	%IOSIN
%FLOPA	TAD	(-12		/DIVIDE %POT BY 10.0-QUOTIENT
	SPA			/TO %ODIG1, REMAINDER TO %POT
	JMP	%FLOPB		/END OF DIVISION
	DAC	%POT
	ISZ	%ODIG1
	JMP	%FLOPA		/LOOP BACK TO CONTINUE DIVISION
%FLOPB	LAC	%IOSIN		/OUTPUT THE EXPONENT SIGN
	JMS	%FLOUT
	LAW	260
	TAD	%ODIG1		/PACK DIG1 OF EXPONENT
	JMS	%FLOUT
	LAW	260
	TAD	%POT
	JMS	%FLOUT
%FLOPC	ISZ	FLOP		/RETURN ADDRESS
	JMS	%FLIOG
	JMP*	FLOP		/EXIT
%FLOPD	LAC	(11
	DAC	%DPFLG
	LAW	330
	JMS	%FLOUT
	JMP	%FLOPE
%FLOPF	LAW	330
	JMS	%FLOUT
	JMP	%FLOPC
/
/--------------------------------------------------------
/
/%FLOSC	/SCALE BINARY TO DECIMAL DATA
/ %DPFLG IS A WORD SET IN THE CALLING
/ROUTINE. IT HAS THE NUMBER OF DIGITS THE USER REQUIRES
/FOR HIS PRINTOUT. THE NUMBER IS IN THE FLT. ACC.
/
%FLOSC	0
	DZM	%OVFLG	/ OVERFLOW FLAG
	DZM	%IOSIN	/ SIGN
	DZM	%POT	/ POWER-OF-TEN
	LAC	%FAC2
	SNA		/IF NUMBER IS 0
	JMP*	%FLOSC	/EXIT IMMEDIATELY
	SMA			/IF MINUS STRIP
	JMP	.+4		/SING BIT AND
	AND	(377777	/
	DAC	%FAC2	/ TURN ON MINUS SIGN 
	ISZ	%IOSIN	/FLAG
	LAC	%FAC1
	SPA!SNA		/ MULTIPLYING BY 10 YIELDS
	JMP	%FLOCC	/FIRST DIGIT. IN ORDER TO AVOID
	CMA
	DAC	%IEXP	/INNUMERABLE DIVISIONS BY 10 IN THE
	JMS	%FH.	/CASE WHERE THE EXPONENT IS LARGE
	DZM	%FAC3	/AND POSITIVE. THE FLT ACC IS SAVED
	LAC	(200000	/AND THE FAC IS USED TO BUILD A
	DAC	%FAC2	/DIVISOR
	LAC	(1
	DAC	%FAC1
%FLOCA	LAC	%IEXP
	TAD	%FAC1
	SMA
	JMP	%FLOCB
	ISZ	%POT	/POT-POWER OF 10
	JMS	%MPY10
	JMP	%FLOCA
%FLOCB	JMS	%FD.	/FAC=HAC/FAC
		-44
		1
	JMS	%FIR.	/ROUND AND SIGN RESULT
		1
		-2
%FLOCC	LAC	(3	/AFTER SCALING POSITIVE EXPONENTS
	TAD	%FAC1	/BY DIVISION; OR IF THE EXPONENT OF
	SPA		/THE DATA IS NEGATIVE, THE FAC IS
	JMP	%FLOCD	/CHECKED IF IT IS LESS THAN
	SZA		/0.1 (-3/31463146...).
	JMP	%FLOCE	/IF SO, FAC IS MULTIPLIED BY 10
	LAC	%FAC2	/AND POT DECREMENTED BY ONE.
	TAD	(463147	/IF NOT, SCALING IS COMPLETE AND
	SPA		/THE DATA IS READY TO BE ROUNDED
	JMP	%FLOCD	/OFF.
	SZA
	JMP	%FLOCE
	LAC	%FAC3
	TAD	(314632
	SMA!SZA
	JMP	%FLOCE
/
%FLOCD	CLC		/POWER-OF-TEN VALUE.
	TAD	%POT	/DECREMENT BY 1
	DAC	%POT
	JMS	%MPY10
	JMP	%FLOCC
/ROUND OFF ROUTINE
%FLOCE	LAC	%DPFLG
	RCL
	TAD	%DPFLG
	TAD	%FLOCF
	DAC	%IEXP
	LAC*	%IEXP	/LOAD THE HELD ACC.
	DAC	%HAC1
	ISZ	%IEXP
	LAC*	%IEXP
	DAC	%HAC2
	ISZ	%IEXP
	LAC*	%IEXP
	DAC	%HAC3	/READY FOR ADDING
	JMS	%FA.
		42
	LAC	%FAC1
	SPA!SNA
	JMP*	%FLOSC
	ISZ	%OVFLG
	ISZ	%POT
	NOP
	JMP*	%FLOSC
/
%FLOCF	.DSA	%FLOCG-3	/TABLE ADDRESS
%FLOCG		-4	/.05
		314631
		463146
		-7	/.005
		243656
		050754
		-12	/.000 5
		203044
		672300
		-16	/.000 05
		321556
		135000
		-21	/.000 005
		247613
		261000
		-24	/.000 000 5
		206157
		364000
		-30	/.000 000 05
		326577
		123000
		-33	/.000 000 005
		253631
		5
		-36	/.000 000 000 5
		211341
		3
		-41	/.000 000 000 05
		334000
		2
/
/---------------------------------------------------------
/
%PKSGN	0
	LAC	%IOSIN
	SZA!CLA
	LAW	15
	TAD	(240
	JMS	%FLOUT
	JMP*	%PKSGN
/
/
/
%FLIOK	0		/KEEP THE FLOATING ACC.
	LAC	%FAC1
	DAC	%FLIO1
	LAC	%FAC2
	DAC	%FLIO2
	LAC	%FAC3
	DAC	%FLIO3
	JMP*	%FLIOK
/
%FLIOG	0		/GET FLOATING ACC
	LAC	%FLIO1
	DAC	%FAC1
	LAC	%FLIO2
	DAC	%FAC2
	LAC	%FLIO3
	DAC	%FAC3
	JMP*	%FLIOG
/
%FLIO1	0
%FLIO2	0
%FLIO3	0
/
/
/FLOATING OUTPUT DISPATCHER
/
%FLOUT	0		/ENTRY
	XX		/CALL DISPATCHER
	JMP*	%FLOUT	/EXIT
%PTP	0		/PAPERTAPE PUNCH
	PSF
	JMP	.-1
	PSA
	JMP*	%PTP
%OTTY	0		/TELETYPE PRINTER OR PUNCH
/
PSF=700201
PSA=700202
	TSF
	JMP	.-1
	TLS
	JMP*	%OTTY
/
PSF=700201
PSA=700202
/
/-------------------------------------------------------------
/
/OUTPUT A DECIMAL DIGIT
/
%FLODD	0
	DZM	%DIG
	LAC	%OVFLG	/CHECK OVERFLOW FLAG SET
	SZA		/IN FLOPSC ROUTINE. 
	JMP	%FLODC	/FROM FAC BY CLEAR BIT 2 OF FAC 2
	JMS	%MPY10	/MULTIPLY FAC BY 10 TO
			/EXTRACT THE NEXT DECIMAL DIGIT
	LAC	%FAC1
	SPA!SNA		/IF FAC EXPONENT. LE.0, DIGIT
	JMP	%FLODB	/IS A ZER0. IF.GT.0 THE
	JMS	%ANEG.	/EXPONENT IS COMPLEMENTED TO
	DAC	%IEXP	/USE AS A SHIFT COUNTER TO
	JMS	%DSHL	/SHIFT THE INTEGER BITS OF
%FLODA	JMS	%DSHL	/MS /LS INTO DIG
	LAC	%DIG
	RAL
	DAC	%DIG
	ISZ	%IEXP
	JMP	%FLODA
	JMS	%DSHR	/NULLIFY SIGN BIT
%FLODB	JMS	%TRML
	DZM	%FAC1	/EXIT IS TAKEN WITH THE
	LAW	60	/ASCII-7 CODE OF THE
	XOR	%DIG	/DECIMAL DIGIT IN THE AC.
	JMP*	%FLODD
%FLODC	ISZ	%DIG	/1ST DIGIT IS .1
	DZM	%OVFLG
	LAC	%FAC2	/FAC=FAC-.1
	AND	(177777	/STRIP OFF BIT 1
	DAC	%MS
	LAC	%FAC3
	DAC	%LS
	JMS	%DSHL
	JMP	%FLODB
	.ENDC
/
/---------------------------------------------------------------------
/
	.IFUND	%NFLIP
/FLOATING POINT INPUT
/SUBROUTINE FLIP WILL INPUT A FLOATING POINT NUMBER
/FROM EITHER THE TELETYPE OR THE PAPER TAPE READER.
/ITS ONLY ARGUMENT IS THE DEVICE ASSIGNMENT (000000 = TTY,
/400000 = PTR). SPACES AND ILLEGAL CHARACTERS ARE
/IGNORED BY FLIP UNTIL THE 1ST NUMB IS READ.
/
FLIP	0
	LAC*	FLIP	/GET INPUT ARG
	RCL		/BIT 0 TO LINK
	LAC	(JMS %PTR	/ASSUME PAPER TAPE READER
	SNL		/IF LINK = 0 INPUT DEVICE IS TTY
	LAC	(JMS %ITTY
	DAC	%FLIPR+1	/INSERT JUMP AT READ DISPATCHER
	JMS	%FLIPX	/READ INTO FAC UNTIL DELIMITED
	JMS	%FLISC	/SCALE THE RAW INPUT VALUE
	ISZ	FLIP	/POINT TO RETURN ADDRESS
	JMP*	FLIP	/EXIT
/FLOATING POINT READ DISPATCHER.
/
%FLIPR	0
	XX		/DISPATCHER
	JMP*	%FLIPR	/EXIT
%ITTY	0		/TELETYPE READ
	KSF
	JMP	.-1
	KRB
	AND	(177	/ASCII-7
	JMP*	%ITTY
%PTR	0		/PAPER TAPE READ
	RSF
	JMP	.-1
	RRB
	RSA
	AND	(177	/ASCII-7
	JMP*	%PTR
KRS=700322
RRB=700112
RSF=700101
RSA=700104
RSF=700101
RSA=700104
/
/-----------------------------------------------------------
/
/FLIPEX		/THIS SUBROUTINE INPUTS CHARACTERS FROM AN
/EXTERNAL FIELD. THE LOOP WILL STOP AFTER A SECOND EXPONENT CHARACTER,
/A DELIMITING CHARACTER, OR AN ERROR CHARACTER HAS BEEN READ.
/
%FLIPX	0
	DZM	%IOSIN	/SIGN OF MANTISSA
	DZM	%IEXP	/SIGN OF EXPONENT
	DZM	%MS	/HIGH-ORDER BUILDER WORD
	DZM	%LS	/LOW-ORDER BUILDER WORD
	DZM	%NCNT	/COUNT OF NUMBERS IN MANTISSA
	DZM	%DCNT	/COUNT OF NUMBERS BEFORE DECIMAL POINT
	DZM	%DPFLG	/FLAG FOR DECIMAL POINT
	DZM	%POT
/
/THE FIRST NUMBER ENCOUNTERED IS STORED AT %LS
/ALL SUCCEEDING NUMBERS ARE CONVERTED USING
/THE FORMULA:%MS,%LS = %LS*10+NUMBER. IN THIS
/WAY THE ENTIRE NUMBER IS TREATED AS AN INTEGER. IF
/THERE ARE DECIMALS THE NUMBER IS CONVERTED LATER
/BY SUBROUTINE FLIPSC.
/
%FLIXA	JMS	%FLIPR	/FETCH CHARACTER FROM BUFFER.
	SAD	(53	/IF CHARACTER IS  PLUS SIGN,
	JMP	%FLIXA	/IGNORE IT AND GET ANOTHER CHARACTER.
	SAD	(55	/IF CHARACTER IS A MINUS SIGN
	JMP	%FLIXB	/INCREMENT %ISGN AN GET ANOTHER CHARACTER
	SAD	(56	/IF CHARACTER IS A DECIMAL POINT
	JMP	%FLIXC	/STORE %NCNT IN %DCNT FOR SCALING
	JMS	%NUMTS	/TEST FOR FIRST NUMBER
	JMP	%FLIXA	/IF NOT IGNORE IT.
	DAC	%LS	/YES..SAVE FIRST NUMBER
	ISZ	%POT
	JMP	%FLIXD-1	/GET THE REST OF THE NUMBERS
%FLIXB	ISZ	%IOSIN	/SIGN = MINUS
	JMP	%FLIXA	/GET ANOTHER CHARACTER
/
/AT THIS POINT A NUMBER OR A DECIMAL POINT HAS BEEN READ.
/A CHARACTER READ NOW THAT IS NOT A DECIMAL POINT OR A
/NUMBER WILL CAUSE THE MANTISSA TO BE DELIMITED.
/
%FLIXC	LAC	%NCNT	/TOTAL NUMBERS SO FAR
	DAC	%DCNT	/NUMBERS PRECEEDING DECIMAL POINT
	ISZ	%DPFLG	/A DECIMAL POINT WAS READ
	SKP
	ISZ	%NCNT	/NCOUNT=NCOUNT+1
%FLIXD	JMS	%FLIPR	/GET A CHARACTER
	JMS	%NUMTS	/IS IT A NUMBER
	JMP	%FLIXE	/NO...TEST FOR DECIMAL POINT
	DAC	%FLISC
	LAC	%POT
	SAD	(11
	JMP	%FLIXD
	ISZ	%POT
	LAC	%FLISC
	JMS	%MPTEN	/YES...%MS,LS=10*%LS + NUMBER
	JMP	%FLIXD-1	/INCREMENT NCOUNT AND CONTINUE.
%FLIXE	SAD	(56
	JMP	%FLIXC
/THE CHARACTER IS NOT A DECIMAL POINT OR A NUMBER.
/THE MANTISSA IS DELIMITED. IF THE CHARACTER IS NOT A
/SPACE,+,-, OR E THE CHARACTER IS TAKEN AS A FLOATING
/POINT NUMBER DELIMITER AND THE PROGRAM EXITS.
/
	JMS	%TRML	/SAVE NUMBER SO FAR
	LAC	%MPY10	/AC STORED NUMTST
	DZM	%LS	/CLEAR EXPONENT FIELD
%FLIXF	SAD	(40	/IF BLANK IGNORE IT
	JMP	%FLIXG	/AND GET NEXT CHAR
	SAD	(53	/IF PLUS SIGN IGNORE IT
	JMP	%FLIXG
	SAD	(55	/IF MINUS SIGN INCREMENT
	JMP	%FLIXG-1	/EXPONENT SIGN (%IEXP)
	SAD	(105	/IF-E-IGNORE IT
	JMP	%FLIXG	/GET ANOTHER CHARACTER
	JMP*	%FLIPX	/MUST BE DELIMITER--EXIT
/
	ISZ	%IEXP	/MINUS SIGN
%FLIXG	JMS	%FLIPR	/GET ANOTHER CHARACTER
	JMS	%NUMTS	/IS IT THE FIRST NUMBER
	JMP	%FLIXF	/NO...WHAT IS IT?
	DAC	%LS	/YES...SAVE IT AND GET LAST.
	JMS	%FLIPR	/CHARACTER. IF IT IS NOT A NUMBER
	JMS	%NUMTS	/IT IS IGNORED.
	SKP
	JMS	%MPTEN	/LS=10*LS+NUMBER
	LAC	%IEXP	/IF=SIGN OF EXPONENT (%LS)
	SNA		/IS NOT 0 NEGATE THE
	JMP*	%FLIPX	/EXPONENT BEFORE
	LAC	%LS	/EXITING.
	JMS	%ANEG.
	DAC	%LS
	JMP*	%FLIPX	/EXIT
/
/----------------------------------------------------------------
/
/FLOATING POINT INPUT SCALER ROUTINE
/SCALE THE RAW INPUT VALUE IN THE FLOATING ACCUMULATOR
/TO FLOATING POINT BINARY. NORMALIZE IT, AND INSERT THE
/SIGN.
/
%FLISC	0
	LAC	%DPFLG	/WAS THERE A DECIMAL POINT
	SNA		/YES...COMPUTE THE 1ST HALF
	JMP	.+4	/OF THE SCALE FACTOR BY
	LAC	%NCNT	/SUBTRACTING THE TOTAL
	JMS	%ANEG.	/NUMBER OF DIGITS FROM
	TAD	%DCNT	/THE NUMBER OF INTEGER DIGITS.
	TAD	%LS	/COMPLETE THE SCALE FACTOR
	DAC	%NCNT	/BY ADDING THE EXPONENT
/
/IF SCALE FACTOR IS ZERO THE CONVERSION IS COMPLETE AND
/THE SIGN MUST BE INSERTED. IF THE SCALE FACTOR IS POSITIVE
/THE NUMBER MUST BE MULTIPLIED BY 10 (%NCNT) TIMES.
/IF THE SCALE FACTOR IS NEGATIVE IT MUST BE DIVIDED BY
/10 (%NCNT) TIMES.  INSTEAD OF DIVIDING BY 10 %NCNT TIMES
/SAVE THE FLOATING ACC IN THE HELD ACC. LOAD 1.0
/INTO THE FLT ACC AND MULTIPLY IT BY 10 %NCNT TIMES.
/DIVIDE THE ORIGINAL NUMBER BY THIS PRODUCT TO
/COMPLETE THE CONVERSION.
/
	LAC	(43
	DAC	%FAC1
	JMS	%FNOR.
	LAC	%FAC2	/IF NUMB IS 0
	SNA
	JMP*	%FLISC	/EXIT IMMEDIATELY
	LAC	%NCNT
	SNA		/SCALE FACTOR=0?
	JMP	%FLICC	/YES..INSERT SIGN
	SMA
	JMP	%FLICB	/POSITIVE..MULTIPLY ROUTINE
	JMS	%FH.	/NEGATIVE..SAVE THE FLTACC.
	DZM	%FAC3	/LOAD FLOATING ACC
	LAC	(200000	/WITH 1.0
	DAC	%FAC2
	LAC	(1
	DAC	%FAC1
	LAC	%NCNT
	SKP
%FLICB	JMS	%ANEG.	/NEGATE THE POSITIVE SCALE FACTOR
	DAC	%DCNT	/SAVE AS MULTIPLY COUNTER
	JMS	%MPY10	/FLT ACC *10
	ISZ	%DCNT	/FINISHED?
	JMP	.-2	/NO MULTIPLY AGAIN
	LAC	%NCNT
	SMA		/YES...IF %NCNT. GT.0 CONVERSION IS COMPLETE.
	JMP	%FLICC
	JMS	%FD.	/NO...DIVIDE TO COMPLETE CONVERSION
		-44	/LOOP COUNT
		1	/INSERT QUOTIENT BIT
/INSERT THE SIGN AND ROUND OFF THE LOW ORDER BIT.
/
%FLICC	LAC	%IOSIN	/%ISIGN=0 IF POSITIV
	SZA		/%ISIGN. NE.0 IF NEG.
	LAC	(400000
	DAC	%FSIGN	/USED BY %FIR.
	JMS	%FIR.	/INSERT SIGN AND ROUND
		1	/ROUND OFF BIT
		-2	/MASK-OFF BIT
	JMP*	%FLISC	/EXIT
	.ENDC
/
/-----------------------------------------------------------------------
/
/SHIFT BUILDER WORD LEFT 1 BIT (%MS,%LS)
/
%DSHL	0
	LAC	%LS
	RCL
	DAC	%LS
	LAC	%MS
	RAL
	DAC	%MS
	JMP*	%DSHL	/EXIT
/SHIFT BUILDER WORDS RIGHT 1 BIT (%MS,	%LS)
/
%DSHR	0
	LAC	%MS
	RCR
	DAC	%MS
	LAC	%LS
	RAR
	DAC	%LS
	JMP*	%DSHR	/EXIT
/
/MULTIPLY THE INPUT BUILDER WORDS (%MS,%LS) BY 10
/AND ADD THE AC TO IT. IF THE PRODUCT OR SUM OVERFLOWS
/INTO THE SIGN BIT EXIT AFTER RESTORING NUMBER.
/
/
%MPTEN	0		/AC=4-BIT BINARY NUMBER ON ENTRANCE
	DAC	%TRML	/SAVE THE NUMBER TO BE ADDED
	JMS	%DSHL	/1ST SHIFT
	LAC	%LS	/SAVE RESULTS OF FIRST SHIFT
	DAC	%TLS
	LAC	%MS
	DAC	%TMS
	JMS	%DSHL
	JMS	%DSHL
/
/ADD THE RESULTS OF THE FIRST SHIFT TO %MS AND %LS AND THE
/ENTRY VALUE AT %TAC.
/
	CLL
	LAC	%LS
	TAD	%TLS
	SZL!CLL		/IF OVERFLOW INCREMENT %MS
	ISZ	%TMS
	NOP
	TAD	%TRML	/ADD ENTRY VALUE
	DAC	%LS
	GLK		/IF OVERFLOW;ADD LINK
	TAD	%MS
	TAD	%TMS	/OVERFLOW OFF HIGH-ORDER END IS LOST.
	DAC	%MS
	JMP*	%MPTEN
/
/TRANSFER THE TWO WORK WORDS (%MS,%LS) TO THE FLOATING ACC.
/THE SIGN BIT IS DROPPED.
/
/CALLING SEQUENCE:
/	JMS	TRMSLS	/SUBR CALL
/	NEXT INSTRUCTION	/RETURN HERE FROM TRMSLS
/
%TRML	0
	LAC	%MS
	AND	(377777	/DROP OFF SIGN BIT
	DAC	%FAC2
	LAC	%LS
	DAC	%FAC3
	JMP*	%TRML	/EXIT
/
/MULTIPLY FLOATING ACCUMULATOR BY TEN
/CALLING SEQUENCE:
/	JMS	MPYTEN	/SUBR CALL
/	NEXT INSTRUCTION	/RETURN HERE FROM MPYTEN
/
%MPY10	0		/ENTRY-EXIT
	LAC	%FAC2	/THE MULTIPLICATION IS
	DAC	%MS	/ACCOMPLISHED BY STORING THE
	LAC	%FAC3	/MANTISSA OF THE FLOATING ACC
	DAC	%LS	/INTO TWO WORK WORDS. THESE
	JMS	%DSHR	/WORK WORDS ARE SHIFTED RIGHT
	JMS	%DSHR	/TWICE AND ROUNDED.
	GLK		/AFTER THE SHIFTING THE ORIGINAL
	TAD	%FAC3	/NUMBER IS ADDED TO THE WORK
	TAD	%LS	/WORDS. THE SUM IS STORED
	DAC	%LS	/IN THE WORK WORDS BECAUSE
	GLK		/AN OVERFLOW MAY HAVE
	TAD	%FAC2	/OCCURED. IF SO, THE WORDS MUST
	TAD	%MS	/BE SHIFTED RIGHT ONCE MORE
	DAC	%MS	/AND THE PRODUCT EXPONENT MUST
	SMA!CLA		/BE INCREMENTED BY FOUR INSTEAD
	JMP	.+3	/OF THREE.
	JMS	%DSHR
	LAC	(1	/ADD 3 OR 4 TO EXPONENT
	TAD	(3	/DEPENDING WHETHER OR NOT
	TAD	%FAC1	/%FAC2 OVERFLOWED INTO
	DAC	%FAC1	/THE SIGN BIT.
	JMS	%TRML	/RESTORE FLOATING ACCUMULATOR
	JMP*	%MPY10	/EXIT
/TEST FOR NUMERIC CHARACTER
/CALLING SEQUENCE: --
/		LAC	CHARACTER 8ASCII-7)
/		JMS	NUMTST
/		JMP	NO (TESTED CHARACTER IN AC)
/		JMP	YES (BINARY VALUE OF CHARACTER IN AC)
%NUMTS	0
	DAC	%MPY10	/SAVE CHARACTER
	TAD	(-72	/IS IT LESS THAN OR EQUAL TO NINE.
	SMA		/YES, TEST AGAIN.
	JMP	%NUM1	/NO, EXIT.
	TAD	(12	/IS IT GREATER THAN OR EQUAL TO ZERO
	SPA		/YES, VALID NUMBER.
	JMP	%NUM1	/NO, EXIT.
	ISZ	%NUMTS	/BUMP RETURN ADDRESS AND EXIT WITH BINARY.
	JMP*	%NUMTS	/VALUE OF CHARACTER IN AC.
%NUM1	LAC	%MPY10	/EXIT WITH ORIGINAL CHARACTER IN AC.
	JMP*	%NUMTS
			/TEMP STORAGE FOR (AC) AT ENTRY.
/
%IEXP	0
%MS	0
%LS	0
%NCNT	0
%DCNT	0
%DPFLG	0
%TLS	0
%TMS	0
%DIG	0
%OVFLG	0
%POT	0
%IOSIN	0
%ODIG1	0
	.EOT
