MM1char

From Esolang
Jump to navigation Jump to search

MM1char is description of 2-register Minsky machine with instructions: INC, DEC, JZ. It's goal is same as for StackBit: to be easily implementable.

Syntax

+ - increment register 1
- - decrement register 1
* - increment register 2
/ - decrement register 2
[abc] - declare label abc
(abc) - goto label abc
~ - if register 1 is zero skip next command
` - if register 2 is zero skip next command

Examples

Countdown

This program sets the value of the register 1 to five, ere it decrements it to zero.

+++++
[decrement_register]
-
~
(decrement_register)

Register value transfer

This program sets the value of the register 1 to ten and moves the content to register 2, resetting register 1 to zero in the process:

++++++++++
[transfer_register_values]
-
*
~
(transfer_register_values)

Interpreter

  • Common Lisp implementation of the MM1char programming language.