Skip to content

KdotDevelopment/c-compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Custom C Compiler (x86_64)

The compiler can currently do basic comparisons, if/while/for statements, integer variables, and return to the linux kernel. It can take into account operator precedence when evaluating an expression. It currently generates into x86 assembly (intel syntax) and uses my custom x86 assembler (https://github.com/KdotDevelopment/assembler). Functions do not have arguments and the type doesn't do much yet. Types have been implemented, which means a variable will only take as much memory as you let it. These are also memory aligned. The compiler supports inline assembly using a special syntax, for example: $mov rax, 60; bascically, everything between the $ and ; is pasted right into the assembly file. This allows for a quick way to make the program do something like printing without the compiler supporting it yet. You can take a look at ./test.rc for a demonstration of whatever I am working on.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published