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

		


/*		SUBW3 (subtract word3) test				*/
/*									*/
/*Test name = subw3							*/
/*Description =								*/
/*	This test checks 'subw3' instruction as follows:		*/
/*sub		min		dif		N Z V C (flags)		*/
/*___		___		______		_______________		*/
/*0x7f		0x7f		0x00		0 1 0 1			*/
/*0xff		0x01		0x02		0 0 0 0			*/
/*0x01		0xff		0xfe		1 0 0 1			*/
/*0x81		0x7f		0xfe		1 0 1 0			*/
/*0x81		0x80		0xff		1 0 0 0			*/
/*0x7f		0x81		0x02		0 0 1 1			*/
/*									*/
/*									*/

/*									*/
/*									*/
/*	constants definition for 'subx' tests.				*/
/*									*/

	.set	SB1,0x11111f7f/*+127, highest +ve number, byte	*/
	.set	SW1,0x111f7fff
	.set	SL1,0x7fffffff
	.set	MB1,0x11111f7f/* +127 */
	.set	MW1,0x111f7fff
	.set	ML1,SL1
	.set	RB1,0x11111f00
	.set	RW1,0x111f0000
	.set	RL1,0x00000000
	.set	SB2,0xff	/* -1 */
	.set	SW2,0xffff
	.set	SL2,0xffffffff
	.set	MB2,0x01	/* +1 */
	.set	MW2,0x0001
	.set	ML2,0X00000001
	.set	RB2,0x00000002	/* +2 */
	.set	RW2,RB2
	.set	RL2,RB2
	.set	SB3,MB2		/* +1 */
	.set	SW3,MW2
	.set	SL3,ML2
	.set	MB3,0xff		/* -1 */
	.set	MW3,0xffff
	.set	ML3,0xffffffff
	.set	RB3,0x000000fe	/* -2 */
	.set	RW3,0x0000fffe
	.set	RL3,0Xfffffffe
	.set	SB4,0x81	/* -127 */
	.set	SW4,0x8001
	.set	SL4,0x80000001
	.set	MB4,0x7f	/* 127 */
	.set	MW4,0x7fff
	.set	ML4,0x7fffffff
	.set	RB4,0xfe		/* -2 */
	.set	RW4,0xfffe
	.set	RL4,0xfffffffe
	.set	SB5,SB4	/* -127 */
	.set	SW5,SW4
	.set	SL5,SL4
	.set	MB5,0x80	/* -128 */
	.set	MW5,0x8000
	.set	ML5,0x80000000
	.set	RB5,0xff		/* -1 */
	.set	RW5,0xffff
	.set	RL5,0xffffffff
	.set	SB6,0x7f/* +127 */
	.set	SW6,0x7fff
	.set	SL6,0x7fffffff
	.set	MB6,SB4		/* -127 */
	.set	MW6,SW4
	.set	ML6,SL4
	.set	RB6,0x02
	.set	RW6,0x02
	.set	RL6,0x02

	.set	INITB,0x11111f55/* initialization values for 3 operand */
	.set	INITW,0x111f5555
	.set	INITL,0X55555555
	
/*									*/
/*	Syst.s - Constants						*/
/*									*/
	.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	T,16
	.set	IV,32
	.set	FU,64
	.set	DV,128
	.set	PSWMASK,0x003f

	.globl	_subw3
_subw3:
	callf	$4,_setjmp	/* save context for return from error */
	movab	_subw3,_stpc	/* save subtest starting address */
	movl	$1,_subtst	/* subtest number */
	movl	$2,_no_opr	/* number of operands in use */
	movl	$SW1,_opr	/* first operand */
	movl	$MW1,_opr + 4	/* second operand */
0:	bicpsw	$PSWMASK	/*PSW = 0				*/
	movl	$SW1,sub	/*first operand				*/
	movl	$MW1,min	/*second operand			*/
	movl	$INITW,dif	/*initialize destination		*/
	bicpsw	$PSWMASK	/*PSW = 0				*/
	bispsw	$(N|V|C)	/* these flags ON			*/
	subw3	sub+2,min+2,dif+2/* try 'sub' instruction mem mem mem	*/
	jlss	e1		/*error if N = 1			*/
	jneq	e1		/*error if Z = 0			*/
	jvs	e1		/*error if V = 1			*/
	jcc	e1		/*error if C = 0			*/
	jmp	1f
e1:	movpsl	_actual		/* actual = psl maybe incorrect		*/
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$2,_ercode	/* error code flag failure */
	jmp	*badrtn
1:	bicpsw	$Z
	cmpl	$RW1,dif	/*dif = expected ?			*/
	jeql	sw2		/* if no error continue */
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$1,_ercode	/* error code data miscompare */
	movl	dif,_actual	/* actual data */
	movl	$RW1,_expected	/* expected data */
	jmp	*badrtn

sw2:
	bbs	$0,_force_lp,0b	/* if set loop on last subtest */
as2:	callf	$4,_setjmp	/* save context for return from error */
	movab	as2,_stpc	/* save subtest starting address */
	movl	$2,_subtst	/* subtest number */
	movl	$2,_no_opr	/* number of operands in use */
	movl	$SW2,_opr	/* first operand */
	movl	$MW2,_opr + 4	/* second operand */
0:	bicpsw	$PSWMASK	/*PSW = 0				*/
	movl	$SW2,sub	/*first operand				*/
	movl	$MW2,r7		/*second operand			*/
	movl	$0,dif		/*initialize destination		*/
	bicpsw	$PSWMASK	/*PSW = 0				*/
	bispsw	$(N|Z|V)	/* these flags ON			*/
	subw3	sub+2,r7,dif+2/* try 'sub' instruction mem reg mem	*/
	jlss	e2		/*error if N = 1			*/
	jeql	e2		/*error if Z = 1			*/
	jvs	e2		/*error if V = 1			*/
	jcs	e2		/*error if C = 1			*/
	jmp	1f
e2:	movpsl	_actual		/* actual = psl maybe incorrect		*/
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$2,_ercode	/* error code flag failure */
	jmp	*badrtn
1:	bicpsw	$Z
	cmpl	$RW2,dif	/*dif = expected ?			*/
	jeql	sw3		/* if no error continue */
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$1,_ercode	/* error code data miscompare */
	movl	dif,_actual	/* actual data */
	movl	$RW2,_expected	/* expected data */
	jmp	*badrtn

sw3:
	bbs	$0,_force_lp,0b	/* if set loop on last subtest */
as3:	callf	$4,_setjmp	/* save context for return from error */
	movab	as3,_stpc	/* save subtest starting address */
	movl	$3,_subtst	/* subtest number */
	movl	$2,_no_opr	/* number of operands in use */
	movl	$SW3,_opr	/* first operand */
	movl	$MW3,_opr + 4	/* second operand */
0:	bicpsw	$PSWMASK	/*PSW = 0				*/
	movl	$SW3,r6		/*first operand				*/
	movl	$MW3,min	/*second operand			*/
	movl	$0,dif		/*initialize destination		*/
	bicpsw	$PSWMASK	/*PSW = 0				*/
	bispsw	$(V|Z|C)	/* these flags ON			*/
	subw3	r6,min+2,dif+2	/* try 'sub' instruction reg mem mem	*/
	jgeq	e3		/*error if N = 0			*/
	jeql	e3		/*error if Z = 1			*/
	jvs	e3		/*error if V = 1			*/
	jcc	e3		/*error if C = 0			*/
	jmp	1f
e3:	movpsl	_actual		/* actual = psl maybe incorrect		*/
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$2,_ercode	/* error code flag failure */
	jmp	*badrtn
1:	bicpsw	$Z
	cmpl	$RW3,dif	/*dif = expected ?			*/
	jeql	sw4		/* if no error continue */
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$1,_ercode	/* error code data miscompare */
	movl	dif,_actual	/* actual data */
	movl	$RW3,_expected	/* expected data */
	jmp	*badrtn
	
sw4:
	bbs	$0,_force_lp,0b	/* if set loop on last subtest */
as4:	callf	$4,_setjmp	/* save context for return from error */
	movab	as4,_stpc	/* save subtest starting address */
	movl	$4,_subtst	/* subtest number */
	movl	$2,_no_opr	/* number of operands in use */
	movl	$SW4,_opr	/* first operand */
	movl	$MW4,_opr + 4	/* second operand */
0:	bicpsw	$PSWMASK	/*PSW = 0				*/
	movl	$SW4,r6		/*first operand				*/
	movl	$MW4,r7		/*second operand			*/
	movl	$0,dif		/*initialize destination		*/
	bicpsw	$PSWMASK	/*PSW = 0				*/
	bispsw	$Z		/* these flags ON			*/
	subw3	r6,r7,dif+2	/* try 'sub' instruction reg reg mem	*/
	jgeq	e4		/*error if N = 0			*/
	jeql	e4		/*error if Z = 1			*/
	jvc	e4		/*error if V = 0			*/
	jcs	e4		/*error if C = 1			*/
	jmp	1f
e4:	movpsl	_actual		/* actual = psl maybe incorrect		*/
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$2,_ercode	/* error code flag failure */
	jmp	*badrtn
1:	bicpsw	$Z
	cmpl	$RW4,dif	/*dif = expected ?			*/
	jeql	sw5		/* if no error continue */
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$1,_ercode	/* error code data miscompare */
	movl	dif,_actual	/* actual data */
	movl	$RW4,_expected	/* expected data */
	jmp	*badrtn

sw5:
	bbs	$0,_force_lp,0b	/* if set loop on last subtest */
as5:	callf	$4,_setjmp	/* save context for return from error */
	movab	as5,_stpc	/* save subtest starting address */
	movl	$5,_subtst	/* subtest number */
	movl	$2,_no_opr	/* number of operands in use */
	movl	$SW5,_opr	/* first operand */
	movl	$MW5,_opr + 4	/* second operand */
0:	bicpsw	$PSWMASK	/*PSW = 0				*/
	movl	$SW5,r6		/*first operand				*/
	movl	$0,dif		/*initialize destination		*/
	bicpsw	$PSWMASK	/*PSW = 0				*/
	bispsw	$(V|Z)		/* these flags ON			*/
	subw3	r6,$MW5,dif+2	/* try 'sub' instruction reg data mem	*/
	jgeq	e5		/*error if N = 0			*/
	jeql	e5		/*error if Z = 1			*/
	jvs	e5		/*error if V = 1			*/
	jcs	e5		/*error if C = 1			*/
	jmp	1f
e5:	movpsl	_actual		/* actual = psl maybe incorrect		*/
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$2,_ercode	/* error code flag failure */
	jmp	*badrtn
1:	bicpsw	$Z
	cmpl	$RW5,dif	/*dif = expected ?			*/
	jeql	sw6		/* if no error continue */
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$1,_ercode	/* error code data miscompare */
	movl	dif,_actual	/* actual data */
	movl	$RW5,_expected	/* expected data */
	jmp	*badrtn

sw6:
	bbs	$0,_force_lp,0b	/* if set loop on last subtest */
as6:	callf	$4,_setjmp	/* save context for return from error */
	movab	as6,_stpc	/* save subtest starting address */
	movl	$6,_subtst	/* subtest number */
	movl	$2,_no_opr	/* number of operands in use */
	movl	$SW6,_opr	/* first operand */
	movl	$MW6,_opr + 4	/* second operand */
0:	bicpsw	$PSWMASK	/*PSW = 0				*/
	movl	$SW6,sub	/*first operand				*/
	movl	$MW6,r7		/*second operand			*/
	movl	$0,dif		/*initialize destination		*/
	bicpsw	$PSWMASK	/*PSW = 0				*/
	bispsw	$(Z|C|N)	/* these flags ON			*/
	subw3	$SW6,r7,dif+2	/* try 'sub' instruction data reg mem	*/
	jlss	e6		/*error if N = 1			*/
	jeql	e6		/*error if Z = 1			*/
	jvc	e6		/*error if V = 0			*/
	jcc	e6		/*error if C = 0			*/
	jmp	1f
e6:	movpsl	_actual		/* actual = psl maybe incorrect		*/
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$2,_ercode	/* error code flag failure */
	jmp	*badrtn
1:	bicpsw	$Z
	cmpl	$RW6,dif	/*dif = expected ?			*/
	jeql	sw7		/* if no error continue */
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$1,_ercode	/* error code data miscompare */
	movl	dif,_actual	/* actual data */
	movl	$RW6,_expected	/* expected data */
	jmp	*badrtn

sw7:
	bbs	$0,_force_lp,0b	/* if set loop on last subtest */
as7:	callf	$4,_setjmp	/* save context for return from error */
	movab	as7,_stpc	/* save subtest starting address */
	movl	$7,_subtst	/* subtest number */
	movl	$2,_no_opr	/* number of operands in use */
	movl	$SW1,_opr	/* first operand */
	movl	$MW1,_opr + 4	/* second operand */
0:	bicpsw	$PSWMASK	/*PSW = 0				*/
	movl	$SW1,r6		/*first operand				*/
	movl	$MW1,r7		/*second operand			*/
	movl	$INITW,r8	/*initialize destination		*/
	bicpsw	$PSWMASK	/*PSW = 0				*/
	bispsw	$(N|V|C)	/* these flags ON			*/
	subw3	r6,r7,r8	/* try 'sub' instruction mem mem mem	*/
	jlss	e7		/*error if N = 1			*/
	jneq	e7		/*error if Z = 0			*/
	jvs	e7		/*error if V = 1			*/
	jcc	e7		/*error if C = 0			*/
	jmp	1f
e7:	movpsl	_actual		/* actual = psl maybe incorrect		*/
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$2,_ercode	/* error code flag failure */
	jmp	*badrtn
1:	bicpsw	$Z
	cmpl	$0x00,r8	/*r8 = expected ?			*/
	jeql	sw8		/* if no error continue */
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$1,_ercode	/* error code data miscompare */
	movl	r8,_actual	/* actual data */
	movl	$0,_expected	/* expected data */
	jmp	*badrtn

sw8:
	bbs	$0,_force_lp,0b	/* if set loop on last subtest */
as8:	callf	$4,_setjmp	/* save context for return from error */
	movab	as8,_stpc	/* save subtest starting address */
	movl	$8,_subtst	/* subtest number */
	movl	$2,_no_opr	/* number of operands in use */
	movl	$SW1,_opr	/* first operand */
	movl	$MW1,_opr + 4	/* second operand */
0:	bicpsw	$PSWMASK	/*PSW = 0				*/
	movl	$SW1,r6		/*first operand				*/
	movl	$MW1,min	/*second operand			*/
	movl	$INITW,r8	/*initialize destination		*/
	bicpsw	$PSWMASK	/*PSW = 0				*/
	bispsw	$(N|V|C)	/* these flags ON			*/
	subw3	r6,min+2,r8	/* try 'sub' instruction reg mem reg	*/
	jgeq	e8		/*error if N = 1			*/
	jeql	e8		/*error if Z = 0			*/
	jvs	e8		/*error if V = 1			*/
	jcs	e8		/*error if C = 0			*/
	jmp	1f
e8:	movpsl	_actual		/* actual = psl maybe incorrect		*/
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$2,_ercode	/* error code flag failure */
	jmp	*badrtn
1:	bicpsw	$Z
	cmpl	$0xeee10000,r8		/*r8 = expected ?		*/
	jeql	sw9		/* if no error continue */
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$1,_ercode	/* error code data miscompare */
	movl	r8,_actual	/* actual data */
	movl	$0xeee10000,_expected	/* expected data */
	jmp	*badrtn

sw9:
	bbs	$0,_force_lp,0b	/* if set loop on last subtest */
as9:	callf	$4,_setjmp	/* save context for return from error */
	movab	as9,_stpc	/* save subtest starting address */
	movl	$9,_subtst	/* subtest number */
	movl	$2,_no_opr	/* number of operands in use */
	movl	$SW1,_opr	/* first operand */
	movl	$MW1,_opr + 4	/* second operand */
0:	bicpsw	$PSWMASK	/*PSW = 0				*/
	movl	$SW1,r6		/*first operand				*/
	movl	$INITW,r8	/*initialize destination		*/
	bicpsw	$PSWMASK	/*PSW = 0				*/
	bispsw	$(N|V|C)	/* these flags ON			*/
	subw3	r6,$MW1,r8	/* try 'sub' instruction reg data reg	*/
	jlss	e9		/*error if N = 1			*/
	jneq	e9		/*error if Z = 0			*/
	jvs	e9		/*error if V = 1			*/
	jcc	e9		/*error if C = 0			*/
	jmp	1f
e9:	movpsl	_actual		/* actual = psl maybe incorrect		*/
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$2,_ercode	/* error code flag failure */
	jmp	*badrtn
1:	bicpsw	$Z
	cmpl	$0x00,r8	/*r8 = expected ?			*/
	jeql	sw10		/* if no error continue */
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$1,_ercode	/* error code data miscompare */
	movl	r8,_actual	/* actual data */
	movl	$0,_expected	/* expected data */
	jmp	*badrtn

sw10:
	bbs	$0,_force_lp,0b	/* if set loop on last subtest */
as10:	callf	$4,_setjmp	/* save context for return from error */
	movab	as10,_stpc	/* save subtest starting address */
	movl	$0xa,_subtst	/* subtest number */
	movl	$2,_no_opr	/* number of operands in use */
	movl	$SW1,_opr	/* first operand */
	movl	$MW1,_opr + 4	/* second operand */
0:	bicpsw	$PSWMASK	/*PSW = 0				*/
	movl	$SW1,sub	/*first operand				*/
	movl	$MW1,r7		/*second operand			*/
	movl	$INITW,r8	/*initialize destination		*/
	bicpsw	$PSWMASK	/*PSW = 0				*/
	bispsw	$(N|V|C)	/* these flags ON			*/
	subw3	sub+2,r7,r8	/* try 'sub' instruction mem reg reg	*/
	jlss	e10		/*error if N = 1			*/
	jeql	e10		/*error if Z = 0			*/
	jvs	e10		/*error if V = 1			*/
	jcc	e10		/*error if C = 0			*/
	jmp	1f
e10:	movpsl	_actual		/* actual = psl maybe incorrect		*/
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$2,_ercode	/* error code flag failure */
	jmp	*badrtn
1:	bicpsw	$Z
	cmpl	$RW1,r8		/*r8 = expected ?			*/
	jeql	sw11		/* if no error continue */
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$1,_ercode	/* error code data miscompare */
	movl	r8,_actual	/* actual data */
	movl	$RW1,_expected	/* expected data */
	jmp	*badrtn


sw11:
	bbs	$0,_force_lp,0b	/* if set loop on last subtest */
as11:	callf	$4,_setjmp	/* save context for return from error */
	movab	as11,_stpc	/* save subtest starting address */
	movl	$0xb,_subtst	/* subtest number */
	movl	$2,_no_opr	/* number of operands in use */
	movl	$SW1,_opr	/* first operand */
	movl	$MW1,_opr + 4	/* second operand */
0:	bicpsw	$PSWMASK	/*PSW = 0				*/
	movl	$SW1,r6		/*first operand				*/
	movl	$MW1,r7		/*second operand			*/
	movl	$INITW,r8	/*initialize destination		*/
	bicpsw	$PSWMASK	/*PSW = 0				*/
	bispsw	$(N|V|C)	/* these flags ON			*/
	subw3	$SW1,r7,r8	/* try 'sub' instruction data reg reg	*/
	jlss	e11		/*error if N = 1			*/
	jneq	e11		/*error if Z = 0			*/
	jvs	e11		/*error if V = 1			*/
	jcc	e11		/*error if C = 0			*/
	jmp	1f
e11:	movpsl	_actual		/* actual = psl maybe incorrect		*/
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$2,_ercode	/* error code flag failure */
	jmp	*badrtn
1:	bicpsw	$Z
	cmpl	$0x00,r8	/*r8 = expected ?			*/
	jeql	sw12		/* if no error continue */
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$1,_ercode	/* error code data miscompare */
	movl	r8,_actual	/* actual data */
	movl	$0,_expected	/* expected data */
	jmp	*badrtn


sw12:
	bbs	$0,_force_lp,0b	/* if set loop on last subtest */
as12:	callf	$4,_setjmp	/* save context for return from error */
	movab	as12,_stpc	/* save subtest starting address */
	movl	$0xc,_subtst	/* subtest number */
	movl	$2,_no_opr	/* number of operands in use */
	movl	$SW1,_opr	/* first operand */
	movl	$MW1,_opr + 4	/* second operand */
0:	bicpsw	$PSWMASK	/*PSW = 0				*/
	movl	$INITW,r8	/*initialize destination		*/
	bicpsw	$PSWMASK	/*PSW = 0				*/
	bispsw	$(N|V|C)	/* these flags ON			*/
	subw3	$SW1,$MW1,r8	/* try 'sub' instruction data data reg	*/
	jlss	e12		/*error if N = 1			*/
	jneq	e12		/*error if Z = 0			*/
	jvs	e12		/*error if V = 1			*/
	jcc	e12		/*error if C = 0			*/
	jmp	1f
e12:	movpsl	_actual		/* actual = psl maybe incorrect		*/
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$2,_ercode	/* error code flag failure */
	jmp	*badrtn
1:	bicpsw	$Z
	cmpl	$0x00,r8	/*r8 = expected ?			*/
	jeql	aldn		/* if no error continue */
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$1,_ercode	/* error code data miscompare */
	movl	r8,_actual	/* actual data */
	movl	$0,_expected	/* expected data */
	jmp	*badrtn

aldn:	bbs	$0,_force_lp,0b	/* if set loop on last subtest */
	jmp	*return


/*									*/
/*	Variables							*/
/*									*/
	.align	2
min:	.space	4
dif:	.space	4
sub:	.space	4

/*	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.