【程序员升职记系列】计时器

第19关,计时器。指令介绍请看:https://www.annhe.net/article-3828.html

优化目标

优化目标:10行82步

代码

14行79步

JUMP     next
next0:
OUTBOX
 
next:
INBOX
JUMPZ    next0
COPYTO   0
JUMPN    neg
 
pos:
OUTBOX
BUMPDN   0
JUMPZ    next0
JUMP     pos
 
neg:
OUTBOX
BUMPUP   0
JUMPZ    next0
JUMP     neg

10行107步

next:
INBOX
COPYTO   0
JUMP     out
 
neg:
BUMPUP   0
 
out:
OUTBOX
 
timer:
COPYFROM 0
JUMPN    neg
JUMPZ    next
 
pos:
BUMPDN   0
JUMP     out

One thought on “【程序员升职记系列】计时器

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注