Esomachine
Esomachine is a cell-based esolang that has an accumulator and it's based on the game Human Resource Machine.
Memory
Memory is an infinite tape but every cell is locked which means they can't be modified, to modify a cell you need to unlock it first.
Syntax
The syntax of a command is very simple, they are like this:
<instruction>[<parameter>,<parameter 2>](linebreak)
- In <instruction> you put the instruction
- In <parameter> you put the parameter that the instruction uses
- If the instruction uses two parameters, you put the comma and in <parameter 2> you put the second parameter
- (linebreak) means that you need to put a line break
Example
hi[34]
Comments
The syntax of a comment is
\<comment>
- In <comment> you put the comment
Commands
Instruction | Parameter/s | Does |
---|---|---|
INDEX_STATE | <0 or 1> <number> | Sets the cell specified by the second parameter to locked or unlocked
|
INDEX_SET | <number> <address> | Sets the cell specified by the parameter one to the parameter two |
HANDS_CONLANG | <+ or - or / or *> <number> | Does an operation specified by the first parameter, using the accumulator as the left operand and the second parameter as the right operand |
HANDS_JUMP | <NEGATIVE/POSITIVE/ZERO/DONTCARE> <number> | Jumps to a line of code specified by the second parameter, the first parameter is the jump type which are:
|
HANDS_EXPECT | Gets a character input and stores its ASCII code into the accumulator | |
OUTPUT | <number> | Outputs the ASCII character associated with the value of the cell specified by the first parameter |
Using hand
When a parameter uses a number or an address you can put HANDS
instead of a number or an address, that means that instead of using a number or an adress it will use the value that is holding the accumulator.
Using indirect addressing
When a parameter uses a number or an address you can surround it with brackets, now that means that instead of using the number, it will use the value of the cell specified by that number in brackets.
Examples
Truth-machine
HANDS_EXPECT[] \line 1 INDEX_STATE[1, 1] \line 2 INDEX_SET[1, HANDS] \line 3 HANDS_CONLANG[-, 48] \ The ascii value of 0 \line 4 HANDS_JUMP[ZERO, 8] \line 5 OUTPUT[1] \line 6 HANDS_JUMP[DONTCARE, 6] \line 7 OUTPUT[1] \line 8
Cat program
An infinitely repeating cat program constitutes the following:
HANDS_EXPECT[] INDEX_STATE[1, 1] INDEX_SET[1, HANDS] OUTPUT[1] HANDS_JUMP[POSITIVE, 1]
Interpreter
- Common Lisp implementation of the Esomachine programming language.