MinISCule

MinISCule is an esoteric programming language created by Jeffry Johnston in 2006, with the goal of having a very small interpreter for a Turing-complete language. The interpreter is in MS-DOS COM binary format and is 36 bytes in size. It was written using DEBUG, so the source listing is made from a program disassembly.

The language is an OISC variant, with instruction pointer (IP) and memory pointer (MP). Instructions take the form aaaavvjjjj, where `a' is address, `v' is value, and `j' is jump. Programs are read from stdin, and are separated from their input by a single CR character (0D hex/13 dec).

To maintain an ASCII input source, input characters are decreased by 78. This means that the space character represents the value -46, the uppercase N = 0, and tilde (~)= +48. Use of characters outside this range is accepted, but discouraged.

An instruction is processed as follows:


 * 1) MP += address (LSB then MSB)
 * 2) If value == 0 then perform an MS-DOS system call:
 * 3) Sets registers: AX = address, DL = byte at MP
 * 4) Executes the INT 21h system call (exit: AX = 00xx, read stdin: AX = 01xx, write stdout: AX = 02xx.  See Ralf Brown's Interrupt List for more)
 * 5) byte at MP += value (or AL return value from a system call)
 * 6) IP += 5
 * 7) If byte at MP != 0 then IP += jump (LSB then MSB)

Note that IP is interpreted using byte offsets, not in terms of 5-byte instructions, so to skip an instruction, use jump = 5, not jump = 1. Setting jump = 0 results in execution always being passed to the next instruction.

Examples
NNNNN
 * Simply exit

NPONNNNMIMNN~NNNN_NNNLONNNNMNNNPNNNNNNNN
 * Print the character `A' and exit

External resources

 * MinISCule interpreter binary (MS-DOS)
 * MinISCule interpreter source listing
 * Bootable FreeDOS disk image, with MinISCule, Barely, FreeDOS Debug