mscan.s 596 Bytes
/************************************************************************
  This RSP program implements the Memory Scan (MSCAN) test procedure for
  DMEM.
 ************************************************************************/

	.base	0x04001000

	ori	$1,  $0,  0x0FFC
	nor	$31, $0,  $0

Start:	sw	$0,  0 ($1)		/* write each word zeros	*/
	lw	$2,  0 ($1)		/* read zeros back		*/
	sw	$31, 0 ($1)		/* write each word ones		*/
	lw	$3,  0 ($1)		/* read ones back		*/

	bne	$2,  $0,  Fail
	nop
	bne	$3,  $31, Fail
	nop
	bne	$1,  $0,  Start
	addi	$1,  $1,  0xFFFC

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