An esoteric programming language where Assembly code is written entirely in Morse code
Morse Assembly Language (MAL) is an Assembly-like language where every instruction, register, and value is encoded in Morse code. Programs are stored in .morse files and executed by the MAL interpreter.
- Full Assembly-style instruction set
- Registers: AX, BX, CX, DX, SP, IP
- Arithmetic, logic, comparison, and jump operations
- Stack operations
- Simple I/O
- Labels for control flow
No installation needed! Just run the Python scripts:
chmod +x src/morse_interpreter.py src/morse_assembler.pypy src/morse_interpreter.py program.morsepy src/morse_assembler.py input.asm output.morse# Encode text to morse
py src/morse_interpreter.py --encode "Hello World"
# Decode morse to text
py src/morse_interpreter.py --decode ".... . .-.. .-.. --- / .-- --- .-. .-.. -.."- Individual morse characters are separated by spaces
- Words/tokens are separated by " / " (space-slash-space)
- Lines are separated by newlines
Regular Assembly: MOV AX, 72
Morse Assembly: -- --- ...- / .- -..- / --..-- / --... ..---
MOV dest, src- Move value from source to destinationPUSH value- Push value onto stackPOP dest- Pop value from stack to destination
ADD dest, src- Add source to destinationSUB dest, src- Subtract source from destinationMUL value- Multiply AX by valueDIV value- Divide AX by valueINC dest- Increment destinationDEC dest- Decrement destination
AND dest, src- Bitwise ANDOR dest, src- Bitwise ORXOR dest, src- Bitwise XORNOT dest- Bitwise NOT
CMP a, b- Compare two valuesJMP label- Unconditional jumpJE label- Jump if equal (zero flag set)JNE label- Jump if not equalJG label- Jump if greaterJL label- Jump if less
OUT value- Output value (as ASCII if 0-127)IN dest- Read input to destination
HLT- Halt execution
MOV AX, 72 ; H
OUT AX
MOV AX, 101 ; e
OUT AX
MOV AX, 108 ; l
OUT AX
OUT AX ; l
MOV AX, 111 ; o
OUT AX
HLT-- --- ...- / .- -..- / --..-- / --... ..---
--- ..- - / .- -..-
-- --- ...- / .- -..- / --..-- / .---- ----- .----
--- ..- - / .- -..-
-- --- ...- / .- -..- / --..-- / .---- ----- ---..
--- ..- - / .- -..-
--- ..- - / .- -..-
-- --- ...- / .- -..- / --..-- / .---- .---- .----
--- ..- - / .- -..-
.... .-.. -
A .- B -... C -.-. D -.. E .
F ..-. G --. H .... I .. J .---
K -.- L .-.. M -- N -. O ---
P .--. Q --.- R .-. S ... T -
U ..- V ...- W .-- X -..- Y -.--
Z --..
0 ----- 1 .---- 2 ..--- 3 ...-- 4 ....-
5 ..... 6 -.... 7 --... 8 ---.. 9 ----.
, --..-- (comma)
: ---... (colon)
/ -..-. (slash)
The MAL Virtual Machine provides:
- 5 general-purpose registers (AX, BX, CX, DX) + SP, IP
- 1024 cells of memory
- Stack
- CPU flags (Zero, Sign, Carry)
- Label resolution for jumps
I hate my life that's why
Feel free to use, modify, and share! Nobody gonna use this anyway
Found a bug? Probably yes