⛔ [DEPRECATED] Will be moved to at https://github.com/yamini-vm/moasm.git soon.
MoASM is an esoteric low-level assembly like language in which the instructions are written in morse code.
Before installing MoASM, make sure you have python3 (>= 3.6) and pip3 installed.
- Install MoASM:
user@programmer~:$ pip install git+https://github.com/frankhart2018/moasm.git
- Run MoASM script:
Once you have written your instructions in a .moasm file, you can run it by running the following command:
user@programmer~:$ moasm -i <.moasm file>
The entire language consists of only three symbols:
.
: The dot symbol.-
: The dash symbol.~
: The space symbol.
Here is the list of morse code symbols:
Symbol | Letter |
---|---|
.- | 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 |
.---- | 1 |
..--- | 2 |
...-- | 3 |
....- | 4 |
..... | 5 |
-.... | 6 |
--... | 7 |
---.. | 8 |
----. | 9 |
----- | 0 |
..-.. | % |
-.-.. | $ |
These are the keywords in MoASM:
SHOW
: Prints the value (string, number, or identifier) to STDOUT. If used without any parameters, it prints the last value in constant stack. (SHOW HELLO WORLD
)ADD
: Adds the values and prints it out. (ADD 1 2
)SUB
: Subtracts the values and prints it out. (SUB 1 2
)MUL
: Multiplies the values and prints it out. (MUL 1 2
)DIV
: Divides the values and prints it out. (DIV 1 2
)MOD
: Computes modulo of values and prints it out. (MOD 1 2
)PUSH
: Pushes the value to the constant stack. (PUSH 2
)POP
: Pops the value from the constant stack and pushes into a variable. (POP %ABC
, all variables in MoASM have to start with%
)JZ
: Jumps to the specified label if and only if the value on top of stack is zero. (JZ $END
, all labels in MoASM have to start with$
)JMP
: Jumps to the specified label. (JMP $END
)
Here is a sample hello world program in MoASM:
... .... --- .-- ~ .... . .-.. .-.. --- ~ .-- --- .-. .-.. -..
This translates to:
SHOW HELLO WORLD