Skip to content

Latest commit

 

History

History
54 lines (43 loc) · 1.19 KB

README.markdown

File metadata and controls

54 lines (43 loc) · 1.19 KB

Tiny BASIC Compiler

Introduction

A simple Tiny BASIC compiler that targets x86-64 Linux machines.

Usage

The compiler can be built with Java 8 and Apache Maven. The following command will build it and run the unit tests:

mvn compile test

You also need NASM and GCC, which are used for assembling the output of the compiler and linking it with the standard C library.

Example programs can be found in the examples folder. They can be compiled and executed like so:

$ cat examples/squares.tb
10 LET X = 1
20 PRINT X * X
30 LET X = X + 1
40 IF X > 10 THEN END
50 GOTO 20
$ ./tinybasic examples/squares.tb 
$ ./examples/squares 
1
4
9
16
25
36
49
64
81
100
$ 

License

This project is available under the terms of the ISC license, which is similar to the 2-clause BSD license. See the LICENSE file for the copyright information and licensing terms.