SimpleC Compiler

Tru Bui

A compiler for a subset of the C language, written in C using Flex and Bison. Generates x86-64 assembly supporting arithmetic, pointer operations, conditionals, loops, arrays, and function calls via a register-backed stack machine.

This demo shows my Simple C Compiler (scc) compiling and.c and bubblesort.c into assembly files (.s). I then assemble them with gcc -c to produce object files, and finally link everything into runnable executables using gcc -no-pie.

Key Features

Implementation Details

The compiler is implemented in a single pass using Bison actions and a register-based virtual stack machine:

Contact me to see source code!