C compiler for GAIA CPU written in OCaml.
- OCaml >= 4.0.1
- ocamlbuild >= 4.0.1
- Clang (for preprocessing and syntax check)
make
To run the tests, use the following command.
make test
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.
- http://kw-udon.hatenablog.com/entry/2015/03/19/171921 (written in Japanese)