File:  [Power 6/32 Unix Tahoe 4.2BSD] / cci / d / entry / mon.s
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Sun Jul 28 12:24:19 2019 UTC (7 years ago) by root
Branches: bsd, MAIN
CVS tags: v12b, v121, HEAD
Power 6/32 Unix version 1.2b

	.globl	_monitor
#
#	For looping
#
	.globl _forever
	.globl	_force_lp
#
#	For messages
#
	.globl _display
	.globl _heading
	.globl _op_mode		/* 1 : Tahoe, 0 : CP */
#
#	Counters
#
	.globl _cycle
	.globl _prog_cnt
	.globl _test_cnt
	.globl	_test_no
#
#	Little monitor for instruction tests
#
	.text
_monitor:
	movl	r0,_test_no		/* Default to 0; runs all tests */
	movl	r2,_cycle
	clrl	_prog_cnt

	andl3	$1,r1,_op_mode		/* Who handle error messages */
	andl3	$2,r1,_forever		/* Loop forever once got an error */
	clrl	_force_lp		/* Before exit each subtest, if this */
	clrl	_scoplp

	andl3	$4,r1,_display
	andl3	$8,r1,_heading
	movl	$0x80000,sp		/* set stack */
	callf	$4,_lp_init		/* Init vars. for looping */
					/* clear run flags back to zero */
	clrl	r2		/* may have been set by previous runs */
2:	shal	$1,r2,r0
	movl	$0x00,_test_tbl[r0]	/* clear run flags  */
	aoblss	$notests,r2,2b

	movl	_test_no,r0
	bleq	1f			/* Invalid test no; runs all tests */
	cmpl	$notests,r0
	blss	1f

	decl	r0			/* subtract 1 from entered test no. */
	movl	r0,_test_no		/* save corected test number */
	shal	$1,r0,r0
	movl	$0x10000,_test_tbl[r0]	/* Set flag to run */
nolp:	brw	start
#
#	Runs all tests
#
1:
	clrl	r2	
2:	shal	$1,r2,r0
	movl	$0x10000,_test_tbl[r0]	/* Set run flag  */
	aoblss	$notests,r2,2b
	clrl	_test_no
#
#
#
	.globl	start
start:
	movl	_test_no,r0
loop:	movl	tst_tbl[r0],r1		/* get address of test routine */
	cmpl	r1,$0			/* No more ? */
	jeql	end
	movl	$0x80000,sp		# reset stack, in case changed by test
	movl	$0x80000,fp		# and frame

	shal	$1,_test_no,r0
	movl	_test_tbl[r0],r0	# Get test flags 
	andl3	$1,r0,r2		# Is loop flag set ? 
	bneq	j_tst
1:
	incl	_test_no

j_tst:
	andl3	$0x10000,r0,r2		# Is run flag set ? 
	bneq	1f
	jmp	start
1:
	movl	r1,soap
	callf	$4,_pr_hd
	movl	soap,r1
	jmp	(r1)			/* jump register deferred */
end:
	cmpl	$0xffffffff,_cycle	/* Loop forever if cycle = -1 */
	jeql	skp
	incl	_prog_cnt
	cmpl	_prog_cnt,_cycle
	bgeq	1f
skp:
	clrl	_test_no
	brw	start
1:
	movl	$0xcafebabe,r0		/* R0 == cafe babe ; end of test */
	halt
#
#
	.globl	tfail
tfail:	callf	$4,_M_error
	jmp	start
errhlt: halt
#
#
filler:
	.align	2
soap:	.long	0
	.globl	return
return:
	.long   start		/* return address if test passed */
	.globl	badrtn
badrtn:
	.long	tfail		/* return address if test failed */
#


unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.