The input program is a sequence of signed, 32-bit integers. Execution begins with the first integer;
that is, the program counter is initiallized to zero. The program is treated as a circular buffer, so
that reads and writes beyond its boundaries are wrapped around.
When an instruction is executed the value at the program counter is read and if outside of the range of [0-12] it is mapped into the range [1-12] the result of this operation is interpreted according to the following table:
0: Increment the program counter.
1: Add the value at the address specified by the value after the program counter to the value at the address specified by the value two after the program counter and store the result of the addition at the address specified by the value three after the program counter, and increment the program counter by 4.
2: Subtract from the value at the address specified by the value after the program counter the value at the address specified by the value two after the program counter and store the result of the subtraction at the address specified by the value three after the program counter, and increment the program counter by 4.
3: Store the value at the address specified by the value one after the program counter to the address specified by the value two after the program counter, and increment the program counter by 3.
4: Unconditionally set the program counter to the value after the program counter.
5: If the value at the address specified by the value one after the program counter is equal to the value at the address specified by the value two after the program counter, set the program counter to the value three after the program counter. Otherwise, increment the program counter by 4.
6: If the value at the address specified by the value one after the program counter is less than or equal to the value at the address specified by the value two after the program counter, set the program counter to the value three after the program counter. Otherwise, increment the program counter by 4.
7: If the value at the address specified by the value one after the program counter is greater than or equal to the value at the address specified by the value two after the program counter, set the program counter to the value three after the program counter. Otherwise, increment the program counter by 4.
8: Read in one character from standard input and store it at the address specified by the value after the program counter, and increment the program counter by 2. (In this non-interactive test environment this instruction will just block until the program is killed.)
9: Output the value at the address specified by the address after the program counter to standard output as a character, and increment the program counter by 2.
10: Unconditionally end the program.
11: Increase the size of the program space by a number of cells equal to the value at the address specified by the value after the program counter. If the increase is positive, the new cells swill be filled with zero values. If the increase is negative and its magnitude is greater than the current size of the program space, end the program.
12: Decrease the size of the program space by a number of cells equal to the value at the address specified by the value after the program counter. If the decrease is positive, magnitude is greater than the current size of the program space, end the program. If the decrease is negative the new cells swill be filled with zero values.
MicroEdcoluj
There is also available a more minimal dialect of Edjoluj. In this dialect, there are only six instructions, [0-5], and values falling outside this raqnge are wrapped onto [1-5]. The allowed instructions are the following:
0: Increment the program counter.
1: Subtract from the value at the address specified by the value after the program counter the value at the address specified by the value two after the program counter and store the result of the subtraction at the address specified by the value three after the program counter, and increment the program counter by 4.
2: If the value at the address specified by the value one after the program counter is less than or equal to the value at the address specified by the value two after the program counter, set the program counter to the value three after the program counter. Otherwise, increment the program counter by 4.
3: Read in one character from standard input and store it at the address specified by the value after the program counter, and increment the program counter by 2. (In this non-interactive test environment this instruction will just block until the program is killed.)
4: Output the value at the address specified by the address after the program counter to standard output as a character, and increment the program counter by 2.
5: Increase the size of the program space by a number of cells equal to the value at the address specified by the value after the program counter. If the increase is positive, the new cells swill be filled with zero values. If the increase is negative and its magnitude is greater than the current size of the program space, end the program.
Any program possible with standard Edcoluj should also be possible with MicroEdcoluj, just much more cumbersome.
Programs will be given ten seconds to run, after which they will be killed, without mercy.