CA65 NES issue with INY STY

137 views Asked by At

I am new to CA65 and am trying to transfer a NESASM project over to it. I translated everything and it builds. When I run I get nothing. Just a black screen. Diving deeper I have an infinite loop. It seems to be having an issue with increasing the Y (INY) and then whatever I set after it doesn't take. enter image description here

You can see that after INY at 8505 Y becomes 1. Setting the variable I have at $84A8 to Y should change it to $01 but it doesn't. Because of this, I enter an infinite loop. Am I doing something wrong here? It has been a bit since I have programmed assembly but this seems pretty easy.

Let me know if I am doing something wrong or you need more information.

1

There are 1 answers

0
Omar and Lorraine On

You need to make sure that your variables are in writable memory.

The NES normally has 2KB of RAM, so you're better off using addresses below $0800.

Because you're writing to $84a8, you're not actually saving the register to any memory because that address is mapped to ROM. So that location will not actually change.