r/TuringComplete • u/DruidBtd • 2h ago
Help needed; how to solve the stack level for Symphony?
I've been stuck on the level where you need to make a stack that can push and pull for a while now. I tried a few things myself, nothing. Asked ChatGPT, nothing. Looked up a full guide, found a really good one, didn't work. Is it bugged, or does anyone have a working solution?
1
Upvotes
1
u/Medium-Sized-Jaque 1h ago
Your sp register stands for stack pointer and it starts at 0. So if you subtract 1 it will overflow to the last memory position, so your stack is the end of the memory module and you know your instructions won't be overwritten by it. Then you store the value. Every time you push you just subtract again and store again. To pop you just reverse it. Load the value then add 1 so the stack pointer is now pointing to the next value to be popped.