1: /* function iputbt fortran callable for integer*2. PLW 8/5/79*/ 2: /* For integer x, replace the n bits starting at bit p with v. 3: The rightmost or lowest bit is number 0 and integers are 15 4: bits plus the sign bit. The n bits are counted from lowest 5: to highest. */ 6: 7: int h_putbit(x,p,n,v) 8: unsigned int *x,*p,*n,*v; 9: { 10: unsigned int r; 11: r=~(~0 << *n); 12: return(((r & *v) << *p) | (~(r<< *p) & *x)); 13: }