WORM Solution
MIXER
WORM row 10

Prerequisites
Unlocks
w47 solved
Active cores0, 1, 2, 3, 6, 7
Program lines29
DetailWORM row 10
Walkthrough
MIXER: OUT = A * B (A,B in 0..31) by repeated addition.
Chain: counter(core1) -> shipper(core0) -> summer(core4) -> out(core8).
core1 (counter): reads B; sends a "1" tick per unit LEFT to the shipper,
then a "4" (the shipper's emit selector).
core0 (shipper): holds A in ACC; JRX RIGHT reads the counter token:
1 -> forward control "1" then A DOWN to the summer; 4 -> forward "3"
(emit) DOWN and reread the next A.
core4 (summer): sum in ACC; JRX UP reads the forwarded control: # 1 -> ADD UP (the A just sent), 3 -> emit the sum DOWN and reset.
core8: relays the result DOWN to output stream 0.
Rack Solution
# MIXER: OUT = A * B (A,B in 0..31) by repeated addition.
# Chain: counter(core1) -> shipper(core0) -> summer(core4) -> out(core8).
# core1 (counter): reads B; sends a "1" tick per unit LEFT to the shipper,
# then a "4" (the shipper's emit selector).
# core0 (shipper): holds A in ACC; JRX RIGHT reads the counter token:
# 1 -> forward control "1" then A DOWN to the summer; 4 -> forward "3"
# (emit) DOWN and reread the next A.
# core4 (summer): sum in ACC; JRX UP reads the forwarded control: # 1 -> ADD UP (the A just sent), 3 -> emit the sum DOWN and reset.
# core8: relays the result DOWN to output stream 0.
@1
L: MOV ACC, RIGHT
Z: JZ E
SUB 1
MOV LEFT, 1
JMP Z
E: MOV LEFT, 4
JMP L
@0
L: MOV ACC, UP
C: JRX RIGHT
MOV DOWN, 1
MOV DOWN, ACC
JMP C
MOV DOWN, 3
JMP L
@3
L: MOV ACC, 0
C: JRX UP
ADD UP
JMP C
E: MOV DOWN, ACC
JMP L
@6
MOV RIGHT, UP
@2
MOV LEFT, UP
@7
MOV DOWN, LEFT