第 23 关,最小的数。指令集请参考 https://www.annhe.net/article-3828.html。
优化目标
优化目标 13行75步
代码
13行71步
JUMP init
out:
COPYFROM 0
OUTBOX
init:
INBOX
COPYTO 0
JUMP main
switch:
ADD 0
COPYTO 0
main:
INBOX
JUMPZ out
SUB 0
JUMPN switch
JUMP main
13行73步
JUMP init
out:
COPYFROM 0
OUTBOX
init:
INBOX
COPYTO 0
main:
INBOX
JUMPZ out
SUB 0
JUMPN switch
JUMP main
switch:
ADD 0
COPYTO 0
JUMP main
第一次pass 14行87步
JUMP init
out:
COPYFROM 0
OUTBOX
init:
INBOX
COPYTO 0
main:
INBOX
JUMPZ out
COPYTO 1
COPYFROM 0
SUB 1
JUMPN main
COPYFROM 1
COPYTO 0
JUMP main
12行71步
-- HUMAN RESOURCE MACHINE PROGRAM --
JUMP b
a:
COPYFROM 0
OUTBOX
b:
INBOX
JUMP d
c:
ADD 0
d:
COPYTO 0
e:
INBOX
JUMPZ a
SUB 0
JUMPN c
JUMP e