Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/scriptlinestudios/sscb
Simple Stack-based Compiler Backend. An easy to use compiler backend for generating, optimising and translating intermediate representation
https://github.com/scriptlinestudios/sscb
Last synced: about 1 month ago
JSON representation
Simple Stack-based Compiler Backend. An easy to use compiler backend for generating, optimising and translating intermediate representation
- Host: GitHub
- URL: https://github.com/scriptlinestudios/sscb
- Owner: ScriptLineStudios
- Created: 2022-11-21T11:40:58.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-29T15:18:26.000Z (almost 2 years ago)
- Last Synced: 2023-03-11T01:57:30.672Z (almost 2 years ago)
- Language: C
- Size: 1 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SSCB
Simple Stack-based Compiler Backend. An easy to use compiler backend for generating, optimising and translating intermediate representation# How it works
SSCB provides an easy to use API which allows you to generate intermediate representation (IR) which can then be optimised and compiled into different assembly languages. Small Example:# Targets
- Intel x86_64 Linux
- Intel x86 Linux```C
#include "include/sscb_instructions.h"
#include "include/sscb_codegen.h"int main(void) {
instruction_setup();FUNCTIONEXTERN(FUNCTION("printf"));
MOV(REG(R1), STRING("string_%d", 10));
XOR(REG(RETURNREGISTER), REG(RETURNREGISTER));
CALL(FUNCTION("printf"));
RETURN();
LABELDEF(STRING("string_%d", 10));
DEFINEBYTE(STRING("`Helllo World!\\n`\n", 10));codegen_generated_instructions(INTEL_x86_64_LINUX);
return 0;
}
```##### Outline of the idea: https://docs.google.com/document/d/1SjRVg72Kb6y4kZf6pb-CG1xLP9F9fr01fhHzh6TqRO8/edit?usp=sharing