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



/*		CLRL (clear long) test					*/

/*Test name = Clrl							*/
/*Description =								*/
/*	This test checks "clrl" 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 one.						*/
/*	Register 1 (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,0X00000000
	.set	EXPW,0xffff0000
	.set	EXPB,0xffffff00
	.set	PSWMASK,0x003f

	.globl	_clr_l
_clr_l:
	callf	$4,_setjmp	/* save context for error return */
	movab	_clr_l,_stpc	/* save context for error return */
	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		*/
	clrl	r3		/*execute "clrl"			*/
	bneq	error1		/*error if Z = 0			*/
	blss	error1		/*error if N = 1			*/
	bvs	error1		/*error if V = 1			*/
	bcc	error1		/*error if C did not remain 1		*/
	jmp	1f
error1:	movpsl	_actual		/* actual = psl MAYBE it is incorrect */
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$2,_ercode	/* error code flag miscompare */
	jmp	*badrtn
1:	bicpsw	$Z		/*clear Z flag				*/
	cmpl	r3,$EXPL	/*check r3 = expected value		*/
	beql	clrlm		/*if not, error		*/
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$1,_ercode	/* error code data miscompare */
	movl	r3,_actual	/* actual data */
	movl	$EXPL,_expected	/* expected data */
	jmp	*badrtn
/*									*/
/*	Now repeat the above test with a memory location (tmloc).	*/
/*									*/
	
clrlm:
	bbs	$0,_force_lp,0b	/* if set loop on last subtest */
c2:	callf	$4,_setjmp	/* save context for error return */
	movab	c2,_stpc	/* save context for error return */
	movl	$2,_subtst	/* subtest number */
0:	movl	$ONES,tmloc	/*set tmloc to all bits ones		*/
	bicpsw	$PSWMASK
	bispsw	$(N|V)		/*turn negetive, &  overflow		 */
	clrl	tmloc		/*execute "clrl"			*/
	bneq	error2		/*error if Z = 0			*/
	blss	error2		/*error if N = 1			*/
	bvs	error2		/*error if V = 1			*/
	bcc	error2		/*error if C did not remain 1		*/
	jmp	1f
error2:	movpsl	_actual		/* actual = psl MAYBE it is incorrect */
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$2,_ercode	/* error code flag miscompare */
	jmp	*badrtn
1:	bicpsw	$Z		/*clear Z flag				*/
	cmpl	tmloc,$EXPL	/*check tmloc = expected value		*/
	beql	aldn		/*if no error all done ! */
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$1,_ercode	/* error code data miscompare */
	movl	tmloc,_actual	/* actual data */
	movl	$EXPL,_expected	/* expected data */
	jmp	*badrtn
aldn:	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.