4 ms·
The instruction set design really deserves praise: people who haven't done assembly before report picking it up without too much trouble, and it manages to fit
by strangecasts 11y ago
The instruction set design really deserves praise: people who haven't done assembly before report picking it up without too much trouble, and it manages to fit several opportunities for subtle tricks in the space of the 13 instructions.
The moment you realize that you can use JRO with a direction to control flow from another node, it feels like a genuine revelation while being immediately obvious and logical in hindsight.
- obstinate 11y agoWell I hadn't realized that. This. Changes. Everything.
- lfowles 11y agoThis is much more familiar than the assembly in 0x10c. I haven't tried JRO with ports yet! I just assumed it would be an illegal operation :) Real instruction sets are clouding my mind.
- chinpokomon 11y agoJRO 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.
- obstinate 11y agoIt 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.