esolang

0815

Three registers, a queue and labels, and it only speaks hexadecimal.

Paulo Jorente, 2013 · Turing complete: yes · ●●● hard · esolangs.org

Tested with 4 known programs · Test method

Run it

Expected: Hello, World!

The idea

Paulo Jorente designed and implemented 0815 between December 2012 and January 2013. It has three signed 64-bit registers. X can only be written and Z can only be read, so every value travels by rolling the three registers round. Results land in Z, and so do the values that jumps test and output prints. Every number in the source, the input and the output is hexadecimal.

The machine

CodeDoes
<:3c:Move 3c into X
xSwap X and Y
~ =Roll the registers left or right
+ - * /Z = X op Y; / puts the remainder in Y
}:loop:A label
^:loop: #:loop:Jump if Z is not 0, or if it is 0
\| !Read a hexadecimal number or a character into X
% $Print Z as a hexadecimal number or a character
> { ?Enqueue Z, dequeue into X, clear the queue
@ &Roll the queue left or right

Anything else is a comment. A jump to a label that does not exist ends the program.

Example

The Hello, World! adds ffffffffffffffbd, which is minus 67 in 64 bits, to get from o down to ,.
Expected: 0

The Hello, World! adds ffffffffffffffbd, which is minus 67 in 64 bits, to get from o down to ,. The truth machine reads a number, rolls it into Z and prints it while it is not 0.

Further

Ideas it shows

Queue-based

Write your own in Run Convert a program from 0815

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: 0815.

Command line

shib run 0815 -e '|~}:i:%^:i:' --input '0'
shib manual 0815

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/0815.js

Docs: Kernel instructions · The .shib format · Command line · Adding a language

Source esolangs.org (CC0) · Edit on esolangs.org