Code size is set to be maximum of 8192 bytes.
Tape size is set to be 16384 bytes.
Stack size is 2048, and procedure stack size is 1024 bytes.
baffle adds a register (R) with a default value of 1, which makes it run plain BF instructions as long as the register is set to 1. Carry flag is actualy a byte, which can be used to impelement multi-byte multiplication.
Here are the instructions:
BF insturctions:
+ : current_cell = current_cell + R
- : current_cell = current_cell - R
> : current_cell_ptr = current_cell_ptr + 1
< : current_cell_ptr = current_cell_ptr - 1
[ : if current_cell == 0 go down to ]
] : if current_cell != 0 go up to [
, : read current_cell
= : R = current_cell
T : Back up the current_cell_ptr
G : Restore the current_cell_ptr
Z : current_cell_ptr = 0 (Rewind)
* : current_cell *= R
/ : current_cell /= R
% : current_cell %= R
^ : current_cell ^= R
& : current_cell &= R
| : current_cell |= R
~ : One's complement of current_cell
L : current_cell <<= 1
R : current_cell >>= 1
! : R = Carry flag
$ : R = Sign flag
\ : clear flags
X : Swap current_cell and R
? : Skip over the next instruction if current_cell is zero
K : label
) : Jump to the label in lower address
( : go to the label in the higher address
: : push current_cell
; : pop current_cell
# : comment (ignore the rest of the line)
" : Put following characters into the tape
V : Print current_cell as a signed number
U : Print current_cell as an unsigned number
H : Print current_cell as HEX
I : Read a byte (a number betwen 0 to 255) and put it in current_cell
P : Print null terminating string starting from current_cell_ptr
S : Read string and insert it cells starting at current_cell_ptr
0-9,A-F : Store HEX number into current_cell
{ : Beginning of a procedure
} : Return from the procedure
@ : Call the Nth procedure where N is current_cell
Q : Quit
axbf is a subset of baffle instructions were symbols only contain alpha numeric characters.
A : +
S : -
R : >
L : <
W : [
B : ]
P : .
I : ,
E : =
T : T
G : G
Z : Z
M : *
D : /
Y : %
K : @
F : {
J : }
C : !
N : $
X : X
V : :
U : ;
H : H
Q : Q
0-9 : Store decimal number (0-255) in current_cell
baffle without any parameters reads and executes the code from STDIN.
s : Step through
n : same as 's' for now
b<number> : Sets the breakpoint (only one for now)
c : clears the breakpoint
g : Go (runs until reaches breakpoing or program ends)
a<secs> : Autostep, step through every <secs> (can be a fraction)
q : quit
Please feel free to send us your patches to get tgc working on other platforms.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of the author nor the names of its contributors
may be used to endorse or promote products derived from THIS
SOFTWARE without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.