File:  [Power 6/32 Unix Tahoe 4.2BSD] / cci / d / entry / clr_b.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



/*		CLRB (clear byte) test					*/

/*Test name = Clrb							*/
/*Description =								*/
/*	This test checks "clrb" instruction to see that			*/
/*	(1)destination is cleared to zero				*/
/*	(2)Z flag is set to one						*/
/*	(3)N and V flags are set to zero				*/
/*	(4)C flag is set to one.					*/
/*	Register 0 (r1) & memory location tmloc(lebel) are used as	*/
/*	destination.							*/
/*									*/
/*	Constants definition						*/
/*									*/
	.set	IPL,8
	.set	HIGH,31
	.set	ZERO,0
	.set	ONES,0xffffffff
	.set	N,8
	.set	Z,4
	.set	V,2
	.set	C,1
	.set	EXPL,0
	.set	EXPW,0
	.set	EXPB,0
	.set	PSWMASK,0x003f
	.globl	_clr_b
_clr_b:
	callf	$4,_setjmp	/* save caontext for error return */
	movab	_clr_b,_stpc	/* save subtest address */
	movl	$1,_subtst	/* subtest number */
	movl	$1,_no_opr	/* number of operands in use */
	movl	$ONES,_opr	/* first operand */
0:	movl	$ONES,r3	/*set r3 to all bits ones		*/
	bicpsw	$PSWMASK	/*disable overflow & other enable bits  */
	bispsw	$(N|V)		/*turn negetive, overflow, &		*/
	clrb	r3		/*execute "clrb"			*/
	bneq	error1		/*error if Z = 0			*/
	blss	error1		/*error if N = 1			*/
	bvs	error1		/*error if V = 1			*/
	bcc	error1		/*error if C = 0			*/
	jmp	1f
error1:	movpsl	_actual		/* actual psl MAYBE it is incorrect */
	bbs	$0,_scoplp,0b	/* if set loop on error */
	movl	$2,_ercode	/* error code flag failure */
	jmp	*badrtn
1:	bicpsw	$Z		/*clear Z flag				*/
	cmpl	r3,$EXPB	/*check r3 = expected value		*/
	beql	clrbm		/*if no	error then continue */
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$1,_ercode	/* error code data miscompare */
	movl	r3,_actual	/* actual data */
	movl	$EXPB,_expected	/* expected data */
	jmp	*badrtn
/*									*/
/*	Now repeat the above test with a memory location (tmloc).	*/
/*									*/
	
clrbm:
	bbs	$0,_force_lp,0b	/* if set loop on last subtest */
c2:	callf	$4,_setjmp	/* save caontext for error return */
	movab	c2,_stpc	/* save subtest address */
	movl	$2,_subtst	/* subtest number */
0:	movl	$ONES,tmloc	/*set tmloc to all bits ones		*/
	bicpsw	$PSWMASK
	bispsw	$(N|V)		/*turn negetive, and overflow		*/
				/*ON in PSW				*/
	clrb	tmloc		/*execute "clrb"			*/
	bneq	error2		/*error if Z = 0			*/
	blss	error2		/*error if N = 1			*/
	bvs	error2		/*error if V = 1			*/
	bcc	error2		/*error if C = 0			*/
	jmp	1f
error2:	movpsl	_actual		/* actual psl MAYBE it is incorrect */
	bbs	$0,_scoplp,0b	/* if set loop on error */
	movl	$2,_ercode	/* error code flag failure */
	jmp	*badrtn
1:	bicpsw	$Z		/*clear Z flag				*/
	movl	$0x00ffffff,r4
	cmpl	tmloc,$0x00ffffff/*check tmloc = expected value		*/
	beql	1f		/*if not, error	*/
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$1,_ercode	/* error code data miscompare */
	movl	tmloc,_actual	/* actual data */
	movl	$0x00ffffff,_expected	/* expected data */
	jmp	*badrtn
1:	bbs	$0,_force_lp,0b	/* if set loop on last subtest */
	jmp	*return		/* good, return to monitor */


/*									*/
/*	Variables definition						*/
/*									*/
	.align	2
tmloc:	.long	0xffffffff	
/*	End of file					*/


unix.superglobalmegacorp.com

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