Skip to content

grahamedgecombe/tiny-basic-compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published