Basic compiler written in C
Takes a .txc file, converts it into assembly, then converts that file into an executable file.
Clone the project with:
git clone https://github.com/amsquid/jcompile.git
Compile with:
./build.sh
... and run jcompile with a filename as the first argument:
./jcompile test.txc
GCC and NASM
A txc program has a pointer that points to anywhere on a 512 byte array.
The program has the following instructions:
+ Adding the value at the current array pointer by 1
- Subtracting the value at the current array pointer by 1
> Increments the pointer by 1
< Decrements the pointer by 1
@ Prints the value at the pointer as a character
# Prints the value at the pointer as a number