FRANCAIS

BOOLEAN OPERATORS


BOOLEAN ARITHMETIC

TESTBIT ()

SETBITON ()

SETBITOFF ()

Download the TESTBIT here. Download the SETBITON here. Download the SETBITOFF here.

Download all 3 here.

TESTBIT (), SETBITON () and SETBITOFF () are free-form versions of opcodes TESTB, BITON and BITOFF. They are designed to be used in free form statements. Each takes two parameters. The first parameter is a one character field which is the target of the bit operation. The second parameter contains the bit numbers to be used - in SETBITON and SETBITOFF this can be up to 8 in length, while in TESTBIT is only one character in length; for all three, this can be a variable or a constant.

Each is presented as sources in .txt files. Each file contains the prototyped subprocedure and an example of use.
This table of DECIMAL - BINARY - HEXADECIMAL values opens in a new window.
This link will open a description of the built-in functions %BITAND - %BITNOT - %BITOR - %BITXOR in a new window.

TestBit()

TestBit() is a function - subprocedure - designed to illustrate a free-form version of the fixed-form opcode TESTB opcode. It takes a character field, length 1, and a bit reference, range 0 - 7, and returns a 0 or 1 for off or on.
The bit reference is tested against the character field.
returnvalue = TESTBIT(charfield, bit).
where returnvalue = signed numeric field, length 1, value 0 or 1.
... charfield = character field, length 1.
... bit = signed numeric field, length 1.

SetBitOn ()

SetBitOn () is a function - subprocedure - designed to illustrate a free-form version of the fixed-form opcode BITON opcode. It takes a character field, length 1, and a bit reference, range 0 - 7, There is no return value.
The bit reference is acts on the character field.
SETBITON(charfield, bits).
where charfield = character field, length 1.
... bits = character field of bit positions, length 8.

SetBitOff()

SetBitOff () is a function - subprocedure - designed to illustrate a free-form version of the fixed-form opcode BITOFF opcode. It takes a character field, length 1, and a bit reference, range 0 - 7, There is no return value.
The bit reference is acts on the character field.
SETBITOFF(charfield, bits).
where charfield = character field, length 1.
... bits = character field of bit positions, length 8.

Post any comments or suggestions you may have on the Contact Us tab.