Human Resource Machine/Year 38

Strategy
This problem is pretty straight-forward. Start by copying the 0 to two other boxes to count occurencies of 100 / 10. Grab the inbox and copy it to a third box. Now repeatedly substract 100 from that box and bump up the 100 counter box. If the substraction is negative, switch over to 10 substraction / up-bumping. Finally, put the required numbers into the outbox: a:   COPYFROM 9 COPYTO  0 COPYTO  1 INBOX COPYTO  2 b:   SUB      11 JUMPN   c    COPYTO   2 BUMPUP  0 COPYFROM 2 JUMP    b c:    ADD      11 d:   SUB      10 JUMPN   e    COPYTO   2 BUMPUP  1 COPYFROM 2 JUMP    d e:    COPYFROM 0 JUMPZ   h    OUTBOX COPYFROM 1 f:   OUTBOX g:   COPYFROM 2 OUTBOX JUMP    a h:    COPYFROM 1 JUMPZ   g    JUMP     f

Optimizing
The above program satisfies the size challenge but misses the mark on the speed challenge (Size 29, 209 Steps). An optimization on step size is to unroll the loops (b,d )like this: b:   SUB      11 JUMPN   c    COPYTO   2 BUMPUP  0 COPYFROM 2 SUB     11 JUMPN   c    COPYTO   2 BUMPUP  0 COPYFROM 2 JUMP    b

Doing this on both loops, one can get down to 196 steps. As further steps net less, this is not sufficient.

In order to meet the speed challenge, you can fully unroll the loop for each digit to avoid the COPYFROM commands, like so: b:   SUB      11 JUMPN   ba    COPYTO   2 SUB     11 JUMPN   bb    COPYTO   2 SUB     11 JUMPN   bc    COPYTO   2 SUB     11 JUMPN   bd    COPYTO   2 SUB     11 JUMPN   be    COPYTO   2 SUB     11 JUMPN   bf    COPYTO   2 SUB     11 JUMPN   bg    COPYTO   2 SUB     11 JUMPN   bh    COPYTO   2 SUB     11 JUMPN   bi    COPYTO   2 BUMPUP  0 bh: BUMPUP  0 bg: BUMPUP  0 bf: BUMPUP  0 be: BUMPUP  0 bd: BUMPUP  0 bc: BUMPUP  0 bb: BUMPUP  0 ba: BUMPUP  0 OUTBOX