C.2.3 Bit Manipulation Intrinsic Functions

Table C-4 lists the Compaq Fortran 77 bit manipulation intrinsic functions.

Table C-4 Bit Manipulation Intrinsic Functions

Function                            No. of Arguments   Generic Name   Specific Name   Type of Argument   Type of Result 
Bit Test [1]   BTEST  INTEGER*1[2]  LOGICAL*4 
      BITEST  INTEGER*2  LOGICAL*2 
      BJTEST  INTEGER*4  LOGICAL*4 
      BKTEST[2]  INTEGER*8  LOGICAL*8 
 
Bitwise AND [3]   IAND  INTEGER*1[2]  INTEGER*1 
      IIAND  INTEGER*2  INTEGER*2 
      JIAND  INTEGER*4  INTEGER*4 
      KIAND[2]  INTEGER*8  INTEGER*8 
 
Bit Clear [4]   IBCLR  INTEGER*1[2]  INTEGER*1 
      IIBCLR  INTEGER*2  INTEGER*2 
      JIBCLR  INTEGER*4  INTEGER*4 
      KIBCLR[2]  INTEGER*8  INTEGER*8 
 
Bit Extraction [5]   IBITS  INTEGER*1[2]  INTEGER*1 
      IIBITS  INTEGER*2  INTEGER*2 
      JIBITS  INTEGER*4  INTEGER*4 
      KIBITS[2]  INTEGER*8  INTEGER*8 
 
Bit Set [6]   IBSET  INTEGER*1[2]  INTEGER*1 
      IIBSET   INTEGER*2  INTEGER*2 
      JIBSET  INTEGER*4  INTEGER*4 
      KIBSET[2]  INTEGER*8  INTEGER*8 
 
Bitwise Exclusive OR [7]   IEOR  INTEGER*1[2]  INTEGER*1 
      IIEOR   INTEGER*2  INTEGER*2 
      JIEOR  INTEGER*4  INTEGER*4 
      KIEOR[2]  INTEGER*8  INTEGER*8 
           
Bitwise Inclusive OR [8]   IOR  INTEGER*1[2]  INTEGER*1 
      IIOR   INTEGER*2  INTEGER*2 
      JIOR  INTEGER*4  INTEGER*4 
      KIOR[2]  INTEGER*8  INTEGER*8 
           
Bitwise Logical Shift [9]   ISHFT  INTEGER*1[2]  INTEGER*1 
      IISHFT   INTEGER*2  INTEGER*2 
      JISHFT  INTEGER*4  INTEGER*4 
      KISHFT[2]  INTEGER*8  INTEGER*8 
 
Bitwise Circular Shift [10] ISHFTC  IISHFTC   INTEGER*2  INTEGER*2 
      JISHFTC  INTEGER*4  INTEGER*4 
Bitwise Complement [11]   NOT  INTEGER*1[2]  INTEGER*1 
      INOT   INTEGER*2  INTEGER*2 
      JNOT  INTEGER*4  INTEGER*4 
      KNOT[2]  INTEGER*8  INTEGER*8 

[1] BTEST returns .TRUE. if bit a(2) of argument a(1) equals 1.

[2] Alpha only

[3] IAND performs a logical AND on corresponding bits.

[4] IBCLR returns the value of a(1) with bit a(2) of a(1) set to 0.

[5] IBITS extracts bits a(2) through a(2)+a(3)-1 from a(1).

[6] IBSET returns the value of a(1) with bit a(2) of a(1) set to 1.

[7] IEOR performs an exclusive OR on corresponding bits.

[8] IOR performs an inclusive OR on corresponding bits.

[9] ISHFT logically shifts a(1) left (if a(2) is positive) or right (if a(2) is negative) by ABS(a(2)) bits. If ABS(a(2)) is 0.

[10] ISHFTC circularly shifts the rightmost a(3) bits of a(1) by a(2) places; bits in a(1) beyond the value specified by a(3) are unaffected.

[11] NOT complements each bit.

For More Information:


Previous Page Next Page Table of Contents