+-----------+---------+---------------------------------------------------------------------------+ | | |<:2: will move '2' to register X | | move | < |(parameter is mandatory) | | | | | +-----------+---------+---------------------------------------------------------------------------+ | | |swaps register X and Y | | swap | x | | | | | | +-----------+---------+---------------------------------------------------------------------------+ | | |}:_loop: this creates a label called '_loop' | | label | } |(parameter is mandatory) | | | | | +-----------+---------+---------------------------------------------------------------------------+ | input | |inputs a signed 64 bit integer and stores it into X | | number | | |(hexadecimal base) | | | | | +-----------+---------+---------------------------------------------------------------------------+ | input | |inputs an ASCII char and stores it into X | | ASCII | ! | | | | | | +-----------+---------+---------------------------------------------------------------------------+ | print | |prints a signed 64 bit integer stored in Z | | number | % |(hexadecimal base) | | | | | +-----------+---------+---------------------------------------------------------------------------+ | print | |prints an ASCII char stored in Z | | ASCII | $ | | | | | | +-----------+---------+---------------------------------------------------------------------------+ | roll | |rolls all registers to the left: X <- Y <- Z | | registers | ~ |after roll: X = Y, Y = Z and Z = X | | left | | | +-----------+---------+---------------------------------------------------------------------------+ | roll | |rolls all registers to the right: X -> Y -> Z | | registers | = |after roll: X = Z, Y = X and Z = Y | | right | | | +-----------+---------+---------------------------------------------------------------------------+ | jump | |^:_loop: jumps to label _loop if Z is not 0 | | if not | ^ |(parameter is mandatory) | | zero | | | +-----------+---------+---------------------------------------------------------------------------+ | jump | |#:_loop: jumps to label _loop if Z is 0 | | if | # |(parameter is mandatory) | | zero | | | +-----------+---------+---------------------------------------------------------------------------+
+-----------+---------+---------------------------------------------------------------------------+ | | |clears the queue | | clear | ? | | | | | | +-----------+---------+---------------------------------------------------------------------------+ | | |enqueue the number stored in Z | | enqueue | > | | | | | | +-----------+---------+---------------------------------------------------------------------------+ | | |dequeue a number and stores it into X | | dequeue | { | | | | | | +-----------+---------+---------------------------------------------------------------------------+ | roll | |rolls the queue to the left: the first value becomes the last, the second | | queue | @ |will be first and so on. If no parameter is found, it will roll the queue | | left | |once, otherwise rolls it parameter times. e.g. @:a: rolls the queue ten | | | |times to the left. | +-----------+---------+---------------------------------------------------------------------------+ | roll | |the same as '@' just that the roll will go to the right: | | queue | & |the last will be the first, the first will be the second and so on. | | right | | | +-----------+---------+---------------------------------------------------------------------------+
+-----------+---------+---------------------------------------------------------------------------+ | | |Z = X + Y | | add | + | | | | | | +-----------+---------+---------------------------------------------------------------------------+ | | |Z = X - Y | | sub | - | | | | | | +-----------+---------+---------------------------------------------------------------------------+ | | |Z = X * Y | | multipl. | * | | | | | | +-----------+---------+---------------------------------------------------------------------------+ | | |Z = X / Y | | division | / |Y = rest | | | | | +-----------+---------+---------------------------------------------------------------------------+
I re-wrote my Brainfuck interpreter to run 0815 programs. This version just runs (interprets) 0815 programs.
Probably, I'll write another version that can interpret both languages, but for now, this will do.
There is another issue that I should mention: In this version, the Queue will only show its first 2070 items.
0815 Interpreter