ass
compiles programs written in C down to x86-64 assembly code.
It has a tokeniser, parser and codegen module. You can run it like this to generate assembly:
ass input.c > output.s
Note: ass is not an assembler or linker. See compile.sh
for assembling binaries
- Variables Local, stack-based and global variables of all primitive types besides floats/doubles
- Pointers Pointers, dereferencing, and the addressOf operator
- Functions Functions + arguments can be defined and called
- StdLib Call into standard library functions like
printf
- If statements With optional
else
- Loops Including unusual loop declarations like
(;;)
Plus Probably more since I wrote this readme :)
See ./examples for some example
code that ass
can compile and run right now - including a FizzBuzz program!
Is it even a compiler if it can't do FizzBuzz?