Syscall 2: Firmware, home

SignalChapter 2: Workshop

10SWITCHBOARD

The task

You are the operator. Each locked caller sends two values and waits for their sum.

Callers do not take turns, so stay on the line with the caller you picked.

The board

The board of SWITCHBOARD3 cores: c0, op, and c2. Locked: c0 and c2. Inputs X and Y; outputs P and Q.c0LOCKEDIN P0OUT P1IN P0OUT P1IN P1OUT P2opSC-2 15 LINESc2LOCKEDIN P0OUT P1IN P0OUT P1IN P1OUT P2P0P1P2P0P1P0P1P2XYPQ
The board as the puzzle screen lays it out. Cyan pins read, lemon pins write, violet pins go both ways. On a narrow screen, scroll the board sideways to see all of it.

Key idea

ANY and LAST: serve whoever calls, then stay on that line.

Hints

Each hint goes a step further than the one before. Open them one at a time.

Hint 1Show

IN ANY reads from whichever caller has a value waiting.

Hint 2Show

LAST is the pin ANY used. IN LAST reads the second value from the same caller.

Hint 3Show

OUT LAST sends the sum back to that caller.

Solution

Reveal the Full SolutionThe complete program for SWITCHBOARD. Open it only when you want the answer.

The reference program

The game's own solution. It passes every test and scores exactly par on every benchmark.

opSC-2 standard

IN ANY
MOV B, A
IN LAST
ADD B
OUT LAST
CYCLES
126
at par
ENERGY
380
at par
NODES
1
at par
INSTRUCTIONS
5
at par

Another way: Reply any

A second program that also passes, and matches par on every benchmark.

Under TIS-100 rules an ANY reply also reaches the right caller here: only the caller being served is reading, so it is the first reader. LAST is needed for the pair.

opSC-2 standard

IN ANY
MOV B, A
IN LAST
ADD B
OUT ANY
CYCLES
126
at par
ENERGY
380
at par
NODES
1
at par
INSTRUCTIONS
5
at par