Google
 

Trailing-Edge - PDP-10 Archives - klad_sources - klad.sources/dfkca3.mac
There are no other files named dfkca3.mac in the archive.
SUBTTL	DIAGNOSTIC SECTION - FIX - CONVERSION OF 0

DEFINE	SAVEAC	(A,B)<
	MOVEI	SAC,.
	MOVEM	SAC,TESTPC		;SETUP SUBTEST PC
	MOVEI	SAC,SAC			;INFORM ERROR ROUTINE WHICH
	MOVEM	SAC,ERRLOP#		;AC IS USED FOR ITERATION>

;CHECK THAT 'FIX AC,E' DOES NOT MODIFY C(E)
CC00:	AC=4
	SAC=<AC+4>&17
	SAVEAC	(1,1)

;THIS TEST VERIFIES THAT THE FIX INSTRUCTION DOES NOT DESTROY C(E)

Q10:	MOVE	AC-2,[233525,,252525]	;LOAD 'E' WITH DATA
	FIX	AC,AC-2			;*CONVERT FLT PT NO. IN E TO FIX PT AND STORE IN AC
	CAME	AC-2,[233525,,252525]	;WAS FLT PT NBR MODIFIED
	ER5	AC-2,11			;C(E) WAS CLOBBERED
	JUMPL	SAC,Q10			;LOOP ON ERROR SWITCH

;CONVERT A FLOAT POINT NO. OF ZEROS TO FIXED PT

	AC=4
	SAC=<AC+4>&17
	SAVEAC	(1,1)

;THIS TEST VERIFIES THAT A FLT PT NO. OF 0 CONVERTED TO FIX PT BY
;FIX, REMAINS 0.

Q100:	SETZM	AC-2			;INITIALIZE FLT PT NBR IN 'E'
	FIX	AC,AC-2			;*CONVERT FLT PT NO OF 0 TO FIX PT
	CAIE	AC,0			;WAS FLT PT 0 CONVERTED CORRECTLY?
	ER3	AC,101			;FIX PT NBR IS INCORRECT
	JUMPL	SAC,Q100		;LOOP ON ERROR SWITCH
SUBTTL	DIAGNOSTIC SECTION - FIX - POSITIVE INTEGERS-RIPPLE ONES

SN=200
	XX=200400
	YY=0

Q200:	REPEAT	^D18,<
;THIS TEST VERIFIES THAT THE FIX INSTRUCTION CONVERTS THE FLT PT NO.
;IN MEMORY TO FIX PT AND PLACES THE RESULT IN THE AC
;DATA: RIPPLE A "1" THROUGH A FIELD OF "0'S" - POSITIVE INTEGERS

SN=SN+1
	XX=XX+1000
	YY=YY+YY
	IFE	YY,<YY=1>
	MOVSI	AC-2,XX			;INITIALIZE FLT PT NBR
	HRRZI	AC-1,YY			;RESULT FOR COMPARISON
	FIX	AC,AC-2			;*CONVERT FLT PT NO. IN 'E' TO FIX PT AND PLACE IN AC
	CAME	AC,AC-1			;FAILURE IF TESTED BIT IS NOT SET
	ER3	AC,SN			;FIX PT NBR INCORRECT
	JUMPL	SAC,.-5			;LOOP ON ERROR SWITCH
>
PAGE
SN=300
	YY=0

Q300:	REPEAT	^D17,<
;THIS TEST VERIFIES THAT THE FIX INSTRUCTION CONVERTS THE FLT PT NO.
;IN MEMORY TO FIX PT AND PLACES THE RESULT IN THE AC
;DATA: RIPPLE A "1" THROUGH A FIELD OF "0'S" - POSITIVE INTEGERS

SN=SN+1
	XX=XX+1000
	YY=YY+YY
	IFE	YY,<YY=1>
	MOVSI	AC-2,XX			;INITIALIZE FLT PT NBR
	MOVSI	AC-1,YY			;RESULT FOR COMPARISON
	FIX	AC,AC-2			;*CONVERT FLT PT NO. IN 'E' TO FIX PT AND PLACE IN AC
	CAME	AC,AC-1			;FAILURE IF TESTED BIT IS NOT SET
	ER3	AC,SN			;FIX PT NBR INCORRECT
	JUMPL	SAC,.-5			;LOOP ON ERROR SWITCH
>
SUBTTL	DIAGNOSTIC SECTION - FIX - CONVERSION OF FLT PT 1

;VERIFY THAT ALL FLT PT NBRS EQUAL TO "1" CONVERT CORRECTLY TO FIX PT

SN=500
	XX=200000
	YY=1000

Q500:	REPEAT	^D9,<
;THIS TEST VERIFIES THAT THE FIX INSTRUCTION CONVERTS THE FLT PT NO.
;IN MEMORY TO FIX PT AND PLACES THE RESULT IN THE AC
;VERIFY THAT ALL FLT PT NBRS EQUAL TO "1" CONVERT CORRECTLY TO FIX PT

SN=SN+1
	XX=XX+1000
	YY=YY/2
	MOVSI	AC-2,XX			;INITIALIZE FLT PT NBR
	TLO	AC-2,YY			;RESULT FOR COMPARISON
	FIX	AC,AC-2			;*CONVERT FLT PT 1 IN 'E' TO FIX PT 1 AND PLACE IN AC
	CAIE	AC,1			;IS RESULT IN AC = 1?
	ER3	AC,SN			;FIX PT NBR NOT EQUAL TO 1
	JUMPL	SAC,.-5			;LOOP ON ERROR SWITCH
>
PAGE
SN=600
	YY=0

Q600:	REPEAT	^D18,<
;THIS TEST VERIFIES THAT THE FIX INSTRUCTION CONVERTS THE FLT PT NO.
;IN MEMORY TO FIX PT AND PLACES THE RESULT IN THE AC
;VERIFY THAT ALL FLT PT NBRS EQUAL TO "1" CONVERT CORRECTLY TO FIX PT

SN=SN+1
	XX=XX+1000
	YY=YY/2
	IFE	YY,<YY=400000>
	MOVSI	AC-2,XX			;INITIALIZE FLT PT NBR
	HRRI	AC-2,YY
	FIX	AC,AC-2			;*CONVERT FLT PT 1 IN 'E' TO FIX PT 1 AND PLACE IN AC
	CAIE	AC,1			;IS RESULT IN AC = 1?
	ER3	AC,SN			;FIX PT NBR NOT EQUAL TO 1
	JUMPL	SAC,.-5			;LOOP ON ERROR SWITCH
>

SUBTTL	DIAGNOSTIC SECTION - FIX - NEGATIVE INTEGERS-RIPPLE ZEROS

SN=700
	XX=577000
	ZZ=0

Q700:	REPEAT	^D2,<
;THIS TEST VERIFIES THAT THE FIX INSTRUCTION CONVERTS THE FLT PT NO.
;IN MEMORY TO FIX PT AND PLACES THE RESULT IN THE AC
;DATA:	RIPPLE A "0" THROUGH A FIELD OF "1'S" - NEGATIVE NUMBERS

SN=SN+1
	XX=XX-1000
	ZZ=<ZZ+ZZ>&777777
	IFE	ZZ,<ZZ=777777>
	MOVSI	AC-2,XX			;INITIALIZE FLT PT NBR
	TLO	AC-2,400
	HRROI	AC-1,ZZ			;RESULT FOR COMPARISON
	FIX	AC,AC-2			;*CONVERT FLT PT NO. IN 'E' TO FIX PT
	CAME	AC,AC-1			;IS TESTED BIT CLEAR?
	ER3	AC,SN			;FAILURE IF TESTED BIT IS NOT CLEAR
	JUMPL	SAC,.-6			;LOOP ON ERROR SWITCH
>
PAGE
SN=1000
	XX=576000
	YY=0
	ZZ=777776

Q1000:	REPEAT	^D8,<
;THIS TEST VERIFIES THAT THE FIX INSTRUCTION CONVERTS THE FLT PT NO.
;IN MEMORY TO FIX PT AND PLACES THE RESULT IN THE AC
;DATA:	RIPPLE A "0" THROUGH A FIELD OF "1'S" - NEGATIVE NUMBERS

SN=SN+1
	XX=XX-1000
	YY=YY!<YY/2>
	ZZ=<ZZ+ZZ+1>&777777
	IFE	YY,<YY=200>
	MOVSI	AC-2,XX			;INITIALIZE FLT PT NBR
	TLO	AC-2,YY
	HRROI	AC-1,ZZ			;RESULT FOR COMPARISON
	FIX	AC,AC-2			;*CONVERT FLT PT NO. IN 'E' TO FIX PT 
	CAME	AC,AC-1			;IS TESTED BIT CLEAR?
	ER3	AC,SN			;FAILURE IF TESTED BIT IS NOT CLEAR
	JUMPL	SAC,.-6			;LOOP ON ERROR SWITCH
>
SN=1100
	XX=566377
	YY=0
	ZZ=777377

Q1100:	REPEAT	^D9,<
;THIS TEST VERIFIES THAT THE FIX INSTRUCTION CONVERTS THE FLT PT NO.
;IN MEMORY TO FIX PT AND PLACES THE RESULT IN THE AC
;DATA:	RIPPLE A "0" THROUGH A FIELD OF "1'S" - NEGATIVE NUMBERS

SN=SN+1
	XX=XX-1000
	YY=YY!<YY/2>
	ZZ=<ZZ+ZZ+1>&777777
	IFE	YY,<YY=400000>
	MOVSI	AC-2,XX			;INITIALIZE FLT PT NBR
	HRRI	AC-2,YY
	HRROI	AC-1,ZZ			;RESULT FOR COMPARISON
	FIX	AC,AC-2			;*CONVERT FLT PT NO. IN 'E' T0 FIX PT
	CAME	AC,AC-1			;IS TESTED BIT CLEAR?
	ER3	AC,SN			;FAILURE IF TESTED BIT IS NOT CLEAR
	JUMPL	SAC,.-6			;LOOP ON ERROR SWITCH
>

SN=1200
	ZZ=0

Q1200:	REPEAT	^D9,<
;THIS TEST VERIFIES THAT THE FIX INSTRUCTION CONVERTS THE FLT PT NO.
;IN MEMORY TO FIX PT AND PLACES THE RESULT IN THE AC
;DATA:	RIPPLE A "0" THROUGH A FIELD OF "1'S" - NEGATIVE NUMBERS

SN=SN+1
	XX=XX-1000
	YY=YY!<YY/2>
	ZZ=<ZZ+ZZ+1>&777777
	IFE	<ZZ-1>,<ZZ=777776>
	MOVSI	AC-2,XX			;INITIALIZE FLT PT NBR
	HRRI	AC-2,YY			;RESULT FOR COMPARISON
	HRLOI	AC-1,ZZ
	FIX	AC,AC-2			;*CONVERT FLT PT NO. IN 'E' TO FIX PT
	CAME	AC,AC-1			;IS TESTED BIT CLEAR?
	ER3	AC,SN			;FAILURE IF TESTED BIT IS NOT CLEAR
	JUMPL	SAC,.-6			;LOOP ON ERROR SWITCH
>
PAGE
SN=1300
	XX=544377
	ZZ=777377
	WW=777777

Q1300:	REPEAT	^D8,<
;THIS TEST VERIFIES THAT THE FIX INSTRUCTION CONVERTS THE FLT PT NO.
;IN MEMORY TO FIX PT AND PLACES THE RESULT IN THE AC
;DATA:	RIPPLE A "0" THROUGH A FIELD OF "1'S" - NEGATIVE NUMBERS

SN=SN+1
	XX=XX-1000
	ZZ=<ZZ+ZZ+1>&777777
	WW=<WW+WW>&777777
	HRLOI	AC-2,XX			;INITIALIZE FLT PT NBR
	HRLI	AC-1,ZZ			;RESULT FOR COMPARISON
	HRRI	AC-1,WW
	FIX	AC,AC-2			;*CONVERT FLT PT NO. IN 'E' TO FIX PT
	CAME	AC,AC-1			;IS TESTED BIT CLEAR?
	ER3	AC,SN			;FAILURE IF TESTED BIT IS NOT CLEAR
	JUMPL	SAC,.-6			;LOOP ON ERROR SWITCH
>
PAGE
;THIS TEST VERIFIES THAT THE FIX INSTRUCTION CONVERTS THE FLT PT NO.
;IN MEMORY TO FIX PT AND PLACES THE RESULT IN THE AC
;DATA:	RIPPLE A "0" THROUGH A FIELD OF "1'S" - NEGATIVE NUMBERS

Q1400:	HRLOI	AC-2,243777		;INITIALIZE FLT PT NBR
	HRLI	AC-1,377777		;RESULT FOR COMPARISON
	HRRI	AC-1,777400
	FIX	AC,AC-2			;*CONVERT FLT PT NO. IN 'E' TO FIX PT
	CAME	AC,AC-1			;IS TESTED BIT CLEAR?
	ER3	AC,1401			;FAILURE IF TESTED BIT IS NOT CLEAR
	JUMPL	SAC,Q1400		;LOOP ON ERROR SWITCH
SUBTTL	DIAGNOSTIC SECTION - FIX - TRUNCATION

;CHECK THAT "FIX" TRUNCATES THE RESULT SUCH THAT
;IF THE VALUE OF 'X' IS GREATER THAN 'N' BUT LESS THAN
;N+1, "FIX" CONVERTS 'X' TO 'N' IF X IS POSITIVE,
;AND "FIX" CONVERTS 'X' TO N+1 IF X IS NEGATIVE WHERE N IS AN
;INTEGER AND 'X' IS THE FLOATING POINT NUMBER BEING
;CONVERTED.

Q1500:	MOVSI	AC-2,576000		;SET-UP FLT PT NBR
	HRRI	AC-2,1
	SETOM	AC-1			;SET-UP EXPECTED RESULT
	FIX	AC,AC-2			;*CONVERT FLT PT NO. IN 'E' TO FIX PT,
					;TRUNCATE RESULT, AND PLACE IN AC
	CAME	AC,AC-1			;IS RESULT TRUNCATED?
	ER3	AC,1501			;TRUNCATION FAILED IN CONVERSION
	JUMPL	SAC,Q1500		;LOOP ON ERROR SWITCH

;CHECK THAT "FIX" TRUNCATES THE RESULT SUCH THAT
;IF THE VALUE OF 'X' IS GREATER THAN 'N' BUT LESS THAN
;N+1, "FIX" CONVERTS 'X' TO 'N' IF X IS POSITIVE,
;AND "FIX" CONVERTS 'X' TO N+1 IF X IS NEGATIVE WHERE N IS AN
;INTEGER AND 'X' IS THE FLOATING POINT NUMBER BEING
;CONVERTED.

Q1600:	HRLZI	AC-2,576200		;SET-UP FLT PT NBR
	SETOM	AC-1			;SET-UP EXPECTED RESULT
	FIX	AC,AC-2			;*CONVERT FLT PT NO. IN 'E' TO FIX PT,
					;TRUNCATE RESULT, AND PLACE IN AC
	CAME	AC,AC-1			;IS RESULT TRUNCATED?
	ER3	AC,1601			;TRUNCATION FAILED IN CONVERSION
	JUMPL	SAC,Q1600		;LOOP ON ERROR SWITCH
;CHECK THAT "FIX" TRUNCATES THE RESULT SUCH THAT
;IF THE VALUE OF 'X' IS GREATER THAN 'N' BUT LESS THAN
;N+1, "FIX" CONVERTS 'X' TO 'N' IF X IS POSITIVE,
;AND "FIX" CONVERTS 'X' TO N+1 IF X IS NEGATIVE WHERE N IS AN
;INTEGER AND 'X' IS THE FLOATING POINT NUMBER BEING
;CONVERTED.

Q1700:	MOVSI	AC-2,576200		;SET-UP FLT PT NBR
	HRRI	AC-2,1
	SETOM	AC-1			;SET-UP EXPECTED RESULT
	FIX	AC,AC-2			;*CONVERT FLT PT NO. IN 'E' TO FIX PT,
					;TRUNCATE RESULT, AND PLACE IN AC
	CAME	AC,AC-1			;IS RESULT TRUNCATED?
	ER3	AC,1701			;TRUNCATION FAILED IN CONVERSION
	JUMPL	SAC,Q1700		;LOOP ON ERROR SWITCH

;CHECK THAT "FIX" TRUNCATES THE RESULT SUCH THAT
;IF THE VALUE OF 'X' IS GREATER THAN 'N' BUT LESS THAN
;N+1, "FIX" CONVERTS 'X' TO 'N' IF X IS POSITIVE,
;AND "FIX" CONVERTS 'X' TO N+1 IF X IS NEGATIVE WHERE N IS AN
;INTEGER AND 'X' IS THE FLOATING POINT NUMBER BEING
;CONVERTED.

Q2000:	MOVSI	AC-2,577000		;SET-UP FLT PT NBR
	HRRI	AC-2,1			;SET-UP EXPECTED RESULT
	FIX	AC,AC-2			;*CONVERT FLT PT NO. IN 'E' TO FIX PT,
					;TRUNCATE RESULT, AND PLACE IN AC
	CAIE	AC,0			;IS RESULT TRUNCATED?
	ER3	AC,2001			;TRUNCATION FAILED IN CONVERSION
	JUMPL	SAC,Q2000		;LOOP ON ERROR SWITCH
;CHECK THAT "FIX" TRUNCATES THE RESULT SUCH THAT
;IF THE VALUE OF 'X' IS GREATER THAN 'N' BUT LESS THAN
;N+1, "FIX" CONVERTS 'X' TO 'N' IF X IS POSITIVE,
;AND "FIX" CONVERTS 'X' TO N+1 IF X IS NEGATIVE WHERE N IS AN
;INTEGER AND 'X' IS THE FLOATING POINT NUMBER BEING
;CONVERTED.

Q2100:	MOVSI	AC-2,577400		;SET-UP FLT PT NBR
	FIX	AC,AC-2			;*CONVERT FLT PT NO. IN 'E' TO FIX PT,
					;TRUNCATE RESULT, AND PLACE IN AC
	CAIE	AC,0			;IS RESULT TRUNCATED?
	ER3	AC,2101			;TRUNCATION FAILED IN CONVERSION
	JUMPL	SAC,Q2100		;LOOP ON ERROR SWITCH

;CHECK THAT "FIX" TRUNCATES THE RESULT SUCH THAT
;IF THE VALUE OF 'X' IS GREATER THAN 'N' BUT LESS THAN
;N+1, "FIX" CONVERTS 'X' TO 'N' IF X IS POSITIVE,
;AND "FIX" CONVERTS 'X' TO N+1 IF X IS NEGATIVE WHERE N IS AN
;INTEGER AND 'X' IS THE FLOATING POINT NUMBER BEING
;CONVERTED.

Q2200:	MOVSI	AC-2,600000		;SET-UP FLT PT NBR
	HRRI	AC-2,1
	FIX	AC,AC-2			;*CONVERT FLT PT NO. IN 'E' TO FIX PT,
					;TRUNCATE RESULT, AND PLACE IN AC
	CAIE	AC,0			;IS RESULT TRUNCATED?
	ER3	AC,2201			;TRUNCATION FAILED IN CONVERSION
	JUMPL	SAC,Q2200		;LOOP ON ERROR SWITCH
;CHECK THAT "FIX" TRUNCATES THE RESULT SUCH THAT
;IF THE VALUE OF 'X' IS GREATER THAN 'N' BUT LESS THAN
;N+1, "FIX" CONVERTS 'X' TO 'N' IF X IS POSITIVE,
;AND "FIX" CONVERTS 'X' TO N+1 IF X IS NEGATIVE WHERE N IS AN
;INTEGER AND 'X' IS THE FLOATING POINT NUMBER BEING
;CONVERTED.

Q2300:	HRLOI	AC-2,177777		;SET-UP FLT PT NBR
	FIX	AC,AC-2			;*CONVERT FLT PT NO. IN 'E' TO FIX PT,
					;TRUNCATE RESULT, AND PLACE IN AC
	CAIE	AC,0			;IS RESULT TRUNCATED?
	ER3	AC,2301			;TRUNCATION FAILED IN CONVERSION
	JUMPL	SAC,Q2300		;LOOP ON ERROR SWITCH

;CHECK THAT "FIX" TRUNCATES THE RESULT SUCH THAT
;IF THE VALUE OF 'X' IS GREATER THAN 'N' BUT LESS THAN
;N+1, "FIX" CONVERTS 'X' TO 'N' IF X IS POSITIVE,
;AND "FIX" CONVERTS 'X' TO N+1 IF X IS NEGATIVE WHERE N IS AN
;INTEGER AND 'X' IS THE FLOATING POINT NUMBER BEING
;CONVERTED.

Q2400:	MOVSI	AC-2,200400		;SET-UP FLT PT NBR
	FIX	AC,AC-2			;*CONVERT FLT PT NO. IN 'E' TO FIX PT,
					;TRUNCATE RESULT, AND PLACE IN AC
	CAIE	AC,0			;IS RESULT TRUNCATED?
	ER3	AC,2401			;TRUNCATION FAILED IN CONVERSION
	JUMPL	SAC,Q2400		;LOOP ON ERROR SWITCH
;CHECK THAT "FIX" TRUNCATES THE RESULT SUCH THAT
;IF THE VALUE OF 'X' IS GREATER THAN 'N' BUT LESS THAN
;N+1, "FIX" CONVERTS 'X' TO 'N' IF X IS POSITIVE,
;AND "FIX" CONVERTS 'X' TO N+1 IF X IS NEGATIVE WHERE N IS AN
;INTEGER AND 'X' IS THE FLOATING POINT NUMBER BEING
;CONVERTED.

Q2500:	HRLOI	AC-2,200777		;SET-UP FLT PT NBR
	FIX	AC,AC-2			;*CONVERT FLT PT NO. IN 'E' TO FIX PT,
					;TRUNCATE RESULT, AND PLACE IN AC
	CAIE	AC,0			;IS RESULT TRUNCATED?
	ER3	AC,2501			;TRUNCATION FAILED IN CONVERSION
	JUMPL	SAC,Q2500		;LOOP ON ERROR SWITCH

;CHECK THAT "FIX" TRUNCATES THE RESULT SUCH THAT
;IF THE VALUE OF 'X' IS GREATER THAN 'N' BUT LESS THAN
;N+1, "FIX" CONVERTS 'X' TO 'N' IF X IS POSITIVE,
;AND "FIX" CONVERTS 'X' TO N+1 IF X IS NEGATIVE WHERE N IS AN
;INTEGER AND 'X' IS THE FLOATING POINT NUMBER BEING
;CONVERTED.

Q2600:	HRLOI	AC-2,201577		;SET-UP FLT PT NBR
	FIX	AC,AC-2			;*CONVERT FLT PT NO. IN 'E' TO FIX PT,
					;TRUNCATE RESULT, AND PLACE IN AC
	CAIE	AC,1			;IS RESULT TRUNCATED?
	ER3	AC,2601			;TRUNCATION FAILED IN CONVERSION
	JUMPL	SAC,Q2600		;LOOP ON ERROR SWITCH
;CHECK THAT "FIX" TRUNCATES THE RESULT SUCH THAT
;IF THE VALUE OF 'X' IS GREATER THAN 'N' BUT LESS THAN
;N+1, "FIX" CONVERTS 'X' TO 'N' IF X IS POSITIVE,
;AND "FIX" CONVERTS 'X' TO N+1 IF X IS NEGATIVE WHERE N IS AN
;INTEGER AND 'X' IS THE FLOATING POINT NUMBER BEING
;CONVERTED.

Q2700:	MOVSI	AC-2,201600		;SET-UP FLT PT NBR
	FIX	AC,AC-2			;*CONVERT FLT PT NO. IN 'E' TO FIX PT,
					;TRUNCATE RESULT, AND PLACE IN AC
	CAIE	AC,1			;IS RESULT TRUNCATED?
	ER3	AC,2701			;TRUNCATION FAILED IN CONVERSION
	JUMPL	SAC,Q2700		;LOOP ON ERROR SWITCH

;CHECK THAT "FIX" TRUNCATES THE RESULT SUCH THAT
;IF THE VALUE OF 'X' IS GREATER THAN 'N' BUT LESS THAN
;N+1, "FIX" CONVERTS 'X' TO 'N' IF X IS POSITIVE,
;AND "FIX" CONVERTS 'X' TO N+1 IF X IS NEGATIVE WHERE N IS AN
;INTEGER AND 'X' IS THE FLOATING POINT NUMBER BEING
;CONVERTED.

Q3000:	HRLOI	AC-2,201777		;SET-UP FLT PT NBR
	FIX	AC,AC-2			;*CONVERT FLT PT NO. IN 'E' TO FIX PT,
					;TRUNCATE RESULT, AND PLACE IN AC
	CAIE	AC,1			;IS RESULT TRUNCATED?
	ER3	AC,3001			;TRUNCATION FAILED IN CONVERSION
	JUMPL	SAC,Q3000		;LOOP ON ERROR SWITCH
SUBTTL	DIAGNOSTIC SECTION - FIX - NON-AC RANGE ADDRESS

;VERIFY THAT 'FIX AC,E' OPERATES FOR 'E' BEYOND THE 'AC' RANGE

	SAVEAC
Q3010:	HRLZI	AC-2,576200
	MOVEM	AC-2,TSTWD		;LOAD 'E' WITH DATA
	SETOM	AC-1			;RESULT FOR COMPARISON
	FIX	AC,TSTWD		;*CONVERT FLT PT NO. IN 'E' TO FIX PT AND STORE IN AC
	CAME	AC,AC-1			;DID 'FIX' GET CORRECT C(E)?
	ER3	AC,3011			;FAILURE TO GET C(E)
	JUMPL	SAC,Q3010		;LOOP ON ERROR SWITCH
SUBTTL	DIAGNOSTIC SECTION - FIXR - ROUNDING

;CHECK THAT 'FIXR AC,E' DOES NOT MODIFY C(E)

Q3050:	MOVE	AC-2,[233525,,252525]	;LOAD 'E' WITH DATA
	FIXR	AC,AC-2			;*CONVERT FLT PT NO. IN 'E' TO FIX PT AND STORE IN AC
	CAME	AC-2,[233525,,252525]	;WAS FLT PT NO. MODIFIED?
	ER5	AC-2,3051		;C(E) WAS CLOBBERED
	JUMPL	SAC,Q3050		;LOOP ON ERROR SWITCH

;CHECK THAT "FIXR" ROUNDS THE RESULT SUCH THAT
;IF 'X' IS GREATER THAN 'N' BUT LESS THAN 'N+0.5',
;THE RESULT IS ROUNDED DOWN TO 'N'
;AND IF 'X' IS GREATER THAN OR EQUAL TO 'N+.5' BUT LESS THAN 'N+1' ,
;THE RESULT IS ROUNDED UP TO "N+1"
;WHERE 'N' IS AN INTEGER AND 'X' IS THE FLOATING POINT NUMBER
;BEING CONVERTED

Q3100:	MOVSI	AC-2,576000		;SET-UP FLT PT NBR
	HRRI	AC-2,1
	HRROI	AC-1,-2			;SET-UP EXPECTED RESULT
	FIXR	AC,AC-2			;*CONVERT FLT PT NO. IN 'E' TO FIX PT,
					;ROUND RESULT, AND PLACE IN AC
	CAME	AC,AC-1			;IS RESULT ROUNDED?
	ER3	AC,3101			;ROUNDING FAILED IN CONVERSION
	JUMPL	SAC,Q3100		;LOOP ON ERROR SWITCH

;CHECK THAT "FIXR" ROUNDS THE RESULT SUCH THAT
;IF 'X' IS GREATER THAN 'N' BUT LESS THAN 'N+0.5',
;THE RESULT IS ROUNDED DOWN TO 'N'
;AND IF 'X' IS GREATER THAN OR EQUAL TO 'N+.5' BUT LESS THAN 'N+1' ,
;THE RESULT IS ROUNDED UP TO "N+1"
;WHERE 'N' IS AN INTEGER AND 'X' IS THE FLOATING POINT NUMBER
;BEING CONVERTED

Q3200:	MOVSI	AC-2,576200		;SET-UP FLT PT NBR
	SETOM	AC-1			;SET-UP EXPECTED RESULT
	FIXR	AC,AC-2			;*CONVERT FLT PT NO. IN 'E' TO FIX PT,
					;ROUND RESULT, AND PLACE IN AC
	CAME	AC,AC-1			;IS RESULT ROUNDED?
	ER3	AC,3201			;ROUNDING FAILED IN CONVERSION
	JUMPL	SAC,Q3200		;LOOP ON ERROR SWITCH
;CHECK THAT "FIXR" ROUNDS THE RESULT SUCH THAT
;IF 'X' IS GREATER THAN 'N' BUT LESS THAN 'N+0.5',
;THE RESULT IS ROUNDED DOWN TO 'N'
;AND IF 'X' IS GREATER THAN OR EQUAL TO 'N+.5' BUT LESS THAN 'N+1' ,
;THE RESULT IS ROUNDED UP TO "N+1"
;WHERE 'N' IS AN INTEGER AND 'X' IS THE FLOATING POINT NUMBER
;BEING CONVERTED

Q3300:	MOVSI	AC-2,576200		;SET-UP FLT PT NBR
	HRRI	AC-2,1
	SETOM	AC-1			;SET-UP EXPECTED RESULT
	FIXR	AC,AC-2			;*CONVERT FLT PT NO. IN 'E' TO FIX PT,
					;ROUND RESULT, AND PLACE IN AC
	CAME	AC,AC-1			;IS RESULT ROUNDED?
	ER3	AC,3301			;ROUNDING FAILED IN CONVERSION
	JUMPL	SAC,Q3300		;LOOP ON ERROR SWITCH

;CHECK THAT "FIXR" ROUNDS THE RESULT SUCH THAT
;IF 'X' IS GREATER THAN 'N' BUT LESS THAN 'N+0.5',
;THE RESULT IS ROUNDED DOWN TO 'N'
;AND IF 'X' IS GREATER THAN OR EQUAL TO 'N+.5' BUT LESS THAN 'N+1' ,
;THE RESULT IS ROUNDED UP TO "N+1"
;WHERE 'N' IS AN INTEGER AND 'X' IS THE FLOATING POINT NUMBER
;BEING CONVERTED

Q3400:	MOVSI	AC-2,577000		;SET-UP FLT PT NBR
	HRRI	AC-2,1
	SETOM	AC-1			;SET-UP EXPECTED RESULT
	FIXR	AC,AC-2			;*CONVERT FLT PT NO. IN 'E' TO FIX PT,
					;ROUND RESULT, AND PLACE IN AC
	CAME	AC,AC-1			;IS RESULT ROUNDED?
	ER3	AC,3401			;ROUNDING FAILED IN CONVERSION
	JUMPL	SAC,Q3400		;LOOP ON ERROR SWITCH
;CHECK THAT "FIXR" ROUNDS THE RESULT SUCH THAT
;IF 'X' IS GREATER THAN 'N' BUT LESS THAN 'N+0.5',
;THE RESULT IS ROUNDED DOWN TO 'N'
;AND IF 'X' IS GREATER THAN OR EQUAL TO 'N+.5' BUT LESS THAN 'N+1' ,
;THE RESULT IS ROUNDED UP TO "N+1"
;WHERE 'N' IS AN INTEGER AND 'X' IS THE FLOATING POINT NUMBER
;BEING CONVERTED

Q3500:	MOVSI	AC-2,577400		;SET-UP FLT PT NBR
	FIXR	AC,AC-2			;*CONVERT FLT PT NO. IN 'E' TO FIX PT,
					;ROUND RESULT, AND PLACE IN AC
	CAIE	AC,0			;IS RESULT ROUNDED?
	ER3	AC,3501			;ROUNDING FAILED IN CONVERSION
	JUMPL	SAC,Q3500		;LOOP ON ERROR SWITCH

;CHECK THAT "FIXR" ROUNDS THE RESULT SUCH THAT
;IF 'X' IS GREATER THAN 'N' BUT LESS THAN 'N+0.5',
;THE RESULT IS ROUNDED DOWN TO 'N'
;AND IF 'X' IS GREATER THAN OR EQUAL TO 'N+.5' BUT LESS THAN 'N+1' ,
;THE RESULT IS ROUNDED UP TO "N+1"
;WHERE 'N' IS AN INTEGER AND 'X' IS THE FLOATING POINT NUMBER
;BEING CONVERTED

Q3600:	MOVSI	AC-2,600000		;SET-UP FLT PT NBR
	HRRI	AC-2,1
	FIXR	AC,AC-2			;*CONVERT FLT PT NO. IN 'E' TO FIX PT,
					;ROUND RESULT, AND PLACE IN AC
	CAIE	AC,0			;IS RESULT ROUNDED?
	ER3	AC,3601			;ROUNDING FAILED IN CONVERSION
	JUMPL	SAC,Q3600		;LOOP ON ERROR SWITCH
;CHECK THAT "FIXR" ROUNDS THE RESULT SUCH THAT
;IF 'X' IS GREATER THAN 'N' BUT LESS THAN 'N+0.5',
;THE RESULT IS ROUNDED DOWN TO 'N'
;AND IF 'X' IS GREATER THAN OR EQUAL TO 'N+.5' BUT LESS THAN 'N+1' ,
;THE RESULT IS ROUNDED UP TO "N+1"
;WHERE 'N' IS AN INTEGER AND 'X' IS THE FLOATING POINT NUMBER
;BEING CONVERTED

Q3700:	HRLOI	AC-2,177777		;SET-UP FLT PT NBR
	FIXR	AC,AC-2			;*CONVERT FLT PT NO. IN 'E' TO FIX PT,
					;ROUND RESULT, AND PLACE IN AC
	CAIE	AC,0			;IS RESULT ROUNDED?
	ER3	AC,3701			;ROUNDING FAILED IN CONVERSION
	JUMPL	SAC,Q3700		;LOOP ON ERROR SWITCH

;CHECK THAT "FIXR" ROUNDS THE RESULT SUCH THAT
;IF 'X' IS GREATER THAN 'N' BUT LESS THAN 'N+0.5',
;THE RESULT IS ROUNDED DOWN TO 'N'
;AND IF 'X' IS GREATER THAN OR EQUAL TO 'N+.5' BUT LESS THAN 'N+1' ,
;THE RESULT IS ROUNDED UP TO "N+1"
;WHERE 'N' IS AN INTEGER AND 'X' IS THE FLOATING POINT NUMBER
;BEING CONVERTED

Q4000:	MOVSI	AC-2,200400		;SET-UP FLT PT NBR
	FIXR	AC,AC-2			;*CONVERT FLT PT NO. IN 'E' TO FIX PT,
					;ROUND RESULT, AND PLACE IN AC
	CAIE	AC,1			;IS RESULT ROUNDED?
	ER3	AC,4001			;ROUNDING FAILED IN CONVERSION
	JUMPL	SAC,Q4000		;LOOP ON ERROR SWITCH
;CHECK THAT "FIXR" ROUNDS THE RESULT SUCH THAT
;IF 'X' IS GREATER THAN 'N' BUT LESS THAN 'N+0.5',
;THE RESULT IS ROUNDED DOWN TO 'N'
;AND IF 'X' IS GREATER THAN OR EQUAL TO 'N+.5' BUT LESS THAN 'N+1' ,
;THE RESULT IS ROUNDED UP TO "N+1"
;WHERE 'N' IS AN INTEGER AND 'X' IS THE FLOATING POINT NUMBER
;BEING CONVERTED

Q4100:	HRLOI	AC-2,200777		;SET-UP FLT PT NBR
	FIXR	AC,AC-2			;*CONVERT FLT PT NO. IN 'E' TO FIX PT,
					;ROUND RESULT, AND PLACE IN AC
	CAIE	AC,1			;IS RESULT ROUNDED?
	ER3	AC,4101			;ROUNDING FAILED IN CONVERSION
	JUMPL	SAC,Q4100		;LOOP ON ERROR SWITCH

;CHECK THAT "FIXR" ROUNDS THE RESULT SUCH THAT
;IF 'X' IS GREATER THAN 'N' BUT LESS THAN 'N+0.5',
;THE RESULT IS ROUNDED DOWN TO 'N'
;AND IF 'X' IS GREATER THAN OR EQUAL TO 'N+.5' BUT LESS THAN 'N+1' ,
;THE RESULT IS ROUNDED UP TO "N+1"
;WHERE 'N' IS AN INTEGER AND 'X' IS THE FLOATING POINT NUMBER
;BEING CONVERTED

Q4200:	HRLOI	AC-2,201577		;SET-UP FLT PT NBR
	FIXR	AC,AC-2			;*CONVERT FLT PT NO. IN 'E' TO FIX PT,
					;ROUND RESULT, AND PLACE IN AC
	CAIE	AC,1			;IS RESULT ROUNDED?
	ER3	AC,4201			;ROUNDING FAILED IN CONVERSION
	JUMPL	SAC,Q4200		;LOOP ON ERROR SWITCH
;CHECK THAT "FIXR" ROUNDS THE RESULT SUCH THAT
;IF 'X' IS GREATER THAN 'N' BUT LESS THAN 'N+0.5',
;THE RESULT IS ROUNDED DOWN TO 'N'
;AND IF 'X' IS GREATER THAN OR EQUAL TO 'N+.5' BUT LESS THAN 'N+1' ,
;THE RESULT IS ROUNDED UP TO "N+1"
;WHERE 'N' IS AN INTEGER AND 'X' IS THE FLOATING POINT NUMBER
;BEING CONVERTED

Q4300:	MOVSI	AC-2,201600		;SET-UP FLT PT NBR
	FIXR	AC,AC-2			;*CONVERT FLT PT NO. IN 'E' TO FIX PT,
					;ROUND RESULT, AND PLACE IN AC
	CAIE	AC,2			;IS RESULT ROUNDED?
	ER3	AC,4301			;ROUNDING FAILED IN CONVERSION
	JUMPL	SAC,Q4300		;LOOP ON ERROR SWITCH

;CHECK THAT "FIXR" ROUNDS THE RESULT SUCH THAT
;IF 'X' IS GREATER THAN 'N' BUT LESS THAN 'N+0.5',
;THE RESULT IS ROUNDED DOWN TO 'N'
;AND IF 'X' IS GREATER THAN OR EQUAL TO 'N+.5' BUT LESS THAN 'N+1' ,
;THE RESULT IS ROUNDED UP TO "N+1"
;WHERE 'N' IS AN INTEGER AND 'X' IS THE FLOATING POINT NUMBER
;BEING CONVERTED

Q4400:	HRLOI	AC-2,201777		;SET-UP FLT PT NBR
	FIXR	AC,AC-2			;*CONVERT FLT PT NO. IN 'E' TO FIX PT,
					;ROUND RESULT, AND PLACE IN AC
	CAIE	AC,2			;IS RESULT ROUNDED?
	ER3	AC,4401			;ROUNDING FAILED IN CONVERSION
	JUMPL	SAC,Q4400		;LOOP ON ERROR SWITCH
SUBTTL	DIAGNOSTIC SECTION - FIXR - NON-AC RANGE ADDRESS

;CHECK THAT 'FIXR AC,E' OPERATES FOR 'E' BEYOND AC RANGE

Q4410:	MOVSI	AC-2,576000		;LOAD 'E' WITH DATA
	HRRI	AC-2,1
	MOVEM	AC-2,TSTWD
	HRROI	AC-1,-2			;RESULT FOR COMPARISON
	FIXR	AC,TSTWD		;*CONVERT FLT PT NO. IN 'E' TO FIX PT AND STORE IN AC
	CAME	AC,AC-1			;DID FIXR GET CORRECT C(E)?
	ER3	AC,4411			;FAILURE TO GET C(E)
	JUMPL	SAC,Q4410		;LOOP ON ERROR SWITCH
SUBTTL	DIAGNOSTIC SECTION - FIX - ARITHMETIC OVERFLOW

;CHECK THAT ARITH OVFL FLG REMAINS CLEAR WHEN THE ABSOLUTE VALUE
;OF 'N' IS LESS THAN 2 RAISED THE 35TH POWER.

;CHECK ABILITY TO CLEAR AROV BEFORE TESTING INTERACTION WITH 'FIX'

Q4500:	JOV	.+1			;CLEAR ARITH OVFL FLG
	JSP	AC,.+1			;READ FLAGS
	JOV	.+2			;TEST AROV FLAG
	JRST	.+2			;SKIP ERROR CALL IF FLAG IS OK
	ER13	AC,4501			;ARITH OVFL FLG SET
	JUMPL	SAC,Q4500		;LOOP ON ERROR SWITCH

;CHECK THAT ARITH OVFL FLG REMAINS CLEAR WHEN THE ABSOLUTE VALUE
;OF 'N' IS LESS THAN 2 RAISED THE 35TH POWER.

Q4600:	JOV	.+1			;CLEAR ARITH OVFL FLG
	MOVSI	AC-2,244400		;INITIALIZE FLOATING PT WORD
	SETOB	AC,AC-1			;SET-UP RESULT
	FIX	AC,AC-2			;*FIX SHOULD SET AROV
	CAME	AC,AC-1			;TEST AC
	ER3	AC,4601			;C(AC) WAS MODIFIED
	JSP	AC+1,.+1		;READ FLAGS
	JOV	.+2			;TEST ARITH OVFL FLG
	ER13	AC+1,4601		;ARITH OVFL FLAG CLEAR
	JUMPL	SAC,Q4600		;LOOP ON ERROR SWITCH

;CHECK THAT ARITH OVFL FLG REMAINS CLEAR WHEN THE ABSOLUTE VALUE
;OF 'N' IS LESS THAN 2 RAISED THE 35TH POWER.

Q4700:	JOV	.+1			;CLEAR ARITH OVFL FLG
	HRLOI	AC-2,243777		;INITIALIZE FLT. PT. WORD
	HRROI	AC-1,777400		;SET UP RESULT
	TLZ	AC-1,AROV
	FIX	AC,AC-2			;*FIX SHOULD NOT SET AROV
	CAME	AC,AC-1			;TEST AC
	ER3	AC,4701			;C(AC) INCORRECT
	JSP	AC+1,.+1		;READ FLAGS
	JOV	.+2			;TEST ARITH OVFL FLG
	JRST	.+2			;SKIP ERROR CALL IF AROV IS CLEAR
	ER13	AC+1,4701		;ARITH OVFL FLAG SET
	JUMPL	SAC,Q4700		;LOOP ON ERROR SWITCH
;CHECK THAT ARITH OVFL FLG REMAINS CLEAR WHEN THE ABSOLUTE VALUE
;OF 'N' IS LESS THAN 2 RAISED THE 35TH POWER.

Q5000:	JOV	.+1			;CLEAR ARITH OVFL FLG
	MOVSI	AC-2,533400		;INIT FLT. PT. WORD
	SETOB	AC,AC-1			;SET-UP RESULT
	FIX	AC,AC-2			;*FIX SHOULD SET AROV
	CAME	AC,AC-1			;TEST AC
	ER3	AC,5001			;C(AC) WAS MODIFIED
	JSP	AC+1,.+1		;READ FLAGS
	JOV	.+2			;TEST ARITH OVFL FLG
	ER13	AC+1,5001		;ARITH OVFL FLG CLEAR
	JUMPL	SAC,Q5000		;LOOP ON ERROR SWITCH

;CHECK THAT ARITH OVFL FLG REMAINS CLEAR WHEN THE ABSOLUTE VALUE
;OF 'N' IS LESS THAN 2 RAISED THE 35TH POWER.

Q5100:	JOV	.+1			;CLEAR ARITH OVFL FLG
	MOVSI	AC-2,534000		;INITIALIZE FLT. PT. WORD
	TRO	AC-2,1
	HRRZI	AC-1,400		;SET-UP RESULT
	TLO	AC-1,AROV
	FIX	AC,AC-2			;*FIX SHOULD NOT SET AROV
	CAME	AC,AC-1			;TEST AC
	ER3	AC,5101			;C(AC) INCORRECT
	JSP	AC+1,.+1		;READ FLAGS
	JOV	.+2			;TEST ARITH OVFL FLG
	JRST	.+2			;SKIP ERROR CALL IF AROV IS CLEAR
	ER13	AC+1,5101		;ARITH OVFL FLG SET
	JUMPL	SAC,Q5100		;LOOP ON ERROR SWITCH
SUBTTL	DIAGNOSTIC SECTION - FLTR - EXPONENT CALCULATION - POSITIVE NUMBERS

;CHECK THAT 'FLTR AC,E' DOES NOT MODIFY C(E)

Q5150:	MOVE	AC-2,[252525,,252525]	;LOAD 'E' WITH DATA
	FLTR	AC,AC-2			;*CONVERT THE FIX PT NO. IN 'E' TO FLT PT
	CAME	AC-2,[252525,,252525]	;WAS FIX PT NO. MODIFIED?
	ER5	AC-2,5151		;C(E) WAS CLOBBERED
	JUMPL	SAC,Q5150		;LOOP ON ERROR SWITCH

;TEST EXPONENT CALCULATION FOR POSITIVE NUMBERS

SN=5200
	XX=400000
	YY=244400

Q5200:	REPEAT	^D17,<
;THIS TEST VERIFIES THAT THE FLTR INSTRUCTION CONVERTS THE FIX PT NO.
;IN MEMORY TO FLT PT AND PLACES THE RESULT IN THE AC
;TEST EXPONENT CALCULATION FOR POSITIVE NUMBERS

SN=SN+1
	XX=XX/2
	YY=YY-1000
	MOVSI	AC-2,XX			;INITIALIZE FIXED PT WORD
	MOVSI	AC-1,YY			;SET-UP RESULT
	FLTR	AC,AC-2			;*CONVERT THE FIX PT NO. IN 'E' TO FLT PT
	CAME	AC,AC-1			;TEST EXPONENT
	ER3	AC,SN			;INCORRECT EXPONENT
	JUMPL	SAC,.-5			;LOOP ON ERROR SWITCH
>
PAGE
SN=5300
	XX=0
	YY=223400

Q5300:	REPEAT	^D18,<
;THIS TEST VERIFIES THAT THE FLTR INSTRUCTION CONVERTS THE FIX PT NO.
;IN MEMORY TO FLT PT AND PLACES THE RESULT IN THE AC
;TEST EXPONENT CALCULATION FOR POSITIVE NUMBERS

SN=SN+1
	XX=XX/2
	YY=YY-1000
	IFE	XX,<XX=400000>
	HRRZI	AC-2,XX			;INITIALIZE FIXED PT WORD
	MOVSI	AC-1,YY			;SET-UP RESULT
	FLTR	AC,AC-2			;*CONVERT THE FIX PT NO. IN 'E' TO FLT PT
	CAME	AC,AC-1			;TEST EXPONENT
	ER3	AC,SN			;INCORRECT EXPONENT
	JUMPL	SAC,-5			;LOOP ON ERROR SWITCH
>
SUBTTL	DIAGNOSTIC SECTION - FLTR - EXPONENT CALCULATION - NEGATIVE NUMBERS

;TEST EXPONENT CALCULATION FOR NEGATIVE NUMBERS

SN=5400
	XX=0
	YY=532400

Q5400:	REPEAT	^D18,<
;THIS TEST VERIFIES THAT THE FLTR INSTRUCTION CONVERTS THE FIX PT NO.
;IN MEMORY TO FLT PT AND PLACES THE RESULT IN THE AC
;TEST EXPONENT CALCULATION FOR NEGATIVE NUMBERS

SN=SN+1
	XX=XX!<XX/2>
	YY=YY+1000
	IFE	XX,<XX=400000>
	MOVSI	AC-2,XX			;INITIALIZE FIXED POINT WORD
	MOVSI	AC-1,YY			;SET-UP RESULT
	FLTR	AC,AC-2			;*CONVERT THE FIX PT NO. IN 'E' TO FLT PT
	CAME	AC,AC-1			;TEST EXPONENT
	ER3	AC,SN			;INCORRECT EXPONENT
	JUMPL	SAC,.-5			;LOOP ON ERROR SWITCH
>
PAGE
SN=5500
	XX=0
	YY=554000

Q5500:	REPEAT ^D18,<
;THIS TEST VERIFIES THAT THE FLTR INSTRUCTION CONVERTS THE FIX PT NO.
;IN MEMORY TO FLT PT AND PLACES THE RESULT IN THE AC
;TEST EXPONENT CALCULATION FOR NEGATIVE NUMBERS

SN=SN+1
	XX=XX!<XX/2>
	YY=YY+1000
	IFE	XX,<XX=400000>
	HRROI	AC-2,XX			;INITIALIZE FIXED POINT WORD
	MOVSI	AC-1,YY+400		;SET-UP RESULT
	FLTR	AC,AC-2			;*CONVERT THE FIX PT NO. IN 'E' TO FLT PT
	CAME	AC,AC-1			;TEST EXPONENT
	ER3	AC,SN			;INCORRECT EXPONENT
	JUMPL	SAC,.-5			;LOOP ON ERROR SWITCH
>
PAGE
;THIS TEST VERIFIES THAT THE FLTR INSTRUCTION CONVERTS THE FIX PT NO. 0
;IN MEMORY TO FLT PT AND PLACES THE RESULT IN THE AC
;FLOAT A WORD OF ALL ZEROS

Q5600:	SETZB	AC-2,AC-1		;INITIALIZE FIXED POINT WORD
	FLTR	AC,AC-2			;*CONVERT THE FIX PT NO. 0 IN 'E' TO FLT PT
	CAME	AC,AC-1			;EXAMINE RESULT FOR 0
	ER3	AC,5601			;CONVERSION FAILED
	JUMPL	SAC,Q5600		;LOOP ON ERROR SWITCH
SUBTTL	DIAGNOSTIC SECTION - FLTR - POSITIVE NUMBERS - RIPPLE ZEROS

;THIS TEST VERIFIES THAT THE FLTR INSTRUCTION CONVERTS THE FIX PT NO.
;IN MEMORY TO FLT PT AND PLACES THE RESULT IN THE AC
;DATA: RIPPLE A ZERO THROUGH A FRACTION FIELD OF ONES - POS NOS.

Q5700:	MOVEI	AC-2,777400		;INITIALIZE FIX PT WORD
	HRLI	AC-2,377777
	HRLOI	AC-1,243777		;SET-UP RESULT
	FLTR	AC,AC-2			;*CONVERT THE FIX PT NO. IN 'E' TO FLT PT
	CAME	AC,AC-1			;TEST FRACTION
	ER3	AC,5701			;FRACTION NOT ALL ONES
	JUMPL	SAC,Q5700		;LOOP ON ERROR SWITCH

SN=6000
	XX=777200
	YY=0

Q6000:	REPEAT	^D10,<
;THIS TEST VERIFIES THAT THE FLTR INSTRUCTION CONVERTS THE FIX PT NO.
;IN MEMORY TO FLT PT AND PLACES THE RESULT IN THE AC
;DATA: RIPPLE A ZERO THROUGH A FRACTION FIELD OF ONES - POS NOS.

SN=SN+1
	XX=<XX+XX+400>&777777
	YY=<YY+YY+1>&777777
	IFE	<YY-1>,<YY=777776>
	HRROI	AC-2,XX			;INITIALIZE FIX PT. NBR.
	TLZ	AC-2,1B18
	HRLOI	AC-1,243777		;SET-UP EXPECTED RESULT7
	HRRI	AC-1,YY
	FLTR	AC,AC-2			;*CONVERT THE FIX PT NO. IN 'E' TO FLT PT
	CAME	AC,AC-1			;TEST FRACTION
	ER3	AC,SN			;FAILURE IF TESTED BIT IS NOT CLEAR
	JUMPL	SAC,.-7			;LOOP ON ERROR SWITCH
>
PAGE
SN=6100
	XX=0
	YY=776777
Q6100:	REPEAT	^D8,<
;THIS TEST VERIFIES THAT THE FLTR INSTRUCTION CONVERTS THE FIX PT NO.
;IN MEMORY TO FLT PT AND PLACES THE RESULT IN THE AC
;DATA: RIPPLE A ZERO THROUGH A FRACTION FIELD OF ONES - POS NOS.

SN=SN+1
	XX=<XX+XX+1>&377777
	YY=<YY+YY+1>&777777
	IFE	<XX-1>,<XX=377776>
	HRLOI	AC-2,XX			;INITIALIZE FIX PT. NBR.
	HRRI	AC-2,777400
	HRLOI	AC-1,243777		;SET-UP EXPECTED RESULT
	HRRI	AC-1,YY
	FLTR	AC,AC-2			;*CONVERT THE FIX PT NO. IN 'E' TO FLT PT
	CAME	AC,AC-1			;TEST FRACTION
	ER3	AC,SN			;FAILURE IF TESTED BIT IS NOT CLEAR
	JUMPL	SAC,.-7			;LOOP ON ERROR SWITCH
>
SN=6200
	XX=377577
	YY=0

Q6200:	REPEAT	^D8,<
;THIS TEST VERIFIES THAT THE FLTR INSTRUCTION CONVERTS THE FIX PT NO.
;IN MEMORY TO FLT PT AND PLACES THE RESULT IN THE AC
;DATA: RIPPLE A ZERO THROUGH A FRACTION FIELD OF ONES - POS NOS.

SN=SN+1
	XX=<XX+XX+1>&377777
	YY=<YY+YY+1>&777
	IFE	<YY-1>,<YY=776>
	HRLOI	AC-2,XX			;INITIALIZE FIX PT. NBR.
	HRRI	AC-2,777400
	HRLOI	AC-1,243000+YY		;SET-UP EXPECTED RESULT
	FLTR	AC,AC-2			;*CONVERT THE FIX PT NO. IN 'E' TO FLT PT
	CAME	AC,AC-1			;TEST FRACTION
	ER3	AC,SN			;FAILURE IF TESTED BIT IS NOT CLEAR
	JUMPL	SAC,.-6			;LOOP ON ERROR SWITCH
>
SUBTTL	DIAGNOSTIC SECTION - FLTR - POSITIVE NUMBERS - RIPPLE ONES

;RIPPLE A ONE THROUGH A FRACTION FIELD OF ZEROS - POS NOS

SN=6300
	XX=200
	YY=0

Q6300:	REPEAT	^D10,<
;THIS TEST VERIFIES THAT THE FLTR INSTRUCTION CONVERTS THE FIX PT NO.
;IN MEMORY TO FLT PT AND PLACES THE RESULT IN THE AC
;DATA: RIPPLE A ONE THROUGH A FRACTION FIELD OF ZEROS - POS NOS.

SN=SN+1
	XX=XX+XX
	YY=YY+YY
	IFE	YY,<YY=1>
	MOVSI	AC-2,1B19		;INITIALIZE FIX PT NBR.
	HRRI	AC-2,XX
	MOVSI	AC-1,243400		;SETUP EXPECTED RESULT
	HRRI	AC-1,YY
	FLTR	AC,AC-2			;CONVERT TO FLT PT
	CAME	AC,AC-1			;TEST FRACTION
	ER3	AC,SN			;FAILURE
	JUMPL	SAC,.-7			;LOOP ON ERROR
>
PAGE
SN=6400
	XX=0
	YY=1000

Q6400:	REPEAT	^D8,<
;THIS TEST VERIFIES THAT THE FLTR INSTRUCTION CONVERTS THE FIXED PT
;NO IN MEMORY TO FLT PT AND PLACES THE RESULT IN THE AC
;DATA: RIPPLE A ONE THROUGH A FRACTION FIELD OF ZEROS - POS NOS.

SN=SN+1
	XX=XX+XX
	YY=YY+YY
	IFE	XX,<XX=1>
	MOVSI	AC-2,1B19+XX		;INITIALIZE FIX PT. NBR.
	MOVSI	AC-1,243400		;SET-UP EXPECTED RESULT
	HRRI	AC-1,YY
	FLTR	AC,AC-2			;*FIXED TO FLOAT
	CAME	AC,AC-1			;TEST FRACTION
	ER3	AC,SN			;FAILURE IF TESTED BIT IS NOT SET
	JUMPL	SAC,.-6			;LOOP ON ERROR SWITCH
>
SN=6500
	XX=200
	YY=0

Q6500:	REPEAT	^D8,<
;THIS TEST VERIFIES THAT THE FLTR INSTRUCTION CONVERTS THE FIX PT NO.
;IN MEMORY TO FLT PT AND PLACES THE RESULT IN THE AC
;DATA: RIPPLE A ONE THROUGH A FRACTION FIELD OF ZEROS - POS NOS.

SN=SN+1
	XX=XX+XX
	YY=YY+YY
	IFE	YY,<YY=1>
	MOVSI	AC-2,1B19+XX		;INITIALIZE FIX PT. NBR.
	MOVSI	AC-1,243400+YY		;SET-UP EXPECTED RESULT
	FLTR	AC,AC-2			;*CONVERT THE FIX PT NO. IN 'E' TO FLT PT AND STORE RESULT IN AC
	CAME	AC,AC-1			;TEST FRACTION
	ER3	AC,SN			;FAILURE IF TESTED BIT IS NOT SET
	JUMPL	SAC,.-5			;LOOP ON ERROR SWITCH
>
SUBTTL	DIAGNOSTIC SECTION - FLTR - NEGATIVE NUMBERS - RIPPLE ONES

;RIPPLE A ONE THROUGH A FRACTION FIELD OF ZEROS - NEG NOS

SN=6600
	XX=200
	YY=0

Q6600:	REPEAT	^D10,<
;THIS TEST VERIFIES THAT THE FLTR INSTRUCTION CONVERTS THE FIX PT NO.
;IN MEMORY TO FLT PT AND PLACES THE RESULT IN THE AC
;DATA: RIPPLE A ONE THROUGH A FRACTION FIELD OF ZEROS - NEG NOS.

SN=SN+1
	XX=XX+XX
	YY=YY+YY
	IFE	YY,<YY=1>
	MOVSI	AC-2,1B18		;INITIALIZE FIX PT. NBR.
	HRRI	AC-2,XX
	MOVSI	AC-1,534000		;SET-UP EXPECTED RESULT
	HRRI	AC-1,YY
	FLTR	AC,AC-2			;*CONVERT FIX TO FLT
	CAME	AC,AC-1			;TEST FRACTION
	ER3	AC,SN			;FAILURE IF TESTED BIT IS NOT SET
	JUMPL	SAC,.-7			;LOOP ON ERROR SWITCH
>
PAGE
SN=6700
	XX=0
	YY=1000

Q6700:	REPEAT	^D8,<
;THIS TEST VERIFIES THAT THE FLTR INSTRUCTION CONVERTS THE FIX PT NO.
;IN MEMORY TO FLT PT AND PLACES THE RESULT IN THE AC
;DATA: RIPPLE A ONE THROUGH A FRACTION FIELD OF ZEROS - NEG NOS.

SN=SN+1
	XX=XX+XX
	YY=YY+YY
	IFE	XX,<XX=1>
	MOVSI	AC-2,1B18+XX		;INITIALIZE FIX PT. NBR.
	MOVSI	AC-1,534000		;SET-UP EXPECTED RESULT
	HRRI	AC-1,YY
	FLTR	AC,AC-2			;*CONVERT THE FIX PT NO. IN 'E' TO FLT PT AND STORE RESULT IN AC
	CAME	AC,AC-1			;TEST FRACTION
	ER3	AC,SN			;FAILURE IF TESTED BIT IS NOT SET
	JUMPL	SAC,.-6			;LOOP ON ERROR SWITCH
>
SN=7000
	XX=200
	YY=0

Q7000:	REPEAT	^D8,<
;THIS TEST VERIFIES THAT THE FLTR INSTRUCTION CONVERTS THE FIX PT NO.
;IN MEMORY TO FLT PT AND PLACES THE RESULT IN THE AC
;DATA: RIPPLE A ONE THROUGH A FRACTION FIELD OF ZEROS - NEG NOS.

SN=SN+1
	XX=XX+XX
	YY=YY+YY
	IFE	YY,<YY=1>
	MOVSI	AC-2,1B18+XX		;INITIALIZE FIX PT. NBR.
	MOVSI	AC-1,534000+YY		;SET-UP EXPECTED RESULT
	FLTR	AC,AC-2			;*CONVERT THE FIX PT NO. IN 'E' TO FLT PT AND STORE RESULT IN AC
	CAME	AC,AC-1			;TEST FRACTION
	ER3	AC,SN			;FAILURE IF TESTED BIT IS NOT SET
	JUMPL	SAC,.-5			;LOOP ON ERROR SWITCH
>
SUBTTL	DIAGNOSTIC SECTION - FLTR - NEGATIVE NUMBERS - RIPPLE ZEROS

;THIS TEST VERIFIES THAT THE FLTR INSTRUCTION CONVERTS THE FIX PT NO.
;IN MEMORY TO FLT PT AND PLACES THE RESULT IN THE AC
;DATA: RIPPLE A ZERO THROUGH A FRACTION FIELD OF ONES - NEG NOS.

Q7100:	MOVSI	AC-2,577777		;INITIALIZE FIX PT. NBR.
	HRRI	AC-2,777400
	HRLOI	AC-1,534377		;SET-UP EXPECTED RESULT
	FLTR	AC,AC-2			;*CONVERT THE FIX PT NO. IN 'E' TO FLT PT AND STORE RESULT IN AC
	CAME	AC,AC-1			;TEST FRACTION
	ER3	AC,7101			;FAILURE IF TESTED BIT IS NOT CLEAR
	JUMPL	SAC,Q7100		;LOOP ON ERROR SWITCH

SN=7200
	XX=777200
	YY=0

Q7200:	REPEAT	^D10,<
;THIS TEST VERIFIES THAT THE FLTR INSTRUCTION CONVERTS THE FIX PT NO.
;IN MEMORY TO FLT PT AND PLACES THE RESULT IN THE AC
;DATA: RIPPLE A ZERO THROUGH A FRACTION FIELD OF ONES - NEG NOS.

SN=SN+1
	XX=<XX+XX+400>&777777
	YY=<YY+YY+1>&777777
	IFE	<YY-1>,<YY=777776>
	MOVSI	AC-2,577777		;INITIALIZE FIX PT. NBR.
	HRRI	AC-2,XX
	MOVSI	AC-1,534377		;SET-UP EXPECTED RESULT
	HRRI	AC-1,YY
	FLTR	AC,AC-2			;*CONVERT THE FIX PT NO. IN 'E' TO FLT PT AND STORE RESULT IN AC
	CAME	AC,AC-1			;TEST FRACTION
	ER3	AC,SN			;FAILURE IF TESTED BIT IS NOT CLEAR
	JUMPL	SAC,.-7			;LOOP ON ERROR SWITCH
>
PAGE
SN=7300
	XX=0
	YY=776777

Q7300:	REPEAT	^D8,<
;THIS TEST VERIFIES THAT THE FLTR INSTRUCTION CONVERTS THE FIX PT NO.
;IN MEMORY TO FLT PT AND PLACES THE RESULT IN THE AC
;DATA: RIPPLE A ZERO THROUGH A FRACTION FIELD OF ONES - NEG NOS.

SN=SN+1
	XX=<XX+XX+1>&177777
	YY=<YY+YY+1>&777777
	IFE	<XX-1>,<XX=177776>
	MOVSI	AC-2,1B18+XX		;INITIALIZE FIX PT. NBR.
	HRRI	AC-2,777400
	MOVSI	AC-1,534377		;SET-UP EXPECTED RESULT
	HRRI	AC-1,YY
	FLTR	AC,AC-2			;*CONVERT THE FIX PT NO. IN 'E' TO FLT PT AND STORE RESULT IN AC
	CAME	AC,AC-1			;TEST FRACTION
	ER3	AC,SN			;FAILURE IF TESTED BIT IS NOT CLEAR
	JUMPL	SAC,.-7			;LOOP ON ERROR SWITCH
>
SN=7400
	XX=177577
	YY=0

Q7400:	REPEAT	^D8,<
;THIS TEST VERIFIES THAT THE FLTR INSTRUCTION CONVERTS THE FIX PT NO.
;IN MEMORY TO FLT PT AND PLACES THE RESULT IN THE AC
;DATA: RIPPLE A ZERO THROUGH A FRACTION FIELD OF ONES - NEG NOS.

SN=SN+1
	XX=<XX+XX+1>&177777
	YY=<YY+YY+1>&377
	IFE	<YY-1>,<YY=376>
	MOVSI	AC-2,1B18+XX		;INITIALIZE FIX PT. NBR.
	HRRI	AC-2,777400
	HRLOI	AC-1,534000+YY		;SET-UP EXPECTED RESULT
	FLTR	AC,AC-2			;*CONVERT FIX TO FLT
	CAME	AC,AC-1			;TEST FRACTION
	ER3	AC,SN			;FAILURE IF TESTED BIT IS NOT CLEAR
	JUMPL	SAC,.-6			;LOOP ON ERROR SWITCH
>
SUBTTL	DIAGNOSTIC SECTION - FLTR - ROUNDING

;TEST FOR ROUNDING
;CHECK THAT FLTR ROUNDS THE RESULTING FRACTION AWAY FROM 0 SUCH THAT
;IF THE PART OF THE FRACTION BEING DROPPED IS GREATER THAN OR EQUAL TO
;1/2 LSB OF THE FRACTION RETAINED, THE FRACTION IS INCREASED BY ONE LSB;
;OTHERWISE, THE FRACTION IS DECREASED BY THE PART BEING DROPPED.


Q7500:	MOVSI	AC-2,1B19		;INITIALIZE FIX PT. NBR.
	HRRI	AC-2,177
	MOVSI	AC-1,243400		;SET-UP EXPECTED RESULT
	FLTR	AC,AC-2			;*CONVERT FIX PT NO. IN 'E' TO FLT PT,
					;ROUND RESULT, AND PLACE IN AC.
	CAME	AC,AC-1			;WAS FRACTION ROUNDED DOWN?
	ER3	AC,7501			;RESULT DID NOT ROUND DOWN
	JUMPL	SAC,Q7500		;LOOP ON ERROR SWITCH

;TEST FOR ROUNDING
;CHECK THAT FLTR ROUNDS THE RESULTING FRACTION AWAY FROM 0 SUCH THAT
;IF THE PART OF THE FRACTION BEING DROPPED IS GREATER THAN OR EQUAL TO
;1/2 LSB OF THE FRACTION RETAINED, THE FRACTION IS INCREASED BY ONE LSB;
;OTHERWISE, THE FRACTION IS DECREASED BY THE PART BEING DROPPED.
Q7600:	MOVSI	AC-2,1B19		;INITIALIZE FIX PT. NBR.
	HRRI	AC-2,200
	MOVSI	AC-1,243400		;SET-UP EXPECTED RESULT
	HRRI	AC-1,1
	FLTR	AC,AC-2			;*CONVERT FIX PT NO. IN 'E' TO FLT PT,
					;ROUND RESULT, AND PLACE IN AC.
	CAME	AC,AC-1			;WAS FRACTION ROUNDED UP?
	ER3	AC,7601			;RESULT DID NOT ROUND UP
	JUMPL	SAC,Q7600		;LOOP ON ERROR SWITCH
;TEST FOR ROUNDING
;CHECK THAT FLTR ROUNDS THE RESULTING FRACTION AWAY FROM 0 SUCH THAT
;IF THE PART OF THE FRACTION BEING DROPPED IS GREATER THAN OR EQUAL TO
;1/2 LSB OF THE FRACTION RETAINED, THE FRACTION IS INCREASED BY ONE LSB;
;OTHERWISE, THE FRACTION IS DECREASED BY THE PART BEING DROPPED.
Q7700:	HRROI	AC-2,777600		;INITIALIZE FIX PT. NBR.
	TLZ	AC-2,1B19
	HRLOI	AC-1,534377		;SET-UP EXPECTED RESULT
	FLTR	AC,AC-2			;*CONVERT FIX PT NO. IN 'E' TO FLT PT,
					;ROUND RESULT, AND PLACE IN AC.
	CAME	AC,AC-1			;WAS FRACTION ROUNDED DOWN?
	ER3	AC,7701			;RESULT DID NOT ROUND DOWN
	JUMPL	SAC,Q7700		;LOOP ON ERROR SWITCH

;TEST FOR ROUNDING
;CHECK THAT FLTR ROUNDS THE RESULTING FRACTION AWAY FROM 0 SUCH THAT
;IF THE PART OF THE FRACTION BEING DROPPED IS GREATER THAN OR EQUAL TO
;1/2 LSB OF THE FRACTION RETAINED, THE FRACTION IS INCREASED BY ONE LSB;
;OTHERWISE, THE FRACTION IS DECREASED BY THE PART BEING DROPPED.
Q10000:	HRROI	AC-2,777601		;INITIALIZE FIX PT. NBR.
	TLZ	AC-2,1B19
	HRLZI	AC-1,534400		;SET-UP EXPECTED RESULT
	FLTR	AC,AC-2			;*CONVERT FIX PT NO. IN 'E' TO FLT PT,
					;ROUND RESULT, AND PLACE IN AC.
	CAME	AC,AC-1			;WAS FRACTION ROUNDED UP?
	ER3	AC,10001		;RESULT DID NOT ROUND UP
	JUMPL	SAC,Q10000		;LOOP ON ERROR SWITCH
SUBTTL	DIAGNOSTIC SECTION - FLTR - NON-AC RANGE ADDRESS

;VERIFY THAT 'FLTR AC,E' OPERATES FOR 'E' BEYOND 'AC' RANGE

Q10010:	MOVSI	AC-2,1B19		;INITIALIZE FIX PT NO.
	HRRI	AC-2,177
	MOVEM	AC-2,TSTWD
	MOVSI	AC-1,243400		;SET-UP EXPECTED RESULT
	FLTR	AC,TSTWD		;*CONVERT FIX PT NO. IN 'E' TO FLT PT AND STORE IN AC
	CAME	AC,AC-1			;DID FLTR GET CORRECT C(E)?
	ER3	AC,10011		;FAILURE TO GET C(E)
	JUMPL	SAC,Q10010		;LOOP ON ERROR SWITCH
SUBTTL	DIAGNOSTIC SECTION - DMOVE - GENERAL DATA PATTERNS

;CHECK THAT 'DMOVE AC,E' DOES NOT CLOBBER C(E) OR C(E+1)

Q10050:	MOVE	AC-2,[631463,,146314]	;INITIALIZE C(E), C(E+1)
	MOVE	AC-1,[424242,,131313]
	DMOVE	AC,AC-2			;*MOVE DOUBLE WORD FROM E, E+1 TO AC, AC+1
	CAME	AC-2,[631463,,146314]	;WAS C(E) MODIFIED?
	ER5	AC-2,10051		;C(E) WAS CLOBBERED
	CAME	AC-1,[424242,,131313]	;WAS C(E+1) MODIFIED?
	ER6	AC-1,10051		;C(E+1) WAS CLOBBERED
	JUMPL	SAC,Q10050
PAGE
	DMVE	1010,0,0,0,0

	DMVE	1020,-1,-1,-1,-1
PAGE
	DMVE	1030,0,0,-1,-1

	DMVE	1040,-1,-1,0,0
PAGE
	DMVE	1050,252525,252525,525252,525252

	DMVE	1060,525252,525252,252525,252525
SUBTTL	DIAGNOSTIC SECTION - DMOVE - AC=17, AC+1=0

;CHECK DMOVE FOR AC=17 AND AC+1=0

	AC=17
	SAC=<AC+4>&17
	SAVEAC (1,1)

	DMVE17	1070,1071,-1,-1,-1,-1
SUBTTL	DIAGNOSTIC SECTION - DMOVE - AC RANGE ADDRESS

;CHECK DMOVE WHERE 'E' IS WITHIN THE 'AC' RANGE

	AC=4
	SAC=<AC+4>&17
	SAVEAC(1,1)
	E=AC-2

SN=11000
	E=<E-1>&17

Q11000:	REPEAT	^D5,
<SN=SN+1
	E=<E+1>&17
	SETZB	AC,AC+1			;INITIALIZE AC,AC+1
	SETOB	E,E+1			;INITIALIZE E,E+1
	HRRZI	E+1,-1
	SETOB	AC+5,<AC+6>&17		;INITIALIZE TEST WORDS FOR COMPARISON
	HRRZI	AC+6,-1
	DMOVE	AC,E			;*MOVE DOUBLE WORD FROM E, E+1 TO AC, AC+1
	CAME	AC,<AC+5>&17		;DID DMOVE GET CORRECT C(E)?
	ER3	AC,SN			;FAIL IF C(AC) NOT = -1,-1
	CAME	AC+1,<AC+6>&17		;DID DMOVE GET CORRECT C(E+1)?
	ER4	AC+1,SN			;FAIL IF C(AC+1) NOT = 0,-1
	JUMPL	SAC,.-^D8		;LOOP ON ERROR SWITCH
>
SUBTTL	DIAGNOSTIC SECTION - DMOVN - GENERAL DATA PATTERNS

;CHECK THAT 'DMOVN AC,E' DOES NOT CLOBBER C(E) OR C(E+1)

Q11050:	DMOVE	AC-2,[631463,,146314	;INITIALIZE C(E), C(E+1)
		      424242,,131313]
	DMOVN	AC,AC-2			;*MOVE NEGATIVE OF DOUBLE WORD FROM E, E+1 TO AC, AC+1
	CAME	AC-2,[631463,,146314]	;WAS C(E) MODIFIED?
	ER5	AC-2,11051		;C(E) WAS CLOBBERED
	CAME	AC-1,[424242,,131313]	;WAS C(E+1) MODIFIED?
	ER6	AC-1,11052		;C(E+1) WAS CLOBBERED
	JUMPL	SAC,Q11050		;LOOP ON ERROR SWITCH
PAGE
	DMVN	1110,0,0,0,0
PAGE
	DMVN	1120,0,0,0,1
PAGE
	DMVN	1130,-1,-1,0,1
PAGE
	DMVN	1140,0,1,0,0
PAGE
	DMVN	1150,525252,525252,252525,252526
PAGE
	DMVN	1160,252525,252525,525252,525253
SUBTTL	DIAGNOSTIC SECTION - DMOVN - AC=17, AC+1=0

;CHECK DMOVN FOR AC=17 AND AC+1=0

	AC=17
	SAC=<AC+4>&17
	SAVEAC	(1,1)

	DMVN17	1170,0,0,0,1
SUBTTL	DIAGNOSTIC SECTION - DMOVN - AC RANGE ADDRESS

;CHECK DMOVN WHERE 'E' IS WITHIN THE 'AC' RANGE

	AC=4
	SAC=<AC+4>&17
	SAVEAC	(1,1)
	E=AC-2

SN=12000
	E=<E-1>&17

Q12000:	REPEAT	^D5,
<SN=SN+1
	E=<E+1>&17
	DMOVE	AC,[XWD 707070,707070
		    XWD 070707,070707]	;INITIALIZE AC,AC+1
	SETCM	AC+5,[XWD 0,0]		;INITIALIZE TEST WORDS
	MOVN	AC+6,[XWD 0,-1]		;FOR COMPARISON
	TLZ	AC+6,1B18		;CLEAR SIGN BIT OF LOW ORDER WORD
	DMOVE	E,[XWD 0,0
		   XWD 0,-1]		;INITIALIZE E,E+1
	DMOVN	AC,E			;*MOVE NEGATIVE OF DOUBLE WORD FROM E, E+1 TO AC, AC+1
	CAME	AC,<AC+5>&17		;DID DMOVN GET CORRECT C(E)?
	ER3	AC,SN			;FAIL IF C(AC) NOT = 2'S COMPL OF C(E)
	CAME	AC+1,<AC+6>&17		;DID DMOVN GET CORRECT C(E+1)?
	ER4	AC+1,SN			;FAIL IF C(AC+1) NOT = 2'S COMPL OF C(E+1)
	JUMPL	SAC,.-^D8		;LOOP ON ERROR SWITCH
>
SUBTTL	DIAGNOSTIC SECTION - DMOVN - GENERAL DATA PATTERNS

	DMVN	1210,400000,0,0,0
PAGE
	DMVN	1220,0,0,400000,0
PAGE
	DMVN	1230,400000,0,400000,0
SUBTTL	DIAGNOSTIC SECTION - DMOVN - OVERFLOW AND CARRY FLAGS

;CHECK ABILITY TO CLEAR OVFL AND CRY FLAGS BEFORE TESTING INTERACTION WITH DMOVN

Q12400:	JFCL	17,.+1			;CLEAR OVFL AND CRY FLAGS
	JSP	AC,.+1			;READ FLAGS
	TLNE	AC,7B20			;TEST OVFL AND CRY FLAGS
	ER13	AC,12401		;FAIL IF OVFL OR CRY FLG SET
	JUMPL	SAC,Q12400		;LOOP ON ERROR SWITCH

	DMVNF	1250,0,0,0,0,300000,310000,300000,310000
PAGE
	DMVNF	1260,400000,0,0,0,500000,510000,100000,510000
PAGE
	DMVNF	1270,0,0,400000,0,300000,310000,300000,310000
PAGE
	DMVNF	1300,400000,0,400000,0,500000,510000,100000,510000
SUBTTL	DIAGNOSTIC SECTION - DMOVEM - GENERAL DATA PATTERNS

;CHECK THAT 'DMOVEM AC,E' DOES NOT CLOBBER C(AC) OR C(AC+1)

Q13050:	DMOVE	AC,[631463,,146314	;INITIALIZE C(AC), C(AC+1)
		    424242,,131313]
	DMOVEM	AC,AC-2			;*MOVE DOUBLE WORD FROM AC, AC+1 TO MEMORY
	CAME	AC,[631463,,146314]	;WAS C(AC) MODIFIED?
	ER3	AC,13051		;C(AC) WAS CLOBBERED
	CAME	AC+1,[424242,,131313]	;WAS C(AC+1) MODIFIED?
	ER4	AC+1,13051		;C(AC+1) WAS CLOBBERED
	JUMPL	SAC,Q13050		;LOOP ON ERROR SWITCH
PAGE
	DMVM	1310,0,0,0,0

	DMVM	1320,-1,-1,-1,-1
PAGE
	DMVM	1330,0,0,-1,-1

	DMVM	1340,-1,-1,0,0
PAGE
	DMVM	1350,252525,252525,525252,525252

	DMVM	1360,525252,525252,252525,252525
SUBTTL	DIAGNOSTIC SECTION - DMOVEM - AC=17, AC+1=0

;CHECK DMOVEM FOR AC=17 AND AC+1=0

	AC=17
	SAC=<AC+4>&17
	SAVEAC	(1,1)

	DMVM17	1370,-1,-1,-1,-1
SUBTTL	DIAGNOSTIC SECTION - DMOVEM - AC RANGE ADDRESS

;CHECK DMOVEM WHERE 'E' IS WITHIN THE 'AC' RANGE

	AC=4
	SAC=<AC+4>&17
	SAVEAC	(1,1)
	E=<AC-2>&17

SN=14000
	E=<E-1>&17

Q14000:	REPEAT	^D5,<
;CHECK DMOVEM WHERE 'E' IS WITHIN THE AC RANGE

SN=SN+1
	E=<E+1>&17
	DMOVE	E,[XWD 707070,707070
		   XWD 070707,070707]	;INITIALIZE E,E+1
	DMOVE	AC,[XWD	-1,-1		;INITIALIZE AC, AC+1
		    XWD 0,-1]
	DMOVEM	AC,E			;*MOVE DOUBLE WORD FROM AC, AC+1 TO MEMORY
	CAME	E,[XWD -1,-1]		;WAS 'E' UPDATED CORRECTLY?
	ER5	E,SN			;FAIL IF C(E) IS NOT = TO -1,-1
	IFN	<E-<AC+1>>,<
	CAME	E+1,[XWD 0,-1]		;FAIL IF C(E+1) IS NOT = 0,-1>
	IFE	<E-<AC+1>>,<
	GO	Q14001			;THIS CASE DIFFERENT KI/KL>
	ER6	E+1,SN			;'E+1' WAS NOT UPDATED CORRECTLY
	JUMPL	SAC,.-7			;LOOP ON ERROR SWITCH
>
	JRST	Q14021

Q14001:	SKIPE	KLFLG			;KL10 ?
	JRST	Q14003			;YES

Q14002:	CAMN	6,[-1,,-1]		;KI10
	AOS	(P)			;PASSED, SKIP RETURN OVER ERROR
	RTN

Q14003:	CAMN	6,[0,,-1]		;KL10
	AOS	(P)			;PASSED, SKIP RETURN OVER ERROR
	RTN
SUBTTL	DIAGNOSTIC SECTION - DMOVEM - BIS FLAG

Q14021:	SKIPE	KLFLG			;KL10 ?
	JRST	Q14050			;YES

;**KI10 ONLY TEST**
;VERIFY THAT C(E) IS NOT MODIFIED BY "DMOVEM AC,E" IF 'BIS'
;FLAG IS SET; AND THAT THE SECOND PART OF "DMOVEM" CLEARS 'BIS'.

	AC=4
	SAC=<AC+4>&17
	SAVEAC	(1,1)
	E=<AC-2>&17

Q14020:	DMOVE	AC,[631463,,146314
		    424242,,131313]	;INITIALIZE AC,AC+1
	SETOB	E,<E+1>&17		;INITIALIZE E,E+1
	JRSTF	@.+1			;SET 'BIS' FLAG
	XWD	BIS,.+1
	DMOVEM	AC,E			;*DMOVEM SHOULD MODIFY ONLY 'E+1' AND CLEAR BIS FLAG
	CAME	E,[-1,,-1]		;WAS C(E) MODIFIED?
	ER5	E,14021			;YES, C(E) WAS MODIFIED
	CAME	E+1,<AC+1>&17		;WAS C(E+1) MODIFIED?
	ER6	E+1,14021		;NO, C(E+1) WAS NOT MODIFIED
	JSP	AC+2,.+1		;READ FLAGS
	TLNE	AC+2,BIS		;IS 'BIS' FLAG CLEAR
	ER13	AC+2,14021		;NO
	JUMPL	SAC,Q14020		;LOOP ON ERROR SWITCH
SUBTTL	DIAGNOSTIC SECTION - DMOVNM - GENERAL DATA PATTERNS

;CHECK THAT 'DMOVNM AC,E' DOES NOT CLOBBER C(AC) OR C(AC+1)

Q14050:	DMOVE	AC,[631463,,146314	;INITIALIZE AC, AC+1
		    424242,,131313]
	DMOVNM	AC,AC-2			;*MOVE NEGATIVE OF DOUBLE WORD FROM AC, AC+1 TO MEMORY
	CAME	AC,[631463,,146314]	;WAS C(AC) MODIFIED?
	ER3	AC,14051		;C(AC) WAS CLOBBERED
	CAME	AC+1,[424242,,131313]	;WAS C(AC+1) MODIFIED?
	ER4	AC+1,14051		;C(AC+1) WAS CLOBBERED
	JUMPL	SAC,Q14050		;LOOP ON ERROR
PAGE
	DMVNM	1410,0,0,0,0
PAGE
	DMVNM	1420,0,0,0,1
PAGE
	DMVNM	1430,-1,-1,0,1
PAGE
	DMVNM	1440,0,1,0,0
PAGE
	DMVNM	1450,525252,525252,252525,252526
PAGE
	DMVNM	1460,252525,252525,525252,525253
SUBTTL	DIAGNOSTIC SECTION - DMOVNM - AC=17, AC+1=0

;CHECK DMOVNM FOR AC=17 AND AC+1=0

	AC=17
	SAC=<AC+4>&17
	SAVEAC	(1,1)

	DMVNM17	1470,0,0,0,1
SUBTTL	DIAGNOSTIC SECTION - DMOVNM - AC RANGE ADDRESS

;CHECK DMOVNM WHERE 'E' IS WITHIN THE 'AC' RANGE

	AC=4
	SAC=<AC+4>&17
	SAVEAC	(1,1)
	E=AC-2

SN=15000
	E=<E-1>&17

Q15000:	REPEAT	^D5,<
;CHECK DMOVNM WHERE 'E' IS WITHIN THE 'AC' RANGE

SN=SN+1
	E=<E+1>&17
	DMOVE	E,[XWD 707070,707070
		  XWD 070707,070707]	;INITIALIZE E,E+1
	DMOVE	AC,[XWD 0,0
		  XWD 0,-1]		;INITIALIZE AC,AC+1
	DMOVN	AC+5,AC			;INITIALIZE TEST RESULTS
	IFE	<E-<AC+1>>,<
	SKIPN	KLFLG			;DON'T DO NEXT INST IF KL10
	MOVNM	AC+5,<AC+6>&17>
	DMOVNM	AC,E			;*MOVE NEGATIVE OF DOUBLE WORD FROM AC, AC+1 TO MEMORY
	CAME	E,AC+5			;WAS 'E' UPDATED CORRECTLY?
	ER5	E,SN			;FAIL IF C(E) IS NOT = TO COMPLEMENT C(AC)
	CAME	E+1,AC+6		;WAS 'E+1' UPDATED CORRECTLY?
	ER6	E+1,SN			;FAIL IF C(E+1) IS NOT = NEGATIVE C(AC+1)
	IFN	<E-<AC+1>>,<
	JUMPL	SAC,.-^D8		;LOOP ON ERROR SWITCH>
	IFE	<E-<AC+1>>,<
	JUMPL	SAC,.-^D10		;LOOP ON ERROR SWITCH>
>
SUBTTL	DIAGNOSTIC SECTION - DMOVNM - GENERAL DATA PATTERNS

	DMVNM	1510,400000,0,0,0
PAGE
	DMVNM	1520,0,0,400000,0
PAGE
	DMVNM	1530,400000,0,400000,0
SUBTTL	DIAGNOSTIC SECTION - DMOVNM - OVERFLOW AND CARRY FLAGS

	DMVNMF	1540,0,0,0,0,300000,310000,300000,310000
PAGE
	DMVNMF	1550,400000,0,0,0,500000,510000,100000,510000
PAGE
	DMVNMF	1560,0,0,400000,0,300000,310000,300000,310000
PAGE
	DMVNMF	1570,400000,0,400000,0,500000,510000,100000,510000