WORM Solution
TENS AND UNITS
WORM row 10

Prerequisites
Unlocks
w52 solved
Active cores0, 1, 3, 4, 6, 7, 8
Program lines21
DetailWORM row 10
Walkthrough
TENS AND UNITS: OUT-left (core 6) = IN / 10, OUT-right (core 7) = IN mod 10.
Decimal split of one input by DIV and MOD. core 0 reads IN (UP) once and fans
it two ways: DOWN to core 3 (quotient path) and RIGHT to core 1 (remainder
path). core 3 takes DIV 10 and sends the quotient DOWN to core 6 (output 0).
core 1 relays the copy DOWN to core 4; core 4 takes MOD 10 and sends the
remainder DOWN to core 7 (output 1).
Rack Solution
# TENS AND UNITS: OUT-left (core 6) = IN / 10, OUT-right (core 7) = IN mod 10.
# Decimal split of one input by DIV and MOD. core 0 reads IN (UP) once and fans
# it two ways: DOWN to core 3 (quotient path) and RIGHT to core 1 (remainder
# path). core 3 takes DIV 10 and sends the quotient DOWN to core 6 (output 0).
# core 1 relays the copy DOWN to core 4; core 4 takes MOD 10 and sends the
# remainder DOWN to core 7 (output 1).
@0
MOV ACC, RIGHT
MOV DOWN, ACC
MOV RIGHT, ACC
@3
MOV ACC, UP
DIV 10
MOV DOWN, ACC
@6
MOV DOWN, UP
@1
MOV LEFT, UP
MOV DOWN, LEFT
@4
MOV ACC, UP
MOD 10
MOV DOWN, ACC
@7
MOV RIGHT, UP
@8
MOV DOWN, LEFT