Simple Virtual Machine with its own Bytecode and Assembly language.
We are using nobuild build system which requires a bootstrapping step with any relatively standard complaint C compiler.
On Linux/MacOS/FreeBSD/literally any OS on the planet Earth except Windows with MSVC:
$ cc -o nobuild nobuild.c
$ ./nobuild helpIf you still want to use MSVC on Windows run vcvarsall.bat and from within the development environment of MSVC:
> cl.exe nobuild.c
> nobuild.exe help$ ./nobuild libThe static library will be put into ./build/library/
$ ./nobuild toolsThe binaries of the toolchain will be placed in ./build/toolchain/.
$ ./nobuild examplesThe examples will be placed in ./build/examples/.
To run the examples use basm executable from the toolchain:
$ ./build/toolchain/bme ./build/examples/hello.bm
$ ./build/toolchain/bme ./build/examples/fib.bm
$ ./build/toolchain/bme ./build/examples/e.bm
$ ./build/toolchain/bme ./build/examples/pi.bm
nobuild examples automatically builds all the ./examples/*.basm files. So if you want to add a new example to the build just add *.basm file to ./examples/.
TBD
Assembly language for the Virtual Machine. For examples see ./examples/ folder.
BM emulator. Used to run programs generated by basm.
BM debuger. Used to step debug programs generated by basm.
Disassembler for the binary files generated by basm
BM recorder. Used to record the output of binary files generated by basm and comparing those output to the expected ones. We use this tool for Integration Testing.
An experimental tool that translates BM files generated by basm to an assembly files in NASM dialect for x86_64 Linux.
Accepts BASM TTE as a command line argument and dumps its AST in dot format that you can render later with graphviz later.
$ ./build/toolchain/expr2dot "f(a) + g(b) + 69 > 420" | dot -Tsvg > ast.svg
$ iexplore.exe ast.svgEmacs mode available in ./tools/basm-mode.el. Until the language stabilized and we upload the mode on MELPA you need to install this mode manually.
Add the following lines to your .emacs file:
(add-to-list 'load-path "/path/to/basm-mode/")
(require 'basm-mode)Copy ./tools/basm.vim in .vim/syntax/basm.vim. Add the following line to your .vimrc file:
autocmd BufRead,BufNewFile *.basm set filetype=basm