Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/superjmn/somecompiler
A little C-like compiler created for The Joy of Learning
https://github.com/superjmn/somecompiler
c compiler language processor z80
Last synced: 27 days ago
JSON representation
A little C-like compiler created for The Joy of Learning
- Host: GitHub
- URL: https://github.com/superjmn/somecompiler
- Owner: SuperJMN
- Created: 2022-07-01T13:32:03.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-04-15T18:00:29.000Z (7 months ago)
- Last Synced: 2024-05-02T04:40:08.658Z (6 months ago)
- Topics: c, compiler, language, processor, z80
- Language: C#
- Homepage:
- Size: 218 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Welcome!
This is "SomeCompiler", a little C-like compiler created for "The Joy of Learning®".
I'm making this in my free time to learn about compilers and some old-school topics. It's supposed to make me happier, but more often that not, it's making me get bald faster 🤣
## How does it work?
Currently, it's able to compile very simple programs into a sort of **intermediate language** (IL for short) that is nothing more than 3-Address Code. The benefit of this IL, is that it's so generic that it can virtually be translated to any platform.
Then, the IL is targeted to a specific platform with a **code generator**. It basically converts IL into the actual binary format (or aseembly code).
What can it do?
Right now, it can compile a few simple programs like this:
```
int main()
{
return 2 * 3 * 4;
}
```## Which platforms does it compile for?
It can compile for the Zilog Z80 processor only. I'm using it as a real platform to test the compiler 😊 But truth is that I almost know nothing about it apart from it being one of the most widely used processors of all time and part of systems like Nintendo Gameboy, Apple II, Commodor 64 and many others.