echse/README.md
Vinzenz Schroeter 5ad6baa30d initial commit
2024-12-13 21:49:55 +01:00

48 lines
1.7 KiB
Markdown

# 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
1. Code with macros (.es)
2. Preprocessor applies macros and resolves jump labels (.ei)
3. Transform into binary representation (.eo)
4. 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.