      .title   sgbit
;     this routine extracts bits from vax words.
;     it is similar to NCAR's GBYTE but it works with
;     the natural underlying structure of the VAX.
;
;     CALL GBIT(NPACK,ISAM,IBIT,NBITS)
;     unpacks the bit pattern located at a bit offset
;     of IBIT in NPACK of length NBITS into ISAM.
;
gbit::
      .word 0        ; don't need to save any registers
      extzv @12(ap),@16(ap),@4(ap),@8(ap)  ;isn't this neat ?
      ret
;
;
;     this routine extracts bits from vax words.
;     it is similar to NCAR's SBYTE but it works with
;     the natural underlying structure of the VAX.
;
;     CALL SBIT(NPACK,ISAM,IBIT,NBITS)
;     packs the value in ISAM into NPACK
;     with NBITS offset by IBIT.
;
sbit::
      .word 0        ; don't need to save any registers
      insv  @8(ap),@12(ap),@16(ap),@4(ap)  ;isn't this neat ?
      ret
      .end
