BVI

BVI: Bit-wise Operations


To perform logical operations, bvi has a set of bit-level commands. The following commands are available:

:rl nrotate left n is a number from 1 through 7
:rr nrotate right
:sr nshift right
:sl nshift left
:and iand operation i is a number from 0 through 255
:or ior operation
:xor ior 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
Back to the top
Page updated: October 12th 2019 by Gerhard Bürgmann, Purkersdorf/Austria