Skip to content

Comment on Designing Zachtronics' TIS-100parent

Comments

It allows you to use another processor to do control flow based on an input, freeing up cpu time. For example, suppose you wanted to emit to DOWN:

   0 if LEFT is <= 0
   UP if LEFT is > 0
So you have two options
   S: MOV LEFT ACC
   JGE E
   MOV 0 DOWN
   MOV UP NIL
   JMP S
   E: MOV UP DOWN
Or you could do this:
   S: JRO LEFT
   MOV UP NIL
   MOV 0 DOWN
   JMP S
   MOV UP DOWN
And left would send 1 if its value is <= 0, or 4 if it's >0. In this case it only saves one cycle for the node under consideration, but it could be a good deal more if the conditional is more involved.
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.