# BITOPS > [HTML Version](bitopssbr.htm) _Reviewed and revised April 2024_ **xcall BITOPS, opcode, chfld, pos, result, result2** BITOPS was developed to facilitate the use of large bit fields (bitmaps). These are quite useful when you want to keep a single binary flag for each of many items. The bit field can be held in memory in a variable of type X, or in a random file. **Parameters** _opcode _([Num](num.htm.md)) \[in\] specifies the operation using the following values: | **Value** | **Meaning** | |------|------| | 1 | Clear bit #__; if_ _ = -1 or is omitted, clear all bits in bitmap | | 2 | Set bit #__; if_ _ = -1 or is omitted, set all bits in bitmap | | 3 | Counts all bits in bitmap; return number of 0s in _result_, number of 1s in _result2_ | | 4 | Set _result_ to bit number of first zero bit on or after given _pos_. If no more zero bits, return –1. At same time, set _result2_ to bit number of first one bit on or after _pos_. | _chfld_ ([BLOB](blob.htm.md) or [Unsigned Int](integer-unsigned.htm.md)) \[in\] is either the bit field (if type X) of any size (first bit is considered bit #0); if any type other than X, _chfld_ is interpreted as an open random file channel (containing the bit field). _pos _([Num](num.htm.md)) \[in\] specifies the bit number we are operating on or starting from; see _opcode_ table above. _result, result2 _([Num](num.htm.md)) \[out\] are used to return the results; see _opcode_ table above.