Google
 

Trailing-Edge - PDP-10 Archives - klad_sources - klad.sources/dfkbbm.mac
There are no other files named dfkbbm.mac in the archive.
SUBTTL	INITIALIZE PROGRAM

START:	MOVSI	(JFCL)
	MOVEM	$ITRX1
	PGMINT			;INITIALIZE SUBROUTINES
	MOVE	0,RANDBS	;EXEC, SETUP RANDOM
	MOVEM	0,RAN		;SETUP RANDOM BASE
	MOVEM	0,RA

;*SET PROGRAM UNCACHED
;*IF SWITCH 18 SET, CACHE EVERYTHING

	MOVE	CONSW
	TRNE	400000		;SWITCH 18 SET ?
	JRST	MEMFD1		;YES, RUN EVERYTHING CACHED

	MOVEI	1,END
	ADDI	1,1000
	ANDI	1,777000
	LSH	1,-^D10
	MOVN	1,1
	HRLZ	1,1
	MOVE	[540000,,540001]
	MOVEM	600(1)
	ADD	[2,,2]
	AOBJN	1,.-2

	CFLUSH			;CLEAN OUT CACHE

	CONI	PAG,1
	CONO	PAG,(1)		;REENABLE PAGING
;*COMPUTE MEMORY SIZE TO BE USED

MEMFD1:	SWITCH
	ANDI	0,777
	SKIPN	0		;MEMORY SIZE SPECIFIED ?
	JRST	MEMFD3		;NO, CHECK RELIAB & OPRSEL SWITCHES
MEMFD2:	LSH	0,9		;POSITION HIGH ORDER
	TRO	0,777		;SET LOW ORDER BITS
	CAMLE	0,MEMSIZ+1	;LESS THAN ACTUAL MEMORY
	MOVE	0,MEMSIZ+1	;NO, USE ACTUAL MEMORY
	HRRZM	0,MEMSIZ+1	;SAVE
	CAML	0,MEMLOW	;ENOUGH MEMORY FOR TEST ?
	JRST	MEMFD4		;YES
	MOVEI	[ASCIZ/
MEMORY SIZE SELECTED TOO SMALL/]
	PNTALF
	MOVEI	PGMNAM
	PNTALF
	ERRHLT
	JRST	START

MEMFD3:	MOVE	0,CONSW
	TLNE	RELIAB!OPRSEL	;IF EITHER RELIAB OR OPRSEL SWITCH SET
	JRST	MEMFD4		;USE ALL OF MEMORY
	MOVEI	77		;OTHERWISE LIMIT MEMORY TO 32K
	JRST	MEMFD2

MEMFD4:	MOVE	0,CONSW
	TLNE	0,CHAIN		;RUNNING IN CHAIN MODE ?
	JRST	STARTA		;YES
	PMSG	<TESTING >
	MOVE	MEMSIZ+1
	ADDI	0,1
	IDIVI	^D1024
	PNTDEC			;PRINT MEMORY SIZE BEING USED
	PMSG	<K^>
	JRST	STARTA
;*COMPUTE BUFFER SIZE TO BE USED

STARTA:	MOVSI	(JFCL)
	MOVEM	$ITRX1

MST1:	MOVE	1,MEMSIZ+1	;GET MEMORY SIZE
	MOVN	1,1		;MAKE (AC1) CONTAIN
	ADD	1,MEMLOW	; - HIGHEST MEM LOC + END OF PROG
	MOVS	1,1		;IN THE LEFT HALF
	HRR	1,MEMLOW	;END OF PROG IN RIGHT HALF
	MOVEM	1,BLOK#		;SAVE

MST2:	MOVE	1,MEMSIZ+1
	MOVS	2,1		;PUT HIGHEST MEMORY LOCATION
	HRR	2,1		;IN LEFT AND RIGHT HALF
	MOVEM	2,MODULO#	;OF MODULO
	MOVN	1,1		;MAKE C(AC1) CONTAIN
	ADD	1,MEMLOW	;-HIGHEST MEM LOC + END OF PROGRAM
	MOVS	1,1		;IN THE LEFT HALF
	HRR	1,MEMLOW	;END OF PROG IN RIGHT HALF
	MOVEM	1,WCBUF#	;SAVE
	SUB	1,[1,,0]
	MOVEM	1,BUFSIZ#

	MOVE	[JRST $MEMERR]
	MOVEM	$ITRX1		;SETUP SPECIAL INTERRUPT INTERCEPT
	JRST	MSADT		;GO PERFORM DIAGNOSTIC
RENTR1:	DROPDV			;CLOSE LOGICAL OUTPUT FILE
	CALL	[SIXBIT .EXIT.]

PGMNAM:	ASCIZ/
DECSYSTEM10 KL10 BASIC INSTRUCTION RELIABILITY TEST 2 (DFKBB)
(MEMORY AND BOTH MODES) CACHE RELIABILITY
/
SUBTTL	$MEMERR - SPECIAL INTERRUPT ERROR PROCESSOR

$MEMERR:MOVEM	16,$SV16#
	MOVE	16,$SVAPR
	TRNN	16,LPARER
	JRST	$MEME2		;NOT PARITY ERROR

	700400,,16		;READ ERA
	TLNN	16,4000
	JRST	$MEME2		;NOT CACHE WRITEBACK

	TLNE	16,400000	;COMPUTE LOW ORDER ADR BITS
	TRO	16,2		;HACK - FROM BIT 0 & 1
	TLNE	16,200000
	TRO	16,1
	ANDI	16,-1		;CLEAR UPPER BITS
	MOVEM	16,$MADR#	;SAVE ADDRESS

	MOVE	3,(16)		;GET BAD DATA
	MOVEM	3,$MBAD#

	MOVE	16,ERRLOP	;COMPUTE TESTING ADDRESS
	ADDI	16,2		;MAKE "AC-1" INTO "AC1"
	MOVE	0,(16)		;GET TESTING ADDRESS CONTROL WORD
	CAIN	16,16		;WAS IT IN AC THAT WAS SAVED ?
	MOVE	0,$SV16		;YES
	ANDI	0,-1
	MOVEM	0,$MTADR#	;SAVE TESTING ADDRESS

	CAMG	0,$MADR		;ABOVE OR BELOW FAILING ADDRESS ?
	JRST	$MABOVE		;FAIL ADR ABOVE TESTING ADR
;*$MBELOW - BELOW SPECIAL PROCESS DISPATCH

$MBELOW:MOVE	4,TESTPC	;TO SPECIAL PROCESS IF NECESSARY
	CAIN	4,MSADT
	JRST	$MSADT
	CAIN	4,TST13
	JRST	$TST13
	CAIN	4,TST16
	JRST	$TST16
	CAIN	4,TST20
	JRST	$TST20
	CAIN	4,TST21
	JRST	$TST21
	CAIN	4,TST22
	JRST	$MEMONE
	CAIN	4,TST23
	JRST	$MEMZRO
	CAIN	4,TST24
	JRST	$MEMONE
	CAIN	4,TST25
	JRST	$MEMZRO
	CAIN	4,TST26
	JRST	$MEMONE
	CAIN	4,TST30
	JRST	$TST30
	JRST	$MEME0
;*$MABOVE - ABOVE SPECIAL PROCESS DISPATCH

$MABOVE:MOVE	4,TESTPC	;TO SPECIAL PROCESS IF NECESSARY
	CAIN	4,TST14
	JRST	$TST13
	CAIN	4,TST17
	JRST	$TST16
	CAIN	4,TST21
	JRST	$TST20
	CAIN	4,TST22
	JRST	$TST21
	CAIN	4,TST23
	JRST	$MEMONE
	CAIN	4,TST24
	JRST	$MEMZRO
	CAIN	4,TST25
	JRST	$MEMONE
	CAIN	4,TST26
	JRST	$MEMZRO
	CAIN	4,TST27
	JRST	$MEMONE
	CAIN	4,TST31
	JRST	$TST30
	JRST	$MEME0
;*MOST TESTS HAVE MEMORY = RANDOM

$MEME0:	MOVE	16,$MADR
	SOS	16		;GET PREVIOUS GOOD WORD
	MOVE	0,(16)

	MOVE	2,ERRLOP	;GET AC ADDRESS
	AOS	2

	MOVE	1,0
	ADD	0,[142536475076]
	ROT	0,-1		;GENERATE GOOD WORD
	CAIE	2,10		;ARE AC & RA THE SAME ?
	EQVB	0,1		;NO
	CAIN	2,10
	EQVB	0,0		;YES
	MOVEM	0,$MGOOD#	;SAVE GOOD WORD

;*PRINT ERROR INFORMATION IN THE FORM
;*FAIL ADR  TEST ADR  GOOD             BAD              DIFF

$MEME1:	PNTMSG	[ASCIZ/
FAIL ADR  TEST ADR  GOOD             BAD              DIFF
/]

	MOVE	$MADR
	PNT6			;PRINT FAIL ADDRESS
	PNTMSG	[ASCIZ/   /]

	MOVE	$MTADR
	PNT6			;PRINT TESTING ADDRESS
	PNTMSG	[ASCIZ/   /]

	MOVE	$MGOOD
	PNTHW			;PRINT GOOD WORD
	PNTMSG	[ASCIZ/   /]

	MOVE	$MBAD
	PNTHW			;PRINT BAD WORD
	PNTMSG	[ASCIZ/   /]

	MOVE	$MGOOD
	XOR	$MBAD
	PNTHW			;PRINT DIFFERENCE
	PCRL
$MEME2:	SWITCH
	TLNE	RSTART		;RESTART SWITCH SET ?
	JRST	BEGIN		;YES, RESTART PROGRAM
	FATAL			;NO, FATAL OUT
;*$TST13 - SPECIAL TST13 DATA REGENERATOR

$TST13:	MOVE	RA,RASV13	;GET RANDOM
	MOVE	11,ACSV13	;GET AC

	HRRZ	1,BLOK		;COMPUTE COUNT
	SUB	1,$MADR

	ADD	RA,[142536475076]
	ROT	RA,-1
	EQVB	RA,11		;COMPUTE RANDOM
	MOVEM	RA,2

	HLRS	11,2		;TEST INSTRUCTIONS

	AOJLE	1,.-5		;DO TILL AT FAILURE ADDRESS

	MOVEM	11,$MGOOD	;SAVE GOOD DATA
	JRST	$MEME1

;*$TST16 - SPECIAL TST16 DATA REGENERATOR

$TST16:	MOVE	RA,RASV16	;GET RANDOM
	MOVE	11,ACSV16	;GET AC

	HRRZ	1,BLOK		;COMPUTE COUNT
	SUB	1,$MADR

	ADD	RA,[142536475076]
	ROT	RA,-1
	EQVB	RA,11		;COMPUTE RANDOM
	MOVEM	RA,2

	TRZ	11,400000
	TLZ	11,400000

	AOJLE	1,.-6		;DO TILL AT FAILURE ADDRESS

	MOVEM	11,$MGOOD	;SAVE GOOD DATA
	JRST	$MEME1
;*$TST20 - SPECIAL TST20 DATA REGENERATOR

$TST20:	MOVE	RA,RASV20	;GET RANDOM
	MOVE	11,ACSV20	;GET AC

	HRRZ	1,BLOK		;COMPUTE COUNT
	SUB	1,$MADR

	ADD	RA,[142536475076]
	ROT	RA,-1
	EQVB	RA,11		;COMPUTE RANDOM
	MOVEM	RA,2

	HRROM	11,2
	HRRZS	11,2

	AOJLE	1,.-6		;DO TILL AT FAILURE ADDRESS

	MOVEM	2,$MGOOD	;SAVE GOOD DATA
	JRST	$MEME1

;*$TST21 - SPECIAL TST21 DATA REGENERATOR

$TST21:	MOVE	RA,RASV21	;GET RANDOM
	MOVE	11,ACSV21	;GET AC

	HRRZ	1,BLOK		;COMPUTE COUNT
	SUB	1,$MADR

	ADD	RA,[142536475076]
	ROT	RA,-1
	EQVB	RA,11		;COMPUTE RANDOM
	MOVEM	RA,2

	HRROS	11,2
	HRRZM	11,2

	AOJLE	1,.-6		;DO TILL AT FAILURE ADDRESS

	MOVEM	2,$MGOOD	;SAVE GOOD DATA
	JRST	$MEME1
;*$TST30 - SPECIAL TST30 DATA REGENERATOR

$TST30:	MOVE	RA,RASV30	;GET RANDOM
	MOVE	11,ACSV30	;GET AC

	HRRZ	1,BLOK		;COMPUTE COUNT
	SUB	1,$MADR

	ADD	RA,[142536475076]
	ROT	RA,-1
	EQVB	RA,11		;COMPUTE RANDOM
	MOVEM	RA,2

	MOVMS	11,2

	AOJLE	1,.-5		;DO TILL AT FAILURE ADDRESS

	MOVEM	11,$MGOOD	;SAVE GOOD DATA
	JRST	$MEME1

;*$MEMONE - SPECIAL ALL ONES DATA REGENERATOR

$MEMONE:SETOM	$MGOOD
	JRST	$MEME1

;*$MEMZRO - SPECIAL ALL ZEROS DATA REGENERATOR

$MEMZRO:SETZM	$MGOOD
	JRST	$MEME1

;*$MSADT - SPECIAL MEMORY ADDRESS REGENERATOR

$MSADT:	HRRZ	1,BLOK		;COMPUTE COUNT
	SUB	1,$MADR
	MOVE	11,BLOK
	AOBJN	11,.+1
	AOJLE	1,.-1		;COMPUTE DATA WORD
	MOVEM	11,$MGOOD
	JRST	$MEME1
SUBTTL	DIAGNOSTIC SECTION

	LALL
;*MSADT - FAST ADDRESS TEST TO CHECK MEMORY(S)

	AC=4
MSADT:	MOVEI	AC-1,.
	MOVEM	AC-1,TESTPC	;SETUP SUBTEST PC
	MOVEI	AC-1,<AC-1>&17	;INFORM ERROR ROUTINE WHICH AC IS
	MOVEM	AC-1,ERRLOP#	;USED FOR KEEPING PROG IN LOOP.
	SETZ	2,		;CLEAR AC2.
	MOVE	1,BLOK		;MOVE(-TOP+END) END INTO AC1.
MSADT2:	CONO	APR,LDPAER!LAPRP1	 ;DISABLE PARITY
MSADT1:	MOVEM	1,(1)		;MOVE TO MEM.
	CAME	1,(1)		;DOES IT COMPARE?
	ERRM	1,1		;NO. PNT ERR MES.
MSADT4:	CONSZ	APR,LPARER	;KL10 PARITY ERROR ?
	ER	1,[ASCII/PAR/]
	CONO	APR,LCPAER!LAPRP1
MSADT3:	JUMPL	AC-1,MSADT1(2)	;LOOP ON ERROR SWITCH.
	AOBJN	1,.+1		;FIX FOR GREATER THAN 128K MEM
	TLNE	1,770000
	JRST	MSADT1(2)	;ADD ONE AND TRY NEXT MEM LOC.
	XORI	2,1		;THIS MAKES C(AC2)=1 OR 0.
	SKIPE	2		;C(AC2)=0?... GONE THROUGH 2 PASSES.
	JRST	MSADT2		;NO..DO 2ND PASS...JUST COMPARE.
	CONO	APR,LAPRAL!LAPRP1
;*TST1
;*TEST MOVE, MOVEM, MOVES, HLLM, EXCH.  AFTER EXECUTING
;*THESE 5 INSTRUCTIONS, THE C(AC) AND C(E) SHOULD STILL
;*=RANDOM NUM.

	AC=10
TST1:	SETUP
TST1A:	RANDOM
TST1B:	MOVE	AC,(AC1)	;DO A MOVE...C(AC)+C(E) STAY SAME.
	MOVEM	AC,(AC1)	;DO A MOVEM...C(AC)+C(E) STAY SAME.
	MOVES	AC,(AC1)	;DO A MOVES...C(AC)+C(E) STAY SAME.
	HLLM	AC,(AC1)	;DO A HLLM...C(AC)+C(E) STAY SAME.
	EXCH	AC,(AC1)	;DO AN EXCH...C(AC)+C(E) STAY SAME.
	CAME	AC,RA		;C(AC) SHOULD STILL=RAN. NUM.
	ERR	RA,RA
	CAME	RA,(AC1)	;C(E) SHOULD STILL=RAN.NUM.
	ERRM	RA,RA
	JUMPL	AC-1,TST1B-4	;LOOP ON ERROR SWITCH
	AOBJN	AC1,.+1
	TLNE	AC1,770000
	JRST	TST1A		;INC. TO TEST NEXT LOC.
;*TST2
;*TEST HLLS, HRRM, ANDM, SETAB.  AFTER
;*EXECUTING THESE 4 INSTRUCTIONS, THE C(AC)+C(E)
;*SHOULD STILL=RANDOM NUM.

	AC=1
TST2:	SETUP
TST2A:	RANDOM
TST2B:	HLLS	AC,(AC1)	;DO A HLLS INST...C(AC)+C(E) STAY SAME
	HRRM	AC,(AC1)	;DO A HRRM INST...C(AC)+C(E) STAY SAME
	ANDM	AC,(AC1)	;DO A HRRS INST...C(AC)+C(E) STAY SAME
	SETAB	AC,(AC1)	;DO A SETMM INST...C(AC)+C(E) STAY SAME.
	CAME	AC,RA		;C(AC) SHOULD STILL=RAN. NUM
	ERR	RA,RA
	CAME	RA,(AC1)	;C(E) SHOULD STILL=RAN NUM
	ERRM	RA,RA
	JUMPL	AC-1,TST2B-4	;LOOP ON ERROR SWITCH
	AOBJN	AC1,.+1
	TLNE	AC1,770000
	JRST	TST2A		;INC TO TEST NEXT LOC.
;*TST3
;*TEST SETMB, HRRS, IORB, SETAM, SETMM.  AFTER
;*EXECUTING THESE 5 INSTRUCTIONS, THE C(AC)+C(E)
;*SHOULD STILL=RANDOM NUMBER

	AC=2
TST3:	SETUP
TST3A:	RANDOM
TST3B:	SETMB	AC,(AC1)	;DO A SETMB. INST...C(AC)+C(E) STAY SAME
	HRRS	AC,(AC1)	;DO AN ANDM INST...C(AC)+C(E) STAY SAME
	IORB	AC,(AC1)	;DO AN ANDB INST...C(AC)+C(E) STAY SAME
	SETAM	AC,(AC1)	;DO A SETAM INST...C(AC)+C(E) STAY SAME
	SETMM	AC,(AC1)	;DO A SETAB INST...C(AC)+C(E) STAY SAME
	CAME	AC,RA		;C(AC) SHOULD STILL=RAN. NUM.
	ERR	RA,RA
	CAME	RA,(AC1)	;C(E) SHOULD STILL=RAN. NUM.
	ERRM	RA,RA
	JUMPL	AC-1,TST3B-4	;LOOP ON ERROR SWITCH
	AOBJN	AC1,.+1
	TLNE	AC1,770000
	JRST	TST3A		;INC TO TEST NEXT LOC.
;*TST4
;*TEST IORM, ANDB, SETCMM, SETCMB.  AFTER
;*EXECUTING THESE 4 INSTRUCTIONS, THE C(AC)+C(E)
;*SHOULD STILL=RANDOM NUMBER.

	AC=3
TST4:	SETUP
TST4A:	RANDOM
				;IF ORIGIN C(AC)=0011,C(E)=0011
TST4B:	IORM	AC,(AC1)	;C(AC)=0011, C(E)=0011
	ANDB	AC,(AC1)	;C(AC)=0011, C(E)=0011
	SETCMM	AC,(AC1)	;C(AC)=0011, C(E)=1100
	SETCMB	AC,(AC1)	;C(AC)=0011, C(E)=0011
	CAME	AC,RA		;C(AC) SHOULD STILL=RAN. NUM.
	ERR	RA,RA
	CAME	RA,(AC1)	;C(E) SHOULD STILL=RAN. NUM.
	ERRM	RA,RA
	JUMPL	AC-1,TST4B-4	;LOOP ON ERROR SWITCH
	AOBJN	AC1,.+1
	TLNE	AC1,770000
	JRST	TST4A		;INC TO TEST NEXT LOC.
;*TST5
;*TEST MOVSM, MOVSS, MOVNM, MOVNS. AFTER
;*EXECUTING THESE 4 INSTRUCTIONS, THE C(AC)+C(E)
;*SHOULD STILL=RANDOM NUMBER

	AC=4
TST5:	SETUP
TST5A:	RANDOM
				;IF C(AC)+C(E)=(0011)0101
TST5B:	MOVSM	AC,(AC1)	;C(AC)=(0011)0101, C(E)=(0101)0011
	MOVSS	AC,(AC1)	;C(AC)=(0011)0101, C(E)=(0011)0101
	MOVNM	AC,(AC1)	;C(AC)=(0011)0101, C(E)=(1100)1011
	MOVNS	AC,(AC1)	;C(AC)=(0011)0101, C(E)=(0011)0101
	CAME	AC,RA		;C(AC) SHOULD STILL=RAN. NUM
	ERR	RA,RA
	CAME	RA,(AC1)	;C(E) SHOULD STILL=RAN. NUM.
	ERRM	RA,RA
	JUMPL	AC-1,TST5B-4	;LOOP ON ERROR SWITCH
	AOBJN	AC1,.+1
	TLNE	AC1,770000
	JRST	TST5A		;INC TO TEST NEXT LOC.
;*TST6
;*TEST HRLM, HLRN, MOVSS, XORM, XORB.  AFTER
;*EXECUTING THESE 5 INSTRUCTIONS, THE C(AC)+C(E)
;*SHOULD STILL=RANDOM NUMBER.

	AC=5
TST6:	SETUP
TST6A:	RANDOM
				;IF C(AC)+C(E)=(0011)0101
TST6B:	HRLM	AC,(AC1)	;C(AC)=(0011)0101, C(E)=(0101)0101
	HLRM	AC,(AC1)	;C(AC)=(0011)0101, C(E)=(0101)0011
	MOVSS	AC,(AC1)	;C(AC)=(0011)0101, C(E)=(0011)0101
	XORM	AC,(AC1)	;C(AC)=(0011)0101, C(E)=(0000)0000
	XORB	AC,(AC1)	;C(AC)=(0011)0101, C(E)=(0011)0101
	CAME	AC,RA		;C(AC) SHOULD STILL=RAN. NUM
	ERR	RA,RA
	CAME	RA,(AC1)	;C(E) SHOULD STILL=RAN. NUM.
	ERRM	RA,RA
	JUMPL	AC-1,TST6B-4	;LOOP ON ERROR SWITCH.
	AOBJN	AC1,.+1
	TLNE	AC1,770000
	JRST	TST6A		;INC TO TEST NEXT LOC.
;*TST7
;*TEST EQVM, ORCMM, ORCAM, EQVB. AFTER
;*EXECUTING THESE 4 INSTRUCTIONS, THE C(AC)+
;*C(E) SHOULD STILL=RANDOM NUMBER

	AC=6
TST7:	SETUP
TST7A:	RANDOM
				;IF C(AC)+C(E)=(0011)0101
TST7B:	EQVM	AC,(AC1)	;C(AC)=(0011)0101, C(E)=(1111)1111
	ORCMM	AC,(AC1)	;C(AC)=(0011)0101, C(E)=(0011)0101
	ORCAM	AC,(AC1)	;C(AC)=(0011)0101, C(E)=(1111)1111
	EQVB	AC,(AC1)	;C(AC)=(0011)0101, C(E)=(0011)0101
	CAME	AC,RA		;C(AC) SHOULD STILL=RAN. NUM
	ERR	RA,RA
	CAME	RA,(AC1)	;C(E) SHOULD STILL=RAN. NUM
	ERRM	RA,RA
	JUMPL	AC-1,TST7B-4	;LOOP ON ERROR SWITCH.
	AOBJN	AC1,.+1
	TLNE	AC1,770000
	JRST	TST7A		;INC TO TEST NEXT LOC.
;*TST10
;*TEST ANDCAM, ANDCMM, ANDCBB, SETCAB.  AFTER
;*EXECUTING THESE 4 INSTRUCTIONS, THE C(AC)+
;*C(E) SHOULD STILL=RANDOM NUMBER.

	AC=12
TST10:	SETUP
TST10A:	RANDOM
				;IF C(AC)+C(E)=(0011)0101,
TST10B:	ANDCAM	AC,(AC1)	;C(AC)=(0011)0101, C(E)=(0000)0000
	ANDCMM	AC,(AC1)	;C(AC)=(0011)0101, C(E)=(0011)0101
	ANDCBB	AC,(AC1)	;C(AC)=(1100)1010, C(E)=(1100)1010
	SETCAB	AC,(AC1)	;C(AC)=(0011)0101, C(E)=(0011)0101
	CAME	AC,RA		;C(AC) SHOULD STILL=RAN. NUM.
	ERR	RA,RA
	CAME	RA,(AC1)	;C(E) SHOULD STILL=RAN. NUM.
	ERRM	RA,RA
	JUMPL	AC-1,TST10B-4	;LOOP ON ERROR SWITCH.
	AOBJN	AC1,.+1
	TLNE	AC1,770000
	JRST	TST10A		;INC TO TEST NEXT LOC.
;*TST11
;*TEST SETCAM, ORCAB, ORCBM, AND CAB, AFTER
;*EXECUTING THESE 4 INSTRUCTIONS, THE C(AC)+
;*C(E) SHOULD STILL=RANDOM NUMBER.

	AC=12
TST11:	SETUP
TST11A:	RANDOM
				;IF C(AC)+C(E)=(0011)0101,
TST11B:	SETCAM	AC,(AC1)	;C(AC)=(0011)0101, C(E)=(1100)1010
	ORCAB	AC,(AC1)	;C(AC)=(1100)1010, C(E)=(1100)1010
	ORCBM	AC,(AC1)	;C(AC)=(1100)1010, C(E)=(0011)0101
	ANDCAB	AC,(AC1)	;C(AC)=(0011)0101, C(E)=(0011)0101
	CAME	AC,RA		;C(AC) SHOULD STILL=RAN. NUM.
	ERR	RA,RA
	CAME	RA,(AC1)	;C(E) SHOULD STILL=RAN. NUM.
	ERRM	RA,RA
	JUMPL	AC-1,TST11B-4	;LOOP ON ERROR SWITCH.
	AOBJN	AC1,.+1
	TLNE	AC1,770000
	JRST	TST11A		;INC TO TEST NEXT LOC.
;*TST12
;*TEST SETZM, ANDCBM, ORCMB. AFTER
;*EXECUTING THESE 3 INSTRUCTIONS, THE C(AC)
;*+C(E) SHOULD=RANDOM NUMBER.

	AC=13
TST12:	SETUP
TST12A:	RANDOM
				;IF C(AC(+C(E)=(0011)0101
TST12B:	SETZM	AC,(AC1)	;C(AC)=(0011)0101, C(E)=(0000)0000
	ANDCBM	AC,(AC1)	;C(AC)=(0011)0101, C(E)=(1100)1010
	ORCMB	AC,(AC1)	;C(AC)=(0011)0101, C(E)=(0011)0101
	CAME	AC,RA		;C(AC) SHOULD STILL=RAN. NUM.
	ERR	RA,RA
	CAME	RA,(AC1)	;C(E) SHOULD STILL=RAN. NUM.
	ERRM	RA,RA
	JUMPL	AC-1,TST12B-4	;LOOP ON ERROR SWITCH.
	AOBJN	AC1,.+1
	TLNE	AC1,770000
	JRST	TST12A		;INC TO TEST NEXT LOC.
;*TST13
;*TEST HRLS, HLRS. CHECK FOR
;*CORRECT DATA IN THE C(AC) AND C(E).
;*C(AC)+C(E)=RAN. NUM.

	AC=1
TST13:	SETUP
	MOVEM	RA,RASV13#
	MOVEM	AC,ACSV13#
TST13A:	RANDOM
TST13B:	MOVSI	AC2,(RA)	;SIMULAT A
	IORI	AC2,(RA)	;HRLS INST.
	HRLS	AC,(AC1)	;DO A HRLS
	CAME	AC,(AC1)	;C(AC) SHOULD=C(E).
	ERR	RA,RA
	CAME	AC2,(AC1)	;C(E) SHOULD=SIM. ANS.
	ERRM	RA,RA
	MOVS	AC3,RA		;SIMULATE
	MOVSI	AC2,(AC3)	;A
	IORI	AC2,(AC3)	;HLRS INST.
	MOVE	AC,RA		;RESTORE C(AC).
	MOVEM	AC,(AC1)	;RESTORE C(E).
	HLRS	AC,(AC1)	;DO A HLRS INST.
	CAME	AC,(AC1)	;C(AC) SHOULD=C(E).
	ERR	RA,RA
	CAME	AC2,(AC1)	;C(E) SHOULD=SIM. ANS.
	ERRM	RA,RA
	JUMPL	AC-1,TST13B-4	;LOOP ON ERROR SWITCH.
	AOBJN	AC1,.+1
	TLNE	AC1,770000
	JRST	TST13A		;INC TO TEST NEXT LOC.
;*TST14
;*TEST HRLZM, HLRZS, HLRZM, HRLZS. CHECK
;*FOR CORRECT DATA IN THE C(AC)+C(E).
;*C(AC)+C(E)=RAN. NUM.

	AC=14
TST14:	SETUP
TST14A:	RANDOM
				;IF C(AC)+C(E)=(0011)0101
TST14B:	HRLZM	AC,(AC1)	;C(AC)=(0011)0101, C(E)=(0101)000
	HLRZS	0,(AC1)		;C(AC)=(0011)0101,C(E)=(0000)0101
	HLLM	AC,(AC1)	;C(AC)=(0011)0101,C(E)=(0011)0101
	CAME	AC,RA		;C(AC)SHOULD=RAN. NUM.
	ERR	RA,RA
	CAME	RA,(AC1)	;C(E) SHOULD=RAN. NUM.
	ERRM	RA,RA
	HLRZM	AC,(AC1)	;C(AC)=(0011)0101,C(E)=(0000)0011
	HRLZS	0,(AC1)		;C(AC)=(0011)0101,C(E)=(0011)0000
	HRRM	AC,(AC1)	;C(AC)=(0011)0101,C(E)=)0011)0101
	CAME	AC,RA		;C(AC)SHOULD=RAN. NUM.
	ERR	RA,RA
	CAME	RA,(AC1)	;C(E)SHOULD=RAN. NUM.
	ERRM	RA,RA
	JUMPL	AC-1,TST14B-4	;LOOP ON ERROR SWITCH.
	AOBJN	AC1,.+1
	TLNE	AC1,770000
	JRST	TST14A		;INC TO TEST NEXT LOC.
;*TST15
;*TEST HRLOM, HLROS, HLROM, HRLOS. CHECK FOR
;*CORRECT DATA IN THE C(AC)+C(E).
;*C(AC)+C(E)=RAN. NUM.

	AC=15
TST15:	SETUP
TST15A:	RANDOM
				;IF C(AC)+C(E)=(0011)0101
TST15B:	HRLOM	AC,(AC1)	;C(AC)=(0011)0101, C(E)=(0101)1111
	HLROS	0,(AC1)		;C(AC)=)0011)0101, C(E)=(1111)0101
	HLLM	AC,(AC1)	;C(E)=(0011)0101, C(E)=(0011)0101
	CAME	AC,RA		;C(AC) SHOULD=RAN. NUM.
	ERR	RA,RA
	CAME	RA,(AC1)	;C(E) SHOULD=RAN. NUM.
	ERRM	RA,RA
	HLROM	AC,(AC1)	;C(AC)=(0011)0101, C(E)=(1111)0011
	HRLOS	0,(AC1)		;C(E)=(0011)1111
	HRRM	AC,(AC1)	;C(AC)=(0011)0101, C(E)=(0011)0101
	CAME	AC,RA		;C(AC) SHOULD=RAN. NUM.
	ERR	RA,RA
	CAME	RA,(AC1)	;C(E) SHOULD = RAN. NUM.
	ERRM	RA,RA
	JUMPL	AC-1,TST15B-4	;LOOP ON ERROR SWITCH.
	AOBJN	AC1,.+1
	TLNE	AC1,770000
	JRST	TST15A		;INC TO TEST NEXT LOC.
;*TST16
;*TEST HRLEM, HLRES, HLREM, HRLES. CHECK
;*FOR CORRECT DATA IN THE C(AC)+C(E).
;*C(AC)+C(E)=RAN. NUM.

	AC=1
TST16:	SETUP
	MOVEM	RA,RASV16#
	MOVEM	AC,ACSV16#
TST16A:	RANDOM
TST16B:	TRZ	AC,400000	;CLEAR BIT 18 IN AC.
	MOVE	AC2,AC		;SAVE FOR FUTURE COMPARE.
				;IF C(AC)+C(E)=(0011)0101
	HRLEM	AC,(AC1)	;C(AC)=(0011)0101, C(E)=(0011)0101
	HLRES	0,(AC1)		;C(AC)=(0011)0101, C(E)=(0000)0101
	HLLM	AC,(AC1)	;C(AC)=(0011)0101, C(E)=(0011)0101
	CAME	AC,AC2		;C(AC)SHOULD=ORIG C(AC).
	ERR	RA,AC2
	CAME	AC2,(AC1)	;C(E) SHOULD=ORIG C(AC).
	ERRM	RA,AC2
	TLZ	AC,400000	;CLEAR BIT 0.
	MOVE	AC2,AC		;SAVE FOR FUTURE COMPARE.
	HLREM	AC,(AC1)	;C(AC)=(0011)0101, C(E)=(0000)0011
	HRLES	0,(AC1)		;C(AC)=(0011)0101, C(E)=(0011)0000
	HRRM	AC,(AC1)	;C(AC) = (0011)0101, C(E) = (0011)0101.
	CAME	AC,AC2		;C(AC)SHOULD=ORIG C(AC).
	ERR	RA,AC2
	CAME	AC2,(AC1)	;C(E) SHOULD=ORIG C(AC).
	ERRM	RA,AC2
	JUMPL	AC-1,TST16B-4	;LOOP ON ERROR SWITCH
	AOBJN	AC1,.+1
	TLNE	AC1,770000
	JRST	TST16A		;INC TO TEST NEXT LOC.
;*TST17
;*TEST HRLEM, HLRES, HLREM, HRLES.   CHECK
;*FOR CORRECT DATA IN AC AND C(E).
;*C(AC)+C(E)=RAN. NUM.

	AC=2
TST17:	SETUP
TST17A:	RANDOM
TST17B:	TRO	AC,400000	;SET BIT 18 IN AC.
	MOVE	AC2,AC		;SAVE C(AC) FOR FUTURE COMPARE
				;IF C(AC)+C(E)=(0011)1101
	HRLEM	AC,(AC1)	;C(AC)=(0011)1101, C(E)=(1101)1111
	HLRES	0,(AC1)		;C(AC)=(0011)1101, C(E)=(0011)1101
	HLLM	AC,(AC1)	;C(AC)=(0011)1101, C(E)=(0011)1101
	CAME	AC,AC2		;C(AC) SHOULD=ORIG C(AC).
	ERR	RA,AC2
	CAME	AC2,(AC1)	;C(E) SHOULD=ORIG C(AC)
	ERRM	RA,AC2
	TLO	AC,400000	;SET BIT 0 IN AC.
	MOVE	AC2,AC		;SAVE FOR FUTURE COMPARE
				;IF C(AC)+C(E)=(1010)1101
	HLREM	AC,(AC1)	;C(AC)=(1011)1101, C(E)=(1111)1011
	HRLES	0,(AC1)		;C(AC)=(1011)1101, C(E)=(1011)1111
	HRRM	AC,(AC1)	;C(AC)=(1011)1101, C(E)=(1011)1101
	CAME	AC,AC2		;C(AC) SHOULD=ORIG C(AC).
	ERR	RA,AC2
	CAME	AC2,(AC1)	;C(E) SHOULD = ORIG C(AC).
	ERRM	RA,AC2
	JUMPL	AC-1,TST17B-4	;LOOP ON ERROR SWITCH.
	AOBJN	AC1,.+1
	TLNE	AC1,770000
	JRST	TST17A		;INC TO TEST NEXT LOC.
;*TST20
;*TEST HLLOM, HLLZS, HRROM, HRRZS.  CHECK FOR
;*CORRECT DATA IN AC AND C(E).
;*C(AC)+C(E)=RAN. NUM.

	AC=1
TST20:	SETUP
	MOVEM	RA,RASV20#
	MOVEM	AC,ACSV20#
TST20A:	RANDOM
TST20B:	MOVE	AC2,AC		;SIMULATE A
	TRO	AC2,-1		;HLLOM INST
	HLLOM	AC,(AC1)	;DO HLLOM.
	CAME	AC2,(AC1)	;C(E) SHOULD=SIM. ANS.
	ERRM	RA,RA
	TRZ	AC2,-1		;SIMULATE A HLLSZ INST.
	HLLZS	AC,(AC1)	;DO A HLLZS.
	CAME	AC,AC2		;C(AC) SHOULD=SIM ANS.
	ERR	RA,RA
	CAME	AC2,(AC1)	;C(E) SHOULD=SIM. ANS.
	ERRM	RA,RA
	MOVE	AC,RA		;RESTORE C(AC)
	MOVE	AC2,RA		;SIMULATE A
	TLO	AC2,-1		;HRROM INST.
	HRROM	AC,(AC1)	;DO A HRROM.
	CAME	AC2,(AC1)	;C(E) SHOULD=SIM. ANS.
	ERR	RA,RA
	TLZ	AC2,-1		;SIMULATE A HRRZS INST.
	HRRZS	AC,(AC1)	;DO A HRRZS INST.
	CAME	AC,AC2		;C(AC) SHOULD=SIM. ANS.
	ERR	RA,RA
	CAME	AC2,(AC1)	;C(E) SHOULD=SIM. ANS.
	ERRM	RA,RA
	JUMPL	AC-1,TST20B-4	;LOOP ON ERROR SWITCH.
	AOBJN	AC1,.+1
	TLNE	AC1,770000
	JRST	TST20A		;INC TO TEST NEXT LOC.
;*TST21
;*TEST HLLOS, HLLZM, HRROS, HRRZM.  CHECK FOR
;*CORRECT DATA IN AC AND C(E).
;*C(AC)+C(E)=RAN. NUM.
	AC=2
TST21:	SETUP
	MOVEM	RA,RASV21#
	MOVEM	AC,ACSV21#
TST21A:	RANDOM
TST21B:	MOVE	AC2,AC		;SIMULATE A
	TRO	AC2,-1		;HLLOS INST.
	HLLOS	AC,(AC1)	;DO A HLLOS.
	CAME	AC,AC2		;C(AC) SHOULD=SIM. ANS.
	ERR	RA,RA
	CAME	AC2,(AC1)	;C(E) SHOULD=SIM. ANS.
	ERRM	RA,RA
	MOVE	AC3,AC		;SAVE C(AC) IN CASE OF ERR.
	TRZ	AC2,-1		;SIMULATE A HLLZM INST.
	HLLZM	AC,(AC1)	;DO A HLLZM
	CAME	AC2,(AC1)	;C(E) SHOULD=SIM. ANS.
	ERRM	AC3,AC3
	MOVE	AC,RA		;RESTORE C(AC).
	MOVEM	AC,(AC1)	;RESTORE C(E).
	MOVE	AC2,RA		;SIMULATE A
	TLO	AC2,-1		;HRROS INST.
	HRROS	AC,(AC1)	;DO A HRROS
	CAME	AC,AC2		;C(AC) SHOULD=SIM. ANS.
	ERR	RA,RA
	CAME	AC2,(AC1)	;C(E) SHOULD=SIM. ANS.
	ERRM	RA,RA
	MOVE	AC3,AC		;SAVE C(AC) IN CASE OF ERROR.
	TLZ	AC2,-1		;SIMULATE A HRRZM INST.
	HRRZM	AC,(AC1)	;DO A HRRZM.
	CAME	AC2,(AC1)	;C(E) SHOULD=SIM. ANS.
	ERRM	AC3,AC3
	JUMPL	AC-1,TST21B-4	;LOOP ON ERROR SWITCH
	AOBJN	AC1,.+1
	TLNE	AC1,770000
	JRST	TST21A		;INC TO TEST NEXT LOC.
;*TST22
;*TEST HLLEM, HRRES.  CHECK C(AC)+C(E)
;*FOR CORRECT DATA.
;*C(AC) HAS SIGN BIT SET.

	AC=3
TST22:	SETUP
TST22A:	RANDOM
TST22B:	TLO	AC,400000	;SET SIGN BIT IN AC.
	MOVE	AC3,AC		;SAVE FOR FUTURE COMPARE.
	MOVE	AC2,AC		;SIMULATE A HLLEM
	TRO	AC2,-1		;WITH SIGN BIT SET.
	HLLEM	AC,(AC1)	;DO A HLLEM.
	CAME	AC,AC3		;C(AC) SHOULD=ORIG. C(AC).
	ERR	RA,AC3		;C(AC) GOT MODIFIED.
	CAME	AC2,(AC1)	;C(E) SHOULD=SIM. ANS.
	ERRM	RA,AC3
	SETO	AC4,		;SIMULATE HRRES WITH BIT 18 A ONE.
	HRRES	AC,(AC1)	;DO A HRRES.
	CAME	AC4,(AC1)	;C(E) SHOULD=-1.
	ERRM	AC2,AC3
	CAME	AC,(AC1)	;C(AC) SHOULD=C(E).
	ERR	AC2,AC3
	JUMPL	AC-1,TST22B-4	;LOOP ON ERROR SWITCH.
	AOBJN	AC1,.+1
	TLNE	AC1,770000
	JRST	TST22A		;INC TO TEST NEXT LOC.
;*TST23
;*TEST HLLEM, HRRES.  CHECK C(AC)+C(E)
;*FOR CORRECT DATA
;*C(AC) HAS SIGN BIT CLEAR.

	AC=12
TST23:	SETUP
TST23A:	RANDOM
TST23B:	TLZ	AC,400000	;CLEAR SIGN BIT IN AC
	MOVE	AC3,AC		;SAVE FOR FUTURE COMPARE
	MOVE	AC2,AC		;SIMULATE A HLLEM
	TRZ	AC2,-1		;WITH SIGN BIT CLEAR.
	HLLEM	AC,(AC1)	;DO A HLLEM.
	CAME	AC,AC3		;C(AC) SHOULD=ORIG. C(AC)
	ERR	RA,AC3
	CAME	AC2,(AC1)	;C(E) SHOULD=SIM. ANS.
	ERRM	RA,AC3
	SETZ	AC4,		;SIMULATE HRRES WITH BIT 18 CLEAR.
	HRRES	AC,(AC1)	;DO A HRRES INST.
	CAME	AC4,(AC1)	;C(E) SHOULD=SIM. ANS.
	ERRM	AC2,AC3
	CAME	AC,(AC1)	;C(AC) SHOULD=C(E).
	ERR	AC2,AC3
	JUMPL	AC-1,TST23B-4	;LOOP ON ERROR SWITCH
	AOBJN	AC1,.+1
	TLNE	AC1,770000
	JRST	TST23A		;INC TO TEST NEXT LOC.
;*TST24
;*TEST HRREM, HLLES.  CHECK C(AC)+C(E)
;*FOR CORRECT DATA.
;*C(AC) HAS BIT 18 SET.

	AC=12
TST24:	SETUP
TST24A:	RANDOM
TST24B:	TRO	AC,400000	;SET BIT 18 IN AC.
	MOVE	AC3,AC		;SAVE C(AC) FOR FUTURE COMPARE
	MOVE	AC2,AC		;SIMULATE A HRREM
	TLO	AC2,-1		;WITH BIT 18 SET.
	HRREM	AC,(AC1)	;DO A HRREM
	CAME	AC,AC3		;C(AC) SHOULD=ORIG. C(AC)
	ERR	RA,AC3
	CAME	AC2,(AC1)	;C(E) SHOULD=SIM. ANS.
	ERRM	RA,AC3
	SETO	AC4,		;SIMULATE A HLLES WITH SIGN BIT SET.
	HLLES	AC,(AC1)	;DO A HLLES
	CAME	AC4,(AC1)	;C(E) SHOULD=-1.
	ERRM	AC2,AC3
	CAME	AC,(AC1)	;C(AC) SHOULD=C(E).
	ERR	AC2,AC3
	JUMPL	AC-1,TST24B-4	;LOOP ON ERROR SWITCH
	AOBJN	AC1,.+1
	TLNE	AC1,770000
	JRST	TST24A		;INC TO TEST NEXT LOC.
;*TST25
;*TEST HRREM, HLLES.  CHECK C(AC)+C(E)
;*FOR CORRECT DATA.
;*C(AC) HAS BIT 18 CLEAR.

	AC=3
TST25:	SETUP
TST25A:	RANDOM
TST25B:	TRZ	AC,400000	;CLEAR BIT 18 ON AC.
	MOVE	AC3,AC		;SAVE C(AC) FOR FUTURE COMPARE.
	MOVE	AC2,AC		;SIMULATE A HRREM
	TLZ	AC2,-1		;WITH BIT 18 CLEAR.
	HRREM	AC,(AC1)	;DO A HRREM
	CAME	AC,AC3		;C(AC) SHOULD=ORIG C(AC)
	ERR	RA,AC3
	CAME	AC2,(AC1)	;C(E) SHOULD=SIM. ANS.
	ERRM	RA,AC3
	SETZ	AC4,		;SIMULATE A HLLES WITH SIGN BIT CLEAR.
	HLLES	AC,(AC1)	;DO A HLLES
	CAME	AC4,(AC1)	;C(E) SHOULD=0
	ERRM	AC2,AC3
	CAME	AC,(AC1)	;C(AC) SHOULD=C(E).
	ERR	AC2,AC3
	JUMPL	AC-1,TST25B-4	;LOOP ON ERROR SWITCH
	AOBJN	AC1,.+1
	TLNE	AC1,770000
	JRST	TST25A		;INC TO TEST NEXT LOC.
;*TST26
;*TEST ORCBB, ANDCMB, SETOM, SETZB, SETOB.  CHECK
;*FOR CORRECT DATA IN AC AND C(E).
	AC=4
TST26:	SETUP
TST26A:	RANDOM
TST26B:	SETCM	AC2,AC		;SIMULATE A ORCBB...1'S COMP.
	ORCBB	AC,(AC1)	;DO ORCBB
	CAME	AC,AC2		;C(AC) SHOULD=SIM. ANS.
	ERR	RA,RA
	CAME	AC2,(AC1)	;C(E) SHOULD=SIM. ANS.
	ERRM	RA,RA
	MOVEI	AC3,0		;SIMULATE ANDCMB...AND 1'S COMP
	ANDCMB	AC,(AC1)	;OF A NUMBER WITH THAT NUMBER
	CAME	AC,AC3		;SHOULD=0
	ERR	AC2,AC2
	CAME	AC3,(AC1)	;C(E) SHOULD=0
	ERRM	AC2,AC2
	MOVE	AC2,[-1]	;SIMULATE SETOM.
	SETOM	AC,(AC1)	;DO SETOM.
	CAME	AC,AC3		;C(AC)SHOULD STILL=0.
	ERR	AC3,AC3
	CAME	AC2,(AC1)	;C(E) SHOULD=-1
	ERRM	AC3,AC3
	SETZB	AC,(AC1)	;DO SETZB
	CAME	AC,AC3		;C(AC) SHOULD=0
	ERR	AC2,AC3
	CAME	AC3,(AC1)	;C(E) SHOULD=0
	ERRM	AC2,AC3
	SETOB	AC,(AC1)	;DO A SETOB.
	CAME	AC,AC2		;C(AC) SHOULD=-1
	ERR	AC3,AC3
	CAME	AC2,(AC1)	;C(E) SHOULD=-1
	ERRM	AC3,AC3
	JUMPL	AC-1,TST26B-4	;LOOP ON ERROR SWITCH.
	AOBJN	AC1,.+1
	TLNE	AC1,770000
	JRST	TST26A		;INC TO TEST NEXT LOC.
;*TST27
;*TEST AOS, SOA, TDC, TDCA, TSC, TSCA.  CHECK
;*FOR CORRECT DATA IN AC AND C(E)
;*C(AC) AND C(E)=RAN. NUM.

	AC=5
TST27:	SETUP
TST27A:	RANDOM
TST27B:	AOS	AC,(AC1)	;ADD ONE TO AC+C(E) AND NO SKIP.
	SOSA	AC,(AC1)	;SUB ONE FROM AC+C(E) AND SKIP.
	ER	AC,[ASCII/AOS/]
	CAME	AC,(AC1)	;C(AC)SHOULD=C(E).
	ERR	RA,RA		;C(E) DID NOT GET STORED IN AC CORRECTLY
	CAME	AC,RA		;C(AC) SHOULD=ORIG. C(AC).
	ERR	RA,RA
	TDC	AC,(AC1)	;SHOULD NOT SKIP
	TDCA	AC,(AC1)	;SHOULD ALWAYS SKIP.
	ER	AC,[ASCII/TST/]
	CAME	AC,RA		;C(AC) SHOULD=ORIG C(AC).
	ERR	RA,RA
	TSC	AC,(AC1)	;SHOULD NOT SKIP.
	TSCA	AC,(AC1)	;SHOULD ALWAYS SKIP.
	ER	AC,[ASCII/TST/]
	CAME	AC,RA		;C(AC) SHOULD=ORIG C(AC).
	ERR	RA,RA
	JUMPL	AC-1,TST27B-4	;LOOP ON ERROR SWITCH.
	AOBJN	AC1,.+1
	TLNE	AC1,770000
	JRST	TST27A		;INC TO TEST NEXT LOC.
;*TST30
;*TEST MOVMM, MOVMS.  CHECK FOR
;*CORRECT DATA IN AC AND C(E).
;*C(AC)+C(E)=RAN. NUM.

	AC=3
TST30:	SETUP
	MOVEM	RA,RASV30#
	MOVEM	AC,ACSV30#
TST30A:	RANDOM
TST30B:	SETCM	AC2,AC		;SIMULATE A MOVM
	ADDI	AC2,1		;WITH SIGN BIT SET.
	TLNN	AC,400000	;SKIP IF SIGN BIT SET.
	MOVE	AC2,AC		;SIM. MOVM WITH SIGN BIT CLEAR.
	MOVMM	AC,(AC1)	;DO A MOVMM
	CAME	AC,RA		;C(AC) SHOULD=ORIG. C(AC)
	ERR	RA,RA		;C(AC) GOT MODIFIED.
	CAME	AC2,(AC1)	;C(E) SHOULD=SIM. ANS.
	ERRM	RA,RA
	MOVEM	RA,(AC1)	;RESTORE C(E).
	MOVMS	AC,(AC1)	;DO A MOVMS
	CAME	AC,(AC1)	;C(AC) SHOULD=C(E).
	ERR	RA,RA
	CAME	AC2,(AC1)	;C(E) SHOULD=SIM. ANS.
	ERRM	RA,RA
	JUMPL	AC-1,TST30B-4	;LOOP ON ERROR SWITCH
	AOBJN	AC1,.+1
	TLNE	AC1,770000
	JRST	TST30A		;INC TO TEST NEXT LOC.
;*TST31
;*TEST ADDM, SUBB, ADDB, SUBM. CHECK FOR
;*CORRECT DATA IN AC AND C(E)
;*C(AC) AND C(E)=RAN. NUM.

	AC=1
TST31:	SETUP
TST31A:	RANDOM
TST31B:	ADDM	AC,(AC1)	;DO AN ADDM.
	MOVE	AC2,(AC1)	;PUT ANS INTO AC2
	MOVEM	AC,(AC1)	;AND RESTORE C(E)
	SUBB	AC2,(AC1)	;DO A SUBB.
	CAME	AC2,RA		;C(AC2) SHOULD=ORIG C(AC).
	ERR	RA,RA
	CAME	RA,(AC1)	;C(E) SHOULD=ORIG. C(E)
	ERRM	RA,RA
	ADDB	AC,(AC1)	;DO AN ADDB.
	CAME	AC,(AC1)	;C(AC) SHOULD=C(E).
	ERR	RA,RA
	MOVEM	RA,(AC1)	;RESTORE C(E).
	SUBM	AC,(AC1)	;DO A SUBM.
	CAME	RA,(AC1)	;C(E) SHOULD=ORIG. C(E)
	ERRM	RA,RA
	JUMPL	AC-1,TST31B-4	;LOOP ON ERROR SWITCH
	AOBJN	AC1,.+1
	TLNE	AC1,770000
	JRST	TST31A		;INC TO TEST NEXT LOC.

	JRST	BEGEND