Find a file
2024-12-15 11:28:25 +01:00
echse improve error handling 2024-12-15 11:28:25 +01:00
echse_cute improve error handling 2024-12-15 11:28:25 +01:00
krabbeltier improve error handling 2024-12-15 11:28:25 +01:00
samples improve error handling 2024-12-15 11:28:25 +01:00
.gitignore initial commit 2024-12-13 21:49:55 +01:00
Cargo.lock improve error handling 2024-12-15 11:28:25 +01:00
Cargo.toml improve error handling 2024-12-15 11:28:25 +01:00
flake.lock initial commit 2024-12-13 21:49:55 +01:00
flake.nix initial commit 2024-12-13 21:49:55 +01:00
README.md initial commit 2024-12-13 21:49:55 +01:00

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.