Forget Me Not

From Esolang
Jump to navigation Jump to search

Forget Me Not is a programming language by User:PixelatedStarfish which is influenced by INTERCAL. The instruction pointer will forget what it was trying to do and start over (or go to the last label). When it forgets, it will replace the instruction it was executing with a randomly generated instruction (in RAM, this is not a self-modifying language). The only way to prevent forgetfulness is to include regular comments that remind the instruction pointer of what to do. For optimal usability, comments should appear in at least one of every 5 lines and no more than one of every 3 lines. If there are not enough comments, the pointer forgets. If there are too many, the pointer feels patronized and refuses to execute the code.

The language is stack based and has a syntax similar to an assembly language. Each instruction gets a line to itself, with arguments separated by a space. A value on the stack can be in the range of 0 to 255 inclusive.

Instructions

Command Args Desc.
PUSH VALUE Push value on to stack.
ADD VALUE Add VALUE to value at top of stack.
SUB VALUE Subtract VALUE from value at top of stack.
SWAP POSITION Swap the value at the top with the value at the specified position in the stack.
LBL IDENTIFIER A Label.
GOTO IDENTIFIER Go to identified label.
CBZ IDENTIFIER Go to label if value on stack is zero.
CBNZ IDENTIFIER Go to label if value on stack is not zero.
CBE IDENTIFIER Go to label if stack is empty.
CBNE IDENTIFIER Go to label if stack is not empty.
POP None Pop value off of stack.
CHAR None Print top value as ASCII char.
VAL None Print top value as value.
DUP None Duplicate value at top of stack and push.
SHFL None Shuffle stack.
INP None Take input as an integer value.
GOBL / RET / GOBLINS / RETURN None Goblins. Go to last GOTO and execute the next line.
R None Reverse the stack.
Q None This is the quine instruction, which prints itself.
NOTE / CMT None A note or comment.
START None Indicates where the program starts. This is optional, but it can be useful for programs that do not start on the first line.
HLT / END None End program.