Skip to content

Comment on Designing Zachtronics' TIS-100parent

Comments

JRO UP? As in pulling in a value from the up port. I didn't see how that gives me a whole lot since wouldn't I need to know in the other node what the offset would be? I considered that this would be valid, but I couldn't see a way to make it really useful.

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.