/ucc

Udon C Compiler: C compiler for our original CPU

Primary LanguageC

UCC - Udon C Compiler Build Status

C compiler for GAIA CPU written in OCaml.

Requirement

  • OCaml >= 4.0.1
  • ocamlbuild >= 4.0.1
  • Clang (for preprocessing and syntax check)

Build

make

To run the tests, use the following command.

make test

Example

You can compile C file by the following command.

./bin/ucc ./test/printf.c

Then, a.out will be created. It runs on the simulator.

./bin/sim -simple a.out

You can check generated assembly by -S option.

./bin/ucc -S ./test/printf.c

If you want to see other options, please use -h option.

In addition, UCC can compile xv6 ported to GAIA, a simple Unix-like OS. Please use this Makefile to try it.

Article