/* $Header:bext_l.c 12.0$ */
/* $ACIS:bext_l.c 12.0$ */
/* $Source: /ibm/acis/usr/src/usr.lib/libF77/RCS/bext_l.c,v $ */

#ifndef lint
static char *rcsid = "$Header:bext_l.c 12.0$";
#endif

/* @(#)bext_l.c	5.1 - 86/12/09 - 09:03:41 */
#include "bit.h"

/* Extract a subfield of len bits from m starting with bit position i
 * and extending left for len bits. The right most bit is bit 0.
 */

long bext_l(m,i,len)
long *m, *i, *len;
{
	register unsigned long temp;

	temp = *m;
	if ( (*i + *len > NBLI)  ||  (*i < 0)  ||  (*len < 0)  ||
	     (*i >= NBLI) || (*len > NBLI) ) return(temp);
	return((temp & F77mask[*i + *len]) >> *i);
}
