All Projects → tyfkda → xcc

tyfkda / xcc

Licence: other
Toy C compiler for x86-64

Programming Languages

c
50402 projects - #5 most used programming language
typescript
32286 projects
shell
77523 projects
javascript
184084 projects - #8 most used programming language
Makefile
30231 projects
HTML
75241 projects

Projects that are alternatives of or similar to xcc

Onyx
UNIX-like operating system written in C and C++
Stars: ✭ 52 (+173.68%)
Mutual labels:  x86-64, posix
Dennix
Dennix is a unix-like hobbyist operating system written from scratch.
Stars: ✭ 53 (+178.95%)
Mutual labels:  x86-64, posix
AheuiJIT
Aheui JIT compiler for PC and web
Stars: ✭ 27 (+42.11%)
Mutual labels:  x86-64, wasm
Wag
WebAssembly compiler implemented in Go
Stars: ✭ 177 (+831.58%)
Mutual labels:  x86-64, wasm
interp
Interpreter experiment. Testing dispatch methods: Switching, Direct/Indirect Threaded Code, Tail-Calls and Inlining
Stars: ✭ 32 (+68.42%)
Mutual labels:  x86-64, wasm
runno
Browser-based code runner that can be embedded as an iframe or used as a library.
Stars: ✭ 211 (+1010.53%)
Mutual labels:  wasm
wecty
Frontend ToolKit for Go and TinyGo.
Stars: ✭ 34 (+78.95%)
Mutual labels:  wasm
FOMOSv2-CL
FOMOS stands for: Free, Open source, Mobile, Operating, System.
Stars: ✭ 24 (+26.32%)
Mutual labels:  x86-64
fasm
flat assembler 1 - reconstructed source history
Stars: ✭ 187 (+884.21%)
Mutual labels:  x86-64
golang-wasm
Golang-WASM provides a simple idiomatic, and comprehensive API and bindings for working with WebAssembly for Go and JavaScript developers
Stars: ✭ 57 (+200%)
Mutual labels:  wasm
wasm-jpeg-ijg
Demo from Chrome Dev Summit of using Web Assembly to optimize images in a browser
Stars: ✭ 54 (+184.21%)
Mutual labels:  wasm
dmr c
dmr_C is a C parser and JIT compiler with LLVM, Eclipse OMR and NanoJIT backends
Stars: ✭ 45 (+136.84%)
Mutual labels:  preprocessor
wapc-rust
Rust-based WebAssembly Host Runtime for waPC-compliant modules
Stars: ✭ 75 (+294.74%)
Mutual labels:  wasm
wasm-fizzbuzz
WebAssembly from Scratch: From FizzBuzz to DooM.
Stars: ✭ 1,364 (+7078.95%)
Mutual labels:  wasm
go-wasm-examples
Some small examples of using Go and WebAssembly
Stars: ✭ 22 (+15.79%)
Mutual labels:  wasm
swam
WebAssembly engine in Scala
Stars: ✭ 38 (+100%)
Mutual labels:  wasm
screeps-starter-rust
Starter Rust AI for Screeps, the JavaScript-based MMO game
Stars: ✭ 55 (+189.47%)
Mutual labels:  wasm
cross-compile-godot-raspberry-pi
A script to easily cross-compile Godot binaries for the Raspberry Pi from Linux x86_64 and an extra script to easily transfer the compiled Godot binaries to the Raspberry Pi using rsync
Stars: ✭ 12 (-36.84%)
Mutual labels:  x86-64
lds-ecdsa-secp256k1-2019.js
EcdsaSecp256k1Signature2019 JSON-LD Signature Suite
Stars: ✭ 15 (-21.05%)
Mutual labels:  wasm
idris-codegen-wasm
WebAssembly Code Generation Backend for Idris Compiler
Stars: ✭ 79 (+315.79%)
Mutual labels:  wasm

XCC

Action Status Build Status Open in Gitpod

  • C compiler for XV6 (64bit)
    • Also work on Linux
  • Assembler
  • Output ELF64 (x86-64) file format
  • Register allocation (Linear scan)
  • Self hosting

Requirements

  • Linux
  • C compiler (gcc or clang)
  • make

Build

$ make

Generated files:

  • xcc: Compiler entry
  • cpp: Preprocessor
  • cc1: C compiler
  • as: Assembler

Run

$ ./xcc examples/hello.c
$ ./a.out

Command line options

  • -o <filename>: Set output filename (default: a.out)
  • -I <path>: Add include path
  • -D <label>(=value): Define macro
  • -S: Output assembly code
  • -E: Preprocess only
  • -c: Output object file

TODO

  • Optimization
  • Archiver, Linker

Missing features

C compiler:

  • Bit field

WebAssembly

WCC: Compile C to WebAssembly.

Reference

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].