8.209 MVBITS — Move bits from one integer to another

Synopsis:

CALL MVBITS(FROM, FROMPOS, LEN, TO, TOPOS)

Description:

Moves LEN bits from positions FROMPOS through FROMPOS+LEN-1 of FROM to positions TOPOS through TOPOS+LEN-1 of TO. The portion of argument TO not affected by the movement of bits is unchanged. The values of FROMPOS+LEN-1 and TOPOS+LEN-1 must be less than BIT_SIZE(FROM).

Class:

Elemental subroutine

Arguments:
FROMThe type shall be INTEGER or UNSIGNED.
FROMPOSThe type shall be INTEGER.
LENThe type shall be INTEGER.
TOThe type shall be of the same type and kind as FROM.
TOPOSThe type shall be INTEGER.
Specific names:
NameArgumentReturn typeStandard
MVBITS(A)INTEGER AINTEGERFortran 90 and later
BMVBITS(A)INTEGER(1) AINTEGER(1)GNU extension
IMVBITS(A)INTEGER(2) AINTEGER(2)GNU extension
JMVBITS(A)INTEGER(4) AINTEGER(4)GNU extension
KMVBITS(A)INTEGER(8) AINTEGER(8)GNU extension
Standard:

Fortran 90 and later, has overloads that are GNU extensions. Extension for UNSIGNED (see Unsigned integers).

See also:

IBCLR — Clear bit,
IBSET — Set bit,
IBITS — Bit extraction,
IAND — Bitwise logical and,
IOR — Bitwise logical or,
IEOR — Bitwise logical exclusive or