Bit Operation and Representation Procedures: table

Note: Square brackets [...] denote optional arguments.

Name Procedure Type Description Argument/Function Type
Bit Operation
BIT_SIZE Intrinsic Function BIT_SIZE(i). Returns the number of bits in integers of type i. i: Integer

result: same type as i

BTEST Intrinsic Function BTEST(i, pos). Tests a bit in position pos of i; true if bit is 1. i: Integer

pos: positive Integer

result: Logical

IAND Intrinsic Function IAND(i, j). Performs a logical AND. i: Integer

j: Integer

result: same type as i

IBCHNG Intrinsic Function IBCHNG(i, pos). Reverses value of bit in position pos of i. i: Integer

pos: positive Integer

result: same type as i

IBCLR Intrinsic Function IBCLR(i, pos). Clears the bit in position pos of i to zero. i: Integer

pos: positive Integer

result: same type as i

IBITS Intrinsic Function IBITS(i, pos, len). Extracts a sequence of bits of length len from i starting in position pos. i: Integer

pos: positive Integer

len: positive Integer

result: same type as i

IBSET Intrinsic Function IBSET(i, pos). Sets the bit in position pos of i to one. i: Integer

pos: positive Integer

result: same type as i

IEOR Intrinsic Function IEOR(i, j). Performs an exclusive OR. i: Integer

j: Integer

result: same type as i

IOR Intrinsic Function IOR(i, j). Performs an inclusive OR. i: Integer

j: Integer

result: same type as i

ISHA Intrinsic Function ISHA(i, shift). Shifts i arithmetically left or right by shift bits; left if shift positive, right if shift negative. Zeros shifted in from the right, ones shifted in from the left. i: Integer

shift: Integer

result: same type as i

ISHC Intrinsic Function ISHC(i, shift). Performs a circular shift of i left or right by shift bits; left if shift positive, right if shift negative. No bits lost. i: Integer

shift: Integer

result: same type as i

ISHFT Intrinsic Function ISHFT(i, shift). Shifts i logically left or right by shift bits; left if shift positive, right if shift negative. Zeros shifted in from opposite end. i: Integer

shift: Integer

result: same type as i

ISHFTC Intrinsic Function ISHFTC(i, shift[, size]). Performs a circular shift of the rightmost bits of (optional) size by shift bits. No bits lost. i: Integer

shift: Integer

size: positive Integer

result: same type as i

ISHL Intrinsic Function ISHL(i, shift). Shifts i logically left or right by shift bits. Zeros shifted in from opposite end. i: Integer

shift: Integer

result: same type as i

MVBITS Intrinsic Subroutine MVBITS(from, frompos, len, to, topos). Copies a sequence of bits from one integer to another. from: Integer

frompos: positive Integer

to: Integer

topos: positive Integer

NOT Intrinsic Function NOT(i). Performs a logical complement. i: Integer

result: same type as i

Bit Representation
LEADZ Intrinsic Function LEADZ(i). Returns leading zero bits in an integer. i: Integer

result: same type as i

POPCNT Intrinsic Function POPCNT(i). Returns number of 1 bits in an integer. i: Integer

result: same type as i

POPPAR Intrinsic Function POPPAR(i). Returns the parity of an integer. i: Integer

result: same type as i

TRAILZ Intrinsic Function TRAILZ(i). Returns trailing zero bits in an integer. i: Integer

result: same type as i