Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
262 lines (252 sloc) 4.62 KB
-- HUMAN RESOURCE MACHINE PROGRAM --
-- 20-Multiplication-Workshop - SIZE 185/15 - SPEED 49/109 --
-- This solution is level-specific (patterned and quantity-limited input).
-- It assumes 5 pairs of numbers (0-9) of which the 2nd
-- and 3rd pair contain a zero and that the others do not. It uses
-- the same branching structure as solutions such as
-- 208.52.specific-mschordan.asm to determine the multiplier.
BUMPUP 9
BUMPUP 9
ADD 9
COPYTO 4
INBOX
COPYTO 0
INBOX
SUB 4
JUMPN g
JUMPZ e
SUB 9
JUMPN d
JUMPZ c
SUB 9
JUMPN b
JUMPZ a
COPYFROM 0
ADD 0
ADD 0
COPYTO 0
JUMP l
a:
ADD 0
ADD 0
COPYTO 0
ADD 0
JUMP k
b:
COPYFROM 0
ADD 0
ADD 0
COPYTO 2
ADD 2
JUMP m
c:
ADD 0
ADD 0
COPYTO 0
JUMP j
d:
COPYFROM 0
e:
ADD 0
ADD 0
JUMP i
f:
COPYFROM 0
JUMP n
g:
ADD 9
JUMPN f
JUMPZ h
COPYFROM 0
h:
i:
j:
k:
l:
ADD 0
m:
ADD 0
n:
OUTBOX
INBOX
SUB 4
JUMPN u
JUMPZ s
SUB 9
JUMPN r
JUMPZ q
SUB 9
JUMPN p
JUMPZ o
INBOX
COPYTO 0
ADD 0
ADD 0
COPYTO 0
ADD 0
JUMP ac
o:
INBOX
COPYTO 0
ADD 0
COPYTO 0
ADD 0
ADD 0
JUMP ab
p:
INBOX
COPYTO 0
ADD 0
ADD 0
COPYTO 2
ADD 2
JUMP aa
q:
INBOX
COPYTO 0
ADD 0
COPYTO 0
ADD 0
JUMP z
r:
INBOX
COPYTO 0
ADD 0
ADD 0
ADD 0
JUMP y
s:
INBOX
COPYTO 0
ADD 0
ADD 0
JUMP x
t:
INBOX
JUMP ad
u:
ADD 9
JUMPN t
JUMPZ v
INBOX
COPYTO 0
ADD 0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Wfqi2T7armz2YYBaNgFAxqAAC1uCgH;
DEFINE LABEL 4
eJzjYWBg+Bo52fdr5KOImPC2zr9hj+eeiHs8tzvTegZQiuFRTmYse7Ze/4qsiCPdmXX3GbCAr6nuxT+r
OUrutYbUiHXeagjqutcs0L2mN6jLeoZ0u/eShNaA5Vtrb60TKVLaIpOvtj0z6/MBbOaMglEwCugPAB3S
Lug;
DEFINE LABEL 9
eJwTZGBgaAy9VGUflpC3Oep9IlPiwXCVnJiQ/7mPIv7nhqQ253CUeGbNbgxMD5jgkiC4Qig6cbNNcsiq
DemCKxxzBVdsLfyznoFMIFJkPSO5om6Wc0vMTBD/SH9daNXko4Vbpq7oCp3K27e8r78ioHtNvHGXZNCV
zr22k7rMLI/0exu+m95n/GzWZ7Nf8xQdxRecdBNfMNnXZl5XnMasnRkG0/9kMc15XvRoeVUDyMyK7d8D
/mxlibLbWpp2f8vRQrutK7oqtlvPeLM7ZNWTfbIbPx712d10+vl26XNNW0Iv3Fp38aLgCt/LB+dwXznZ
veby3qaii0cLq84JJr88YR28/tg1f8YDhT6r9lzzr9j+KALshxc714Lo52/sc+0+mFnafXiu2/Bey+D5
m5Nufq/sc8Oem9V9f8bQClKz98nOtTOeTV8z4eWf9Zde+OwWedG/9/uz3D2Wzzh2Wj5r2hL23H5T2HOO
neSG5ygYBeQAAOyurOA;
You can’t perform that action at this time.