Skip to content

“TIS-100” – SIGNAL COMPARATOR (SEGMENT 21340)

TIS-100 index

Solution for the UNCONDITIONAL achievement of not using any conditional jump instructions:

full solution

The trick in my solution was to use the JRO instruction instead of a comparison. The key detail that makes this possible is that all of the inputs fall in the range [-2, 2], so we can add 3 to the input to move the range to [1, 5] and use that as an index into a jump table, as can be seen in the main code blocks below:

main code segment

The left unit is supposed to output 1 if the input is positive (so, 4 or 5 after the addition) and 0 otherwise (1, 2, or 3). So after the JRO, indexes 1 through 3 jump to a spot that outputs 0 and returns to the start, and indexes 4 and 5 jump to a spot that outputs 1.

The other two units work the same way.