To perform logical operations, bvi has a set of bit-level commands. The following commands are available:
:rl n | rotate left | n is a number from 1 through 7 |
:rr n | rotate right | |
:sr n | shift right | |
:sl n | shift left | |
:and i | and operation | i is a number from 0 through 255 |
:or i | or operation | |
:xor i | or operation | |
:not | negates operation | |
:neg | negates operation |
The i value can be entered as a decimal number (0 - 255), a hexadecimal number with a leading zero (0 - 0ff) or a binary number, either with a leading B (B101) or exactly eight digits long (00000101).
On default the whole file is affected, but you can use the usual
colon command address forms. In contrast to vi the addresses designate
not line numbers but byte numbers. These addresses can be enterd in
decimal or hexadecimal notation.
Examples:
:100,500and 01A RETURN
:03FA,01000or 00001000 RETURN
:.rr 3 RETURN
:'a,$sl 1 RETURN