WORM Solution
CHECKSUM
WORM row 8

Prerequisites
Unlocks
w36 solved
Active cores1, 2, 4, 5, 7
Program lines26
DetailWORM row 8
Walkthrough
w36 CHECKSUM: frames of 5; emit the 5 values then (sum mod 100).
Emit path is col 0: core 0 -> core 4 -> core 8 (output stream 0).
core 0 reads input UP, fans RIGHT (summer core1) first then DOWN (core4):
feeding the sum path first overlaps the reduce with the pass-through.
PC wraps from the last line, so the loop needs no JMP.
core 1 sums 5 from LEFT, reduces mod 100 (tight SUB;JG loop), DOWN to core 5.
core 5 relays the checksum UP->LEFT into core 4.
core 4 emits 5 from UP then the checksum from RIGHT, all DOWN to core 8.
Rack Solution
# w36 CHECKSUM: frames of 5; emit the 5 values then (sum mod 100).
# Emit path is col 0: core 0 -> core 4 -> core 8 (output stream 0).
# core 0 reads input UP, fans RIGHT (summer core1) first then DOWN (core4):
# feeding the sum path first overlaps the reduce with the pass-through.
# PC wraps from the last line, so the loop needs no JMP.
# core 1 sums 5 from LEFT, reduces mod 100 (tight SUB;JG loop), DOWN to core 5.
# core 5 relays the checksum UP->LEFT into core 4.
# core 4 emits 5 from UP then the checksum from RIGHT, all DOWN to core 8.
@1
MOV ACC, UP
MOV RIGHT, ACC
MOV DOWN, ACC
@2
MOV ACC, LEFT
ADD LEFT
ADD LEFT
ADD LEFT
ADD LEFT
M: SUB 100
JG M
JZ E
ADD 100
E: MOV DOWN, ACC
@5
MOV LEFT, UP
@4
MOV DOWN, UP
MOV DOWN, UP
MOV DOWN, UP
MOV DOWN, UP
MOV DOWN, UP
MOV DOWN, RIGHT
@7
MOV DOWN, UP