Colambda

Colambda is an esoteric programming language designed by User:Zzo38 in 2010 as a sort of coprocessor for Unlambda programming. When Colambda must be loaded, it must be a program file containing one or more Unlambda programs which can be numbered, and one or more files of arbitrary data, which can be numbered. One main Unlambda file is numbered zero, and is the file when starting the program. You can run multiple threads, and there is a storage of INTERCAL registers shared with all threads. Each thread of Unlambda codes has its own memory and input/output.

The Unlambda program must send commands as output, which are processed by Colambda, and receives input for the results of commands.

These are commands that can be used:
 * 0 - output bit zero
 * 1 - output bit one
 * ? - receive character of input as eight bits 0 and 1 (or . if EOF)
 * ~dxy - read x and y and use select operator, stored in d
 * $dxy - read x and y and use interleave operator, stored in d
 * ?d - read d and use unary XOR, stored in d
 * &amp;d - read d and use unary AND, stored in d
 * Vd - read d and use unary OR, stored in d
 * N</tt>dxy - read x and y and use NAND operator, stored in d
 * _</tt>dx - read x and store in d
 * *</tt>x - receive value of x
 * S</tt>d - stash x
 * R</tt>d - retrieve x
 * i</tt>d - ignore x
 * r</tt>d - remember x
 * o</tt>x - send x to output
 * y</tt>dx - get binary data from stream x and store in array d, first reallocating array to correct size (data stored 8 bits in each cell)
 * Y</tt>dx - same as above but as many bits as possible in each cell of the array
 * +</tt> - increment value of register :1
 * -</tt> - decrement value of register :1
 * B</tt>x - get binary data from stream x send to Unlambda program as 0 and 1
 * b</tt>x - get binary data from stream x send to Unlambda program as bytes characters
 * a</tt>d - reallocate an array, using values of .1 .2 .3 for number of elements each dimension, if one of these is zero, that is the end of the dimensions
 * =</tt>dx - create subprogram thread of program numbered x, and store the subprogram thread ID number in d
 * <tt>!</tt>x - switch to subprogram x
 * <tt>M</tt>x - make Colambda execute commands from characters of byte stream x, until stream is end
 * <tt>m</tt>x - send characters of stream x to output

Source/destination operands can use a character followed by the 0 and 1 for sixteen bits:
 * <tt>#</tt> - literal number value
 * <tt>.</tt> - 16-bit register
 * <tt>:</tt> - 32-bit register
 * <tt>,</tt> - 16-bit array (uses .1 .2 and so on for subscript numbers)
 * <tt>;</tt> - 32-bit array (uses .1 .2 and so on for subscript numbers)
 * <tt>/</tt> - same as previous operand (no bits)
 * <tt>P</tt> - number of thread switched out of (no bits)
 * <tt>p</tt> - number of current thread (no bits)

As well as 0 and 1 for bits, you can also use these abbreviations:
 * <tt>q</tt> - 0000
 * <tt>Q</tt> - 00000000
 * <tt>k</tt> - 1111
 * <tt>K</tt> - 11111111
 * <tt>d</tt> - 00000001
 * <tt>j</tt> - 100