The subroutine is called by:
call mvbits( src, ini1, nbits, des, ini2 ) |
|||
src |
INTEGER*4 |
Input |
Source |
ini1 |
INTEGER*4 |
Input |
Initial bit position in the source |
nbits |
INTEGER*4 |
Input | |
des |
INTEGER*4 |
Output |
Destination |
ini2 |
INTEGER*4 |
Input |
Initial bit position in the destination |
demo% cat mvb1.f * mvb1.f -- From src, initial bit 0, move 3 bits to des, initial * bit 3. * src des * 543210 543210 <- Bit numbers * 000111 000001 <- Values before move * 000111 111001 <- Values after move INTEGER*4 src, ini1, nbits, des, ini2 data src, ini1, nbits, des, ini2 1 / 7, 0, 3, 1, 3 / call mvbits ( src, ini1, nbits, des, ini2 ) write (*,"(5o3)") src, ini1, nbits, des, ini2 end demo% f95 mvb1.f demo% a.out 7 0 3 71 3 demo% |
Note the following: