File:  [Power 6/32 Unix Tahoe 4.2BSD] / cci / d / entry / convert.c
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs
Sun Jul 28 12:30:48 2019 UTC (6 years, 11 months ago) by root
Branches: bsd, MAIN
CVS tags: v121, HEAD
Power 6/32 Unix version 1.21



/*		constants definition for convert instruction		*/
/*									*/
/*									*/
extern long scoplp;
extern long force_lp;

#define		CVTBW		0x99		/*opcodes		*/
#define		CVTBL		0x89
#define		CVTWB		0x33
#define		CVTWL		0x23
#define		CVTLB		0x6f
#define		CVTLW		0x7f
asm(".set PSWMASK,0xf");
#define		MAX_PATTERNS	4

#define		IDESTB1		0x1111007f	/*destination		*/
						/*initial values	*/
#define		IDESTB2		0x1111aa00	/*for bw,bl		*/
#define		IDESTB3		0x1111aaaa
#define		IDESTB4		0x1111ffff


#define		IDESTWL1	0x1111007f	/* wl			*/
#define		IDESTWL2	0x1111aa00
#define		IDESTWL3	0x1111aaaa
#define		IDESTWL4	0x11110000


#define		IDESTWB1	0x111180ff	/* wb			*/
#define		IDESTWB2	0x11110000
#define		IDESTWB3	0x11117f80
#define		IDESTWB4	0x11110080


#define		IDESTLW1	0xffff0000	/* lw			*/
#define		IDESTLW2	0x00008000
#define		IDESTLW3	0x8000ffff
#define		IDESTLW4	0x00007fff


#define		IDESTLB1	0xffffff00	/* lb			*/
#define		IDESTLB2	0x00000080
#define		IDESTLB3	0x800000ff
#define		IDESTLB4	0x0000007f


#define		SB1		0x11110080	/*source values		*/
#define		SB2		0x1111aa7f	/* bw, bl		*/
#define		SB3		0x1111aa00
#define		SB4		0x11110000

#define		SWL1		0x11118000	/* wl			*/
#define		SWL2		0x11117fff
#define		SWL3		0x11110000
#define		SWL4		0x11111111

#define		SWB1		0x11118000	/* wb			*/
#define		SWB2		0x111100ff
#define		SWB3		0x11117f7f
#define		SWB4		0x1111007f

#define		SLW1		0xffffffff	/*lw			*/
#define		SLW2		0x00007fff
#define		SLW3		0x80000000
#define		SLW4		0x00008000

#define		SLB1		0xffffffff	/* lb			*/
#define		SLB2		0x0000007f
#define		SLB3		0x80000000
#define		SLB4		0x00000080


#define		EXPBW1		0x1111ff80	/*expected destination	*/
#define		EXPBW2		0x1111007f	/* bw			*/
#define		EXPBW3		0x11110000
#define		EXPBW4		0x11110000

#define		EXPBL1		0xffffff80	/* bl			*/
#define		EXPBL2		0x0000007f
#define		EXPBL3		0x00000000
#define		EXPBL4		0x00000000

#define		EXPWL1		0xffff8000	/* wl			*/
#define		EXPWL2		0x00007fff
#define		EXPWL3		0
#define		EXPWL4		0x00001111

#define		EXPWB1		0x11118000	/* wb			*/
#define		EXPWB2		0x111100ff
#define		EXPWB3		0x11117f7f
#define		EXPWB4		0x1111007f


#define		FLG1		7		/*initial flags		*/
#define		FLG2		8		/* bw, bl, wl		*/
#define		FLG3		0
#define		FLG4		0

#define		FLGW1		9		/* wb			*/
#define		FLGW2		5
#define		FLGW3		15
#define		FLGW4		15

#define		FLGL1		7		/* lw, lb		*/
#define		FLGL2		15
#define		FLGL3		0
#define		FLGL4		0



#define		EFLG1		9		/*expected flags	*/
#define		EFLG2		1		/* bw, bl		*/
#define		EFLG3		5
#define		EFLG4		5

#define		EFLGWL1		9		/* wl			*/
#define		EFLGWL2		1
#define		EFLGWL3		5
#define		EFLGWL4		1

#define		EFLGWB1		11		/* wb			*/
#define		EFLGWB2		3
#define		EFLGWB3		3
#define		EFLGWB4		1

#define		EFLGL1		9		/* lw, lb		*/
#define		EFLGL2		1
#define		EFLGL3		11	
#define		EFLGL4		3



#define		ERROR1			1	  /*error definitions	*/
#define		ERROR2			2
#define		ERROR3			3
#define		ERROR4			4
#define		ERROR5			5
						  /*error messages	*/
#define		EM1	"destination not equal to expected \n"
#define		EM2	"source altered by the instruction \n"
#define		EM3	"flags not equal to expected \n"


/*		standard definition file				*/
/*		for 'C' diagnostic porgrams.				*/
/*									*/
/*									*/
#define		HIGH		31
#define		IPL		18
#define		PSWMASK		255
#define		T		16
#define		IV		32
#define		FU		64
#define		DV		128
#define		FLAGS		0x0000000f






/*	Global variables for convert test				*/
/*									*/
/*									*/

static short	index = 0;
static long	dest = 0;	/*destination location			*/
static long	source = 0;	/*source location			*/
static long	psw;		/*processor status word			*/
static long	error_count = 0;

				/*initial flag values			*/
static	long	flag_valueb[MAX_PATTERNS] = {FLG1,FLG2,FLG3,FLG4};
static	long	flag_valuewl[MAX_PATTERNS] = {FLG1,FLG2,FLG3,FLG4};
static	long	flag_valuewb[MAX_PATTERNS] = {FLGW1,FLGW2,FLGW3,FLGW4};
static	long	flag_valuel[MAX_PATTERNS] = {FLGL1,FLGL2,FLGL3,FLGL4};


				/*expected destination			*/
static	long	expbw[MAX_PATTERNS] = {EXPBW1,EXPBW2,EXPBW3,EXPBW4};
static	long	expbl[MAX_PATTERNS] =  {EXPBL1,EXPBL2,EXPBL3,EXPBL4};
static	long	expwl[MAX_PATTERNS] = {EXPWL1,EXPWL2,EXPWL3,EXPWL4};
static	long	expwb[MAX_PATTERNS] = {EXPWB1,EXPWB2,EXPWB3,EXPWB4};
static	long	explw[MAX_PATTERNS] = {SLW1,SLW2,SLW3,SLW4};
static	long	explb[MAX_PATTERNS] = {SLB1,SLB2,SLB3,SLB4};


				/*expected psw				*/
static long	exp_pswb[MAX_PATTERNS] = {EFLG1,EFLG2,EFLG3,EFLG4};
static long	exp_pswwl[MAX_PATTERNS] = {EFLGWL1,EFLGWL2,EFLGWL3,EFLGWL4};
static long	exp_pswwb[MAX_PATTERNS] = {EFLGWB1,EFLGWB2,EFLGWB3,EFLGWB4};
static long	exp_pswl[MAX_PATTERNS] = {EFLGL1,EFLGL2,EFLGL3,EFLGL4};

				
				/*source values				*/
static long	sourceb[MAX_PATTERNS] = {SB1,SB2,SB3,SB4};
static long	sourcewl[MAX_PATTERNS] = {SWL1,SWL2,SWL3,SWL4};
static long	sourcewb[MAX_PATTERNS] = {SWB1,SWB2,SWB3,SWB4};
static long	sourcelw[MAX_PATTERNS] = {SLW1,SLW2,SLW3,SLW4};
static long	sourcelb[MAX_PATTERNS] = {SLB1,SLB2,SLB3,SLB4};


				/*initial destination values		*/
static	long	destb[MAX_PATTERNS] = {IDESTB1,IDESTB2,IDESTB3,IDESTB4};
static	long	destwl[MAX_PATTERNS] = {IDESTWL1,IDESTWL2,IDESTWL3,IDESTWL4};
static	long	destwb[MAX_PATTERNS] = {IDESTWB1,IDESTWB2,IDESTWB3,IDESTWB4};
static	long	destlw[MAX_PATTERNS] = {IDESTLW1,IDESTLW2,IDESTLW3,IDESTLW4};
static	long	destlb[MAX_PATTERNS] = {IDESTLB1,IDESTLB2,IDESTLB3,IDESTLB4};

static char *tst_name;
convert()
{
	asm("movl	$2,_no_opr");
	tst_name = " ** CVTLB ** \n";
	cvtlb();
	tst_name = " ** CVTLW ** \n";
	cvtlw();
	tst_name = " ** CVTBL ** \n";
	cvtbl();
	tst_name = " ** CVTWL ** \n";
	cvtwl();		/* convert word to long */
	tst_name = " ** CVTWB ** \n";
	cvtwb();		/* convert word to byte */
	tst_name = " ** CVTBW ** \n";
	cvtbw();		/* convert byte to word */
	asm("jmp *return");
}

static long *p_destwb;
static long *p_destb;
static long *p_destlb;
static long *p_destlw;
static long *p_destwl;
static long *p_exp_pswb;
static long *p_exp_pswl;
static long *p_exp_pswwb;
static long *p_exp_pswwl;
static long *p_expbl;
static long *p_expbw;
static long *p_explb;
static long *p_explw;
static long *p_expwb;
static long *p_expwl;
static long *p_sourceb;
static long *p_sourcelb;
static long *p_sourcelw;
static long *p_sourcewb;
static long *p_sourcewl;

static init_ptr()
{
p_destwb = destwb;
p_destb = destb;
p_destlb = destlb;
p_destlw = destlw;
p_destwl = destwl;
p_exp_pswb = exp_pswb;
p_exp_pswl = exp_pswl;
p_exp_pswwb = exp_pswwb;
p_exp_pswwl = exp_pswwl;
p_expbl = expbl;
p_expbw = expbw;
p_explb = explb;
p_explw = explw;
p_expwb = expwb;
p_expwl = expwl;
p_sourceb = sourceb;
p_sourcelb = sourcelb;
p_sourcelw = sourcelw;
p_sourcewb = sourcewb;
p_sourcewl = sourcewl;
}

static bump_ptr()
{
p_destwb++;
p_destb++;
p_destlb++;
p_destlw++;
p_destwl++;
p_exp_pswb++;
p_exp_pswl++;
p_exp_pswwb++;
p_exp_pswwl++;
p_expbl++;
p_expbw++;
p_explb++;
p_explw++;
p_expwb++;
p_expwl++;
p_sourceb++;
p_sourcelb++;
p_sourcelw++;
p_sourcewb++;
p_sourcewl++;
}

static cvtwb()			/* convert word to byte test */
{
   asm("bicpsw	$PSWMASK");		/*psw = 0*/
      for (init_ptr(), index = 0; index < MAX_PATTERNS; bump_ptr(), index++)
	  {
           t_cvtwb ();
      	   t_cvtwb1();		/*one more test where			*/
				/* dest address = source address	*/
          }
}	


static t_cvtwb()		/*single test called by main test*/
{
	for ( ; ; )
	  { 
	   setjmp();
	   asm("c1:	movab	c1,_stpc");
	   asm("movl	$1,_subtst");
	   dest = *p_destwb;	/*initialize dest.,source & psw	*/
	   source = *p_sourcewb;
	   asm("movw _index,r10");
	   asm("bicpsw	$PSWMASK");
	   asm("bispsw	_flag_valuewb[r10]");
				/*execute cvt instruction		*/
	   asm("cvtwb	_source+2,_dest+3"); /* memory to memory */
	   asm("movpsl	_psw");	/*save psw				*/
	   psw &= FLAGS;	/*mask out all bits except flag bits	*/
	   if (dest != *p_expwb)
		{
		asm("movl	$1,_ercode");
		if (scoplp) longjmp();
	        error(dest,*p_expwb,source,*p_destwb,*p_expwb,dest); 
		}
	   if (source != *p_sourcewb)
		{
		asm("movl	$3,_ercode");
		if (scoplp) longjmp();
	        error(source,*p_sourcewb,source,*p_destwb); 
		}
	   if (psw != *p_exp_pswwb)
		{
		asm("movl	$2,_ercode");
		if (scoplp) longjmp();
	        error(psw,*p_exp_pswwb,source,dest); 
		}
		if (force_lp) longjmp();
    	   else
		return(0);	/*no error exit*/ 
          }	
}


/*single test 1 called by main test*/
/*source location = destination location*/
static	t_cvtwb1()
{

	for ( ; ; )
	  { 
           			/*initialize  source, & psw	*/
	   setjmp();
	   asm("c2:	movab	c2,_stpc");
	   asm("movl	$2,_subtst");
	   source = *p_sourcewb;
	   asm("movw 	_index,r10");
	   asm("movw	_source+2,r5"); /* load first operand register */
	   asm("movl	_source,r6"); /* load first operand register */
	   asm("bicpsw	$PSWMASK");
	   asm("bispsw	_flag_valuel[r10]");
				/*execute cvt instruction		*/
	   asm("cvtwb	r5,r6"); /* register to register */
	   asm("movpsl	_psw");	/*save psw				*/
	   psw &= FLAGS;	/*mask out all bits except flag bits	*/
	   source = *p_expwb;
	   if (source != *p_expwb)
		{
		asm("movl	$1,_ercode");
		if (scoplp) longjmp();
	     	error(source,*p_expwb,*p_sourcewb,*p_sourcewb); 
		}
	   if (psw != *p_exp_pswwb)
		{
		asm("movl	$1,_ercode");
		if (scoplp) longjmp();
	  	error(psw,*p_exp_pswwb,*p_sourcewb,*p_sourcewb); 
		}
		if (force_lp) longjmp();
    	   else
		return(0);	/*no error exit*/ 
          }
}



static cvtwl()			/* convert word to long test */
{
   asm("bicpsw	$PSWMASK");		/*psw = 0*/
      for (init_ptr(), index = 0; index < MAX_PATTERNS; bump_ptr(), index++)
	  {
           t_cvtwl ();
      	   t_cvtwl1();		/*one more test where			*/
				/* dest address = source address	*/
          }
}

static t_cvtwl()		/*single test called by main test*/
{
	for ( ; ; )
	  { 
	   setjmp();
	   asm("c3:	movab	c3,_stpc");
	   asm("movl	$3,_subtst");
	   dest = *p_destwl;	/*initialize dest., source, & psw */
	   source = *p_sourcewl;
	   asm("movw _index,r10");
	   asm("bicpsw	$PSWMASK");
	   asm("bispsw	_flag_valueb[r10]");
				/*execute cvt instruction		*/
	   asm("cvtwl	_source+2,_dest"); /* memory to memory */
	   asm("movpsl	_psw");	/*save psw				*/
	   psw &= FLAGS;	/*mask out all bits except flag bits	*/
	   if (dest != *p_expwl)
		{
		asm("movl	$1,_ercode");
		if (scoplp) longjmp();
	        error(dest,*p_destwl,source,*p_destwl); 
		}
	   if (source != *p_sourcewl)
		{
		asm("movl	$3,_ercode");
		if (scoplp) longjmp();
	        error(source,*p_sourcewl,source,*p_destwl); 
		}
	   if (psw != *p_exp_pswwl)
		{
		asm("movl	$2,_ercode");
		if (scoplp) longjmp();
	        error(psw,*p_exp_pswwl,source,*p_destwl); 
		}
		if (force_lp) longjmp();
    	   else
		return(0);	/*no error exit*/ 
          }	
}



/*single test 1 called by main test*/
/* register to register operation */
static	t_cvtwl1()
{

	for ( ; ; )
	  { 
           			/*initialize  source, & psw	*/
	   setjmp();
	   asm("c4:	movab	c4,_stpc");
	   asm("movl	$4,_subtst");
	   source = *p_sourcewl;
	   asm("movw 	_index,r10");
	   asm("movw	_source+2,r5"); /* load first operand register */
	   asm("movl	_source,r6"); /* load second operand register */
	   asm("bicpsw	$PSWMASK");
	   asm("bispsw	_flag_valueb[r10]");
				/*execute cvt instruction		*/
	   asm("cvtwl	r5,r6"); /* register to register operation */
	   asm("movpsl	_psw");	/*save psw				*/
	   psw &= FLAGS;	/*mask out all bits except flag bits	*/
	   asm("movl	r6,_source"); /* reload source location */
	   if (source != *p_expwl)
		{
		asm("movl	$1,_ercode");
		if (scoplp) longjmp();
	     	error(source,*p_sourcewl,*p_sourcewl,*p_sourcewl); 
		}
	   if (psw != *p_exp_pswwl)
		{
		asm("movl	$2,_ercode");
		if (scoplp) longjmp();
	     	error(psw,*p_exp_pswwl,*p_sourcewl,*p_sourcewl); 
		}
		if (force_lp) longjmp();
    	   else
		return(0);	/*no error exit*/ 
          }	/*end of for loop*/
}	/*end of test*/



static cvtbw()	/* convert byte to long test */

{
   asm("bicpsw	$PSWMASK");		/*psw = 0*/
      for (init_ptr(), index = 0; index < MAX_PATTERNS; bump_ptr(), index++)
	  {
           t_cvtbw ();
      	   t_cvtbw1();		/*one more test where			*/
				/* dest address = source address	*/
          }
}

static t_cvtbw()		/*single test called by main test*/
{
	for ( ; ; )
	  { 
	   setjmp();
	   asm("c5:	movab	c5,_stpc");
	   asm("movl	$5,_subtst");
	   dest = *p_destb;	/*initialize destination, source, & psw	*/
	   source = *p_sourceb;
	   asm("movw _index,r10");
	   asm("bicpsw	$PSWMASK");
	   asm("bispsw	_flag_valueb[r10]");
				/*execute cvt instruction		*/
	   asm("cvtbw	_source+3,_dest+2"); /* memory to memory */
	   asm("movpsl	_psw");	/*save psw				*/
	   psw &= FLAGS;	/*mask out all bits except flag bits	*/
	   if (dest != *p_expbw)
		{
		asm("movl	$1,_ercode");
		if (scoplp) longjmp();
	        error(dest,*p_expbw,source,*p_destb); 
		}
	   if (source != *p_sourceb)
		{
		asm("movl	$3,_ercode");
		if (scoplp) longjmp();
	        error(source,*p_sourceb,source,*p_destb); 
		}
	   if (psw != *p_exp_pswb)
		{
		asm("movl	$2,_ercode");
		if (scoplp) longjmp();
	        error(psw,*p_exp_pswb,source,*p_destb); 
		}
		if (force_lp) longjmp();
    	   else
		return(0);	/*no error exit*/ 
          }	
}

/*single test 1 called by main test*/
/*source location = destination location*/
static	t_cvtbw1()
{
	for ( ; ; )
	  { 
           			/*initialize  source, & psw	*/
	   setjmp();
	   asm("c6:	movab	c6,_stpc");
	   asm("movl	$6,_subtst");
	   source = *p_sourceb;
	   asm("movb	_source+3,r5"); /* load first operand register */
	   asm("movl	_source,r6"); /* load second operand register */
	   asm("movw 	_index,r10");
	   asm("bicpsw	$PSWMASK");
	   asm("bispsw	_flag_valueb[r10]");
				/*execute cvt instruction		*/
	   asm("cvtbw	_source+3,_source+2"); /* register to register */
	   asm("movpsl	_psw");	/*save psw				*/
	   psw &= FLAGS;	/*mask out all bits except flag bits	*/
	   if (source != *p_expbw)
		{
		asm("movl	$1,_ercode");
		if (scoplp) longjmp();
	     	error(source,*p_expbw,*p_sourceb,*p_sourceb); 
		}
	   if (psw != *p_exp_pswb)
		{
		asm("movl	$2,_ercode");
		if (scoplp) longjmp();
	     	error(psw,*p_exp_pswb,*p_sourceb,*p_sourceb); 
		}
		if (force_lp) longjmp();
    	   else
		return(0);	/*no error exit*/ 
          }	/*end of for loop*/
}	/*end of test*/




static cvtlb()			/* convert long to byte */
{
   asm("bicpsw	$PSWMASK");		/*psw = 0*/
      for (init_ptr(), index = 0; index < MAX_PATTERNS; bump_ptr(), index++)
	  {
           t_cvtlb ();
      	   t_cvtlb1();		/*one more test where			*/
				/* dest address = source address	*/
          }	
}

static t_cvtlb()		/*single test called by main test*/
{

	for ( ; ; )
	  { 
	   setjmp();
	   asm("c7:	movab	c7,_stpc");
	   asm("movl	$7,_subtst");
	   dest = *p_destlb;	/*init destination, source, & psw */
	   source = *p_sourcelb;
	   asm("movw _index,r10");
	   asm("bicpsw	$PSWMASK");
	   asm("bispsw	_flag_valuel[r10]");
				/*execute cvt instruction		*/
	   asm("cvtlb	_source,_dest+3"); /* memory to memory */
	   asm("movpsl	_psw");	/*save psw				*/
	   psw &= FLAGS;	/*mask out all bits except flag bits	*/
	   if (dest != *p_explb)
		{
		asm("movl	$1,_ercode");
		if (scoplp) longjmp();
	        error(dest,*p_explb,source,*p_destlb); 
		}
	   if (source != *p_sourcelb)
		{
		asm("movl	$3,_ercode");
		if (scoplp) longjmp();
	        error(source,*p_sourcelb,source,*p_destlb); 
		}
	   if (psw != *p_exp_pswl)
		{
		asm("movl	$2,_ercode");
		if (scoplp) longjmp();
	        error(psw,*p_exp_pswl,source,*p_destlb); 
		}
		if (force_lp) longjmp();
    	   else
		return(0);	/*no error exit*/ 
          }	
}



static	t_cvtlb1 ()		/*single test 1 called by main test*/
				/*source location = destination location*/
{

	for ( ; ; )
	  { 
           			/*initialize  source, & psw	*/
	   setjmp();
	   asm("c8:	movab	c8,_stpc");
	   asm("movl	$8,_subtst");
	   source = *p_sourcelb;
	   asm("movw 	_index,r10");
	   asm("movl	_source,r5"); /* load first operand register */
	   asm("movl	_source,r6"); /* load second operand register */
	   asm("bicpsw	$PSWMASK");
	   asm("bispsw	_flag_valuel[r10]");
				/*execute cvt instruction		*/
	   asm("cvtlb	r5,r6"); /* register to register */
	   asm("movpsl	_psw");	/*save psw				*/
	   psw &= FLAGS;	/*mask out all bits except flag bits	*/
	   asm("movb	r6,_source+3"); /* load source location */
	   if (source != *p_explb)
		{
		asm("movl	$1,_ercode");
		if (scoplp) longjmp();
	     	error(source,*p_explb,*p_sourcelb,*p_sourcelb); 
		}
	   if (psw != *p_exp_pswl)
		{
		asm("movl	$2,_ercode");
		if (scoplp) longjmp();
	     	error(psw,*p_exp_pswl,*p_sourcelb,*p_sourcelb); 
		}
		if (force_lp) longjmp();
    	   else
		return(0);	/*no error exit*/ 
          }	/*end of for loop*/
}	/*end of test*/



static cvtlw()			/* convert long to word */
{
   asm("bicpsw	$PSWMASK");		/*psw = 0*/
      for (init_ptr(), index = 0; index < MAX_PATTERNS; bump_ptr(), index++)
	  {
           t_cvtlw ();
      	   t_cvtlw1();		/*one more test where			*/
				/* dest address = source address	*/
          }
}

static t_cvtlw()		/*single test called by main test*/
{
	for ( ; ; )
	  { 
	   setjmp();
	   asm("c9:	movab	c9,_stpc");
	   asm("movl	$9,_subtst");
	   dest = *p_destlw;	/*init destination, source, & psw */
	   source = *p_sourcelw;
	   asm("movw _index,r10");
	   asm("bicpsw	$PSWMASK");
	   asm("bispsw	_flag_valuel[r10]");
				/*execute cvt instruction		*/
	   asm("cvtlw	_source,_dest+2"); /* memory to memory */
	   asm("movpsl	_psw");	/*save psw				*/
	   psw &= FLAGS;	/*mask out all bits except flag bits	*/
	   if (dest != *p_explw)
		{
		asm("movl	$1,_ercode");
		if (scoplp) longjmp();
	        error(dest,*p_explw,source,*p_destlw); 
		}
	   if (source != *p_sourcelw)
		{
		asm("movl	$3,_ercode");
		if (scoplp) longjmp();
	        error(source,*p_sourcelw,source,*p_destlw); 
		}
	   if (psw != *p_exp_pswl)
		{
		asm("movl	$2,_ercode");
		if (scoplp) longjmp();
	        error(psw,*p_exp_pswl,source,*p_destlw); 
		}
		if (force_lp) longjmp();
    	   else
		return(0);	/*no error exit*/ 
          }	
}



static	t_cvtlw1 ()		/*single test 1 called by main test*/
				/*source location = destination location*/
{

	for ( ; ; )
	  { 
           			/*initialize  source, & psw	*/
	   setjmp();
	   asm("c10:	movab	c10,_stpc");
	   asm("movl	$0xa,_subtst");
	   source = *p_sourcelw;
	   asm("movw 	_index,r10");
	   asm("movl	_source,r5"); /* load first operand register */
	   asm("movl	_source,r6"); /* load second operand register */
	   asm("bicpsw	$PSWMASK");
	   asm("bispsw	_flag_valuel[r10]");
				/*execute cvt instruction		*/
	   asm("cvtlw	r5,r6"); /* register to register operation */
	   asm("movpsl	_psw");	/*save psw				*/
	   psw &= FLAGS;	/*mask out all bits except flag bits	*/
	   asm("movw	r6,_source+2"); /* load source location */
	   if (source != *p_explw)
		{
		asm("movl	$1,_ercode");
		if (scoplp) longjmp();
	     	error(source,*p_explw,*p_sourcelw,*p_sourcelw); 
		}
	   if (psw != *p_exp_pswl)
		{
		asm("movl	$2,_ercode");
		if (scoplp) longjmp();
	     	error(psw,*p_exp_pswl,*p_sourcelw,*p_sourcelw); 
		}
		if (force_lp) longjmp();
    	   else
		return(0);	/*no error exit*/ 
          }
}



static cvtbl()			/* convert byte to long test */
{
   asm("bicpsw	$PSWMASK");		/*psw = 0*/
      for (init_ptr(), index = 0; index < MAX_PATTERNS; bump_ptr(), index++)
	  {
           t_cvtbl ();
      	   t_cvtbl1();		/*one more test where			*/
				/* dest address = source address	*/
          }
}

static t_cvtbl()		/*single test called by main test*/
{

	for ( ; ; )
	  { 
	   setjmp();
	   asm("c11:	movab	c11,_stpc");
	   asm("movl	$0xb,_subtst");
	   dest = *p_destb;	/*initialize destination, source, & psw	*/
	   source = *p_sourceb;
	   asm("movw _index,r10");
	   asm("bicpsw	$PSWMASK");
	   asm("bispsw	_flag_valueb[r10]");
				/*execute cvt instruction		*/
	   asm("cvtbl	_source+3,_dest"); /* memory to memory */
	   asm("movpsl	_psw");	/*save psw				*/
	   psw &= FLAGS;	/*mask out all bits except flag bits	*/
	   if (dest != *p_expbl)
		{
		asm("movl	$1,_ercode");
		if (scoplp) longjmp();
	        error(dest,*p_expbl,source,*p_destb); 
		}
	   if (source != *p_sourceb)
		{
		asm("movl	$3,_ercode");
		if (scoplp) longjmp();
	        error(source,*p_sourceb,source,*p_destb); 
		}
	   if (psw != *p_exp_pswb)
		{
		asm("movl	$2,_ercode");
		if (scoplp) longjmp();
	        error(psw,*p_exp_pswb,source,*p_destb,*p_exp_pswb,psw); 
		}
		if (force_lp) longjmp();
    	   else
		return(0);	/*no error exit*/ 
          }	
}



static	t_cvtbl1 ()		/*single test 1 called by main test*/
				/*source location = destination location*/
{

	for ( ; ; )
	  { 
           			/*initialize  source, & psw	*/
	   setjmp();
	   asm("c12:	movab	c12,_stpc");
	   asm("movl	$0xc,_subtst");
	   source = *p_sourceb;
	   asm("movw 	_index,r10");
	   asm("movb	_source+3,r5"); /* load first operand register */
	   asm("movl	_source,r6"); /* load second operand register */
	   asm("bicpsw	$PSWMASK");
	   asm("bispsw	_flag_valueb[r10]");
				/*execute cvt instruction		*/
	   asm("cvtbl	r5,r6"); /* register to register operation */
	   asm("movpsl	_psw");	/*save psw				*/
	   asm("movl	r6,_source"); /* reload source register */
	   psw &= FLAGS;	/*mask out all bits except flag bits	*/
	   if (source != *p_expbl)
		{
		asm("movl	$1,_ercode");
		if (scoplp) longjmp();
	     	error(source,*p_expbl,*p_sourceb,*p_sourceb); 
		}
	   if (psw != *p_exp_pswb)
		{
		asm("movl	$2,_ercode");
		if (scoplp) longjmp();
	     	error(psw,*p_exp_pswb,*p_sourceb,*p_sourceb); 
		}
		if (force_lp) longjmp();
    	   else
		return(0);	/*no error exit*/ 
          }	/*end of for loop*/
}	/*end of test*/




unix.superglobalmegacorp.com

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