Read Me
README.txt for pbtc
----
2014 October 10
pbtc -- A PBASIC tokenization toolchain
---
Summary
---
pbtc is the 'PBasic Tokenization Toolchain', a fully open-source toolchain for
programming and debugging the BASIC Stamp 2 family of microcontrollers from
Parallax, Inc.
pbtc consists of two layers of tools:
1) pbttc -- an 'assembler/disassembler', which can transform 'PBT'
format mnemonics into valid .tok object streams, and vice versa.
2) pbp -- a compiler transforming a PBASIC-like syntax into PBT
streams, which can then be assembled and uploaded to the microcontroller.
pbtc is only (as of this writing) designed for use in *nix environments; it
should build and work easily on Linux, *BSD (including Mac OS/X), and other
flavours of Unix. For use on a Windows system, it is _likely it will build
in cygwin, but this hasn't been tested, as yet.
pbtc does not use nor require an external tokenizer library; all encoding/
decoding is done by its own, open-source assembler component.
pbtc is currently pre-alpha; while it is capable of producing useable code, it
is by no means, as of this writing, a) user-friendly b) sufficiently
documented, nor c) by any means housebroken.
pbtc should be widely-cross platform; if your platform/architecture has
ports of the prequisites listed below, you can probably use it to program
Stamps from your system.
pbtc is by no means a product of Parallax, and comes with no warranty
whatsoever.
Building -- prerequisites
---
To build pbtc, you will require:
. a g++/gcc compiler for your platform
. make or a compatible port (gmake, etc.)
. a development version of libpcre (the Perl-compatible regular expression
library), with the C++ headers.
. flex and bison (required only for the pbp tool)
Building pbttc -- steps
---
Apologies, but there's no configuration script yet. And it uses
makedepend for header dependencies, so yours may be in an unfriendly state
when you get it out of git. Working on it.
Anyway. Best first to do:
make depend
... then
make
... and optionally
make install
... but the last just puts the binaries in your home ~/bin
directory, if you happen to have one.
... see the README in the pbp subdirectory for building
the pbp tool.
Using the assembler/disassembler
---
pbttc (in the root directory of the project) is the assembler/disassembler
binary. To use it:
pbttc d <filename.tok>
... to disassemble to a 'semi-portable' format, with jump targets
abstracted to labels, and labels inserted. This format can be
reassembled directly; see below.
pbbtc d <filename.tok> -n
... to disassemble to a 'literal' format, with the jump targets
and addresses still literal, in the code. This format cannot be
read by the assembler directly; it's mainly useful for diagnostics
purposes.
pbttc a <filename.pbt>
... assembles a token stream in the top ('semi-portable') format
and dumps out the non-portable/literal format, and finally ...
pbttc a <filename.pbt> <filename.tok>
... assembles a token stream to a valid .tok file.
Using the BASIC-to-pbt compiler
---
See the README.txt in the pbp directory, for use of this tool.
Using the interactive Perl-based detokenizer
---
See the idetok directory for details on this tool. (However, it's of use only
if you're involved in extending the library of known tokens.)