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



/*		SUBB3 (subtract byte 3) test				*/
/*									*/
/*Test name = subb3							*/
/*Description =								*/
/*	This test checks 'subb3' 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	_subb3
_subb3:
	callf	$4,_setjmp	/* save context for error return */
	movab	_subb3,_stpc	/* starting address of subtest */
	movl	$1,_subtst	/* subtest number */
	movl	$2,_no_opr	/* number of operands in use */
	movl	$SB1,_opr	/* first operand in use */
	movl	$MB1,_opr + 4	/* second operand */
0:	bicpsw	$PSWMASK	/*PSW = 0				*/
	movl	$SB1,sub	/*first operand				*/
	movl	$MB1,min	/*second operand			*/
	movl	$INITB,dif	/*initialize destination		*/
	bicpsw	$PSWMASK	/*PSW = 0				*/
	bispsw	$(N|V|C)	/* these flags ON			*/
	subb3	sub+3,min+3,dif+3/* 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	$RB1,dif	/*dif = expected ?			*/
	jeql	sb2
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$1,_ercode	/* error code data miscompare */
	movl	dif,_actual	/* actual data */
	movl	$RB1,_expected /* expected data */
	jmp	*badrtn

sb2:
	bbs	$0,_force_lp,0b	/* if set loop on last subtest */
as2:	callf	$4,_setjmp	/* save context for error return */
	movab	as2,_stpc	/* starting address of subtest */
	movl	$2,_subtst	/* subtest number */
	movl	$2,_no_opr	/* number of operands in use */
	movl	$SB2,_opr	/* first operand in use */
	movl	$MB2,_opr + 4	/* second operand */
	movl	$SB2,r6		/*first operand				*/
	movl	$MB2,r7		/*second operand			*/
	movl	$0,r8		/*initialize destination		*/
0:	bicpsw	$PSWMASK	/*PSW = 0				*/
	bispsw	$(N|Z|V)	/* these flags ON			*/
	subb3	r6,r7,r8	/* try 'sub' instruction reg reg reg	*/
	jgeq	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	$0xffffff02,r8	/*r8= expected ?			*/
	jeql	sb3
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$1,_ercode	/* error code data miscompare */
	movl	r8,_actual	/* actual data */
	movl	$0xffffff02,_expected /* expected data */
	jmp	*badrtn



sb3:
	bbs	$0,_force_lp,0b	/* if set loop on last subtest */
as3:	callf	$4,_setjmp	/* save context for error return */
	movab	as3,_stpc	/* starting address of subtest */
	movl	$3,_subtst	/* subtest number */
	movl	$2,_no_opr	/* number of operands in use */
	movl	$SB3,_opr	/* first operand in use */
	movl	$MB3,_opr + 4	/* second operand */
0:	bicpsw	$PSWMASK	/*PSW = 0				*/
	movl	$SB3,r6		/*first operand				*/
	movl	$MB3,r7		/*second operand			*/
	movl	$0,dif		/*initialize destination		*/
	bicpsw	$PSWMASK	/*PSW = 0				*/
	bispsw	$(V|Z|C)	/* these flags ON			*/
	subb3	r6,r7,dif+3	/* try 'sub' instruction  reg reg mem	*/
	jlss	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	$RB3,dif	/*dif = expected ?			*/
	jeql	sb4
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$1,_ercode	/* error code data miscompare */
	movl	dif,_actual	/* actual data */
	movl	$RB3,_expected /* expected data */
	jmp	*badrtn
	

sb4:
	bbs	$0,_force_lp,0b	/* if set loop on last subtest */
as4:	callf	$4,_setjmp	/* save context for error return */
	movab	as4,_stpc	/* starting address of subtest */
	movl	$4,_subtst	/* subtest number */
	movl	$2,_no_opr	/* number of operands in use */
	movl	$SB4,_opr	/* first operand in use */
	movl	$MB4,_opr + 4	/* second operand */
0:	bicpsw	$PSWMASK	/*PSW = 0				*/
	movl	$SB4,r6		/*first operand				*/
	movl	$MB4,min	/*second operand			*/
	movl	$0,r8		/*initialize destination		*/
	bicpsw	$PSWMASK	/*PSW = 0				*/
	bispsw	$Z		/* these flags ON			*/
	subb3	r6,min+3,r8	/* try 'sub' instruction reg mem reg	*/
	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	$0xfffffffe,r8	/* r8 = expected ?			*/
	jeql	sb5
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$1,_ercode	/* error code data miscompare */
	movl	r8,_actual	/* actual data */
	movl	$0xfffffffe,_expected /* expected data */
	jmp	*badrtn



sb5:
	bbs	$0,_force_lp,0b	/* if set loop on last subtest */
as5:	callf	$4,_setjmp	/* save context for error return */
	movab	as5,_stpc	/* starting address of subtest */
	movl	$5,_subtst	/* subtest number */
	movl	$2,_no_opr	/* number of operands in use */
	movl	$SB5,_opr	/* first operand in use */
	movl	$MB5,_opr + 4	/* second operand */
0:	bicpsw	$PSWMASK	/*PSW = 0				*/
	movl	$SB5,r6		/*first operand				*/
	movl	$MB5,min	/*second operand			*/
	movl	$0,r8		/*initialize destination		*/
	bicpsw	$PSWMASK	/*PSW = 0				*/
	bispsw	$(V|Z)		/* these flags ON			*/
	subb3	r6,$MB5,r8	/* try 'sub' instruction reg data reg	*/
	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	$RL5,r8		/*r8= expected ?			*/
	jeql	sb6
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$1,_ercode	/* error code data miscompare */
	movl	r8,_actual	/* actual data */
	movl	$RL5,_expected /* expected data */
	jmp	*badrtn



sb6:
	bbs	$0,_force_lp,0b	/* if set loop on last subtest */
as6:	callf	$4,_setjmp	/* save context for error return */
	movab	as6,_stpc	/* starting address of subtest */
	movl	$6,_subtst	/* subtest number */
	movl	$2,_no_opr	/* number of operands in use */
	movl	$SB6,_opr	/* first operand in use */
	movl	$MB6,_opr + 4	/* second operand */
0:	bicpsw	$PSWMASK	/*PSW = 0				*/
	movl	$SB6,r6		/*first operand				*/
	movl	$MB6,min	/*second operand			*/
	movl	$0,dif		/*initialize destination		*/
	bicpsw	$PSWMASK	/*PSW = 0				*/
	bispsw	$(Z|C|N)	/* these flags ON			*/
	subb3	r6,min+3,dif+3	/* try 'sub' instruction reg mem mem	*/
	jgeq	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	$RB6,dif	/*dif = expected ?			*/
	jeql	sb7
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$1,_ercode	/* error code data miscompare */
	movl	dif,_actual	/* actual data */
	movl	$RB6,_expected /* expected data */
	jmp	*badrtn

sb7:
	bbs	$0,_force_lp,0b	/* if set loop on last subtest */
as7:	callf	$4,_setjmp	/* save context for error return */
	movab	as7,_stpc	/* starting address of subtest */
	movl	$7,_subtst	/* subtest number */
	movl	$2,_no_opr	/* number of operands in use */
	movl	$SB6,_opr	/* first operand in use */
	movl	$MB6,_opr + 4	/* second operand */
0:	bicpsw	$PSWMASK	/*PSW = 0				*/
	movl	$SB6,r6		/*first operand				*/
	movl	$0,dif		/*initialize destination		*/
	bicpsw	$PSWMASK	/*PSW = 0				*/
	bispsw	$(Z|C|N)	/* these flags ON			*/
	subb3	r6,$MB6,dif+3	/* try 'sub' instruction reg data mem	*/
	jlss	e7		/*error if N = 1			*/
	jeql	e7		/*error if Z = 1			*/
	jvc	e7		/*error if V = 0			*/
	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	$RB6,dif	/*dif = expected ?			*/
	jeql	sb8
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$1,_ercode	/* error code data miscompare */
	movl	dif,_actual	/* actual data */
	movl	$RB6,_expected /* expected data */
	jmp	*badrtn

sb8:
	bbs	$0,_force_lp,0b	/* if set loop on last subtest */
as8:	callf	$4,_setjmp	/* save context for error return */
	movab	as8,_stpc	/* starting address of subtest */
	movl	$8,_subtst	/* subtest number */
	movl	$2,_no_opr	/* number of operands in use */
	movl	$SB5,_opr	/* first operand in use */
	movl	$MB5,_opr + 4	/* second operand */
0:	bicpsw	$PSWMASK	/*PSW = 0				*/
	movl	$SB5,sub	/*first operand				*/
	movl	$MB5,r7		/*second operand			*/
	movl	$0,r8		/*initialize destination		*/
	bicpsw	$PSWMASK	/*PSW = 0				*/
	bispsw	$(V|Z)		/* these flags ON			*/
	subb3	sub+3,r7,r8	/* try 'sub' instruction mem reg reg	*/
	jlss	e8		/*error if N = 0			*/
	jeql	e8		/*error if Z = 1			*/
	jvs	e8		/*error if V = 1			*/
	jcs	e8		/*error if C = 1			*/
	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	$RB5,r8		/*r8= expected ?			*/
	jeql	sb9
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$1,_ercode	/* error code data miscompare */
	movl	r8,_actual	/* actual data */
	movl	$RB5,_expected /* expected data */
	jmp	*badrtn



sb9:
	bbs	$0,_force_lp,0b	/* if set loop on last subtest */
as9:	callf	$4,_setjmp	/* save context for error return */
	movab	as9,_stpc	/* starting address of subtest */
	movl	$9,_subtst	/* subtest number */
	movl	$2,_no_opr	/* number of operands in use */
	movl	$SB6,_opr	/* first operand in use */
	movl	$MB6,_opr + 4	/* second operand */
0:	bicpsw	$PSWMASK	/*PSW = 0				*/
	movl	$MB6,r7		/*second operand			*/
	movl	$0,r8		/*initialize destination		*/
	bicpsw	$PSWMASK	/*PSW = 0				*/
	bispsw	$(Z|C|N)	/* these flags ON			*/
	subb3	$SB6,r7,r8	/* try 'sub' instruction data reg reg	*/
	jlss	e9		/*error if N = 1			*/
	jeql	e9		/*error if Z = 1			*/
	jvc	e9		/*error if V = 0			*/
	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	$RB6,r8		/*dif = expected ?			*/
	jeql	sb10
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$1,_ercode	/* error code data miscompare */
	movl	r8,_actual	/* actual data */
	movl	$RB6,_expected /* expected data */
	jmp	*badrtn


sb10:
	bbs	$0,_force_lp,0b	/* if set loop on last subtest */
as10:	callf	$4,_setjmp	/* save context for error return */
	movab	as10,_stpc	/* starting address of subtest */
	movl	$0xa,_subtst	/* subtest number */
	movl	$2,_no_opr	/* number of operands in use */
	movl	$SB5,_opr	/* first operand in use */
	movl	$MB5,_opr + 4	/* second operand */
0:	bicpsw	$PSWMASK	/*PSW = 0				*/
	movl	$SB5,sub	/*first operand				*/
	movl	$MB5,r7		/*second operand			*/
	movl	$0, dif		/*initialize destination		*/
	bicpsw	$PSWMASK	/*PSW = 0				*/
	bispsw	$(V|Z)		/* these flags ON			*/
	subb3	sub+3,r7,dif+3	/* try 'sub' instruction mem reg mem	*/
	jlss	e10		/*error if N = 0			*/
	jeql	e10		/*error if Z = 1			*/
	jvs	e10		/*error if V = 1			*/
	jcs	e10		/*error if C = 1			*/
	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	$RB5,dif	/*dif = expected ?			*/
	jeql	sb11
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$1,_ercode	/* error code data miscompare */
	movl	dif,_actual	/* actual data */
	movl	$RB5,_expected /* expected data */
	jmp	*badrtn


sb11:
	bbs	$0,_force_lp,0b	/* if set loop on last subtest */
as11:	callf	$4,_setjmp	/* save context for error return */
	movab	as11,_stpc	/* starting address of subtest */
	movl	$0xb,_subtst	/* subtest number */
	movl	$2,_no_opr	/* number of operands in use */
	movl	$SB5,_opr	/* first operand in use */
	movl	$MB5,_opr + 4	/* second operand */
0:	bicpsw	$PSWMASK	/*PSW = 0				*/
	movl	$MB5,r7		/*second operand			*/
	movl	$0,dif		/*initialize destination		*/
	bicpsw	$PSWMASK	/*PSW = 0				*/
	bispsw	$(V|Z)		/* these flags ON			*/
	subb3	$SB5,r7,dif+3	/* try 'sub' instruction data reg mem	*/
	jgeq	e11		/*error if N = 0			*/
	jeql	e11		/*error if Z = 1			*/
	jvs	e11		/*error if V = 1			*/
	jcs	e11		/*error if C = 1			*/
	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	$RB5,dif	/* dif = expected ?			*/
	jeql	sb12
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$1,_ercode	/* error code data miscompare */
	movl	dif,_actual	/* actual data */
	movl	$RB5,_expected /* expected data */
	jmp	*badrtn


sb12:
	bbs	$0,_force_lp,0b	/* if set loop on last subtest */
as12:	callf	$4,_setjmp	/* save context for error return */
	movab	as12,_stpc	/* starting address of subtest */
	movl	$0xc,_subtst	/* subtest number */
	movl	$2,_no_opr	/* number of operands in use */
	movl	$SB5,_opr	/* first operand in use */
	movl	$MB5,_opr + 4	/* second operand */
0:	bicpsw	$PSWMASK	/*PSW = 0				*/
	movl	$0,r8		/*initialize destination		*/
	bicpsw	$PSWMASK	/*PSW = 0				*/
	bispsw	$(V|Z)		/* these flags ON			*/
	subb3	$SB5,$MB5,r8	/* try 'sub' instruction data data reg	*/
	jgeq	e12		/*error if N = 0			*/
	jeql	e12		/*error if Z = 1			*/
	jvs	e12		/*error if V = 1			*/
	jcs	e12		/*error if C = 1			*/
	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	$RL5,r8		/*r8= expected ?			*/
	jeql	aldn
	bbs	$0,_scoplp,0b	/* if set scope loop on error */
	movl	$1,_ercode	/* error code data miscompare */
	movl	r8,_actual	/* actual data */
	movl	$RB5,_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.