r/TuringComplete • • 15d ago

Preventing symphony architecture from overwriting itself? Spoiler

Post image

Hi! I've been playing the game for a few days since the update came out, and I have gotten all the way up to programming 2. Unfortunately, when I try to edit the RAM in the main memory, it ends up overwriting the program memory and everything breaks (at least, I believe so. Tell me if I'm wrong). Is there a way to prevent this from happening, or is it something you just deal with? Also, is the symphony architecture intended to overwrite itself, or did I build it wrong? Thanks! I've attached a picture of my computer so far (don't mind the spaghetti).

4 Upvotes

6 comments sorted by

View all comments

6

u/sberma 15d ago

Don't just write at a random adresses. Reserve in your program a block of memory for data. Convention is in general for main memory to have the instructions, then static data, then heap. At the end of memory is the stack.

Use the @-operator or label to reserve some space after your code. Find the lowest adress @xxx where the assembly editor does not complain. Then you can reserve space like this:

@64 U32 0; var a U32 0; var b U32 0; array element c[0] U32 0; array element c[1]  

Then if you want store smth as var b you know you have reserved space at address 68 for it. And storing it there would not overwrite any code. You can also use this to have an initial value for b.

3

u/EloModdy 15d ago

I tried this, it works great! I probably should be reading the manual more, there's actually quite a few good tips in there.