Logo Valid XHTML 1.0 Transitional Valid CSS!

FVM Factory

FVM Factory is an open source project. It offers Win32 tools supporting Forth Virtual Machine (FVM) development.

Using FVM Factory, you can add a Forth-like interpreter into your embedded application. The FVM instruction set can be easily customised. You can add/remove instructions as required, while the cross-compiler (named FVM Console) will keep track of that.

The created FVM is written in ANSI C language. Tokens or pre-compiled functions (scripts) can be invoked from C code.

FVM Factory creates 16-bit FVMs with indirect threading code. FVM bytecodes can be 1-byte, 2-bytes and 3-bytes long. Typically a compiled FVM occupies about 2K of program memory.

Currently FVM Factory does not have code specific to any particular microcontroller. Thus, it is suitable for any microcontroller.

Create a custom FVM using token compiler FVM_factory.exe

Token compiler converts token's description file into a set of C source files. It creates appropriate C function declarations and their calls. If a declared C function exists in the repository std_tokens.c, token compiler copies its content from the repository into a source file. If source files already have C code, token compiler copies matched C functions into output files; that facilitates incremental development.

FVM Factory

Edit your custom tokens (C functions) in the generated files as required.

Create a custom cross-compiler FVM_console.exe

Source files generated by the token compiler are combined with other source files in the Console directory. Then Dev-C++ compiles them into a Windows console application FVM_console.exe. It becomes a cross-compiler and a debugger for your custom FVM.

FVM console

Create and debug FVM scripts using FVM_console.exe

Write your FVM scripts, compile and debug them using FVM_console.exe. Script language is a simplified Forth. FVM_console.exe has extensive error checking and an embedded help system which is aware of your custom tokens. Cast compiled scripts into a C source file as a byte array FVM_code.c.

FVM scripts

Compile your target application

Combine FVM source files with your application and compile them.

FVM target

Read more: FVM Factory overview (pdf ~120k)

Download FVM Factory from SourceForge