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
Flex lexer + Bison parser for SimpleC grammar
Generates x86-64 assembly compatible with gcc
Register-backed expression stack using rbx, r10, r13, r14, r15
Arithmetic, logical, relational, and pointer operations