1BIT(3F) BIT(3F)
2
3
4
6 bit - and, or, xor, not, rshift, lshift bitwise functions
7
9 (intrinsic) function and (word1, word2)
10
11 (intrinsic) function or (word1, word2)
12
13 (intrinsic) function xor (word1, word2)
14
15 (intrinsic) function not (word)
16
17 (intrinsic) function rshift (word, nbits)
18
19 (intrinsic) function lshift (word, nbits)
20
22 These bitwise functions are built into the compiler and return the data
23 type of their argument(s). Their arguments must be integer or logical
24 values.
25
26 The bitwise combinatorial functions return the bitwise ``and'' (and),
27 ``or'' (or), or ``exclusive or'' (xor) of two operands. Not returns
28 the bitwise complement of its operand.
29
30 Lshift, or rshift with a negative nbits, is a logical left shift with
31 no end around carry. Rshift, or lshift with a negative nbits, is an
32 arithmetic right shift with sign extension. No test is made for a rea‐
33 sonable value of nbits.
34
35 These functions may be used to create a variety of general routines, as
36 in the following statement function definitions:
37
38 integer bitset, bitclr, getbit, word, bitnum
39
40 bitset( word, bitnum ) = or(word,lshift(1,bitnum))
41 bitclr( word, bitnum ) = and(word,not(lshift(1,bitnum)))
42 getbit( word, bitnum ) = and(rshift(word,bitnum),1)
43
45 These functions are generated in-line by the f77 compiler.
46
47
48
494.2 Berkeley Distribution April 30, 1986 BIT(3F)