No description
Find a file
2016-02-26 01:40:06 -05:00
c5.c Include headers 2016-02-26 01:40:06 -05:00
c5x86.c Include headers 2016-02-26 01:40:06 -05:00
hello.c initial 2014-11-04 13:05:49 -05:00
LICENSE Initial commit 2014-11-04 12:57:29 -05:00
README.md AST + Code Generator 2016-01-27 02:11:00 -05:00
w32.h AST + Code Generator 2016-01-27 02:11:00 -05:00

c5 - C in four functions + AST + back-end code generator

An exercise in minimalism.

This branch extends c4.c by adding:

  • Abstract Syntax Tree creation
  • Back-end code generator function: gen()
  • Standard ordering of function parameters on stack
  • Native x86 version: c5x86.c
  • Various optimizations

Try the following:

gcc -o c5 c5.c  (you may need the -m32 option on 64bit machines)
./c5 hello.c
./c5 -s hello.c

./c5 c5.c hello.c
./c5 c5.c c5.c hello.c