Skip to content

grewek/ccomp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ccomp

My C Compiler for the dielectric_dreams CPU and x86_64 Intel, this project will be based on the book "Writing a C Compiler" by Nora Sandler. Will be written in Swift want to see if the language has good enough linux support!

Necessary Tools

To use this compiler for x86_64 you need the following things available on your system:

  • NASM (For assembling the generated output)
  • GCC (For linking with the c runtime library)

Instructions

Currently the steps to obtaining a executable includes a bit of manual labor but nothing to horrorfying...

Compile any valid C-Program (In the boundaries of our currently supported subset) then compile it with nasm:

nasm -felf64 ${name_of_output}.asm

This should give you a valid object file which then must be linked with gcc like this (failure of doing so will result in a segfaulting binary!):

gcc -o ${name_of_executable} ${name_of_output}.o

where ${name_of_executable} is to be replaced with the actual output name

About

A C Compiler for the x86_64 and dielectric_dreams CPU. Based on the book by Nora Sandler

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published