Dontmove: an archival MOV machine

XXX not fully tested yet

Archival preservation of digital documents over centuries faces the difficulty of damaging data as we move it from one format to another repeatedly. Dontmove is a solution to this problem.

Dontmove is a virtual machine inspired by an esoteric programming language with the unfortunate name of Brainfuck, with 4 instructions, rather than Brainfuck's 8, inspired by MOV machines and Lorie's UVC archival virtual machine. It is intended to be a practical target for compilation that is nevertheless implementable in a few minutes even in a low-level language.

Unlike Brainfuck, Dontmove can accommodate subroutines and multithreading, and a naïve Dontmove implementation will run thousands of times faster than a naïve Brainfuck implementation, despite being a similarly small amount of code.

Dontmove has a 32-bit accumulator and 1048576 32-bit words of word-addressed data memory, of which four or five are special; they are dedicated to memory-mapped I/O. The first 26 words can be addressed directly by instructions. All of this memory is initially zero.

The four instructions are:

The special memory locations are:

Bytes in the program other than letters, digits, and < are passed over as no-ops.

Attempting to execute outside the program text ends the program.

So a simple program is "104aF105aF10a", which outputs "hi\n". The "1", "0", and "4", starting from an empty accumulator, build up the number 104, the ASCII code for "h"; and then "a" writes that code out to the output. Then "F" fetches the value of memory location 5, which is 0, since we haven't written anything to it yet, and similarly we build up 105, "i", and output it.

A simple loop is "AaGe", which copies input to output: "A" reads a byte from input, "a" writes it to output, "G" loads a zero into the accumulator from register G, and "e" jumps to the location in the accumulator, namely 0, the beginning of the program.

To increment register F by the number in register H, we can write "BbFbHbBbbBf", which zeroes B, subtracts F from it, subtracts H from it, negates the result, and stores it back into F.

To jump by a particular number of bytes, it is necessary to use this same approach to increment the E register.