mats.s 726 Bytes
/************************************************************************
  This RSP program implements the Modified Algorithmic Test Sequence
  (MATS) memory test procedure for DMEM with wired-OR construction.
 ************************************************************************/

	.base 0x04001000

	nor	$31, $0,  $0

	ori	$30, $0,  1
	ori	$1,  $0,  0x0FFC
Step1:	sw	$0,  0 ($1)
	bgtz	$1,  Step1
	addi	$1,  $1,  0xFFFC

	ori	$30, $0,  2
	ori	$1,  $0,  0x0FFC
Step2:	lw	$2,  0 ($1)
	bne	$2,  $0,  Fail
	sw	$31, 0 ($1)
	bgtz	$1,  Step2
	addi	$1,  $1,  0xFFFC

	ori	$30, $0,  3
	ori	$1,  $0,  0x0FFC
Step3:	lw	$3,  0 ($1)
	bne	$3,  $31, Fail
	nop
	bgtz	$1,  Step3
	addi	$1,  $1,  0xFFFC

	ori	$1,  $0,  0xFEED
Fail:	break