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

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

/* @(#)bext_h.c	5.1 - 86/12/09 - 09:03:37 */
#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.
 */

short bext_h(m,i,len)
short *m, *i, *len;
{
	if ( (*i + *len > NBSI)  ||  (*i < 0)  ||  (*len < 0)  ||
	     (*i >= NBSI) || (*len > NBSI) ) return(*m);
	return((*m & F77mask[*i + *len]) >> *i);
}
