2 - three storage regions
3 - memory with 15-bit address space storing 16-bit values
5 - an unbounded stack which holds individual 16-bit values
6 - all numbers are unsigned integers 0..32767 (15-bit)
7 - all math is modulo 32768; 32758 + 15 => 5
10 - each number is stored as a 16-bit little-endian pair (low byte, high byte)
11 - numbers 0..32767 mean a literal value
12 - numbers 32768..32775 instead mean registers 0..7
13 - numbers 32776..65535 are invalid
14 - programs are loaded into memory starting at address 0
15 - address 0 is the first 16-bit value, address 1 is the second 16-bit value, etc
18 - After an operation is executed, the next instruction to read is immediately after the last argument of the current operation.
19 If a jump was performed, the next operation is instead the exact destination of the jump.
20 - Encountering a register as an operation argument should be taken as reading from the register or setting into the register as appropriate.
23 - Start with operations 0, 19, and 21.
24 - Here's a code for the challenge website: jTTockJlJiOC
25 - The program "9,32768,32769,4,19,32768" occupies six memory addresses and should:
26 - Store into register 0 the sum of 4 and the value contained in register 1.
27 - Output to the terminal the character with the ascii code contained in register 0.
31 stop execution and terminate the program
33 set register <a> to the value of <b>
35 push <a> onto the stack
37 remove the top element from the stack and write it into <a>; empty stack = error
39 set <a> to 1 if <b> is equal to <c>; set it to 0 otherwise
41 set <a> to 1 if <b> is greater than <c>; set it to 0 otherwise
45 if <a> is nonzero, jump to <b>
47 if <a> is zero, jump to <b>
49 assign into <a> the sum of <b> and <c> (modulo 32768)
51 store into <a> the product of <b> and <c> (modulo 32768)
53 store into <a> the remainder of <b> divided by <c>
55 stores into <a> the bitwise and of <b> and <c>
57 stores into <a> the bitwise or of <b> and <c>
59 stores 15-bit bitwise inverse of <b> in <a>
61 read memory at address <b> and write it to <a>
63 write the value from <b> into memory at address <a>
65 write the address of the next instruction to the stack and jump to <a>
67 remove the top element from the stack and jump to it; empty stack = halt
69 write the character represented by ascii code <a> to the terminal
71 read a character from the terminal and write its ascii code to <a>; it can be assumed that once input starts, it will continue until a newline is encountered; this means that you can safely read whole lines from the keyboard and trust that they will be fully read