The binary tools are all combined into a single executable file. The Windows version is available as forw.exe (link). Versions for Linux, Mac, and other platforms can easily be compiled from the source code (link). Everything is free and open source.
The tools can be called from a command line, batch file, shell script, or make utility. See the ForwardCom manual for instructions.
A compiler is not available yet.
Assembly language is traditionally very cryptic. Different assemblers sometimes have very different syntaxes for the same microprocessor so that it is unclear to the reader which operands are source and destination.
ForwardCom breaks this cumbersome tradition and replaces it with a clear syntax that is unambiguous and immediately intelligible to programmers. For example, adding the contents of two integer registers and storing the result in a third register is as simple as
int r1 = r2 + r3All common operators are supported.
Branches and loops can be written in a syntax that is very similar to C or Java, with support for high-level language keywords such as: if, else, for, while, do, break, continue.
The following example shows a function to calculate a factorial. This should be easy to read even for programmers who are not familiar with assembly language:
code section execute // define executable code section // factorial function calculates n! // input: r0, output: r0 _factorial function public if (uint64 r0 <= 20) { // check for overflow, 64 bit unsigned integer uint64 r1 = 1 // start with 1 while (uint64 r0 > 1) { // loop through r0 values uint64 r1 *= r0 // multiply all values uint64 r0 -- // count down to 1 } uint64 r0 = r1 // put result in r0 return // normal return from function } int64 r0 = -1 // overflow. return max unsigned value return // return from overflow _factorial end // end of function code end // end of code section
While this syntax is very similar to high-level programming languages like C or Java, it differs in two important aspects: The assembly programmer must decide which registers to use for each variable, and each line must fit into a single machine instruction.
Most instructions can be predicated for conditional execution. This can be expressed conveniently by using the ?: operator. For example, the C code if (r1 < 0) r1 += r2; can be coded in ForwardCom assembly as
int r0 = r1 < 0 // r0 contains boolean result of compare int r1 = r0 ? r1 + r2 : r1 // addition conditional on boolean r0
Code examples for inspiration can be found in the github repository (link). The complete syntax is defined in the ForwardCom manual (link).