the BFVM interprets BFB, a Brainfuck-based binary format.
conceptually, there are two tapes of memory, and six "free" registers.
<>
move left and right on the current tape.
+-
increment and decrement the current tape.
[]
do a loop-like thing, the same as Brainfuck.
,.
read input and write output, again see Brainfuck.
$
jumps between tapes.
#
moves to tape 0.
&
writes the tape index to the r
register.
^
reads tape index from r
, and jumps to it.
&^
and &&
are equivalent to &
.
r*
and R*
read from, and write to, a register *
. The other operand is always the tape.
there are three "special" registers, and thirteen "regular" ones.
regular: abcdeABCDErxy
i
increments on every instruction processed. ri
at the start of execution reads 0
, as does Riri
.
m
increments on every >
and decrements on every <
.
t
increments on every $
and is zeroed on every #
.
~
flips all bits of the current tape cell.
|
is binary OR. one operand (and the return value) is always the current position on the tape.
0
writes 0.
)
is right-shift, (
is left-shift.
ALL ARITHMETIC OPERATIONS WRITE THEIR RESULTS TO THE r
REGISTER.
also, most (except %
) have an alternate floating-point version by prefixing '
.
all binary ones operate on x
and y
registers.
!+
is addition, !-
is subtraction.
*
is multiplication, /
is division
%
is modulus, =
is greater-or-equal
abs
is absolute value, sgn
is signum.
with '
, the following unary functions (operating on x
) are available:
sin
, cos
, tan
, asin
, acos
, atan
sinh
, cosh
, tanh
, asinh
, acosh
, atan
exp
, ln
the ;
character signifies a one-line comment