mirror of
https://github.com/kaesaecracker/echse.git
synced 2025-02-21 16:47:11 +01:00
echse | ||
echse_cute | ||
krabbeltier | ||
samples | ||
.gitignore | ||
Cargo.lock | ||
Cargo.toml | ||
flake.lock | ||
flake.nix | ||
README.md |
echse
The cutest assembly-like language!
This is for learning or teaching purposes only - and is probably not useful for anything else.
From code to running
- Code with macros (.es)
- Preprocessor applies macros and resolves jump labels (.ei)
- Transform into binary representation (.eo)
- Run the binary
Currently, you have to write and execute a .ei file.
Ideas and ToDos
- a cute manual for the provided functionality
- preprocessor that supports jumping to labels and unrolled loops
- separate machine configuration and program in files
- register custom instructions before parsing
- optional stack with pus, pop, ret
- small games built upon this:
- battle multiple programs against each other
- rustlings-like exercises to learn the instructions
- put multiple echsen into an environment, interact with environment
Limitations
List of constraints that I want to keep:
- general-purpose registers
- are always interpreted as native signed integers
- are numbered r0...rn, without gaps
- all base instruction
- have names with 3 letters
- all test instructions start with i (after prefixes) and always set r0
- all conditional jumps act based upon r0
- when interpreting numbers as booleans: 0 is false, everything else is true. The name of instructions should reflect that.
- all extension instructions
- have names longer than 3 letters
- have a extension prefix
- the executed instructions do not know anything about the preprocessor and all formatting and jump marks are lost
- there should be no hard-coded calling convention
License
The code in this repository is licensed under GPL v2 or later, unless stated otherwise in the file.