BITRESET Function

Resets the value of the specified bit in the bit table to 0 and returns the value of the bit before it was changed.

Syntax

BITRESET(bitNumber)

Syntax Elements

bitNumber Specifies the bit to be reset.

If bitNumber evaluates to zero, all elements in the table are cleared and the returned value is zero.

Operation

BITRESET operates on a table of 128 bits, numbered 1 to 128, unique to each process. Each bit is available as a two-state flag, that is, the value returned by the function is either zero or one.

Because BITRESET returns the value of the bit before it was changed, the function of checking-and-setting (or resetting) a flag can be accomplished in one step.

Special functions can be performed by setting bitNumber to the following values:

0 Resets the entire table.

-1 Allows access to the system INHIBIT bit (which controls inhibiting of the Break key).

-2 Allows access to the system TRSTRFLG bit (which controls TCL restart).

-3 Allows access to the system RSTRTFLG bit (which controls BREAK-END restart).

If bitNumber is less than -3, or greater than 128, the bit table remains unchanged and BITRESET returns 0.

See Also

BITCHANGE function, BITCHECK function, BITLOAD function, BITSET function.

Example 1

If bit 126 = 0

A = BITRESET(126)
PRINT A

Returns a value of 0 and resets bit 126 to 0. Prints 0.

Example 2

If bit 113 = 1

VALUE = BITRESET(113)
PRINT VALUE

Returns a value of 1 and resets bit 113 to 0. Prints 1.