Elemental Intrinsic Subroutine: Copies a sequence of bits (a bit field) from one location to another.
Syntax
On return, the len bits of to (starting at topos) are equal to the value that len bits of from (starting at frompos) had on entry.
For more information, see Bit Functions.
The model for the interpretation of an integer value as a sequence of bits is shown in Model for Bit Data.
You can also use the following specific routines:
IMVBITS | All arguments must be INTEGER(2) |
JMVBITS | Arguments can be INTEGER(2) or INTEGER(4); at least one must be INTEGER(4) |
KMVBITS | Arguments can be INTEGER(2), INTEGER(4), or INTEGER(8); at least one must be INTEGER(8) |
Compatibility
CONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIB
See Also: BIT_SIZE, IBCLR, IBSET, ISHFT, ISHFTC
Examples
If TO has the initial value of 6, its value after a call to MVBITS with arguments (7, 2, 2, TO, 0) is 5.
The following shows another example:
INTEGER(1) :: from = 13 ! 00001101
INTEGER(1) :: to = 6 ! 00000110
CALL MVBITS(from, 2, 2, to, 0) ! returns to = 00000111
END