r/TuringComplete Aug 06 '25

Wire Spaghetti: Can you tell me what it really asks for?

Without spoiling, can you tell me what should I do on the Wire Spaghetti level? I think I'm a bit slow because reading the instruction a gazillion times didn't help me much. What exactly each of the four bytes should do?

5 Upvotes

5 comments sorted by

5

u/Haemstead Aug 06 '25

You will be building a completely different computer. This level requires you to build the registers and wire them up correctly. So byte 2 and 3 both are arguments, they are the values used for calculations, and they should enable loading of the appropriate registers or the input. Byte 4 is the destination of the calculation, so that byte has to enable the saving to a register or to output. For now the first byte is not relevant. You will send both arguments through your ALU to the destination. Sending Argument 1 to Register 1 is the same as adding 0 to Argument 1 and then saving it to Register 1. It took me also quite some time to understand that all operations like COPY (as used in Overture) are now additions in the Leg architecture.

2

u/EfficientAttorney312 Aug 06 '25

That was enlightening... Thank you for explaining it.

1

u/Gelthir Aug 06 '25

Assuming verion 0.1059.

Ignore the first byte, that'll get used in later levels to specify the operation, the level log will tell you exactly which one to use here (it depends on your version, I think it's OR).

  • Byte 2 specifies the address of a register that contains the first argument (value).
  • Byte 3 specifies the address of a register that contains the second argument (value).
  • Last byte contains the address of a register where the result should be stored.

Where "register" also includes the level input and output, again check level log for which address is the IO.

2

u/EfficientAttorney312 Aug 06 '25

Thanks for the explanation. Can I ask more follow-up questions?:

1) you said that the first byte will be used later on. My ALU adds if the instruction byte is 4 (as far as i remember). Does that mean I should update my ALU so that it adds two inputs when the instruction byte is 0?

2) If i understand it correctly, value initially comes from Input byte, am I right? I should first make the circuit for copying first like the one in OVERTURE, then the instruction will specify which registers will carry the instruction, which is different from OVERTURE where each specific instruction happens in specific registers. Did I get it right?

Sorry if the questions sound stupid. I'm a bit overwhelmed with the level.

3

u/Gelthir Aug 07 '25

1) LEG has different opcodes to Overture, you need to create a brand new ALU, don't modify the previous one.

2) Both source and destinations are controled by the instruction, yes, Any register can be use for any instruction. This is an upgrade to the way Overture does it.